This commit is contained in:
2024-12-18 15:50:21 +08:00
parent 684973e6b7
commit b2c54119ea
214 changed files with 65908 additions and 8461 deletions

View File

@@ -6,8 +6,8 @@
xmlns:local="clr-namespace:CapMachine.Shared.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="MeterInstance"
d:DesignHeight="160"
d:DesignWidth="160"
Width="130"
Height="155"
BorderBrush="Gray"
mc:Ignorable="d">
<Grid>
@@ -25,29 +25,29 @@
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontSize="24"
FontSize="22"
Foreground="White"
Text="PV" />
<TextBlock
Margin="10,0,5,0"
Margin="5,0,5,0"
VerticalAlignment="Center"
FontSize="24"
FontSize="20"
Foreground="White"
Text="25.45" />
Text="{Binding ElementName=MeterInstance, Path=PVValue}" />
<TextBlock
Margin="5,0"
Margin="2,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
DockPanel.Dock="Right"
FontSize="14"
FontSize="12"
Foreground="White"
Text="Kg" />
Text="{Binding ElementName=MeterInstance, Path=Unit}" />
</DockPanel>
<DockPanel Margin="5,-3,5,0">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontSize="22"
FontSize="20"
FontStyle="Italic"
Foreground="Gold"
Text="SV" />
@@ -56,15 +56,15 @@
VerticalAlignment="Center"
FontSize="20"
Foreground="Gold"
Text="25.45" />
<TextBlock
Margin="5,0"
Text="{Binding ElementName=MeterInstance, Path=SVValue}" />
<!--<TextBlock
Margin="2,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
DockPanel.Dock="Right"
FontSize="12"
Foreground="Gold"
Text="Kg" />
Text="{Binding ElementName=MeterInstance, Path=Unit}" />-->
</DockPanel>
</StackPanel>
@@ -74,15 +74,79 @@
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Margin="0,5,0,0">
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" ToolTip="手自动" />
<StackPanel Margin="0,3,0,0">
<!--
Command="{Binding ElementName=MeterInstance, Path=AutoHandCommand}"
CommandParameter="{Binding ElementName=MeterInstance}"
把整个控件作为参数传递进去
-->
<ToggleButton
x:Name="ToggleBtnAutoHand"
Width="40"
Click="ToggleBtnAutoHand_Click_1"
Command="{Binding ElementName=MeterInstance, Path=AutoHandCommand}"
CommandParameter="{Binding ElementName=MeterInstance}"
IsChecked="{Binding ElementName=MeterInstance, Path=AutoHandState}"
Style="{StaticResource MaterialDesignSwitchToggleButton}"
ToolTip="手自动" />
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="Bold"
Foreground="CadetBlue"
Text="自动" />
Text="{Binding ElementName=MeterInstance, Path=AutoStateMsg}" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="3,3,3,0">
<StackPanel.Resources />
<!--
Text="{Binding ElementName=MeterInstance, Path=AutoStateMsg}"
Command="{Binding ElementName=MeterInstance, Path=AutoHandCommand}"
CommandParameter="{Binding ElementName=MeterInstance}"
把整个控件作为参数传递进去
-->
<TextBox
x:Name="HandValueMV"
Width="42"
HorizontalContentAlignment="Center"
KeyDown="HandValueMV_KeyDown"
Text="{Binding ElementName=MeterInstance, Path=HandValueMVParameter}"
ToolTip="按【Enter】回车键才会发送生效"
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
<TextBlock
Margin="0,2,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="Bold"
Foreground="CadetBlue"
Text="MV"
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
</StackPanel>
<StackPanel Grid.Column="2" Margin="3,3,3,0">
<StackPanel.Resources />
<!--
Text="{Binding ElementName=MeterInstance, Path=AutoStateMsg}"
Command="{Binding ElementName=MeterInstance, Path=AutoHandCommand}"
CommandParameter="{Binding ElementName=MeterInstance}"
把整个控件作为参数传递进去
-->
<TextBox
x:Name="HandValueSV"
Width="42"
HorizontalContentAlignment="Center"
KeyDown="HandValueSV_KeyDown"
Text="{Binding ElementName=MeterInstance, Path=HandValueSVParameter}"
ToolTip="按【Enter】回车键才会发送生效"
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
<TextBlock
Margin="0,2,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="Bold"
Foreground="CadetBlue"
Text="SV"
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
</StackPanel>
</Grid>
@@ -94,9 +158,9 @@
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="20"
FontSize="16"
Foreground="White"
Text="吸气温度" />
Text="{Binding ElementName=MeterInstance, Path=MeterName}" />
</Border>
</Grid>
</UserControl>