@@ -86,6 +88,7 @@
});
}
+
diff --git a/Services/RTD8TMService.cs b/Services/RTD8TMService.cs
index b3f4630..f6d7f35 100644
--- a/Services/RTD8TMService.cs
+++ b/Services/RTD8TMService.cs
@@ -1,4 +1,5 @@
using System.Timers;
+using UI_SequentMicrosystems.Components;
using UI_SequentMicrosystems.Models;
using Wrapper_Api_SequentMicrosystems.RTD8TM;
@@ -9,9 +10,9 @@ namespace UI_SequentMicrosystems.Services
private SortedList
ChanelNames = new SortedList();
private SortedList ActualValues = new SortedList();
private SortedList ValuesType = new SortedList();
- private List GraphData = new();
+ public SortedList>> GraphData = new();
private byte GraphDataCounterCount = 10;
- private byte GraphDataCounter = 0;
+ private byte GraphDataCounter = 9;
private string? Address { get; set; }
@@ -20,6 +21,7 @@ namespace UI_SequentMicrosystems.Services
public delegate Task AsyncEventHandler(object? sender, TEventArgs? e);
public event AsyncEventHandler? EventUpdateValues;
+ public event AsyncEventHandler? EventUpdateGraph;
public RTD8TMService()
{
@@ -72,7 +74,13 @@ namespace UI_SequentMicrosystems.Services
if (GraphDataCounter >= GraphDataCounterCount)
{
GraphDataCounter = 0;
- GraphData.Add(new() { Data = ActualValues, Time = DateTime.Now });
+
+ ReadChartData();
+
+ if (EventUpdateGraph != null)
+ {
+ await EventUpdateGraph.Invoke(this, true);
+ }
}
else
{
@@ -227,19 +235,50 @@ namespace UI_SequentMicrosystems.Services
//Graph Data
+ ///
+ /// Get Chart data
+ ///
+ public void ReadChartData()
+ {
+ DateTime time = DateTime.Now;
+
+ foreach (byte stack in ActualValues.Keys)
+ {
+ if (!GraphData.ContainsKey(stack))
+ {
+ GraphData.Add(stack, new());
+
+ for (int chanel = 0; chanel < 8; chanel++)
+ {
+ GraphData[stack].Add(new());
+ }
+ }
+
+ for (byte chanel = 0; chanel < 8; chanel++)
+ {
+ GraphData[stack][chanel].Add(new RTD8TMGraphPointModel() { Value = new RTD8TMChanelComponent().RecalculateValues(ActualValues[stack][chanel], GetValueType(stack, chanel)), Time = time });
+ }
+ }
+ }
+
///
/// Get data for graph visualize
///
- /// saved Graphn Data
- public List GetGraphData()
+ /// saved chart chanel Data
+ public List GetChartData(byte StackID, byte Chanel)
{
- return GraphData;
+ if (!GraphData.ContainsKey(StackID))
+ {
+ return new List();
+ }
+
+ return GraphData[StackID][Chanel];
}
///
/// Clear data from Graph
///
- public void ClearGraph()
+ public void ClearChart()
{
GraphData.Clear();
}
diff --git a/UI_SequentMicrosystems.csproj b/UI_SequentMicrosystems.csproj
index fd8339f..0f32045 100644
--- a/UI_SequentMicrosystems.csproj
+++ b/UI_SequentMicrosystems.csproj
@@ -8,6 +8,7 @@
+
diff --git a/_Imports.razor b/_Imports.razor
index 75740a0..ee471be 100644
--- a/_Imports.razor
+++ b/_Imports.razor
@@ -7,4 +7,4 @@
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using UI_SequentMicrosystems
-@using UI_SequentMicrosystems.Layout
+@using UI_SequentMicrosystems.Layout
\ No newline at end of file
diff --git a/wwwroot/css/Custom.css b/wwwroot/css/Custom.css
index d008172..46ac6c6 100644
--- a/wwwroot/css/Custom.css
+++ b/wwwroot/css/Custom.css
@@ -3,13 +3,11 @@
color: white;
}
-
-.graybg {
- background: gray;
- color: yellow;
+.c-bg-black {
+ background: black;
+ color: white;
}
-
.no-border {
border: 0;
box-shadow: none; /* You may want to include this as bootstrap applies these styles too */