반응형
- Zoom : nZoomValuer값에 따라 - (Near), + (Far) 동작.
public void PTZ_Zoom(int nZoomValue) { String strPreURI = "http://"; String strIPAddress = _strDeviceIP; String strPort = _nDeviceHttpPort.ToString(); String strFunction = "/stw-cgi/ptzcontrol.cgi?msubmenu=absolute&action=control&Zoom=" + nZoomValue.ToString(); String strQuery = strPreURI + strIPAddress + ":" + strPort + strFunction; String strUserID = _strUserID; String strUserPWD = _strUserPWD; Console.WriteLine(strQuery); // Query 출력 WebRequest request = WebRequest.Create(strQuery); // WebRequest 생성. request.Credentials = new NetworkCredential(strUserID, strUserPWD); // 계정 생성. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Response 호출. Console.WriteLine(response.StatusDescription); // 응답 결과 출력 response.Close(); } |
- Focus Mode : Manual, Auto, OneShotAutoFocus
public void Focus_Mode(eSUNAPI_FocusMode eModeValue) { String strModeValue = ""; if (eModeValue == eSUNAPI_FocusMode.OneShotAutoFocus) strModeValue = "OneShotAutoFocus"; else if (eModeValue == eSUNAPI_FocusMode.Manual) strModeValue = "Manual"; else strModeValue = "Auto"; String strPreURI = "http://"; String strIPAddress = _strDeviceIP; String strPort = _nDeviceHttpPort.ToString(); String strFunction = "/stw-cgi/image.cgi?msubmenu=focus&action=set&Mode=" + strModeValue; String strQuery = strPreURI + strIPAddress + ":" + strPort + strFunction; String strUserID = _strUserID; String strUserPWD = _strUserPWD; Console.WriteLine(strQuery); // Query 출력 WebRequest request = WebRequest.Create(strQuery); // WebRequest 생성. request.Credentials = new NetworkCredential(strUserID, strUserPWD); // 계정 생성. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Response 호출. Console.WriteLine(response.StatusDescription); // 응답 결과 출력 response.Close(); } |
- Focus Continuous : Near, Far, Stop
public void Focus_Continuous(eSUNAPI_FocusContinuous eFocusValue) { String strFocusValue = ""; if(eFocusValue == eSUNAPI_FocusContinuous.Far) strFocusValue = "Far"; else if (eFocusValue == eSUNAPI_FocusContinuous.Near) strFocusValue = "Near"; else strFocusValue = "Stop"; String strPreURI = "http://"; String strIPAddress = _strDeviceIP; String strPort = _nDeviceHttpPort.ToString(); String strFunction = "/stw-cgi/ptzcontrol.cgi?msubmenu=continuous&action=control&Focus=" + strFocusValue.ToString(); String strQuery = strPreURI + strIPAddress + ":" + strPort + strFunction; String strUserID = _strUserID; String strUserPWD = _strUserPWD; Console.WriteLine(strQuery); // Query 출력 WebRequest request = WebRequest.Create(strQuery); // WebRequest 생성. request.Credentials = new NetworkCredential(strUserID, strUserPWD); // 계정 생성. HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // Response 호출. Console.WriteLine(response.StatusDescription); // 응답 결과 출력 response.Close(); } |
반응형
'IT > C#' 카테고리의 다른 글
[PostgreSQL] 네트워크 접속 설정 방법 (외부 접속 설정) (0) | 2023.07.12 |
---|---|
[한화 비전 - SUNAPI] PTZ, Preset (0) | 2023.07.06 |
[한화 비전 - SUNAPI] RTSP 영상 수신 (with OpenCVSharp) (0) | 2023.07.05 |
[한화 비전 - SUNAPI] RTSP - SMP Address (0) | 2023.07.04 |
[한화 비전 - SUNAPI] SnapShot (0) | 2023.07.04 |