|
|
@ -55,12 +55,14 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
public Int32 Scenery_RealHandle = -1;
|
|
|
|
public Int32 Scenery_RealHandle = -1;
|
|
|
|
public Int32 Thermal_RealHandle = -1;
|
|
|
|
public Int32 Thermal_RealHandle = -1;
|
|
|
|
|
|
|
|
|
|
|
|
private const string DVRIPAddress = "192.168.1.64"; //设备IP地址或者域名 Device IP
|
|
|
|
//private const string DVRIPAddress = "192.168.2.64"; //设备IP地址或者域名 Device IP
|
|
|
|
private const Int16 DVRPortNumber = 8000; //设备服务端口号 Device Port
|
|
|
|
//private const Int16 DVRPortNumber = 8000; //设备服务端口号 Device Port
|
|
|
|
private const string DVRUserName = "admin"; //设备登录用户名 User name to login
|
|
|
|
//private const string DVRUserName = "admin"; //设备登录用户名 User name to login
|
|
|
|
private const string DVRPassword = "haiwei@2024"; //设备登录密码 Password to login
|
|
|
|
//private const string DVRPassword = "haiwei@2024"; //设备登录密码 Password to login
|
|
|
|
|
|
|
|
|
|
|
|
public IndexControlViewModel()
|
|
|
|
public IndexControlViewModel()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_log = App.ServiceProvider.GetService<SerilogHelper>();
|
|
|
|
_log = App.ServiceProvider.GetService<SerilogHelper>();
|
|
|
|
_callback = new CHCNetSDK.RemoteConfigCallback(GetThermInfoCallback);
|
|
|
|
_callback = new CHCNetSDK.RemoteConfigCallback(GetThermInfoCallback);
|
|
|
@ -71,6 +73,11 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
|
|
|
|
|
|
|
|
RefreshTrackMotorAddress();
|
|
|
|
RefreshTrackMotorAddress();
|
|
|
|
|
|
|
|
}catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_log.Error("巡检控制系统初始化失败",ex);
|
|
|
|
|
|
|
|
MessageBox.Show($"巡检控制系统初始化失败:{ex.Message}");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 参数定义
|
|
|
|
#region 参数定义
|
|
|
@ -115,7 +122,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_lUserID = CHCNetSDK.NET_DVR_Login_V30(DVRIPAddress, DVRPortNumber, DVRUserName, DVRPassword, ref DeviceInfo);
|
|
|
|
m_lUserID = CHCNetSDK.NET_DVR_Login_V30(_appConfig.cameraIp, _appConfig.cameraPort, _appConfig.cameraUserName, _appConfig.cameraPassword, ref DeviceInfo);
|
|
|
|
|
|
|
|
|
|
|
|
if (m_lUserID < 0)
|
|
|
|
if (m_lUserID < 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -168,11 +175,15 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
public void GetThermInfoCallback(uint dwType, IntPtr lpBuffer, uint dwBufLen, IntPtr pUserData)
|
|
|
|
public void GetThermInfoCallback(uint dwType, IntPtr lpBuffer, uint dwBufLen, IntPtr pUserData)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ret = Marshal.PtrToStructure<CHCNetSDK.NET_DVR_THERMOMETRY_UPLOAD>(lpBuffer);
|
|
|
|
var ret = Marshal.PtrToStructure<CHCNetSDK.NET_DVR_THERMOMETRY_UPLOAD>(lpBuffer);
|
|
|
|
|
|
|
|
if (autoModeBusiness != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMaxTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMaxTemperature, 1);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMaxTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMaxTemperature, 1);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMinTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMinTemperature);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fMinTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMinTemperature);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1);
|
|
|
|
autoModeBusiness._realTemperatureInfo.fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.RealTemperature = new RealTemperatureInfo()
|
|
|
|
this.RealTemperature = new RealTemperatureInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fMaxTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMaxTemperature, 1),
|
|
|
|
fMaxTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fMaxTemperature, 1),
|
|
|
|