Fix selettore macchina doppiatavola
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
<div class="input-group">
|
||||
<span class="input-group-text" id="basic-addon1"><i class="fa-solid fa-building"></i></span>
|
||||
<select class="form-select form-select-sm" @bind="@IdxMaccSel">
|
||||
<select class="form-select form-select-sm" value="@idxMaccSel" @onchange="OnSelectionChanged">
|
||||
@if (ListMacchine == null)
|
||||
{
|
||||
<option value="" disabled>No record found</option>
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data.DbModels;
|
||||
using MP.Data.Services;
|
||||
using MP_TAB3.Shared;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace MP_TAB3.Components
|
||||
{
|
||||
public partial class MachSel : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
TDataService.DataInvalidated -= TDataService_DataInvalidated;
|
||||
}
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
@@ -23,41 +16,18 @@ namespace MP_TAB3.Components
|
||||
[Parameter]
|
||||
public MappaStatoExplModel? RecMSE { get; set; } = null;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
#region Public Methods
|
||||
|
||||
protected string IdxMaccSel
|
||||
public void Dispose()
|
||||
{
|
||||
get => idxMaccSel;
|
||||
set
|
||||
{
|
||||
if (idxMaccSel != value)
|
||||
{
|
||||
idxMaccSel = value;
|
||||
MsgServ.UserPrefSet(idxMaccCurr, value);
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await E_MachSel.InvokeAsync(value);
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
}
|
||||
TDataService.DataInvalidated -= TDataService_DataInvalidated;
|
||||
}
|
||||
private string idxMaccSel { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
#endregion Public Methods
|
||||
|
||||
protected Dictionary<string, string>? ListMacchine { get; set; } = null;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
#region Protected Properties
|
||||
|
||||
protected string idxMaccCurr
|
||||
{
|
||||
@@ -71,18 +41,51 @@ namespace MP_TAB3.Components
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
protected string IdxMaccSel
|
||||
{
|
||||
get => idxMaccSel;
|
||||
set
|
||||
{
|
||||
if (idxMaccSel != value)
|
||||
{
|
||||
idxMaccSel = value;
|
||||
MsgServ.UserPrefSet(idxMaccCurr, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected Dictionary<string, string>? ListMacchine { get; set; } = null;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDataService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
//base.OnInitialized();
|
||||
firstInit = true;
|
||||
TDataService.DataInvalidated += TDataService_DataInvalidated;
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
TDataService.DataInvalidated += TDataService_DataInvalidated;
|
||||
try
|
||||
{
|
||||
// inizilamente riporto macchina corrente da MSE
|
||||
if (RecMSE == null)
|
||||
{
|
||||
IdxMaccSel = "";
|
||||
Log.Error("Impossibile selezionare: recMSE è nullo");
|
||||
Log.Error("Impossibile selezionare: recMSE � nullo");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -99,10 +102,41 @@ namespace MP_TAB3.Components
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private bool firstInit = true;
|
||||
|
||||
private bool isMulti = false;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string idxMaccSel { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task OnSelectionChanged(ChangeEventArgs e)
|
||||
{
|
||||
var newValue = e.Value?.ToString();
|
||||
if (newValue != idxMaccSel)
|
||||
{
|
||||
idxMaccSel = newValue;
|
||||
await E_MachSel.InvokeAsync(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ReloadSelector(bool doReload)
|
||||
{
|
||||
if (RecMSE != null)
|
||||
if (RecMSE != null && firstInit)
|
||||
{
|
||||
firstInit = false;
|
||||
// verifico se la macchina sia configurata tra le MSFD...
|
||||
if (SMServ.DictMacchMulti.ContainsKey(RecMSE.IdxMacchina))
|
||||
{
|
||||
@@ -110,7 +144,6 @@ namespace MP_TAB3.Components
|
||||
}
|
||||
if (isMulti)
|
||||
{
|
||||
|
||||
var listMulti = await TDataService.VMSFDGetAll(doReload);
|
||||
ListMacchine = listMulti
|
||||
.Where(x => x.IdxMacchina.Contains($"{RecMSE.IdxMacchina}#"))
|
||||
@@ -138,15 +171,6 @@ namespace MP_TAB3.Components
|
||||
await ReloadSelector(true);
|
||||
}
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TDataService { get; set; } = null!;
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool isMulti = false;
|
||||
|
||||
#endregion Private Fields
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2507.3108</Version>
|
||||
<Version>6.16.2509.817</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2507.3108</h4>
|
||||
<h4>Versione: 6.16.2509.817</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2507.3108
|
||||
6.16.2509.817
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2507.3108</version>
|
||||
<version>6.16.2509.817</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user