Commit a18c53cf by liulongfei

1. 修复校验和计算

2. 添加云台控制器资源项目
parent ec03b6e5
......@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Framework.Connection;
using VIZ.Framework.Domain;
using System.Diagnostics;
namespace VIZ.GimbalAI.Controller.Connection
{
......@@ -22,8 +23,9 @@ namespace VIZ.GimbalAI.Controller.Connection
/// 云台包解析器
/// </summary>
/// <param name="fixedBufferSize">包大小</param>
/// <param name="syncHeader">同步针头</param>
/// <param name="downEndpointManagerKey">下行终结点管理器键</param>
public GimbalPackageDownProvider(int fixedBufferSize, string downEndpointManagerKey) : base(fixedBufferSize)
public GimbalPackageDownProvider(int fixedBufferSize, IEnumerable<byte> syncHeader, string downEndpointManagerKey) : base(fixedBufferSize, syncHeader)
{
this.DownEndpointManagerKey = downEndpointManagerKey;
}
......@@ -44,10 +46,26 @@ namespace VIZ.GimbalAI.Controller.Connection
/// <param name="info">信息</param>
protected override void Execute(ConnFixedBufferInfo info)
{
if (info.Buffer.Any(p => p == 0xA5))
{
Debug.WriteLine("-------------------------------------------");
Debug.WriteLine("0xA5");
Debug.WriteLine("-------------------------------------------");
}
// 解析数据
GimbalPackage_down data = new GimbalPackage_down();
data.FromBuffer(info.Buffer);
// 同步帧头
if (data.SyncHead_1 != 0xA5 || data.SyncHead_2 != 0xE7)
return;
// 校验数据
byte check = data.GetCheckValue();
if (check != data.Check)
return;
// 处理数据
foreach (IGimbalDownProvider provider in this.providers)
{
......
......@@ -21,8 +21,9 @@ namespace VIZ.GimbalAI.Controller.Connection
/// 云台包解析器
/// </summary>
/// <param name="fixedBufferSize">包大小</param>
/// <param name="syncHeader">同步针头</param>
/// <param name="upEndpointManagerKey">上行终结点管理器键</param>
public GimbalPackageUpProvider(int fixedBufferSize, string upEndpointManagerKey) : base(fixedBufferSize)
public GimbalPackageUpProvider(int fixedBufferSize, IEnumerable<byte> syncHeader, string upEndpointManagerKey) : base(fixedBufferSize, syncHeader)
{
this.UpEndpointManagerKey = upEndpointManagerKey;
}
......
......@@ -243,34 +243,13 @@ namespace VIZ.GimbalAI.Controller.Connection
/// <returns>是否通过校验</returns>
public override byte GetCheckValue()
{
byte[] buffer = this.ToBuffer();
long sum = 0;
// 同步帧头 1
sum += this.SyncHead_1;
// 同步帧头 2
sum += this.SyncHead_2;
// 命令字
sum += this.GetValueWithPN(this.Command_PN, this.Command);
// 俯仰
sum += this.GetValueWithPN(this.Vertical_PN, this.Vertical);
// 方位
sum += this.GetValueWithPN(this.Horizontal_PN, this.Horizontal);
// 横滚
sum += this.Roll;
// 变焦
sum += this.Zoom;
// 光圈
sum += this.Aperture;
// 聚焦
sum += this.Focus;
// 品牌
sum += this.Brand;
// 跟踪俯仰
sum += this.GetValueWithPN(this.Track_Vertical_PN, this.Track_Vertical);
// 跟踪方位
sum += this.GetValueWithPN(this.Track_Horizontal_PN, this.Track_Horizontal);
// 备用
// 心跳
sum += this.Heart;
for (int i = 0; i < buffer.Length - 1; i++)
{
sum += buffer[i];
}
return (byte)(sum & 0xFF);
}
......
......@@ -12,6 +12,11 @@ namespace VIZ.GimbalAI.Controller.Connection
public abstract class GimbalPackageBase : IGimbalPackageSerialize
{
/// <summary>
/// 时间 yyyy-MM-dd HH:mm:ss fff
/// </summary>
public string DateTime { get; set; }
/// <summary>
/// 获取一个字节数据的正负值
/// </summary>
/// <param name="buffer">Buffer</param>
......
......@@ -217,36 +217,13 @@ namespace VIZ.GimbalAI.Controller.Connection
/// <returns>是否通过校验</returns>
public override byte GetCheckValue()
{
byte[] buffer = this.ToBuffer();
long sum = 0;
// 同步帧头 1
sum += this.SyncHead_1;
// 同步帧头 2
sum += this.SyncHead_2;
// 命令字
sum += this.Command;
// 俯仰
sum += this.Vertical;
// 方位
sum += this.Horizontal;
// 横滚
sum += this.Roll;
// 变焦
sum += this.Zoom;
// 光圈
sum += this.Aperture;
// 聚焦
sum += this.Focus;
// 心跳
sum += this.Heart;
// 处理后的俯仰角度值
sum += this.Real_Vertical_Angle;
// 处理后的方位角度值
sum += this.Real_Horizontal_Angle;
// 变焦值
sum += this.Real_Zoom;
// 焦点位置
sum += this.Real_Focus;
// 备用 1
for (int i = 0; i < buffer.Length - 1; i++)
{
sum += buffer[i];
}
return (byte)(sum & 0xFF);
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.GimbalAI.Controller.Domain
{
/// <summary>
/// 串口键
/// </summary>
public static class SerialPortKeys
{
/// <summary>
/// 下行
/// </summary>
public const string DOWN = "DOWN";
/// <summary>
/// 上行
/// </summary>
public const string UP = "UP";
}
}
......@@ -61,6 +61,7 @@
<ItemGroup>
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Enum\GimbalPackage_Commands.cs" />
<Compile Include="Enum\SerialPortKeys.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
......
......@@ -10,6 +10,7 @@ using VIZ.Framework.Connection;
using VIZ.Framework.Core;
using VIZ.GimbalAI.Controller.Connection;
using VIZ.GimbalAI.Controller.Domain;
using VIZ.GimbalAI.Controller.Storage;
namespace VIZ.GimbalAI.Controller.Module
{
......@@ -43,6 +44,11 @@ namespace VIZ.GimbalAI.Controller.Module
public bool IsRunning { get; private set; }
/// <summary>
/// 是否输出日志
/// </summary>
private static readonly bool GIMBAL_IS_WRITE_DATA = ApplicationDomainEx.IniStorage.GetValue<GimbalConfig, bool>(p => p.GIMBAL_IS_WRITE_DATA);
/// <summary>
/// 处理线程
/// </summary>
private System.Threading.Thread thread;
......@@ -57,14 +63,17 @@ namespace VIZ.GimbalAI.Controller.Module
/// </summary>
public void Start()
{
string floder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data");
if (!Directory.Exists(floder))
if (GIMBAL_IS_WRITE_DATA)
{
Directory.CreateDirectory(floder);
}
string floder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data");
if (!Directory.Exists(floder))
{
Directory.CreateDirectory(floder);
}
string path = Path.Combine(floder, $"data_{DateTime.Now.ToString("yyyy_MM_dd___HH_mm_ss")}.json");
this.fileStream = new FileStream(path, FileMode.Create, FileAccess.Write);
string path = Path.Combine(floder, $"data_{DateTime.Now.ToString("yyyy_MM_dd___HH_mm_ss")}.json");
this.fileStream = new FileStream(path, FileMode.Create, FileAccess.Write);
}
this.IsRunning = true;
this.thread = new System.Threading.Thread(this.Execute);
......@@ -93,7 +102,7 @@ namespace VIZ.GimbalAI.Controller.Module
{
while (this.IsRunning)
{
System.Threading.Thread.Sleep(500);
System.Threading.Thread.Sleep(100);
bool isUpdateUI_down = false;
bool isUpdateUI_up = false;
......@@ -151,12 +160,16 @@ namespace VIZ.GimbalAI.Controller.Module
// 下行数据
GimbalPackage_down data = new GimbalPackage_down();
data.FromBuffer(msg.Buffer);
data.DateTime = msg.DateTime.ToString("yyyy-MM-dd HH:mm:ss fff");
string json = JsonConvert.SerializeObject(data);
json += "\n";
byte[] buffer = Encoding.UTF8.GetBytes(json);
if (GIMBAL_IS_WRITE_DATA)
{
string json = JsonConvert.SerializeObject(data);
json += "\n";
byte[] buffer = Encoding.UTF8.GetBytes(json);
this.fileStream?.Write(buffer, 0, buffer.Length);
this.fileStream?.Write(buffer, 0, buffer.Length);
}
down = data;
}
......@@ -165,12 +178,16 @@ namespace VIZ.GimbalAI.Controller.Module
// 上行数据
GimbalPackage_up data = new GimbalPackage_up();
data.FromBuffer(msg.Buffer);
data.DateTime = msg.DateTime.ToString("yyyy-MM-dd HH:mm:ss fff");
string json = JsonConvert.SerializeObject(data);
json += "\n";
byte[] buffer = Encoding.UTF8.GetBytes(json);
if (GIMBAL_IS_WRITE_DATA)
{
string json = JsonConvert.SerializeObject(data);
json += "\n";
byte[] buffer = Encoding.UTF8.GetBytes(json);
this.fileStream?.Write(buffer, 0, buffer.Length);
this.fileStream?.Write(buffer, 0, buffer.Length);
}
up = data;
}
......
......@@ -5,9 +5,14 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.GimbalAI.Controller.Module"
xmlns:common="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:resource="clr-namespace:Viz.GimbalAI.Controller.Module.Resource;assembly=Viz.GimbalAI.Controller.Module.Resource"
mc:Ignorable="d" Background="White"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
d:DesignHeight="850" d:DesignWidth="1200">
<UserControl.Resources>
<resource:GimbalPackage_down_CheckValueConverter x:Key="GimbalPackage_down_CheckValueConverter"></resource:GimbalPackage_down_CheckValueConverter>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="120"></RowDefinition>
......@@ -66,8 +71,8 @@
<common:LabelValue Grid.Row="2" Grid.Column="1" Label="俯仰控制指令值:" Text="{Binding Path=DownData.Vertical}" Margin="5,0,5,0"></common:LabelValue>
<!-- 方位控制指令 -->
<common:LabelValue Grid.Row="3" Grid.Column="0" Label="俯仰控制指令标记:" Text="{Binding Path=DownData.Horizontal_PN}" Margin="5,0,5,0"></common:LabelValue>
<common:LabelValue Grid.Row="3" Grid.Column="1" Label="俯仰控制指令值:" Text="{Binding Path=DownData.Horizontal}" Margin="5,0,5,0"></common:LabelValue>
<common:LabelValue Grid.Row="3" Grid.Column="0" Label="方位控制指令标记:" Text="{Binding Path=DownData.Horizontal_PN}" Margin="5,0,5,0"></common:LabelValue>
<common:LabelValue Grid.Row="3" Grid.Column="1" Label="方位控制指令值:" Text="{Binding Path=DownData.Horizontal}" Margin="5,0,5,0"></common:LabelValue>
<!-- 横滚控制指令 -->
<common:LabelValue Grid.Row="4" Grid.Column="0" Label="横滚控制指令:" Text="{Binding Path=DownData.Roll}" Margin="5,0,5,0"></common:LabelValue>
......@@ -97,6 +102,7 @@
<!-- 校验和 -->
<common:LabelValue Grid.Row="12" Grid.Column="0" Label="校验和:" Text="{Binding Path=DownData.Check}" Margin="5,0,5,0"></common:LabelValue>
<common:LabelValue Grid.Row="12" Grid.Column="1" Label="计算校验和:" Text="{Binding Path=DownData,Converter={StaticResource GimbalPackage_down_CheckValueConverter}}" Margin="5,0,5,0"></common:LabelValue>
</Grid>
</GroupBox>
......
......@@ -22,11 +22,11 @@ namespace VIZ.GimbalAI.Controller.Module
// 初始化命令
this.InitCommand();
// 初始化消息
this.InitMessage();
// 初始化控制器
this.InitController();
// 初始化消息
this.InitMessage();
}
/// <summary>
......
using log4net;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Connection;
using VIZ.Framework.Module;
using VIZ.GimbalAI.Controller.Connection;
using VIZ.GimbalAI.Controller.Domain;
namespace VIZ.GimbalAI.Controller.Module
{
/// <summary>
/// 应用程序启动 -- 串口
/// </summary>
public class AppSetup_SerialPort : AppSetupBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_SerialPort));
/// <summary>
/// 描述
/// </summary>
public override string Detail { get; } = "应用程序启动 -- 串口";
/// <summary>
/// 执行启动
/// </summary>
/// <param name="context">应用程序启动上下文</param>
/// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context)
{
ConnectionManager.SerialPortConnection = new SerialPortConnection();
// 下行
SerialPortEndpointManager down_endpoint_manager = new SerialPortEndpointManager(SerialPortKeys.DOWN, "COM4", 115200, Parity.None, 8, StopBits.One);
down_endpoint_manager.PackageProvider = new GimbalPackageDownProvider(53, new byte[] { 0xA5, 0xE7 }, SerialPortKeys.DOWN);
ConnectionManager.SerialPortConnection.AddEndpointManager(down_endpoint_manager);
down_endpoint_manager.Open();
return true;
}
/// <summary>
/// 执行关闭
/// </summary>
/// <param name="context">应用程序启动上下文</param>
public override void Shutdown(AppSetupContext context)
{
}
}
}
......@@ -103,6 +103,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Setup\Provider\AppSetup_SerialPort.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
......@@ -155,13 +156,15 @@
<Project>{b41abf07-77ab-4373-b43e-df82fbfda3cd}</Project>
<Name>VIZ.GimbalAI.Controller.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\Viz.GimbalAI.Controller.Module.Resource\Viz.GimbalAI.Controller.Module.Resource.csproj">
<Project>{0a9657ed-fdf9-48b7-8b78-a94814ec211f}</Project>
<Name>Viz.GimbalAI.Controller.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.GimbalAI.Controller.Storage\VIZ.GimbalAI.Controller.Storage.csproj">
<Project>{aeb04581-0586-4388-b53f-95b6482c807e}</Project>
<Name>VIZ.GimbalAI.Controller.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Setup\Provider\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Framework.Storage;
namespace VIZ.GimbalAI.Controller.Storage
{
/// <summary>
/// 云台配置
/// </summary>
public class GimbalConfig : IniConfigBase
{
/// <summary>
/// 是否输出数据
/// </summary>
[Ini(Section = "Gimbal", DefaultValue = "True", Type = typeof(bool))]
public string GIMBAL_IS_WRITE_DATA { get; set; }
}
}
......@@ -64,10 +64,21 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Ini\Config\GimbalConfig.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -9,12 +9,14 @@ namespace VIZ.GimbalAI.Controller.UnitTest
[TestMethod]
public void TestMethod1()
{
byte[] buffer = BitConverter.GetBytes(1);
//byte[] buffer = BitConverter.GetBytes(1);
using (System.IO.FileStream fs = new System.IO.FileStream(@"e:\test.data", System.IO.FileMode.Create, System.IO.FileAccess.Write))
{
fs.Write(buffer, 0, buffer.Length);
}
//using (System.IO.FileStream fs = new System.IO.FileStream(@"e:\test.data", System.IO.FileMode.Create, System.IO.FileAccess.Write))
//{
// fs.Write(buffer, 0, buffer.Length);
//}
string str = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff");
}
}
}
......@@ -55,6 +55,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.GimbalAI.Controller.Dom
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.GimbalAI.Controller.Connection", "VIZ.GimbalAI.Controller.Connection\VIZ.GimbalAI.Controller.Connection.csproj", "{4DA87EC9-2BB4-4233-9E1B-495D9B6290C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Viz.GimbalAI.Controller.Module.Resource", "Viz.GimbalAI.Controller.Module.Resource\Viz.GimbalAI.Controller.Module.Resource.csproj", "{0A9657ED-FDF9-48B7-8B78-A94814EC211F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -183,6 +185,14 @@ Global
{4DA87EC9-2BB4-4233-9E1B-495D9B6290C6}.Release|Any CPU.Build.0 = Release|Any CPU
{4DA87EC9-2BB4-4233-9E1B-495D9B6290C6}.Release|x64.ActiveCfg = Release|Any CPU
{4DA87EC9-2BB4-4233-9E1B-495D9B6290C6}.Release|x64.Build.0 = Release|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Debug|x64.ActiveCfg = Debug|x64
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Debug|x64.Build.0 = Debug|x64
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Release|Any CPU.Build.0 = Release|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Release|x64.ActiveCfg = Release|Any CPU
{0A9657ED-FDF9-48B7-8B78-A94814EC211F}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -203,6 +213,7 @@ Global
{AEB04581-0586-4388-B53F-95B6482C807E} = {0B2CCF9C-9255-49F2-8A5A-F1B76EEA8A32}
{B41ABF07-77AB-4373-B43E-DF82FBFDA3CD} = {C1FAA923-9112-476C-8D40-D876F5FF85B5}
{4DA87EC9-2BB4-4233-9E1B-495D9B6290C6} = {2AC01299-645D-4832-A690-FE7796EDEA80}
{0A9657ED-FDF9-48B7-8B78-A94814EC211F} = {3C621BD4-260F-460D-BFA4-1178F742608A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {50328564-73F6-4EFA-B07F-15C668BA8327}
......
......@@ -6,6 +6,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Module;
using VIZ.GimbalAI.Controller.Module;
namespace VIZ.GimbalAI.Controller
{
......@@ -16,6 +17,9 @@ namespace VIZ.GimbalAI.Controller
{
public App()
{
// 串口
AppSetup.AppendSetup(new AppSetup_SerialPort());
// 执行启动流程
AppSetupContext context = AppSetup.Setup();
......
......@@ -167,6 +167,10 @@
<Project>{b41abf07-77ab-4373-b43e-df82fbfda3cd}</Project>
<Name>VIZ.GimbalAI.Controller.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\Viz.GimbalAI.Controller.Module.Resource\Viz.GimbalAI.Controller.Module.Resource.csproj">
<Project>{0a9657ed-fdf9-48b7-8b78-a94814ec211f}</Project>
<Name>Viz.GimbalAI.Controller.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.GimbalAI.Controller.Module\VIZ.GimbalAI.Controller.Module.csproj">
<Project>{9037e23d-4e0b-4083-aab8-65fbaae997a8}</Project>
<Name>VIZ.GimbalAI.Controller.Module</Name>
......
......@@ -2,35 +2,12 @@
; === Application ===
; ============================================================
[Application]
;是否是调试模式
; 是否是调试模式
APPLICATION_IS_DEBUG=true
; ============================================================
; === Video ===
; === Gimbal ===
; ============================================================
[Video]
;视频是否显示FPS
VIDEO_IS_SHOW_FPS=false
;视频渲染等待(单位:毫秒)
VIDEO_RENDER_WAIT=10
;视频背景颜色
VIDEO_BACKGROUND_COLOR=#FF172532
;视频框边框宽度(单位:像素)
VIDEO_RECTANGLE_BORDER_WIDTH=4
;视频框边框颜色(格式:#AARRGGBB)
VIDEO_RECTANGLE_BORDER_COLOR=#FFFF0000
;视频跟踪框边框宽度(单位:像素)
VIDEO_TRACKING_BOX_BORDER_WIDTH=2
;视频跟踪框边框颜色
VIDEO_TRACKING_BOX_BORDER_COLOR=#FFFF0000
;视频框选边框宽度(单位:像素)
VIDEO_FRAME_SELECTION_BORDER_WIDTH=4
;视频框选边框颜色(格式:#AARRGGBB)
VIDEO_FRAME_SELECTION_BORDER_COLOR=#FFFF6D87
;视频剪切宽度(单位:像素)
VIDEO_CLIP_BOX_WIDTH=810
;视频剪切边框宽度(单位:像素)
VIDEO_CLIP_BOX_BORDER_WIDTH=4
;视频剪切边框颜色
VIDEO_CLIP_BOX_BORDER_COLOR=#FFFF0000
;视频剪切掩码颜色
VIDEO_CLIP_BOX_MASK_COLOR=#88000000
[Gimbal]
; 是否输出数据
GIMBAL_IS_WRITE_DATA=true
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIZ.Framework.Core;
using VIZ.GimbalAI.Controller.Connection;
namespace Viz.GimbalAI.Controller.Module.Resource
{
/// <summary>
/// 下行数据计算校验和转化器
/// </summary>
public class GimbalPackage_down_CheckValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
GimbalPackage_down down = value as GimbalPackage_down;
if (down == null)
return string.Empty;
return down.GetCheckValue().ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Viz.GimbalAI.Controller.Module.Resource")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Viz.GimbalAI.Controller.Module.Resource")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Viz.GimbalAI.Controller.Module.Resource.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Viz.GimbalAI.Controller.Module.Resource.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Viz.GimbalAI.Controller.Module.Resource.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Viz.GimbalAI.Controller.Module.Resource">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0A9657ED-FDF9-48B7-8B78-A94814EC211F}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>Viz.GimbalAI.Controller.Module.Resource</RootNamespace>
<AssemblyName>Viz.GimbalAI.Controller.Module.Resource</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\GimbalPackage_down_CheckValueConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.GimbalAI.Controller.Connection\VIZ.GimbalAI.Controller.Connection.csproj">
<Project>{4da87ec9-2bb4-4233-9e1b-495d9b6290c6}</Project>
<Name>VIZ.GimbalAI.Controller.Connection</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.GimbalAI.Controller.Core\VIZ.GimbalAI.Controller.Core.csproj">
<Project>{51de8c1e-e026-4e0b-b6b2-4922736866a6}</Project>
<Name>VIZ.GimbalAI.Controller.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ 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