去掉录像机相关代码

This commit is contained in:
maqiao 2025-03-03 16:51:49 +08:00
parent a3eb3a702f
commit f207c264d4
5 changed files with 29 additions and 32 deletions

View File

@ -97,7 +97,7 @@ namespace DM_Weight
// 组态屏工具 // 组态屏工具
containerRegistry.RegisterSingleton<ScreenUtil>(); containerRegistry.RegisterSingleton<ScreenUtil>();
// 录像机 // 录像机
containerRegistry.RegisterSingleton<CHKFunction>(); //containerRegistry.RegisterSingleton<CHKFunction>();
containerRegistry.Register<IDialogService, MaterialDialogService>(); containerRegistry.Register<IDialogService, MaterialDialogService>();

View File

@ -133,7 +133,7 @@ namespace DM_Weight.Port
logger.Info($"进行抽屉操作抽屉号【{DrawerNo}】类型【{BoardType}】库位【{string.Join(",", ColNos)}】窗口【{WindowName}】"); logger.Info($"进行抽屉操作抽屉号【{DrawerNo}】类型【{BoardType}】库位【{string.Join(",", ColNos)}】窗口【{WindowName}】");
Operate = true; Operate = true;
//开始录像 //开始录像
_chkFunction.HIKStartDVRRecord(); //_chkFunction.HIKStartDVRRecord();
logger.Info($"时间:{DateTime.Now}"); logger.Info($"时间:{DateTime.Now}");
try try
{ {
@ -592,8 +592,8 @@ namespace DM_Weight.Port
private readonly IEventAggregator _eventAggregator; private readonly IEventAggregator _eventAggregator;
private CHKFunction _chkFunction; //private CHKFunction _chkFunction;
public PortUtil(IEventAggregator eventAggregator, CHKFunction chkFunction) public PortUtil(IEventAggregator eventAggregator)
{ {
_eventAggregator = eventAggregator; _eventAggregator = eventAggregator;
try try
@ -660,7 +660,7 @@ namespace DM_Weight.Port
} }
} }
_chkFunction = chkFunction; //_chkFunction = chkFunction;
} }

View File

@ -342,16 +342,14 @@ namespace DM_Weight.ViewModels
public bool Is16Drawer { get => _is16Drawer; set => SetProperty(ref _is16Drawer, value); } public bool Is16Drawer { get => _is16Drawer; set => SetProperty(ref _is16Drawer, value); }
public bool KeepAlive => false; public bool KeepAlive => false;
private PortUtil _portUtil; private PortUtil _portUtil;
private CHKFunction _chkFunction;
IEventAggregator _eventAggregator; IEventAggregator _eventAggregator;
public HomeWindowViewModel(IRegionManager iRegionManager, PortUtil portUtil, IDialogService dialogService, IUnityContainer container, IEventAggregator eventAggregator, CHKFunction cHKFunction) public HomeWindowViewModel(IRegionManager iRegionManager, PortUtil portUtil, IDialogService dialogService, IUnityContainer container, IEventAggregator eventAggregator)
{ {
_portUtil = portUtil; _portUtil = portUtil;
_regionManager = iRegionManager; _regionManager = iRegionManager;
_dialogService = dialogService; _dialogService = dialogService;
_container = container; _container = container;
this._eventAggregator = eventAggregator; this._eventAggregator = eventAggregator;
_chkFunction = cHKFunction;
} }
public DelegateCommand<string> OpenFingerDialog public DelegateCommand<string> OpenFingerDialog
@ -480,7 +478,6 @@ namespace DM_Weight.ViewModels
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > autoExit && CheckComputerFreeState.GetLastInputTime() > autoExit) if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > autoExit && CheckComputerFreeState.GetLastInputTime() > autoExit)
{ {
logger.Info($"设备30秒内无人操作用户【{Operator?.Nickname}】自动退出登录"); logger.Info($"设备30秒内无人操作用户【{Operator?.Nickname}】自动退出登录");
_chkFunction.HIKStopDVRRecord();
Operator = null; Operator = null;
Reviewer = null; Reviewer = null;
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
@ -493,25 +490,25 @@ namespace DM_Weight.ViewModels
}; };
timer.Start(); timer.Start();
} }
if (stopRecord > 0) //if (stopRecord > 0)
{ //{
System.Timers.Timer timer = new System.Timers.Timer(); // System.Timers.Timer timer = new System.Timers.Timer();
timer.Interval = 1000; // timer.Interval = 1000;
timer.Elapsed += (sender, e) => // timer.Elapsed += (sender, e) =>
{ // {
//指定时间内无人操作鼠标键盘则停止录像 // //指定时间内无人操作鼠标键盘则停止录像
if (!_portUtil.Operate && CheckComputerFreeState.GetLastInputTime() > stopRecord) // if (!_portUtil.Operate && CheckComputerFreeState.GetLastInputTime() > stopRecord)
{ // {
_chkFunction.HIKStopDVRRecord(); // _chkFunction.HIKStopDVRRecord();
} // }
}; // };
timer.Start(); // timer.Start();
} //}
logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间"); logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间");
//获取录像机的时间 //获取录像机的时间
_chkFunction.HIK_DVR_TIME(); //_chkFunction.HIK_DVR_TIME();
_chkFunction.HIKStartDVRRecord(); //_chkFunction.HIKStartDVRRecord();
} }
//每次导航的时候该实列用不用重新创建true是不重新创建,false是重新创建 //每次导航的时候该实列用不用重新创建true是不重新创建,false是重新创建

View File

@ -65,7 +65,7 @@ namespace DM_Weight.ViewModels
private FingerprintUtil _fingerprintUtil; private FingerprintUtil _fingerprintUtil;
private PortUtil _portUtil; private PortUtil _portUtil;
private CHKFunction _chkFunction; //private CHKFunction _chkFunction;
public Boolean LoginBtnEnable { get { return _loginBtnEnable; } set { SetProperty(ref _loginBtnEnable, value); } } public Boolean LoginBtnEnable { get { return _loginBtnEnable; } set { SetProperty(ref _loginBtnEnable, value); } }
public string Password { get { return password; } set { SetProperty(ref password, value); } } public string Password { get { return password; } set { SetProperty(ref password, value); } }
@ -110,11 +110,11 @@ namespace DM_Weight.ViewModels
// _regionManager = regionManager; // _regionManager = regionManager;
// _eventAggregator = eventAggregator; // _eventAggregator = eventAggregator;
//} //}
public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, CHKFunction chcFunction) public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil)
{ {
//_fingerprintUtil = fingerprintUtil; //_fingerprintUtil = fingerprintUtil;
_portUtil = portUtil; _portUtil = portUtil;
_chkFunction= chcFunction; //_chkFunction= chcFunction;
_regionManager = regionManager; _regionManager = regionManager;
_eventAggregator = eventAggregator; _eventAggregator = eventAggregator;
} }
@ -355,7 +355,7 @@ _exitCommand ??= new DelegateCommand(Exit);
void Exit() void Exit()
{ {
_chkFunction.HIKLoginOut(); //_chkFunction.HIKLoginOut();
Process.GetCurrentProcess().Kill(); Process.GetCurrentProcess().Kill();
Environment.Exit(0); Environment.Exit(0);
} }

View File

@ -63,8 +63,8 @@ namespace DM_Weight.ViewModels
private FingerprintUtil _fingerprintUtil; private FingerprintUtil _fingerprintUtil;
IRegionManager _regionManager; IRegionManager _regionManager;
IUnityContainer _container; IUnityContainer _container;
private CHKFunction _cHKFunction; //private CHKFunction _cHKFunction;
public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, FingerprintUtil fingerprintUtil, ScreenUtil screenUtil, CHKFunction cHKFunction) public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, FingerprintUtil fingerprintUtil, ScreenUtil screenUtil)
{ {
//_portUtil = portUtil; //_portUtil = portUtil;
this.eventAggregator = eventAggregator; this.eventAggregator = eventAggregator;
@ -73,7 +73,7 @@ namespace DM_Weight.ViewModels
_fingerprintUtil = fingerprintUtil; _fingerprintUtil = fingerprintUtil;
_regionManager = regionManager; _regionManager = regionManager;
_container = container; _container = container;
_cHKFunction = cHKFunction; //_cHKFunction = cHKFunction;
System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() => System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
{ {