|
|
|
@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using NVelocity.Util.Introspection;
|
|
|
|
|
using Quartz;
|
|
|
|
|
using SlnMesnac.Business;
|
|
|
|
|
using SlnMesnac.Business.@base;
|
|
|
|
|
using SlnMesnac.Config;
|
|
|
|
@ -70,6 +71,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
//private const string DVRUserName = "admin"; //设备登录用户名 User name to login
|
|
|
|
|
//private const string DVRPassword = "haiwei@2024"; //设备登录密码 Password to login
|
|
|
|
|
|
|
|
|
|
private readonly IScheduler _scheduler;
|
|
|
|
|
|
|
|
|
|
public IndexControlViewModel()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
@ -84,6 +87,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
webSocketBusiness = App.ServiceProvider.GetService<WebSocketBusiness>();
|
|
|
|
|
cabinetInfoBusiness = App.ServiceProvider.GetService<CabinetInfoBusiness>();
|
|
|
|
|
|
|
|
|
|
_scheduler = App.ServiceProvider.GetService<IScheduler>();
|
|
|
|
|
|
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
|
autoModeBusiness.GimbaRotationControlEvent += GimbaRotationControl;
|
|
|
|
|
|
|
|
|
@ -663,17 +668,24 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开启自动模式
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Start_AutoMode()
|
|
|
|
|
public async void Start_AutoMode()
|
|
|
|
|
{
|
|
|
|
|
autoModeBusiness.Start();
|
|
|
|
|
//autoModeBusiness.Start();
|
|
|
|
|
if (!_scheduler.IsStarted)
|
|
|
|
|
{
|
|
|
|
|
await _scheduler.Start();
|
|
|
|
|
}
|
|
|
|
|
var myJobKey = new JobKey("AutoModeJob", "AutoModeJobGroup");
|
|
|
|
|
await _scheduler.ResumeJob(myJobKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 关闭自动模式
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Stop_AutoMode()
|
|
|
|
|
public async void Stop_AutoMode()
|
|
|
|
|
{
|
|
|
|
|
autoModeBusiness.Stop();
|
|
|
|
|
var myJobKey = new JobKey("AutoModeJob", "AutoModeJobGroup");
|
|
|
|
|
await _scheduler.PauseJob(myJobKey);
|
|
|
|
|
|
|
|
|
|
autoModeBusiness.ClearPlcMode();
|
|
|
|
|
}
|
|
|
|
@ -681,20 +693,28 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开启巡检模式
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Start_InspMode()
|
|
|
|
|
public async void Start_InspMode()
|
|
|
|
|
{
|
|
|
|
|
string taskCode = DateTime.Now.ToString("yyyyMMddHHmmssffff");
|
|
|
|
|
string fileName = $"{taskCode}.mp4";
|
|
|
|
|
//string taskCode = DateTime.Now.ToString("yyyyMMddHHmmssffff");
|
|
|
|
|
//string fileName = $"{taskCode}.mp4";
|
|
|
|
|
|
|
|
|
|
inspModeBusiness.Start(taskCode, fileName);
|
|
|
|
|
//inspModeBusiness.Start(taskCode, fileName);
|
|
|
|
|
|
|
|
|
|
if (!_scheduler.IsStarted)
|
|
|
|
|
{
|
|
|
|
|
await _scheduler.Start();
|
|
|
|
|
}
|
|
|
|
|
var myJobKey = new JobKey("InspModeJob", "InspModeJobGroup");
|
|
|
|
|
await _scheduler.ResumeJob(myJobKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 关闭巡检模式
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Stop_InspMode()
|
|
|
|
|
public async void Stop_InspMode()
|
|
|
|
|
{
|
|
|
|
|
inspModeBusiness.Stop();
|
|
|
|
|
var myJobKey = new JobKey("InspModeJob", "InspModeJobGroup");
|
|
|
|
|
await _scheduler.PauseJob(myJobKey);
|
|
|
|
|
|
|
|
|
|
autoModeBusiness.ClearPlcMode();
|
|
|
|
|
}
|
|
|
|
|