Commit c3ec3eb7 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 支持大AD盒的 16位输入,8位输出显示

parent 1ca3aa5a
...@@ -349,8 +349,8 @@ namespace FlyADBase ...@@ -349,8 +349,8 @@ namespace FlyADBase
ID, ID,
FLYAD7_OBJ_INTERFACE.FLYIO_OBJ_INTERFACE.GET_IO); FLYAD7_OBJ_INTERFACE.FLYIO_OBJ_INTERFACE.GET_IO);
NotifyPropertyChanged("Pos1LCShift");//写入到AD盒 NotifyPropertyChanged(nameof(Pos1LCShift));//写入到AD盒
NotifyPropertyChanged("Pos2Comp");//写入到AD盒 NotifyPropertyChanged(nameof(Pos2Comp));//写入到AD盒
SyncPos2Clear(); SyncPos2Clear();
SyncClear(); SyncClear();
...@@ -516,12 +516,12 @@ namespace FlyADBase ...@@ -516,12 +516,12 @@ namespace FlyADBase
Array.Copy(pack.code, Code, pack.code.Length); Array.Copy(pack.code, Code, pack.code.Length);
Code[6] = 0x06; Code[6] = 0x06;
NotifyPropertyChanged("Code"); NotifyPropertyChanged(nameof(Code));
Surplus = pack.surplus; Surplus = pack.surplus;
Array.Copy(pack.access, Access, pack.access.Length); Array.Copy(pack.access, Access, pack.access.Length);
NotifyPropertyChanged("Access"); NotifyPropertyChanged(nameof(Access));
} break; } break;
case FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS: case FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS:
...@@ -976,12 +976,12 @@ namespace FlyADBase ...@@ -976,12 +976,12 @@ namespace FlyADBase
public int ADMax { get; } = 65535; public int ADMax { get; } = 65535;
/// <summary> /// <summary>
/// 输入口状态,只有12位有效 /// 输入口状态,只有12位有效, 大AD盒 16位
/// </summary> /// </summary>
public UInt16 IStatus { get; private set; } = 0xffff; public UInt16 IStatus { get; private set; } = 0xffff;
/// <summary> /// <summary>
/// 输出口状态,只有4位有效 /// 输出口状态,只有4位有效, 大AD盒 8位
/// </summary> /// </summary>
public UInt16 OStatus { get; private set; } = 0xffff; public UInt16 OStatus { get; private set; } = 0xffff;
......
...@@ -103,23 +103,43 @@ ...@@ -103,23 +103,43 @@
<StackPanel > <StackPanel >
<StackPanel Orientation="Horizontal" Margin="2"> <StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Text="入" Style="{StaticResource ItemHeaderStyle}" /> <TextBlock Text="入" Style="{StaticResource ItemHeaderStyle}" />
<StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=15}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=14}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=13}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=12}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="13" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0"> <StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=11}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=11}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=10}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=10}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=9}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=9}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=8}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=8}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="9" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0"> <StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=7}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=7}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=6}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=6}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="5" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0"> <StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=3}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=3}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=2}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=2}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding IStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="1" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Grid Margin="2"> <Grid Margin="2">
...@@ -129,11 +149,23 @@ ...@@ -129,11 +149,23 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"> <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
<TextBlock Text="出" Style="{StaticResource ItemHeaderStyle}" /> <TextBlock Text="出" Style="{StaticResource ItemHeaderStyle}" />
<StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=7}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=6}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=5}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=4}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="5" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="4,0"> <StackPanel Orientation="Horizontal" Margin="4,0">
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=3}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=3}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=2}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=2}" Style="{StaticResource IOStyle}"/>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=1}" Style="{StaticResource IOStyle}"/>
<Grid>
<Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/> <Rectangle Fill="{Binding OStatus,Converter={StaticResource io2bitcolorconv},ConverterParameter=0}" Style="{StaticResource IOStyle}"/>
<TextBlock Text="1" Style="{StaticResource IOTextStyle}"/>
</Grid>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Grid Margin="1" > <Grid Margin="1" >
......
...@@ -16,10 +16,16 @@ ...@@ -16,10 +16,16 @@
<Setter Property="Margin" Value="5,0"/> <Setter Property="Margin" Value="5,0"/>
</Style> </Style>
<Style x:Key="IOStyle" TargetType="Rectangle" > <Style x:Key="IOStyle" TargetType="Rectangle" >
<Setter Property="Width" Value="11" /> <Setter Property="Width" Value="10" />
<Setter Property="Height" Value="12" /> <Setter Property="Height" Value="12" />
<Setter Property="Margin" Value="1" /> <Setter Property="Margin" Value="1" />
</Style> </Style>
<Style x:Key="IOTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#FF119EDA" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="10"/>
</Style>
<Style x:Key="BtnStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonStyle_empty}"> <Style x:Key="BtnStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource ButtonStyle_empty}">
<Setter Property="Margin" Value="2"/> <Setter Property="Margin" Value="2"/>
<Setter Property="Foreground" Value="{StaticResource AccentBaseColorBrush}"/> <Setter Property="Foreground" Value="{StaticResource AccentBaseColorBrush}"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment