Browse Source

颜色资源字典添加

reconfiguration
pry 2 months ago
parent
commit
46e289bd0c
2 changed files with 14 additions and 8 deletions
  1. +3
    -0
      BPASmartClient.Academy/ColorResource.xaml
  2. +11
    -8
      BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs

+ 3
- 0
BPASmartClient.Academy/ColorResource.xaml View File

@@ -0,0 +1,3 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="yellow">yellow</Color>
</ResourceDictionary>

+ 11
- 8
BPASmartClient.Academy/ViewModel/HistoryChart50LViewModel.cs View File

@@ -13,6 +13,7 @@ using System.Diagnostics;
using ThingsGateway.Foundation.Extension.Generic;
using static System.Windows.Forms.LinkLabel;
using System.Windows;
using System.Windows.Media;

namespace BPASmartClient.Academy.ViewModel
{
@@ -67,16 +68,18 @@ namespace BPASmartClient.Academy.ViewModel
OxyDataModels.Add(new OxyDataModel(CreateLine("负压流量", OxyColor.Parse("#9b30ff"))));
OxyDataModels.Add(new OxyDataModel(CreateLine("称重水罐重量", OxyColor.Parse("#00ffff"))));
OxyDataModels.Add(new OxyDataModel(CreateLine("比例阀实际开度", OxyColor.Parse("#ff00ff"))));

SqliteOperate.GetInstance.QueryableByNum(num).ForEach(item =>
{
OxyDataModels[0].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.Temperature));
OxyDataModels[1].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.SteamPressure));
OxyDataModels[2].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.SteamFlowRate));
OxyDataModels[3].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.CondensateWaterTemperature));
OxyDataModels[4].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.CondensateWaterHumidity));
OxyDataModels[5].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.NegativePressureFlowRate));
OxyDataModels[6].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.WeighingWaterTankWeight));
OxyDataModels[7].dataPoints.Add(new DataPoint(DateTimeAxis.ToDouble(item.Createtime), item.ProportionalValveOpening));
double x = DateTimeAxis.ToDouble(item.Createtime);
OxyDataModels[0].dataPoints.Add(new DataPoint(x, item.Temperature));
OxyDataModels[1].dataPoints.Add(new DataPoint(x, item.SteamPressure));
OxyDataModels[2].dataPoints.Add(new DataPoint(x, item.SteamFlowRate));
OxyDataModels[3].dataPoints.Add(new DataPoint(x, item.CondensateWaterTemperature));
OxyDataModels[4].dataPoints.Add(new DataPoint(x, item.CondensateWaterHumidity));
OxyDataModels[5].dataPoints.Add(new DataPoint(x, item.NegativePressureFlowRate));
OxyDataModels[6].dataPoints.Add(new DataPoint(x, item.WeighingWaterTankWeight));
OxyDataModels[7].dataPoints.Add(new DataPoint(x, item.ProportionalValveOpening));
});
OxyDataModels.ForEach(item => { item.AddRange(); });
if (!(OxyModel.Axes.Count > 0))


Loading…
Cancel
Save