Commit dd8f2990 by liulongfei

修复差值计算错误的bug

parent 6a4f1e1c
......@@ -68,8 +68,12 @@
DifferenceValue="{Binding DifferenceValue,Mode=OneWay}"
LeftBrush="#066FA5" RightBrush="#F70044" SafeBrush="#11CD86"></common:ArrowShape>
</fcommon:FlashingBorder>
<!--<Slider VerticalAlignment="Center" Width="200" Minimum="-100" Maximum="100"
x:Name="slider" Value="0" Grid.ColumnSpan="2" HorizontalAlignment="Right"></Slider>-->
<fcommon:DebugBorder HorizontalAlignment="Left" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="算法FPS:" Foreground="Red" FontSize="20" Margin="10,0,10,0"></TextBlock>
<TextBlock Text="{Binding AlgorithmFPS.FPS}" Foreground="Red" FontSize="20"></TextBlock>
</StackPanel>
</fcommon:DebugBorder>
<!-- 主视频区域 -->
<fcommon:VideoControl x:Name="video" Grid.Row="1" Margin="10,0,44,0"></fcommon:VideoControl>
<CheckBox x:Name="cbShowSettingView" Grid.Row="1" Style="{StaticResource CheckBox_Expand}"
......
......@@ -21,6 +21,9 @@ namespace VIZ.ElectricRabbit.Module
// 初始化命令
this.InitCommand();
// 初始化FPS
this.InitFPS();
// 初始化消息
this.InitMessage();
}
......@@ -44,6 +47,15 @@ namespace VIZ.ElectricRabbit.Module
ApplicationDomainEx.MessageManager.Register<AlgorithmDectectMessage>(this, this.OnAlgorithmDectectMessage);
}
/// <summary>
/// 初始化FPS
/// </summary>
private void InitFPS()
{
this.AlgorithmFPS = new FPSHelper();
this.AlgorithmFPS.Start();
}
// ================================================================================
// Property
// ================================================================================
......@@ -90,6 +102,20 @@ namespace VIZ.ElectricRabbit.Module
#endregion
#region AlgorithmFPS -- 算法FPS
private FPSHelper algorithmFPS;
/// <summary>
/// 算法FPS
/// </summary>
public FPSHelper AlgorithmFPS
{
get { return algorithmFPS; }
set { algorithmFPS = value; this.RaisePropertyChanged(nameof(AlgorithmFPS)); }
}
#endregion
// ================================================================================
// Command
// ================================================================================
......@@ -266,8 +292,11 @@ namespace VIZ.ElectricRabbit.Module
view.video.UpdateTrackingBox(infos);
// 更新差值
double center = (right - left) / 2d;
this.DifferenceValue = this.SettingViewModel.SafeAxis - center;
double center = left + (right - left) / 2d;
this.DifferenceValue = center - this.SettingViewModel.SafeAxis;
// 更新FPS
this.AlgorithmFPS.CalcFps();
}
}
}
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