Procházet zdrojové kódy

50L实时数据对照功能添加

HK研究所反应釜三屏显示
ZhaoGang před 1 týdnem
rodič
revize
d9d4e36e32
3 změnil soubory, kde provedl 148 přidání a 92 odebrání
  1. +2
    -2
      BPASmartClient.Academy/View/DeviceChart50LView.xaml
  2. +107
    -76
      BPASmartClient.Academy/View/DeviceChart50LView.xaml.cs
  3. +39
    -14
      BPASmartClient.Academy/ViewModel/DeviceChart50LViewModel.cs

+ 2
- 2
BPASmartClient.Academy/View/DeviceChart50LView.xaml Zobrazit soubor

@@ -180,7 +180,7 @@
Margin="20" Orientation="Vertical" Visibility="Visible">
<lvc:CartesianChart
x:Name="ppp" Height="270" HorizontalAlignment="Stretch" VerticalAlignment="Top"
AnimationsSpeed="0:0:1"
AnimationsSpeed="0:0:1"
DataTooltip="{x:Null}"
Hoverable="False" MouseDoubleClick="DataView_CLick" ToolTip="温度曲线">
<lvc:CartesianChart.Series>
@@ -213,7 +213,7 @@
</lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.AxisX>
<lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
<lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}" MinValue="{Binding AxisXMinValue}" MaxValue="{Binding AxisXMaxValue}">
<lvc:Axis.Separator>
<lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
</lvc:Axis.Separator>


+ 107
- 76
BPASmartClient.Academy/View/DeviceChart50LView.xaml.cs Zobrazit soubor

@@ -98,24 +98,32 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "反应釜蒸汽压力曲线" };
chartGrid.Visibility = Visibility.Visible;
OxyPlot.Series.LineSeries line = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "反应釜蒸汽压力", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
OxyPlot.Series.LineSeries line2 = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "反应釜压力", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
List<DataPoint> steamPressure = new List<DataPoint>();
List<DataPoint> reactPressure = new List<DataPoint>();
SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
{
steamPressure.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.SteamPressure));
reactPressure.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.ReactPressure));
});
line.Points.AddRange(steamPressure);
line2.Points.AddRange(reactPressure);
if (!(plotModel.Axes.Count > 0))
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max, MaximumRange = maxrange });
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max, MaximumRange = maxrange });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "压力/Mpa", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2"), IsZoomEnabled = false });
}
plotModel.Series.Add(line);
plotModel.Series.Add(line2);

List<HistoryDataPoint> point1 = new();
List<HistoryDataPoint> point2 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.SteamPressure));
point2.Add(new(time, t.ReactPressure));
});
AddOxyLineSeries("反应釜蒸汽压力", OxyColor.FromRgb(110, 79, 79), point1);
AddOxyLineSeries("反应釜压力", OxyColor.FromRgb(110, 79, 79), point2);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
List<HistoryDataPoint> refPoint1 = new();
List<HistoryDataPoint> refPoint2 = new();
refPoint1 = viewModel.ReferenceData.SteamPressure.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
refPoint2 = viewModel.ReferenceData.ReactPressure.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("反应釜蒸汽压力_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
AddOxyLineSeries("反应釜压力_参考", OxyColor.FromRgb(110, 79, 79), refPoint2);
}
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -125,20 +133,24 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "比例阀开度曲线" };
chartGrid.Visibility = Visibility.Visible;
OxyPlot.Series.LineSeries line = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "蒸汽比例阀开度", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
List<DataPoint> open = new List<DataPoint>();
SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
{
open.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.ProportionalValveOpening));

});
line.Points.AddRange(open);
if (!(plotModel.Axes.Count > 0))
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max, MaximumRange = maxrange });
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max, MaximumRange = maxrange });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "比例阀开度/%", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2"), IsZoomEnabled = false });
}
plotModel.Series.Add(line);
List<HistoryDataPoint> point1 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.ProportionalValveOpening));
});
AddOxyLineSeries("蒸汽比例阀开度", OxyColor.FromRgb(110, 79, 79), point1);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
List<HistoryDataPoint> refPoint1 = new();
refPoint1 = viewModel.ReferenceData.ProportionalValveOpening.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("蒸汽比例阀开度_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
}
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -149,25 +161,31 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "流量曲线" };
chartGrid.Visibility = Visibility.Visible;
OxyPlot.Series.LineSeries templine = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "反应釜蒸汽流量", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
OxyPlot.Series.LineSeries templine_1 = new OxyPlot.Series.LineSeries() { LineStyle = LineStyle.Solid, Title = "负压流量", MarkerFill = OxyColor.FromRgb(110, 79, 79), MarkerSize = 2, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
List<DataPoint> twValues = new List<DataPoint>();
List<DataPoint> tvValues = new List<DataPoint>();
SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
if (!(plotModel.Axes.Count > 0))
{
twValues.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.SteamFlowRate));
tvValues.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.NegativePressureFlowRate));
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "流量", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2") });
}

List<HistoryDataPoint> point1 = new();
List<HistoryDataPoint> point2 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.SteamFlowRate));
point2.Add(new(time, t.NegativePressureFlowRate));
});
templine.Points.AddRange(twValues);
templine_1.Points.AddRange(tvValues);
if (!(plotModel.Axes.Count > 0))
AddOxyLineSeries("反应釜蒸汽流量", OxyColor.FromRgb(110, 79, 79), point1);
AddOxyLineSeries("负压流量", OxyColor.FromRgb(110, 79, 79), point2);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "流量", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2") });
List<HistoryDataPoint> refPoint1 = new();
List<HistoryDataPoint> refPoint2 = new();
refPoint1 = viewModel.ReferenceData.SteamFlowRate.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
refPoint2 = viewModel.ReferenceData.NegativePressureFlowRate.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("反应釜蒸汽流量_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
AddOxyLineSeries("负压流量_参考", OxyColor.FromRgb(110, 79, 79), refPoint2);
}
plotModel.Series.Add(templine);
plotModel.Series.Add(templine_1);
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -177,25 +195,32 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "重量曲线" };
chartGrid.Visibility = Visibility.Visible;
List<DataPoint> ww = new List<DataPoint>();
List<DataPoint> ww1 = new List<DataPoint>();
OxyPlot.Series.LineSeries line_5 = new OxyPlot.Series.LineSeries() { Title = "冷却水罐重量", Color = OxyColor.FromRgb(110, 79, 79), LineStyle = LineStyle.Solid, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };
OxyPlot.Series.LineSeries line_6 = new OxyPlot.Series.LineSeries() { Title = "卤水罐重量", Color = OxyColor.FromRgb(110, 79, 79), LineStyle = LineStyle.Solid, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };

SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
{
ww.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.WeighingWaterTankWeight));
ww1.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.BrineTankWeight));
});
line_5.Points.AddRange(ww);
line_6.Points.AddRange(ww1);
if (!(plotModel.Axes.Count > 0))
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max });
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "重量/kg", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2") });
}
plotModel.Series.Add(line_5);
plotModel.Series.Add(line_6);

List<HistoryDataPoint> point1 = new();
List<HistoryDataPoint> point2 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.WeighingWaterTankWeight));
point2.Add(new(time, t.BrineTankWeight));
});
AddOxyLineSeries("冷却水罐重量", OxyColor.FromRgb(110, 79, 79), point1);
AddOxyLineSeries("卤水罐重量", OxyColor.FromRgb(110, 79, 79), point2);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
List<HistoryDataPoint> refPoint1 = new();
List<HistoryDataPoint> refPoint2 = new();
refPoint1 = viewModel.ReferenceData.WeighingWaterTankWeight.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
refPoint2 = viewModel.ReferenceData.BrineTankWeight.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("冷却水罐重量_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
AddOxyLineSeries("卤水罐重量_参考", OxyColor.FromRgb(110, 79, 79), refPoint2);
}
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -205,20 +230,24 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "湿度曲线" };
chartGrid.Visibility = Visibility.Visible;
List<DataPoint> ww = new List<DataPoint>();
OxyPlot.Series.LineSeries line_5 = new OxyPlot.Series.LineSeries() { Title = "冷却水罐湿度", Color = OxyColor.FromRgb(110, 79, 79), LineStyle = LineStyle.Solid, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };

SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
{
ww.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.CondensateWaterHumidity));
});
line_5.Points.AddRange(ww);
if (!(plotModel.Axes.Count > 0))
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max });
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "湿度", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2") });
}
plotModel.Series.Add(line_5);
List<HistoryDataPoint> point1 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.CondensateWaterHumidity));
});
AddOxyLineSeries("冷却水罐湿度", OxyColor.FromRgb(110, 79, 79), point1);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
List<HistoryDataPoint> refPoint1 = new();
refPoint1 = viewModel.ReferenceData.CondensateWaterHumidity.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("冷却水罐湿度_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
}
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -228,20 +257,26 @@ namespace BPASmartClient.Academy.View
plotModel.Series.Clear();
plotModel = new PlotModel() { Title = "反应釜角度曲线" };
chartGrid.Visibility = Visibility.Visible;
List<DataPoint> ww = new List<DataPoint>();
OxyPlot.Series.LineSeries line_5 = new OxyPlot.Series.LineSeries() { Title = "反应釜角度", Color = OxyColor.FromRgb(110, 79, 79), LineStyle = LineStyle.Solid, LineLegendPosition = OxyPlot.Series.LineLegendPosition.End };

SqliteOperate.GetInstance.QueryableById(PlcControl.GetInstance.id).ForEach(t =>
{
ww.Add(new DataPoint(DateTimeAxis.ToDouble(t.Createtime), t.ReactEncoderValue));
});
line_5.Points.AddRange(ww);
if (!(plotModel.Axes.Count > 0))
{
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", Minimum = min, Maximum = max });
plotModel.Axes.Add(new DateTimeAxis() { Position = OxyPlot.Axes.AxisPosition.Bottom, Title = "时间/s", StringFormat = "hh:mm:ss", AbsoluteMinimum = min, AbsoluteMaximum = max });
plotModel.Axes.Add(new LinearAxis() { Key = "y1", Title = "角度/°", Position = OxyPlot.Axes.AxisPosition.Left, LabelFormatter = value => value.ToString("f2") });
}
plotModel.Series.Add(line_5);

List<HistoryDataPoint> point1 = new();
datas.ForEach(t =>
{
var time = new DateTime((t.Createtime - startTime).Ticks);
point1.Add(new(time, t.ReactEncoderValue));
});
AddOxyLineSeries("反应釜角度", OxyColor.FromRgb(110, 79, 79), point1);
if (this.DataContext is DeviceChart50LViewModel viewModel && viewModel.ReferenceData != null)
{
List<HistoryDataPoint> refPoint1 = new();
refPoint1 = viewModel.ReferenceData.ReactEncoderValue.Select(x => new HistoryDataPoint(x.DateTime, (float)x.Value)).ToList();
AddOxyLineSeries("反应釜角度_参考", OxyColor.FromRgb(110, 79, 79), refPoint1);
}
plotModel.InvalidatePlot(true);//重新加载曲线
chartView.Model = plotModel;
}
@@ -278,10 +313,6 @@ namespace BPASmartClient.Academy.View
}

record HistoryDataPoint(DateTime DateTime, float Value);
//class HistoryDataPoint
//{
// public DateTime DateTime { get; set; }
// public float Value { get; set; }
//}
}
}

+ 39
- 14
BPASmartClient.Academy/ViewModel/DeviceChart50LViewModel.cs Zobrazit soubor

@@ -57,8 +57,24 @@ namespace BPASmartClient.Academy.ViewModel
{
if (ReferenceData != null && ReferenceData.Temperature.Count > 0)
{
DateTime startTime = DataFeedback.Temperature.Select(x => x.DateTime).Min();
DateTime endTime = DataFeedback.Temperature.Select(x => x.DateTime).Max().AddSeconds(6);
DateTime startTime = DataFeedback.Temperature.Min(x => x.DateTime);
DateTime endTime = DataFeedback.Temperature.Max(x => x.DateTime).AddSeconds(6);

//PartReferenceData.Temperature.RemoveWhere(x => x.DateTime < startTime);
AxisXMinValue = startTime;
AxisXMaxValue = endTime;

//PartReferenceData.Temperature.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.SteamPressure.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.SteamPressure.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.CondensateWaterTemperature.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.CondensateWaterHumidity.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.NegativePressureFlowRate.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.WeighingWaterTankWeight.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.ReactEncoderValue.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.ProportionalValveOpening.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.BrineTankWeight.RemoveWhere(x => x.DateTime < startTime);
//PartReferenceData.ReactPressure.RemoveWhere(x => x.DateTime < startTime);

PartReferenceData.Temperature.Clear();
PartReferenceData.SteamPressure.Clear();
@@ -72,20 +88,24 @@ namespace BPASmartClient.Academy.ViewModel
PartReferenceData.BrineTankWeight.Clear();
PartReferenceData.ReactPressure.Clear();

PartReferenceData.Temperature.AddRange(ReferenceData.Temperature.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.SteamPressure.AddRange(ReferenceData.SteamPressure.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.SteamPressure.AddRange(ReferenceData.SteamFlowRate.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.CondensateWaterTemperature.AddRange(ReferenceData.CondensateWaterTemperature.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.CondensateWaterHumidity.AddRange(ReferenceData.CondensateWaterHumidity.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.NegativePressureFlowRate.AddRange(ReferenceData.NegativePressureFlowRate.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.WeighingWaterTankWeight.AddRange(ReferenceData.WeighingWaterTankWeight.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ReactEncoderValue.AddRange(ReferenceData.ReactEncoderValue.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ProportionalValveOpening.AddRange(ReferenceData.ProportionalValveOpening.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.BrineTankWeight.AddRange(ReferenceData.BrineTankWeight.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ReactPressure.AddRange(ReferenceData.ReactPressure.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
if (ReferenceData.Temperature.Max(x => x.DateTime) >= endTime)
{
PartReferenceData.Temperature.AddRange(ReferenceData.Temperature.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.SteamPressure.AddRange(ReferenceData.SteamPressure.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.SteamPressure.AddRange(ReferenceData.SteamFlowRate.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.CondensateWaterTemperature.AddRange(ReferenceData.CondensateWaterTemperature.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.CondensateWaterHumidity.AddRange(ReferenceData.CondensateWaterHumidity.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.NegativePressureFlowRate.AddRange(ReferenceData.NegativePressureFlowRate.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.WeighingWaterTankWeight.AddRange(ReferenceData.WeighingWaterTankWeight.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ReactEncoderValue.AddRange(ReferenceData.ReactEncoderValue.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ProportionalValveOpening.AddRange(ReferenceData.ProportionalValveOpening.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.BrineTankWeight.AddRange(ReferenceData.BrineTankWeight.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
PartReferenceData.ReactPressure.AddRange(ReferenceData.ReactPressure.Where(x => x.DateTime >= startTime && x.DateTime <= endTime));
}

}
await Task.Delay(2000);
//await Task.Delay(2000);
Thread.Sleep(2000);
}
}, TaskCreationOptions.LongRunning,_tokenSource.Token);
}
@@ -104,7 +124,12 @@ namespace BPASmartClient.Academy.ViewModel

private DataFeedBack_50 _partReferenceData;
public DataFeedBack_50 PartReferenceData { get { return _partReferenceData; } set { _partReferenceData = value; OnPropertyChanged(); } }
public DateTime AxisXMinValue { get { return _axisXMinValue; } set { _axisXMinValue = value; OnPropertyChanged(); } }

private DateTime _axisXMinValue;
public DateTime AxisXMaxValue { get { return _axisXMaxValue; } set { _axisXMaxValue = value; OnPropertyChanged(); } }

private DateTime _axisXMaxValue;
public Func<double, string> DateTimeFormatter { get; set; } = value => value > 0 ? new DateTime((long)value).ToString("HH:mm:ss") : new DateTime((long)DateTime.Now.Ticks).ToString("HH:mm:ss");

public Func<double, string> doubleFormatter { get; set; } = value => value.ToString("F2");


Načítá se…
Zrušit
Uložit