Soluzione problem TAB3 su refresh post controllo

This commit is contained in:
Samuele Locatelli
2025-03-13 14:50:20 +01:00
parent 16c2767c09
commit 8f8e1f1153
6 changed files with 82 additions and 6 deletions
+76 -2
View File
@@ -78,8 +78,30 @@ namespace MP_TAB3.Components
#endregion Protected Properties
private bool isMulti = false;
#region Protected Methods
/// <summary>
/// Restituisce il codice IdxMacchina dell'impianto PARENT (se multi) altrimenti la stessa macchina...
/// </summary>
protected string getIdxMaccParent()
{
string answ = IdxMaccSel;
// se fosse multi controllo
if (isMulti)
{
// verifico se SIA una tavola (ha char "#")
int iSharp = IdxMaccSel.IndexOf('#');
if (iSharp > 0)
{
// sistemo nome
answ = IdxMaccSel.Substring(0, iSharp);
}
}
return answ;
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
@@ -87,7 +109,7 @@ namespace MP_TAB3.Components
{
enableControlli = SMServ.GetConfBool("enableControlli");
IdxMaccSel = RecMSE.IdxMacchina;
bool isMulti = SMServ.DictMacchMulti[IdxMaccSel] == 1;
isMulti = SMServ.DictMacchMulti[IdxMaccSel] == 1;
if (isMulti)
{
var idxMSel = MServ.UserPrefGet(IdxMaccSel);
@@ -103,7 +125,44 @@ namespace MP_TAB3.Components
await doUpdate();
}
}
/// <summary>
/// Macchina selezionata MAIN
/// </summary>
private string IdxMaccMain
{
get => RecMSE != null ? RecMSE.IdxMacchina : "";
}
/// <summary>
/// Restituisce il codice IdxMacchina dell'altra tavola (se multi) altrimenti la stessa macchina...
/// </summary>
private string idxMaccAltraTav
{
get
{
string answ = "";
if (RecMSE != null)
{
try
{
// verifico se SIA una tavola (ha char "#")
int iSharp = IdxMaccMain.IndexOf('#');
if (iSharp > 0)
{
// ora verifico SE ALTRA TAVOLA ha ODL...
string nomeTav = IdxMaccMain.Substring(iSharp);
string altraTav = nomeTav.Substring(0, nomeTav.Length - 1);
altraTav += nomeTav.EndsWith("1") ? "2" : "1";
// sistemo nome
answ = IdxMaccMain.Replace(nomeTav, altraTav);
}
}
catch
{ }
}
return answ;
}
}
protected async Task SaveKo()
{
isProcessing = true;
@@ -112,6 +171,13 @@ namespace MP_TAB3.Components
showNote = false;
await doUpdate();
await E_Updated.InvokeAsync(false);
//TabDServ.NotifyDataInvalidated(IdxMaccSel);
if (isMulti)
{
await E_MachSel.InvokeAsync(idxMaccAltraTav);
await Task.Delay(100);
}
await E_MachSel.InvokeAsync(IdxMaccSel);
isProcessing = false;
}
@@ -129,6 +195,13 @@ namespace MP_TAB3.Components
showNote = false;
await doUpdate();
await E_Updated.InvokeAsync(true);
//TabDServ.NotifyDataInvalidated(IdxMaccSel);
if (isMulti)
{
await E_MachSel.InvokeAsync(idxMaccAltraTav);
await Task.Delay(100);
}
await E_MachSel.InvokeAsync(IdxMaccSel);
isProcessing = false;
}
@@ -144,8 +217,8 @@ namespace MP_TAB3.Components
await Task.Delay(1);
IdxMaccSel = selIdxMacc;
await doUpdate();
isProcessing = false;
await Task.Delay(1);
isProcessing = false;
await E_MachSel.InvokeAsync(selIdxMacc);
}
@@ -222,6 +295,7 @@ namespace MP_TAB3.Components
private Periodo CurrPeriodo { get; set; } = new Periodo();
private string IdxMaccSel { get; set; } = "";
private string IdxMaccAltra { get; set; } = "";
private int IdxOdl { get; set; } = 0;
+2
View File
@@ -402,9 +402,11 @@ namespace MP_TAB3.Components
{
// se riceve evento relativo a questo impianto --> ricarico dati prod...
detailLoaded = false;
Log.Info("TabDServ_DataInvalidated: Reload Data");
// carico dettagli
await loadDetails();
setGaugeVals();
//await InvokeAsync(StateHasChanged);
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2503.1312</Version>
<Version>6.16.2503.1314</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2503.1312</h4>
<h4>Versione: 6.16.2503.1314</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2503.1312
6.16.2503.1314
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2503.1312</version>
<version>6.16.2503.1314</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>