This commit is contained in:
zaccaria.majid
2023-12-15 15:09:19 +01:00
+52 -8
View File
@@ -150,14 +150,39 @@ namespace MP_TAB_SERV.Components
// verifico attrezzaggio su macchina corrente o se multi su parent
string idxMacc2check = isMulti ? IdxMaccParent : IdxMaccSel;
StatoMacchineModel rigaStato = TabDServ.StatoMacchina(idxMacc2check);
//calcolo stato attrezzaggio, hard coded!!!
inAttr = (rigaStato.IdxStato == 2);
// calcolo stato attrezzaggio, hard coded!!!
if (isMulti)
{
inAttr = (rigaStato.IdxStato == 2 && tavHasOdl);
}
else
{
inAttr = rigaStato.IdxStato == 2;
}
// se in attr --> carico podlCurr...
if (inAttr && RecMSE != null)
{
await ReloadXDL(false);
}
}
/// <summary>
/// Verifica se la tavola SIA in fase di attrezzaggio, ovvero SE:
/// - sia un impianto MULTI (= con + tavole)
/// - sia già attrezzata
/// </summary>
protected bool tavHasOdl
{
get
{
bool answ = false;
// se è multi controllo
if (isMulti)
{
answ = !emptyOdlMacc;
}
return answ;
}
}
/// <summary>
/// Aggiorno...
@@ -255,10 +280,6 @@ 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>
@@ -681,8 +702,8 @@ namespace MP_TAB_SERV.Components
{
IdxMaccSel = idxMSel;
}
IdxMaccParent = getIdxMaccParent();
}
IdxMaccParent = getIdxMaccParent();
// verifica stato inAttr
await CheckAttr();
await ReloadData(true);
@@ -690,10 +711,18 @@ namespace MP_TAB_SERV.Components
checkAll();
}
#if false
protected override async Task OnParametersSetAsync()
{
await ReloadData(false);
// verifica stato inAttr
if (!string.IsNullOrEmpty(IdxMaccSel) && IdxMaccSelLast != IdxMaccSel)
{
await CheckAttr();
await ReloadData(false);
IdxMaccSelLast = IdxMaccSel;
}
}
#endif
protected async Task ProdEnd()
{
@@ -896,6 +925,7 @@ namespace MP_TAB_SERV.Components
IdxMaccSel = selIdxMacc;
// recupero dati
RecMSE = TabDServ.MseGetSub(IdxMaccParent, selIdxMacc, true);
await CheckAttr();
await ReloadData(true);
await DoUpdate();
if (showOdlDetail || inAttr)
@@ -950,6 +980,9 @@ namespace MP_TAB_SERV.Components
private int gPeriodReopenOdlTav = 1;
private string IdxMaccSel = "";
#if false
private string IdxMaccSelLast = "";
#endif
private int idxPOdlSel = 0;
@@ -1223,6 +1256,17 @@ namespace MP_TAB_SERV.Components
private void checkAll()
{
if (string.IsNullOrEmpty(IdxMaccParent))
{
if (isMulti)
{
IdxMaccParent = getIdxMaccParent();
}
else
{
IdxMaccParent = IdxMaccSel;
}
}
checkConfProd();
}