Commit a1842509 by 鲁志-悦动

算法标记写到画点方法

parent 71f0467c
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}

......@@ -10,11 +10,11 @@ none
false
2-725104376
21870986562
3947974750
17-1462717611
31364711570
17-1683084370
Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml;
True
False

C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.FGOUT.Storage;
using VIZ.FGOUT.Storage;
using VIZ.Framework.Core;
using VIZ.Framework.Domain;
using VIZ.Framework.Storage;
......@@ -41,7 +36,7 @@ namespace VIZ.FGOUT.Domain
/// <summary>
/// 视频裁切框宽度
/// </summary>
public static int VIDEO_CLIP_BOX_WIDTH { get; set; } = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_WIDTH);
public static int VIDEO_CLIP_BOX_WIDTH { get; set; } = IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_CLIP_BOX_WIDTH);
/// <summary>
/// 视频宽度
......
namespace VIZ.FGOUT.Domain
{
public class MarkModel
{
public bool IsMark { get; set; }
}
}
namespace VIZ.FGOUT.Domain.Message.Setting
namespace VIZ.FGOUT.Domain
{
public class UEControlModel
{
......
namespace VIZ.FGOUT.Domain.Message.Setting
namespace VIZ.FGOUT.Domain
{
public class UESettingModel
{
......
......@@ -79,6 +79,7 @@
<Compile Include="Message\Setting\DisplayPlaceModel.cs" />
<Compile Include="Message\Setting\EndPlaceModel.cs" />
<Compile Include="Message\Setting\InvalidPlaceModel.cs" />
<Compile Include="Message\Setting\MarkModel.cs" />
<Compile Include="Message\Setting\ReplayModel.cs" />
<Compile Include="Message\Setting\RestartAlgorithmModel.cs" />
<Compile Include="Message\Setting\SavePlaceModel.cs" />
......
35ff8143cc4c1f911f49bb7be9e50906549de29c
9b0900368707f846fdfe912e9d9b99792804e3ab
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
181380438361
1-1441241311
11-1602666439
23-2035776870
18560433975
1470602451
11-350624472
24-1321085892
Style\Button\Button_NdiView.xaml;Style\Button\Button_Setting.xaml;Style\Button\Button_WindowTop.xaml;Style\CheckBox\CheckBox_NdiView.xaml;Style\CheckBox\CheckBox_Setting.xaml;Style\CheckBox\CheckBox_WindowTop.xaml;Style\ComboBox\ComboBox_Setting.xaml;Style\HotkeyBox\HotkeyBox_Setting.xaml;Style\MessageBox\MessageBoxEx.xaml;Style\RadioButton\RadioButton_FootballSide.xaml;Style\RadioButton\RadioButton_NdiView.xaml;Style\RadioButton\RadioButton_Setting.xaml;Style\Slider\Slider_Setting.xaml;Style\TextBlock\TextBlock_Setting.xaml;Style\TextBox\TextBox_Setting.xaml;Style\ToogleButton\ToogleButton_Setting.xaml;Themes\Generic.xaml;Toolkit\NumericUpDown\NumericUpDown.xaml;
True
False
......@@ -375,6 +375,9 @@
<b:EventTrigger EventName="Checked">
<b:InvokeCommandAction Command="{Binding MarkCommand}" />
</b:EventTrigger>
<b:EventTrigger EventName="Unchecked">
<b:InvokeCommandAction Command="{Binding UnMarkCommand}" />
</b:EventTrigger>
</b:Interaction.Triggers>
</ToggleButton>
......
......@@ -59,6 +59,8 @@ namespace VIZ.FGOUT.Module
this.MinCommand = new VCommand(this.Min);
this.CloseCommand = new VCommand(this.Close);
this.SettingCommand = new VCommand(this.Setting);
this.MarkCommand = new VCommand(this.Mark);
this.UnMarkCommand = new VCommand(this.UnMark);
this.InvalidRegionCommand = new VCommand(this.Invalid);
this.StartRegionCommand = new VCommand(this.StartRegion);
this.EndRegionCommand = new VCommand(this.EndRegion);
......@@ -927,19 +929,43 @@ namespace VIZ.FGOUT.Module
#region Command开始画区域框命令
/// <summary>
/// 算法标定取消命令
/// </summary>
public VCommand UnMarkCommand { get; set; }
private void UnMark()
{
_markModel.IsMark = false;
ApplicationDomain.MessageManager.Send(_markModel);
}
/// <summary>
/// 算法标定Command命令
/// </summary>
public VCommand MarkCommand { get; set; }
public MarkModel _markModel = new MarkModel();
private void Mark()
{
_markModel.IsMark = true;
ApplicationDomain.MessageManager.Send(_markModel);
}
/// <summary>
/// 无效区域Command命令
/// </summary>
public VCommand InvalidRegionCommand { get; set; }
public InvalidPlaceModel invalidPlaceModel = new InvalidPlaceModel();
private void Invalid()
{
endPlaceModel.EndPlace = startPlaceModel.StartPlace =false;
startPlaceModel.StartPlace = false;
endPlaceModel.EndPlace = false;
invalidPlaceModel.IsInvalid = true;
ApplicationDomain.MessageManager.Send(invalidPlaceModel);
//EndEnable = true;
//InvalidEnable = false;
//StartEnable = true;
EndIsChecked = StartIsChecked = false;
StartIsChecked = false;
EndIsChecked = false;
}
/// <summary>
......
......@@ -45,6 +45,8 @@ namespace VIZ.FGOUT.Module
WPFHelper.BindingViewModel(this, vm);
#region 注释部分
// this.video.IsShowFPS = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, bool>(p => p.VIDEO_IS_SHOW_FPS);
//rectStart.Stroke = Brushes.Red;
......@@ -75,6 +77,9 @@ namespace VIZ.FGOUT.Module
//myPath1.StrokeThickness = 1;
//this.canvas1.Children.Add(myPath1);
#endregion
}
bool isMouseDown = false;
......@@ -269,6 +274,8 @@ namespace VIZ.FGOUT.Module
{
startPoint = e.GetPosition(this.canvas1);
#region 注释部分
//if (vm.IsDrawStartPlace)
//{
// myPath.Stroke = Brushes.Red;
......@@ -319,6 +326,8 @@ namespace VIZ.FGOUT.Module
//}
//else
#endregion
//鼠标左键单击画点
if (e.ClickCount == 1)
{
......@@ -327,6 +336,8 @@ namespace VIZ.FGOUT.Module
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Blue);
else if (vm.IsDrawEndPlace)
DrawPolygon(e.GetPosition(this.canvas1), Brushes.Green);
else if(vm.IsMark)
DrawDot(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsDrawInvalidPlace)
// DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
......@@ -374,9 +385,10 @@ namespace VIZ.FGOUT.Module
}
}
}
public Polygon polygon;
public PointCollection points;
public PointCollection dotPoints;
/// <summary>
/// 画多边形
/// </summary>
......@@ -399,6 +411,25 @@ namespace VIZ.FGOUT.Module
polygon.Points = points;
}
/// <summary>
/// 画点
/// </summary>
/// <param name="point"></param>
/// <param name="brush"></param>
private void DrawDot(Point point, Brush brush)
{
//var myPoint = new EllipseGeometry();
//myPoint.
//myPoint.Height = 1;
//myPoint.Width = 1;
//myPoint.Margin = new Thickness(5, 5, 0, 0);
//myPoint.Stroke = new SolidColorBrush(Colors.Red);
//PaintCanvas.Children.Add(myPoint);
//canvas1.Children.Add(myPoint);
}
//public Rectangle _rectangle;
//private void DrawRenctangle(Point point, Brush brush)
//{
......
......@@ -13,6 +13,7 @@ using VIZ.FGOUT.Storage;
using VIZ.Framework.Common;
using VIZ.Framework.Connection;
using VIZ.Framework.Core;
using VIZ.Framework.Domain;
using VIZ.Framework.Storage;
namespace VIZ.FGOUT.Module
......@@ -118,53 +119,56 @@ namespace VIZ.FGOUT.Module
private void InitMessage()
{
// 算法初始化完成消息
ApplicationDomainEx.MessageManager.Register<AlgorithmMessage__checked_ok>(this, this.OnAlgorithmMessage__checked_ok);
ApplicationDomain.MessageManager.Register<AlgorithmMessage__checked_ok>(this, this.OnAlgorithmMessage__checked_ok);
// 算法跟踪消息--检测
ApplicationDomainEx.MessageManager.Register<AlgorithmMessage__detect>(this, this.OnAlgorithmMessage__detect);
ApplicationDomain.MessageManager.Register<AlgorithmMessage__detect>(this, this.OnAlgorithmMessage__detect);
// 算法跟踪消息--裁切
ApplicationDomainEx.MessageManager.Register<AlgorithmMessage__crop_roi>(this, this.OnAlgorithmMessage__crop_roi);
ApplicationDomain.MessageManager.Register<AlgorithmMessage__crop_roi>(this, this.OnAlgorithmMessage__crop_roi);
// 算法落盘开始、结束时间戳消息
ApplicationDomainEx.MessageManager.Register<AlgorithmMessage__start_end>(this, this.OnAlgorithmMessage__start_end);
ApplicationDomain.MessageManager.Register<AlgorithmMessage__start_end>(this, this.OnAlgorithmMessage__start_end);
NDIView nDIView = this.GetView<NDIView>();
// 算法标记
ApplicationDomain.MessageManager.Register<MarkModel>(this, this.Mark);
// 开始的位置
ApplicationDomainEx.MessageManager.Register<StartPlaceModel>(this, this.StartPlace);
ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace);
// 结束位置的
ApplicationDomainEx.MessageManager.Register<EndPlaceModel>(this, this.EndPlace);
ApplicationDomain.MessageManager.Register<EndPlaceModel>(this, this.EndPlace);
// 无效区域的注册
ApplicationDomainEx.MessageManager.Register<InvalidPlaceModel>(this, this.InvalidPlaceModel);
ApplicationDomain.MessageManager.Register<InvalidPlaceModel>(this, this.InvalidPlaceModel);
// 清除开始、结束、无效位置
ApplicationDomainEx.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace);
ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace);
//显示开始、结束、无效位置
ApplicationDomainEx.MessageManager.Register<DisplayPlaceModel>(this, this.DisplayPlace);
ApplicationDomain.MessageManager.Register<DisplayPlaceModel>(this, this.DisplayPlace);
// 算法发送命令
ApplicationDomainEx.MessageManager.Register<SendPlaceModel>(this, this.SendPlace);
ApplicationDomain.MessageManager.Register<SendPlaceModel>(this, this.SendPlace);
// 保存按钮发送命令
ApplicationDomainEx.MessageManager.Register<SavePlaceModel>(this, this.SavePlace);
ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace);
// 调用Replay发送命令
ApplicationDomainEx.MessageManager.Register<ReplayModel>(this,this.Replay);
ApplicationDomain.MessageManager.Register<ReplayModel>(this,this.Replay);
//调用UESetting发送命令
ApplicationDomainEx.MessageManager.Register<UESettingModel>(this,this.UESetting);
ApplicationDomain.MessageManager.Register<UESettingModel>(this,this.UESetting);
//调用UEControl发送命令
ApplicationDomainEx.MessageManager.Register<UEControlModel>(this, this.UEControl);
ApplicationDomain.MessageManager.Register<UEControlModel>(this, this.UEControl);
//重启算法发送命令
ApplicationDomainEx.MessageManager.Register<RestartAlgorithmModel>(this, this.RestartAlgorithm);
ApplicationDomain.MessageManager.Register<RestartAlgorithmModel>(this, this.RestartAlgorithm);
//关闭算法发送命令
ApplicationDomainEx.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm);
ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm);
}
//CleanPlaceModel cpModel = new CleanPlaceModel { CleanPlace = true };
......@@ -298,6 +302,22 @@ namespace VIZ.FGOUT.Module
//replayPanelView.Show();
}
public bool IsMark;
/// <summary>
/// 算法标记命令
/// </summary>
/// <param name="markModel"></param>
private void Mark(MarkModel markModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
{
IsMark = false;
return;
}
IsMark = markModel.IsMark;
}
public bool IsDrawStartPlace;
/// <summary>
/// 开始位置命令
......@@ -309,6 +329,7 @@ namespace VIZ.FGOUT.Module
IsDrawStartPlace = false;
return;
}
IsDrawStartPlace = startPlaceModel.StartPlace;
IsDrawEndPlace = false;
IsDrawInvalidPlace = false;
......@@ -481,9 +502,9 @@ namespace VIZ.FGOUT.Module
private List<List<List<int>>> Coordinate(List<PointCollection> points, double srcWidth, double srcHeight)
{
// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
int resWith = ApplicationDomain.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
int resHeight = ApplicationDomain.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
double xp = srcWidth / resWith;
double xy = srcHeight / resHeight;
......@@ -502,9 +523,9 @@ namespace VIZ.FGOUT.Module
private List<List<List<int>>> Coordinate(List<System.Windows.Rect> rects, double srcWidth, double srcHeight)
{
// 视频的宽度
int resWith = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
int resWith = ApplicationDomain.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_WIDTH);
// 视频的高度
int resHeight = ApplicationDomainEx.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
int resHeight = ApplicationDomain.IniStorage.GetValue<VideoConfig, int>(p => p.VIDEO_HEIGHT);
double xp = srcWidth / resWith;
double xy = srcHeight / resHeight;
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "99C718A73FE0FDAF671A9ADBBF4CECA1D310CCD61900B18B64B7832E219F42CC"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -74,7 +74,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 673 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 676 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -82,7 +82,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 720 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 723 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "99C718A73FE0FDAF671A9ADBBF4CECA1D310CCD61900B18B64B7832E219F42CC"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -74,7 +74,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 673 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 676 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam1;
......@@ -82,7 +82,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 720 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 723 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Storage
namespace VIZ.Framework.Storage
{
/// <summary>
/// 应用程序配置
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Storage
namespace VIZ.Framework.Storage
{
/// <summary>
/// INI配置基类
......
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