去掉录像机相关
This commit is contained in:
parent
c7a3ef80ad
commit
1059dc01b0
|
@ -23,7 +23,6 @@ using log4net;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using log4net.Repository.Hierarchy;
|
using log4net.Repository.Hierarchy;
|
||||||
|
@ -104,7 +103,7 @@ namespace DM_Weight
|
||||||
// 组态屏工具
|
// 组态屏工具
|
||||||
//containerRegistry.RegisterSingleton<ScreenUtil>();
|
//containerRegistry.RegisterSingleton<ScreenUtil>();
|
||||||
// 录像机
|
// 录像机
|
||||||
containerRegistry.RegisterSingleton<CHKFunction>();
|
//containerRegistry.RegisterSingleton<CHKFunction>();
|
||||||
|
|
||||||
containerRegistry.Register<IDialogService, MaterialDialogService>();
|
containerRegistry.Register<IDialogService, MaterialDialogService>();
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,13 @@
|
||||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="HIKVISION\**" />
|
||||||
|
<EmbeddedResource Remove="HIKVISION\**" />
|
||||||
|
<None Remove="HIKVISION\**" />
|
||||||
|
<Page Remove="HIKVISION\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Images\body-bg.jpg" />
|
<None Remove="Images\body-bg.jpg" />
|
||||||
<None Remove="Images\box-16.jpg" />
|
<None Remove="Images\box-16.jpg" />
|
||||||
|
@ -135,10 +142,6 @@
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="HIKVISION\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\DM_Weight.Commons\DM_Weight.Commons.csproj" />
|
<ProjectReference Include="..\DM_Weight.Commons\DM_Weight.Commons.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -23,8 +23,7 @@ using Unity;
|
||||||
using DM_Weight.msg;
|
using DM_Weight.msg;
|
||||||
using DM_Weight.Views;
|
using DM_Weight.Views;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using DM_Weight.HIKVISION;
|
//using PreviewDemo;
|
||||||
using PreviewDemo;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using DM_Weight.Common;
|
using DM_Weight.Common;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
@ -236,8 +235,8 @@ 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
|
||||||
{
|
{
|
||||||
// 储物箱直接开
|
// 储物箱直接开
|
||||||
|
@ -416,7 +415,7 @@ namespace DM_Weight.Port
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
int i = 10;
|
int i = 15;
|
||||||
public async void GetDrawerStatus()
|
public async void GetDrawerStatus()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -521,7 +520,7 @@ namespace DM_Weight.Port
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
SpeakAsync("请关闭抽屉");
|
SpeakAsync("请关闭抽屉");
|
||||||
i = 10;
|
i = 15;
|
||||||
}
|
}
|
||||||
// 继续监听抽屉状态
|
// 继续监听抽屉状态
|
||||||
await Task.Delay(200);
|
await Task.Delay(200);
|
||||||
|
@ -529,6 +528,7 @@ namespace DM_Weight.Port
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
i = 15;
|
||||||
statue = 2;
|
statue = 2;
|
||||||
if (BoardType == 2)
|
if (BoardType == 2)
|
||||||
{
|
{
|
||||||
|
@ -695,8 +695,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
|
||||||
|
@ -761,7 +761,7 @@ namespace DM_Weight.Port
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
_chkFunction = chkFunction;
|
//_chkFunction = chkFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ using Unity;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using DM_Weight.msg;
|
using DM_Weight.msg;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
|
@ -340,16 +339,16 @@ 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;
|
//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;
|
//_chkFunction = cHKFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DelegateCommand<string> OpenFingerDialog
|
public DelegateCommand<string> OpenFingerDialog
|
||||||
|
@ -553,7 +552,7 @@ 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();
|
//_chkFunction.HIKStopDVRRecord();
|
||||||
Operator = null;
|
Operator = null;
|
||||||
Reviewer = null;
|
Reviewer = null;
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
@ -580,25 +579,25 @@ namespace DM_Weight.ViewModels
|
||||||
//}
|
//}
|
||||||
//#endregion
|
//#endregion
|
||||||
//GetWD();
|
//GetWD();
|
||||||
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是重新创建
|
||||||
|
|
|
@ -24,7 +24,6 @@ using System.Collections.ObjectModel;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
using System.Security.AccessControl;
|
using System.Security.AccessControl;
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
|
@ -65,7 +64,6 @@ namespace DM_Weight.ViewModels
|
||||||
private FingerprintUtil _fingerprintUtil;
|
private FingerprintUtil _fingerprintUtil;
|
||||||
|
|
||||||
private PortUtil _portUtil;
|
private PortUtil _portUtil;
|
||||||
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); } }
|
||||||
|
@ -84,7 +82,7 @@ namespace DM_Weight.ViewModels
|
||||||
get => _portUtil._canBusExsit && !_portUtil.canBusSerial.IsOpen;
|
get => _portUtil._canBusExsit && !_portUtil.canBusSerial.IsOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _fingerMsg= CHKFunction.HKUserId>=0;
|
private bool _fingerMsg = false;// CHKFunction.HKUserId>=0;
|
||||||
|
|
||||||
public bool FingerMsg
|
public bool FingerMsg
|
||||||
{
|
{
|
||||||
|
@ -96,12 +94,12 @@ namespace DM_Weight.ViewModels
|
||||||
get => !_portUtil.fridgeSerial.IsOpen;
|
get => !_portUtil.fridgeSerial.IsOpen;
|
||||||
}
|
}
|
||||||
//录像机登录状态
|
//录像机登录状态
|
||||||
private bool _hikMsg;
|
//private bool _hikMsg;
|
||||||
public bool HIKMsg
|
//public bool HIKMsg
|
||||||
{
|
//{
|
||||||
get=>_hikMsg;
|
// get=>_hikMsg;
|
||||||
set=>SetProperty(ref _hikMsg, value);
|
// set=>SetProperty(ref _hikMsg, value);
|
||||||
}
|
//}
|
||||||
|
|
||||||
//public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, FingerprintUtil fingerprintUtil)
|
//public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, FingerprintUtil fingerprintUtil)
|
||||||
//{
|
//{
|
||||||
|
@ -110,11 +108,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 +353,6 @@ _exitCommand ??= new DelegateCommand(Exit);
|
||||||
|
|
||||||
void Exit()
|
void Exit()
|
||||||
{
|
{
|
||||||
_chkFunction.HIKLoginOut();
|
|
||||||
Process.GetCurrentProcess().Kill();
|
Process.GetCurrentProcess().Kill();
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ using DM_Weight.util;
|
||||||
using DM_Weight.Finger;
|
using DM_Weight.Finger;
|
||||||
using DM_Weight.Views;
|
using DM_Weight.Views;
|
||||||
using Unity;
|
using Unity;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
using log4net.Repository.Hierarchy;
|
using log4net.Repository.Hierarchy;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
|
||||||
|
@ -65,9 +64,8 @@ namespace DM_Weight.ViewModels
|
||||||
private FingerprintUtil _fingerprintUtil;
|
private FingerprintUtil _fingerprintUtil;
|
||||||
IRegionManager _regionManager;
|
IRegionManager _regionManager;
|
||||||
IUnityContainer _container;
|
IUnityContainer _container;
|
||||||
private CHKFunction _cHKFunction;
|
|
||||||
private readonly ILog logger = LogManager.GetLogger(typeof(PortUtil));
|
private readonly ILog logger = LogManager.GetLogger(typeof(PortUtil));
|
||||||
public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, FingerprintUtil fingerprintUtil, CHKFunction cHKFunction)
|
public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, FingerprintUtil fingerprintUtil)
|
||||||
{
|
{
|
||||||
//_portUtil = portUtil;
|
//_portUtil = portUtil;
|
||||||
this.eventAggregator = eventAggregator;
|
this.eventAggregator = eventAggregator;
|
||||||
|
@ -75,7 +73,6 @@ namespace DM_Weight.ViewModels
|
||||||
_fingerprintUtil = fingerprintUtil;
|
_fingerprintUtil = fingerprintUtil;
|
||||||
_regionManager = regionManager;
|
_regionManager = regionManager;
|
||||||
_container = container;
|
_container = container;
|
||||||
_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(() =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,6 @@ using DM_Weight.Port;
|
||||||
using DM_Weight.select;
|
using DM_Weight.select;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,6 @@ using DM_Weight.Port;
|
||||||
using DM_Weight.util;
|
using DM_Weight.util;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using DM_Weight.HIKVISION;
|
|
||||||
|
|
||||||
namespace DM_Weight.ViewModels
|
namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
<TextBlock Visibility="{Binding DrawerPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="抽屉串口连接失败" />
|
<TextBlock Visibility="{Binding DrawerPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="抽屉串口连接失败" />
|
||||||
<TextBlock Visibility="{Binding CanBusPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="can总线串口连接失败" />
|
<TextBlock Visibility="{Binding CanBusPortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="can总线串口连接失败" />
|
||||||
<TextBlock Visibility="{Binding FingerMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="指纹机连接失败" />
|
<TextBlock Visibility="{Binding FingerMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="指纹机连接失败" />
|
||||||
<TextBlock Visibility="{Binding HIKMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="录像机登录失败" />
|
<!--<TextBlock Visibility="{Binding HIKMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="录像机登录失败" />-->
|
||||||
<TextBlock Visibility="{Binding FridgePortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="冰箱串口连接失败" />
|
<TextBlock Visibility="{Binding FridgePortMsg, Converter={StaticResource BooleanToVisibilityConverter}}" Text="冰箱串口连接失败" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in New Issue