- @if (CurrList.Contains(record.IdxMacchina))
+ @if (currList.Contains(record.IdxMacchina))
{
}
diff --git a/MP.SPEC/Components/Fermate/ListMacc.razor.cs b/MP.SPEC/Components/Fermate/ListMacc.razor.cs
index 01d7a5e8..a8f64b38 100644
--- a/MP.SPEC/Components/Fermate/ListMacc.razor.cs
+++ b/MP.SPEC/Components/Fermate/ListMacc.razor.cs
@@ -8,6 +8,9 @@ namespace MP.SPEC.Components.Fermate
{
#region Public Properties
+ [Parameter]
+ public bool ResetSelection { get; set; }
+
[Parameter]
public EventCallback EC_ReqRefresh { get; set; }
@@ -19,32 +22,70 @@ namespace MP.SPEC.Components.Fermate
#endregion Public Properties
- #region Protected Properties
+ #region Protected Methods
- ///
- /// Elenco selezione corrente
- ///
- protected List CurrList { get; set; } = new List();
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ await ReloadUserPref();
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ await ReloadUserPref();
+ }
+
+ protected override void OnParametersSet()
+ {
+ if (ResetSelection)
+ {
+ currList = new();
+ }
+ isLoading = true;
+ totalCount = ListMSE.Count();
+ ReloadData();
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private bool AllSelected = false;
+
+ private List currList = new List();
+
+ private int currPage = 1;
+
+ private bool isLoading = false;
+
+ private List ListRecords = new();
+
+ private int numRecord = 10;
+
+ private int totalCount = 0;
+
+ #endregion Private Fields
+
+ #region Private Properties
[Inject]
- protected ILocalStorageService localStorage { get; set; } = null!;
+ private ILocalStorageService localStorage { get; set; } = null!;
///
/// Conteggio elementi selezionati
///
- protected int numSel
+ private int numSel
{
- get => CurrList.Count();
+ get => currList.Count();
}
- #endregion Protected Properties
+ #endregion Private Properties
- #region Protected Methods
+ #region Private Methods
- protected string CheckSelect(MappaStatoExplModel currRec)
+ private string CheckSelect(MappaStatoExplModel currRec)
{
string answ = "";
- if (CurrList.Contains(currRec.IdxMacchina))
+ if (currList.Contains(currRec.IdxMacchina))
{
answ = "table-info";
}
@@ -54,7 +95,7 @@ namespace MP.SPEC.Components.Fermate
///
/// CSS Class bordo da stato macchina
///
- protected string cssClassBorder(string semaforo)
+ private string cssClassBorder(string semaforo)
{
string answ = "";
if (!string.IsNullOrEmpty(semaforo))
@@ -89,109 +130,15 @@ namespace MP.SPEC.Components.Fermate
return answ;
}
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- await ReloadUserPref();
- }
-
- protected override async Task OnInitializedAsync()
- {
- await ReloadUserPref();
- }
-
- protected override void OnParametersSet()
- {
- isLoading = true;
- totalCount = ListMSE.Count();
- ReloadData();
- }
-
///
/// Richiesta update
///
///
- protected async Task RaiseRefresh()
+ private async Task RaiseRefresh()
{
await EC_ReqRefresh.InvokeAsync(true);
}
- protected async Task SetNumRec(int newNum)
- {
- numRecord = newNum;
- await localStorage.SetItemAsync(varName("numRec"), newNum);
- currPage = 1;
- ReloadData();
- }
-
- protected async Task SetPage(int newNum)
- {
- currPage = newNum;
- ReloadData();
- }
-
- ///
- /// Esegue toggle selezione fino a numMax in aggiunta e rimuovendo tutti se era true
- ///
- protected async Task ToggleAllSel()
- {
- AllSelected = !AllSelected;
- if (AllSelected)
- {
- if (ListRecords != null)
- {
- foreach (var record in ListRecords)
- {
- if (!CurrList.Contains(record.IdxMacchina))
- {
- CurrList.Add(record.IdxMacchina);
- }
- }
- }
- }
- else
- {
- CurrList.Clear();
- }
- await Task.Delay(1);
- await EC_Selected.InvokeAsync(CurrList);
- }
-
- protected async Task ToggleSel(string newVal)
- {
- if (!CurrList.Contains(newVal))
- {
- CurrList.Add(newVal);
- }
- else
- {
- CurrList.Remove(newVal);
- }
- // riordino
- CurrList = CurrList.OrderBy(x => x).ToList();
- // invio selezione!
- await EC_Selected.InvokeAsync(CurrList);
- }
-
- #endregion Protected Methods
-
- #region Private Fields
-
- private bool AllSelected = false;
-
- private int currPage = 1;
-
- private bool isLoading = false;
-
- private List ListRecords = new();
-
- private int numRecord = 10;
-
- private int totalCount = 0;
-
- #endregion Private Fields
-
- #region Private Methods
-
private void ReloadData()
{
if (ListMSE != null)
@@ -215,6 +162,63 @@ namespace MP.SPEC.Components.Fermate
numRecord = await localStorage.GetItemAsync(varName("numRec"), 10);
}
+ private async Task SetNumRec(int newNum)
+ {
+ numRecord = newNum;
+ await localStorage.SetItemAsync(varName("numRec"), newNum);
+ currPage = 1;
+ ReloadData();
+ }
+
+ private async Task SetPage(int newNum)
+ {
+ currPage = newNum;
+ ReloadData();
+ }
+
+ ///
+ /// Esegue toggle selezione fino a numMax in aggiunta e rimuovendo tutti se era true
+ ///
+ private async Task ToggleAllSel()
+ {
+ AllSelected = !AllSelected;
+ if (AllSelected)
+ {
+ if (ListRecords != null)
+ {
+ foreach (var record in ListRecords)
+ {
+ if (!currList.Contains(record.IdxMacchina))
+ {
+ currList.Add(record.IdxMacchina);
+ }
+ }
+ }
+ }
+ else
+ {
+ currList.Clear();
+ }
+ await Task.Delay(1);
+ await EC_Selected.InvokeAsync(currList);
+ }
+
+ private async Task ToggleSel(string newVal)
+ {
+ if (!currList.Contains(newVal))
+ {
+ currList.Add(newVal);
+ }
+ else
+ {
+ currList.Remove(newVal);
+ }
+ // riordino
+ currList = currList.OrderBy(x => x).ToList();
+ // invio selezione!
+ await EC_Selected.InvokeAsync(currList);
+ }
+
private string varName(string key)
{
return $"ListMacc_{key}";
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index f8446314..c17da66e 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.16.2602.2612
+ 6.16.2603.2015
1800a78a-6ff1-40f9-b490-87fb8bfc1394
en
diff --git a/MP.SPEC/Pages/ProdPlanner.razor b/MP.SPEC/Pages/ProdPlanner.razor
new file mode 100644
index 00000000..2142f878
--- /dev/null
+++ b/MP.SPEC/Pages/ProdPlanner.razor
@@ -0,0 +1,17 @@
+@page "/ProdPlanner"
+
+
diff --git a/MP.SPEC/Pages/ProdPlanner.razor.cs b/MP.SPEC/Pages/ProdPlanner.razor.cs
new file mode 100644
index 00000000..bf30c492
--- /dev/null
+++ b/MP.SPEC/Pages/ProdPlanner.razor.cs
@@ -0,0 +1,63 @@
+using Microsoft.AspNetCore.Components;
+using MP.Core.DTO;
+using MP.Data.Services;
+
+namespace MP.SPEC.Pages
+{
+ public partial class ProdPlanner
+ {
+ #region Protected Properties
+
+ [Inject]
+ protected SchedulerDataService SDService { get; set; } = null!;
+
+ #endregion Protected Properties
+
+ #region Private Fields
+
+ ///
+ /// Periodo selezionato attuale
+ ///
+ private EgwCoreLib.Utils.DtUtils.Periodo PeriodoSel = new EgwCoreLib.Utils.DtUtils.Periodo(EgwCoreLib.Utils.DtUtils.PeriodSet.ThisYear);
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private List ListEventi { get; set; } = new();
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ ///
+ /// Legge i dati dei record completi
+ ///
+ private async Task ReloadData()
+ {
+ var rawData = await SDService.PlannerGetEvents(PeriodoSel.Inizio, PeriodoSel.Fine);
+ if (rawData != null && rawData.Count > 0)
+ {
+ ListEventi.Clear();
+ // x ora copio i vari blocchi...
+ foreach (var item in rawData)
+ {
+ ListEventi.AddRange(item.Value);
+ }
+ }
+ }
+
+ ///
+ /// Imposta periodo da filtro
+ ///
+ ///
+ ///
+ private async Task SetPeriodo(EgwCoreLib.Utils.DtUtils.Periodo newPeriod)
+ {
+ PeriodoSel = newPeriod;
+ await ReloadData();
+ }
+
+ #endregion Private Methods
+ }
+}
diff --git a/MP.SPEC/Pages/RepStop.razor b/MP.SPEC/Pages/RepStop.razor
index 4b12028d..a083dd16 100644
--- a/MP.SPEC/Pages/RepStop.razor
+++ b/MP.SPEC/Pages/RepStop.razor
@@ -24,11 +24,13 @@
{
-
+
@if (showFermate)
{
+
+
}
else
diff --git a/MP.SPEC/Pages/RepStop.razor.cs b/MP.SPEC/Pages/RepStop.razor.cs
index 89bfc906..c504e35a 100644
--- a/MP.SPEC/Pages/RepStop.razor.cs
+++ b/MP.SPEC/Pages/RepStop.razor.cs
@@ -4,17 +4,24 @@ using MP.Core.DTO;
using MP.Data;
using MP.Data.DbModels;
using MP.Data.Services;
-using MP.SPEC.Components.Reparti;
using MP.SPEC.Data;
using Newtonsoft.Json;
-using NLog.LayoutRenderers;
using static MP.Core.Objects.Enums;
-using static MP.Data.Services.ExecStatsCollector;
namespace MP.SPEC.Pages
{
- public partial class RepStop: IDisposable
+ public partial class RepStop : IDisposable
{
+ #region Public Methods
+
+ public void Dispose()
+ {
+ TDFeeder.pauseTimers();
+ TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
+ }
+
+ #endregion Public Methods
+
#region Protected Properties
[Inject]
@@ -23,12 +30,18 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
+ [Inject]
+ protected MsgServiceSpec MService { get; set; } = null!;
+
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
+ [Inject]
+ protected TabDataFeeder TDFeeder { get; set; } = null!;
+
#endregion Protected Properties
#region Protected Methods
@@ -40,43 +53,6 @@ namespace MP.SPEC.Pages
TDFeeder.resumeTimers();
}
- [Inject]
- protected TabDataFeeder TDFeeder { get; set; } = null!;
-
- public void Dispose()
- {
- TDFeeder.pauseTimers();
- TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
- }
-
- ///
- /// Ricevuto nuovi dati da mostrare!
- ///
- ///
- ///
- private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
- {
- PubSubEventArgs currArgs = (PubSubEventArgs)e;
- // conversione on-the-fly List --> allarmi
- if (!string.IsNullOrEmpty(currArgs.newMessage))
- {
- try
- {
- List? dataList = JsonConvert.DeserializeObject>(currArgs.newMessage);
- if (dataList != null)
- {
- InvokeAsync(() => SaveData(dataList));
- }
- }
- catch
- { }
- }
- InvokeAsync(() =>
- {
- StateHasChanged();
- });
- }
-
protected async Task SaveData(List newList)
{
// salvo valori ricevuti
@@ -108,6 +84,34 @@ namespace MP.SPEC.Pages
showFermate = listSelezione.Count > 0;
}
+ ///
+ /// Ricevuto nuovi dati da mostrare!
+ ///
+ ///
+ ///
+ private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
+ {
+ PubSubEventArgs currArgs = (PubSubEventArgs)e;
+ // conversione on-the-fly List --> allarmi
+ if (!string.IsNullOrEmpty(currArgs.newMessage))
+ {
+ try
+ {
+ List? dataList = JsonConvert.DeserializeObject>(currArgs.newMessage);
+ if (dataList != null)
+ {
+ InvokeAsync(() => SaveData(dataList));
+ }
+ }
+ catch
+ { }
+ }
+ InvokeAsync(() =>
+ {
+ StateHasChanged();
+ });
+ }
+
private async Task DoReload(bool forceReload)
{
isLoading = true;
@@ -116,9 +120,40 @@ namespace MP.SPEC.Pages
isLoading = false;
}
+ ///
+ /// Gestione ritorno a stato precedente, tramite stored
+ ///
+ ///
+ private async Task DoRestorePrevious()
+ {
+ if (!await JSRuntime.InvokeAsync("confirm", $"Hai {CurrMachSel.Count} impianti selezionati.{Environment.NewLine}Confermi di voler registrare il ritorno all'ultimo stato precedente le dichiarazioni manuali?{Environment.NewLine}La procedura verificherà l'applicabilità per ogni impianto selezionato."))
+ return;
- [Inject]
- protected MsgServiceSpec MService { get; set; } = null!;
+ isLoading = true;
+ await InvokeAsync(StateHasChanged);
+
+ // se conferma ciclo x ogni macchina e registro
+ foreach (var idxMacc in CurrMachSel)
+ {
+ DateTime adesso = DateTime.Now.Floor(TimeSpan.FromSeconds(1));
+ var rigaStato = MDService.StatoMacchina(idxMacc);
+ string valData = $"SPEC | {MService.DomainName}\\{MService.UserName}";
+
+ // chiamo stored
+ await TabDServ.RipristinaStatoPrec(idxMacc, adesso, valData, rigaStato.IdxStato, 0);
+ // resetta il microstato in modo da ricevere successive info HW
+ await TabDServ.resetMicrostatoMacchina(idxMacc);
+ }
+
+ forceResetSel = true;
+ var ListMSE = await MDService.MseGetAll(true);
+ CurrMachSel = new();
+ await Task.Delay(250);
+ await ReloadData();
+ forceResetSel = false;
+ CheckSelection(new());
+ isLoading = false;
+ }
///
/// Gestione selezione evento da registrare x le macchine selezionate
@@ -142,7 +177,7 @@ namespace MP.SPEC.Pages
{
var rigaStato = MDService.StatoMacchina(idxMacc);
- // mpreparo info utente x Value...
+ // preparo info utente x Value...
string valData = $"SPEC | {MService.DomainName}\\{MService.UserName}";
// processo evento...
DateTime adesso = DateTime.Now.Floor(TimeSpan.FromSeconds(1));
@@ -153,7 +188,7 @@ namespace MP.SPEC.Pages
IdxTipo = selEv.IdxEv,
CodArticolo = rigaStato.CodArticolo,
Value = valData,
- MatrOpr = 0,
+ MatrOpr = 0,
pallet = rigaStato.pallet
};
// FORZO con metodo TAB
@@ -161,14 +196,19 @@ namespace MP.SPEC.Pages
// resetta il microstato in modo da ricevere successive info HW
await TabDServ.resetMicrostatoMacchina(idxMacc);
}
-
+ forceResetSel = true;
var ListMSE = await MDService.MseGetAll(true);
+ CurrMachSel = new();
await Task.Delay(250);
await ReloadData();
+ forceResetSel = false;
+ CheckSelection(new());
isLoading = false;
}
}
+ private bool forceResetSel = false;
+
private async Task ReloadData()
{
CurrMSE = await MDService.MseGetAll(false);
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html
index 60194377..155b3291 100644
--- a/MP.SPEC/Resources/ChangeLog.html
+++ b/MP.SPEC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2602.2612
+ Versione: 6.16.2603.2015
Note di rilascio:
-
diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt
index c2e451ac..71328cf6 100644
--- a/MP.SPEC/Resources/VersNum.txt
+++ b/MP.SPEC/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2602.2612
+6.16.2603.2015
diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml
index 0aabfeb5..00df1e6f 100644
--- a/MP.SPEC/Resources/manifest.xml
+++ b/MP.SPEC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2602.2612
+ 6.16.2603.2015
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip
https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html
false
diff --git a/MP.SPEC/appsettings.json b/MP.SPEC/appsettings.json
index a2055c1b..a061328d 100644
--- a/MP.SPEC/appsettings.json
+++ b/MP.SPEC/appsettings.json
@@ -59,6 +59,7 @@
"MP.Inve": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"MP.Land.Auth": "Server=SQL2016DEV;Database=MoonPro_Anagrafica; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
+ "MP.Sched": "Server=SQL2016DEV;Database=MoonPro_ES3; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.SPEC;",
"Redis": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
"RedisAdmin": "redis.ufficio:26379,serviceName=devel,DefaultDatabase=5,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false,allowAdmin=true",
"mdbConnString": "mongodb://W2019-MONGODB:27017"
|