This commit is contained in:
GukSang.Jin
2026-03-16 19:58:18 +08:00
parent 88a65233a7
commit 4acf0c7d14
7 changed files with 47 additions and 9 deletions

View File

@@ -61,7 +61,6 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- 主标题 -->
@@ -71,10 +70,13 @@
<!--<TextBlock Text="定量供应检验系统"
FontSize="14" Foreground="#CCFFFFFF" Margin="0,5,0,0"/>-->
</StackPanel>
<StackPanel Grid.Column="3" Orientation="Horizontal" Margin="2" HorizontalAlignment="Center">
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="样品编号:" FontSize="26" FontWeight="Bold" Foreground="White" Style="{StaticResource LabelStyle}"/>
<TextBox x:Name="pressureDiff2" Text="" Width="180" Style="{StaticResource TextBoxStyle}" LostFocus="pressureDiff2_GotFocus"/>
<Border Background="White" Padding="15,8" Margin="15,0,0,0" VerticalAlignment="Center">
<TextBlock Text="{Binding CurrentTime, StringFormat='yyyy-MM-dd HH:mm:ss'}"
FontSize="12" FontWeight="Bold" Foreground="#2C3E50"/>
</Border>
</StackPanel>
<!-- 状态指示 -->
@@ -87,11 +89,6 @@
</Border>
</StackPanel>
<!-- 系统时间 -->
<Border Grid.Column="2" Background="White" Padding="15,8">
<TextBlock Text="{Binding CurrentTime, StringFormat='yyyy-MM-dd HH:mm:ss'}"
FontSize="12" FontWeight="Bold" Foreground="#2C3E50"/>
</Border>
</Grid>
</Border>

View File

@@ -1,7 +1,7 @@
<Window x:Class="自救器呼吸器综合检验仪.ParameterSettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="参数设置" Height="600" Width="1024" WindowState="Maximized"
Title="参数设置" Height="600" Width="800"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" Loaded="Window_Loaded" Closed="Window_Closed" Closing="Window_Closing">

View File

@@ -29,6 +29,17 @@ namespace 自救器呼吸器综合检验仪
_readTimer = InitDispatcherTimer();
}
private void EnsureWindowedLayout()
{
WindowState = WindowState.Normal;
Width = 1024;
Height = 600;
Rect workArea = SystemParameters.WorkArea;
Left = workArea.Left + (workArea.Width - Width) / 2;
Top = workArea.Top + (workArea.Height - Height) / 2;
}
private DispatcherTimer InitDispatcherTimer()
{
var timer = new DispatcherTimer
@@ -446,6 +457,8 @@ _modbusMaster?.ReadHoldingRegisters(1, 290, 2)
private void Window_Loaded(object sender, RoutedEventArgs e)
{
EnsureWindowedLayout();
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)

View File

@@ -228,6 +228,13 @@ namespace 自救器呼吸器综合检验仪
private void BtnPrint_Click(object sender, RoutedEventArgs e)
{
if (_records == null || _records.Count == 0)
{
MessageBox.Show("无数据,不可打印", "提示",
MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
ma.BtnClickFunctionForNew(Function.ButtonType., 15);
}

View File

@@ -248,6 +248,13 @@ namespace 自救器呼吸器综合检验仪
private void BtnPrint_Click(object sender, RoutedEventArgs e)
{
if (_records == null || _records.Count == 0)
{
MessageBox.Show("无数据,不可打印", "提示",
MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
ma.BtnClickFunctionForNew(Function.ButtonType., 15);
}

View File

@@ -191,6 +191,13 @@ namespace 自救器呼吸器综合检验仪
private void BtnPrint_Click(object sender, RoutedEventArgs e)
{
if (_records == null || _records.Count == 0)
{
MessageBox.Show("无数据,不可打印", "提示",
MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
ma.BtnClickFunctionForNew(Function.ButtonType., 15);
}

View File

@@ -233,6 +233,13 @@ namespace 自救器呼吸器综合检验仪
private void BtnPrint_Click(object sender, RoutedEventArgs e)
{
if (_records == null || _records.Count == 0)
{
MessageBox.Show("无数据,不可打印", "提示",
MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
ma.BtnClickFunctionForNew(Function.ButtonType., 15);
}