diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor
index 95392f3..42a9a9a 100644
--- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor
+++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor
@@ -1,18 +1,26 @@
@page "/AlarmsAnalysis"
@*@page "/controlli/{IdxMacchina}"*@
-@using MP.Stats.Components
+@using MP.MONO.UI.Components
@if (ShowCharts == true)
{
-
- }
+ @* *@
+ }@*
+ @if (currRecord != null)
+ {
+
+ }*@
@if (ListRecords == null)
{
@@ -25,51 +33,40 @@
{
-
+
- | DateTime start |
- Error |
- Status |
- Duration |
+ Alarm Description |
+ Alarm Event Count |
+ Event Frequence |
+ Event Frequence Chart |
- @foreach (var record in ListRecordsREC)
+ @foreach (var record in ListRecords)
{
-
- |
- @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss")
+ |
+ |
+ @record.AlarmDescription
|
- @record.AlarmListNav.FullValue
+ @record.EventCount
|
- Fixing...
+
+ @if (totalEvents != 0)
+ {
+ @calcPerc((double)record.EventCount)
+ }
+
|
-
- @TimeSpan.FromMinutes(@record.Duration)
+
|
}
- else
- {
-
- |
- @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss")
- |
-
- @record.AlarmListNav.FullValue
- |
-
- FIXED
- |
-
- @TimeSpan.FromMinutes(@record.Duration)
- |
-
- }
@@ -77,7 +74,7 @@
}
diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs
index a202b20..e7527a4 100644
--- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs
+++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs
@@ -16,6 +16,11 @@ using MP.MONO.UI.Shared;
using MP.MONO.UI.Components;
using MP.MONO.Data.DbModels;
using MP.MONO.UI.Data;
+using MP.MONO.Data.DTO;
+using System.Diagnostics.Tracing;
+using System.Security.Cryptography.X509Certificates;
+using System.DirectoryServices.Protocols;
+using System.Security;
namespace MP.MONO.UI.Pages
{
@@ -23,11 +28,11 @@ namespace MP.MONO.UI.Pages
{
#region Private Fields
- private AlarmRecModel currRecord = null;
+ private AlarmFreqDTO currRecord = null;
- private string fileName = "Controlli.csv";
- private List ListRecords;
- private List SearchRecords;
+ private List ListRecords;
+
+ private List SearchRecords;
#endregion Private Fields
@@ -36,6 +41,8 @@ namespace MP.MONO.UI.Pages
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
+ protected int totalEvents = 0;
+ protected string percEvents = "";
private int currPage
{
@@ -45,11 +52,25 @@ namespace MP.MONO.UI.Pages
if (_currPage != value)
{
_currPage = value;
- var pUpd = Task.Run(async () => await reloadData());
+ var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
+ protected int _numHourPrev = 24;
+ protected int numHourPrev
+ {
+ get => _numHourPrev;
+ set
+ {
+ _numHourPrev = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ });
+ pUpd.Wait();
+ }
+ }
private bool isLoading { get; set; } = false;
@@ -61,18 +82,24 @@ namespace MP.MONO.UI.Pages
if (_numRecord != value)
{
_numRecord = value;
- var pUpd = Task.Run(async () => await reloadData());
+ var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
- private bool ShowCharts { get; set; } = false;
+ private bool ShowCharts { get; set; } = true;
#endregion Private Properties
#region Protected Properties
+ [Inject]
+ protected IJSRuntime JSRuntime { get; set; }
+
+ [Inject]
+ protected NavigationManager NavManager { get; set; }
+
protected int totalCount
{
get
@@ -85,21 +112,20 @@ namespace MP.MONO.UI.Pages
return answ;
}
}
- protected int machine { get; set; } = ListRecords.Select(x => x.MachineId).FirstOrDefault();
#endregion Protected Properties
- #region Public Properties
+ #region Private Methods isLoading = false;
+ //}
- #endregion Public Properties
-
- #region Private Methods
-
- private async Task reloadData()
+ private async Task ReloadData()
{
isLoading = true;
- SearchRecords = await MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq();
+ DateTime adesso = DateTime.Now;
+ SearchRecords = CurrentDataService.dbController.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso);
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+ totalEvents = SearchRecords.Sum(x => x.EventCount);
+ calcolaSoglie();
isLoading = false;
}
@@ -120,53 +146,118 @@ namespace MP.MONO.UI.Pages
protected override async Task OnInitializedAsync()
{
numRecord = 10;
- await reloadData();
+ SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now);
+ ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
+ await ReloadData();
+ }
+ private double sogliaGreen = 0;
+ private double sogliaRed = 1;
+ private void calcolaSoglie()
+ {
+ int numRecord = SearchRecords.Count;
+ var firstRecord = SearchRecords.Skip((int)(numRecord * 0.2)).FirstOrDefault();
+ var lastRecord = SearchRecords.Skip((int)(numRecord * 0.8)).FirstOrDefault();
+ if (firstRecord != null)
+ {
+ sogliaGreen = (double)firstRecord.EventCount / totalEvents;
+ }
+ if (lastRecord != null)
+ {
+ sogliaRed = (double)lastRecord.EventCount / totalEvents;
+ }
}
protected void ResetData()
{
currRecord = null;
}
+ protected string calcPerc(double numEvent)
+ {
+ string ans = $"{numEvent / totalEvents:P2}";
+
+ return ans;
+ }
+ protected string calcPercStyle(double numEvent)
+ {
+ string perc = $"{numEvent / totalEvents:P2}";
+ string percs = perc.Substring(0, perc.Length - 1);
+ string ans = $"width: {@Math.Round(double.Parse(percs), 0)}%";
+
+ return ans;
+ }
+
+ protected string val(int eventCount)
+ {
+ int max = SearchRecords.Max(a => a.EventCount);
+
+ string ans = $"{eventCount/max}";
+
+ return ans;
+ }
+
+ protected string styleColourPBar(double eventFreq)
+ {
+ string ans = "";
+ var source = ListRecords;
+
+ calcolaSoglie();
+
+ if (eventFreq >= sogliaGreen)
+ {
+ ans = "bg-danger";
+ }
+ else if (eventFreq <= sogliaRed)
+ {
+ ans = "bg-success";
+ }
+ else
+ {
+ ans = "bg-warning";
+ }
+
+
+ return ans;
+ }
+
+ protected void Select(AlarmFreqDTO selRecord)
+ {
+ // applico filtro da selezione
+ currRecord = selRecord;
+ }
protected async Task ToggleChart(bool doShow)
{
ShowCharts = !ShowCharts;
if (ShowCharts)
{
- await reloadData();
+ await ReloadData();
}
}
protected async Task UpdateData()
{
currRecord = null;
- await reloadData();
+ await ReloadData();
}
#endregion Protected Methods
-
+
#region Public Methods
- public string checkSelect(int IdxMacchina)
+ public string checkSelect(DateTime DtStart, double EventCount, int IdxMacchina)
{
string answ = "";
if (currRecord != null)
{
try
{
- answ = (currRecord.MachineId == IdxMacchina) ? "table-info" : "";
+ answ = (currRecord.MachineId == IdxMacchina && currRecord.EventCount == EventCount) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
-
- public void Dispose()
- {
- //MessageService.EA_SearchUpdated -= OnSeachUpdated;
- }
-
public async void OnSeachUpdated()
{
await InvokeAsync(() =>
diff --git a/MP.MONO.UI/Pages/Parameters.razor b/MP.MONO.UI/Pages/Parameters.razor
index 3f8cfbd..92d09f5 100644
--- a/MP.MONO.UI/Pages/Parameters.razor
+++ b/MP.MONO.UI/Pages/Parameters.razor
@@ -73,18 +73,23 @@
{
- @foreach (var item in selParams)
+ @if (isRT)
{
-
- @if (isRT)
- {
+ @foreach (var item in selParams)
+ {
+
+
+ }
+ }
+ else
+ {
+ @foreach (var item in selParams)
+ {
+
+ }
}
}
diff --git a/MP.MONO.UI/Pages/Parameters.razor.cs b/MP.MONO.UI/Pages/Parameters.razor.cs
index 709b692..91fce93 100644
--- a/MP.MONO.UI/Pages/Parameters.razor.cs
+++ b/MP.MONO.UI/Pages/Parameters.razor.cs
@@ -1,3 +1,6 @@
+using MP.MONO.UI.Data;
+
+
namespace MP.MONO.UI.Pages
{
public partial class Parameters
@@ -7,8 +10,18 @@ namespace MP.MONO.UI.Pages
private int maxRecord = 120;
private bool showParam = false;
- private DateTime DateFrom = DateTime.Today.AddDays(-2);
- private DateTime DateTo = DateTime.Today.AddDays(1);
+ private DateTime DateFrom
+ {
+ get => SelFilter.DtStart;
+ set => SelFilter.DtStart = value;
+ }
+ private DateTime DateTo
+ {
+ get => SelFilter.DtEnd;
+ set => SelFilter.DtEnd = value;
+ }
+
+ protected DataLogFilter SelFilter { get; set; } = new DataLogFilter();
#endregion Private Fields
diff --git a/MP.MONO.UI/Pages/Test.razor b/MP.MONO.UI/Pages/Test.razor
index b4d5ab2..af70158 100644
--- a/MP.MONO.UI/Pages/Test.razor
+++ b/MP.MONO.UI/Pages/Test.razor
@@ -6,17 +6,21 @@
@if (ListRecords == null)
{
}
- @*else if (totalCount == 0)
- {
- No record found
- }*@
else
{
@@ -41,7 +45,7 @@
- @if (totalEvents!= 0)
+ @if (totalEvents != 0)
{
@($"{(double)record.EventCount/totalEvents:P2}")
}
diff --git a/MP.MONO.UI/Pages/Test.razor.cs b/MP.MONO.UI/Pages/Test.razor.cs
index fcc5536..9d5434a 100644
--- a/MP.MONO.UI/Pages/Test.razor.cs
+++ b/MP.MONO.UI/Pages/Test.razor.cs
@@ -20,18 +20,37 @@ namespace MP.MONO.UI.Pages
{
public partial class Test
{
+ protected int _numHourPrev = 24;
+ protected int numHourPrev
+ {
+ get => _numHourPrev;
+ set
+ {
+ _numHourPrev = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ });
+ pUpd.Wait();
+ }
+ }
protected int totalCount = 0;
protected int totalEvents = 0;
protected List ListRecords = new List();
protected override async Task OnInitializedAsync()
{
- await Task.Delay(1);
- DateTime adesso = DateTime.Now;
- ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddDays(-1), adesso);
- totalCount = ListRecords.Count;
- totalEvents = ListRecords.Sum(x => x.EventCount);
+ await ReloadData();
}
+ private async Task ReloadData()
+ {
+ await Task.Delay(1);
+ DateTime adesso = DateTime.Now;
+ ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso);
+ totalCount = ListRecords.Count;
+ totalEvents = ListRecords.Sum(x => x.EventCount);
+ await Task.Delay(1);
+ }
}
}
\ No newline at end of file
diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html
index 4541d50..39c315b 100644
--- a/MP.MONO.UI/Resources/ChangeLog.html
+++ b/MP.MONO.UI/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
MAPO-MONO
- Version: 1.2.2209.2216
+ Version: 1.2.2209.2318
Release Note:
-
diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt
index e5ec7b6..f67a0bd 100644
--- a/MP.MONO.UI/Resources/VersNum.txt
+++ b/MP.MONO.UI/Resources/VersNum.txt
@@ -1 +1 @@
-1.2.2209.2216
+1.2.2209.2318
diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml
index d4e91b6..ccaedc1 100644
--- a/MP.MONO.UI/Resources/manifest.xml
+++ b/MP.MONO.UI/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.2.2209.2216
+ 1.2.2209.2318
http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip
http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html
false
diff --git a/MP.MONO.UI/temp/InfoData.json b/MP.MONO.UI/temp/InfoData.json
index 962a618..356169e 100644
--- a/MP.MONO.UI/temp/InfoData.json
+++ b/MP.MONO.UI/temp/InfoData.json
@@ -2,55 +2,55 @@
"AdapterType": "Ethernet 802.3",
"AddressWidth": "64",
"Architecture": "9",
- "BiosVersion": "_ASUS_ - 1072009",
- "BuildNumber": "19043",
- "Caption": "Microsoft Windows 10 Pro",
- "ConfiguredClockSpeed": "2400",
+ "BiosVersion": "ALASKA - 1072009",
+ "BuildNumber": "19044",
+ "Caption": "Microsoft Windows 10 Pro N",
+ "ConfiguredClockSpeed": "3600",
"ConfiguredVoltage": "1200",
"CpuVersion": "Modello 1, Stepping 0",
- "CurrentClockSpeed": "2200",
- "CurrentVoltage": "12",
+ "CurrentClockSpeed": "3501",
+ "CurrentVoltage": "11",
"DataWidth": "64",
- "Description": "AMD64 Family 23 Model 17 Stepping 0",
- "DeviceLocator": "ChannelA-DIMM0",
+ "Description": "AMD64 Family 23 Model 113 Stepping 0",
+ "DeviceLocator": "DIMM 1",
"ExtClock": "100",
"Family": "107",
- "FormFactor": "12",
- "GUID": "{7F313732-DBA3-46E5-9FA7-BEF235B0682E}",
- "L2CacheSize": "2048",
- "L3CacheSize": "4096",
+ "FormFactor": "8",
+ "GUID": "{E76995C4-F180-406E-B9C3-E491C65A8FCF}",
+ "L2CacheSize": "8192",
+ "L3CacheSize": "65536",
"Level": "23",
- "LoadPercentage": "23",
- "MACAddress": "4C:ED:FB:D9:78:83",
- "Manufacturer": "American Megatrends Inc.",
+ "LoadPercentage": "14",
+ "MACAddress": "0C:9D:92:B8:FD:E8",
+ "Manufacturer": "American Megatrends International, LLC.",
"MaxNumberOfProcesses": "4294967295",
"MaxProcessMemorySize": "137438953344",
"MaxVoltage": "1200",
"MinVoltage": "1200",
- "Name": "Realtek PCIe GbE Family Controller",
- "NumberOfCores": "4",
- "NumberOfLogicalProcessors": "8",
+ "Name": "ASUS XG-C100C 10G PCI-E Network Adapter",
+ "NumberOfCores": "16",
+ "NumberOfLogicalProcessors": "32",
"OSArchitecture": "64 bit",
- "PartNumber": "8ATF1G64HZ-2G3E1 ",
+ "PartNumber": "CMK64GX4M2D3600C18",
"PhysicalAdapter": "True",
- "ProcessorId": "178BFBFF00810F10",
+ "ProcessorId": "178BFBFF00870F10",
"ProcessorType": "3",
- "ProductName": "Realtek PCIe GbE Family Controller",
- "ReleaseDate": "20190521000000.000000+000",
- "Revision": "4352",
+ "ProductName": "ASUS XG-C100C 10G PCI-E Network Adapter",
+ "ReleaseDate": "20210521000000.000000+000",
+ "Revision": "28928",
"Role": "CPU",
- "SerialNumber": "00330-80951-85780-AA242",
- "ServiceName": "rt640x64",
- "SMBIOSBIOSVersion": "X505ZA.311",
+ "SerialNumber": "00332-00332-17209-AA940",
+ "ServiceName": "aqnic650",
+ "SMBIOSBIOSVersion": "F33",
"SMBIOSMajorVersion": "3",
"SMBIOSMemoryType": "26",
- "SMBIOSMinorVersion": "1",
- "SocketDesignation": "FP5",
- "SoftwareElementID": "X505ZA.311",
+ "SMBIOSMinorVersion": "3",
+ "SocketDesignation": "AM4",
+ "SoftwareElementID": "F33",
"SoftwareElementState": "3",
- "Speed": "2400",
+ "Speed": "3600",
"SystemBiosMajorVersion": "5",
- "SystemBiosMinorVersion": "13",
- "SystemName": "EGALW-NB-004",
- "Version": "10.0.19043"
+ "SystemBiosMinorVersion": "17",
+ "SystemName": "WRKST-R9-SAM",
+ "Version": "10.0.19044"
}
\ No newline at end of file
| |