This commit is contained in:
xyy
2026-05-11 21:07:08 +08:00
parent 7780b4758b
commit 14d55162ae
3 changed files with 45 additions and 43 deletions

View File

@@ -165,7 +165,7 @@ namespace ShanghaiEnvironmentalTechnology
{
InitializeComponent();
InitializeModbusTcp();
InitializePlot();
//InitializePlot();
StartDataUpdate();
@@ -328,44 +328,44 @@ namespace ShanghaiEnvironmentalTechnology
}
}
private void InitializePlot()
{
_plotModel = new PlotModel
{
Title = _lang == "en-US" ? "Exhalation & Inhalation Flow" : "呼气流量与吸气流量",
Background = OxyColor.FromRgb(240, 240, 240)
};
//private void InitializePlot()
//{
// _plotModel = new PlotModel
// {
// Title = _lang == "en-US" ? "Exhalation & Inhalation Flow" : "呼气流量与吸气流量",
// Background = OxyColor.FromRgb(240, 240, 240)
// };
_exhalationSeries = new LineSeries
{
Title = _lang == "en-US" ? "Exhalation Flow (D5016)" : "呼气流量 (D5016)",
Color = OxyColor.FromRgb(255, 0, 0),
StrokeThickness = 2,
MarkerType = MarkerType.Circle,
MarkerSize = 4
};
// _exhalationSeries = new LineSeries
// {
// Title = _lang == "en-US" ? "Exhalation Flow (D5016)" : "呼气流量 (D5016)",
// Color = OxyColor.FromRgb(255, 0, 0),
// StrokeThickness = 2,
// MarkerType = MarkerType.Circle,
// MarkerSize = 4
// };
_inhalationSeries = new LineSeries
{
Title = _lang == "en-US" ? "Inhalation Flow (D5014)" : "吸气流量 (D5014)",
Color = OxyColor.FromRgb(0, 0, 255),
StrokeThickness = 2,
MarkerType = MarkerType.Circle,
MarkerSize = 4
};
// _inhalationSeries = new LineSeries
// {
// Title = _lang == "en-US" ? "Inhalation Flow (D5014)" : "吸气流量 (D5014)",
// Color = OxyColor.FromRgb(0, 0, 255),
// StrokeThickness = 2,
// MarkerType = MarkerType.Circle,
// MarkerSize = 4
// };
_exhalationData = new List<DataPoint>();
_inhalationData = new List<DataPoint>();
// _exhalationData = new List<DataPoint>();
// _inhalationData = new List<DataPoint>();
_plotModel.Series.Add(_exhalationSeries);
_plotModel.Series.Add(_inhalationSeries);
// _plotModel.Series.Add(_exhalationSeries);
// _plotModel.Series.Add(_inhalationSeries);
_plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = _lang == "en-US" ? "Time (s)" : "时间 (秒)" });
_plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = _lang == "en-US" ? "Flow" : "流量" });
// _plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = _lang == "en-US" ? "Time (s)" : "时间 (秒)" });
// _plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = _lang == "en-US" ? "Flow" : "流量" });
_plotModel.IsLegendVisible = true;
plotView.Model = _plotModel;
}
// _plotModel.IsLegendVisible = true;
// plotView.Model = _plotModel;
//}