Commit 83605bc1 by 鲁志-悦动

Replay拖出入点框,把坐标数据发送给算法

parent 5346a6b5
......@@ -32,7 +32,6 @@ namespace VIZ.FGOUT.Connection
/// <summary>
/// InValidPalce
/// </summary>
public List<List<List<int>>> ignore { get; set; }
/// <summary>
......
using VIZ.FGOUT.Domain;
using System.Collections.Generic;
using VIZ.FGOUT.Domain;
namespace VIZ.FGOUT.Connection
{
......@@ -28,6 +29,11 @@ namespace VIZ.FGOUT.Connection
/// <summary>
/// 数据
/// </summary>
public VideoData data { get; set; }
//public VideoData data { get; set; }
/// <summary>
/// InValidPalce
/// </summary>
public List<List<List<int>>> inPoints { get; set; }
}
}
namespace VIZ.FGOUT.Domain
{
public class CleanInPointsModel
{
}
}
......@@ -77,6 +77,7 @@
<Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__detect.cs" />
<Compile Include="Message\Algorithm\Implementation\AlgorithmMessage__start_end.cs" />
<Compile Include="Message\Algorithm\Interface\IAlgorithmMessage__roi.cs" />
<Compile Include="Message\Setting\CleanInPointsModel.cs" />
<Compile Include="Message\Setting\CleanPlaceModel.cs" />
<Compile Include="Message\Setting\DisplayPlaceModel.cs" />
<Compile Include="Message\Setting\EndPlaceModel.cs" />
......
3524faf8538cdae4f5dd0830a09823eb1c801e99
e5d520f069224ea49e66eb87e09bd80ce5e68404
......@@ -126,6 +126,19 @@ namespace VIZ.FGOUT.Module
return true;
}
private bool AssembleHotkeyModeCam3(NDIViewHotkeys hotkey)
{
var service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_3);
if (service == null) return false;
var context = new NDIViewHotkeyContext()
{
hotkey = hotkey
};
service.NDIViewHotkeyMode(context);
return true;
}
/// <summary>
/// 算法是否处于停止状态
/// </summary>
......@@ -142,13 +155,13 @@ namespace VIZ.FGOUT.Module
//Replay入点命令
if (string.Equals(this.Support.HotkeyConfig.I, hotkey))
{
return AssembleHotkeyMode(NDIViewHotkeys.I);
return AssembleHotkeyModeCam3(NDIViewHotkeys.I);
}
//Replay出点命令
if (string.Equals(this.Support.HotkeyConfig.O, hotkey))
{
return AssembleHotkeyMode(NDIViewHotkeys.O);
return AssembleHotkeyModeCam3(NDIViewHotkeys.O);
}
//位置标记删除命令
......
......@@ -227,6 +227,7 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Foreground="White" Header="自动检测">
<CheckBox
......@@ -607,7 +608,7 @@
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
<Button
Grid.Row="5"
Grid.Row="4"
Grid.Column="3"
Width="100"
Height="40"
......@@ -616,6 +617,18 @@
Content="Replay Stop"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
<Button
Grid.Row="5"
Grid.Column="3"
Width="100"
Height="40"
Margin="10"
Command="{Binding Path=CleanInPointCommand}"
Content="Clean In Point"
IsEnabled="{Binding CleanEnable}"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
</Grid>
</WrapPanel>
<!--<WrapPanel
......
......@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Web.WebSockets;
using System.Windows;
using System.Windows.Interop;
using VIZ.FGOUT.Connection;
......@@ -87,6 +88,8 @@ namespace VIZ.FGOUT.Module
this.InPointCommand = new VCommand(this.InPoint);
//出点
this.OutPointCommand = new VCommand(this.OutPoint);
//清空入点标记
this.CleanInPointCommand = new VCommand(this.CleanInPoint);
//UESetting
this.UESettingCommand = new VCommand(this.UESetting);
......@@ -727,6 +730,13 @@ namespace VIZ.FGOUT.Module
ReplayIsChecked = false;
}
public VCommand CleanInPointCommand { get; set; }
public CleanInPointsModel _cleanInPointsModel = new CleanInPointsModel();
private void CleanInPoint()
{
ApplicationDomain.MessageManager.Send(_cleanInPointsModel);
}
public VCommand ReplayStartCommand { get; set; }
public ReplayStartModel replayStartModel = new ReplayStartModel();
private void ReplayStart()
......@@ -1115,7 +1125,7 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 清除矩形框
/// 清除开始、结束、无效位置标记
/// </summary>
public VCommand CleanCommand { get; set; }
public CleanPlaceModel cleanPlaceModel = new CleanPlaceModel();
......
......@@ -33,8 +33,11 @@ namespace VIZ.FGOUT.Module
// public Rectangle rectInvalid;
public List<Rect> rectsInvalid = new List<Rect>();
// public Path myPath = new Path();
public Rect rectReplay;
// public Rectangle rectInvalid;
public List<Rect> rectsReplay = new List<Rect>();
// public Path myPath = new Path();
// public Path myPath1 = new Path();
public NDIView()
......@@ -296,6 +299,26 @@ namespace VIZ.FGOUT.Module
canvas1.Children.Add(myPath);
}
}
if (vm.IsReplay)
{
aa = new PathGeometry();
if (!rectsReplay.Contains(rectReplay))
{
aa.AddGeometry(new RectangleGeometry(rectReplay));
rectsReplay.Add(rectReplay);
//if (rectsReplay.Count == 2)
// rectsReplay.RemoveAt(0);
var myPath = new Path()
{
Fill = Brushes.Transparent,
Stroke = Brushes.Green,
StrokeThickness = 1,
Data = aa
};
canvas1.Children.Add(myPath);
}
}
}
/// <summary>
......@@ -369,8 +392,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.IsMark)
// DrawDot(e.GetPosition(this.canvas1), Brushes.Red);
//else if (vm.IsDrawInvalidPlace)
// DrawPolygon(e.GetPosition(this.canvas1), Brushes.Red);
......@@ -416,6 +439,11 @@ namespace VIZ.FGOUT.Module
{
rectInvalid = new Rect(startPoint, e.GetPosition(this.canvas1));
}
if (vm.IsReplay)
{
rectReplay = new Rect(startPoint, e.GetPosition(this.canvas1));
}
}
}
......
......@@ -182,6 +182,9 @@ namespace VIZ.FGOUT.Module
// Replay出点发送命令
ApplicationDomain.MessageManager.Register<ReplayOutPointModel>(this, this.ReplayOutPort);
//清空入点标记
ApplicationDomain.MessageManager.Register<CleanInPointsModel>(this, this.CleanInPoints);
}
private void ReplayOutPort(ReplayOutPointModel replayOutPointModel)
......@@ -200,8 +203,14 @@ namespace VIZ.FGOUT.Module
private void ReplayStart(ReplayStartModel replayStartModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
if (this.ViewKey != NDIViewKeys.CAM_3)
//if (this.ViewKey != NDIViewKeys.CAM_1)
return;
// 对结束值进行组装
NDIView nDIView = this.GetView<NDIView>();
//var rects = nDIView.rectsReplay;
var srcWidth = nDIView.video.ActualWidth;
var srcHeight = nDIView.video.ActualHeight;
var manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
if (manager == null) return;
......@@ -229,7 +238,8 @@ namespace VIZ.FGOUT.Module
type = ClipPackageSignal.REPLAY,
start_time = StartTime,
end_time = EndTime,
status = ReplayStatus.Start
status = ReplayStatus.Start,
inPoints = Coordinate(nDIView.rectsReplay, srcWidth, srcHeight)
};
managerAlgorithm.SendJson(replayPackage);
......@@ -237,6 +247,17 @@ namespace VIZ.FGOUT.Module
MessageBoxEx.ShowDialog("Replay Start OK.");
}
private void CleanInPoints(CleanInPointsModel cleanInPointsModel)
{
if (this.ViewKey != NDIViewKeys.CAM_3)
return;
var ndiView = this.GetView<NDIView>();
if (ndiView == null)
return;
ndiView.rectsReplay.Clear();
ndiView.canvas1.Children.Clear();
}
private void UESetting(UESettingModel ueSettingModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
......@@ -264,7 +285,7 @@ namespace VIZ.FGOUT.Module
/// </summary>
private void Replay(ReplayModel replayModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
if (this.ViewKey == NDIViewKeys.CAM_2)
return;
IsReplay = replayModel.IsReplay;
IsSliderValueChanged = replayModel.IsSliderValueChanged;
......@@ -419,12 +440,12 @@ namespace VIZ.FGOUT.Module
public bool IsCleanPlace;
private void CleanPlace(CleanPlaceModel cleanPlaceModel)
{
IsCleanPlace = cleanPlaceModel.CleanPlace;
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
var ndiView = this.GetView<NDIView>();
if(ndiView == null)
if (ndiView == null)
return;
IsCleanPlace = cleanPlaceModel.CleanPlace;
//nDIView.aa = null;
//nDIView.myPath.Data = null;
......@@ -451,12 +472,12 @@ namespace VIZ.FGOUT.Module
/// <param name="sendPlaceModel"></param>
private void SendPlace(SendPlaceModel sendPlaceModel)
{
// 对结束值进行组装
NDIView nDIView = this.GetView<NDIView>();
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
// 对结束值进行组装
NDIView nDIView = this.GetView<NDIView>();
//var renderInfo = nDIView.video.GetRenderInfo();
//var rectStart = nDIView.rectStart;
......@@ -1308,6 +1329,8 @@ namespace VIZ.FGOUT.Module
view.polygonsEnd.RemoveAt(view.polygonsEnd.Count - 1);
else if (IsDrawInvalidPlace && view.rectsInvalid.Count > 0)
view.rectsInvalid.RemoveAt(view.rectsInvalid.Count - 1);
else if (IsReplay && view.rectsReplay.Count > 0)
view.rectsReplay.RemoveAt(view.rectsReplay.Count - 1);
//先清空
view.canvas1.Children.Clear();
......@@ -1329,6 +1352,11 @@ namespace VIZ.FGOUT.Module
foreach (var points in view.rectsInvalid)
AddRects(view, points, Brushes.Red);
}
//if (view.rectsReplay.Count > 0)
//{
// foreach (var points in view.rectsReplay)
// AddRects(view, points, Brushes.Red);
//}
}
/// <summary>
......
......@@ -38,7 +38,7 @@ namespace VIZ.FGOUT.Module
//timecode
data.timecode = timecode;
data.status = 1;
replayPackage.data = data;
//replayPackage.data = data;
manager.SendJson(replayPackage);
}
......@@ -62,7 +62,7 @@ namespace VIZ.FGOUT.Module
//timecode
data.timecode = timecode;
data.status = 2; //重新开始
replayPackage.data = data;
//replayPackage.data = data;
manager.SendJson(replayPackage);
}
......@@ -94,7 +94,7 @@ namespace VIZ.FGOUT.Module
//timecode
data.timecode = timecode;
data.status = 0;//停止
replayPackage.data = data;
//replayPackage.data = data;
manager.SendJson(replayPackage);
}
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F7E31AF7C684FC230365F0EB5CBFB35D5A0FF9028A004C278D0DD9FC304C7CE0"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C2A844093FC01C7C4B85B4490D8FC7C48519F47C8585C4E6427F9B7D13310026"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -58,7 +58,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 233 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 234 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox _AutoMode_;
......@@ -66,7 +66,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 250 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 251 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox _ManualMode_;
......@@ -74,7 +74,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 912 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 925 "..\..\..\..\..\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 926 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 939 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 973 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 986 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......@@ -140,7 +140,7 @@ namespace VIZ.FGOUT.Module {
case 2:
this._AutoMode_ = ((System.Windows.Controls.CheckBox)(target));
#line 235 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 236 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._AutoMode_.Click += new System.Windows.RoutedEventHandler(this.AutoMode_OnClick);
#line default
......@@ -149,7 +149,7 @@ namespace VIZ.FGOUT.Module {
case 3:
this._ManualMode_ = ((System.Windows.Controls.CheckBox)(target));
#line 252 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 253 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._ManualMode_.Click += new System.Windows.RoutedEventHandler(this.ManualMode_OnClick);
#line default
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F7E31AF7C684FC230365F0EB5CBFB35D5A0FF9028A004C278D0DD9FC304C7CE0"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C2A844093FC01C7C4B85B4490D8FC7C48519F47C8585C4E6427F9B7D13310026"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......@@ -58,7 +58,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 233 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 234 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox _AutoMode_;
......@@ -66,7 +66,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 250 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 251 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.CheckBox _ManualMode_;
......@@ -74,7 +74,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 912 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 925 "..\..\..\..\..\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 926 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 939 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam3;
......@@ -90,7 +90,7 @@ namespace VIZ.FGOUT.Module {
#line hidden
#line 973 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 986 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal VIZ.FGOUT.Module.NDIView cam2;
......@@ -140,7 +140,7 @@ namespace VIZ.FGOUT.Module {
case 2:
this._AutoMode_ = ((System.Windows.Controls.CheckBox)(target));
#line 235 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 236 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._AutoMode_.Click += new System.Windows.RoutedEventHandler(this.AutoMode_OnClick);
#line default
......@@ -149,7 +149,7 @@ namespace VIZ.FGOUT.Module {
case 3:
this._ManualMode_ = ((System.Windows.Controls.CheckBox)(target));
#line 252 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
#line 253 "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml"
this._ManualMode_.Click += new System.Windows.RoutedEventHandler(this.ManualMode_OnClick);
#line default
......

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