For DOS Protected Mode version of sensor core software
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.

955 lines
29 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
​
3 years ago
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 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: kernel_.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of kernel_.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\LgLib\Version.h"
  16. #include "Kernel.h"
  17. CKernel *CKernel::_instance = NULL;
  18. CKernel *CKernel::getInstance(){
  19. if( _instance == NULL ) {
  20. _instance = new CKernel();
  21. };
  22. return _instance;
  23. };
  24. CKernel::CKernel() : CIsr(){
  25. m_nInitErrorSkipCounter = 20;
  26. m_pBoard = NULL;
  27. m_pShadow = NULL;
  28. #ifdef ALS_300
  29. m_pShadowS = NULL;
  30. #endif
  31. m_bIsCreated = false;
  32. #ifndef NO_EMBED_CAMERA
  33. m_pCamera = NULL;
  34. m_pCameraComm = NULL;
  35. #endif
  36. m_bTimerISR = false;
  37. nTimerISRCount = 0;
  38. #ifdef BOARD_NO_RESPONCE_COUNT_INIT
  39. m_nBoardNoRespoceCount = BOARD_NO_RESPONCE_COUNT_INIT;
  40. #endif
  41. m_bRun = true;
  42. m_nSerialNumber = 0;
  43. memset( m_pSerialNumber, 0, sizeof(m_pSerialNumber) );
  44. m_nAddress = 0;
  45. // init error timing
  46. memset( m_dwTimeErrorOverflowSST, 0, sizeof(m_dwTimeErrorOverflowSST)*4 );
  47. memset( m_dwTimeErrorOverflow, 0, sizeof(m_dwTimeErrorOverflow)*4 );
  48. memset( m_dwTimeErrorSun, 0, sizeof(m_dwTimeErrorSun)*4 );
  49. m_dwTimeErrorDelay_EA = 0UL;
  50. m_dwTimeErrorDelay_IQ = 0UL;
  51. m_dwTimePower = 0UL;
  52. #ifdef DETECTION_MULTI_PROFILES
  53. m_bActiveMasterDetectionProfile = 1;
  54. m_bActiveSlaveDetectionProfile = 4;
  55. #endif
  56. #ifndef LGS_PLS_1
  57. m_LRFDisable.bMaster = m_LRFDisable.bSlave = false;
  58. #else
  59. m_LRFDisable.bMaster = false;
  60. #ifdef INFINITE_SAF_STUDY
  61. m_LRFDisable.bSlave = false;
  62. #else
  63. m_LRFDisable.bSlave = true;
  64. #endif
  65. #endif
  66. m_bWaitFirstZero = true;
  67. #ifndef LGS_DISABLE_FILE_SYSTEM
  68. // file system
  69. m_pFSHelper = new NFSHelper();
  70. //memset( &m_FileSystemPacket, 0, sizeof(m_FileSystemPacket) );
  71. //m_pFSFileHandle = NULL;
  72. #endif
  73. // prepare software version
  74. #ifdef LGS_MIRROR
  75. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM,%s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  76. #else
  77. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s", CLgVersion::GetBuildTimeStr(),
  78. #endif
  79. #ifdef BOARD_A2D_FOUR_SAMPLES
  80. "4"
  81. #else
  82. "1"
  83. #endif
  84. #ifdef COMPILE_AS_ANGLES
  85. ",AN"
  86. #endif
  87. #ifdef COMPILE_AS_GETFILE
  88. ",GF"
  89. #endif
  90. #ifdef DEBUG_BOARD_SET_TEST_BIT
  91. ",B"
  92. #endif
  93. #ifdef DEBUG_ENABLE_OLD_BOARD
  94. ",O"
  95. #endif
  96. #ifdef DEBUG_ENABLE_SEND_BOARDDATA
  97. ",S"
  98. #endif
  99. #ifdef COMM_RS485_PREVENT_ECHO
  100. ",E,ASDFGHJJ,"
  101. #endif
  102. #ifdef COMM_WITHOUT_INTERRUPTS
  103. ",I"
  104. #endif
  105. #ifdef BOARD_DEFFERED_PROCESSING
  106. ",D"
  107. #endif
  108. #ifdef BOARD_SUN_BIT_DISABLE
  109. ",S"
  110. #endif
  111. #ifdef LGS_PROTOCOL_TRANSMIT_DELAY
  112. ",T"
  113. #endif
  114. #ifdef BOARD_LINEARIZATION_ENABLE
  115. ",L"
  116. #endif
  117. #ifdef WATCHDOG_ENABLED
  118. ",W"
  119. #endif
  120. #ifdef BOARD_POWER_ENABLE
  121. ",P"
  122. #endif
  123. #ifndef EMBEDDED_CAMERA_DISABLED
  124. ",C"
  125. #endif
  126. #ifdef EMBEDDED_CAMERA_MIGVAN
  127. "O"
  128. #endif
  129. #ifdef EMBEDDED_CAMERA_MIC
  130. "M"
  131. #endif
  132. #ifdef EMBEDDED_CAMERA_JVC
  133. "J"
  134. #endif
  135. #ifdef EMBEDDED_CAMERA_PHILIPS
  136. "B"
  137. #endif
  138. #ifdef EMBEDDED_CAMERA_VICON
  139. "V"
  140. #endif
  141. #ifdef EMBEDDED_CAMERA_PELCO
  142. "P"
  143. #endif
  144. #ifdef EMBEDDED_CAMERA_CHINA
  145. "X"
  146. #endif
  147. #ifdef EMBEDDED_CAMERA_FLIR
  148. "F"
  149. #endif
  150. #ifdef EMBEDDED_CAMERA_HEBRON
  151. "H"
  152. #endif
  153. #ifdef EMBEDDED_CAMERA_AMERICAN_DYNAMICS
  154. "A"
  155. #endif
  156. );
  157. }
  158. CKernel::~CKernel(){
  159. if( m_bIsCreated ) Destroy();
  160. #ifndef LGS_DISABLE_FILE_SYSTEM
  161. if( m_pFSHelper ) delete( m_pFSHelper );
  162. #endif
  163. }
  164. #ifdef DETECTION_MULTI_PROFILES
  165. bool CKernel::setActiveDetectionProfile( uint8_t profileID ){
  166. if( profileID != m_bActiveMasterDetectionProfile ){
  167. char APFN[32];
  168. FILE *APFD;
  169. if( profileID > 2 ) profileID = 2;
  170. sprintf( APFN, "%c:\\profile.ini", (char)(65+m_pBoard->GetNotVolatileFileSystem()) );
  171. //printf( "Save Settings to: %s\n", APFN );
  172. APFD = fopen( APFN, "w+" );
  173. if( APFD!=NULL ){
  174. fprintf( APFD, "%d\n", profileID );
  175. fclose( APFD );
  176. } else {
  177. //printf( "Cannot access file: %s\n", APFN );
  178. return false;
  179. };
  180. m_bActiveMasterDetectionProfile = profileID;
  181. m_bActiveSlaveDetectionProfile = profileID+3;
  182. return true;
  183. } else {
  184. return false;
  185. };
  186. };
  187. LPCTSTR m_pDetectionProfiles[] = {
  188. { "init_m01.ini" },
  189. { "init_m02.ini" },
  190. { "init_m03.ini" },
  191. { "init_s01.ini" },
  192. { "init_s02.ini" },
  193. { "init_s03.ini" }
  194. };
  195. #endif
  196. bool CKernel::Create(){
  197. m_bWaitFirstZero = true;
  198. if( m_bIsCreated ) Destroy();
  199. m_pBoard = CBoard::getInstance();
  200. m_pShadow = new CShadow();
  201. if( m_pShadow == NULL ) return false;
  202. #ifdef ALS_300
  203. m_pShadowS = new CShadow( true );
  204. if( m_pShadowS == NULL ) return false;
  205. #endif
  206. m_pComm485 = new CComm485();
  207. if( m_pComm485 == NULL ) return false;
  208. #ifdef DEBUG_SHOW_COMMUNICATION
  209. m_pComm485->ShowCommunication( true );
  210. #endif
  211. int32_t nSpeed = LGS_COMM_BAUDRATE;
  212. #ifndef COMPILE_AS_GETFILE
  213. // load comm speed
  214. FILE *pFile = fopen( "SERIAL.INI", "rt" );
  215. if( pFile ){
  216. fscanf( pFile, "%ld\n", &nSpeed );
  217. fclose( pFile );
  218. };
  219. #endif
  220. if( !m_pComm485->Create( CComm485::_COM2, nSpeed, 8, CComm485::_NOPARITY )) return false;
  221. // create transport protocol
  222. if( !m_Protocol.Create( m_pComm485 ) ) return false;
  223. // assume that no relay
  224. LGS::RELAY_PARAMETERS rp;
  225. rp.bAuto = 0;
  226. rp.nAutoDelay = 0;
  227. rp.bNormallyClose = 0;
  228. // no voltage control by default
  229. LGS::VOLTAGE_PARAMETERS vp;
  230. vp.bControl = false;
  231. // both lasers enabled
  232. m_LRFDisable.bMaster = false;
  233. m_LRFDisable.bSlave = false;
  234. // load user settings
  235. BOARD_SETTINGS BoardSettings;
  236. ARESET_SETTINGS AutoReset;
  237. BoardSettings.nHID = 255;
  238. SWITCHER_SETTINGS SwitcherSettings;
  239. #ifndef NO_EMBED_CAMERA
  240. m_pCameraComm = new CComm485();
  241. if( m_pCameraComm == NULL ) return false;
  242. #ifdef DEBUG_SHOW_COMMUNICATION
  243. m_pCameraComm->ShowCommunication( true );
  244. #endif
  245. // assume that no camera
  246. LGS::CAMERA_PARAMETERS cp;
  247. cp.eType = LGS::CAMERA_TYPE_NONE;
  248. cp.nShift = 0;
  249. cp.bAuto = false;
  250. cp.nAutoDelay = 0;
  251. // load settings
  252. LoadSettings( (PCHAR)m_pSerialNumber, &m_nSerialNumber, &m_nAddress, &cp, &rp, &vp, &m_LRFDisable );
  253. LoadUserSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, pCameraComm );
  254. BoardSettings.M_LRFDisable = m_LRFDisable.bMaster;
  255. BoardSettings.S_LRFDisable = m_LRFDisable.bSlave;
  256. LoadFSSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, pCameraComm );
  257. #else
  258. // load settings
  259. LoadSettings( (PCHAR)m_pSerialNumber, &m_nSerialNumber, &m_nAddress, NULL, &rp, &vp, &m_LRFDisable );
  260. LoadUserSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, NULL );
  261. BoardSettings.M_LRFDisable = m_LRFDisable.bMaster;
  262. BoardSettings.S_LRFDisable = m_LRFDisable.bSlave;
  263. LoadFSSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, NULL );
  264. #endif
  265. //Telling the board of Relay Default mode
  266. if( rp.bAuto ){
  267. BoardSettings.RelayDefaultMode = rp.bNormallyClose;
  268. } else {
  269. BoardSettings.RelayDefaultMode = false;
  270. };
  271. #ifndef NO_EMBED_CAMERA
  272. m_pCamera = new CCamera;
  273. if( m_pCamera == NULL ) return false;
  274. if( !m_pCamera->Create( (LGS::E_CAMERA_TYPE)cp.eType, m_pCameraComm, CComm485::_COM1, &cp, &SwitcherSettings ) ) return false;
  275. #endif
  276. //#ifdef DEBUG_SHOW_COMMUNICATION
  277. // g_LgsComm485.ShowCommunication( false );
  278. // #ifndef NO_EMBED_CAMERA
  279. // g_CameraComm485.ShowCommunication( true );
  280. // #endif
  281. //#endif
  282. //printf("Create Relay\n");
  283. if( !m_Relay.Create( m_pBoard, &rp ) ) return false;
  284. //printf("Create Voltage\n");
  285. if( !m_Voltage.Create( &vp ) ) return false;
  286. #ifdef DEBUG
  287. printf("Create Board\n");
  288. #endif
  289. if( !m_pBoard->Create( &BoardSettings ) ) return false;
  290. //printf("Autoreset\n");
  291. if( !m_AutoReset.Create( &AutoReset ) ) return false;
  292. #ifndef COMPILE_AS_GETFILE
  293. //printf("Create Tracker[0]\n");
  294. #ifndef NO_EMBED_CAMERA
  295. if( !m_Tracker[0].Create( BoardSettings.M_LRFDisable, m_pCamera, &m_Relay, &m_AutoReset ) ) {
  296. #else
  297. if( !m_Tracker[0].Create( BoardSettings.M_LRFDisable, NULL, &m_Relay, &m_AutoReset ) ) {
  298. #endif
  299. return false;
  300. };
  301. #ifdef DETECT_JUST_MOVING_TARGETS
  302. m_Tracker[0].SetMovingFilter( m_nMovingRadialFilter, m_nMovingDistanceFilter );
  303. m_Tracker[0].SetBlindZoneFilter( m_nBZSAngleFilter, m_nBZEAngleFilter, m_nBZSRangeFilter, m_nBZERangeFilter );
  304. #endif
  305. #ifdef DEBUG_GRAPH_SCREEN_SST
  306. m_Tracker[0].SetIndex(0);
  307. #endif
  308. //printf("Done\n");
  309. #ifndef LGS_MIRROR
  310. #ifndef LGS_PLS_1 // ALS Systems
  311. //printf("Create Tracker[1](ALS)\n");
  312. #ifndef NO_EMBED_CAMERA
  313. if( !m_Tracker[1].Create( BoardSettings.S_LRFDisable, m_pCamera, &m_Relay, &m_AutoReset ) ){
  314. #else
  315. if( !m_Tracker[1].Create( BoardSettings.S_LRFDisable, NULL, &m_Relay, &m_AutoReset ) ){
  316. #endif
  317. return false;
  318. };
  319. #ifdef DETECT_JUST_MOVING_TARGETS
  320. m_Tracker[1].SetMovingFilter( m_nMovingRadialFilter, m_nMovingDistanceFilter );
  321. m_Tracker[1].SetBlindZoneFilter( m_nBZSAngleFilter, m_nBZEAngleFilter, m_nBZSRangeFilter, m_nBZERangeFilter );
  322. #endif
  323. #ifdef DEBUG_GRAPH_SCREEN_SST
  324. m_Tracker[1].SetIndex(1);
  325. #endif
  326. //printf("Done\n");
  327. #endif
  328. #endif
  329. #ifdef DETECTION_MULTI_PROFILES
  330. char APFN[32];
  331. FILE *APFD;
  332. sprintf( APFN, "%c:\\profile.ini", (char)( 65+BoardSettings.nHID ) );
  333. APFD = fopen( APFN, "r" );
  334. if( APFD!=NULL ){
  335. uint8_t profileID;
  336. fscanf( APFD, "%d\n", &m_bActiveMasterDetectionProfile );
  337. m_bActiveSlaveDetectionProfile = m_bActiveMasterDetectionProfile+3;
  338. fclose( APFD );
  339. } else {
  340. m_bActiveMasterDetectionProfile = 0; // to ensure no to exit from next function
  341. setActiveDetectionProfile( 1 );
  342. };
  343. #ifdef STORE_FIRST_SAF
  344. #ifdef WATCHDOG_ENABLED
  345. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, /*_T("init_m.ini")*/( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_MASTER ) ) {
  346. #else
  347. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_MASTER ) ) {
  348. #endif
  349. #else
  350. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  351. #endif
  352. #else
  353. //printf("Singleprofiles Detector\n");
  354. #ifdef STORE_FIRST_SAF
  355. #ifdef WATCHDOG_ENABLED
  356. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini"), &m_WatchDog, LRF_ID_MASTER ) ) {
  357. #else
  358. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini"), LRF_ID_MASTER ) ) {
  359. #endif
  360. #else
  361. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini") ) ) {
  362. #endif
  363. #endif
  364. return false;
  365. };
  366. #ifdef STORE_FIRST_SAF
  367. if( g_bSAFFileEnable ){
  368. m_Detector[0].load_stored_SAF();
  369. };
  370. #endif
  371. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  372. #ifdef DETECTION_MULTI_PROFILES
  373. #ifdef STORE_FIRST_SAF
  374. #ifdef WATCHDOG_ENABLED
  375. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  376. #else
  377. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  378. #endif
  379. #else
  380. if( !m_Detector[1].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  381. #endif
  382. #else
  383. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  384. #endif
  385. return false;
  386. };
  387. #ifdef DETECTION_MULTI_PROFILES
  388. #ifdef STORE_FIRST_SAF
  389. #ifdef WATCHDOG_ENABLED
  390. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  391. #else
  392. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  393. #endif
  394. #else
  395. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  396. #endif
  397. #else
  398. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  399. #endif
  400. return false;
  401. };
  402. #ifdef DETECTION_MULTI_PROFILES
  403. #ifdef STORE_FIRST_SAF
  404. #ifdef WATCHDOG_ENABLED
  405. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  406. #else
  407. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  408. #endif
  409. #else
  410. if( !m_Detector[3].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  411. #endif
  412. #else
  413. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  414. #endif
  415. return false;
  416. };
  417. #else
  418. //printf("Single Profile\n");
  419. #if !defined ( LGS_PLS_1 ) && !defined( LGS_MND ) //ALS Systems
  420. #ifdef DETECTION_MULTI_PROFILES
  421. #ifdef ALS_300
  422. #ifdef STORE_FIRST_SAF
  423. #ifdef WATCHDOG_ENABLED
  424. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, /*_T("init_s.ini")*/( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  425. #else
  426. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  427. #endif
  428. #else
  429. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  430. #endif
  431. #else
  432. #ifdef STORE_FIRST_SAF
  433. #ifdef WATCHDOG_ENABLED
  434. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  435. #else
  436. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  437. #endif
  438. #else
  439. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR ) m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  440. #endif
  441. #endif
  442. #else
  443. #ifdef ALS_300
  444. #ifdef STORE_FIRST_SAF
  445. #ifdef WATCHDOG_ENABLED
  446. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini"), &m_WatchDog, LRF_ID_SLAVE ) ) {
  447. #else
  448. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini"), LRF_ID_SLAVE ) ) {
  449. #endif
  450. #else
  451. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  452. #endif
  453. #else
  454. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  455. #endif
  456. #endif
  457. return false;
  458. };
  459. #endif
  460. #endif
  461. #ifdef DEBUG_EXTRA
  462. printf("Done\n");
  463. #endif
  464. #ifndef RANGE_16BIT
  465. //printf("Calibrator\n");
  466. if( !m_Calibrator[0].Create( "lt0.ini" ) ) return false;
  467. #ifndef LGS_MIRROR
  468. #ifndef LGS_PLS_1
  469. if( !m_Calibrator[1].Create( "lt1.ini" ) ) return false;
  470. #endif
  471. #endif
  472. //printf("Done\n");
  473. #endif
  474. #endif // ! COMPILE_AS_GETFILE
  475. if( !m_GetFile.Create() ) return false;
  476. #ifdef DEBUG_EXTRA
  477. printf("Get File Done\n");
  478. #endif
  479. //********************************************************
  480. //*
  481. //* GENERATING VERSION STRING
  482. //*
  483. //********************************************************
  484. #ifdef DEBUG
  485. printf("Creating SW String\n");
  486. #endif
  487. #ifdef COMPILE_AS_GETFILE
  488. #ifdef LGS_MIRROR
  489. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  490. #ifdef LGS_FOD
  491. #ifdef RANGE_16BIT
  492. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  493. #else
  494. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  495. #endif
  496. #ifdef NO_EMBED_CAMERA
  497. "FODGFX"
  498. #else
  499. "FODGF"
  500. #endif
  501. #else
  502. #ifdef RANGE_16BIT
  503. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  504. #else
  505. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  506. #endif
  507. #ifdef NO_EMBED_CAMERA
  508. "LFSSGFX"
  509. #else
  510. "LFSSGF"
  511. #endif
  512. #endif
  513. #else
  514. #ifdef LGS_MND
  515. #ifdef RANGE_16BIT
  516. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  517. #else
  518. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  519. #endif
  520. #ifdef NO_EMBED_CAMERA
  521. "MNDGFX"
  522. #else
  523. "MNDGF"
  524. #endif
  525. #else
  526. #ifdef RANGE_16BIT
  527. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  528. #else
  529. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  530. #endif
  531. #ifdef NO_EMBED_CAMERA
  532. "LFSGFX"
  533. #else
  534. "LFSGF"
  535. #endif
  536. #endif
  537. #endif
  538. #else
  539. #ifdef LGS_PLS_1
  540. #ifdef RANGE_16BIT
  541. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  542. #else
  543. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  544. #endif
  545. #ifdef NO_EMBED_CAMERA
  546. #ifdef LGS_PLS_200
  547. "PLSGFX100"
  548. #else
  549. "PLSGFX1"
  550. #endif
  551. #else
  552. #ifdef LGS_PLS_200
  553. "PLSGFX100"
  554. #else
  555. "PLSGFX1"
  556. #endif
  557. #endif
  558. #else
  559. #ifdef RANGE_16BIT
  560. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  561. #else
  562. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  563. #endif
  564. #ifdef NO_EMBED_CAMERA
  565. "ALSGFX"
  566. #else
  567. "ALSGF"
  568. #endif
  569. #endif
  570. #endif // LGS_MIRROR
  571. #else // ! COMPILE_AS_GETFILE
  572. #ifdef LGS_MIRROR
  573. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  574. #ifdef LGS_FOD
  575. #ifdef RANGE_16BIT
  576. #ifdef STORE_FIRST_SAF
  577. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  578. #else
  579. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  580. #endif
  581. #else
  582. #ifdef STORE_FIRST_SAF
  583. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  584. #else
  585. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  586. #endif
  587. #endif
  588. #ifdef NO_EMBED_CAMERA
  589. "FODX"
  590. #else
  591. "FOD"
  592. #endif
  593. #else
  594. #ifdef RANGE_16BIT
  595. #ifdef STORE_FIRST_SAF
  596. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  597. #else
  598. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  599. #endif
  600. #else
  601. #ifdef STORE_FIRST_SAF
  602. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  603. #else
  604. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  605. #endif
  606. #endif
  607. #ifdef NO_EMBED_CAMERA
  608. "LFSSX"
  609. #else
  610. "LFSS"
  611. #endif
  612. #endif
  613. #else
  614. #ifdef LGS_MND
  615. #ifdef RANGE_16BIT
  616. #ifdef STORE_FIRST_SAF
  617. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  618. #else
  619. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  620. #endif
  621. #else
  622. #ifdef STORE_FIRST_SAF
  623. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  624. #else
  625. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  626. #endif
  627. #endif
  628. #ifdef NO_EMBED_CAMERA
  629. "MNDX"
  630. #else
  631. "MND"
  632. #endif
  633. #else
  634. #ifdef RANGE_16BIT
  635. #ifdef STORE_FIRST_SAF
  636. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  637. #else
  638. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  639. #endif
  640. #else
  641. #ifdef STORE_FIRST_SAF
  642. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  643. #else
  644. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  645. #endif
  646. #endif
  647. #ifdef NO_EMBED_CAMERA
  648. "LFSX"
  649. #else
  650. "LFS"
  651. #endif
  652. #endif
  653. #endif
  654. #else
  655. #ifdef LGS_PLS_1
  656. #ifdef RANGE_16BIT
  657. #ifdef STORE_FIRST_SAF
  658. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  659. #else
  660. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  661. #endif
  662. #else
  663. #ifdef STORE_FIRST_SAF
  664. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  665. #else
  666. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  667. #endif
  668. #endif
  669. #ifdef NO_EMBED_CAMERA
  670. #ifdef LGS_PLS_200
  671. "PLSX100"
  672. #else
  673. "PLSX1"
  674. #endif
  675. #else
  676. #ifdef LGS_PLS_200
  677. "PLS100"
  678. #else
  679. "PLS1"
  680. #endif
  681. #endif
  682. #else
  683. #ifdef RANGE_16BIT
  684. #ifdef STORE_FIRST_SAF
  685. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  686. #else
  687. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  688. #endif
  689. #else
  690. #ifdef STORE_FIRST_SAF
  691. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  692. #else
  693. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  694. #endif
  695. #endif
  696. #ifdef NO_EMBED_CAMERA
  697. #ifdef ALS_300
  698. #ifdef ALS_300_BM
  699. "ALSX20K"
  700. #else
  701. "ALSX300"
  702. #endif
  703. #else
  704. "ALSX"
  705. #endif
  706. #else
  707. #ifdef ALS_300
  708. #ifdef ALS_300_BM
  709. "ALS20K"
  710. #else
  711. "ALS300"
  712. #endif
  713. #else
  714. "ALS"
  715. #endif
  716. #endif
  717. #endif
  718. #endif // LGS_MIRROR
  719. #endif // COMPILE_AS_GETFILE
  720. ,( m_pBoard->getBoardType() == BT_VORTEX_SX || m_pBoard->getBoardType() == BT_VORTEX_DX || m_pBoard->getBoardType() == BT_VORTEX_MX )?"d":"i"
  721. ,( g_bNoBlackTargets )?"B":""
  722. ,(m_pBoard->workingEnabled())?((( m_pBoard->getBoardWM() == WM_BLO_ONLY ) || ( m_pBoard->getBoardWM() == WM_FW_UPGRADE ) )?"BLO":""):"NLC"
  723. ,( g_bWatchDogEnable )?"W":""
  724. #ifdef STORE_FIRST_SAF
  725. #ifdef INFINITE_SAF_STUDY
  726. ,( g_bSAFFreezEnable )?((m_Detector[0].isSAFFrozen())?((g_bSAFFileEnable)?"F":"M"):"S"):"D"
  727. #else
  728. ,( g_bSAFFreezEnable )?((g_bSAFFileEnable)?"F":"M"):"D"
  729. #endif
  730. #endif
  731. //#if defined( LGS_PLS_1 ) || defined( LGS_FOD ) || defined( LGS_STEPPER ) || defined( LGS_MND )
  732. , m_pBoard->GetBFW()
  733. , m_pBoard->GetBSW()
  734. //#endif
  735. , m_pBoard->GetBSN() );
  736. //printf("SW:%s\n", s_pSoftwareVersion );
  737. //printf("Done\n");
  738. #ifdef WATCHDOG_ENABLED
  739. //printf("Start Watchdog\n");
  740. // start watchdog
  741. if( g_bWatchDogEnable ) if( !m_WatchDog.Create() ) return false;
  742. //printf("Done\n");
  743. #endif
  744. #ifndef COMPILE_AS_GETFILE
  745. //printf("Issue Board Reset\n");
  746. //m_pBoard->Reset();
  747. // printf("Done\n");
  748. #endif
  749. #ifndef COMM_WITHOUT_INTERRUPTS
  750. // m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  751. // m_pCameraComm->SetFCT( false ); // Disable usage of timer with Camera Programm Port
  752. if ( ! m_bTimerISR ){ // setup Timer Interupt Procedure
  753. printf("ISR -> Setup Timer!\n");
  754. #ifndef NO_EMBED_CAMERA
  755. if( m_pCameraComm->m_bFollowControlTimer || m_pComm485->m_bFollowControlTimer ) ){
  756. #else
  757. if( m_pComm485->m_bFollowControlTimer ){
  758. #endif
  759. intTimerCC();
  760. m_bTimerISR = initISR( 10 );
  761. } else {
  762. #ifndef NO_EMBED_CAMERA
  763. m_pCameraComm->SetFCT( false ); // Disable usage of WD timer
  764. #endif
  765. m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  766. };
  767. #ifdef DEBUG
  768. printf("Done\n");
  769. #endif
  770. };
  771. #endif
  772. m_bIsCreated = true;
  773. return m_bIsCreated;
  774. };
  775. void CKernel::Destroy(){
  776. #ifdef DEBUG_PRINTOUT_MSGS
  777. if( m_bIsCreated ){
  778. debug("Kernel Destroy");
  779. } else {
  780. debug("Reset Components in Create!");
  781. };
  782. #endif
  783. #ifndef NO_EMBED_CAMERA
  784. if( m_pCamera ){
  785. delete( m_pCamera );
  786. m_pCamera = NULL;
  787. };
  788. if( m_pCameraComm ) {
  789. delete( m_pCameraComm );
  790. m_pCameraComm = NULL;
  791. };
  792. #endif
  793. if( m_pComm485 ) {
  794. delete( m_pComm485 );
  795. m_pComm485 = NULL;
  796. };
  797. #ifndef COMPILE_AS_GETFILE
  798. if ( m_bTimerISR ) resignISR();
  799. #endif
  800. #ifdef DEBUG_PRINTOUT_MSGS
  801. debugProcBegin("GetFile Destroy");
  802. #endif
  803. m_GetFile.Destroy();
  804. #ifdef DEBUG_PRINTOUT_MSGS
  805. debugProcEnd();
  806. debugProcBegin("Protocol Destroy");
  807. #endif
  808. m_Protocol.Destroy();
  809. #ifdef DEBUG_PRINTOUT_MSGS
  810. debugProcEnd();
  811. debugProcBegin("Detector[0] Destroy");
  812. #endif
  813. m_Detector[0].Destroy();
  814. #ifdef DEBUG_PRINTOUT_MSGS
  815. debugProcEnd();
  816. #endif
  817. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  818. #ifdef DEBUG_PRINTOUT_MSGS
  819. debugProcBegin("Detector[1] Destroy");
  820. #endif
  821. m_Detector[1].Destroy();
  822. #ifdef DEBUG_PRINTOUT_MSGS
  823. debugProcEnd();
  824. #endif
  825. #endif
  826. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  827. #ifdef DEBUG_PRINTOUT_MSGS
  828. debugProcBegin("Detector[2] Destroy");
  829. #endif
  830. m_Detector[2].Destroy();
  831. #ifdef DEBUG_PRINTOUT_MSGS
  832. debugProcEnd();
  833. debugProcBegin("Detector[3] Destroy");
  834. #endif
  835. m_Detector[3].Destroy();
  836. #ifdef DEBUG_PRINTOUT_MSGS
  837. debugProcEnd();
  838. debugProcBegin("Tracker[0] Destroy");
  839. #endif
  840. m_Tracker[0].Destroy();
  841. #ifdef DEBUG_PRINTOUT_MSGS
  842. debugProcEnd();
  843. #endif
  844. #else
  845. #ifdef DEBUG_PRINTOUT_MSGS
  846. debugProcBegin("Tracker[0] Destroy");
  847. #endif
  848. m_Tracker[0].Destroy();
  849. #ifdef DEBUG_PRINTOUT_MSGS
  850. debugProcEnd();
  851. #endif
  852. #if !defined(LGS_PLS_1) && !defined( LGS_MND )
  853. #ifdef DEBUG_PRINTOUT_MSGS
  854. debugProcBegin("Tracker[1] Destroy");
  855. #endif
  856. m_Tracker[1].Destroy();
  857. #ifdef DEBUG_PRINTOUT_MSGS
  858. debugProcEnd();
  859. #endif
  860. #endif
  861. #endif
  862. #ifdef DEBUG_PRINTOUT_MSGS
  863. debugProcBegin("Voltage Control Destroy");
  864. #endif
  865. m_Voltage.Destroy();
  866. #ifdef DEBUG_PRINTOUT_MSGS
  867. debugProcEnd();
  868. debugProcBegin("Relay Destroy");
  869. #endif
  870. m_Relay.Destroy();
  871. #ifdef DEBUG_PRINTOUT_MSGS
  872. debugProcEnd();
  873. #endif
  874. #ifndef RANGE_16BIT
  875. #ifdef DEBUG_PRINTOUT_MSGS
  876. debugProcBegin("Calibrator[0] Destroy");
  877. #endif
  878. m_Calibrator[0].Destroy();
  879. #ifdef DEBUG_PRINTOUT_MSGS
  880. debugProcEnd();
  881. #endif
  882. #endif
  883. #ifndef LGS_MIRROR
  884. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  885. #ifndef RANGE_16BIT
  886. #ifdef DEBUG_PRINTOUT_MSGS
  887. debugProcBegin("Calibrator[1] Destroy");
  888. #endif
  889. m_Calibrator[1].Destroy();
  890. #ifdef DEBUG_PRINTOUT_MSGS
  891. debugProcEnd();
  892. #endif
  893. #endif
  894. #endif
  895. #endif
  896. #ifdef DEBUG_PRINTOUT_MSGS
  897. debugProcBegin("Auto-Reset Destroy");
  898. #endif
  899. m_AutoReset.Destroy();
  900. #ifdef DEBUG_PRINTOUT_MSGS
  901. debugProcEnd();
  902. #endif
  903. m_pBoard = NULL;
  904. m_pShadow = NULL;
  905. m_bRun = true;
  906. m_bIsCreated = false;
  907. #ifdef DEBUG_PRINTOUT_MSGS
  908. debug("Exit From Kernel Destroy!");
  909. #endif
  910. }