- @if (!liveUpdate)
- {
- toggleUpdate()">
- @lastUpdate
-
- }
- else
- {
- toggleUpdate()">
-
- Valori live
-
- }
+
-
-
- @if (showEditPar)
+
+
+ @*@if (showEditPar)
{
diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs
index 37e8430e..12a155a5 100644
--- a/MP.SPEC/Components/DossiersFilter.razor.cs
+++ b/MP.SPEC/Components/DossiersFilter.razor.cs
@@ -15,6 +15,7 @@ using MP.SPEC;
using MP.SPEC.Shared;
using MP.SPEC.Components;
using MP.SPEC.Data;
+using MP.Data.DatabaseModels;
namespace MP.SPEC.Components
{
@@ -23,78 +24,35 @@ namespace MP.SPEC.Components
#region Public Properties
[Parameter]
- public EventCallback
FilterChanged { get; set; }
+ public EventCallback FilterChanged { get; set; }
[Parameter]
- public SelectFluxParams SelFilter { get; set; } = null!;
+ public SelectDossierParams SelFilterDossier { get; set; } = null!;
#endregion Public Properties
#region Protected Fields
- protected string lastUpdate
- {
- get => SelFilter.lastUpdate;
- set => SelFilter.lastUpdate = value;
- }
-
#endregion Protected Fields
#region Protected Properties
- protected bool liveUpdate
- {
- get => SelFilter.LiveUpdate;
- set
- {
- if (!SelFilter.LiveUpdate.Equals(value))
- {
- SelFilter.LiveUpdate = value;
- if (!value)
- {
- SelFilter.CurrPage = 0;
- }
- reportChange();
- }
- }
- }
-
[Inject]
protected MpDataService MDService { get; set; } = null!;
- protected string selFlux
- {
- get
- {
- return SelFilter.CodFlux;
- }
- set
- {
- if (!SelFilter.CodFlux.Equals(value))
- {
- SelFilter.CurrPage = 1;
- SelFilter.CodFlux = value;
- StateHasChanged();
- Task.Delay(1);
- reportChange();
- }
- }
- }
protected string selMacchina
{
get
{
- return SelFilter.IdxMacchina;
+ return SelFilterDossier.IdxMacchina;
}
set
{
- if (!SelFilter.IdxMacchina.Equals(value))
+ if (!SelFilterDossier.IdxMacchina.Equals(value))
{
- SelFilter.CurrPage = 1;
- SelFilter.IdxMacchina = value;
- SelFilter.CodFlux = "*";
- ListFlux = MDService.ParametriGetFilt(selMacchina).Result;
+ SelFilterDossier.CurrPage = 1;
+ SelFilterDossier.IdxMacchina = value;
StateHasChanged();
Task.Delay(1);
reportChange();
@@ -102,36 +60,36 @@ namespace MP.SPEC.Components
}
}
+
protected int selMaxRecord
{
get
{
- return SelFilter.MaxRecord;
+ return SelFilterDossier.MaxRecord;
}
set
{
- if (!SelFilter.MaxRecord.Equals(value))
+ if (!SelFilterDossier.MaxRecord.Equals(value))
{
- SelFilter.MaxRecord = value;
+ SelFilterDossier.MaxRecord = value;
reportChange();
}
}
}
- protected int selTempoAgg
+ protected DateTime selDtRef
{
get
{
- return SelFilter.TempoAgg / 1000;
+ return SelFilterDossier.DtRef;
}
set
{
- int tempoMS = value * 1000;
- if (!SelFilter.TempoAgg.Equals(tempoMS))
+ if (!SelFilterDossier.DtRef.Equals(value))
{
- SelFilter.TempoAgg = tempoMS;
+ SelFilterDossier.DtRef = value;
reportChange();
}
}
@@ -143,10 +101,10 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
- SelFilter = new SelectFluxParams();
+ SelFilterDossier = new SelectDossierParams();
ListMacchine = await MDService.MacchineWithFlux();
- ListFlux = await MDService.ParametriGetFilt(selMacchina);
- await FilterChanged.InvokeAsync(SelFilter);
+ ListDossier = await MDService.DossiersGetLastFilt(selMacchina, selDtRef, selMaxRecord);
+ await FilterChanged.InvokeAsync(SelFilterDossier);
}
protected void toggleParams()
@@ -154,21 +112,11 @@ namespace MP.SPEC.Components
showEditPar = !showEditPar;
}
- protected async Task toggleUpdate()
- {
- liveUpdate = !liveUpdate;
- await Task.Delay(1);
- if (!liveUpdate)
- {
- lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
- }
- }
-
#endregion Protected Methods
#region Private Fields
- private List? ListFlux = null;
+ private List? ListDossier = null;
private List? ListMacchine = null;
#endregion Private Fields
@@ -183,7 +131,7 @@ namespace MP.SPEC.Components
private void reportChange()
{
- FilterChanged.InvokeAsync(SelFilter);
+ FilterChanged.InvokeAsync(SelFilterDossier);
}
#endregion Private Methods
diff --git a/MP.SPEC/Components/ListDossiers.razor b/MP.SPEC/Components/ListDossiers.razor
index 0745d5cb..0ff85078 100644
--- a/MP.SPEC/Components/ListDossiers.razor
+++ b/MP.SPEC/Components/ListDossiers.razor
@@ -1,9 +1,68 @@
-ListDossiers
+@using MP.SPEC.Components
+@using MP.SPEC.Data
+
+@if (ListRecords == null)
+{
+
+}
+else if (totalCount == 0)
+{
+ Nessun record trovato
+}
+else
+{
+
+
+
+
+
+
+ @* resetSel()" class="btn btn-primary btn-sm"> *@
+
+ Macchina
+ Data
+ ODL
+ DATA TYPE
+ Valore
+
+
+
+
+ @foreach (var record in ListRecords)
+ {
+
+
+ @* selRecord(record)" class="btn btn-primary btn-sm"> *@
+
+
+ @record.IdxMacchina
+
+
+ @record.DtRif
+
+
+ @record.IdxODL
+
+
+ @record.DataType
+
+
+ @record.Valore
+
+
+ @*@if (ArticoloDelEnabled(record.CodArticolo))
+ {
+ deleteRecord(record)" class="btn btn-danger btn-sm">
+ }*@
+
+
+ }
+
+
+
+
+}
+
-
- copiare da ListParameters
- metodo dati: DossiersGetLastFilt
- metodo dati x ora non fa cache redis (se vuoi provare...)
-
diff --git a/MP.SPEC/Components/ListDossiers.razor.cs b/MP.SPEC/Components/ListDossiers.razor.cs
index 872595ff..bf8615d6 100644
--- a/MP.SPEC/Components/ListDossiers.razor.cs
+++ b/MP.SPEC/Components/ListDossiers.razor.cs
@@ -14,10 +14,223 @@ using Microsoft.JSInterop;
using MP.SPEC;
using MP.SPEC.Shared;
using MP.SPEC.Components;
+using MP.Data.DatabaseModels;
+using MP.SPEC.Data;
+using System.Diagnostics;
namespace MP.SPEC.Components
{
public partial class ListDossiers
{
+ #region Public Properties
+
+ [Parameter]
+ public SelectDossierParams SelFilter { get; set; } = null!;
+
+ [Parameter]
+ public EventCallback TotRecordChanged { get; set; }
+
+ #endregion Public Properties
+
+ #region Public Methods
+
+ public string checkSelect(string IdxMacchina)
+ {
+ string answ = "";
+ if (currRecord != null)
+ {
+ try
+ {
+ answ = (currRecord.IdxMacchina == IdxMacchina) ? "table-info" : "";
+ }
+ catch
+ { }
+ }
+ return answ;
+ }
+
+#if false
+ public void Dispose()
+ {
+ aTimer.Elapsed -= ElapsedTimer;
+ MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
+ MessageService.EA_SearchUpdated -= OnSeachUpdated;
+ aTimer.Stop();
+ aTimer.Dispose();
+ }
+#endif
+
+ //public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
+ //{
+ // if (!isLoading && LiveUpdate)
+ // {
+ // aTimer.Stop();
+ // // inizio misura esecuzione
+ // Stopwatch stopWatch = new Stopwatch();
+ // stopWatch.Start();
+ // var pUpd = Task.Run(async () =>
+ // {
+ // await Task.Delay(1);
+ // await InvokeAsync(() => reloadData(true));
+ // });
+ // pUpd.Wait();
+ // // misuro tempo esecuzione
+ // stopWatch.Stop();
+ // TimeSpan ts = stopWatch.Elapsed;
+ // int deltaTime = RefreshPeriod - (int)ts.TotalMilliseconds;
+ // aTimer.Interval = deltaTime > 100 ? deltaTime : 100;
+ // aTimer.Start();
+ // }
+ //}
+
+ public async Task reloadData(bool setChanged)
+ {
+ isLoading = true;
+ SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelDtRef, MaxRecord);
+ totalCount = SearchRecords.Count;
+ ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+ await Task.Delay(1);
+ if (setChanged)
+ {
+ await InvokeAsync(() => StateHasChanged());
+ }
+ isLoading = false;
+ }
+
+ //public void StartTimer()
+ //{
+ // //int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
+ // aTimer = new System.Timers.Timer(RefreshPeriod);
+ // aTimer.Elapsed += ElapsedTimer;
+ // aTimer.Enabled = true;
+ // //aTimer.AutoReset = true;
+ // aTimer.Start();
+ //}
+
+ #endregion Public Methods
+
+ #region Protected Properties
+
+ [Inject]
+ protected IJSRuntime JSRuntime { get; set; } = null!;
+
+ [Inject]
+ protected MpDataService MDService { get; set; } = null!;
+
+ [Inject]
+ protected MessageService MessageService { get; set; } = null!;
+
+ //protected int RefreshPeriod
+ //{
+ // get => SelFilter.TempoAgg;
+ //}
+ //protected int RefreshPeriod { get; set; } = 5000;
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected override async Task OnInitializedAsync()
+ {
+ MessageService.EA_PageUpdated += MessageService_EA_PageUpdated;
+ MessageService.EA_SearchUpdated += OnSeachUpdated;
+
+ ListRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelDtRef, MaxRecord);
+
+ await reloadData();
+ }
+
+ protected async void OnSeachUpdated()
+ {
+ await InvokeAsync(() =>
+ {
+ //currPage = 1;
+ StateHasChanged();
+ });
+ }
+
+ protected async Task UpdateData()
+ {
+ currRecord = null;
+ await reloadData(true);
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ //private static System.Timers.Timer aTimer = null!;
+
+ private int _totalCount = 0;
+ private Dossiers? currRecord = null;
+ private List? ListRecords;
+ private List? SearchRecords;
+ private List? listaFlux;
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private int currPage
+ {
+ get => MessageService.currPage;
+ set => MessageService.currPage = value;
+ }
+
+ private bool isLoading { get; set; } = false;
+
+ private int MaxRecord
+ {
+ get => SelFilter.MaxRecord;
+ }
+
+ private int numRecord
+ {
+ get => MessageService.numRecord;
+ set => MessageService.numRecord = value;
+ }
+
+ private string SelMacchina
+ {
+ get => SelFilter.IdxMacchina;
+ }
+ private DateTime SelDtRef
+ {
+ get => SelFilter.DtRef;
+ }
+
+ private int totalCount
+ {
+ get => _totalCount;
+ set
+ {
+ if (_totalCount != value)
+ {
+ _totalCount = value;
+ TotRecordChanged.InvokeAsync(value);
+ }
+ }
+ }
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private async void MessageService_EA_PageUpdated()
+ {
+ await reloadData();
+ }
+ private async Task reloadData()
+ {
+ isLoading = true;
+ SearchRecords = await MDService.DossiersGetLastFilt(SelMacchina, SelDtRef, MaxRecord);
+ totalCount = SearchRecords.Count;
+ ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+ await Task.Delay(1);
+ await InvokeAsync(() => StateHasChanged());
+ isLoading = false;
+ }
+
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs
index 470a72b2..c3b3fbb5 100644
--- a/MP.SPEC/Data/MpDataService.cs
+++ b/MP.SPEC/Data/MpDataService.cs
@@ -322,6 +322,11 @@ namespace MP.SPEC.Data
return await Task.FromResult(dbController.DossiersGetLastFilt(IdxMacchina, DtRef, MaxRec));
}
+ public async Task> convertToFluxLog(string Valore)
+ {
+ return await Task.FromResult(dbController.convertToFluxLog(Valore));
+
+ }
///
/// Restitusice elenco aziende
diff --git a/MP.SPEC/Data/SelectDossierParams.cs b/MP.SPEC/Data/SelectDossierParams.cs
new file mode 100644
index 00000000..9c83245a
--- /dev/null
+++ b/MP.SPEC/Data/SelectDossierParams.cs
@@ -0,0 +1,53 @@
+namespace MP.SPEC.Data
+{
+ public class SelectDossierParams
+ {
+ #region Public Constructors
+
+ public SelectDossierParams()
+ { }
+
+ #endregion Public Constructors
+
+ #region Public Properties
+ public string IdxMacchina { get; set; } = "*";
+
+ public int MaxRecord { get; set; } = 100;
+ public DateTime DtRef { get; set; } = DateTime.Now;
+ public int CurrPage { get; set; } = 1;
+
+ #endregion Public Properties
+
+ #region Public Methods
+
+ public override bool Equals(object obj)
+ {
+ if (!(obj is SelectDossierParams item))
+ return false;
+
+ if (IdxMacchina != item.IdxMacchina)
+ return false;
+
+ ////if (MaxRecord != item.MaxRecord)
+ //// return false;
+
+ if (DtRef != item.DtRef)
+ return false;
+
+ if (CurrPage != item.CurrPage)
+ return false;
+
+ //if (lastUpdate != item.lastUpdate)
+ // return false;
+
+ return true;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Public Methods
+ }
+}
\ No newline at end of file
diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj
index a2e1a3e7..1c651398 100644
--- a/MP.SPEC/MP.SPEC.csproj
+++ b/MP.SPEC/MP.SPEC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.SPEC
- 6.15.2209.2009
+ 6.15.2209.2012
diff --git a/MP.SPEC/Pages/DOSS.razor b/MP.SPEC/Pages/DOSS.razor
index 0bdba786..29766f5f 100644
--- a/MP.SPEC/Pages/DOSS.razor
+++ b/MP.SPEC/Pages/DOSS.razor
@@ -14,7 +14,7 @@
}
else
{
-
+
}
@@ -27,11 +27,11 @@
else
{
@*
*@
-
+
}
diff --git a/MP.SPEC/Pages/DOSS.razor.cs b/MP.SPEC/Pages/DOSS.razor.cs
index 3c38b08b..2038917f 100644
--- a/MP.SPEC/Pages/DOSS.razor.cs
+++ b/MP.SPEC/Pages/DOSS.razor.cs
@@ -26,14 +26,6 @@ namespace MP.SPEC.Pages
numRecord = newNum;
}
- protected void ForceReloadPage(int newNum)
- {
- currPage = newNum;
- currFilter.lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}";
- currFilter.LiveUpdate = (currPage == 1);
- StateHasChanged();
- }
-
protected override async Task OnInitializedAsync()
{
isLoading = true;
@@ -45,20 +37,11 @@ namespace MP.SPEC.Pages
await Task.Delay(1);
var modFilter = currFilter;
modFilter.CurrPage = 1;
- modFilter.LiveUpdate = (currPage == 1);
currFilter = modFilter;
await Task.Delay(1);
isFiltering = false;
}
- protected async Task pgResetReq(bool doReset)
- {
- if (doReset)
- {
- await pagerODL.resetCurrPage();
- }
- }
-
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
@@ -68,7 +51,7 @@ namespace MP.SPEC.Pages
#region Private Properties
- private SelectFluxParams currFilter { get; set; } = new SelectFluxParams();
+ private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
@@ -91,21 +74,12 @@ namespace MP.SPEC.Pages
#region Private Methods
- private async Task updateFilter(SelectFluxParams newParams)
+ private async Task updateFilter(SelectDossierParams newParams)
{
isFiltering = false;
isLoading = true;
await Task.Delay(1);
currPage = 1;
- if (newParams.CurrPage == 0)
- {
- newParams.CurrPage = 1;
- newParams.LiveUpdate = false;
- }
- else
- {
- newParams.LiveUpdate = (currPage == 1);
- }
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
currFilter = newParams;
diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html
index d198161f..ab973ab1 100644
--- a/MP.SPEC/Resources/ChangeLog.html
+++ b/MP.SPEC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
-
Versione: 6.15.2209.2009
+
Versione: 6.15.2209.2012
Note di rilascio:
diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt
index 5047ec82..1d498c2e 100644
--- a/MP.SPEC/Resources/VersNum.txt
+++ b/MP.SPEC/Resources/VersNum.txt
@@ -1 +1 @@
-6.15.2209.2009
+6.15.2209.2012
diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml
index 3c5aa0b3..69e51e79 100644
--- a/MP.SPEC/Resources/manifest.xml
+++ b/MP.SPEC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
-
6.15.2209.2009
+ 6.15.2209.2012
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