change - 添加最高温度报警,并截图保存

master
wenjy 3 months ago
parent 93bbdab177
commit 7c176833a5

@ -5,6 +5,7 @@ using SlnMesnac.WPF.ViewModel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
@ -40,6 +41,7 @@ namespace SlnMesnac.WPF.Page
public CHCNetSDK.NET_DVR_PTZPOS m_struPtzCfg; public CHCNetSDK.NET_DVR_PTZPOS m_struPtzCfg;
private bool bAuto = false; private bool bAuto = false;
private CHCNetSDK.RemoteConfigCallback _callback; private CHCNetSDK.RemoteConfigCallback _callback;
private CHCNetSDK.MSGCallBack_V31 m_falarmData_V31 = null;
private string DVRIPAddress = "192.168.1.64"; //设备IP地址或者域名 Device IP private string DVRIPAddress = "192.168.1.64"; //设备IP地址或者域名 Device IP
private Int16 DVRPortNumber = 8000; //设备服务端口号 Device Port private Int16 DVRPortNumber = 8000; //设备服务端口号 Device Port
@ -130,6 +132,30 @@ namespace SlnMesnac.WPF.Page
realTemperature.fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1); realTemperature.fAverageTemperature = (float)Math.Round(ret.struLinePolygonThermCfg.fAverageTemperature, 1);
realTemperature.fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1); realTemperature.fTemperatureDiff = (float)Math.Round(ret.struLinePolygonThermCfg.fTemperatureDiff, 1);
indexControlViewModel.RefreshRealTemperature(realTemperature); indexControlViewModel.RefreshRealTemperature(realTemperature);
string sJpegPicFileName = $"F:\\桌面\\赛轮智慧热电项目\\日志信息\\picture\\{DateTime.Now.ToString("yyyyMMddHHmmssffff")}.jpg";
if(realTemperature.fMaxTemperature > 65)
{
int lChannel = 2;
CHCNetSDK.NET_DVR_JPEGPARA lpJpegPara = new CHCNetSDK.NET_DVR_JPEGPARA();
lpJpegPara.wPicQuality = 0; //图像质量 Image quality
lpJpegPara.wPicSize = 0xff; //抓图分辨率 Picture size: 2- 4CIF0xff- Auto(使用当前码流分辨率)抓图分辨率需要设备支持更多取值请参考SDK文档
//JPEG抓图 Capture a JPEG picture
if (!CHCNetSDK.NET_DVR_CaptureJPEGPicture(m_lUserID, lChannel, ref lpJpegPara, sJpegPicFileName))
{
var str = "NET_DVR_CaptureJPEGPicture failed, error code= " + NET_DVR_GetLastError();
DebugInfo(str);
return;
}
else
{
var str = "Successful to capture the JPEG file and the saved file is " + sJpegPicFileName;
DebugInfo(str);
}
}
} }

Loading…
Cancel
Save