diff --git a/MP.SPEC/Components/ListFerm.razor b/MP.SPEC/Components/ListFerm.razor index 902a959b..e779d00c 100644 --- a/MP.SPEC/Components/ListFerm.razor +++ b/MP.SPEC/Components/ListFerm.razor @@ -1,5 +1,15 @@ -

Elenco Fermate

- -@code { - -} +
+
+ @if (ListaFermate == null || ListaFermate.Count == 0) + { +
Nessun Record Trovato
+ } + else + { + foreach (var item in ListaFermate) + { + + } + } +
+
\ No newline at end of file diff --git a/MP.SPEC/Components/ListFerm.razor.cs b/MP.SPEC/Components/ListFerm.razor.cs new file mode 100644 index 00000000..1ae9e70c --- /dev/null +++ b/MP.SPEC/Components/ListFerm.razor.cs @@ -0,0 +1,169 @@ +using Microsoft.AspNetCore.Components; +using MP.Data; +using MP.Data.DbModels; +using MP.Data.Services; +using MP.SPEC.Data; +using MP.SPEC.Shared; +using NLog.Layouts; +using System.Threading; + +namespace MP.SPEC.Components +{ + public partial class ListFerm + { + + [Parameter] + public List ListaFermate { get; set; } = new List(); + + private bool isProcessing = false; + + //[Inject] + //protected SharedMemService SMServ { get; set; } = null!; + + //[Inject] + //protected TabDataService TabDServ { get; set; } = null!; + + /// + /// Processo registrazione eventi + /// + /// + /// + protected async Task EventRecord(int IdxEv) + { + isProcessing = true; + await Task.Delay(500); +#if false + bool needReload = false; + await Task.Delay(1); + // salvo evento e processo... + if (IdxEv > 0) + { + var rigaEvento = SMServ.GetEventRow(IdxEv); + if (rigaEvento != null) + { + var rigaStato = TabDServ.StatoMacchina(IdxMacc); + // processo evento... + if (insRealtime) + { + DateTime adesso = DateTime.Now.Floor(TimeSpan.FromSeconds(1)); + EventListModel newRec = new EventListModel() + { + IdxMacchina = IdxMacc, + InizioStato = adesso, + IdxTipo = IdxEv, + CodArticolo = rigaStato.CodArticolo, + Value = "DRT", + MatrOpr = MatrOpr, + pallet = rigaStato.pallet + }; + // se realtime + await TabDServ.EvListInsert(newRec, MP.Core.Objects.Enums.tipoInputEvento.barcode); + // resetta il microstato in modo da ricevere successive info HW + await TabDServ.resetMicrostatoMacchina(IdxMacc); + } + else + { + needReload = true; + // in primis disabilito insert... + TabDServ.MacchinaSetInsEnab(IdxMacc, false); + + // calcolo evento + string evento = $"{IdxEv}"; + string commento = ""; + try + { + evento = rigaEvento.Nome.Replace("Barcode - ", ""); + } + catch + { } + // genero stringa pseudo-univoca + string codRich = $"{DateTime.Now:yyMMddHHmmss}-{IdxEv}"; + // x prima cosa scrivo un evento tipo "1" x chiudere la durata appena prima + // dell'evento successivo + try + { + // cerco da 1 sec DOPO evento... + var tabNext = TabDServ.DDB_getNext(IdxMacc, DtRif.AddSeconds(1)); + + DateTime nextEvDT = tabNext != null ? tabNext.InizioStato : DateTime.Now.AddMinutes(-1); + + // fix salvo la dichiarazione di chiusura + commento = $"999 - M.Lav EndEvt: {evento} [{codRich}]"; + // 1 hard-coded x resettare + EventListModel newRec = new EventListModel() + { + IdxMacchina = IdxMacc, + InizioStato = nextEvDT.AddSeconds(-1), + IdxTipo = 1, + CodArticolo = rigaStato.CodArticolo, + Value = commento, + MatrOpr = MatrOpr, + pallet = rigaStato.pallet + }; + await TabDServ.EvListInsert(newRec, MP.Core.Objects.Enums.tipoInputEvento.barcode); + + // update commento apertura! + commento = $"999 - Dich StartEvt: {evento} [{codRich}]"; + newRec = new EventListModel() + { + IdxMacchina = IdxMacc, + InizioStato = DtRif.AddSeconds(1), + IdxTipo = IdxEv, + CodArticolo = rigaStato.CodArticolo, + Value = commento, + MatrOpr = MatrOpr, + pallet = rigaStato.pallet + }; + await TabDServ.EvListInsert(newRec, MP.Core.Objects.Enums.tipoInputEvento.barcode); + // eseguo ricalcolo! + DateTime startRicalcolo = DtRif.AddMinutes(minAnticipoRicalcolo); + // eseguo ricalcolo periodo.. + await TabDServ.DDB_DoRecalc(IdxMacc, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly); + // chiamo registrazione commento... + if (noteEdit != null) + { + await noteEdit.ForceSave(DtRif.AddSeconds(5)); + DtRif = DateTime.Now; + } + } + catch (Exception exc) + { + Log.Error($"Eccezione in fase di riqualifica fermi{Environment.NewLine}{exc}"); + } + + // riabilito insert... anche se non dovrebbe servire x stored ricalcolo precedente... + TabDServ.MacchinaSetInsEnab(IdxMacc, true); + } + // mostro esito + alertCss = "alert-primary"; + titleOut = rigaEvento.Nome; + lblOut = $"Registrata dichiarazione fermata alle {DateTime.Now:HH:mm:ss}"; + } + else + { + alertCss = "alert-warning"; + lblOut = $"Codice evento non valido! {IdxEv}"; + } + } + // faccio refresh x singola macchina 2019.03.26 + await TabDServ.RicalcMse(IdxMacc, 0); + // rileggo e salvo.. + var ListMSE = await MDataService.MseGetAll(true); + if (ListMSE != null) + { + // salvo in LocalStorage... + await MsgServ.SaveMse(ListMSE); + // aggiorno MSE attuale + CurrMSE = ListMSE.Find(x => x.IdxMacchina == IdxMacc); + } + isProcessing = false; + // se non era realtime --> rimando a commenti + if (needReload) + { + await MsgServ.LastOpenedPageSet("notes"); + NavMan.NavigateTo("notes"); + } +#endif + } + } +} \ No newline at end of file diff --git a/MP.SPEC/Components/ListMacc.razor b/MP.SPEC/Components/ListMacc.razor index 1f8ebf18..c1b23165 100644 --- a/MP.SPEC/Components/ListMacc.razor +++ b/MP.SPEC/Components/ListMacc.razor @@ -16,7 +16,11 @@
- @if (ListRecords != null) + @if (ListRecords == null || ListRecords.Count==0) + { +
Nessun Record Trovato
+ } + else { @@ -71,6 +75,5 @@
} -
\ No newline at end of file diff --git a/MP.SPEC/Components/ListMacc.razor.cs b/MP.SPEC/Components/ListMacc.razor.cs index 8d61a911..3be9f83d 100644 --- a/MP.SPEC/Components/ListMacc.razor.cs +++ b/MP.SPEC/Components/ListMacc.razor.cs @@ -10,6 +10,10 @@ namespace MP.SPEC.Components [Parameter] public List ListMSE { get; set; } = null!; + + [Parameter] + public EventCallback> EC_Selected { get; set; } + #endregion Public Properties #region Protected Properties @@ -84,12 +88,10 @@ namespace MP.SPEC.Components CurrList.Clear(); } await Task.Delay(1); -#if false - await EC_ListUpdated.InvokeAsync(CurrList); -#endif + await EC_Selected.InvokeAsync(CurrList); } - protected void ToggleSel(string newVal) + protected async Task ToggleSel(string newVal) { if (!CurrList.Contains(newVal)) { @@ -101,6 +103,8 @@ namespace MP.SPEC.Components } // riordino CurrList = CurrList.OrderBy(x => x).ToList(); + // invio selezione! + await EC_Selected.InvokeAsync(CurrList); } #endregion Protected Methods diff --git a/MP.SPEC/Components/ProdStopMan.razor b/MP.SPEC/Components/ProdStopMan.razor new file mode 100644 index 00000000..01298ec0 --- /dev/null +++ b/MP.SPEC/Components/ProdStopMan.razor @@ -0,0 +1,15 @@ +
+
+
+
+ +
+ +
+
+
\ No newline at end of file diff --git a/MP.SPEC/Components/ProdStopMan.razor.cs b/MP.SPEC/Components/ProdStopMan.razor.cs new file mode 100644 index 00000000..8a130732 --- /dev/null +++ b/MP.SPEC/Components/ProdStopMan.razor.cs @@ -0,0 +1,79 @@ +using Microsoft.AspNetCore.Components; + +namespace MP.SPEC.Components +{ + public partial class ProdStopMan + { + #region Public Properties + + [Parameter] + public EventCallback E_EventSelected { get; set; } + + [Parameter] + public int IdxEvento { get; set; } = 0; + + [Parameter] + public string objCss { get; set; } = ""; + + [Parameter] + public string objIcon { get; set; } = ""; + + [Parameter] + public string objTxt { get; set; } = ""; + + #endregion Public Properties + + #region Protected Properties + + [Inject] + protected IConfiguration config { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + protected override void OnInitialized() + { + maxChar4Scroll = config.GetValue("ServerConf:maxChar4Scroll"); + } + + protected async Task ReportSelected() + { + await E_EventSelected.InvokeAsync(IdxEvento); + } + + /// + /// CSS class x testo (se descr lunga scorre...) + /// + protected string textCss(string currText) + { + string answ = " text-nowrap text-truncate w-100"; + if (currText.Length > maxChar4Scroll) + { + // calcolo delta... a-b-c con 5-10-oltre + int delta = currText.Length - maxChar4Scroll; + if (delta < 5) + { + answ = " scroll-left-a"; + } + else if (delta < 10) + { + answ = " scroll-left-b"; + } + else + { + answ = " scroll-left-c"; + } + } + return answ; + } + + #endregion Protected Methods + + #region Private Fields + + private int maxChar4Scroll = 20; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/MP.SPEC/Pages/RepStop.razor b/MP.SPEC/Pages/RepStop.razor index 2a8b9b42..12a9483d 100644 --- a/MP.SPEC/Pages/RepStop.razor +++ b/MP.SPEC/Pages/RepStop.razor @@ -24,7 +24,7 @@ {
- +
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 850b6fc7..e69de29b 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,25 +0,0 @@ - - Modulo MAPOSPEC -

Versione: 6.16.2602.2415

-
Note di rilascio: -
    -
  • - Ultime modifiche: -
      {{LAST-CHANGES}}
    -
  • -
  • - v.6.15.* → -
      -
    • Prima release dotnet6
    • -
    -
  • -
-
-
- -
- -
- diff --git a/MP.SPEC/appsettings.json b/MP.SPEC/appsettings.json index d7b86b7e..16254251 100644 --- a/MP.SPEC/appsettings.json +++ b/MP.SPEC/appsettings.json @@ -71,7 +71,8 @@ ".utdata": "application/octet-stream", ".utprobe": "application/octet-stream", ".utwedge": "application/octet-stream" - } + }, + "maxChar4Scroll": 21 }, "SpecialConf": { "AppUrl": "/MP/SPEC",