Continuo porting pagine a gestione TabDataFeeder
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class=" col-4 col-sm-4 col-md-4 col-lg-2 flex-fill ">
|
||||
<div class=" col-4 col-sm-4 col-md-4 col-lg-2 flex-fill2 ">
|
||||
<div class="p-2 h-100 w-100">
|
||||
<div class="@objCss text-center card w-100 h-100" @onclick="() => ReportSelected()">
|
||||
<div class="card-body text-light">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2402.2616</Version>
|
||||
<Version>6.16.2402.2618</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@page "/declarations"
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
{
|
||||
@@ -12,7 +14,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -20,11 +22,15 @@ namespace MP_TAB3.Pages
|
||||
#region Protected Properties
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -32,6 +38,7 @@ namespace MP_TAB3.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
@@ -67,6 +74,35 @@ namespace MP_TAB3.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@page "/machine-detail"
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
@@ -13,7 +15,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -21,6 +23,7 @@ namespace MP_TAB3.Pages
|
||||
#region Protected Properties
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
@@ -32,6 +35,9 @@ namespace MP_TAB3.Pages
|
||||
[Inject]
|
||||
protected TabDataService TabServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -39,6 +45,7 @@ namespace MP_TAB3.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
if (enableSchedaTecnica)
|
||||
{
|
||||
checkLottiOdl();
|
||||
@@ -81,8 +88,11 @@ namespace MP_TAB3.Pages
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private bool enableMagLotti = false;
|
||||
|
||||
private bool enableSchedaTecnica = false;
|
||||
|
||||
private string IdxMaccSubSel = "";
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -113,6 +123,35 @@ namespace MP_TAB3.Pages
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@page "/odl"
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
@@ -13,7 +15,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -21,11 +23,15 @@ namespace MP_TAB3.Pages
|
||||
#region Protected Properties
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -33,6 +39,7 @@ namespace MP_TAB3.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
@@ -71,12 +78,42 @@ namespace MP_TAB3.Pages
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private string IdxMaccSubSel = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
@page "/parameters"
|
||||
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
{
|
||||
@@ -12,7 +14,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -20,11 +22,15 @@ namespace MP_TAB3.Pages
|
||||
#region Protected Properties
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -32,6 +38,7 @@ namespace MP_TAB3.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
@@ -56,6 +63,35 @@ namespace MP_TAB3.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
@page "/prod-stop"
|
||||
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -3,6 +3,7 @@ using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using MP_TAB3.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
@@ -15,7 +16,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -23,10 +24,15 @@ namespace MP_TAB3.Pages
|
||||
#region Protected Fields
|
||||
|
||||
protected int dltMinRealtime = 1;
|
||||
|
||||
protected bool isProcessing = false;
|
||||
|
||||
protected int minAnticipoRicalcolo = 1;
|
||||
|
||||
protected bool rdm_ChkOnly = false;
|
||||
|
||||
protected int rdm_nEvCheck = 1;
|
||||
|
||||
protected int rdm_nEvStep = 1;
|
||||
|
||||
#endregion Protected Fields
|
||||
@@ -79,6 +85,9 @@ namespace MP_TAB3.Pages
|
||||
[Inject]
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -231,6 +240,7 @@ namespace MP_TAB3.Pages
|
||||
rdm_ChkOnly = SMServ.GetConfBool("rdm_ChkOnly");
|
||||
// leggo gli altri dati
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
protected async Task RefreshData(List<MappaStatoExpl> newList)
|
||||
@@ -274,6 +284,35 @@ namespace MP_TAB3.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@page "/status-map"
|
||||
|
||||
@* <MseSampler SampleMult="1.5" E_Updated="SaveData"></MseSampler> *@
|
||||
<div class="pe-2">
|
||||
<div class="row mb-2">
|
||||
@if (ListMSE == null || ListMSE.Count == 0 || isCalcSize)
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
ListMSE = null;
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
TDFeeder.blinkPipe.EA_NewMessage -= BlinkPipe_EA_NewMessage;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
@@ -134,13 +133,11 @@ namespace MP_TAB3.Pages
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ListMSE = null;
|
||||
setDefaults();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
TDFeeder.blinkPipe.EA_NewMessage += BlinkPipe_EA_NewMessage;
|
||||
Random rnd = new Random();
|
||||
await Task.Delay(rnd.Next(10, 20));
|
||||
SetupConf();
|
||||
@@ -183,29 +180,6 @@ namespace MP_TAB3.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void BlinkPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
var dataRaw = JsonConvert.DeserializeObject<string>(currArgs.newMessage);
|
||||
if (dataRaw != null)
|
||||
{
|
||||
bool.TryParse($"{dataRaw}", out doBlink);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
@@ -223,23 +197,6 @@ namespace MP_TAB3.Pages
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
#if false
|
||||
// se ho filtro macchine --> tengo solo quelle che mi tornano...
|
||||
if (listMacchine != null && listMacchine.Count > 0)
|
||||
{
|
||||
List<MappaStatoExpl> listaFilt = new List<MappaStatoExpl>();
|
||||
foreach (var item in listMacchine)
|
||||
{
|
||||
var rigaFilt = dataList.FirstOrDefault(x => x.IdxMacchina == item.IdxMacchina);
|
||||
if (rigaFilt != null)
|
||||
{
|
||||
listaFilt.Add(rigaFilt);
|
||||
}
|
||||
}
|
||||
dataList = listaFilt;
|
||||
}
|
||||
ListMSE = dataList;
|
||||
#endif
|
||||
SaveData(dataList);
|
||||
}
|
||||
}
|
||||
@@ -248,11 +205,6 @@ namespace MP_TAB3.Pages
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
#if false
|
||||
// attesa random 0-50ms...
|
||||
Random rnd = new Random();
|
||||
Task.Delay(rnd.Next(5, 50));
|
||||
#endif
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
@@ -266,7 +218,6 @@ namespace MP_TAB3.Pages
|
||||
isCalcSize = true;
|
||||
}
|
||||
|
||||
|
||||
private void SetupConf()
|
||||
{
|
||||
// sistemo i parametri opzionali...
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
@page "/tech-sheet"
|
||||
|
||||
|
||||
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
|
||||
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP_TAB3.Pages
|
||||
{
|
||||
@@ -12,7 +14,7 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
IdxMacc = "";
|
||||
CurrMSE = null;
|
||||
//GC.Collect();
|
||||
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
@@ -28,6 +30,9 @@ namespace MP_TAB3.Pages
|
||||
[Inject]
|
||||
protected TabDataService TabDServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataFeeder TDFeeder { get; set; } = null!;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -35,6 +40,7 @@ namespace MP_TAB3.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await ReloadData();
|
||||
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
|
||||
SetupConf();
|
||||
}
|
||||
|
||||
@@ -68,6 +74,35 @@ namespace MP_TAB3.Pages
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Ricevuto nuovi dati da mostrare!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly List<string> --> allarmi
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
try
|
||||
{
|
||||
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
|
||||
if (dataList != null)
|
||||
{
|
||||
InvokeAsync(() => RefreshData(dataList));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
InvokeAsync(() =>
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2402.2616</h4>
|
||||
<h4>Versione: 6.16.2402.2618</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2402.2616
|
||||
6.16.2402.2618
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2402.2616</version>
|
||||
<version>6.16.2402.2618</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>
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace MP.Data.Services
|
||||
/// <summary>
|
||||
/// Cache brevissima durata
|
||||
/// </summary>
|
||||
private TimeSpan UltraFastCache = TimeSpan.FromMilliseconds(1000);
|
||||
private TimeSpan UltraFastCache = TimeSpan.FromMilliseconds(1100);
|
||||
|
||||
/// <summary>
|
||||
/// Cache lunga durata
|
||||
|
||||
@@ -16,7 +16,9 @@ namespace MP.Data.Services
|
||||
|
||||
// setup canali pub/sub
|
||||
dataPipe = new MessagePipe(redisConn, Constants.TAB_ACT_MSE_DATA_KEY, false);
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.TAB_ACT_BLINK_KEY, false);
|
||||
#if false
|
||||
blinkPipe = new MessagePipe(redisConn, Constants.TAB_ACT_BLINK_KEY, false);
|
||||
#endif
|
||||
|
||||
// avvio timers...
|
||||
startTimers();
|
||||
@@ -26,7 +28,9 @@ namespace MP.Data.Services
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
#if false
|
||||
public MessagePipe blinkPipe { get; set; } = null!;
|
||||
#endif
|
||||
|
||||
public MessagePipe dataPipe { get; set; } = null!;
|
||||
|
||||
@@ -89,26 +93,10 @@ namespace MP.Data.Services
|
||||
{
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
// secondi pari --> blink, secondi dispari --> ricarica
|
||||
DateTime adesso = DateTime.Now;
|
||||
int resto = 0;
|
||||
Math.DivRem(adesso.Second, 2, out resto);
|
||||
if (resto == 0)
|
||||
{
|
||||
// invio in channel blink il segnale
|
||||
blinkPipe.sendMessage("true");
|
||||
Log.Debug("Elapsed Fast Timer Blink");
|
||||
}
|
||||
else
|
||||
{
|
||||
// invio in channel blink segnale false
|
||||
blinkPipe.sendMessage("false");
|
||||
// rileggo dati...
|
||||
var newData = await MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
Log.Debug("Elapsed Fast Timer reload");
|
||||
}
|
||||
var newData = await MseGetAll();
|
||||
// invio tramite la pipe...
|
||||
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
|
||||
Log.Debug("Elapsed Fast Timer reload");
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user