Fix reload post ODL action

This commit is contained in:
Samuele Locatelli
2023-12-12 15:52:50 +01:00
parent abf0cc63b8
commit 75b330abc4
7 changed files with 57 additions and 53 deletions
+13 -6
View File
@@ -68,12 +68,19 @@ namespace MP_TAB_SERV.Components
protected void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
aTimer.Interval = fastRefreshMs;
await InvokeAsync(RefreshData);
});
pUpd.Wait();
try
{
var pUpd = Task.Run(async () =>
{
aTimer.Interval = fastRefreshMs;
await InvokeAsync(RefreshData);
});
pUpd.Wait();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante MseSampler.ElapsedTimer{Environment.NewLine}{exc}");
}
}
protected override void OnInitialized()
+18 -11
View File
@@ -242,7 +242,7 @@ namespace MP_TAB_SERV.Components
await advStep(currStep++);
// cancella dati correnti ODL
DoRemoveCurrOdlData();
DoRemoveCurrOdlData(false);
await advStep(currStep++);
}
catch
@@ -255,6 +255,10 @@ namespace MP_TAB_SERV.Components
await advStep(currStep++);
isProcessing = false;
await InvokeAsync(StateHasChanged);
#if false
await Task.Delay(50);
NavMan.NavigateTo(NavMan.Uri, true);
#endif
}
/// <summary>
@@ -630,7 +634,7 @@ namespace MP_TAB_SERV.Components
checkBtnStatus();
fixSplitBtn(false);
// faccio refresh e riporto
await TabDServ.FlushCache("ODL");
await TabDServ.FlushOdlCache();
IdxPOdlSel = 0;
RecMSE = null;
await RefreshData();
@@ -972,7 +976,6 @@ namespace MP_TAB_SERV.Components
private bool showOdlProvv = false;
private bool showReopenOdlTav = false;
private bool showSplitOdlOnTav = false;
private decimal tcRichAttr = 1;
#endregion Private Fields
@@ -994,7 +997,6 @@ namespace MP_TAB_SERV.Components
}
private ODLExpModel currOdl { get; set; } = new ODLExpModel();
private PODLExpModel currPodl { get; set; } = new PODLExpModel();
/// <summary>
@@ -1185,6 +1187,8 @@ namespace MP_TAB_SERV.Components
}
}
private decimal tcRichAttr { get; set; } = 1;
private string titleOdlDetail
{
get => IdxPOdlSel > 0 ? "Verifica parametri attrezzaggio NUOVO PODL" : inAttr ? "Parametri PODL in Attrezzaggio" : "Parametri ODL Corrente";
@@ -1426,7 +1430,7 @@ namespace MP_TAB_SERV.Components
/// <summary>
/// Rimozione dati e parametri (TAB e su PLC) x ODL corrente
/// </summary>
private void DoRemoveCurrOdlData()
private void DoRemoveCurrOdlData(bool nav2detail)
{
// invio task x end produzione...
string setArtVal = "NO ART";
@@ -1453,8 +1457,11 @@ namespace MP_TAB_SERV.Components
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.setComm, setCommVal);
}
}
// rimando a pagina dettaglio...
NavMan.NavigateTo("machine-detail", true);
// se richiesto rimando a pagina dettaglio...
if (nav2detail)
{
NavMan.NavigateTo("machine-detail", true);
}
}
#if false
@@ -1564,14 +1571,14 @@ namespace MP_TAB_SERV.Components
// imposto tcRichAttr in base allo stato...
if (odlOk)
{
// prendo TCRich da ODL...
if (IdxOdl > 0)
// prendo TCRich da PODL...
if (IdxPOdlSel > 0)
{
tcRichAttr = currOdl.TCRichAttr;
tcRichAttr = currPodl.Tcassegnato;
}
else
{
tcRichAttr = currPodl.Tcassegnato;
tcRichAttr = currOdl.TCRichAttr;
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2312.1214</Version>
<Version>6.16.2312.1215</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2312.1214</h4>
<h4>Versione: 6.16.2312.1215</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2312.1214
6.16.2312.1215
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2312.1214</version>
<version>6.16.2312.1215</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+22 -32
View File
@@ -1225,9 +1225,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlClearSetup(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1236,6 +1234,17 @@ namespace MP.Data.Services
}
return answ;
}
/// <summary>
/// Flush di tutta la cache relativa ad i dati ODL/PODL
/// </summary>
/// <returns></returns>
public async Task FlushOdlCache()
{
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushCache("StatoMacc");
}
/// <summary>
/// ODL corrente macchina
@@ -1287,9 +1296,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlDividiDaAltraTavola(idxODL, matrOpr, idxMacchinaTo);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1312,9 +1319,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlFineProd(idxODL, idxMacchina);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1338,9 +1343,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlFixMachineSlave(idxMacchina, numDayPrev, doInsert);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1367,9 +1370,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlInizioSetup(idxODL, matrOpr, idxMacchina, tcRich, pzPallet, note);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1473,9 +1474,7 @@ namespace MP.Data.Services
// riordino
result = results.FirstOrDefault();
// svuoto cache
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
if (result == null)
{
result = new ODLModel();
@@ -1498,9 +1497,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = await Task.FromResult(dbTabController.OdlSetupPostumo(idxODL, idxMacchina));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1524,9 +1521,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = await Task.FromResult(dbTabController.OdlSetupPromPostuma(idxPromOdl, matrOpr, idxMacchina));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1555,9 +1550,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = await Task.FromResult(dbTabController.OdlSplit(idxODL, matrOpr, idxMacchina, TCRich, pzPallet, note, startNewOdl, qtyRich));
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1583,9 +1576,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.OdlUpdate(idxODL, matrOpr, tCRichAttr, pzPallet, note);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushCache("VSODL");
await FlushOdlCache();
}
catch (Exception exc)
{
@@ -1759,8 +1750,7 @@ namespace MP.Data.Services
{
// inserisco evento
answ = dbTabController.PODL_startSetup(editRec, matrOpr, tcRich, pzPallet, note, dtEvent);
await FlushCache("ODL");
await FlushCache("PODL");
await FlushOdlCache();
}
catch (Exception exc)
{