Commit 8d20a4c2 by 王永辉

标记由单个矩形改为可画多个的多边形,保存和发送功能

parent 9fcdb9e5
using System.Collections.Generic;
using System.Windows.Media;
namespace VIZ.FGOUT.Connection
{
/// <summary>
/// 时间切片工具包
/// </summary>
public class AlgorithmPackage_Figout_new_model : AlgorithmPackageBase
{
/// <summary>
/// 是自动还是手动
/// </summary>
public string mode { get; set; }
/// <summary>
/// signal 信号
/// </summary>
public override string signal { get; set; } = "auto_Place";
/// <summary>
/// startPlace
/// </summary>
public List<PointCollection> start { get; set; }
/// <summary>
/// endPalce
/// </summary>
public List<PointCollection> end { get; set; }
/// <summary>
/// InValidPalce
/// </summary>
public List<PointCollection> ignore { get; set; }
/// <summary>
/// 跟踪框的坐标
/// </summary>
public List<int> track_xy { get; set; }
/// <summary>
/// 暂时留的跟踪框
/// </summary>
public List<List<int>> bbox { get; set; }
/// <summary>
/// 跟踪框进行赋值
/// </summary>
public List<int> box { get; set; }
/// <summary>
/// 时间码
/// </summary>
public long timecode { get; set; }
}
}
......@@ -55,6 +55,7 @@
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
</Reference>
......@@ -85,6 +86,7 @@
<Compile Include="UDP\Algorithm\Signal\Recv\AlgorithmRecvPackage__checked_ok.cs" />
<Compile Include="UDP\Algorithm\Signal\Recv\AlgorithmRecvPackage__crop_roi.cs" />
<Compile Include="UDP\Algorithm\Signal\Recv\AlgorithmRecvPackage__detect.cs" />
<Compile Include="UDP\Algorithm\Signal\Send\AlgorithmPackage_Figout_new_model.cs" />
<Compile Include="UDP\Algorithm\Signal\Send\AlgorithmPackage_Figout_model.cs" />
<Compile Include="UDP\Algorithm\Signal\Send\AlgorithmPackage__auto_mode.cs" />
<Compile Include="UDP\Algorithm\Signal\Send\AlgorithmPackage__auto_mode_Cableway.cs" />
......
954a8f953ea0c9e58cbd7a4e88ffc6456f42311e
fdabdd16b89e6e5e7c9f808ae8e6503a5aab99e9
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
181380438361
1-1441241311
11-1602666439
23304678694
18560433975
1470602451
11-350624472
241319896476
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
......@@ -307,17 +307,25 @@
Background="Transparent"
PreviewMouseLeftButtonDown="Border_MouseLeftButtonDown"
PreviewMouseLeftButtonUp="Border_MouseLeftButtonUp"
PreviewMouseMove="Border_MouseMove">
<Canvas x:Name="canvas1" Focusable="False">
PreviewMouseMove="Border_MouseMove"
PreviewMouseRightButtonDown="Border_OnPreviewMouseRightButtonDown">
<!--<Canvas x:Name="canvas1" Focusable="False">
<fcommon:VideoControl
x:Name="video"
Width="{Binding ElementName=canvas1, Path=ActualWidth}"
Height="{Binding ElementName=canvas1, Path=ActualHeight}"
BorderBrush="White"
BorderThickness="6" />
</Canvas>
</Canvas>-->
<Grid>
<fcommon:VideoControl
x:Name="video"
Width="{Binding ElementName=canvas1, Path=ActualWidth}"
Height="{Binding ElementName=canvas1, Path=ActualHeight}"
BorderBrush="White"
BorderThickness="6" />
<Canvas x:Name="canvas1" Focusable="False" />
</Grid>
</Border>
......
......@@ -26,7 +26,10 @@ namespace VIZ.FGOUT.Module
//PathGeometry bb = new PathGeometry();
public Rect rectStart;
//public Rect rectStart;
public List<PointCollection> polygonsStart = new List<PointCollection>();
public List<PointCollection> polygonsEnd = new List<PointCollection>();
public List<PointCollection> polygonsInvalid= new List<PointCollection>();
public Rect rectEnd;
public Rect rectInvalid;
......@@ -149,7 +152,7 @@ namespace VIZ.FGOUT.Module
//{
// aa.AddGeometry(new RectangleGeometry(rectStart));
//}
aa.AddGeometry(new RectangleGeometry(rectStart));
//aa.AddGeometry(new RectangleGeometry(rectStart));
aa.AddGeometry(new RectangleGeometry(rectEnd));
aa.AddGeometry(new RectangleGeometry(rectInvalid));
// }
......@@ -168,7 +171,7 @@ namespace VIZ.FGOUT.Module
//{
// aa.AddGeometry(new RectangleGeometry(rectStart));
//}
aa.AddGeometry(new RectangleGeometry(rectStart));
//aa.AddGeometry(new RectangleGeometry(rectStart));
aa.AddGeometry(new RectangleGeometry(rectEnd));
aa.AddGeometry(new RectangleGeometry(rectInvalid));
}
......@@ -179,7 +182,7 @@ namespace VIZ.FGOUT.Module
//{
// aa.AddGeometry(new RectangleGeometry(rectStart));
//}
aa.AddGeometry(new RectangleGeometry(rectStart));
//aa.AddGeometry(new RectangleGeometry(rectStart));
aa.AddGeometry(new RectangleGeometry(rectEnd));
aa.AddGeometry(new RectangleGeometry(rectInvalid));
}
......@@ -189,8 +192,9 @@ namespace VIZ.FGOUT.Module
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
startPoint = e.GetPosition(this.canvas1);
isMouseDown = true;
//startPoint = e.GetPosition(this.canvas1);
//isMouseDown = true;
//if (vm.IsDrawStartPlace)
//{
// myPath.Stroke = Brushes.Red;
......@@ -200,6 +204,12 @@ namespace VIZ.FGOUT.Module
//{
// myPath.Stroke = Brushes.Green;
//}
if (vm.IsDrawStartPlace || vm.IsDrawEndPlace || vm.IsDrawInvalidPlace)
DrawPolygon(e.GetPosition(this.canvas1));
//if(e.ClickCount == 2)
// polygon = null;
}
List<Rect> rectStarts = new List<Rect>();
......@@ -209,7 +219,9 @@ namespace VIZ.FGOUT.Module
{
if (vm.IsDrawStartPlace)
{
rectStart = new Rect(startPoint, e.GetPosition(this.canvas1));
//DrawPath(startPoint, e.GetPosition(this.canvas1));
DrawPolygon(e.GetPosition(this.canvas1));
//rectStart = new Rect(startPoint, e.GetPosition(this.canvas1));
//rectStarts.Add(new Rect(startPoint, e.GetPosition(this.canvas1)));
//rectStart.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
......@@ -229,5 +241,54 @@ namespace VIZ.FGOUT.Module
}
}
}
public Polygon polygon;
public PointCollection points;
private void DrawPolygon(Point point)
{
if (polygon == null)
{
polygon = new Polygon
{
Stroke = Brushes.Blue,
StrokeThickness = 1,
Fill = Brushes.Transparent
};
points = new PointCollection();
this.canvas1.Children.Add(polygon);
}
points.Add(point);
polygon.Points = points;
}
private void Border_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
if(points == null)
return;
if (vm.IsDrawStartPlace)
{
if (!polygonsStart.Contains(points))
polygonsStart.Add(points);
}
else if (vm.IsDrawEndPlace)
{
if (!polygonsEnd.Contains(points))
polygonsEnd.Add(points);
if (polygonsEnd.Count == 2)
{
polygonsEnd[0].Clear();
polygonsEnd.RemoveAt(0);
}
}
else if (vm.IsDrawInvalidPlace)
{
if(!polygonsInvalid.Contains(points))
polygonsInvalid.Add(points);
}
polygon = null;
}
}
}
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1B8D7DB41D18FB6AD221B9112F3D2D3E77F56EB7B3EA18B2A2F39D16FDE28C85"
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4C53870627456E69FD41DB4A8FBCB21CFC262A56D9C54343A3B4412BE754F5A5"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -68,17 +68,17 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 322 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas canvas1;
internal VIZ.Framework.Common.VideoControl video;
#line default
#line hidden
#line 314 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 327 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.Framework.Common.VideoControl video;
internal System.Windows.Controls.Canvas canvas1;
#line default
#line hidden
......@@ -136,12 +136,18 @@ namespace VIZ.FGOUT.Module {
#line default
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_OnPreviewMouseRightButtonDown);
#line default
#line hidden
return;
case 3:
this.canvas1 = ((System.Windows.Controls.Canvas)(target));
this.video = ((VIZ.Framework.Common.VideoControl)(target));
return;
case 4:
this.video = ((VIZ.Framework.Common.VideoControl)(target));
this.canvas1 = ((System.Windows.Controls.Canvas)(target));
return;
}
this._contentLoaded = true;
......
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1B8D7DB41D18FB6AD221B9112F3D2D3E77F56EB7B3EA18B2A2F39D16FDE28C85"
#pragma checksum "..\..\..\..\..\NDIView\View\NDIView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "4C53870627456E69FD41DB4A8FBCB21CFC262A56D9C54343A3B4412BE754F5A5"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -68,17 +68,17 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 322 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Canvas canvas1;
internal VIZ.Framework.Common.VideoControl video;
#line default
#line hidden
#line 314 "..\..\..\..\..\NDIView\View\NDIView.xaml"
#line 327 "..\..\..\..\..\NDIView\View\NDIView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.Framework.Common.VideoControl video;
internal System.Windows.Controls.Canvas canvas1;
#line default
#line hidden
......@@ -136,12 +136,18 @@ namespace VIZ.FGOUT.Module {
#line default
#line hidden
#line 311 "..\..\..\..\..\NDIView\View\NDIView.xaml"
this.Border.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Border_OnPreviewMouseRightButtonDown);
#line default
#line hidden
return;
case 3:
this.canvas1 = ((System.Windows.Controls.Canvas)(target));
this.video = ((VIZ.Framework.Common.VideoControl)(target));
return;
case 4:
this.video = ((VIZ.Framework.Common.VideoControl)(target));
this.canvas1 = ((System.Windows.Controls.Canvas)(target));
return;
}
this._contentLoaded = true;
......

D:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FD:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FD:\wyh\FGOUT\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiteDB;
using log4net;
using LiteDB;
using System;
namespace VIZ.FGOUT.Storage
{
......@@ -48,6 +44,8 @@ namespace VIZ.FGOUT.Storage
this.HotkeyConfig = this.Database.GetCollection<HotkeyConfig>();
// 开始位置进行设置
this.SetPlaceConfig = this.Database.GetCollection<SetPlaceConfig>();
// 新开始位置进行设置
this.SetPlaceNewConfig = this.Database.GetCollection<SetPlaceNewConfig>();
//手动模式设置
this.SetManualConfig = this.Database.GetCollection<SetManualConfig>();
......@@ -130,6 +128,11 @@ namespace VIZ.FGOUT.Storage
public ILiteCollection<SetPlaceConfig> SetPlaceConfig { get; private set; }
/// <summary>
/// 设置位置新配置文件
/// </summary>
public ILiteCollection<SetPlaceNewConfig> SetPlaceNewConfig { get; private set; }
/// <summary>
/// 保存配置文件
/// </summary>
public ILiteCollection<SetManualConfig> SetManualConfig { get; private set; }
......@@ -153,6 +156,7 @@ namespace VIZ.FGOUT.Storage
this.HotkeyConfig = null;
this.SetPlaceConfig = null;
this.SetPlaceNewConfig = null;
this.SetManualConfig = null;
......
using System.Collections.Generic;
using System.Windows.Media;
namespace VIZ.FGOUT.Storage
{
public class SetPlaceNewConfig
{
/// <summary>
/// 编号
/// </summary>
[LiteDB.BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 开始位置
/// </summary>
public List<PointCollection> StartPlace { get; set; } = new List<PointCollection>();
/// <summary>
/// 结束位置
/// </summary>
public List<PointCollection> EndPlace { get; set; } = new List<PointCollection>();
/// <summary>
/// 无效位置
/// </summary>
public List<PointCollection> InvlidPlace { get; set; } = new List<PointCollection>();
}
}
......@@ -82,6 +82,7 @@
<Reference Include="NPOI.OpenXmlFormats, Version=2.5.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
<HintPath>..\packages\NPOI.2.5.6\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
......@@ -135,6 +136,7 @@
<Compile Include="LiteDB\System\HotkeyConfig.cs" />
<Compile Include="LiteDB\System\Info\TallyInfo.cs" />
<Compile Include="LiteDB\System\SetManualConfig.cs" />
<Compile Include="LiteDB\System\SetPlaceNewConfig.cs" />
<Compile Include="LiteDB\System\SetPlaceConfig.cs" />
<Compile Include="LiteDB\System\SystemConfig.cs" />
<Compile Include="LiteDB\UEPresets\JavelinThrowConfig.cs" />
......
e7d8d81d288b78c61aadb659a9d0060dade18795
f7deecda7a4cb8b6b9c8cc9da3e1feb09ae5bb50
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,10 +10,10 @@ none
false
DEBUG;TRACE
9-721875057
91711917753
3-630027162
192063791830
3-1719726047
19-915820474
Path\ArrowPathResource.xaml;Style\Button\Button_MessageBox.xaml;Style\Button\Button_Normal.xaml;Style\Button\Button_WindowTop.xaml;Style\GridSplitter\GridSplitter_None.xaml;Style\ListBox\ListBox_None.xaml;Style\ScrollView\ScrollView_Default.xaml;Style\TextBox\TextBox_None.xaml;Themes\Generic.xaml;
False
......

D:\wyh\FGOUT\FGOUT\VIZ.Framework\VIZ.Framework.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FD:\wyh\FGOUT\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxEx.xaml;;
FD:\wyh\FGOUT\FGOUT\VIZ.Framework\VIZ.Framework.Common\MessageBox\MessageBoxExWindow.xaml;;
......
......@@ -10,11 +10,11 @@ none
false
DEBUG;TRACE
1-731644535
11882902973
212002329545
25-1459698188
212023628146
25-2140555781
Themes\Generic.xaml;
True
False
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