private void RunRoutePatrolsBtn_Click(object sender, EventArgs e) { NETDEV_PTZ_TRACK_INFO_S stTrackCruiseInfo = new NETDEV_PTZ_TRACK_INFO_S(); Int32 iRet = NETDEVSDK.NETDEV_PTZGetTrackCruise(m_lpDevHandle, m_iChannelID, ref stTrackCruiseInfo); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route"); iRet = NETDEVSDK.NETDEV_PTZTrackCruise(m_lpDevHandle, m_iChannelID, (int)NETDEV_PTZ_E.NETDEV_PTZ_TRACKCRUISE, stTrackCruiseInfo.TrackName); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Start Route patrol", NETDEVSDK.NETDEV_GetLastError()); } else { this.m_curRealPlayPanel.m_trackStatus = true; m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Start Route patrol"); } return; }
private void StopPatrolsBtn_Click(object sender, EventArgs e) { if (false == this.m_curRealPlayPanel.m_trackStatus) { MessageBox.Show("Connot Tracking", "warning"); return; } NETDEV_PTZ_TRACK_INFO_S stTrackCruiseInfo = new NETDEV_PTZ_TRACK_INFO_S(); int iRet = NETDEVSDK.NETDEV_PTZGetTrackCruise(m_lpDevHandle, m_iChannelID, ref stTrackCruiseInfo); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route"); iRet = NETDEVSDK.NETDEV_PTZTrackCruise(m_lpDevHandle, m_iChannelID, (int)NETDEV_PTZ_E.NETDEV_PTZ_TRACKCRUISESTOP, stTrackCruiseInfo.TrackName); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Stop Route patrol fail", NETDEVSDK.NETDEV_GetLastError()); return; } else { this.m_curRealPlayPanel.m_trackStatus = false; m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Stop Route patrol"); } return; }
private void GetRoutePatrolsBtn_Click(object sender, EventArgs e) { NETDEV_PTZ_TRACK_INFO_S stTrackCruiseInfo = new NETDEV_PTZ_TRACK_INFO_S(); Int32 iRet = NETDEVSDK.NETDEV_PTZGetTrackCruise(m_lpDevHandle, m_iChannelID, ref stTrackCruiseInfo); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route fail", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route"); this.routePatrolsNameText.Text = stTrackCruiseInfo.TrackName; return; }
private void RecordEndBtn_Click(object sender, EventArgs e) { NETDEV_PTZ_TRACK_INFO_S stTrackCruiseInfo = new NETDEV_PTZ_TRACK_INFO_S(); int iRet = NETDEVSDK.NETDEV_PTZGetTrackCruise(m_lpDevHandle, m_iChannelID, ref stTrackCruiseInfo); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route"); iRet = NETDEVSDK.NETDEV_PTZTrackCruise(m_lpDevHandle, m_iChannelID, (int)NETDEV_PTZ_E.NETDEV_PTZ_TRACKCRUISERECSTOP, stTrackCruiseInfo.TrackName); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Stop Recording Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Stop Recording Route"); return; }
private void RecordStartBtn_Click(object sender, EventArgs e) { NETDEV_PTZ_TRACK_INFO_S stTrackCruiseInfo = new NETDEV_PTZ_TRACK_INFO_S(); int iRet = NETDEVSDK.NETDEV_PTZGetTrackCruise(m_lpDevHandle, m_iChannelID, ref stTrackCruiseInfo); if (NETDEVSDK.TRUE != iRet) { /* Get error codes */ m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Get Route"); if (0 == stTrackCruiseInfo.dwTrackNum) { /* Use PTZ to record route */ iRet = NETDEVSDK.NETDEV_PTZTrackCruise(m_lpDevHandle, m_iChannelID, (int)NETDEV_PTZ_E.NETDEV_PTZ_TRACKCRUISEADD, stTrackCruiseInfo.TrackName); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Creat Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Creat Route"); stTrackCruiseInfo.dwTrackNum++; } iRet = NETDEVSDK.NETDEV_PTZTrackCruise(m_lpDevHandle, m_iChannelID, (int)NETDEV_PTZ_E.NETDEV_PTZ_TRACKCRUISEREC, stTrackCruiseInfo.TrackName); if (NETDEVSDK.TRUE != iRet) { m_oNetDemo.showFailLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Start Recording Route", NETDEVSDK.NETDEV_GetLastError()); return; } m_oNetDemo.showSuccessLogInfo(m_deviceInfoList[m_curSelectedTreeDeviceIndex].m_ip + " chl:" + (m_curSelectedTreeChannelIndex + 1), "Start Recording Route"); return; }