测试样例
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
<!-- 测试界面标题 -->
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource MainTitleStyle}" Text="测试界面"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -129,19 +129,26 @@
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Image Grid.Row="2" Source="/Images/touzhao.png" Opacity="1" Width="224"
|
||||
Margin="200,0,0,0" Height="194"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Content="打印" HorizontalAlignment="Left" Margin="77,6,0,0" VerticalAlignment="Top" Height="42" Width="75" Click="Button_Click_Print" FontSize="18" RenderTransformOrigin="0.360,-0.63"/>
|
||||
|
||||
<RadioButton Grid.Column="1" Content="试样测试"
|
||||
Margin="121,16,0,0" VerticalAlignment="Top"
|
||||
FontSize="18" HorizontalAlignment="Left"
|
||||
Checked="RadioButton_Checked"
|
||||
RenderTransformOrigin="1.521,-0.3"
|
||||
Unchecked="RadioButton_Unchecked"
|
||||
/>
|
||||
<Button Grid.Column="2" Content="打印" Margin="270,6,0,0" VerticalAlignment="Top" Height="42" Width="75" Click="Button_Click_Print" FontSize="18" RenderTransformOrigin="0.360,-0.63" HorizontalAlignment="Left"/>
|
||||
|
||||
<ToggleButton x:Name="tbTest"
|
||||
FontSize="18"
|
||||
Width="111" Height="40"
|
||||
Background="LightBlue"
|
||||
Checked="TbTest_Checked"
|
||||
Unchecked="TbTest_Unchecked" Grid.Column="1" HorizontalAlignment="Left" Margin="131,8,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
|
||||
<!-- 取消时(空白测试) -->
|
||||
<!-- 关键:用Style去掉边框 -->
|
||||
<ToggleButton.Style>
|
||||
<Style TargetType="ToggleButton">
|
||||
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
试样测试
|
||||
</ToggleButton>
|
||||
<TextBlock x:Name="当前模式" Grid.Column="1" HorizontalAlignment="Left" Margin="39,16,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="18" RenderTransformOrigin="-6.776,-2.381" Width="116"><Run Text="当前模式"/><Run Language="zh-cn" Text=":"/></TextBlock>
|
||||
</Grid>
|
||||
|
||||
@@ -259,14 +266,14 @@ PreviewMouseLeftButtonUp="Button_Click_ForUp" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页"
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页"
|
||||
Click="GoHome" />
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面"
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面"
|
||||
Click="GoTest" />
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="数据记录"
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="数据记录"
|
||||
Click="GoRecord" />
|
||||
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="3" Content="记录画面"
|
||||
Click="GoView" />
|
||||
Click="GoView" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
@@ -198,17 +199,23 @@ namespace 头罩视野.Views
|
||||
}
|
||||
//试样测试
|
||||
|
||||
private void RadioButton_Checked(object sender, RoutedEventArgs e)
|
||||
|
||||
private void TbTest_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
ma.BtnClickFunction(Function.ButtonType.切换型, 41);
|
||||
|
||||
// 选中 → 试样测试
|
||||
var btn = sender as ToggleButton;
|
||||
btn.Content = "试样测试";
|
||||
btn.Background = System.Windows.Media.Brushes.LightBlue;
|
||||
//_modbusMaster.WriteSingleCoilAsync(1, 41, true);
|
||||
}
|
||||
private void RadioButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
|
||||
private void TbTest_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
ma.BtnClickFunction(Function.ButtonType.切换型, 41);
|
||||
|
||||
// 取消 → 空白测试
|
||||
var btn = sender as ToggleButton;
|
||||
btn.Content = "空白测试";
|
||||
btn.Background = System.Windows.Media.Brushes.LightGray;
|
||||
//_modbusMaster.WriteSingleCoilAsync(1, 41, false);
|
||||
}
|
||||
private void Button_Click_home(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user