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.

956 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
​
​
​
​
​
​
​
​
​
​
​
​
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. if( !m_pShadow->Load() ) return false;
  203. //#ifdef ALS_300
  204. // m_pShadowS = new CShadow( true );
  205. // if( m_pShadowS == NULL ) return false;
  206. //#endif
  207. m_pComm485 = new CComm485();
  208. if( m_pComm485 == NULL ) return false;
  209. #ifdef DEBUG_SHOW_COMMUNICATION
  210. m_pComm485->ShowCommunication( true );
  211. #endif
  212. int32_t nSpeed = LGS_COMM_BAUDRATE;
  213. #ifndef COMPILE_AS_GETFILE
  214. // load comm speed
  215. FILE *pFile = fopen( "SERIAL.INI", "rt" );
  216. if( pFile ){
  217. fscanf( pFile, "%ld\n", &nSpeed );
  218. fclose( pFile );
  219. };
  220. #endif
  221. if( !m_pComm485->Create( CComm485::_COM2, nSpeed, 8, CComm485::_NOPARITY )) return false;
  222. // create transport protocol
  223. if( !m_Protocol.Create( m_pComm485 ) ) return false;
  224. // assume that no relay
  225. LGS::RELAY_PARAMETERS rp;
  226. rp.bAuto = 0;
  227. rp.nAutoDelay = 0;
  228. rp.bNormallyClose = 0;
  229. // no voltage control by default
  230. LGS::VOLTAGE_PARAMETERS vp;
  231. vp.bControl = false;
  232. // both lasers enabled
  233. m_LRFDisable.bMaster = false;
  234. m_LRFDisable.bSlave = false;
  235. // load user settings
  236. BOARD_SETTINGS BoardSettings;
  237. ARESET_SETTINGS AutoReset;
  238. BoardSettings.nHID = 255;
  239. SWITCHER_SETTINGS SwitcherSettings;
  240. #ifndef NO_EMBED_CAMERA
  241. m_pCameraComm = new CComm485();
  242. if( m_pCameraComm == NULL ) return false;
  243. #ifdef DEBUG_SHOW_COMMUNICATION
  244. m_pCameraComm->ShowCommunication( true );
  245. #endif
  246. // assume that no camera
  247. LGS::CAMERA_PARAMETERS cp;
  248. cp.eType = LGS::CAMERA_TYPE_NONE;
  249. cp.nShift = 0;
  250. cp.bAuto = false;
  251. cp.nAutoDelay = 0;
  252. // load settings
  253. LoadSettings( (PCHAR)m_pSerialNumber, &m_nSerialNumber, &m_nAddress, &cp, &rp, &vp, &m_LRFDisable );
  254. LoadUserSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, pCameraComm );
  255. BoardSettings.M_LRFDisable = m_LRFDisable.bMaster;
  256. BoardSettings.S_LRFDisable = m_LRFDisable.bSlave;
  257. LoadFSSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, pCameraComm );
  258. #else
  259. // load settings
  260. LoadSettings( (PCHAR)m_pSerialNumber, &m_nSerialNumber, &m_nAddress, NULL, &rp, &vp, &m_LRFDisable );
  261. LoadUserSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, NULL );
  262. BoardSettings.M_LRFDisable = m_LRFDisable.bMaster;
  263. BoardSettings.S_LRFDisable = m_LRFDisable.bSlave;
  264. LoadFSSettings( &AutoReset, &BoardSettings, &SwitcherSettings , m_pComm485, NULL );
  265. #endif
  266. //Telling the board of Relay Default mode
  267. if( rp.bAuto ){
  268. BoardSettings.RelayDefaultMode = rp.bNormallyClose;
  269. } else {
  270. BoardSettings.RelayDefaultMode = false;
  271. };
  272. #ifndef NO_EMBED_CAMERA
  273. m_pCamera = new CCamera;
  274. if( m_pCamera == NULL ) return false;
  275. if( !m_pCamera->Create( (LGS::E_CAMERA_TYPE)cp.eType, m_pCameraComm, CComm485::_COM1, &cp, &SwitcherSettings ) ) return false;
  276. #endif
  277. //#ifdef DEBUG_SHOW_COMMUNICATION
  278. // g_LgsComm485.ShowCommunication( false );
  279. // #ifndef NO_EMBED_CAMERA
  280. // g_CameraComm485.ShowCommunication( true );
  281. // #endif
  282. //#endif
  283. //printf("Create Relay\n");
  284. if( !m_Relay.Create( m_pBoard, &rp ) ) return false;
  285. //printf("Create Voltage\n");
  286. if( !m_Voltage.Create( &vp ) ) return false;
  287. #ifdef DEBUG
  288. printf("Create Board\n");
  289. #endif
  290. if( !m_pBoard->Create( &BoardSettings ) ) return false;
  291. //printf("Autoreset\n");
  292. if( !m_AutoReset.Create( &AutoReset ) ) return false;
  293. #ifndef COMPILE_AS_GETFILE
  294. //printf("Create Tracker[0]\n");
  295. #ifndef NO_EMBED_CAMERA
  296. if( !m_Tracker[0].Create( BoardSettings.M_LRFDisable, m_pCamera, &m_Relay, &m_AutoReset ) ) {
  297. #else
  298. if( !m_Tracker[0].Create( BoardSettings.M_LRFDisable, NULL, &m_Relay, &m_AutoReset ) ) {
  299. #endif
  300. return false;
  301. };
  302. #ifdef DETECT_JUST_MOVING_TARGETS
  303. m_Tracker[0].SetMovingFilter( m_nMovingRadialFilter, m_nMovingDistanceFilter );
  304. m_Tracker[0].SetBlindZoneFilter( m_nBZSAngleFilter, m_nBZEAngleFilter, m_nBZSRangeFilter, m_nBZERangeFilter );
  305. #endif
  306. #ifdef DEBUG_GRAPH_SCREEN_SST
  307. m_Tracker[0].SetIndex(0);
  308. #endif
  309. //printf("Done\n");
  310. #ifndef LGS_MIRROR
  311. #ifndef LGS_PLS_1 // ALS Systems
  312. //printf("Create Tracker[1](ALS)\n");
  313. #ifndef NO_EMBED_CAMERA
  314. if( !m_Tracker[1].Create( BoardSettings.S_LRFDisable, m_pCamera, &m_Relay, &m_AutoReset ) ){
  315. #else
  316. if( !m_Tracker[1].Create( BoardSettings.S_LRFDisable, NULL, &m_Relay, &m_AutoReset ) ){
  317. #endif
  318. return false;
  319. };
  320. #ifdef DETECT_JUST_MOVING_TARGETS
  321. m_Tracker[1].SetMovingFilter( m_nMovingRadialFilter, m_nMovingDistanceFilter );
  322. m_Tracker[1].SetBlindZoneFilter( m_nBZSAngleFilter, m_nBZEAngleFilter, m_nBZSRangeFilter, m_nBZERangeFilter );
  323. #endif
  324. #ifdef DEBUG_GRAPH_SCREEN_SST
  325. m_Tracker[1].SetIndex(1);
  326. #endif
  327. //printf("Done\n");
  328. #endif
  329. #endif
  330. #ifdef DETECTION_MULTI_PROFILES
  331. char APFN[32];
  332. FILE *APFD;
  333. sprintf( APFN, "%c:\\profile.ini", (char)( 65+BoardSettings.nHID ) );
  334. APFD = fopen( APFN, "r" );
  335. if( APFD!=NULL ){
  336. uint8_t profileID;
  337. fscanf( APFD, "%d\n", &m_bActiveMasterDetectionProfile );
  338. m_bActiveSlaveDetectionProfile = m_bActiveMasterDetectionProfile+3;
  339. fclose( APFD );
  340. } else {
  341. m_bActiveMasterDetectionProfile = 0; // to ensure no to exit from next function
  342. setActiveDetectionProfile( 1 );
  343. };
  344. #ifdef STORE_FIRST_SAF
  345. #ifdef WATCHDOG_ENABLED
  346. 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 ) ) {
  347. #else
  348. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_MASTER ) ) {
  349. #endif
  350. #else
  351. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  352. #endif
  353. #else
  354. //printf("Singleprofiles Detector\n");
  355. #ifdef STORE_FIRST_SAF
  356. #ifdef WATCHDOG_ENABLED
  357. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini"), &m_WatchDog, LRF_ID_MASTER ) ) {
  358. #else
  359. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini"), LRF_ID_MASTER ) ) {
  360. #endif
  361. #else
  362. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini") ) ) {
  363. #endif
  364. #endif
  365. return false;
  366. };
  367. #ifdef STORE_FIRST_SAF
  368. if( g_bSAFFileEnable ){
  369. m_Detector[0].load_stored_SAF();
  370. };
  371. #endif
  372. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  373. #ifdef DETECTION_MULTI_PROFILES
  374. #ifdef STORE_FIRST_SAF
  375. #ifdef WATCHDOG_ENABLED
  376. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  377. #else
  378. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  379. #endif
  380. #else
  381. if( !m_Detector[1].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  382. #endif
  383. #else
  384. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  385. #endif
  386. return false;
  387. };
  388. #ifdef DETECTION_MULTI_PROFILES
  389. #ifdef STORE_FIRST_SAF
  390. #ifdef WATCHDOG_ENABLED
  391. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  392. #else
  393. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  394. #endif
  395. #else
  396. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  397. #endif
  398. #else
  399. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  400. #endif
  401. return false;
  402. };
  403. #ifdef DETECTION_MULTI_PROFILES
  404. #ifdef STORE_FIRST_SAF
  405. #ifdef WATCHDOG_ENABLED
  406. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  407. #else
  408. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile], LRF_ID_SLAVE ) ) {
  409. #endif
  410. #else
  411. if( !m_Detector[3].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  412. #endif
  413. #else
  414. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  415. #endif
  416. return false;
  417. };
  418. #else
  419. //printf("Single Profile\n");
  420. #if !defined ( LGS_PLS_1 ) && !defined( LGS_MND ) //ALS Systems
  421. #ifdef DETECTION_MULTI_PROFILES
  422. #ifdef ALS_300
  423. #ifdef STORE_FIRST_SAF
  424. #ifdef WATCHDOG_ENABLED
  425. 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 ) ) {
  426. #else
  427. 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 ) ) {
  428. #endif
  429. #else
  430. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  431. #endif
  432. #else
  433. #ifdef STORE_FIRST_SAF
  434. #ifdef WATCHDOG_ENABLED
  435. 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 ) ) {
  436. #else
  437. 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 ) ) {
  438. #endif
  439. #else
  440. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR ) m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  441. #endif
  442. #endif
  443. #else
  444. #ifdef ALS_300
  445. #ifdef STORE_FIRST_SAF
  446. #ifdef WATCHDOG_ENABLED
  447. 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 ) ) {
  448. #else
  449. 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 ) ) {
  450. #endif
  451. #else
  452. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  453. #endif
  454. #else
  455. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  456. #endif
  457. #endif
  458. return false;
  459. };
  460. #endif
  461. #endif
  462. #ifdef DEBUG_EXTRA
  463. printf("Done\n");
  464. #endif
  465. #ifndef RANGE_16BIT
  466. //printf("Calibrator\n");
  467. if( !m_Calibrator[0].Create( "lt0.ini" ) ) return false;
  468. #ifndef LGS_MIRROR
  469. #ifndef LGS_PLS_1
  470. if( !m_Calibrator[1].Create( "lt1.ini" ) ) return false;
  471. #endif
  472. #endif
  473. //printf("Done\n");
  474. #endif
  475. #endif // ! COMPILE_AS_GETFILE
  476. if( !m_GetFile.Create() ) return false;
  477. #ifdef DEBUG_EXTRA
  478. printf("Get File Done\n");
  479. #endif
  480. //********************************************************
  481. //*
  482. //* GENERATING VERSION STRING
  483. //*
  484. //********************************************************
  485. #ifdef DEBUG
  486. printf("Creating SW String\n");
  487. #endif
  488. #ifdef COMPILE_AS_GETFILE
  489. #ifdef LGS_MIRROR
  490. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  491. #ifdef LGS_FOD
  492. #ifdef RANGE_16BIT
  493. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  494. #else
  495. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  496. #endif
  497. #ifdef NO_EMBED_CAMERA
  498. "FODGFX"
  499. #else
  500. "FODGF"
  501. #endif
  502. #else
  503. #ifdef RANGE_16BIT
  504. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  505. #else
  506. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  507. #endif
  508. #ifdef NO_EMBED_CAMERA
  509. "LFSSGFX"
  510. #else
  511. "LFSSGF"
  512. #endif
  513. #endif
  514. #else
  515. #ifdef LGS_MND
  516. #ifdef RANGE_16BIT
  517. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  518. #else
  519. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  520. #endif
  521. #ifdef NO_EMBED_CAMERA
  522. "MNDGFX"
  523. #else
  524. "MNDGF"
  525. #endif
  526. #else
  527. #ifdef RANGE_16BIT
  528. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  529. #else
  530. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  531. #endif
  532. #ifdef NO_EMBED_CAMERA
  533. "LFSGFX"
  534. #else
  535. "LFSGF"
  536. #endif
  537. #endif
  538. #endif
  539. #else
  540. #ifdef LGS_PLS_1
  541. #ifdef RANGE_16BIT
  542. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  543. #else
  544. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  545. #endif
  546. #ifdef NO_EMBED_CAMERA
  547. #ifdef LGS_PLS_200
  548. "PLSGFX100"
  549. #else
  550. "PLSGFX1"
  551. #endif
  552. #else
  553. #ifdef LGS_PLS_200
  554. "PLSGFX100"
  555. #else
  556. "PLSGFX1"
  557. #endif
  558. #endif
  559. #else
  560. #ifdef RANGE_16BIT
  561. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  562. #else
  563. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  564. #endif
  565. #ifdef NO_EMBED_CAMERA
  566. "ALSGFX"
  567. #else
  568. "ALSGF"
  569. #endif
  570. #endif
  571. #endif // LGS_MIRROR
  572. #else // ! COMPILE_AS_GETFILE
  573. #ifdef LGS_MIRROR
  574. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  575. #ifdef LGS_FOD
  576. #ifdef RANGE_16BIT
  577. #ifdef STORE_FIRST_SAF
  578. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  579. #else
  580. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  581. #endif
  582. #else
  583. #ifdef STORE_FIRST_SAF
  584. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  585. #else
  586. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  587. #endif
  588. #endif
  589. #ifdef NO_EMBED_CAMERA
  590. "FODX"
  591. #else
  592. "FOD"
  593. #endif
  594. #else
  595. #ifdef RANGE_16BIT
  596. #ifdef STORE_FIRST_SAF
  597. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  598. #else
  599. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  600. #endif
  601. #else
  602. #ifdef STORE_FIRST_SAF
  603. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  604. #else
  605. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  606. #endif
  607. #endif
  608. #ifdef NO_EMBED_CAMERA
  609. "LFSSX"
  610. #else
  611. "LFSS"
  612. #endif
  613. #endif
  614. #else
  615. #ifdef LGS_MND
  616. #ifdef RANGE_16BIT
  617. #ifdef STORE_FIRST_SAF
  618. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  619. #else
  620. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  621. #endif
  622. #else
  623. #ifdef STORE_FIRST_SAF
  624. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  625. #else
  626. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  627. #endif
  628. #endif
  629. #ifdef NO_EMBED_CAMERA
  630. "MNDX"
  631. #else
  632. "MND"
  633. #endif
  634. #else
  635. #ifdef RANGE_16BIT
  636. #ifdef STORE_FIRST_SAF
  637. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  638. #else
  639. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  640. #endif
  641. #else
  642. #ifdef STORE_FIRST_SAF
  643. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  644. #else
  645. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  646. #endif
  647. #endif
  648. #ifdef NO_EMBED_CAMERA
  649. "LFSX"
  650. #else
  651. "LFS"
  652. #endif
  653. #endif
  654. #endif
  655. #else
  656. #ifdef LGS_PLS_1
  657. #ifdef RANGE_16BIT
  658. #ifdef STORE_FIRST_SAF
  659. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  660. #else
  661. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  662. #endif
  663. #else
  664. #ifdef STORE_FIRST_SAF
  665. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  666. #else
  667. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  668. #endif
  669. #endif
  670. #ifdef NO_EMBED_CAMERA
  671. #ifdef LGS_PLS_200
  672. "PLSX100"
  673. #else
  674. "PLSX1"
  675. #endif
  676. #else
  677. #ifdef LGS_PLS_200
  678. "PLS100"
  679. #else
  680. "PLS1"
  681. #endif
  682. #endif
  683. #else
  684. #ifdef RANGE_16BIT
  685. #ifdef STORE_FIRST_SAF
  686. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  687. #else
  688. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  689. #endif
  690. #else
  691. #ifdef STORE_FIRST_SAF
  692. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  693. #else
  694. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  695. #endif
  696. #endif
  697. #ifdef NO_EMBED_CAMERA
  698. #ifdef ALS_300
  699. #ifdef ALS_300_BM
  700. "ALSX20K"
  701. #else
  702. "ALSX300"
  703. #endif
  704. #else
  705. "ALSX"
  706. #endif
  707. #else
  708. #ifdef ALS_300
  709. #ifdef ALS_300_BM
  710. "ALS20K"
  711. #else
  712. "ALS300"
  713. #endif
  714. #else
  715. "ALS"
  716. #endif
  717. #endif
  718. #endif
  719. #endif // LGS_MIRROR
  720. #endif // COMPILE_AS_GETFILE
  721. ,( m_pBoard->getBoardType() == BT_VORTEX_SX || m_pBoard->getBoardType() == BT_VORTEX_DX || m_pBoard->getBoardType() == BT_VORTEX_MX )?"d":"i"
  722. ,( g_bNoBlackTargets )?"B":""
  723. ,(m_pBoard->workingEnabled())?((( m_pBoard->getBoardWM() == WM_BLO_ONLY ) || ( m_pBoard->getBoardWM() == WM_FW_UPGRADE ) )?"BLO":""):"NLC"
  724. ,( g_bWatchDogEnable )?"W":""
  725. #ifdef STORE_FIRST_SAF
  726. #ifdef INFINITE_SAF_STUDY
  727. ,( g_bSAFFreezEnable )?((m_Detector[0].isSAFFrozen())?((g_bSAFFileEnable)?"F":"M"):"S"):"D"
  728. #else
  729. ,( g_bSAFFreezEnable )?((g_bSAFFileEnable)?"F":"M"):"D"
  730. #endif
  731. #endif
  732. //#if defined( LGS_PLS_1 ) || defined( LGS_FOD ) || defined( LGS_STEPPER ) || defined( LGS_MND )
  733. , m_pBoard->GetBFW()
  734. , m_pBoard->GetBSW()
  735. //#endif
  736. , m_pBoard->GetBSN() );
  737. //printf("SW:%s\n", s_pSoftwareVersion );
  738. //printf("Done\n");
  739. #ifdef WATCHDOG_ENABLED
  740. //printf("Start Watchdog\n");
  741. // start watchdog
  742. if( g_bWatchDogEnable ) if( !m_WatchDog.Create() ) return false;
  743. //printf("Done\n");
  744. #endif
  745. #ifndef COMPILE_AS_GETFILE
  746. //printf("Issue Board Reset\n");
  747. //m_pBoard->Reset();
  748. // printf("Done\n");
  749. #endif
  750. #ifndef COMM_WITHOUT_INTERRUPTS
  751. // m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  752. // m_pCameraComm->SetFCT( false ); // Disable usage of timer with Camera Programm Port
  753. if ( ! m_bTimerISR ){ // setup Timer Interupt Procedure
  754. printf("ISR -> Setup Timer!\n");
  755. #ifndef NO_EMBED_CAMERA
  756. if( m_pCameraComm->m_bFollowControlTimer || m_pComm485->m_bFollowControlTimer ) ){
  757. #else
  758. if( m_pComm485->m_bFollowControlTimer ){
  759. #endif
  760. intTimerCC();
  761. m_bTimerISR = initISR( 10 );
  762. } else {
  763. #ifndef NO_EMBED_CAMERA
  764. m_pCameraComm->SetFCT( false ); // Disable usage of WD timer
  765. #endif
  766. m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  767. };
  768. #ifdef DEBUG
  769. printf("Done\n");
  770. #endif
  771. };
  772. #endif
  773. m_bIsCreated = true;
  774. return m_bIsCreated;
  775. };
  776. void CKernel::Destroy(){
  777. #ifdef DEBUG_PRINTOUT_MSGS
  778. if( m_bIsCreated ){
  779. debug("Kernel Destroy");
  780. } else {
  781. debug("Reset Components in Create!");
  782. };
  783. #endif
  784. #ifndef NO_EMBED_CAMERA
  785. if( m_pCamera ){
  786. delete( m_pCamera );
  787. m_pCamera = NULL;
  788. };
  789. if( m_pCameraComm ) {
  790. delete( m_pCameraComm );
  791. m_pCameraComm = NULL;
  792. };
  793. #endif
  794. if( m_pComm485 ) {
  795. delete( m_pComm485 );
  796. m_pComm485 = NULL;
  797. };
  798. #ifndef COMPILE_AS_GETFILE
  799. if ( m_bTimerISR ) resignISR();
  800. #endif
  801. #ifdef DEBUG_PRINTOUT_MSGS
  802. debugProcBegin("GetFile Destroy");
  803. #endif
  804. m_GetFile.Destroy();
  805. #ifdef DEBUG_PRINTOUT_MSGS
  806. debugProcEnd();
  807. debugProcBegin("Protocol Destroy");
  808. #endif
  809. m_Protocol.Destroy();
  810. #ifdef DEBUG_PRINTOUT_MSGS
  811. debugProcEnd();
  812. debugProcBegin("Detector[0] Destroy");
  813. #endif
  814. m_Detector[0].Destroy();
  815. #ifdef DEBUG_PRINTOUT_MSGS
  816. debugProcEnd();
  817. #endif
  818. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  819. #ifdef DEBUG_PRINTOUT_MSGS
  820. debugProcBegin("Detector[1] Destroy");
  821. #endif
  822. m_Detector[1].Destroy();
  823. #ifdef DEBUG_PRINTOUT_MSGS
  824. debugProcEnd();
  825. #endif
  826. #endif
  827. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  828. #ifdef DEBUG_PRINTOUT_MSGS
  829. debugProcBegin("Detector[2] Destroy");
  830. #endif
  831. m_Detector[2].Destroy();
  832. #ifdef DEBUG_PRINTOUT_MSGS
  833. debugProcEnd();
  834. debugProcBegin("Detector[3] Destroy");
  835. #endif
  836. m_Detector[3].Destroy();
  837. #ifdef DEBUG_PRINTOUT_MSGS
  838. debugProcEnd();
  839. debugProcBegin("Tracker[0] Destroy");
  840. #endif
  841. m_Tracker[0].Destroy();
  842. #ifdef DEBUG_PRINTOUT_MSGS
  843. debugProcEnd();
  844. #endif
  845. #else
  846. #ifdef DEBUG_PRINTOUT_MSGS
  847. debugProcBegin("Tracker[0] Destroy");
  848. #endif
  849. m_Tracker[0].Destroy();
  850. #ifdef DEBUG_PRINTOUT_MSGS
  851. debugProcEnd();
  852. #endif
  853. #if !defined(LGS_PLS_1) && !defined( LGS_MND )
  854. #ifdef DEBUG_PRINTOUT_MSGS
  855. debugProcBegin("Tracker[1] Destroy");
  856. #endif
  857. m_Tracker[1].Destroy();
  858. #ifdef DEBUG_PRINTOUT_MSGS
  859. debugProcEnd();
  860. #endif
  861. #endif
  862. #endif
  863. #ifdef DEBUG_PRINTOUT_MSGS
  864. debugProcBegin("Voltage Control Destroy");
  865. #endif
  866. m_Voltage.Destroy();
  867. #ifdef DEBUG_PRINTOUT_MSGS
  868. debugProcEnd();
  869. debugProcBegin("Relay Destroy");
  870. #endif
  871. m_Relay.Destroy();
  872. #ifdef DEBUG_PRINTOUT_MSGS
  873. debugProcEnd();
  874. #endif
  875. #ifndef RANGE_16BIT
  876. #ifdef DEBUG_PRINTOUT_MSGS
  877. debugProcBegin("Calibrator[0] Destroy");
  878. #endif
  879. m_Calibrator[0].Destroy();
  880. #ifdef DEBUG_PRINTOUT_MSGS
  881. debugProcEnd();
  882. #endif
  883. #endif
  884. #ifndef LGS_MIRROR
  885. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  886. #ifndef RANGE_16BIT
  887. #ifdef DEBUG_PRINTOUT_MSGS
  888. debugProcBegin("Calibrator[1] Destroy");
  889. #endif
  890. m_Calibrator[1].Destroy();
  891. #ifdef DEBUG_PRINTOUT_MSGS
  892. debugProcEnd();
  893. #endif
  894. #endif
  895. #endif
  896. #endif
  897. #ifdef DEBUG_PRINTOUT_MSGS
  898. debugProcBegin("Auto-Reset Destroy");
  899. #endif
  900. m_AutoReset.Destroy();
  901. #ifdef DEBUG_PRINTOUT_MSGS
  902. debugProcEnd();
  903. #endif
  904. m_pBoard = NULL;
  905. m_pShadow = NULL;
  906. m_bRun = true;
  907. m_bIsCreated = false;
  908. #ifdef DEBUG_PRINTOUT_MSGS
  909. debug("Exit From Kernel Destroy!");
  910. #endif
  911. }