|
|
|
@ -52,6 +52,8 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
private WebSocketBusiness webSocketBusiness;
|
|
|
|
|
|
|
|
|
|
private CabinetInfoBusiness cabinetInfoBusiness;
|
|
|
|
|
|
|
|
|
|
private AppConfig _appConfig;
|
|
|
|
|
|
|
|
|
|
private CHCNetSDK.RemoteConfigCallback _callback;
|
|
|
|
@ -80,6 +82,7 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
inspModeBusiness = App.ServiceProvider.GetService<InspModeBusiness>();
|
|
|
|
|
fixedPointBusiness = App.ServiceProvider.GetService<FixedPointBusiness>();
|
|
|
|
|
webSocketBusiness = App.ServiceProvider.GetService<WebSocketBusiness>();
|
|
|
|
|
cabinetInfoBusiness = App.ServiceProvider.GetService<CabinetInfoBusiness>();
|
|
|
|
|
|
|
|
|
|
autoModeBusiness.CaptureAlarmPictureEvent += CapturePicture;
|
|
|
|
|
autoModeBusiness.GimbaRotationControlEvent += GimbaRotationControl;
|
|
|
|
@ -594,13 +597,43 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Marshal.FreeHGlobal(ptrPtzCfg);
|
|
|
|
|
_log.Info("云台旋转控制成功!");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Marshal.FreeHGlobal(ptrPtzCfg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//bool isFlag = true;
|
|
|
|
|
//while (isFlag)
|
|
|
|
|
//{
|
|
|
|
|
// UInt32 dwReturn = 0;
|
|
|
|
|
// Int32 nSize = Marshal.SizeOf(m_struPtzCfg);
|
|
|
|
|
// IntPtr ptrPtzCfg = Marshal.AllocHGlobal(nSize);
|
|
|
|
|
// Marshal.StructureToPtr(m_struPtzCfg, ptrPtzCfg, false);
|
|
|
|
|
// //获取参数失败
|
|
|
|
|
// if (!CHCNetSDK.NET_DVR_GetDVRConfig(m_lUserID, CHCNetSDK.NET_DVR_GET_PTZPOS, -1, ptrPtzCfg, (UInt32)nSize, ref dwReturn))
|
|
|
|
|
// {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// m_struPtzCfg = (CHCNetSDK.NET_DVR_PTZPOS)Marshal.PtrToStructure(ptrPtzCfg, typeof(CHCNetSDK.NET_DVR_PTZPOS));
|
|
|
|
|
// //成功获取显示ptz参数
|
|
|
|
|
// ushort wPanPos2 = Convert.ToUInt16(Convert.ToString(m_struPtzCfg.wPanPos, 16));
|
|
|
|
|
|
|
|
|
|
// ushort wTiltPos2 = Convert.ToUInt16(Convert.ToString(m_struPtzCfg.wTiltPos, 16));
|
|
|
|
|
// ushort wZoomPos2 = Convert.ToUInt16(Convert.ToString(m_struPtzCfg.wZoomPos, 16));
|
|
|
|
|
// if (Convert.ToString(wPanPos2 * 1f) == wPanPos && Convert.ToString(wTiltPos2 * 1f) == wTiltPos && Convert.ToString(wZoomPos2 * 1f) == wZoomPos)
|
|
|
|
|
// {
|
|
|
|
|
// isFlag = false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// Task.Delay(1000).Wait();
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -741,5 +774,10 @@ namespace SlnMesnac.WPF.ViewModel
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void QueryCabinetName(int cabinetCode, out string cabinetName)
|
|
|
|
|
{
|
|
|
|
|
cabinetInfoBusiness.QueryCabinetName(cabinetCode, out cabinetName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|