This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
InputScope="Number" PreviewTextInput="SettingPaTextBox_PreviewTextInput" />
|
||||
|
||||
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black"/>
|
||||
<Button Content="{DynamicResource Setting}" Style="{StaticResource MyButtonStyle}" Click="SettingPaTextBox_MouseLeave"/>
|
||||
<Button Name="btnsetting" Content="{DynamicResource Setting}" Style="{StaticResource MyButtonStyle}" Click="SettingPaTextBox_MouseLeave"/>
|
||||
<!--<Button Content="确定" Style="{StaticResource MyButtonStyle}"/>-->
|
||||
</StackPanel>
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<TextBlock Text="{DynamicResource RealTimePressure}" VerticalAlignment="Center" Foreground="Black"/>
|
||||
<TextBox x:Name="RealTimePressureTextBox" Width="120" Margin="10,0" Style="{StaticResource MyTextBoxStyle}" IsReadOnly="True" IsEnabled="True"/>
|
||||
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black"/>
|
||||
<Button Content="{DynamicResource TriggerDisplacement}" Width="180" Style="{StaticResource MyButtonStyle}" Click="Button_Click"/>
|
||||
<Button Name="btnjiaozhun" Content="{DynamicResource TriggerDisplacement}" Width="180" Style="{StaticResource MyButtonStyle}" Click="Button_Click"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
@@ -199,11 +199,15 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isTestRunning)
|
||||
{
|
||||
btnsetting.IsEnabled = false;
|
||||
btnjiaozhun.IsEnabled = false;
|
||||
TestStartButton.Content = testStartButtonText;
|
||||
TestStartButton.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnsetting.IsEnabled = true;
|
||||
btnjiaozhun.IsEnabled = true;
|
||||
TestStartButton.Content = ButtonStatus;
|
||||
TestStartButton.Foreground = Brushes.White;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="2" Content="{DynamicResource Deformation2}" Width="250" Style="{StaticResource MyButtonStyle}" Click="Button_Click" HorizontalAlignment="Left"/>
|
||||
<Button Name="btnlianjiekou" Grid.Column="2" Content="{DynamicResource Deformation2}" Width="250" Style="{StaticResource MyButtonStyle}" Click="Button_Click" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 鼻口压力行 -->
|
||||
@@ -114,7 +114,7 @@
|
||||
<TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="2" Content="{DynamicResource Calibration}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_1" HorizontalAlignment="Left"/>
|
||||
<Button Name="btnjiaozhun" Grid.Column="2" Content="{DynamicResource Calibration}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_1" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
|
||||
<!-- 设定流量行 -->
|
||||
@@ -132,7 +132,7 @@
|
||||
<TextBlock Text="L/min" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Column="2" Content="{DynamicResource Deformation4}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7" HorizontalAlignment="Left"/>
|
||||
<Button Name="btnsetting" Grid.Column="2" Content="{DynamicResource Deformation4}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7" HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
@@ -260,11 +260,19 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isTestRunning)
|
||||
{
|
||||
btnjiaozhun.IsEnabled = false;
|
||||
btnlianjiekou.IsEnabled = false;
|
||||
btnsetting.IsEnabled = false;
|
||||
|
||||
TestStartButton.Content = testStartButtonText;
|
||||
TestStartButton.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnjiaozhun.IsEnabled = true;
|
||||
btnlianjiekou.IsEnabled = true;
|
||||
btnsetting.IsEnabled = true;
|
||||
|
||||
TestStartButton.Content = ButtonStatus;
|
||||
TestStartButton.Foreground = Brushes.White;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
InputScope="Number"
|
||||
PreviewTextInput="SettingPaTextBox_PreviewTextInput"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
<Button Content="{DynamicResource The force value determines the pressure difference}" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_10"/>
|
||||
<Button Name="btnsetting" Content="{DynamicResource The force value determines the pressure difference}" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_10"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5">
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
<Button Content="{DynamicResource The force value determines the pressure difference}" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_11"/>
|
||||
<Button Name="btnsetting2" Content="{DynamicResource The force value determines the pressure difference}" Style="{StaticResource MyButtonStyle}" Margin="10" Click="Button_Click_11"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<TextBlock x:Name="TimerPressTxt" Text="???" FontSize="20" Foreground="Red"/>
|
||||
<TextBlock Text=" pa" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<Button Content="{DynamicResource Calibration}" Style="{StaticResource MyButtonStyle}" Margin="10,0" Click="Button_Click_4"/>
|
||||
<Button Name="btnjiaozhun" Content="{DynamicResource Calibration}" Style="{StaticResource MyButtonStyle}" Margin="10,0" Click="Button_Click_4"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,30">
|
||||
|
||||
@@ -138,11 +138,20 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isTestRunning)
|
||||
{
|
||||
|
||||
btnsetting.IsEnabled = false;
|
||||
btnjiaozhun.IsEnabled = false;
|
||||
btnsetting2.IsEnabled = false;
|
||||
|
||||
TestStartButton.Content = testStartButtonText;
|
||||
TestStartButton.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnsetting.IsEnabled = true;
|
||||
btnjiaozhun.IsEnabled = true;
|
||||
btnsetting2.IsEnabled = true;
|
||||
|
||||
TestStartButton.Content = ButtonStatus;
|
||||
TestStartButton.Foreground = Brushes.White;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Row="0" Grid.Column="2"
|
||||
<Button Name="btnsetting" Grid.Row="0" Grid.Column="2"
|
||||
Content="{DynamicResource setFlow4}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Click="Button_Click"
|
||||
@@ -227,7 +227,7 @@
|
||||
MinWidth="50"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="2"
|
||||
<Button Name="btnsetting2" Grid.Row="1" Grid.Column="2"
|
||||
Content="{DynamicResource setFlow6}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Click="Button_Click_1"
|
||||
|
||||
@@ -122,11 +122,17 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isTestRunning)
|
||||
{
|
||||
|
||||
btnsetting.IsEnabled = false;
|
||||
btnsetting2.IsEnabled = false;
|
||||
TestStartButton.Content = running;
|
||||
TestStartButton.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnsetting.IsEnabled = true;
|
||||
btnsetting2.IsEnabled = true;
|
||||
|
||||
TestStartButton.Content = ready;
|
||||
TestStartButton.Foreground = Brushes.White;
|
||||
}
|
||||
|
||||
10
Window5.xaml
10
Window5.xaml
@@ -200,7 +200,7 @@
|
||||
Width="45"
|
||||
PreviewTextInput="NumberPreviewTextInput"
|
||||
IsReadOnly="True"/>
|
||||
<Button Content="{DynamicResource test2}"
|
||||
<Button Name="btn1" Content="{DynamicResource test2}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Width="61"
|
||||
Margin="5,0"
|
||||
@@ -211,7 +211,7 @@
|
||||
Width="45"
|
||||
PreviewTextInput="NumberPreviewTextInput"
|
||||
IsReadOnly="True"/>
|
||||
<Button Content="{DynamicResource test2}"
|
||||
<Button Name="btn2" Content="{DynamicResource test2}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Width="57"
|
||||
Margin="10,0"
|
||||
@@ -233,7 +233,7 @@
|
||||
<TextBlock Text=" L" VerticalAlignment="Center" Margin="5,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Row="1" Grid.Column="1"
|
||||
<Button Name="btn3" Grid.Row="1" Grid.Column="1"
|
||||
Content="{DynamicResource test2}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Width="80"
|
||||
@@ -256,7 +256,7 @@
|
||||
<TextBlock Text="{DynamicResource test8}" VerticalAlignment="Center" Margin="5,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="1"
|
||||
<Button Name="btn4" Grid.Row="2" Grid.Column="1"
|
||||
Content="{DynamicResource test2}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Width="80"
|
||||
@@ -278,7 +278,7 @@
|
||||
IsReadOnly="True"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button Grid.Row="3" Grid.Column="1"
|
||||
<Button Name="btn5" Grid.Row="3" Grid.Column="1"
|
||||
Content="{DynamicResource test2}"
|
||||
Style="{StaticResource MyButtonStyle}"
|
||||
Width="80"
|
||||
|
||||
@@ -216,11 +216,23 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isRunning)
|
||||
{
|
||||
btn1.IsEnabled = false;
|
||||
btn2.IsEnabled = false;
|
||||
btn3.IsEnabled = false;
|
||||
btn4.IsEnabled = false;
|
||||
btn5.IsEnabled = false;
|
||||
|
||||
TestStartButton.Content = _lang == "en-US" ? "Test Started" : "测试启动成功";
|
||||
TestStartButton.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn1.IsEnabled = true;
|
||||
btn2.IsEnabled = true;
|
||||
btn3.IsEnabled = true;
|
||||
btn4.IsEnabled = true;
|
||||
btn5.IsEnabled = true;
|
||||
|
||||
TestStartButton.Content = _lang == "en-US" ? "Start Test" : "测试启动";
|
||||
TestStartButton.Foreground = Brushes.White;
|
||||
}
|
||||
@@ -840,7 +852,7 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
|
||||
if (Dispatcher.HasShutdownStarted)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
10
Window6.xaml
10
Window6.xaml
@@ -161,21 +161,21 @@
|
||||
IsReadOnly="True"
|
||||
/>
|
||||
<TextBlock Text="mm/min" Style="{StaticResource UnitTextStyle}" Grid.Row="0" Grid.Column="2"/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_14" Grid.Row="0" Grid.Column="3"/>
|
||||
<Button Name="btn1" Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_14" Grid.Row="0" Grid.Column="3"/>
|
||||
|
||||
<!-- 潮气量系数 -->
|
||||
<TextBlock Text="潮气量系数" Style="{StaticResource ParamLabelStyle}" Grid.Row="1" Grid.Column="0" Margin="5"/>
|
||||
<TextBox Name="moistureTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="1" Grid.Column="1"
|
||||
IsReadOnly="True"
|
||||
/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_15" Grid.Row="1" Grid.Column="3"/>
|
||||
<Button Name="btn2" Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_15" Grid.Row="1" Grid.Column="3"/>
|
||||
|
||||
<!-- 呼气流量系数 -->
|
||||
<TextBlock Text="呼气流量系数" Style="{StaticResource ParamLabelStyle}" Grid.Row="2" Grid.Column="0" Margin="5"/>
|
||||
<TextBox Name="OutFowRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="2" Grid.Column="1"
|
||||
IsReadOnly="True"
|
||||
/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_16" Grid.Row="2" Grid.Column="3"/>
|
||||
<Button Name="btn3" Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_16" Grid.Row="2" Grid.Column="3"/>
|
||||
<!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="2" Grid.Column="2"/>-->
|
||||
|
||||
<!-- 吸气流量系数 -->
|
||||
@@ -183,7 +183,7 @@ IsReadOnly="True"
|
||||
<TextBox Name="InFowRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="3" Grid.Column="1"
|
||||
IsReadOnly="True"
|
||||
/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_17" Grid.Row="3" Grid.Column="3"/>
|
||||
<Button Name="btn4" Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_17" Grid.Row="3" Grid.Column="3"/>
|
||||
<!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="3" Grid.Column="2"/>-->
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ IsReadOnly="True"
|
||||
<TextBox Name="PressRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="4" Grid.Column="1"
|
||||
IsReadOnly="True"
|
||||
/>
|
||||
<Button Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_18" Grid.Row="4" Grid.Column="3"/>
|
||||
<Button Name="btn5" Content="设置" Style="{StaticResource MyButtonStyle}" Width="50" Click="Button_Click_18" Grid.Row="4" Grid.Column="3"/>
|
||||
<!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="4" Grid.Column="2"/>-->
|
||||
|
||||
|
||||
|
||||
@@ -113,12 +113,6 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
// 实时读取定时器(1个定时器管理5个参数)
|
||||
private System.Timers.Timer _paramReadTimer;
|
||||
|
||||
// 下位机寄存器地址(根据实际PLC地址修改)
|
||||
//private readonly ushort _handmovementAddr = 0x0300; // 手动速度
|
||||
//private readonly ushort _moistureAddr = 0x0301; // 潮气量系数
|
||||
//private readonly ushort _outFlowAddr = 0x0302; // 呼气流量系数
|
||||
//private readonly ushort _inFlowAddr = 0x0303; // 吸气流量系数
|
||||
//private readonly ushort _pressAddr = 0x0304; // 压力系数
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -133,11 +127,25 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (isTestRunning)
|
||||
{
|
||||
|
||||
btn1.IsEnabled = false;
|
||||
btn2.IsEnabled = false;
|
||||
btn3.IsEnabled = false;
|
||||
btn4.IsEnabled = false;
|
||||
btn5.IsEnabled = false;
|
||||
|
||||
ResetBtn.Content = _lang == "en-US" ? "Reset Success" : "复位成功";
|
||||
ResetBtn.Foreground = Brushes.LightGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
btn1.IsEnabled = true;
|
||||
btn2.IsEnabled = true;
|
||||
btn3.IsEnabled = true;
|
||||
btn4.IsEnabled = true;
|
||||
btn5.IsEnabled = true;
|
||||
|
||||
|
||||
ResetBtn.Content = _lang == "en-US" ? "Reset" : "复位";
|
||||
ResetBtn.Foreground = Brushes.White;
|
||||
}
|
||||
@@ -604,7 +612,7 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -617,7 +625,7 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
if (!IsModbusConnected())
|
||||
{
|
||||
// ShowError("Modbus TCP 未连接");
|
||||
// ShowError("Modbus TCP 未连接");
|
||||
return;
|
||||
}
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user