增加监控界面

This commit is contained in:
2024-07-12 10:39:55 +08:00
parent 1e0cba7b53
commit c9f4e88e04
11 changed files with 892 additions and 141 deletions

View File

@@ -54,28 +54,28 @@ namespace CapMachine.Wpf.Services
Stopwatch stopwatch = new Stopwatch();
//第一次计时
stopwatch.Start(); //启动Stopwatch
//Stopwatch stopwatch = new Stopwatch();
////第一次计时
//stopwatch.Start(); //启动Stopwatch
for (var i = 0; i < 10000000; i++)
{
keyValuePairs.TryAdd(DateTime.UtcNow, new RecordInfo()
{
CreateTime = DateTime.UtcNow,
WorkCondition = "dadf",
Temp = 23.3
});
//keyValuePairs.Add(new RecordInfo()
//{
// CreateTime = DateTime.UtcNow,
// WorkCondition = "dadf",
// Temp = 23.3
//});
}
//for (var i = 0; i < 10000000; i++)
//{
// keyValuePairs.TryAdd(DateTime.UtcNow, new RecordInfo()
// {
// CreateTime = DateTime.UtcNow,
// WorkCondition = "dadf",
// Temp = 23.3
// });
// //keyValuePairs.Add(new RecordInfo()
// //{
// // CreateTime = DateTime.UtcNow,
// // WorkCondition = "dadf",
// // Temp = 23.3
// //});
//}
stopwatch.Stop(); //停止Stopwatch
Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.ToString());
//stopwatch.Stop(); //停止Stopwatch
//Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.ToString());
//事件服务
_EventAggregator = eventAggregator;
@@ -216,12 +216,13 @@ namespace CapMachine.Wpf.Services
await Task.Delay(1000);
_EventAggregator.GetEvent<ChartRtEvent>().Publish(new List<Models.ChartRtValue>()
{
new Models.ChartRtValue(){Name="室温0",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="室温1",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="室温2",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="室温3",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="室温4",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="室温5",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="EVA风量",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="中间轴转速",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="加热电力",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="加湿电力",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="EMPCV电流",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="INJ压力",Value=random.NextDouble()*100,Unit="℃"},
new Models.ChartRtValue(){Name="冷媒流量",Value=random.NextDouble()*100,Unit="℃"},
});
}