- gestione cache MP-IO che scade su operazioni da tab che riguardano ODL
- fix gestione fine prod con evento inviato a IOB-WIN come task2exe
This commit is contained in:
Samuele Locatelli
2024-10-08 18:30:25 +02:00
parent b7bcf8e67a
commit dc8879d7c6
7 changed files with 70 additions and 25 deletions
+48 -19
View File
@@ -102,9 +102,6 @@ namespace MP_TAB3.Components
[Inject]
protected MailService MailServ { get; set; } = null!;
[Inject]
protected StatusData SDService { get; set; } = null!;
[Inject]
protected MessageService MsgServ { get; set; } = null!;
@@ -119,6 +116,9 @@ namespace MP_TAB3.Components
get => IdxOdl > 0;
}
[Inject]
protected StatusData SDService { get; set; } = null!;
protected string SearchPodl
{
get => searchPodl;
@@ -294,7 +294,6 @@ namespace MP_TAB3.Components
await TabDServ.OdlClearSetup(idxODLCurr, IdxMaccSel);
await advStep(currStep++);
// se è multi processo ANCHE x altra tavola...
if (isMulti)
{
@@ -311,7 +310,6 @@ namespace MP_TAB3.Components
}
await advStep(currStep++);
// se è master --> chiamo update child!
if (isMaster)
{
@@ -333,6 +331,7 @@ namespace MP_TAB3.Components
await RefreshData();
await CheckAttr();
await advStep(currStep++);
await FlushMpIoOdlCache();
isProcessing = false;
await InvokeAsync(StateHasChanged);
}
@@ -373,6 +372,7 @@ namespace MP_TAB3.Components
await RefreshData();
await CheckAttr();
await advStep(currStep++);
await FlushMpIoOdlCache();
// chiudo update...
isProcessing = false;
}
@@ -521,6 +521,7 @@ namespace MP_TAB3.Components
await RefreshData();
await CheckAttr();
await advStep(currStep++);
await FlushMpIoOdlCache();
// chiudo update...
isProcessing = false;
await InvokeAsync(StateHasChanged);
@@ -728,6 +729,7 @@ namespace MP_TAB3.Components
await TabDServ.FlushOdlCache();
IdxPOdlSel = 0;
RecMSE = null;
await FlushMpIoOdlCache();
await InvokeAsync(StateHasChanged);
await RefreshData();
await CheckAttr();
@@ -799,7 +801,6 @@ namespace MP_TAB3.Components
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi fine produzione?"))
return;
// prima di tutto svuoto dati prod
SDService.MachProdStRem(IdxMaccSel);
@@ -895,7 +896,22 @@ namespace MP_TAB3.Components
NavMan.NavigateTo($"machine-detail");
}
}
// aggiunto esplicita endProd
TabDServ.addTask4Machine(IdxMaccSel, taskType.endProd, "");
if (isMaster)
{
// calcolo gli slave...
var slaveList = SMServ.ListM2S
.Where(x => x.IdxMacchina.Equals(IdxMaccSel, StringComparison.InvariantCultureIgnoreCase))
.ToList();
foreach (var machine in slaveList)
{
// invio task x end produzione...
TabDServ.addTask4Machine(machine.IdxMacchinaSlave, taskType.endProd, "");
}
}
await advStep(currStep++);
await FlushMpIoOdlCache();
// faccio refresh e riporto
IdxPOdlSel = 0;
RecMSE = null;
@@ -1196,17 +1212,6 @@ namespace MP_TAB3.Components
#region Private Properties
private string baseLang
{
get => MsgServ.UserPrefGet("Lang");
}
private bool cancelSetupEnabled
{
//get => inAttr && enableSchedaTecnica && enableAnnullaSetup;
get => inAttr && enableAnnullaSetup;
}
private bool annullaSetupVisible
{
get
@@ -1233,6 +1238,17 @@ namespace MP_TAB3.Components
}
}
private string baseLang
{
get => MsgServ.UserPrefGet("Lang");
}
private bool cancelSetupEnabled
{
//get => inAttr && enableSchedaTecnica && enableAnnullaSetup;
get => inAttr && enableAnnullaSetup;
}
private string cssDetailOdl
{
get => IdxPOdlSel > 0 ? "bg-info text-light" : "bg-warning";
@@ -1372,8 +1388,8 @@ namespace MP_TAB3.Components
catch
{ }
// ora verifico SE E SOLO SE è ANCORA in attrezzaggio ora verifico SE ALTRA
// TAVOLA ha ODL...
// ora verifico SE E SOLO SE è ANCORA in attrezzaggio ora verifico SE
// ALTRA TAVOLA ha ODL...
if (dtChiusura.AddMinutes(gPeriodReopenOdlTav) > adesso)
{
answ = showReopenOdlTav;
@@ -1574,6 +1590,19 @@ namespace MP_TAB3.Components
}
}
/// <summary>
/// Flush cache relativa a MP-IO x dati ODL
/// </summary>
/// <returns></returns>
private async Task FlushMpIoOdlCache()
{
// svuoto dalla cache REDIS del server IO...
await TabDServ.ResetIoCache("CurrODL");
await TabDServ.ResetIoCache("CurrOdlRow");
await TabDServ.ResetIoCache("CurrStatoMacc");
await TabDServ.ResetIoCache("DtMac");
}
/// <summary>
/// processa evento richiesto
/// </summary>
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2409.408</Version>
<Version>6.16.2410.818</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.2409.408</h4>
<h4>Versione: 6.16.2410.818</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2409.408
6.16.2410.818
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2409.408</version>
<version>6.16.2410.818</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>
-1
View File
@@ -534,7 +534,6 @@ namespace MP.Data.Controllers
return dbResult;
}
//stp_DDB_getNextByMacchinaFrom
/// <summary>
/// Eliminazione record EventList (SE trovato)
/// </summary>
+18 -1
View File
@@ -1200,7 +1200,7 @@ namespace MP.Data.Services
/// <summary>
/// Restitusice elenco KVP dei TASK SALVATI (da passare a IOB-WIN) per l'impianto indicato
/// </summary>
/// <param name="idxMacchina"></param>
/// <param name="idxMacchina"></param>s
/// <returns></returns>
public Dictionary<string, string> mSavedTaskMacchina(string idxMacchina)
{
@@ -2438,6 +2438,23 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Reset della cache IO post operazioni come setup ODL...
/// </summary>
/// <param name="baseMem">Indirizzo base da cui rimuovere memoria cache</param>
/// <returns></returns>
public async Task<bool> ResetIoCache(string baseMem)
{
// patterna a partire da cache IO...
RedisValue pattern = new RedisValue($"{MpIoNS}:*");
if (!string.IsNullOrEmpty(baseMem))
{
pattern = new RedisValue($"{MpIoNS}:{baseMem}:*");
}
bool answ = await ExecFlushRedisPattern(pattern);
return answ;
}
/// <summary>
/// Effettua reset microstato macchina
/// </summary>