Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.GimbalAI
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.GimbalAI
Commits
aa166e8d
Commit
aa166e8d
authored
Oct 09, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 引入 WPFToolKit 组件
2. 安全框 3. 轴控制
parent
6d894e9e
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
327 additions
and
43 deletions
+327
-43
VIZ.GimbalAI.Client/VIZ.GimbalAI.Client.csproj
+15
-0
VIZ.GimbalAI.Client/packages.config
+1
-0
VIZ.GimbalAI.Common.Resource/Toolkit/NumericUpDown/NumericUpDown.xaml
+199
-0
VIZ.GimbalAI.Common.Resource/VIZ.GimbalAI.Common.Resource.csproj
+20
-0
VIZ.GimbalAI.Common.Resource/packages.config
+5
-0
VIZ.GimbalAI.Connection/UDP/Gimbal/Provider/GimbalCenterAxisProvider.cs
+2
-2
VIZ.GimbalAI.Domain/ApplicationDomainEx.cs
+10
-0
VIZ.GimbalAI.Domain/Model/Algorithm/AlgorithmAutoSetting.cs
+5
-5
VIZ.GimbalAI.Domain/Model/Gimbal/GimbalControlModel.cs
+4
-4
VIZ.GimbalAI.Module.Resource/VIZ.GimbalAI.Module.Resource.csproj
+1
-0
VIZ.GimbalAI.Module.Resource/app.config
+12
-0
VIZ.GimbalAI.Module/ControlView/View/ControlView.xaml
+17
-10
VIZ.GimbalAI.Module/ControlView/ViewModel/ControlViewModel.cs
+7
-7
VIZ.GimbalAI.Module/MainView/Controller/Hotkey/HotkeyController.cs
+2
-2
VIZ.GimbalAI.Module/Setup/Provider/Setup/AppSetup_InitConfig.cs
+2
-2
VIZ.GimbalAI.Module/VIZ.GimbalAI.Module.csproj
+15
-0
VIZ.GimbalAI.Module/VideoView/ViewModel/VideoViewModel.cs
+9
-11
VIZ.GimbalAI.Module/packages.config
+1
-0
No files found.
VIZ.GimbalAI.Client/VIZ.GimbalAI.Client.csproj
View file @
aa166e8d
...
...
@@ -127,6 +127,21 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<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>
<ApplicationDefinition Include="App.xaml">
...
...
VIZ.GimbalAI.Client/packages.config
View file @
aa166e8d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Extended.Wpf.Toolkit"
version
=
"4.4.0"
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
=
"System.Buffers"
version
=
"4.5.1"
targetFramework
=
"net48"
/>
...
...
VIZ.GimbalAI.Common.Resource/Toolkit/NumericUpDown/NumericUpDown.xaml
0 → 100644
View file @
aa166e8d
<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
VIZ.GimbalAI.Common.Resource/VIZ.GimbalAI.Common.Resource.csproj
View file @
aa166e8d
...
...
@@ -65,6 +65,21 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<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>
<Page Include="Style\Button\Button_WindowTop.xaml">
...
...
@@ -91,6 +106,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Toolkit\NumericUpDown\NumericUpDown.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
...
...
@@ -110,6 +129,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
...
...
VIZ.GimbalAI.Common.Resource/packages.config
0 → 100644
View file @
aa166e8d
<?
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
VIZ.GimbalAI.Connection/UDP/Gimbal/Provider/GimbalCenterAxisProvider.cs
View file @
aa166e8d
...
...
@@ -47,8 +47,8 @@ namespace VIZ.GimbalAI.Connection
y
+=
symbol
*
ApplicationDomainEx
.
GimbalControlModel
.
TargetKeepSymbolHelperY
.
GetSymbol
(
package
.
v
)
*
ApplicationDomainEx
.
GimbalControlModel
.
CenterAxisSpeed
;
}
x
=
MathHelper
.
Clip
(
0
,
1920
,
x
);
y
=
MathHelper
.
Clip
(
0
,
1080
,
y
);
x
=
MathHelper
.
Clip
(
0
,
ApplicationDomainEx
.
VIDEO_WIDTH
,
x
);
y
=
MathHelper
.
Clip
(
0
,
ApplicationDomainEx
.
VIDEO_HEIGH
,
y
);
ApplicationDomainEx
.
GimbalControlModel
.
TargetCenterAxisX
=
x
;
ApplicationDomainEx
.
GimbalControlModel
.
TargetCenterAxisY
=
y
;
}
...
...
VIZ.GimbalAI.Domain/ApplicationDomainEx.cs
View file @
aa166e8d
...
...
@@ -15,6 +15,16 @@ namespace VIZ.GimbalAI.Domain
public
class
ApplicationDomainEx
:
ApplicationDomain
{
/// <summary>
/// 视频宽度
/// </summary>
public
const
int
VIDEO_WIDTH
=
1920
;
/// <summary>
/// 视频高度
/// </summary>
public
const
int
VIDEO_HEIGH
=
1080
;
/// <summary>
/// CSV数据上下文
/// </summary>
public
static
CsvContext
CsvContext
{
get
;
set
;
}
...
...
VIZ.GimbalAI.Domain/Model/Algorithm/AlgorithmAutoSetting.cs
View file @
aa166e8d
...
...
@@ -82,16 +82,16 @@ namespace VIZ.GimbalAI.Domain
#
endregion
#
region
SaveHeigh
t
--
安全高度
#
region
SaveHeigh
--
安全高度
private
int
saveHeigh
t
;
private
int
saveHeigh
;
/// <summary>
/// 安全高度
/// </summary>
public
int
SaveHeigh
t
public
int
SaveHeigh
{
get
{
return
saveHeigh
t
;
}
set
{
saveHeigh
t
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SaveHeight
));
}
get
{
return
saveHeigh
;
}
set
{
saveHeigh
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
SaveHeigh
));
}
}
#
endregion
...
...
VIZ.GimbalAI.Domain/Model/Gimbal/GimbalControlModel.cs
View file @
aa166e8d
...
...
@@ -16,22 +16,22 @@ namespace VIZ.GimbalAI.Domain
/// <summary>
/// 目标中心轴X坐标
/// </summary>
public
double
TargetCenterAxisX
{
get
;
set
;
}
=
1920
/
2
;
public
double
TargetCenterAxisX
{
get
;
set
;
}
=
ApplicationDomainEx
.
VIDEO_WIDTH
/
2
;
/// <summary>
/// 中心轴X坐标
/// </summary>
public
double
CenterAxisX
{
get
;
set
;
}
=
1920
/
2
;
public
double
CenterAxisX
{
get
;
set
;
}
=
ApplicationDomainEx
.
VIDEO_WIDTH
/
2
;
/// <summary>
/// 目标中心轴Y坐标
/// </summary>
public
double
TargetCenterAxisY
{
get
;
set
;
}
=
1080
/
2
;
public
double
TargetCenterAxisY
{
get
;
set
;
}
=
ApplicationDomainEx
.
VIDEO_HEIGH
/
2
;
/// <summary>
/// 中心轴Y坐标
/// </summary>
public
double
CenterAxisY
{
get
;
set
;
}
=
1080
/
2
;
public
double
CenterAxisY
{
get
;
set
;
}
=
ApplicationDomainEx
.
VIDEO_HEIGH
/
2
;
/// <summary>
/// 目标中心轴X 保持符号辅助类
...
...
VIZ.GimbalAI.Module.Resource/VIZ.GimbalAI.Module.Resource.csproj
View file @
aa166e8d
...
...
@@ -121,6 +121,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
...
...
VIZ.GimbalAI.Module.Resource/app.config
0 → 100644
View file @
aa166e8d
<?
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
VIZ.GimbalAI.Module/ControlView/View/ControlView.xaml
View file @
aa166e8d
...
...
@@ -7,6 +7,8 @@
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:converter="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
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}"
mc:Ignorable="d" x:Name="uc"
d:DesignHeight="800" d:DesignWidth="300">
...
...
@@ -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/RadioButton/RadioButton_Mode.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>
<converter:Bool2VisibilityConverter x:Key="Bool2VisibilityConverter"></converter:Bool2VisibilityConverter>
...
...
@@ -171,10 +175,11 @@
<!-- 速度 -->
<TextBlock Text="速度" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="White" FontSize="16"></TextBlock>
<common:NumberBox Grid.Row="3" Grid.Column="1" IsShowUpAndDownButton="False" Height="30"
Foreground="White" FontSize="16" BorderBrush="#99FFFFFF"
MinValue="1" MaxValue="10" Margin="0,0,10,0"
Value="{Binding Path=CenterAxisSpeed,Mode=TwoWay}"></common:NumberBox>
<toolkit:IntegerUpDown Grid.Column="1" Grid.Row="3" BorderBrush="#ff33333b" FontSize="16"
ButtonSpinnerWidth="0" Background="Transparent"
Height="30" Margin="0,0,10,0"
Minimum="1" Maximum="10" Increment="10"
Value="{Binding Path=CenterAxisSpeed,Mode=TwoWay}"></toolkit:IntegerUpDown>
</Grid>
<!-- 安全框 -->
...
...
@@ -195,17 +200,19 @@
<!-- 宽度 -->
<TextBlock Text="宽度" Grid.Row="1" FontSize="16" Foreground="White"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<
common:NumberBox Grid.Column="1" Grid.Row="1" IsShowUpAndDownButton="False" Foreground="White
"
BorderBrush="#99FFFFFF" FontSize="16" MinValue="100" MaxValue="1920" Interval="1
"
<
toolkit:IntegerUpDown Grid.Column="1" Grid.Row="1" BorderBrush="#ff33333b" FontSize="16
"
ButtonSpinnerWidth="0" Background="Transparent
"
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"
VerticalAlignment="Center" HorizontalAlignment="Center"></TextBlock>
<
common:NumberBox Grid.Column="1" Grid.Row="2" IsShowUpAndDownButton="False" Foreground="White
"
BorderBrush="#99FFFFFF" FontSize="16" MinValue="100" MaxValue="1080" Interval="1
"
<
toolkit:IntegerUpDown Grid.Column="1" Grid.Row="2" BorderBrush="#ff33333b" FontSize="16
"
ButtonSpinnerWidth="0" Background="Transparent
"
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>
...
...
VIZ.GimbalAI.Module/ControlView/ViewModel/ControlViewModel.cs
View file @
aa166e8d
...
...
@@ -56,7 +56,7 @@ namespace VIZ.GimbalAI.Module
this
.
CenterAxisSpeed
=
ApplicationDomainEx
.
GimbalControlModel
.
CenterAxisSpeed
;
this
.
AlgorithmSaveWidth
=
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
;
this
.
algorithmSaveHeigh
t
=
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeight
;
this
.
algorithmSaveHeigh
=
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
;
}
/// <summary>
...
...
@@ -331,18 +331,18 @@ namespace VIZ.GimbalAI.Module
#
region
AlgorithmSaveHeight
--
算法安全框高度
private
double
algorithmSaveHeigh
t
;
private
double
algorithmSaveHeigh
;
/// <summary>
/// 算法安全框高度
/// </summary>
public
double
AlgorithmSaveHeigh
t
public
double
AlgorithmSaveHeigh
{
get
{
return
algorithmSaveHeigh
t
;
}
get
{
return
algorithmSaveHeigh
;
}
set
{
algorithmSaveHeigh
t
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
AlgorithmSaveHeigh
t
));
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
=
(
int
)
value
;
algorithmSaveHeigh
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
AlgorithmSaveHeigh
));
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
=
(
int
)
value
;
}
}
...
...
VIZ.GimbalAI.Module/MainView/Controller/Hotkey/HotkeyController.cs
View file @
aa166e8d
...
...
@@ -68,8 +68,8 @@ namespace VIZ.GimbalAI.Module
y
+=
GIMBAL_CENTER_AXIS_SPEED
;
}
x
=
MathHelper
.
Clip
(
0
,
1920
,
x
);
y
=
MathHelper
.
Clip
(
0
,
1080
,
y
);
x
=
MathHelper
.
Clip
(
0
,
ApplicationDomainEx
.
VIDEO_WIDTH
,
x
);
y
=
MathHelper
.
Clip
(
0
,
ApplicationDomainEx
.
VIDEO_HEIGH
,
y
);
ApplicationDomainEx
.
GimbalControlModel
.
TargetCenterAxisX
=
x
;
ApplicationDomainEx
.
GimbalControlModel
.
TargetCenterAxisY
=
y
;
}
...
...
VIZ.GimbalAI.Module/Setup/Provider/Setup/AppSetup_InitConfig.cs
View file @
aa166e8d
...
...
@@ -36,7 +36,7 @@ namespace VIZ.GimbalAI.Module
{
// 算法安全框
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
AlgorithmConfig
,
int
>(
p
=>
p
.
ALGORITHM_SAVE_WIDTH
);
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
=
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
;
...
...
@@ -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_HEIGHT
,
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
);
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
);
...
...
VIZ.GimbalAI.Module/VIZ.GimbalAI.Module.csproj
View file @
aa166e8d
...
...
@@ -135,6 +135,21 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<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>
<Page Include="ControlView\View\ChangeVideoFrameDelayView.xaml">
...
...
VIZ.GimbalAI.Module/VideoView/ViewModel/VideoViewModel.cs
View file @
aa166e8d
...
...
@@ -8,7 +8,6 @@ using VIZ.GimbalAI.Common;
using
VIZ.GimbalAI.Domain
;
using
VIZ.GimbalAI.Domain.Message
;
using
VIZ.GimbalAI.Connection
;
using
ManageLiteAV
;
using
System.Drawing
;
using
VIZ.GimbalAI.Storage
;
using
VIZ.Framework.Common
;
...
...
@@ -19,7 +18,6 @@ using OpenCvSharp.Extensions;
using
SharpDX.Mathematics.Interop
;
using
VIZ.Framework.Storage
;
using
System.Windows.Interop
;
using
System.Web.UI.WebControls
;
namespace
VIZ.GimbalAI.Module
{
...
...
@@ -101,10 +99,10 @@ namespace VIZ.GimbalAI.Module
// 更新安全框
ClipBoxInfo
clipBoxInfo
=
new
ClipBoxInfo
();
float
left
=
(
1920
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
1080
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeight
)
/
2f
;
float
left
=
(
ApplicationDomainEx
.
VIDEO_WIDTH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
ApplicationDomainEx
.
VIDEO_HEIGH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
)
/
2f
;
float
right
=
left
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
;
clipBoxInfo
.
SrcRect
=
new
RawRectangleF
(
left
,
top
,
right
,
bottom
);
clipBoxInfo
.
DrawingBorderWidth
=
4
;
clipBoxInfo
.
DrawingBorderColor
=
ALGORITHM_SAVE_COLOR
;
...
...
@@ -484,10 +482,10 @@ namespace VIZ.GimbalAI.Module
private
void
UpdateSaveRect
(
VideoView
view
)
{
ClipBoxInfo
clipBoxInfo
=
new
ClipBoxInfo
();
float
left
=
(
1920
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
1080
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeight
)
/
2f
;
float
left
=
(
ApplicationDomainEx
.
VIDEO_WIDTH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
ApplicationDomainEx
.
VIDEO_HEIGH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
)
/
2f
;
float
right
=
left
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
;
clipBoxInfo
.
SrcRect
=
new
RawRectangleF
(
left
,
top
,
right
,
bottom
);
clipBoxInfo
.
DrawingBorderWidth
=
4
;
clipBoxInfo
.
DrawingBorderColor
=
ALGORITHM_SAVE_COLOR
;
...
...
@@ -562,10 +560,10 @@ namespace VIZ.GimbalAI.Module
float
center_x
=
rect
.
Left
+
(
rect
.
Right
-
rect
.
Left
)
/
2f
;
float
center_y
=
rect
.
Top
+
(
rect
.
Bottom
-
rect
.
Top
)
/
2f
;
float
left
=
(
1920
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
1080
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeight
)
/
2f
;
float
left
=
(
ApplicationDomainEx
.
VIDEO_WIDTH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
)
/
2f
;
float
top
=
(
ApplicationDomainEx
.
VIDEO_HEIGH
-
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
)
/
2f
;
float
right
=
left
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveWidth
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
t
;
float
bottom
=
top
+
ApplicationDomainEx
.
AlgorithmAutoSetting
.
SaveHeigh
;
// 不处理在安全框以外的数据
if
(
center_x
<
left
||
center_x
>
right
||
center_y
<
top
||
center_y
>
bottom
)
...
...
VIZ.GimbalAI.Module/packages.config
View file @
aa166e8d
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Extended.Wpf.Toolkit"
version
=
"4.4.0"
targetFramework
=
"net48"
/>
<
package
id
=
"LiteDB"
version
=
"5.0.11"
targetFramework
=
"net48"
/>
<
package
id
=
"log4net"
version
=
"2.0.14"
targetFramework
=
"net48"
/>
<
package
id
=
"Microsoft.Xaml.Behaviors.Wpf"
version
=
"1.1.39"
targetFramework
=
"net48"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment