Old fashion design for PC-104
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.

487 lines
14 KiB

4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
4 years ago
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
4 years ago
​
​
4 years ago
4 years ago
4 years ago
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: DPelco.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of DPelco.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #ifdef __BORLANDC__
  16. #include "..\LgLib\Device\DPelco.h"
  17. #else
  18. #include "DPelco.h"
  19. #endif
  20. #define POSITION_QUALYTY 2
  21. #define MAX_NO_REPLY_COUNT 20
  22. #define MAX_NOT_IN_POSITION_COUNT 1
  23. #define DELAY_BEFORE_GET_POSITION 500
  24. typedef enum PELCO_SETTING_TYPE
  25. {
  26. P_ST_NONE = -1,
  27. P_ST_MAX_NO_REPLY_COUNT = 0,
  28. P_ST_DELAY_BEFORE_GET_POSITION,
  29. P_ST_MAX_OPTICAL_ZOOM,
  30. P_ST_PAN_REVERSE
  31. }PELCO_SETTING_TYPE;
  32. LPCTSTR m_pPelco_Setting[] =
  33. {
  34. { "MAX_NO_REPLY_COUNT" },
  35. { "DELAY_BEFORE_GET_POSITION" },
  36. ( "MAX_OPTICAL_ZOOM" ),
  37. { "PAN_REVERSE"}
  38. };
  39. BOOL CLgDevicePTZPelco::LoadUserSettings( void ) {
  40. // read delay number
  41. FILE *pFile = fopen( "PELCO.INI", "rt" );
  42. if( !pFile ) return FALSE;
  43. CHAR pLine[MAX_PATH];
  44. while( fgets( pLine, MAX_PATH, pFile ) )
  45. {
  46. PELCO_SETTING_TYPE eType = P_ST_NONE;
  47. PCHAR pTemp = NULL;
  48. for( INT i = 0; i < 4; i++ )
  49. {
  50. pTemp = strstr( pLine, m_pPelco_Setting[i] );
  51. if( pTemp )
  52. {
  53. eType = (PELCO_SETTING_TYPE)i;
  54. pTemp = strstr( pTemp, "=" );
  55. if( pTemp )
  56. pTemp = strtok( pTemp + 1, " \t\n\r" );
  57. break;
  58. }
  59. }
  60. if( eType == P_ST_NONE || !pTemp )
  61. continue;
  62. switch( eType )
  63. {
  64. case P_ST_MAX_NO_REPLY_COUNT: {
  65. PELCO_MAX_NO_REPLY_COUNT = atoi( pTemp ); break;
  66. };
  67. case P_ST_MAX_OPTICAL_ZOOM: {
  68. PELCO_MAX_OPTICAL_ZOOM = atoi( pTemp ); break;
  69. };
  70. case P_ST_PAN_REVERSE: {
  71. PELCO_PAN_REVERSE = atoi( pTemp ); break;
  72. };
  73. }
  74. }
  75. fclose( pFile );
  76. return TRUE;
  77. }
  78. CLgDevicePTZPelco::CLgDevicePTZPelco()
  79. {
  80. m_nMode = CMD_INIT;
  81. m_nStage = STAGE_INIT_TURN_ON;
  82. m_nNoReplyCount = 0;
  83. m_nNotInPositionCount = 0;
  84. memset( &m_PtzState, 0, sizeof(m_PtzState) );
  85. m_bPause = FALSE;
  86. PELCO_MAX_NO_REPLY_COUNT = 20; // Default for Replaying Camera
  87. PELCO_DELAY_BEFORE_GET_POSITION = 500; // Default for Replaying Camera
  88. PELCO_MAX_OPTICAL_ZOOM = 0x2C85;
  89. LoadUserSettings();
  90. }
  91. CLgDevicePTZPelco::~CLgDevicePTZPelco()
  92. {
  93. }
  94. BOOL CLgDevicePTZPelco::CmdInit()
  95. {
  96. // check availibility
  97. return DoCmd( CMD_INIT );
  98. }
  99. void CLgDevicePTZPelco::OnPerformCmd()
  100. {
  101. // ready for new message
  102. ReleaseCmd();
  103. // ready to process new message
  104. m_nMode = CMD_NONE;
  105. }
  106. BOOL CLgDevicePTZPelco::WriteProc( void *pProtocol, PLONG pTimeout )
  107. {
  108. BYTE pSendBuffer[ CProtocolPTZPelco::MAX_COMMAND_SIZE ];
  109. BYTE nSendCount = 0;
  110. // cast to protocol
  111. CProtocolPTZPelco *pProtocolPTZ = (CProtocolPTZPelco*)pProtocol;
  112. // set working address
  113. pProtocolPTZ->SetAddress( GetAddress() );
  114. if( m_bPause )
  115. {
  116. m_bPause = FALSE;
  117. *pTimeout = 100L;
  118. return FALSE;
  119. }
  120. // check input command
  121. if( m_nMode == CMD_NONE )
  122. {
  123. switch( GetCmd() )
  124. {
  125. case CMD_INIT:
  126. m_nMode = CMD_INIT;
  127. m_nStage = STAGE_INIT_TURN_ON;
  128. /*switch( m_nStage )
  129. {
  130. case STAGE_INIT_TURN_ON:
  131. nSendCount += PTZ_PELCO::BuildMove( pSendBuffer, GetAddress(), m_PtzState );
  132. pProtocolPTZ->SetResponseSize( 4 );
  133. break;
  134. case STAGE_INIT_AUTO_FOCUS:
  135. nSendCount += PTZ_PELCO::BuildAutoFocus( pSendBuffer, GetAddress(), 0 ); // 0 - On , 1 - Off
  136. pProtocolPTZ->SetResponseSize( 4 );
  137. break;
  138. case STAGE_INIT_AUTO_IRIS:
  139. nSendCount += PTZ_PELCO::BuildAutoIris( pSendBuffer, GetAddress(), 0 );
  140. pProtocolPTZ->SetResponseSize( 4 );
  141. break;
  142. case STAGE_INIT_AUTO_GAIN_CONTROL:
  143. nSendCount += PTZ_PELCO::BuildAutoGainControl( pSendBuffer, GetAddress(), 0 );
  144. pProtocolPTZ->SetResponseSize( 4 );
  145. break;
  146. case STAGE_INIT_BACKLIGHT_COMPENSATION:
  147. nSendCount += PTZ_PELCO::BuildBacklightCompensation( pSendBuffer, GetAddress(), 0 );
  148. pProtocolPTZ->SetResponseSize( 4 );
  149. break;
  150. case STAGE_INIT_WHITE_BALANCE:
  151. nSendCount += PTZ_PELCO::BuildWhiteBalance( pSendBuffer, GetAddress(), 2 ); // 0 - On, 1 - Off, 2 - Auto
  152. pProtocolPTZ->SetResponseSize( 4 );
  153. break;
  154. }*/
  155. break;
  156. case CMD_GET_PTZ:
  157. m_nMode = CMD_GET_PTZ;
  158. m_nStage = STAGE_GET_PAN_POSITION;
  159. break;
  160. case CMD_SET_PTZ:
  161. // validate positions
  162. PTZ_PELCO::ValidatePan( m_Position.dPan );
  163. PTZ_PELCO::ValidateTilt( m_Position.dTilt );
  164. PTZ_PELCO::ValidateZoom( m_Position.dZoom );
  165. m_nMode = CMD_SET_PTZ;
  166. m_nStage = STAGE_SET_TILT_POSITION;
  167. m_nNotInPositionCount = 0;
  168. break;
  169. case CMD_MOVE_TILT:
  170. m_nMode = CMD_MOVE_TILT;
  171. break;
  172. case CMD_MOVE_PAN:
  173. m_nMode = CMD_MOVE_PAN;
  174. break;
  175. case CMD_MOVE_ZOOM:
  176. m_nMode = CMD_MOVE_ZOOM;
  177. break;
  178. case CMD_NONE:
  179. // no new commands
  180. break;
  181. case CMD_SET_IRIS:
  182. case CMD_SET_FOCUS:
  183. case CMD_WIPER:
  184. default:
  185. //command unsupported
  186. OnPerformCmd();
  187. OnEvtCommandError( m_nMode, _T("UNSUPPORTED") );
  188. break;
  189. }
  190. }
  191. // fill packet depend on command
  192. switch( m_nMode )
  193. {
  194. case CMD_INIT:
  195. switch( m_nStage )
  196. {
  197. case STAGE_INIT_TURN_ON:
  198. nSendCount += PTZ_PELCO::BuildMove( pSendBuffer, GetAddress(), m_PtzState );
  199. pProtocolPTZ->SetResponseSize( 4 );
  200. break;
  201. case STAGE_INIT_AUTO_FOCUS:
  202. nSendCount += PTZ_PELCO::BuildAutoFocus( pSendBuffer, GetAddress(), 0 ); // 0 - On , 1 - Off
  203. pProtocolPTZ->SetResponseSize( 4 );
  204. break;
  205. case STAGE_INIT_AUTO_IRIS:
  206. nSendCount += PTZ_PELCO::BuildAutoIris( pSendBuffer, GetAddress(), 0 );
  207. pProtocolPTZ->SetResponseSize( 4 );
  208. break;
  209. case STAGE_INIT_AUTO_GAIN_CONTROL:
  210. nSendCount += PTZ_PELCO::BuildAutoGainControl( pSendBuffer, GetAddress(), 0 );
  211. pProtocolPTZ->SetResponseSize( 4 );
  212. break;
  213. case STAGE_INIT_BACKLIGHT_COMPENSATION:
  214. nSendCount += PTZ_PELCO::BuildBacklightCompensation( pSendBuffer, GetAddress(), 0 );
  215. pProtocolPTZ->SetResponseSize( 4 );
  216. break;
  217. case STAGE_INIT_WHITE_BALANCE:
  218. nSendCount += PTZ_PELCO::BuildWhiteBalance( pSendBuffer, GetAddress(), 2 ); // 0 - On, 1 - Off, 2 - Auto
  219. pProtocolPTZ->SetResponseSize( 4 );
  220. break;
  221. }
  222. break;
  223. case CMD_SET_PTZ:
  224. switch( m_nStage )
  225. {
  226. case STAGE_SET_TILT_POSITION:
  227. // ask for pan position
  228. nSendCount += PTZ_PELCO::BuildSetTilt( pSendBuffer, GetAddress(), PTZ_PELCO::Degree2Tilt( m_Position.dTilt ) );
  229. // set reply size
  230. pProtocolPTZ->SetResponseSize( 4 );
  231. break;
  232. case STAGE_SET_PAN_POSITION:
  233. // ask for pan position
  234. nSendCount += PTZ_PELCO::BuildSetPan( pSendBuffer, GetAddress(), PTZ_PELCO::Degree2Pan( m_Position.dPan ,PELCO_PAN_REVERSE) );
  235. // set reply size
  236. pProtocolPTZ->SetResponseSize( 4 );
  237. break;
  238. case STAGE_SET_ZOOM_POSITION:
  239. // ask for pan position
  240. nSendCount += PTZ_PELCO::BuildSetZoom( pSendBuffer, GetAddress(), PTZ_PELCO::Percent2Zoom( m_Position.dZoom, PELCO_MAX_OPTICAL_ZOOM ) );
  241. // set reply size
  242. pProtocolPTZ->SetResponseSize( 4 );
  243. break;
  244. case STAGE_GET_PAN_POSITION:
  245. // ask for pan position
  246. nSendCount += PTZ_PELCO::BuildGetPan( pSendBuffer, GetAddress() );
  247. // set reply size
  248. pProtocolPTZ->SetResponseSize( 7 );
  249. break;
  250. case STAGE_GET_TILT_POSITION:
  251. // ask for pan position
  252. nSendCount += PTZ_PELCO::BuildGetTilt( pSendBuffer, GetAddress() );
  253. // set reply size
  254. pProtocolPTZ->SetResponseSize( 7 );
  255. break;
  256. case STAGE_GET_ZOOM_POSITION:
  257. // ask for pan position
  258. nSendCount += PTZ_PELCO::BuildGetZoom( pSendBuffer, GetAddress() );
  259. // set reply size
  260. pProtocolPTZ->SetResponseSize( 7 );
  261. break;
  262. }
  263. break;
  264. case CMD_GET_PTZ:
  265. switch( m_nStage )
  266. {
  267. case STAGE_GET_PAN_POSITION:
  268. // ask for pan position
  269. nSendCount += PTZ_PELCO::BuildGetPan( pSendBuffer, GetAddress() );
  270. // set reply size
  271. pProtocolPTZ->SetResponseSize( 7 );
  272. break;
  273. case STAGE_GET_TILT_POSITION:
  274. // ask for pan position
  275. nSendCount += PTZ_PELCO::BuildGetTilt( pSendBuffer, GetAddress() );
  276. // set reply size
  277. pProtocolPTZ->SetResponseSize( 7 );
  278. break;
  279. case STAGE_GET_ZOOM_POSITION:
  280. // ask for pan position
  281. nSendCount += PTZ_PELCO::BuildGetZoom( pSendBuffer, GetAddress() );
  282. // set reply size
  283. pProtocolPTZ->SetResponseSize( 7 );
  284. break;
  285. }
  286. break;
  287. /* case CMD_INIT:
  288. // ask for pan position
  289. nSendCount += PTZ_PELCO::BuildMove( pSendBuffer, GetAddress(), m_PtzState );
  290. // set reply size
  291. pProtocolPTZ->SetResponseSize( 4 );
  292. break;
  293. */
  294. case CMD_MOVE_TILT:
  295. nSendCount += PTZ_PELCO::BuildTilt( pSendBuffer, GetAddress(), m_MoveTilt.dSpeed > 0 ? ( m_MoveTilt.bUp ? PTZ_PELCO::TILT_UP : PTZ_PELCO::TILT_DOWN ) : PTZ_PELCO::TILT_STOP, PTZ_PELCO::Percent2TiltSpeed( m_MoveTilt.dSpeed ), m_PtzState );
  296. // set reply size
  297. pProtocolPTZ->SetResponseSize( 4 );
  298. break;
  299. case CMD_MOVE_PAN:
  300. // ask for pan position
  301. nSendCount += PTZ_PELCO::BuildPan( pSendBuffer, GetAddress(), m_MovePan.dSpeed > 0 ? ( m_MovePan.bRight ? PTZ_PELCO::PAN_RIGHT : PTZ_PELCO::PAN_LEFT ) : PTZ_PELCO::PAN_STOP, PTZ_PELCO::Percent2PanSpeed( m_MovePan.dSpeed ), m_PtzState );
  302. // set reply size
  303. pProtocolPTZ->SetResponseSize( 4 );
  304. break;
  305. case CMD_MOVE_ZOOM:
  306. nSendCount += PTZ_PELCO::BuildZoom( pSendBuffer, GetAddress(), m_MoveZoom.dSpeed > 0 ? ( m_MoveZoom.bTele ? PTZ_PELCO::ZOOM_TELE : PTZ_PELCO::ZOOM_WIDE ) : PTZ_PELCO::ZOOM_STOP, m_PtzState );
  307. // set reply size
  308. pProtocolPTZ->SetResponseSize( 4 );
  309. break;
  310. case CMD_NONE:
  311. default:
  312. *pTimeout = 10L;
  313. return FALSE;
  314. }
  315. // write packet
  316. if( !pProtocolPTZ->Write( pSendBuffer, nSendCount, 1000UL, TRUE ) )
  317. return FALSE;
  318. *pTimeout = 250L; // TX + RX
  319. return TRUE;
  320. }
  321. BOOL CLgDevicePTZPelco::ReadProc( void *pProtocol, LONG lTimeout, BOOL bLastChance )
  322. {
  323. CProtocolPTZPelco *pProtocolPTZ = (CProtocolPTZPelco*)pProtocol;
  324. // read reply
  325. PBYTE pReadBuffer = NULL;
  326. INT nReadCount = 0;
  327. //if( !pProtocolPTZ->Read( &pReadBuffer, &nReadCount, lTimeout, TRUE ) || !pReadBuffer || !nReadCount )
  328. if( !pProtocolPTZ->Read( &pReadBuffer, &nReadCount, lTimeout, TRUE ) || !pReadBuffer || !nReadCount )
  329. {
  330. if( !bLastChance )
  331. return FALSE;
  332. m_nNoReplyCount++;
  333. // if( m_nNoReplyCount > MAX_NO_REPLY_COUNT || ( m_nMode == CMD_GET_PTZ && m_nNoReplyCount > MAX_NOT_IN_POSITION_COUNT ) ) // v_1
  334. if( m_nNoReplyCount > PELCO_MAX_NO_REPLY_COUNT ) // v_2
  335. {
  336. // perform goto idle state
  337. // m_nMode = CMD_INIT; // Commented for BOSH/Pelco
  338. } else // else - Bosh Pelco
  339. return FALSE;
  340. }
  341. // reset retry counter
  342. m_nNoReplyCount = 0;
  343. // switch mode
  344. switch( m_nMode )
  345. {
  346. case CMD_INIT:
  347. switch( m_nStage )
  348. {
  349. case STAGE_INIT_TURN_ON: m_nStage = STAGE_INIT_AUTO_FOCUS; break;
  350. case STAGE_INIT_AUTO_FOCUS: m_nStage = STAGE_INIT_AUTO_IRIS; break;
  351. case STAGE_INIT_AUTO_IRIS: m_nStage = STAGE_INIT_AUTO_GAIN_CONTROL; break;
  352. case STAGE_INIT_AUTO_GAIN_CONTROL: m_nStage = STAGE_INIT_BACKLIGHT_COMPENSATION; break;
  353. case STAGE_INIT_BACKLIGHT_COMPENSATION: m_nStage = STAGE_INIT_WHITE_BALANCE; break;
  354. case STAGE_INIT_WHITE_BALANCE:
  355. OnPerformCmd();
  356. OnEvtInit();
  357. break;
  358. }
  359. break;
  360. case CMD_GET_PTZ:
  361. switch( m_nStage )
  362. {
  363. case STAGE_GET_PAN_POSITION:
  364. m_Position.dPan = PTZ_PELCO::Pan2Degree( PTZ_PELCO::Pan2Value( pReadBuffer[4], pReadBuffer[5] ), PELCO_PAN_REVERSE );
  365. m_nStage = STAGE_GET_TILT_POSITION;
  366. break;
  367. case STAGE_GET_TILT_POSITION:
  368. m_Position.dTilt = PTZ_PELCO::Tilt2Degree( PTZ_PELCO::Tilt2Value( pReadBuffer[4], pReadBuffer[5] ) );
  369. m_nStage = STAGE_GET_ZOOM_POSITION;
  370. break;
  371. case STAGE_GET_ZOOM_POSITION:
  372. m_Position.dZoom = PTZ_PELCO::Zoom2Percent( PTZ_PELCO::Zoom2Value( pReadBuffer[4], pReadBuffer[5] ) );
  373. // ready to process new message
  374. OnPerformCmd();
  375. //notify
  376. OnEvtGetPTZ( m_Position.dPan, m_Position.dTilt, m_Position.dZoom );
  377. break;
  378. }
  379. break;
  380. case CMD_SET_PTZ:
  381. switch( m_nStage )
  382. {
  383. case STAGE_SET_TILT_POSITION: m_nStage = STAGE_SET_PAN_POSITION; break;
  384. case STAGE_SET_PAN_POSITION: m_nStage = STAGE_SET_ZOOM_POSITION; break;
  385. case STAGE_SET_ZOOM_POSITION: /*m_nStage = STAGE_GET_PAN_POSITION; break;
  386. case STAGE_GET_PAN_POSITION:
  387. m_TempPosition.dPan = PTZ_PELCO::Pan2Degree( PTZ_PELCO::Pan2Value( pReadBuffer[4], pReadBuffer[5] ) );
  388. m_nStage = STAGE_GET_TILT_POSITION;
  389. break;
  390. case STAGE_GET_TILT_POSITION:
  391. m_TempPosition.dTilt = PTZ_PELCO::Tilt2Degree( PTZ_PELCO::Tilt2Value( pReadBuffer[4], pReadBuffer[5] ) );
  392. m_nStage = STAGE_GET_ZOOM_POSITION;
  393. break;
  394. case STAGE_GET_ZOOM_POSITION:
  395. m_TempPosition.dZoom = PTZ_PELCO::Zoom2Percent( PTZ_PELCO::Zoom2Value( pReadBuffer[4], pReadBuffer[5] ) );
  396. // calculate difference between desired position and current position
  397. if( QualifyPosition( m_TempPosition.dPan - m_Position.dPan,
  398. m_TempPosition.dTilt - m_Position.dTilt,
  399. m_TempPosition.dZoom - m_Position.dZoom,
  400. POSITION_QUALYTY ) ||
  401. m_nNotInPositionCount >= MAX_NOT_IN_POSITION_COUNT )
  402. {
  403. // store position
  404. m_Position.dPan = m_TempPosition.dPan;
  405. m_Position.dTilt = m_TempPosition.dTilt;
  406. m_Position.dZoom = m_TempPosition.dZoom;
  407. */ // ready to process new message
  408. OnPerformCmd();
  409. //notify
  410. OnEvtSetPTZ( m_Position.dPan, m_Position.dTilt, m_Position.dZoom );
  411. /* }
  412. else
  413. {
  414. // does not in posiiton
  415. m_nStage = STAGE_SET_PAN_POSITION;
  416. // increate fault counter
  417. m_nNotInPositionCount++;
  418. return TRUE;
  419. }
  420. break;
  421. */ }
  422. break;
  423. case CMD_MOVE_PAN:
  424. OnPerformCmd();
  425. OnEvtMovePan( m_MovePan.bRight, m_MovePan.dSpeed );
  426. break;
  427. case CMD_MOVE_TILT:
  428. OnPerformCmd();
  429. OnEvtMoveTilt( m_MoveTilt.bUp, m_MoveTilt.dSpeed );
  430. break;
  431. case CMD_MOVE_ZOOM:
  432. OnPerformCmd();
  433. OnEvtMoveZoom( m_MoveZoom.bTele, m_MoveZoom.dSpeed );
  434. break;
  435. }
  436. return TRUE;
  437. }