Commit e455f67a by liulongfei

部分逻辑调整

parent 59830c15
...@@ -89,7 +89,7 @@ namespace VIZ.ElectricRabbit.Connection ...@@ -89,7 +89,7 @@ namespace VIZ.ElectricRabbit.Connection
/// <summary> /// <summary>
/// 校验和 /// 校验和
/// (序号1+……+序号52)&0xFF /// (序号1+……+序号49)&0xFF
/// </summary> /// </summary>
[ConnBitLength(8)] [ConnBitLength(8)]
public byte Check { get; set; } public byte Check { get; set; }
...@@ -100,7 +100,7 @@ namespace VIZ.ElectricRabbit.Connection ...@@ -100,7 +100,7 @@ namespace VIZ.ElectricRabbit.Connection
/// <returns>二进制数据</returns> /// <returns>二进制数据</returns>
public override byte[] ToBuffer() public override byte[] ToBuffer()
{ {
byte[] buffer = new byte[53]; byte[] buffer = new byte[49];
int index = 0; int index = 0;
// 同步帧头 1 // 同步帧头 1
......
...@@ -102,6 +102,7 @@ namespace VIZ.ElectricRabbit.Module ...@@ -102,6 +102,7 @@ namespace VIZ.ElectricRabbit.Module
package.HelpCommand_PN = this.Support.AlgorithmDifferenceValue < 0 ? (byte)1 : (byte)0; package.HelpCommand_PN = this.Support.AlgorithmDifferenceValue < 0 ? (byte)1 : (byte)0;
package.HelpCommand = (UInt16)Math.Abs(this.Support.AlgorithmDifferenceValue); package.HelpCommand = (UInt16)Math.Abs(this.Support.AlgorithmDifferenceValue);
package.Heart = (byte)this.heart; package.Heart = (byte)this.heart;
package.Check = package.GetCheckValue();
this.heart++; this.heart++;
if (this.heart > 255) if (this.heart > 255)
......
...@@ -61,11 +61,11 @@ ...@@ -61,11 +61,11 @@
<!-- 提示区域 --> <!-- 提示区域 -->
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 中心值 --> <!-- 中心值 -->
<TextBlock Text="{Binding Path=AlgorithmCenterX}" VerticalAlignment="Bottom" HorizontalAlignment="Center" Foreground="Red" FontSize="16"></TextBlock> <TextBlock Text="{Binding Path=AlgorithmCenterX}" VerticalAlignment="Bottom" HorizontalAlignment="Center" Foreground="Red" FontSize="24"></TextBlock>
<!-- 箭头 --> <!-- 箭头 -->
<fcommon:FlashingBorder IsFlashingEnabled="{Binding Path=SettingViewModel.IsFlashingEnabled}" Grid.Row="1" <fcommon:FlashingBorder IsFlashingEnabled="{Binding Path=SettingViewModel.IsFlashingEnabled}" Grid.Row="1"
......
...@@ -348,7 +348,7 @@ namespace VIZ.ElectricRabbit.Module ...@@ -348,7 +348,7 @@ namespace VIZ.ElectricRabbit.Module
double center = left + (right - left) / 2d; double center = left + (right - left) / 2d;
this.DifferenceValue = center - this.SettingViewModel.SafeAxis; this.DifferenceValue = center - this.SettingViewModel.SafeAxis;
this.AlgorithmCenterX = msg.center_x; this.AlgorithmCenterX = msg.center_x;
this.AlgorithmDifferenceValue = center - this.AlgorithmCenterX; this.AlgorithmDifferenceValue = this.SettingViewModel.SafeAxis - msg.center_x;
// 更新FPS // 更新FPS
this.AlgorithmFPS.CalcFps(); this.AlgorithmFPS.CalcFps();
......
...@@ -35,4 +35,4 @@ CLIENT_RIGHT_COLOR=#00000000 ...@@ -35,4 +35,4 @@ CLIENT_RIGHT_COLOR=#00000000
; 箭头安全颜色(格式:#AARRGGBB) ; 箭头安全颜色(格式:#AARRGGBB)
CLIENT_SAFE_COLOR=#00000000 CLIENT_SAFE_COLOR=#00000000
; 输出串口号 ; 输出串口号
CLIENT_OUTPUT_SERIAL_PORT=COM1 CLIENT_OUTPUT_SERIAL_PORT=COM3
\ No newline at end of file \ No newline at end of file
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