Commit aa166e8d by liulongfei

1. 引入 WPFToolKit 组件

2. 安全框
3. 轴控制
parent 6d894e9e
...@@ -127,6 +127,21 @@ ...@@ -127,6 +127,21 @@
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" /> <Reference Include="WindowsFormsIntegration" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ApplicationDefinition Include="App.xaml"> <ApplicationDefinition Include="App.xaml">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" /> <package id="System.Buffers" version="4.5.1" targetFramework="net48" />
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<toolkit:InverseBoolConverter x:Key="InverseBoolConverter" />
<DataTemplate x:Key="DefaultWatermarkTemplate">
<ContentControl Content="{Binding}"
Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"
Focusable="False"
Margin="0,0,3,0" />
</DataTemplate>
<DataTemplate x:Key="IncreaseGlyphNormalKey">
<TextBlock Text="UP" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</DataTemplate>
<DataTemplate x:Key="IncreaseGlyphDisabledKey">
<TextBlock Text="UP" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</DataTemplate>
<DataTemplate x:Key="DecreaseGlyphNormalKey">
<TextBlock Text="DOWN" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</DataTemplate>
<DataTemplate x:Key="DecreaseGlyphDisabledKey">
<TextBlock Text="DOWN" VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
</DataTemplate>
<Style x:Key="NumericUpDown"
TargetType="{x:Type toolkit:InputBase}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Control">
<toolkit:ButtonSpinner x:Name="PART_Spinner"
IsTabStop="False"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AllowSpin="{Binding AllowSpin, RelativeSource={RelativeSource TemplatedParent}}"
ShowSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
ShowButtonSpinner="{Binding ShowButtonSpinner, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerLocation="{Binding ButtonSpinnerLocation, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerWidth="{Binding ButtonSpinnerWidth, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerHeight="{Binding ButtonSpinnerHeight, RelativeSource={RelativeSource TemplatedParent}}"
SpinnerUpContentTemplate="{Binding ButtonSpinnerUpContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphNormalKey}}"
SpinnerDownContentTemplate="{Binding ButtonSpinnerDownContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphNormalKey}}"
SpinnerUpDisabledContentTemplate="{Binding ButtonSpinnerUpDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource IncreaseGlyphDisabledKey}}"
SpinnerDownDisabledContentTemplate="{Binding ButtonSpinnerDownDisabledContentTemplate, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={StaticResource DecreaseGlyphDisabledKey}}">
<toolkit:WatermarkTextBox x:Name="PART_TextBox"
BorderThickness="0"
Background="Transparent"
CaretBrush="White"
ContextMenu="{TemplateBinding ContextMenu}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
FontStyle="{TemplateBinding FontStyle}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
IsUndoEnabled="{Binding IsUndoEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTabStop="True"
MinWidth="20"
AcceptsReturn="False"
Padding="{TemplateBinding Padding}"
AutoSelectBehavior="{Binding AutoSelectBehavior, RelativeSource={RelativeSource TemplatedParent}}"
AutoMoveFocus="{Binding AutoMoveFocus, RelativeSource={RelativeSource TemplatedParent}}"
TextAlignment="{Binding TextAlignment, RelativeSource={RelativeSource TemplatedParent}}"
TextWrapping="NoWrap"
TabIndex="{TemplateBinding TabIndex}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Watermark="{Binding Watermark, RelativeSource={RelativeSource TemplatedParent}}"
WatermarkTemplate="{Binding WatermarkTemplate, RelativeSource={RelativeSource TemplatedParent}}"
MaxLength="{Binding MaxLength, RelativeSource={RelativeSource TemplatedParent}}">
</toolkit:WatermarkTextBox>
</toolkit:ButtonSpinner>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
Value="False" />
<Condition Binding="{Binding AllowTextInput, RelativeSource={RelativeSource Self}}"
Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="IsReadOnly"
Value="True"
TargetName="PART_TextBox" />
</MultiDataTrigger>
<DataTrigger Binding="{Binding IsReadOnly, RelativeSource={RelativeSource Self}}"
Value="True">
<Setter Property="IsReadOnly"
Value="True"
TargetName="PART_TextBox" />
</DataTrigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
<Trigger Property="IsFocused"
Value="True">
<Setter TargetName="PART_TextBox"
Property="FocusManager.FocusedElement"
Value="{Binding ElementName=PART_TextBox}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- =============================================================================== -->
<!-- DecimalUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:DecimalUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- DoubleUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:DoubleUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- IntegerUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:IntegerUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- ShortUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:ShortUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- LongUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:LongUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- ByteUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:ByteUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- SingleUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:SingleUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- Style for all internal derived types of NumericUpDown will be done in code-behind -->
<!-- for external themes to redefine the default style. The reason is that the -->
<!-- toolkit.dll uses the InternalsVisibleTo attribute which makes internal data only -->
<!-- available in code-behind (not xaml). -->
<!-- (ex. Office2007 theme) -->
<!-- =============================================================================== -->
<!-- =============================================================================== -->
<!-- SByteUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:SByteUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- UIntegerUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:UIntegerUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- ULongUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:ULongUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
<!-- =============================================================================== -->
<!-- UShortUpDown -->
<!-- =============================================================================== -->
<Style TargetType="{x:Type toolkit:UShortUpDown}"
BasedOn="{StaticResource NumericUpDown}" />
</ResourceDictionary>
\ No newline at end of file
...@@ -65,6 +65,21 @@ ...@@ -65,6 +65,21 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Style\Button\Button_WindowTop.xaml"> <Page Include="Style\Button\Button_WindowTop.xaml">
...@@ -91,6 +106,10 @@ ...@@ -91,6 +106,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Toolkit\NumericUpDown\NumericUpDown.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
...@@ -110,6 +129,7 @@ ...@@ -110,6 +129,7 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
</packages>
\ No newline at end of file
...@@ -47,8 +47,8 @@ namespace VIZ.GimbalAI.Connection ...@@ -47,8 +47,8 @@ namespace VIZ.GimbalAI.Connection
y += symbol * ApplicationDomainEx.GimbalControlModel.TargetKeepSymbolHelperY.GetSymbol(package.v) * ApplicationDomainEx.GimbalControlModel.CenterAxisSpeed; y += symbol * ApplicationDomainEx.GimbalControlModel.TargetKeepSymbolHelperY.GetSymbol(package.v) * ApplicationDomainEx.GimbalControlModel.CenterAxisSpeed;
} }
x = MathHelper.Clip(0, 1920, x); x = MathHelper.Clip(0, ApplicationDomainEx.VIDEO_WIDTH, x);
y = MathHelper.Clip(0, 1080, y); y = MathHelper.Clip(0, ApplicationDomainEx.VIDEO_HEIGH, y);
ApplicationDomainEx.GimbalControlModel.TargetCenterAxisX = x; ApplicationDomainEx.GimbalControlModel.TargetCenterAxisX = x;
ApplicationDomainEx.GimbalControlModel.TargetCenterAxisY = y; ApplicationDomainEx.GimbalControlModel.TargetCenterAxisY = y;
} }
......
...@@ -15,6 +15,16 @@ namespace VIZ.GimbalAI.Domain ...@@ -15,6 +15,16 @@ namespace VIZ.GimbalAI.Domain
public class ApplicationDomainEx : ApplicationDomain public class ApplicationDomainEx : ApplicationDomain
{ {
/// <summary> /// <summary>
/// 视频宽度
/// </summary>
public const int VIDEO_WIDTH = 1920;
/// <summary>
/// 视频高度
/// </summary>
public const int VIDEO_HEIGH = 1080;
/// <summary>
/// CSV数据上下文 /// CSV数据上下文
/// </summary> /// </summary>
public static CsvContext CsvContext { get; set; } public static CsvContext CsvContext { get; set; }
......
...@@ -82,16 +82,16 @@ namespace VIZ.GimbalAI.Domain ...@@ -82,16 +82,16 @@ namespace VIZ.GimbalAI.Domain
#endregion #endregion
#region SaveHeight -- 安全高度 #region SaveHeigh -- 安全高度
private int saveHeight; private int saveHeigh;
/// <summary> /// <summary>
/// 安全高度 /// 安全高度
/// </summary> /// </summary>
public int SaveHeight public int SaveHeigh
{ {
get { return saveHeight; } get { return saveHeigh; }
set { saveHeight = value; this.RaisePropertyChanged(nameof(SaveHeight)); } set { saveHeigh = value; this.RaisePropertyChanged(nameof(SaveHeigh)); }
} }
#endregion #endregion
......
...@@ -16,22 +16,22 @@ namespace VIZ.GimbalAI.Domain ...@@ -16,22 +16,22 @@ namespace VIZ.GimbalAI.Domain
/// <summary> /// <summary>
/// 目标中心轴X坐标 /// 目标中心轴X坐标
/// </summary> /// </summary>
public double TargetCenterAxisX { get; set; } = 1920 / 2; public double TargetCenterAxisX { get; set; } = ApplicationDomainEx.VIDEO_WIDTH / 2;
/// <summary> /// <summary>
/// 中心轴X坐标 /// 中心轴X坐标
/// </summary> /// </summary>
public double CenterAxisX { get; set; } = 1920 / 2; public double CenterAxisX { get; set; } = ApplicationDomainEx.VIDEO_WIDTH / 2;
/// <summary> /// <summary>
/// 目标中心轴Y坐标 /// 目标中心轴Y坐标
/// </summary> /// </summary>
public double TargetCenterAxisY { get; set; } = 1080 / 2; public double TargetCenterAxisY { get; set; } = ApplicationDomainEx.VIDEO_HEIGH / 2;
/// <summary> /// <summary>
/// 中心轴Y坐标 /// 中心轴Y坐标
/// </summary> /// </summary>
public double CenterAxisY { get; set; } = 1080 / 2; public double CenterAxisY { get; set; } = ApplicationDomainEx.VIDEO_HEIGH / 2;
/// <summary> /// <summary>
/// 目标中心轴X 保持符号辅助类 /// 目标中心轴X 保持符号辅助类
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:converter="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core" xmlns:converter="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:common="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common" xmlns:common="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:domain="clr-namespace:VIZ.GimbalAI.Domain;assembly=VIZ.GimbalAI.Domain"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
d:DataContext="{d:DesignInstance Type=local:ControlViewModel}" d:DataContext="{d:DesignInstance Type=local:ControlViewModel}"
mc:Ignorable="d" x:Name="uc" mc:Ignorable="d" x:Name="uc"
d:DesignHeight="800" d:DesignWidth="300"> d:DesignHeight="800" d:DesignWidth="300">
...@@ -18,6 +20,8 @@ ...@@ -18,6 +20,8 @@
<ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/CheckBox/CheckBox_AlgorithmClass.xaml"></ResourceDictionary> <ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/CheckBox/CheckBox_AlgorithmClass.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/RadioButton/RadioButton_Mode.xaml"></ResourceDictionary> <ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/RadioButton/RadioButton_Mode.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/ComboBox/ComboBox_AlgorithmScene.xaml"></ResourceDictionary> <ResourceDictionary Source="/VIZ.GimbalAI.Module.Resource;component/Style/ComboBox/ComboBox_AlgorithmScene.xaml"></ResourceDictionary>
<ResourceDictionary Source="/VIZ.GimbalAI.Common.Resource;component/Toolkit/NumericUpDown/NumericUpDown.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<converter:Bool2VisibilityConverter x:Key="Bool2VisibilityConverter"></converter:Bool2VisibilityConverter> <converter:Bool2VisibilityConverter x:Key="Bool2VisibilityConverter"></converter:Bool2VisibilityConverter>
...@@ -170,11 +174,12 @@ ...@@ -170,11 +174,12 @@
</ComboBox> </ComboBox>
<!-- 速度 --> <!-- 速度 -->
<TextBlock Text="速度" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" <TextBlock Text="速度" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="White" FontSize="16"></TextBlock> Foreground="White" FontSize="16"></TextBlock>
<common:NumberBox Grid.Row="3" Grid.Column="1" IsShowUpAndDownButton="False" Height="30" <toolkit:IntegerUpDown Grid.Column="1" Grid.Row="3" BorderBrush="#ff33333b" FontSize="16"
Foreground="White" FontSize="16" BorderBrush="#99FFFFFF" ButtonSpinnerWidth="0" Background="Transparent"
MinValue="1" MaxValue="10" Margin="0,0,10,0" Height="30" Margin="0,0,10,0"
Value="{Binding Path=CenterAxisSpeed,Mode=TwoWay}"></common:NumberBox> Minimum="1" Maximum="10" Increment="10"
Value="{Binding Path=CenterAxisSpeed,Mode=TwoWay}"></toolkit:IntegerUpDown>
</Grid> </Grid>
<!-- 安全框 --> <!-- 安全框 -->
...@@ -195,17 +200,19 @@ ...@@ -195,17 +200,19 @@
<!-- 宽度 --> <!-- 宽度 -->
<TextBlock Text="宽度" Grid.Row="1" FontSize="16" Foreground="White" <TextBlock Text="宽度" Grid.Row="1" FontSize="16" Foreground="White"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<common:NumberBox Grid.Column="1" Grid.Row="1" IsShowUpAndDownButton="False" Foreground="White" <toolkit:IntegerUpDown Grid.Column="1" Grid.Row="1" BorderBrush="#ff33333b" FontSize="16"
BorderBrush="#99FFFFFF" FontSize="16" MinValue="100" MaxValue="1920" Interval="1" ButtonSpinnerWidth="0" Background="Transparent"
Height="30" Margin="0,0,10,0" Height="30" Margin="0,0,10,0"
Value="{Binding Path=AlgorithmSaveWidth,Mode=TwoWay}"></common:NumberBox> Minimum="100" Maximum="1920" Increment="10"
Value="{Binding Path=AlgorithmSaveWidth,Mode=TwoWay}"></toolkit:IntegerUpDown>
<!-- 高度 --> <!-- 高度 -->
<TextBlock Text="高度" Grid.Row="2" FontSize="16" Foreground="White" <TextBlock Text="高度" Grid.Row="2" FontSize="16" Foreground="White"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock> VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<common:NumberBox Grid.Column="1" Grid.Row="2" IsShowUpAndDownButton="False" Foreground="White" <toolkit:IntegerUpDown Grid.Column="1" Grid.Row="2" BorderBrush="#ff33333b" FontSize="16"
BorderBrush="#99FFFFFF" FontSize="16" MinValue="100" MaxValue="1080" Interval="1" ButtonSpinnerWidth="0" Background="Transparent"
Height="30" Margin="0,0,10,0" Height="30" Margin="0,0,10,0"
Value="{Binding Path=AlgorithmSaveHeight,Mode=TwoWay}"></common:NumberBox> Minimum="100" Maximum="1080" Increment="10"
Value="{Binding Path=AlgorithmSaveHeigh,Mode=TwoWay}"></toolkit:IntegerUpDown>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
......
...@@ -56,7 +56,7 @@ namespace VIZ.GimbalAI.Module ...@@ -56,7 +56,7 @@ namespace VIZ.GimbalAI.Module
this.CenterAxisSpeed = ApplicationDomainEx.GimbalControlModel.CenterAxisSpeed; this.CenterAxisSpeed = ApplicationDomainEx.GimbalControlModel.CenterAxisSpeed;
this.AlgorithmSaveWidth = ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth; this.AlgorithmSaveWidth = ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth;
this.algorithmSaveHeight = ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight; this.algorithmSaveHeigh = ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh;
} }
/// <summary> /// <summary>
...@@ -331,18 +331,18 @@ namespace VIZ.GimbalAI.Module ...@@ -331,18 +331,18 @@ namespace VIZ.GimbalAI.Module
#region AlgorithmSaveHeight -- 算法安全框高度 #region AlgorithmSaveHeight -- 算法安全框高度
private double algorithmSaveHeight; private double algorithmSaveHeigh;
/// <summary> /// <summary>
/// 算法安全框高度 /// 算法安全框高度
/// </summary> /// </summary>
public double AlgorithmSaveHeight public double AlgorithmSaveHeigh
{ {
get { return algorithmSaveHeight; } get { return algorithmSaveHeigh; }
set set
{ {
algorithmSaveHeight = value; algorithmSaveHeigh = value;
this.RaisePropertyChanged(nameof(AlgorithmSaveHeight)); this.RaisePropertyChanged(nameof(AlgorithmSaveHeigh));
ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight = (int)value; ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh = (int)value;
} }
} }
......
...@@ -68,8 +68,8 @@ namespace VIZ.GimbalAI.Module ...@@ -68,8 +68,8 @@ namespace VIZ.GimbalAI.Module
y += GIMBAL_CENTER_AXIS_SPEED; y += GIMBAL_CENTER_AXIS_SPEED;
} }
x = MathHelper.Clip(0, 1920, x); x = MathHelper.Clip(0, ApplicationDomainEx.VIDEO_WIDTH, x);
y = MathHelper.Clip(0, 1080, y); y = MathHelper.Clip(0, ApplicationDomainEx.VIDEO_HEIGH, y);
ApplicationDomainEx.GimbalControlModel.TargetCenterAxisX = x; ApplicationDomainEx.GimbalControlModel.TargetCenterAxisX = x;
ApplicationDomainEx.GimbalControlModel.TargetCenterAxisY = y; ApplicationDomainEx.GimbalControlModel.TargetCenterAxisY = y;
} }
......
...@@ -36,7 +36,7 @@ namespace VIZ.GimbalAI.Module ...@@ -36,7 +36,7 @@ namespace VIZ.GimbalAI.Module
{ {
// 算法安全框 // 算法安全框
ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_SAVE_WIDTH); ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_SAVE_WIDTH);
ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_SAVE_HEIGHT); ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh = ApplicationDomainEx.IniStorage.GetValue<AlgorithmConfig, int>(p => p.ALGORITHM_SAVE_HEIGHT);
// 控制轴方向 // 控制轴方向
ApplicationDomainEx.GimbalControlModel.HorizontalRockerDirection = ApplicationDomainEx.IniStorage.GetValue<GimbalConfig, string>(p => p.GIMBAL_CENTER_AXIS_HORIZONTAL_DIRECTION) == RockerDirection.Forward.ToString() ? RockerDirection.Forward : RockerDirection.Backward; ApplicationDomainEx.GimbalControlModel.HorizontalRockerDirection = ApplicationDomainEx.IniStorage.GetValue<GimbalConfig, string>(p => p.GIMBAL_CENTER_AXIS_HORIZONTAL_DIRECTION) == RockerDirection.Forward.ToString() ? RockerDirection.Forward : RockerDirection.Backward;
...@@ -65,7 +65,7 @@ namespace VIZ.GimbalAI.Module ...@@ -65,7 +65,7 @@ namespace VIZ.GimbalAI.Module
{ {
// 算法安全框 // 算法安全框
ApplicationDomainEx.IniStorage.SetValue<AlgorithmConfig>(p => p.ALGORITHM_SAVE_WIDTH, ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth); ApplicationDomainEx.IniStorage.SetValue<AlgorithmConfig>(p => p.ALGORITHM_SAVE_WIDTH, ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth);
ApplicationDomainEx.IniStorage.SetValue<AlgorithmConfig>(p => p.ALGORITHM_SAVE_HEIGHT, ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight); ApplicationDomainEx.IniStorage.SetValue<AlgorithmConfig>(p => p.ALGORITHM_SAVE_HEIGHT, ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh);
// 控制轴方向 // 控制轴方向
ApplicationDomainEx.IniStorage.SetValue<GimbalConfig>(p => p.GIMBAL_CENTER_AXIS_HORIZONTAL_DIRECTION, ApplicationDomainEx.GimbalControlModel.HorizontalRockerDirection); ApplicationDomainEx.IniStorage.SetValue<GimbalConfig>(p => p.GIMBAL_CENTER_AXIS_HORIZONTAL_DIRECTION, ApplicationDomainEx.GimbalControlModel.HorizontalRockerDirection);
......
...@@ -135,6 +135,21 @@ ...@@ -135,6 +135,21 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="ControlView\View\ChangeVideoFrameDelayView.xaml"> <Page Include="ControlView\View\ChangeVideoFrameDelayView.xaml">
......
...@@ -8,7 +8,6 @@ using VIZ.GimbalAI.Common; ...@@ -8,7 +8,6 @@ using VIZ.GimbalAI.Common;
using VIZ.GimbalAI.Domain; using VIZ.GimbalAI.Domain;
using VIZ.GimbalAI.Domain.Message; using VIZ.GimbalAI.Domain.Message;
using VIZ.GimbalAI.Connection; using VIZ.GimbalAI.Connection;
using ManageLiteAV;
using System.Drawing; using System.Drawing;
using VIZ.GimbalAI.Storage; using VIZ.GimbalAI.Storage;
using VIZ.Framework.Common; using VIZ.Framework.Common;
...@@ -19,7 +18,6 @@ using OpenCvSharp.Extensions; ...@@ -19,7 +18,6 @@ using OpenCvSharp.Extensions;
using SharpDX.Mathematics.Interop; using SharpDX.Mathematics.Interop;
using VIZ.Framework.Storage; using VIZ.Framework.Storage;
using System.Windows.Interop; using System.Windows.Interop;
using System.Web.UI.WebControls;
namespace VIZ.GimbalAI.Module namespace VIZ.GimbalAI.Module
{ {
...@@ -101,10 +99,10 @@ namespace VIZ.GimbalAI.Module ...@@ -101,10 +99,10 @@ namespace VIZ.GimbalAI.Module
// 更新安全框 // 更新安全框
ClipBoxInfo clipBoxInfo = new ClipBoxInfo(); ClipBoxInfo clipBoxInfo = new ClipBoxInfo();
float left = (1920 - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f; float left = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f;
float top = (1080 - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight) / 2f; float top = (ApplicationDomainEx.VIDEO_HEIGH - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh) / 2f;
float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth; float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth;
float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight; float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh;
clipBoxInfo.SrcRect = new RawRectangleF(left, top, right, bottom); clipBoxInfo.SrcRect = new RawRectangleF(left, top, right, bottom);
clipBoxInfo.DrawingBorderWidth = 4; clipBoxInfo.DrawingBorderWidth = 4;
clipBoxInfo.DrawingBorderColor = ALGORITHM_SAVE_COLOR; clipBoxInfo.DrawingBorderColor = ALGORITHM_SAVE_COLOR;
...@@ -484,10 +482,10 @@ namespace VIZ.GimbalAI.Module ...@@ -484,10 +482,10 @@ namespace VIZ.GimbalAI.Module
private void UpdateSaveRect(VideoView view) private void UpdateSaveRect(VideoView view)
{ {
ClipBoxInfo clipBoxInfo = new ClipBoxInfo(); ClipBoxInfo clipBoxInfo = new ClipBoxInfo();
float left = (1920 - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f; float left = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f;
float top = (1080 - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight) / 2f; float top = (ApplicationDomainEx.VIDEO_HEIGH - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh) / 2f;
float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth; float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth;
float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight; float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh;
clipBoxInfo.SrcRect = new RawRectangleF(left, top, right, bottom); clipBoxInfo.SrcRect = new RawRectangleF(left, top, right, bottom);
clipBoxInfo.DrawingBorderWidth = 4; clipBoxInfo.DrawingBorderWidth = 4;
clipBoxInfo.DrawingBorderColor = ALGORITHM_SAVE_COLOR; clipBoxInfo.DrawingBorderColor = ALGORITHM_SAVE_COLOR;
...@@ -562,10 +560,10 @@ namespace VIZ.GimbalAI.Module ...@@ -562,10 +560,10 @@ namespace VIZ.GimbalAI.Module
float center_x = rect.Left + (rect.Right - rect.Left) / 2f; float center_x = rect.Left + (rect.Right - rect.Left) / 2f;
float center_y = rect.Top + (rect.Bottom - rect.Top) / 2f; float center_y = rect.Top + (rect.Bottom - rect.Top) / 2f;
float left = (1920 - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f; float left = (ApplicationDomainEx.VIDEO_WIDTH - ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth) / 2f;
float top = (1080 - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight) / 2f; float top = (ApplicationDomainEx.VIDEO_HEIGH - ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh) / 2f;
float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth; float right = left + ApplicationDomainEx.AlgorithmAutoSetting.SaveWidth;
float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeight; float bottom = top + ApplicationDomainEx.AlgorithmAutoSetting.SaveHeigh;
// 不处理在安全框以外的数据 // 不处理在安全框以外的数据
if (center_x < left || center_x > right || center_y < top || center_y > bottom) if (center_x < left || center_x > right || center_y < top || center_y > bottom)
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="LiteDB" version="5.0.11" targetFramework="net48" /> <package id="LiteDB" version="5.0.11" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" /> <package id="log4net" version="2.0.14" targetFramework="net48" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net48" />
......
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