Commit ce1a176d by 鲁志-悦动

算法标定流程走通,后续工作交互实现

parent 188f7d54
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;;
......
......@@ -8,7 +8,6 @@ namespace VIZ.FGOUT.Connection
/// </summary>
public class AlgorithmPackage_Figout_new_model : AlgorithmPackageBase
{
/// <summary>
/// 是自动还是手动
/// </summary>
......@@ -25,13 +24,11 @@ namespace VIZ.FGOUT.Connection
/// </summary>
public List<List<List<int>>> start { get; set; }
/// <summary>
/// endPalce
/// </summary>
public List<List<List<int>>> end { get; set; }
/// <summary>
/// InValidPalce
/// </summary>
......@@ -58,6 +55,9 @@ namespace VIZ.FGOUT.Connection
/// </summary>
public long timecode { get; set; }
/// <summary>
/// 算法标记
/// </summary>
public List<List<List<int>>> mark { get; set; }
}
}
namespace VIZ.FGOUT.Domain
{
public class SaveMarkModel
{
}
}
......@@ -82,6 +82,7 @@
<Compile Include="Message\Setting\MarkModel.cs" />
<Compile Include="Message\Setting\ReplayModel.cs" />
<Compile Include="Message\Setting\RestartAlgorithmModel.cs" />
<Compile Include="Message\Setting\SaveMarkModel.cs" />
<Compile Include="Message\Setting\SavePlaceModel.cs" />
<Compile Include="Message\Setting\SendPlaceModel.cs" />
<Compile Include="Message\Setting\StartPlaceModel.cs" />
......
9b0900368707f846fdfe912e9d9b99792804e3ab
abce2ed6bd8860697bdf35cc469c93114b39453a
......@@ -387,7 +387,7 @@
Width="100"
Height="40"
HorizontalAlignment="Left"
Command="{Binding}"
Command="{Binding SaveMarkCommand}"
Content="保存"
Style="{StaticResource ButtonStyle}" />
</Grid>
......
......@@ -60,6 +60,7 @@ namespace VIZ.FGOUT.Module
this.CloseCommand = new VCommand(this.Close);
this.SettingCommand = new VCommand(this.Setting);
this.MarkCommand = new VCommand(this.Mark);
this.SaveMarkCommand = new VCommand(this.SaveMark);
this.UnMarkCommand = new VCommand(this.UnMark);
this.InvalidRegionCommand = new VCommand(this.Invalid);
this.StartRegionCommand = new VCommand(this.StartRegion);
......@@ -940,7 +941,7 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 算法标定Command命令
/// 算法标定命令
/// </summary>
public VCommand MarkCommand { get; set; }
public MarkModel _markModel = new MarkModel();
......@@ -949,9 +950,19 @@ namespace VIZ.FGOUT.Module
_markModel.IsMark = true;
ApplicationDomain.MessageManager.Send(_markModel);
}
/// <summary>
/// 保存标定命定
/// </summary>
public VCommand SaveMarkCommand { get; set; }
public SaveMarkModel _saveMarkModel = new SaveMarkModel();
private void SaveMark()
{
ApplicationDomain.MessageManager.Send(_saveMarkModel);
}
/// <summary>
/// 无效区域Command命令
/// 无效区域命令
/// </summary>
public VCommand InvalidRegionCommand { get; set; }
public InvalidPlaceModel invalidPlaceModel = new InvalidPlaceModel();
......@@ -969,14 +980,14 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 开始位置Command命令
/// 开始位置命令
/// </summary>
public VCommand StartRegionCommand { get; set; }
public StartPlaceModel startPlaceModel = new StartPlaceModel();
public EndPlaceModel endPlaceModel = new EndPlaceModel();
/// <summary>
/// 开始位置设置命令
/// 开始位置命令
/// </summary>
private void StartRegion()
{
......@@ -993,7 +1004,7 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 结束位置Command命令
/// 结束位置命令
/// </summary>
public VCommand EndRegionCommand { get; set; }
......@@ -1011,7 +1022,7 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 设置位置的Command命令
/// 设置位置命令
/// </summary>
public VCommand PlaceSettingCommand { get; set; }
......@@ -1052,13 +1063,15 @@ namespace VIZ.FGOUT.Module
/// </summary>
public VCommand SendPlaceCommand { get; set; }
public SendPlaceModel sendPlaceModel = new SendPlaceModel();
private void SendPlace()
private void SendPlace()
{
ApplicationDomain.MessageManager.Send(sendPlaceModel);
}
/// <summary>
/// 保存位置命令
/// </summary>
public VCommand SavePalceCommand { get; set; }
public SavePlaceModel savePlaceModel = new SavePlaceModel();
private void SavePlace()
{
......
......@@ -15,7 +15,7 @@ namespace VIZ.FGOUT.Module
{
public NDIViewModel vm = new NDIViewModel();
Rectangle rectStart = new Rectangle();
// Rectangle rectStart = new Rectangle();
// Rectangle rectEnd = new Rectangle();
......@@ -26,15 +26,16 @@ namespace VIZ.FGOUT.Module
//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 List<PointCollection> polygonsInvalid= new List<PointCollection>();
public List<PointCollection> _polygonsMark;
// public Rect rectEnd;
public Rect rectInvalid;
//public Rectangle rectInvalid;
// public Rectangle rectInvalid;
public List<Rect> rectsInvalid = new List<Rect>();
//public Path myPath = new Path();
// public Path myPath = new Path();
//public Path myPath1 = new Path();
// public Path myPath1 = new Path();
public NDIView()
{
......@@ -167,6 +168,8 @@ namespace VIZ.FGOUT.Module
isMouseDown = false;
#region 注释部分
// //if (vm.IsDrawStartPlace)
// //{
// // rectStart.Stroke = Brushes.Red;
......@@ -247,6 +250,7 @@ namespace VIZ.FGOUT.Module
// aa.AddGeometry(new RectangleGeometry(rectInvalid));
// }
#endregion
if (vm.IsDrawInvalidPlace)
{
......@@ -390,7 +394,6 @@ namespace VIZ.FGOUT.Module
public Polygon polygon;
public PointCollection points;
public PointCollection dotPoints;
/// <summary>
/// 画多边形
/// </summary>
......@@ -413,6 +416,7 @@ namespace VIZ.FGOUT.Module
polygon.Points = points;
}
public PointCollection dotPoints;
/// <summary>
/// 画点
/// </summary>
......@@ -420,20 +424,20 @@ namespace VIZ.FGOUT.Module
/// <param name="brush"></param>
private void DrawDot(Point point, Brush brush)
{
aa = new PathGeometry();
//if (!rectsInvalid.Contains(rectInvalid))
//{
aa.AddGeometry(new LineGeometry(){ StartPoint = point, EndPoint = new Point(point.X + 1, point.Y + 1) });
//rectsInvalid.Add(rectInvalid);
if (!dotPoints.Contains(point))
{
aa = new PathGeometry();
dotPoints.Add(point);
aa.AddGeometry(new LineGeometry() { StartPoint = point, EndPoint = new Point(point.X + 1, point.Y + 1) });
var myPath = new Path()
{
Fill = Brushes.Transparent,
Stroke = brush,
StrokeThickness = 1.5,
StrokeThickness = 4,
Data = aa
};
canvas1.Children.Add(myPath);
// }
}
}
//public Rectangle _rectangle;
......
......@@ -134,6 +134,10 @@ namespace VIZ.FGOUT.Module
// 算法标记
ApplicationDomain.MessageManager.Register<MarkModel>(this, this.Mark);
// 保存算法标记
ApplicationDomain.MessageManager.Register<SaveMarkModel>(this, this.SaveMark);
// 开始的位置
ApplicationDomain.MessageManager.Register<StartPlaceModel>(this, this.StartPlace);
......@@ -145,29 +149,29 @@ namespace VIZ.FGOUT.Module
// 清除开始、结束、无效位置
ApplicationDomain.MessageManager.Register<CleanPlaceModel>(this, this.CleanPlace);
//显示开始、结束、无效位置
// 显示开始、结束、无效位置
ApplicationDomain.MessageManager.Register<DisplayPlaceModel>(this, this.DisplayPlace);
// 算法发送命令
// 发送位置命令给算法
ApplicationDomain.MessageManager.Register<SendPlaceModel>(this, this.SendPlace);
// 保存按钮发送命令
// 保存位置发送命令
ApplicationDomain.MessageManager.Register<SavePlaceModel>(this, this.SavePlace);
// 调用Replay发送命令
ApplicationDomain.MessageManager.Register<ReplayModel>(this,this.Replay);
//调用UESetting发送命令
// 调用UESetting发送命令
ApplicationDomain.MessageManager.Register<UESettingModel>(this,this.UESetting);
//调用UEControl发送命令
// 调用UEControl发送命令
ApplicationDomain.MessageManager.Register<UEControlModel>(this, this.UEControl);
//重启算法发送命令
// 重启算法发送命令
ApplicationDomain.MessageManager.Register<RestartAlgorithmModel>(this, this.RestartAlgorithm);
//关闭算法发送命令
// 关闭算法发送命令
ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm);
}
......@@ -315,9 +319,38 @@ namespace VIZ.FGOUT.Module
return;
}
NDIView nDIView = this.GetView<NDIView>();
nDIView.dotPoints = new PointCollection();
nDIView._polygonsMark = new List<PointCollection>();
IsMark = markModel.IsMark;
}
/// <summary>
/// 保存算法标记
/// </summary>
/// <param name="saveMarkModel"></param>
private void SaveMark(SaveMarkModel saveMarkModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1);
if (manager == null)
return;
NDIView nDIView = this.GetView<NDIView>();
var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight;
nDIView._polygonsMark.Add(nDIView.dotPoints);
AlgorithmPackage_Figout_new_model package = new AlgorithmPackage_Figout_new_model();
package.mark = Coordinate(nDIView._polygonsMark, srcWidth, srcHeight);
manager.SendJson(package);
MessageBoxEx.ShowDialog("算法标记保存成功");
}
public bool IsDrawStartPlace;
/// <summary>
/// 开始位置命令
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "9806D9914924DA355C964D7F602DE067F1D96B5D1858176E2D9922DBC86CDABB"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......

C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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