diff --git a/MP.Data/MP.Data.csproj b/MP.Data/MP.Data.csproj
index 41f08fa6..4f1b7c7e 100644
--- a/MP.Data/MP.Data.csproj
+++ b/MP.Data/MP.Data.csproj
@@ -12,14 +12,14 @@
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
\ No newline at end of file
diff --git a/MP.Mon/Components/CmpFooter.razor b/MP.Mon/Components/CmpFooter.razor
index 507af4e6..e0e57471 100644
--- a/MP.Mon/Components/CmpFooter.razor
+++ b/MP.Mon/Components/CmpFooter.razor
@@ -7,41 +7,3 @@
-@code {
-
- Version version = typeof(Program).Assembly.GetName().Version;
-
- protected override async Task OnInitializedAsync()
- {
- StartTimer();
- }
-
- public void Dispose()
- {
- aTimer.Stop();
- aTimer.Dispose();
- }
-
- private static System.Timers.Timer aTimer;
-
- public void StartTimer()
- {
- int tOutPeriod = 1000;
- //int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
- aTimer = new System.Timers.Timer(tOutPeriod);
- aTimer.Elapsed += ElapsedTimer;
- aTimer.Enabled = true;
- aTimer.Start();
- }
-
- public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
- {
- var pUpd = Task.Run(async () =>
- {
- //await ReloadData();
- await Task.Delay(1);
- await InvokeAsync(StateHasChanged);
- });
- pUpd.Wait();
- }
-}
\ No newline at end of file
diff --git a/MP.Mon/Components/CmpFooter.razor.cs b/MP.Mon/Components/CmpFooter.razor.cs
new file mode 100644
index 00000000..71252e09
--- /dev/null
+++ b/MP.Mon/Components/CmpFooter.razor.cs
@@ -0,0 +1,55 @@
+namespace MP.Mon.Components
+{
+ public partial class CmpFooter
+ {
+ #region Public Methods
+
+ public void Dispose()
+ {
+ aTimer.Stop();
+ aTimer.Dispose();
+ }
+
+ public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
+ {
+ var pUpd = Task.Run(async () =>
+ {
+ //await ReloadData();
+ await Task.Delay(1);
+ await InvokeAsync(StateHasChanged);
+ });
+ pUpd.Wait();
+ }
+
+ public void StartTimer()
+ {
+ int tOutPeriod = 1000;
+ //int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod);
+ aTimer = new System.Timers.Timer(tOutPeriod);
+ aTimer.Elapsed += ElapsedTimer;
+ aTimer.Enabled = true;
+ aTimer.Start();
+ }
+
+ #endregion Public Methods
+
+ #region Protected Methods
+
+ protected override async Task OnInitializedAsync()
+ {
+ var currAssembly = typeof(Program).Assembly.GetName();
+ version = currAssembly.Version != null ? currAssembly.Version : new Version();
+ StartTimer();
+ await Task.Delay(1);
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private static System.Timers.Timer aTimer = null!;
+ private Version version = null!;
+
+ #endregion Private Fields
+ }
+}
\ No newline at end of file
diff --git a/MP.Mon/Components/DetailMSE.razor b/MP.Mon/Components/DetailMSE.razor
index 0700a123..f8e39dad 100644
--- a/MP.Mon/Components/DetailMSE.razor
+++ b/MP.Mon/Components/DetailMSE.razor
@@ -54,7 +54,7 @@
{
@CurrRecord.DescrizioneStato
-
@getMinSec((decimal)CurrRecord.Durata)
+
@getMinSec(getDecimal(@CurrRecord.Durata))
}
@if (hasRow(3))
diff --git a/MP.Mon/Components/DetailMSE.razor.cs b/MP.Mon/Components/DetailMSE.razor.cs
index 60202343..c9e91dd1 100644
--- a/MP.Mon/Components/DetailMSE.razor.cs
+++ b/MP.Mon/Components/DetailMSE.razor.cs
@@ -140,7 +140,7 @@ namespace MP.Mon.Components
aTimer.Dispose();
}
- public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e)
+ public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
@@ -168,7 +168,7 @@ namespace MP.Mon.Components
{
StartTimer();
Random rnd = new Random();
- //await Task.Delay(rnd.Next(500));
+ await Task.Delay(rnd.Next(5));
dataLoaded = true;
setupConf();
}
@@ -219,13 +219,24 @@ namespace MP.Mon.Components
return answ;
}
+ private decimal getDecimal(object? rawData)
+ {
+ decimal answ = 0;
+ if (rawData != null)
+ {
+ decimal.TryParse($"{rawData}", out answ);
+ }
+ return answ;
+ }
+
private string getMinSec(decimal? currTimeMin)
{
string answ = "nd";
TimeSpan tSpan = new TimeSpan(0);
try
{
- tSpan = TimeSpan.FromMinutes((double)currTimeMin);
+ double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0;
+ tSpan = TimeSpan.FromMinutes(cTimeMin);
answ = $"{tSpan:mm}:{tSpan:ss}";
}
catch
diff --git a/MP.Mon/Conf/iobTagsConf.json b/MP.Mon/Conf/iobTagsConf.json
index f216a4d6..b39524e7 100644
--- a/MP.Mon/Conf/iobTagsConf.json
+++ b/MP.Mon/Conf/iobTagsConf.json
@@ -1,90 +1,5 @@
{
"IobSetup": {
- "***": [
- {
- "ColNum": 1,
- "RowNum": 5,
- "TagCss": "fontSmall",
- "TagName": "Feed Over",
- "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER"
- },
- {
- "ColNum": 2,
- "RowNum": 5,
- "TagCss": "fontSmall",
- "TagName": "Rapid Over",
- "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER"
- }
- ],
- "SIMUL_01": [
- {
- "ColNum": 1,
- "RowNum": 6,
- "TagCss": "fontSmall",
- "TagName": "Power",
- "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01"
- }
- ],
- "SIMUL_02": [
- {
- "ColNum": 1,
- "RowNum": 6,
- "TagCss": "fontSmall",
- "TagName": "Power",
- "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01"
- }
- ],
- "GIACO_ICOEL_001": [
- {
- "ColNum": 1,
- "RowNum": 1,
- "TagName": "Vel",
- "TagLocation": "FluxData:TonnOra"
- },
- {
- "ColNum": 2,
- "RowNum": 1,
- "TagName": "Vel",
- "TagLocation": "FluxData:PezziMin"
- },
- {
- "ColNum": 1,
- "RowNum": 2,
- "TagName": "Batch SX",
- "TagLocation": "FluxData:BatchL1"
- },
- {
- "ColNum": 2,
- "RowNum": 2,
- "TagName": "Batch DX",
- "TagLocation": "FluxData:BatchL2"
- }
- ],
- "GIACO_ICOEL_002": [
- {
- "ColNum": 1,
- "RowNum": 1,
- "TagName": "Vel",
- "TagLocation": "FluxData:TonnOra"
- },
- {
- "ColNum": 2,
- "RowNum": 1,
- "TagName": "Vel",
- "TagLocation": "FluxData:PezziMin"
- },
- {
- "ColNum": 1,
- "RowNum": 2,
- "TagName": "Batch SX",
- "TagLocation": "FluxData:BatchL1"
- },
- {
- "ColNum": 2,
- "RowNum": 2,
- "TagName": "Batch DX",
- "TagLocation": "FluxData:BatchL2"
- }
- ]
+ "***": []
}
}
\ No newline at end of file
diff --git a/MP.Mon/Conf/iobTagsConf.office.json b/MP.Mon/Conf/iobTagsConf.office.json
new file mode 100644
index 00000000..f216a4d6
--- /dev/null
+++ b/MP.Mon/Conf/iobTagsConf.office.json
@@ -0,0 +1,90 @@
+{
+ "IobSetup": {
+ "***": [
+ {
+ "ColNum": 1,
+ "RowNum": 5,
+ "TagCss": "fontSmall",
+ "TagName": "Feed Over",
+ "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER"
+ },
+ {
+ "ColNum": 2,
+ "RowNum": 5,
+ "TagCss": "fontSmall",
+ "TagName": "Rapid Over",
+ "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER"
+ }
+ ],
+ "SIMUL_01": [
+ {
+ "ColNum": 1,
+ "RowNum": 6,
+ "TagCss": "fontSmall",
+ "TagName": "Power",
+ "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01"
+ }
+ ],
+ "SIMUL_02": [
+ {
+ "ColNum": 1,
+ "RowNum": 6,
+ "TagCss": "fontSmall",
+ "TagName": "Power",
+ "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01"
+ }
+ ],
+ "GIACO_ICOEL_001": [
+ {
+ "ColNum": 1,
+ "RowNum": 1,
+ "TagName": "Vel",
+ "TagLocation": "FluxData:TonnOra"
+ },
+ {
+ "ColNum": 2,
+ "RowNum": 1,
+ "TagName": "Vel",
+ "TagLocation": "FluxData:PezziMin"
+ },
+ {
+ "ColNum": 1,
+ "RowNum": 2,
+ "TagName": "Batch SX",
+ "TagLocation": "FluxData:BatchL1"
+ },
+ {
+ "ColNum": 2,
+ "RowNum": 2,
+ "TagName": "Batch DX",
+ "TagLocation": "FluxData:BatchL2"
+ }
+ ],
+ "GIACO_ICOEL_002": [
+ {
+ "ColNum": 1,
+ "RowNum": 1,
+ "TagName": "Vel",
+ "TagLocation": "FluxData:TonnOra"
+ },
+ {
+ "ColNum": 2,
+ "RowNum": 1,
+ "TagName": "Vel",
+ "TagLocation": "FluxData:PezziMin"
+ },
+ {
+ "ColNum": 1,
+ "RowNum": 2,
+ "TagName": "Batch SX",
+ "TagLocation": "FluxData:BatchL1"
+ },
+ {
+ "ColNum": 2,
+ "RowNum": 2,
+ "TagName": "Batch DX",
+ "TagLocation": "FluxData:BatchL2"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/MP.Mon/Data/MpDataService.cs b/MP.Mon/Data/MpDataService.cs
index b95602c0..cda398cd 100644
--- a/MP.Mon/Data/MpDataService.cs
+++ b/MP.Mon/Data/MpDataService.cs
@@ -11,14 +11,14 @@ namespace MP.Mon.Data
{
#region Public Fields
- public static MP.Data.Controllers.MpMonController dbController;
+ public static MP.Data.Controllers.MpMonController dbController { get; set; } = null!;
#endregion Public Fields
#region Private Fields
- private static IConfiguration _configuration;
- private static ILogger