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 @@ ...@@ -82,7 +82,10 @@
<Compile Include="Message\Setting\EndPlaceModel.cs" /> <Compile Include="Message\Setting\EndPlaceModel.cs" />
<Compile Include="Message\Setting\InvalidPlaceModel.cs" /> <Compile Include="Message\Setting\InvalidPlaceModel.cs" />
<Compile Include="Message\Setting\MarkModel.cs" /> <Compile Include="Message\Setting\MarkModel.cs" />
<Compile Include="Message\Setting\ReplayInPortModel.cs" />
<Compile Include="Message\Setting\ReplayModel.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\RestartAlgorithmModel.cs" />
<Compile Include="Message\Setting\SaveMarkModel.cs" /> <Compile Include="Message\Setting\SaveMarkModel.cs" />
<Compile Include="Message\Setting\SavePlaceModel.cs" /> <Compile Include="Message\Setting\SavePlaceModel.cs" />
......
96138fc77e1d71fde39f5fd3f92f5a032e421a59 3524faf8538cdae4f5dd0830a09823eb1c801e99
...@@ -113,6 +113,22 @@ namespace VIZ.FGOUT.Module ...@@ -113,6 +113,22 @@ namespace VIZ.FGOUT.Module
} }
/// <summary> /// <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> /// </summary>
bool _isStop = true; bool _isStop = true;
...@@ -128,46 +144,52 @@ namespace VIZ.FGOUT.Module ...@@ -128,46 +144,52 @@ namespace VIZ.FGOUT.Module
//Replay入点命令 //Replay入点命令
if (string.Equals(this.Support.HotkeyConfig.I, hotkey)) if (string.Equals(this.Support.HotkeyConfig.I, hotkey))
{ {
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1); //service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false; //if (service == null) return false;
var context = new NDIViewHotkeyContext() //var context = new NDIViewHotkeyContext()
{ //{
hotkey = NDIViewHotkeys.I // hotkey = NDIViewHotkeys.I
}; //};
service.NDIViewHotkeyMode(context); //service.NDIViewHotkeyMode(context);
return true; //return true;
return AssembleHotkeyMode(NDIViewHotkeys.I);
} }
//Replay出点命令 //Replay出点命令
if (string.Equals(this.Support.HotkeyConfig.O, hotkey)) if (string.Equals(this.Support.HotkeyConfig.O, hotkey))
{ {
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1); //service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false; //if (service == null) return false;
var context = new NDIViewHotkeyContext() //var context = new NDIViewHotkeyContext()
{ //{
hotkey = NDIViewHotkeys.O // hotkey = NDIViewHotkeys.O
}; //};
service.NDIViewHotkeyMode(context); //service.NDIViewHotkeyMode(context);
return true; //return true;
return AssembleHotkeyMode(NDIViewHotkeys.O);
} }
//位置标记删除命令 //位置标记删除命令
if (string.Equals(this.Support.HotkeyConfig.Delete, hotkey)) if (string.Equals(this.Support.HotkeyConfig.Delete, hotkey))
{ {
service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1); //service = ApplicationDomain.ServiceManager.GetService<INDIViewService>(NDIViewKeys.CAM_1);
if (service == null) return false; //if (service == null) return false;
var context = new NDIViewHotkeyContext() //var context = new NDIViewHotkeyContext()
{ //{
hotkey = NDIViewHotkeys.Delete // hotkey = NDIViewHotkeys.Delete
}; //};
service.NDIViewHotkeyMode(context); //service.NDIViewHotkeyMode(context);
//return true;
return true; return AssembleHotkeyMode(NDIViewHotkeys.Delete);
} }
//INDIViewService service = null; //INDIViewService service = null;
......
...@@ -644,12 +644,12 @@ ...@@ -644,12 +644,12 @@
Width="100" Width="100"
Height="40" Height="40"
Margin="10" Margin="10"
Command="{Binding Path=ReplaySendCommand}" Command="{Binding Path=ReplayStartCommand}"
Content="Replay Start" Content="Replay Start"
Style="{StaticResource ButtonStyle}" Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" /> Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />
<Button <!--<Button
Grid.Row="4" Grid.Row="4"
Grid.Column="2" Grid.Column="2"
Width="100" Width="100"
...@@ -658,7 +658,7 @@ ...@@ -658,7 +658,7 @@
Command="{Binding Path=ReplayReStartCommand}" Command="{Binding Path=ReplayReStartCommand}"
Content="Replay Restart" Content="Replay Restart"
Style="{StaticResource ButtonStyle}" Style="{StaticResource ButtonStyle}"
Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" /> Visibility="{Binding ReplaySendVisibility, Mode=TwoWay}" />-->
<Button <Button
Grid.Row="4" Grid.Row="4"
......
...@@ -75,7 +75,7 @@ namespace VIZ.FGOUT.Module ...@@ -75,7 +75,7 @@ namespace VIZ.FGOUT.Module
this.ReplayUncheckedCommand = new VCommand(this.ReplayUnchecked); this.ReplayUncheckedCommand = new VCommand(this.ReplayUnchecked);
this.SliderValueChangedCommand = new VCommand(this.SliderValueChanged); this.SliderValueChangedCommand = new VCommand(this.SliderValueChanged);
//Replay Start //Replay Start
this.ReplaySendCommand = new VCommand(this.ReplaySend); this.ReplayStartCommand = new VCommand(this.ReplayStart);
//Replay Stop //Replay Stop
this.ReplayStopCommand = new VCommand(this.ReplayStop); this.ReplayStopCommand = new VCommand(this.ReplayStop);
//Replay Restart //Replay Restart
...@@ -657,9 +657,9 @@ namespace VIZ.FGOUT.Module ...@@ -657,9 +657,9 @@ namespace VIZ.FGOUT.Module
} }
public VCommand ReplayStopCommand { get; set; } public VCommand ReplayStopCommand { get; set; }
public VCommand ReplayReStartCommand { get; set; }
public VCommand ReplaySendCommand { get; set; }
public VCommand ReplayReStartCommand { get; set; }
private void ReplayReStart() private void ReplayReStart()
{ {
if (StartTime == 0) if (StartTime == 0)
...@@ -708,54 +708,61 @@ namespace VIZ.FGOUT.Module ...@@ -708,54 +708,61 @@ namespace VIZ.FGOUT.Module
ReplayIsChecked = false; ReplayIsChecked = false;
} }
private void ReplaySend() public VCommand ReplayStartCommand { get; set; }
public ReplayStartModel replayStartModel = new ReplayStartModel();
private void ReplayStart()
{ {
if (StartTime == 0) //if (StartTime == 0)
{ //{
MessageBoxEx.ShowDialog("请选择入点."); // MessageBoxEx.ShowDialog("请选择入点.");
return; // return;
} //}
if (EndTime == 0) //if (EndTime == 0)
{ //{
MessageBoxEx.ShowDialog("请选择出点."); // MessageBoxEx.ShowDialog("请选择出点.");
return; // return;
} //}
if (EndTime <= StartTime) //if (EndTime <= StartTime)
{ //{
MessageBoxEx.ShowDialog("出点应大于入点."); // MessageBoxEx.ShowDialog("出点应大于入点.");
return; // return;
} //}
UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP); ApplicationDomain.MessageManager.Send(replayStartModel);
if (manager == null) return;
ReplayPackage replayPackage = new ReplayPackage(); //UdpEndpointManager manager = ConnectionManager.UdpConnection.GetEndpointManager(NDIViewKeys.CAM_1__CLIP);
replayPackage.type = ClipPackageSignal.REPLAY; //if (manager == null) return;
//VideoData data = new VideoData();
////data.backTimes = Convert.ToInt32(ReplaySecond); //ReplayPackage replayPackage = new ReplayPackage();
////timecode时间戳 //replayPackage.type = ClipPackageSignal.REPLAY;
//data.timecode = NDIViewModel.ReplayTimeStamp; ////VideoData data = new VideoData();
//data.status = 1; //////data.backTimes = Convert.ToInt32(ReplaySecond);
//replayPackage.data = data; //////timecode时间戳
replayPackage.start_time = StartTime; ////data.timecode = NDIViewModel.ReplayTimeStamp;
replayPackage.end_time = EndTime; ////data.status = 1;
replayPackage.status = ReplayStatus.Start; ////replayPackage.data = data;
manager.SendJson(replayPackage); //replayPackage.start_time = StartTime;
MessageBoxEx.ShowDialog("Replay Start OK."); //replayPackage.end_time = EndTime;
//replayPackage.status = ReplayStatus.Start;
//manager.SendJson(replayPackage);
//MessageBoxEx.ShowDialog("Replay Start OK.");
} }
public VCommand InPointCommand { get; set; } public VCommand InPointCommand { get; set; }
public ReplayInPortModel replayInPortModel = new ReplayInPortModel();
private void InPoint() private void InPoint()
{ {
StartTime = NDIViewModel.ReplayTimeStamp; //StartTime = NDIViewModel.ReplayTimeStamp;
ApplicationDomain.MessageManager.Send(replayInPortModel);
} }
public VCommand OutPointCommand { get; set; } public VCommand OutPointCommand { get; set; }
public ReplayOutPointModel replayOutPointModel = new ReplayOutPointModel();
private void OutPoint() private void OutPoint()
{ {
EndTime = NDIViewModel.ReplayTimeStamp; //EndTime = NDIViewModel.ReplayTimeStamp;
ApplicationDomain.MessageManager.Send(replayOutPointModel);
} }
private long _start_time; private long _start_time;
......
...@@ -173,6 +173,65 @@ namespace VIZ.FGOUT.Module ...@@ -173,6 +173,65 @@ namespace VIZ.FGOUT.Module
// 关闭算法发送命令 // 关闭算法发送命令
ApplicationDomain.MessageManager.Register<StopAlgorithmModel>(this, this.CloseAlgorithm); 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 }; //CleanPlaceModel cpModel = new CleanPlaceModel { CleanPlace = true };
...@@ -1264,7 +1323,11 @@ namespace VIZ.FGOUT.Module ...@@ -1264,7 +1323,11 @@ namespace VIZ.FGOUT.Module
public void NDIViewHotkeyMode(NDIViewHotkeyContext context) 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(); 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> // <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> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
......
This source diff could not be displayed because it is too large. You can view the blob instead.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace VIZ.Framework.Core 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