You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
388 lines
17 KiB
388 lines
17 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: SetupPtzDlg.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of SetupPtzDlg.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "SetupPtzDlg.h"
|
|
#include "Resource.h"
|
|
#include "..\LgLib\Version.h"
|
|
|
|
CSetupPtzDlg::CSetupPtzDlg()
|
|
{
|
|
|
|
}
|
|
|
|
CSetupPtzDlg::~CSetupPtzDlg()
|
|
{
|
|
|
|
}
|
|
|
|
BOOL CSetupPtzDlg::DoModal( PPROFILE_DATA pProfileData, HWND hParent )
|
|
{
|
|
// get hinstance handle
|
|
HINSTANCE hInstance = (HINSTANCE)::GetWindowLong( hParent, GWL_HINSTANCE );
|
|
|
|
// store data
|
|
m_Data = *pProfileData;
|
|
|
|
// call edit dialog
|
|
if( CGenericWnd::DoModal( hInstance, (LPCTSTR)IDD_SETUP_PTZ_DLG, hParent ) == IDOK )
|
|
{
|
|
// update data
|
|
*pProfileData = m_Data;
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
LRESULT CSetupPtzDlg::OnCommand( WPARAM wParam, LPARAM )
|
|
{
|
|
UINT nCtrlId = LOWORD( wParam );
|
|
|
|
switch( nCtrlId )
|
|
{
|
|
case IDOK:
|
|
if( HIWORD(wParam) == BN_CLICKED )
|
|
OnButtonOk();
|
|
break;
|
|
|
|
case IDCANCEL:
|
|
if( HIWORD(wParam) == BN_CLICKED )
|
|
EndDialog( IDCANCEL );
|
|
break;
|
|
|
|
case IDC_COMBO_PTZ_TYPE:
|
|
if( HIWORD(wParam) == CBN_SELCHANGE )
|
|
OnComboPtzType();
|
|
break;
|
|
|
|
case IDC_CHECK_MIGVAN_SERIAL_NUMBER:
|
|
if( HIWORD(wParam) == BN_CLICKED )
|
|
OnCheckMigvanSerialNumber();
|
|
break;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
LRESULT CSetupPtzDlg::OnInitDialog( WPARAM, LPARAM )
|
|
{
|
|
// init capture parameters
|
|
for( INT i = 0; i < 10; i++ )
|
|
{
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM0 + i, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0) );
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM0 + i, UDM_SETPOS, 0, (LPARAM) MAKELONG( m_Data.PtzRangeZoom[i], 0 ) );
|
|
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TILT0 + i, UDM_SETRANGE, 0, (LPARAM) MAKELONG(359,0) );
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TILT0 + i, UDM_SETPOS, 0, (LPARAM) MAKELONG( m_Data.PtzRangeTilt[i], 0 ) );
|
|
|
|
SendDlgItemMessage( IDC_SPIN_FOCUS0 + i, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0) );
|
|
SendDlgItemMessage( IDC_SPIN_FOCUS0 + i, UDM_SETPOS, 0, (LPARAM) MAKELONG( m_Data.PtzRangeFocus[i], 0 ) );
|
|
}
|
|
|
|
// init camera type
|
|
LPCTSTR pPtzTypes[] =
|
|
{
|
|
_T("Migvan 878"),
|
|
_T("Migvan KD6Z"),
|
|
_T("Forward Vision MIC1-300"),
|
|
_T("JVC TK-S576"),
|
|
_T("Philips G3 AutoDome"),
|
|
_T("Vicon S2000"),
|
|
_T("Pelco D Protocol"),
|
|
_T("Video switcher"),
|
|
_T("3-Track"),
|
|
_T("American Dynamics"),
|
|
_T("Philips G3 AutoDome (OLD)"),
|
|
_T("Via Laser Sensor")
|
|
};
|
|
SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_RESETCONTENT, 0, 0 );
|
|
for( i = 0UL; i < sizeof(pPtzTypes)/sizeof(*pPtzTypes); i++ )
|
|
SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_ADDSTRING, 0, (LONG)pPtzTypes[i] );
|
|
switch( m_Data.PtzType )
|
|
{
|
|
case PTZCT_MIGVAN_878: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 0, 0 ); break;
|
|
case PTZCT_MIGVAN_KDZ6: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 1, 0 ); break;
|
|
case PTZCT_MIC_1300: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 2, 0 ); break;
|
|
case PTZCT_JVC_TKS576: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 3, 0 ); break;
|
|
case PTZCT_PHILIPS_G3AD_NEW:SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 4, 0 ); break;
|
|
case PTZCT_VICON: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 5, 0 ); break;
|
|
case PTZCT_PELCO: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 6, 0 ); break;
|
|
case PTZCT_HEBRON: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 7, 0 ); break;
|
|
case PTZCT_3_TRACK: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 8, 0 ); break;
|
|
case PTZCT_AMERICAN_DYNAMICS:SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 9, 0 ); break;
|
|
case PTZCT_PHILIPS_G3AD_OLD:SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 10, 0 ); break;
|
|
default:
|
|
case PTZCT_LGS: SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_SETCURSEL, 11, 0 ); break;
|
|
}
|
|
|
|
DWORD cbNeeded, cReturned;
|
|
::EnumPorts(NULL, 1, NULL, 0UL, &cbNeeded, &cReturned);
|
|
LPPORT_INFO_1 pPI = (LPPORT_INFO_1)new BYTE[cbNeeded];
|
|
::EnumPorts(NULL, 1, (LPBYTE)pPI, cbNeeded, &cbNeeded, &cReturned);
|
|
// clear port names
|
|
SendDlgItemMessage( IDC_PTZ_COMBO_COMMPORT, CB_RESETCONTENT, 0, 0);
|
|
// add port names
|
|
for(i = 0UL; i < cReturned; i++)
|
|
SendDlgItemMessage( IDC_PTZ_COMBO_COMMPORT, CB_ADDSTRING, 0, (LONG)pPI[i].pName);
|
|
SendDlgItemMessage( IDC_PTZ_COMBO_COMMPORT, CB_SETCURSEL, 0, 0L);
|
|
if( SendDlgItemMessage( IDC_PTZ_COMBO_COMMPORT, CB_SELECTSTRING, -1, (LONG)m_Data.PtzCommPort) == CB_ERR )
|
|
::SetWindowText( GetDlgItem( IDC_PTZ_COMBO_COMMPORT), m_Data.PtzCommPort );
|
|
|
|
delete[] (LPBYTE)pPI;
|
|
|
|
// init migvan controls
|
|
TCHAR pBuffer[MAX_PATH];
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_MAXPRESET, UDM_SETRANGE, 0, (LPARAM) MAKELONG(32000,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_MAXPRESET, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzPresetMax,0));
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_1, EM_LIMITTEXT, 2, 0 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_2, EM_LIMITTEXT, 2, 0 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_3, EM_LIMITTEXT, 2, 0 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_4, EM_LIMITTEXT, 2, 0 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_5, EM_LIMITTEXT, 2, 0 );
|
|
SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_SETCHECK, m_Data.PtzMigvanSerialNumberManual, 0 );
|
|
_sntprintf( pBuffer, MAX_PATH, "%02X", m_Data.PtzMigvanSerialNumber[0] );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_1, WM_SETTEXT, 0, (LPARAM)pBuffer );
|
|
_sntprintf( pBuffer, MAX_PATH, "%02X", m_Data.PtzMigvanSerialNumber[1] );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_2, WM_SETTEXT, 0, (LPARAM)pBuffer );
|
|
_sntprintf( pBuffer, MAX_PATH, "%02X", m_Data.PtzMigvanSerialNumber[2] );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_3, WM_SETTEXT, 0, (LPARAM)pBuffer );
|
|
_sntprintf( pBuffer, MAX_PATH, "%02X", m_Data.PtzMigvanSerialNumber[3] );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_4, WM_SETTEXT, 0, (LPARAM)pBuffer );
|
|
_sntprintf( pBuffer, MAX_PATH, "%02X", m_Data.PtzMigvanSerialNumber[4] );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_5, WM_SETTEXT, 0, (LPARAM)pBuffer );
|
|
|
|
// common camera settings
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_SHIFT, UDM_SETRANGE, 0, (LPARAM) MAKELONG( +30000, -30000 ));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_SHIFT, UDM_SETPOS, 0, (LPARAM) MAKELONG((SHORT)m_Data.PtzPanShift,0));
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_ADDRESS, UDM_SETRANGE, 0, (LPARAM) MAKELONG(255,0) );
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_ADDRESS, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzMic1300Address,0) );
|
|
|
|
// init iris
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAY, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAY, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzIris[0],0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHT, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHT, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzIris[1],0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_HOUR, UDM_SETRANGE, 0, (LPARAM) MAKELONG(23,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_HOUR, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTimeNight/60,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_HOUR, UDM_SETRANGE, 0, (LPARAM) MAKELONG(23,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_HOUR, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTimeDay/60,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_MINUTE, UDM_SETRANGE, 0, (LPARAM) MAKELONG(59,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_MINUTE, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTimeNight%60,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_MINUTE, UDM_SETRANGE, 0, (LPARAM) MAKELONG(59,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_MINUTE, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTimeDay%60,0));
|
|
|
|
// init home & prealarm (preview)
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TILT, UDM_SETRANGE, 0, (LPARAM) MAKELONG(359,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TILT, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTilt,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_SPEED, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_SPEED, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzSpeed,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM, UDM_SETRANGE, 0, (LPARAM) MAKELONG(100,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzZoom,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TIME, UDM_SETRANGE, 0, (LPARAM) MAKELONG(32000,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_TIME, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzTime,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_FULLTIME, UDM_SETRANGE, 0, (LPARAM) MAKELONG(32000,0));
|
|
SendDlgItemMessage( IDC_PTZ_SPIN_FULLTIME, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.PtzFullTime,0));
|
|
|
|
// dopler
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_ANGLE, UDM_SETRANGE, 0, (LPARAM) MAKELONG(360,0));
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_ANGLE, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.DoplerAngle,0));
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_TIMEOUT, UDM_SETRANGE, 0, (LPARAM) MAKELONG(30000,0));
|
|
SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_TIMEOUT, UDM_SETPOS, 0, (LPARAM) MAKELONG(m_Data.DoplerTimeout,0));
|
|
|
|
// update dynamic controls
|
|
OnComboPtzType();
|
|
OnCheckMigvanSerialNumber();
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
void CSetupPtzDlg::OnButtonOk()
|
|
{
|
|
// get capture parameters
|
|
for( INT i = 0; i < 10; i++ )
|
|
{
|
|
m_Data.PtzRangeZoom[i] = SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM0 + i, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzRangeTilt[i] = SendDlgItemMessage( IDC_PTZ_SPIN_TILT0 + i, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzRangeFocus[i] = SendDlgItemMessage( IDC_SPIN_FOCUS0 + i, UDM_GETPOS, 0, 0);
|
|
}
|
|
|
|
// get ptz type
|
|
switch( SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_GETCURSEL, 0, 0 ) )
|
|
{
|
|
case 0: m_Data.PtzType = PTZCT_MIGVAN_878; break;
|
|
case 1: m_Data.PtzType = PTZCT_MIGVAN_KDZ6; break;
|
|
case 2: m_Data.PtzType = PTZCT_MIC_1300; break;
|
|
case 3: m_Data.PtzType = PTZCT_JVC_TKS576; break;
|
|
case 4: m_Data.PtzType = PTZCT_PHILIPS_G3AD_NEW; break;
|
|
case 5: m_Data.PtzType = PTZCT_VICON; break;
|
|
case 6: m_Data.PtzType = PTZCT_PELCO; break;
|
|
case 7: m_Data.PtzType = PTZCT_HEBRON; break;
|
|
case 8: m_Data.PtzType = PTZCT_3_TRACK; break;
|
|
case 9: m_Data.PtzType = PTZCT_AMERICAN_DYNAMICS; break;
|
|
case 10: m_Data.PtzType = PTZCT_PHILIPS_G3AD_OLD; break;
|
|
default:
|
|
case 11: m_Data.PtzType = PTZCT_LGS; break;
|
|
}
|
|
|
|
// get camera port
|
|
SendDlgItemMessage( IDC_PTZ_COMBO_COMMPORT, WM_GETTEXT, MAX_PATH, (LONG)m_Data.PtzCommPort );
|
|
|
|
// get migvan controls
|
|
m_Data.PtzPresetMax = SendDlgItemMessage( IDC_PTZ_SPIN_MAXPRESET, UDM_GETPOS, 0, 0);
|
|
PCHAR pEndHex;
|
|
TCHAR pBuffer[MAX_PATH];
|
|
m_Data.PtzMigvanSerialNumberManual = SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_1, WM_GETTEXT, MAX_PATH, (LPARAM)pBuffer );
|
|
m_Data.PtzMigvanSerialNumber[0] = strtol( pBuffer, &pEndHex, 16 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_2, WM_GETTEXT, MAX_PATH, (LPARAM)pBuffer );
|
|
m_Data.PtzMigvanSerialNumber[1] = strtol( pBuffer, &pEndHex, 16 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_3, WM_GETTEXT, MAX_PATH, (LPARAM)pBuffer );
|
|
m_Data.PtzMigvanSerialNumber[2] = strtol( pBuffer, &pEndHex, 16 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_4, WM_GETTEXT, MAX_PATH, (LPARAM)pBuffer );
|
|
m_Data.PtzMigvanSerialNumber[3] = strtol( pBuffer, &pEndHex, 16 );
|
|
SendDlgItemMessage( IDC_EDIT_MIGVAN_SERIAL_NUMBER_5, WM_GETTEXT, MAX_PATH, (LPARAM)pBuffer );
|
|
m_Data.PtzMigvanSerialNumber[4] = strtol( pBuffer, &pEndHex, 16 );
|
|
|
|
// get common camera settings
|
|
m_Data.PtzPanShift = (int)((short int)LOWORD(SendDlgItemMessage( IDC_PTZ_SPIN_SHIFT, UDM_GETPOS, 0, 0)));
|
|
switch( m_Data.PtzType )
|
|
{
|
|
case PTZCT_MIGVAN_878:
|
|
case PTZCT_MIGVAN_KDZ6: break;
|
|
case PTZCT_MIC_1300:
|
|
case PTZCT_JVC_TKS576:
|
|
case PTZCT_PHILIPS_G3AD_NEW:
|
|
case PTZCT_PHILIPS_G3AD_OLD:
|
|
case PTZCT_AMERICAN_DYNAMICS:
|
|
case PTZCT_VICON:
|
|
case PTZCT_PELCO:
|
|
case PTZCT_HEBRON:
|
|
case PTZCT_3_TRACK: m_Data.PtzMic1300Address = SendDlgItemMessage( IDC_SPIN_PTZ_ADDRESS, UDM_GETPOS, 0, 0 ); break;
|
|
case PTZCT_LGS:
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// get iris
|
|
m_Data.PtzIris[0] = (UCHAR)SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAY, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzIris[1] = (UCHAR)SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHT, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzTimeNight = (WORD)SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_MINUTE, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzTimeNight += (WORD)(60 * SendDlgItemMessage( IDC_PTZ_SPIN_IRISNIGHTTIME_HOUR, UDM_GETPOS, 0, 0));
|
|
m_Data.PtzTimeDay = (WORD)SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_MINUTE, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzTimeDay += (WORD)(60 * SendDlgItemMessage( IDC_PTZ_SPIN_IRISDAYTIME_HOUR, UDM_GETPOS, 0, 0));
|
|
|
|
// get home & prealarm
|
|
m_Data.PtzTilt = SendDlgItemMessage( IDC_PTZ_SPIN_TILT, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzSpeed = SendDlgItemMessage( IDC_PTZ_SPIN_SPEED, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzZoom = (WORD)SendDlgItemMessage( IDC_PTZ_SPIN_ZOOM, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzTime = SendDlgItemMessage( IDC_PTZ_SPIN_TIME, UDM_GETPOS, 0, 0);
|
|
m_Data.PtzFullTime = SendDlgItemMessage( IDC_PTZ_SPIN_FULLTIME, UDM_GETPOS, 0, 0);
|
|
|
|
// dopler
|
|
m_Data.DoplerAngle = (INT)SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_ANGLE, UDM_GETPOS, 0, 0 );
|
|
m_Data.DoplerTimeout = (DWORD)SendDlgItemMessage( IDC_SPIN_PTZ_DOPLER_TIMEOUT, UDM_GETPOS, 0, 0 );
|
|
|
|
EndDialog( IDOK );
|
|
}
|
|
|
|
void CSetupPtzDlg::OnComboPtzType()
|
|
{
|
|
BOOL bCommPortEnable = FALSE;
|
|
BOOL bMigvanEnable = FALSE;
|
|
BOOL bFocusEnable = FALSE;
|
|
BOOL bAddressEnable = FALSE;
|
|
BOOL bDoplerEnable = FALSE;
|
|
|
|
switch( SendDlgItemMessage( IDC_COMBO_PTZ_TYPE, CB_GETCURSEL, 0, 0 ) )
|
|
{
|
|
case 0:
|
|
case 1:
|
|
bCommPortEnable = TRUE;
|
|
bMigvanEnable = TRUE;
|
|
break;
|
|
case 2:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 3:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
bFocusEnable = TRUE;
|
|
break;
|
|
case 4:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 5:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 6:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 7:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 8:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
bDoplerEnable = TRUE;
|
|
break;
|
|
case 9:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 10:
|
|
bCommPortEnable = TRUE;
|
|
bAddressEnable = TRUE;
|
|
break;
|
|
case 11:
|
|
bFocusEnable = TRUE;
|
|
break;
|
|
}
|
|
|
|
// comm port settings
|
|
::EnableWindow( GetDlgItem( IDC_PTZ_COMBO_COMMPORT ), bCommPortEnable );
|
|
// migvan settings
|
|
::EnableWindow( GetDlgItem( IDC_PTZ_EDIT_MAXPRESET ), bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_CHECK_MIGVAN_SERIAL_NUMBER ), bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_1 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) && bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_2 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) && bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_3 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) && bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_4 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) && bMigvanEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_5 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) && bMigvanEnable );
|
|
// mic1300 settings
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_PTZ_ADDRESS ), bAddressEnable );
|
|
//focus
|
|
for( INT i = 0; i < 10; i++ )
|
|
{
|
|
::EnableWindow( GetDlgItem( IDC_PTZ_EDIT_TILT0 + i), !bDoplerEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_FOCUS0 + i), bFocusEnable );
|
|
}
|
|
// dopler settings
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_PTZ_DOPLER_ANGLE ), bDoplerEnable );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_PTZ_DOPLER_TIMEOUT ), bDoplerEnable );
|
|
}
|
|
|
|
void CSetupPtzDlg::OnCheckMigvanSerialNumber()
|
|
{
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_1 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_2 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_3 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_4 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) );
|
|
::EnableWindow( GetDlgItem( IDC_EDIT_MIGVAN_SERIAL_NUMBER_5 ), SendDlgItemMessage( IDC_CHECK_MIGVAN_SERIAL_NUMBER, BM_GETCHECK, 0, 0 ) );
|
|
}
|