Commit e455f67a by liulongfei

部分逻辑调整

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