Commit b7109d31 by 鲁志-悦动

Replay In/Out Port热键

parent 17b61dcf
namespace VIZ.FGOUT.Domain
{
public class ReplayInPortModel
{
}
}
namespace VIZ.FGOUT.Domain
{
public class ReplayOutPointModel
{
}
}
\ No newline at end of file
namespace VIZ.FGOUT.Domain
{
public class ReplayStartModel
{
}
}
......@@ -82,7 +82,10 @@
<Compile Include="Message\Setting\EndPlaceModel.cs" />
<Compile Include="Message\Setting\InvalidPlaceModel.cs" />
<Compile Include="Message\Setting\MarkModel.cs" />
<Compile Include="Message\Setting\ReplayInPortModel.cs" />
<Compile Include="Message\Setting\ReplayModel.cs" />
<Compile Include="Message\Setting\ReplayOutPointModel.cs" />
<Compile Include="Message\Setting\ReplayStartModel.cs" />
<Compile Include="Message\Setting\RestartAlgorithmModel.cs" />
<Compile Include="Message\Setting\SaveMarkModel.cs" />
<Compile Include="Message\Setting\SavePlaceModel.cs" />
......
96138fc77e1d71fde39f5fd3f92f5a032e421a59
3524faf8538cdae4f5dd0830a09823eb1c801e99
......@@ -113,6 +113,22 @@ namespace VIZ.FGOUT.Module
}
/// <summary>
/// 组装HotkeyMode
/// </summary>
private bool AssembleHotkeyMode(NDIViewHotkeys hotkey)
{
var service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false;
var context = new NDIViewHotkeyContext()
{
hotkey = hotkey
};
service.NDIViewHotkeyMode(context);
return true;
}
/// <summary>
/// 算法是否处于停止状态
/// </summary>
bool _isStop = true;
......@@ -128,46 +144,52 @@ namespace VIZ.FGOUT.Module
//Replay入点命令
if (string.Equals(this.Support.HotkeyConfig.I, hotkey))
{
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false;
//service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
//if (service == null) return false;
var context = new NDIViewHotkeyContext()
{
hotkey = NDIViewHotkeys.I
};
service.NDIViewHotkeyMode(context);
//var context = new NDIViewHotkeyContext()
//{
// hotkey = NDIViewHotkeys.I
//};
//service.NDIViewHotkeyMode(context);
return true;
//return true;
return AssembleHotkeyMode(NDIViewHotkeys.I);
}
//Replay出点命令
if (string.Equals(this.Support.HotkeyConfig.O, hotkey))
{
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false;
//service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
//if (service == null) return false;
var context = new NDIViewHotkeyContext()
{
hotkey = NDIViewHotkeys.O
};
service.NDIViewHotkeyMode(context);
//var context = new NDIViewHotkeyContext()
//{
// hotkey = NDIViewHotkeys.O
//};
//service.NDIViewHotkeyMode(context);
return true;
//return true;
return AssembleHotkeyMode(NDIViewHotkeys.O);
}
//位置标记删除命令
if (string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
{
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false;
//service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
//if (service == null) return false;
var context = new NDIViewHotkeyContext()
{
hotkey = NDIViewHotkeys.Delete
};
service.NDIViewHotkeyMode(context);
//var context = new NDIViewHotkeyContext()
//{
// hotkey = NDIViewHotkeys.Delete
//};
//service.NDIViewHotkeyMode(context);
return true;
//return true;
return AssembleHotkeyMode(NDIViewHotkeys.Delete);
}
//INDIViewService service = null;
......
......@@ -644,12 +644,12 @@
Width="100"
Height="40"
Margin="10"
Command="{Binding Path=ReplaySendCommand}"
Command="{Binding Path=ReplayStartCommand}"
Content="Replay Start"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
<Button
<!--<Button
Grid.Row="4"
Grid.Column="2"
Width="100"
......@@ -658,7 +658,7 @@
Command="{Binding Path=ReplayReStartCommand}"
Content="Replay Restart"
Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />-->
<Button
Grid.Row="4"
......
......@@ -75,7 +75,7 @@ namespace VIZ.FGOUT.Module
this.ReplayUncheckedCommand = new VCommand(this.ReplayUnchecked);
this.SliderValueChangedCommand = new VCommand(this.SliderValueChanged);
//Replay Start
this.ReplaySendCommand = new VCommand(this.ReplaySend);
this.ReplayStartCommand = new VCommand(this.ReplayStart);
//Replay Stop
this.ReplayStopCommand = new VCommand(this.ReplayStop);
//Replay Restart
......@@ -657,8 +657,8 @@ namespace VIZ.FGOUT.Module
}
public VCommand ReplayStopCommand { get; set; }
public VCommand ReplayReStartCommand { get; set; }
public VCommand ReplaySendCommand { get; set; }
private void ReplayReStart()
{
......@@ -708,54 +708,61 @@ namespace VIZ.FGOUT.Module
ReplayIsChecked = false;
}
private void ReplaySend()
{
if (StartTime == 0)
{
MessageBoxEx.ShowDialog("请选择入点.");
return;
}
if (EndTime == 0)
{
MessageBoxEx.ShowDialog("请选择出点.");
return;
}
if (EndTime <= StartTime)
public VCommand ReplayStartCommand { get; set; }
public ReplayStartModel replayStartModel = new ReplayStartModel();
private void ReplayStart()
{
MessageBoxEx.ShowDialog("出点应大于入点.");
return;
}
//if (StartTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择入点.");
// return;
//}
//if (EndTime == 0)
//{
// MessageBoxEx.ShowDialog("请选择出点.");
// return;
//}
//if (EndTime <= StartTime)
//{
// MessageBoxEx.ShowDialog("出点应大于入点.");
// return;
//}
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
if (manager == null) return;
ApplicationDomain.MessageManager.Send(replayStartModel);
ReplayPackage replayPackage = new ReplayPackage();
replayPackage.type = ClipPackageSignal.REPLAY;
//VideoData data = new VideoData();
////data.backTimes = Convert.ToInt32(ReplaySecond);
////timecode时间戳
//data.timecode = NDIViewModel.ReplayTimeStamp;
//data.status = 1;
//replayPackage.data = data;
replayPackage.start_time = StartTime;
replayPackage.end_time = EndTime;
replayPackage.status = ReplayStatus.Start;
manager.SendJson(replayPackage);
MessageBoxEx.ShowDialog("Replay Start OK.");
//UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
//if (manager == null) return;
//ReplayPackage replayPackage = new ReplayPackage();
//replayPackage.type = ClipPackageSignal.REPLAY;
////VideoData data = new VideoData();
//////data.backTimes = Convert.ToInt32(ReplaySecond);
//////timecode时间戳
////data.timecode = NDIViewModel.ReplayTimeStamp;
////data.status = 1;
////replayPackage.data = data;
//replayPackage.start_time = StartTime;
//replayPackage.end_time = EndTime;
//replayPackage.status = ReplayStatus.Start;
//manager.SendJson(replayPackage);
//MessageBoxEx.ShowDialog("Replay Start OK.");
}
public VCommand InPointCommand { get; set; }
public ReplayInPortModel replayInPortModel = new ReplayInPortModel();
private void InPoint()
{
StartTime = NDIViewModel.ReplayTimeStamp;
//StartTime = NDIViewModel.ReplayTimeStamp;
ApplicationDomain.MessageManager.Send(replayInPortModel);
}
public VCommand OutPointCommand { get; set; }
public ReplayOutPointModel replayOutPointModel = new ReplayOutPointModel();
private void OutPoint()
{
EndTime = NDIViewModel.ReplayTimeStamp;
//EndTime = NDIViewModel.ReplayTimeStamp;
ApplicationDomain.MessageManager.Send(replayOutPointModel);
}
private long _start_time;
......
......@@ -173,6 +173,65 @@ namespace VIZ.FGOUT.Module
// 关闭算法发送命令
ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm);
// ReplayStart发送命令
ApplicationDomain.MessageManager.Register<ReplayStartModel>(this, this.ReplayStart);
// Replay入点发送命令
ApplicationDomain.MessageManager.Register<ReplayInPortModel>(this, this.ReplayInPort);
// Replay出点发送命令
ApplicationDomain.MessageManager.Register<ReplayOutPointModel>(this, this.ReplayOutPort);
}
private void ReplayOutPort(ReplayOutPointModel replayOutPointModel)
{
EndTime = ReplayTimeStamp;
}
private void ReplayInPort(ReplayInPortModel replayInPortModel)
{
StartTime = ReplayTimeStamp;
}
public long StartTime { get; set; }
public long EndTime { get; set; }
private void ReplayStart(ReplayStartModel replayStartModel)
{
if (this.ViewKey != NDIViewKeys.CAM_1)
return;
var manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
if (manager == null) return;
if (StartTime == 0)
{
MessageBoxEx.ShowDialog("请选择入点.");
return;
}
if (EndTime == 0)
{
MessageBoxEx.ShowDialog("请选择出点.");
return;
}
if (EndTime <= StartTime)
{
MessageBoxEx.ShowDialog("出点应大于入点.");
return;
}
var replayPackage = new ReplayPackage()
{
type = ClipPackageSignal.REPLAY,
start_time = StartTime,
end_time = EndTime,
status = ReplayStatus.Start
};
manager.SendJson(replayPackage);
MessageBoxEx.ShowDialog("Replay Start OK.");
}
//CleanPlaceModel cpModel = new CleanPlaceModel { CleanPlace = true };
......@@ -1264,7 +1323,11 @@ namespace VIZ.FGOUT.Module
public void NDIViewHotkeyMode(NDIViewHotkeyContext context)
{
if(context.hotkey.Equals(NDIViewHotkeys.Delete))
if (context.hotkey.Equals(NDIViewHotkeys.I))
StartTime = ReplayTimeStamp;
if (context.hotkey.Equals(NDIViewHotkeys.O))
EndTime = ReplayTimeStamp;
if (context.hotkey.Equals(NDIViewHotkeys.Delete))
DeletePositionMarker();
}
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ECFD948E66B81FA644E58CC0E938F79CDBA8AFEA7D65F6071AF2481DAF525937"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E0D0F55D79FE75A95C4A7B5F034ACA7CA3D958A7C5F5C04B9BF1ECC08A37949D"
#pragma checksum "..\..\..\..\..\NDIMainView\View\NDIMainView.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "ECFD948E66B81FA644E58CC0E938F79CDBA8AFEA7D65F6071AF2481DAF525937"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
......
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.Text.RegularExpressions;
using System.Threading.Tasks;
namespace VIZ.Framework.Core
{
......
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