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.

954 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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 = false;
  226. rp.nAutoDelay = 0;
  227. rp.bNormallyClose = false;
  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
  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() ){
  476. return false;
  477. };
  478. #ifdef DEBUG
  479. printf("Get File Done\n");
  480. #endif
  481. //********************************************************
  482. //*
  483. //* GENERATING VERSION STRING
  484. //*
  485. //********************************************************
  486. #ifdef DEBUG
  487. printf("Creating SW String\n");
  488. #endif
  489. #ifdef COMPILE_AS_GETFILE
  490. #ifdef LGS_MIRROR
  491. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  492. #ifdef LGS_FOD
  493. #ifdef RANGE_16BIT
  494. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  495. #else
  496. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  497. #endif
  498. #ifdef NO_EMBED_CAMERA
  499. "FODGFX"
  500. #else
  501. "FODGF"
  502. #endif
  503. #else
  504. #ifdef RANGE_16BIT
  505. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  506. #else
  507. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  508. #endif
  509. #ifdef NO_EMBED_CAMERA
  510. "LFSSGFX"
  511. #else
  512. "LFSSGF"
  513. #endif
  514. #endif
  515. #else
  516. #ifdef LGS_MND
  517. #ifdef RANGE_16BIT
  518. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  519. #else
  520. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  521. #endif
  522. #ifdef NO_EMBED_CAMERA
  523. "MNDGFX"
  524. #else
  525. "MNDGF"
  526. #endif
  527. #else
  528. #ifdef RANGE_16BIT
  529. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  530. #else
  531. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  532. #endif
  533. #ifdef NO_EMBED_CAMERA
  534. "LFSGFX"
  535. #else
  536. "LFSGF"
  537. #endif
  538. #endif
  539. #endif
  540. #else
  541. #ifdef LGS_PLS_1
  542. #ifdef RANGE_16BIT
  543. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  544. #else
  545. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  546. #endif
  547. #ifdef NO_EMBED_CAMERA
  548. #ifdef LGS_PLS_200
  549. "PLSGFX100"
  550. #else
  551. "PLSGFX1"
  552. #endif
  553. #else
  554. #ifdef LGS_PLS_200
  555. "PLSGFX100"
  556. #else
  557. "PLSGFX1"
  558. #endif
  559. #endif
  560. #else
  561. #ifdef RANGE_16BIT
  562. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  563. #else
  564. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  565. #endif
  566. #ifdef NO_EMBED_CAMERA
  567. "ALSGFX"
  568. #else
  569. "ALSGF"
  570. #endif
  571. #endif
  572. #endif // LGS_MIRROR
  573. #else // ! COMPILE_AS_GETFILE
  574. #ifdef LGS_MIRROR
  575. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  576. #ifdef LGS_FOD
  577. #ifdef RANGE_16BIT
  578. #ifdef STORE_FIRST_SAF
  579. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  580. #else
  581. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  582. #endif
  583. #else
  584. #ifdef STORE_FIRST_SAF
  585. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  586. #else
  587. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  588. #endif
  589. #endif
  590. #ifdef NO_EMBED_CAMERA
  591. "FODX"
  592. #else
  593. "FOD"
  594. #endif
  595. #else
  596. #ifdef RANGE_16BIT
  597. #ifdef STORE_FIRST_SAF
  598. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  599. #else
  600. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  601. #endif
  602. #else
  603. #ifdef STORE_FIRST_SAF
  604. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  605. #else
  606. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  607. #endif
  608. #endif
  609. #ifdef NO_EMBED_CAMERA
  610. "LFSSX"
  611. #else
  612. "LFSS"
  613. #endif
  614. #endif
  615. #else
  616. #ifdef LGS_MND
  617. #ifdef RANGE_16BIT
  618. #ifdef STORE_FIRST_SAF
  619. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  620. #else
  621. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  622. #endif
  623. #else
  624. #ifdef STORE_FIRST_SAF
  625. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  626. #else
  627. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  628. #endif
  629. #endif
  630. #ifdef NO_EMBED_CAMERA
  631. "MNDX"
  632. #else
  633. "MND"
  634. #endif
  635. #else
  636. #ifdef RANGE_16BIT
  637. #ifdef STORE_FIRST_SAF
  638. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  639. #else
  640. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  641. #endif
  642. #else
  643. #ifdef STORE_FIRST_SAF
  644. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  645. #else
  646. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  647. #endif
  648. #endif
  649. #ifdef NO_EMBED_CAMERA
  650. "LFSX"
  651. #else
  652. "LFS"
  653. #endif
  654. #endif
  655. #endif
  656. #else
  657. #ifdef LGS_PLS_1
  658. #ifdef RANGE_16BIT
  659. #ifdef STORE_FIRST_SAF
  660. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  661. #else
  662. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  663. #endif
  664. #else
  665. #ifdef STORE_FIRST_SAF
  666. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  667. #else
  668. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  669. #endif
  670. #endif
  671. #ifdef NO_EMBED_CAMERA
  672. #ifdef LGS_PLS_200
  673. "PLSX100"
  674. #else
  675. "PLSX1"
  676. #endif
  677. #else
  678. #ifdef LGS_PLS_200
  679. "PLS100"
  680. #else
  681. "PLS1"
  682. #endif
  683. #endif
  684. #else
  685. #ifdef RANGE_16BIT
  686. #ifdef STORE_FIRST_SAF
  687. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  688. #else
  689. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  690. #endif
  691. #else
  692. #ifdef STORE_FIRST_SAF
  693. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  694. #else
  695. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  696. #endif
  697. #endif
  698. #ifdef NO_EMBED_CAMERA
  699. #ifdef ALS_300
  700. #ifdef ALS_300_BM
  701. "ALSX20K"
  702. #else
  703. "ALSX300"
  704. #endif
  705. #else
  706. "ALSX"
  707. #endif
  708. #else
  709. #ifdef ALS_300
  710. #ifdef ALS_300_BM
  711. "ALS20K"
  712. #else
  713. "ALS300"
  714. #endif
  715. #else
  716. "ALS"
  717. #endif
  718. #endif
  719. #endif
  720. #endif // LGS_MIRROR
  721. #endif // COMPILE_AS_GETFILE
  722. ,( m_pBoard->getBoardType() == BT_VORTEX_SX || m_pBoard->getBoardType() == BT_VORTEX_DX || m_pBoard->getBoardType() == BT_VORTEX_MX )?"d":"i"
  723. ,( g_bNoBlackTargets )?"B":""
  724. ,(m_pBoard->workingEnabled())?((( m_pBoard->getBoardWM() == WM_BLO_ONLY ) || ( m_pBoard->getBoardWM() == WM_FW_UPGRADE ) )?"BLO":""):"NLC"
  725. ,( g_bWatchDogEnable )?"W":""
  726. #ifdef STORE_FIRST_SAF
  727. #ifdef INFINITE_SAF_STUDY
  728. ,( g_bSAFFreezEnable )?((m_Detector[0].isSAFFrozen())?((g_bSAFFileEnable)?"F":"M"):"S"):"D"
  729. #else
  730. ,( g_bSAFFreezEnable )?((g_bSAFFileEnable)?"F":"M"):"D"
  731. #endif
  732. #endif
  733. //#if defined( LGS_PLS_1 ) || defined( LGS_FOD ) || defined( LGS_STEPPER ) || defined( LGS_MND )
  734. , m_pBoard->GetBFW()
  735. , m_pBoard->GetBSW()
  736. //#endif
  737. , m_pBoard->GetBSN() );
  738. //printf("SW:%s\n", s_pSoftwareVersion );
  739. //printf("Done\n");
  740. #ifdef WATCHDOG_ENABLED
  741. //printf("Start Watchdog\n");
  742. // start watchdog
  743. if( g_bWatchDogEnable ) if( !m_WatchDog.Create() ) return false;
  744. //printf("Done\n");
  745. #endif
  746. #ifndef COMPILE_AS_GETFILE
  747. //printf("Issue Board Reset\n");
  748. //m_pBoard->Reset();
  749. // printf("Done\n");
  750. #endif
  751. #ifndef COMM_WITHOUT_INTERRUPTS
  752. // m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  753. // m_pCameraComm->SetFCT( false ); // Disable usage of timer with Camera Programm Port
  754. if ( ! m_bTimerISR ){ // setup Timer Interupt Procedure
  755. printf("ISR -> Setup Timer!\n");
  756. #ifndef NO_EMBED_CAMERA
  757. if( m_pCameraComm->m_bFollowControlTimer || m_pComm485->m_bFollowControlTimer ) ){
  758. #else
  759. if( m_pComm485->m_bFollowControlTimer ){
  760. #endif
  761. intTimerCC();
  762. m_bTimerISR = initISR( 10 );
  763. } else {
  764. #ifndef NO_EMBED_CAMERA
  765. m_pCameraComm->SetFCT( false ); // Disable usage of WD timer
  766. #endif
  767. m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  768. };
  769. #ifdef DEBUG
  770. printf("Done\n");
  771. #endif
  772. };
  773. #endif
  774. m_bIsCreated = true;
  775. return m_bIsCreated;
  776. };
  777. void CKernel::Destroy(){
  778. #ifdef DEBUG_PRINTOUT_MSGS
  779. if( m_bIsCreated ){
  780. debug("Kernel Destroy");
  781. } else {
  782. debug("Reset Components in Create!");
  783. };
  784. #endif
  785. #ifndef NO_EMBED_CAMERA
  786. if( m_pCamera ){
  787. delete( m_pCamera );
  788. m_pCamera = NULL;
  789. };
  790. if( m_pCameraComm ) {
  791. delete( m_pCameraComm );
  792. m_pCameraComm = NULL;
  793. };
  794. #endif
  795. if( m_pComm485 ) {
  796. delete( m_pComm485 );
  797. m_pComm485 = NULL;
  798. };
  799. #ifndef COMPILE_AS_GETFILE
  800. if ( m_bTimerISR ) resignISR();
  801. #endif
  802. #ifdef DEBUG_PRINTOUT_MSGS
  803. debugProcBegin("GetFile Destroy");
  804. #endif
  805. m_GetFile.Destroy();
  806. #ifdef DEBUG_PRINTOUT_MSGS
  807. debugProcEnd();
  808. debugProcBegin("Protocol Destroy");
  809. #endif
  810. m_Protocol.Destroy();
  811. #ifdef DEBUG_PRINTOUT_MSGS
  812. debugProcEnd();
  813. debugProcBegin("Detector[0] Destroy");
  814. #endif
  815. m_Detector[0].Destroy();
  816. #ifdef DEBUG_PRINTOUT_MSGS
  817. debugProcEnd();
  818. #endif
  819. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  820. #ifdef DEBUG_PRINTOUT_MSGS
  821. debugProcBegin("Detector[1] Destroy");
  822. #endif
  823. m_Detector[1].Destroy();
  824. #ifdef DEBUG_PRINTOUT_MSGS
  825. debugProcEnd();
  826. #endif
  827. #endif
  828. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  829. #ifdef DEBUG_PRINTOUT_MSGS
  830. debugProcBegin("Detector[2] Destroy");
  831. #endif
  832. m_Detector[2].Destroy();
  833. #ifdef DEBUG_PRINTOUT_MSGS
  834. debugProcEnd();
  835. debugProcBegin("Detector[3] Destroy");
  836. #endif
  837. m_Detector[3].Destroy();
  838. #ifdef DEBUG_PRINTOUT_MSGS
  839. debugProcEnd();
  840. debugProcBegin("Tracker[0] Destroy");
  841. #endif
  842. m_Tracker[0].Destroy();
  843. #ifdef DEBUG_PRINTOUT_MSGS
  844. debugProcEnd();
  845. #endif
  846. #else
  847. #ifdef DEBUG_PRINTOUT_MSGS
  848. debugProcBegin("Tracker[0] Destroy");
  849. #endif
  850. m_Tracker[0].Destroy();
  851. #ifdef DEBUG_PRINTOUT_MSGS
  852. debugProcEnd();
  853. #endif
  854. #if !defined(LGS_PLS_1) && !defined( LGS_MND )
  855. #ifdef DEBUG_PRINTOUT_MSGS
  856. debugProcBegin("Tracker[1] Destroy");
  857. #endif
  858. m_Tracker[1].Destroy();
  859. #ifdef DEBUG_PRINTOUT_MSGS
  860. debugProcEnd();
  861. #endif
  862. #endif
  863. #endif
  864. #ifdef DEBUG_PRINTOUT_MSGS
  865. debugProcBegin("Voltage Control Destroy");
  866. #endif
  867. m_Voltage.Destroy();
  868. #ifdef DEBUG_PRINTOUT_MSGS
  869. debugProcEnd();
  870. debugProcBegin("Relay Destroy");
  871. #endif
  872. m_Relay.Destroy();
  873. #ifdef DEBUG_PRINTOUT_MSGS
  874. debugProcEnd();
  875. #endif
  876. #ifndef RANGE_16BIT
  877. #ifdef DEBUG_PRINTOUT_MSGS
  878. debugProcBegin("Calibrator[0] Destroy");
  879. #endif
  880. m_Calibrator[0].Destroy();
  881. #ifdef DEBUG_PRINTOUT_MSGS
  882. debugProcEnd();
  883. #endif
  884. #endif
  885. #ifndef LGS_MIRROR
  886. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  887. #ifndef RANGE_16BIT
  888. #ifdef DEBUG_PRINTOUT_MSGS
  889. debugProcBegin("Calibrator[1] Destroy");
  890. #endif
  891. m_Calibrator[1].Destroy();
  892. #ifdef DEBUG_PRINTOUT_MSGS
  893. debugProcEnd();
  894. #endif
  895. #endif
  896. #endif
  897. #endif
  898. #ifdef DEBUG_PRINTOUT_MSGS
  899. debugProcBegin("Auto-Reset Destroy");
  900. #endif
  901. m_AutoReset.Destroy();
  902. #ifdef DEBUG_PRINTOUT_MSGS
  903. debugProcEnd();
  904. #endif
  905. m_pBoard = NULL;
  906. m_pShadow = NULL;
  907. m_bRun = true;
  908. m_bIsCreated = false;
  909. #ifdef DEBUG_PRINTOUT_MSGS
  910. debug("Exit From Kernel Destroy!");
  911. #endif
  912. }