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

@@ -2,11 +2,13 @@
<configuration> <configuration>
<appSettings> <appSettings>
<!--压力PLC--> <!--压力PLC-->
<add key="PLC1_IP" value="192.168.1.11"/> <!--<add key="PLC1_IP" value="192.168.1.11"/>-->
<add key="PLC1_Port" value="503"/> <add key="PLC1_IP" value="127.0.0.1"/>
<add key="PLC1_Port" value="502"/>
<!--二氧化碳PLC--> <!--二氧化碳PLC-->
<add key="PLC2_IP" value="192.168.1.10"/> <!--<add key="PLC2_IP" value="192.168.1.10"/>-->
<add key="PLC1_IP" value="127.0.0.1"/>
<add key="PLC2_Port" value="502"/> <add key="PLC2_Port" value="502"/>

View File

@@ -118,9 +118,9 @@
<!-- 3. 中间内容区 - 填充剩余空间 --> <!-- 3. 中间内容区 - 填充剩余空间 -->
<Grid Margin="20,10,20,10"> <Grid Margin="20,10,20,10">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <!--<ColumnDefinition Width="1*"/>-->
<ColumnDefinition Width="1.2*"/>
<ColumnDefinition Width="1.2*"/> <ColumnDefinition Width="1.2*"/>
<ColumnDefinition Width="220"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- 左侧参数区 --> <!-- 左侧参数区 -->
@@ -244,7 +244,7 @@ IsReadOnly="True"
</Grid> </Grid>
<!-- 中间预留区 --> <!-- 中间预留区 -->
<Grid Grid.Column="1" Margin="10"> <!--<Grid Grid.Column="1" Margin="10">
<Border Background="White" <Border Background="White"
BorderBrush="#E0E0E0" BorderBrush="#E0E0E0"
BorderThickness="1" BorderThickness="1"
@@ -266,7 +266,7 @@ IsReadOnly="True"
Grid.Row="1" /> Grid.Row="1" />
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>-->
@@ -275,7 +275,7 @@ IsReadOnly="True"
<!-- 右侧操作区 --> <!-- 右侧操作区 -->
<Grid Grid.Column="2" Margin="10"> <Grid Grid.Column="1" Margin="10">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@@ -285,7 +285,7 @@ IsReadOnly="True"
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 操作按钮标题 --> <!-- 操作按钮标题 -->
<TextBlock Text="{DynamicResource Manual19}" Style="{StaticResource SectionTitleStyle}" Grid.Row="0"/> <!--<TextBlock Text="{DynamicResource Manual19}" Style="{StaticResource SectionTitleStyle}" />-->
<!-- 控制按钮组 --> <!-- 控制按钮组 -->
<StackPanel Grid.Row="1" Margin="0,0,0,10"> <StackPanel Grid.Row="1" Margin="0,0,0,10">
@@ -299,7 +299,7 @@ IsReadOnly="True"
</StackPanel> </StackPanel>
<!-- 校准按钮标题 --> <!-- 校准按钮标题 -->
<TextBlock Text="{DynamicResource Manual20}" Style="{StaticResource SectionTitleStyle}" Grid.Row="3"/> <!--<TextBlock Text="{DynamicResource Manual20}" Style="{StaticResource SectionTitleStyle}" Grid.Row="3"/>-->
<!-- 校准按钮组 --> <!-- 校准按钮组 -->
<StackPanel Grid.Row="4"> <StackPanel Grid.Row="4">

View File

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