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.

940 lines
28 KiB

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. //printf("Multiprofiles\n");
  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. setActiveDetectionProfile( 1 );
  342. };
  343. //printf("Done\n");
  344. //printf("Create Detectors\n");
  345. #ifdef STORE_FIRST_SAF
  346. #ifdef WATCHDOG_ENABLED
  347. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_MASTER ) ) {
  348. #else
  349. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_MASTER ) ) {
  350. #endif
  351. #else
  352. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  353. #endif
  354. #else
  355. //printf("Singleprofiles Detector\n");
  356. if( !m_Detector[0].Create( BoardSettings.M_LRFDisable, &m_Tracker[0], m_pShadow, 0, _T("init_m.ini") ) ) {
  357. #endif
  358. return false;
  359. };
  360. #ifdef STORE_FIRST_SAF
  361. if( g_bSAFFileEnable ){
  362. m_Detector[0].load_stored_SAF();
  363. };
  364. #endif
  365. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  366. #ifdef DETECTION_MULTI_PROFILES
  367. #ifdef STORE_FIRST_SAF
  368. #ifdef WATCHDOG_ENABLED
  369. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  370. #else
  371. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_SLAVE ) ) {
  372. #endif
  373. #else
  374. if( !m_Detector[1].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  375. #endif
  376. #else
  377. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  378. #endif
  379. return false;
  380. };
  381. #ifdef DETECTION_MULTI_PROFILES
  382. #ifdef STORE_FIRST_SAF
  383. #ifdef WATCHDOG_ENABLED
  384. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  385. #else
  386. if( !m_Detector[2].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_SLAVE ) ) {
  387. #endif
  388. #else
  389. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  390. #endif
  391. #else
  392. if( !m_Detector[2].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, "init_m.ini" ) ){
  393. #endif
  394. return false;
  395. };
  396. #ifdef DETECTION_MULTI_PROFILES
  397. #ifdef STORE_FIRST_SAF
  398. #ifdef WATCHDOG_ENABLED
  399. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  400. #else
  401. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_SLAVE ) ) {
  402. #endif
  403. #else
  404. if( !m_Detector[3].Create( m_LRFDisable.bMaster, &m_Tracker[0], m_pShadow, 0, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  405. #endif
  406. #else
  407. if( !m_Detector[3].Create( m_LRFDisable.bSlave, &m_Tracker[0], m_pShadow, 0, "init_s.ini" ) ){
  408. #endif
  409. return false;
  410. };
  411. #else
  412. //printf("Single Profile\n");
  413. #if !defined ( LGS_PLS_1 ) && !defined( LGS_MND ) //ALS Systems
  414. #ifdef DETECTION_MULTI_PROFILES
  415. #ifdef ALS_300
  416. #ifdef STORE_FIRST_SAF
  417. #ifdef WATCHDOG_ENABLED
  418. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  419. #else
  420. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_SLAVE ) ) {
  421. #endif
  422. #else
  423. if( !m_Detector[1].Create( BoardSettings.S_LRFDisable, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile] ) ) {
  424. #endif
  425. #else
  426. #ifdef STORE_FIRST_SAF
  427. #ifdef WATCHDOG_ENABLED
  428. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], &m_WatchDog, LRF_ID_SLAVE ) ) {
  429. #else
  430. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR )m_pDetectionProfiles[m_bActiveMasterDetectionProfile], LRF_ID_SLAVE ) ) {
  431. #endif
  432. #else
  433. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, ( PCHAR ) m_pDetectionProfiles[m_bActiveSlaveDetectionProfile] ) ) {
  434. #endif
  435. #endif
  436. #else
  437. #ifdef ALS_300
  438. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadowS, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  439. #else
  440. if( !m_Detector[1].Create( m_LRFDisable.bSlave, &m_Tracker[1], m_pShadow, LGS_MAX_DETECTOR_ANGLES / 2, _T("init_s.ini") ) ){
  441. #endif
  442. #endif
  443. return false;
  444. };
  445. #endif
  446. #endif
  447. #ifdef DEBUG
  448. printf("Done\n");
  449. #endif
  450. #ifndef RANGE_16BIT
  451. //printf("Calibrator\n");
  452. if( !m_Calibrator[0].Create( "lt0.ini" ) ) return false;
  453. #ifndef LGS_MIRROR
  454. #ifndef LGS_PLS_1
  455. if( !m_Calibrator[1].Create( "lt1.ini" ) ) return false;
  456. #endif
  457. #endif
  458. //printf("Done\n");
  459. #endif
  460. #endif // ! COMPILE_AS_GETFILE
  461. if( !m_GetFile.Create() ){
  462. return false;
  463. };
  464. #ifdef DEBUG
  465. printf("Get File Done\n");
  466. #endif
  467. //********************************************************
  468. //*
  469. //* GENERATING VERSION STRING
  470. //*
  471. //********************************************************
  472. #ifdef DEBUG
  473. printf("Creating SW String\n");
  474. #endif
  475. #ifdef COMPILE_AS_GETFILE
  476. #ifdef LGS_MIRROR
  477. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  478. #ifdef LGS_FOD
  479. #ifdef RANGE_16BIT
  480. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  481. #else
  482. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  483. #endif
  484. #ifdef NO_EMBED_CAMERA
  485. "FODGFX"
  486. #else
  487. "FODGF"
  488. #endif
  489. #else
  490. #ifdef RANGE_16BIT
  491. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  492. #else
  493. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  494. #endif
  495. #ifdef NO_EMBED_CAMERA
  496. "LFSSGFX"
  497. #else
  498. "LFSSGF"
  499. #endif
  500. #endif
  501. #else
  502. #ifdef LGS_MND
  503. #ifdef RANGE_16BIT
  504. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  505. #else
  506. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  507. #endif
  508. #ifdef NO_EMBED_CAMERA
  509. "MNDGFX"
  510. #else
  511. "MNDGF"
  512. #endif
  513. #else
  514. #ifdef RANGE_16BIT
  515. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  516. #else
  517. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  518. #endif
  519. #ifdef NO_EMBED_CAMERA
  520. "LFSGFX"
  521. #else
  522. "LFSGF"
  523. #endif
  524. #endif
  525. #endif
  526. #else
  527. #ifdef LGS_PLS_1
  528. #ifdef RANGE_16BIT
  529. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  530. #else
  531. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  532. #endif
  533. #ifdef NO_EMBED_CAMERA
  534. #ifdef LGS_PLS_200
  535. "PLSGFX100"
  536. #else
  537. "PLSGFX1"
  538. #endif
  539. #else
  540. #ifdef LGS_PLS_200
  541. "PLSGFX100"
  542. #else
  543. "PLSGFX1"
  544. #endif
  545. #endif
  546. #else
  547. #ifdef RANGE_16BIT
  548. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  549. #else
  550. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  551. #endif
  552. #ifdef NO_EMBED_CAMERA
  553. "ALSGFX"
  554. #else
  555. "ALSGF"
  556. #endif
  557. #endif
  558. #endif // LGS_MIRROR
  559. #else // ! COMPILE_AS_GETFILE
  560. #ifdef LGS_MIRROR
  561. #if defined( LGS_STEPPER ) || defined( LGS_FOD )
  562. #ifdef LGS_FOD
  563. #ifdef RANGE_16BIT
  564. #ifdef STORE_FIRST_SAF
  565. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  566. #else
  567. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  568. #endif
  569. #else
  570. #ifdef STORE_FIRST_SAF
  571. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  572. #else
  573. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  574. #endif
  575. #endif
  576. #ifdef NO_EMBED_CAMERA
  577. "FODX"
  578. #else
  579. "FOD"
  580. #endif
  581. #else
  582. #ifdef RANGE_16BIT
  583. #ifdef STORE_FIRST_SAF
  584. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  585. #else
  586. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  587. #endif
  588. #else
  589. #ifdef STORE_FIRST_SAF
  590. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  591. #else
  592. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  593. #endif
  594. #endif
  595. #ifdef NO_EMBED_CAMERA
  596. "LFSSX"
  597. #else
  598. "LFSS"
  599. #endif
  600. #endif
  601. #else
  602. #ifdef LGS_MND
  603. #ifdef RANGE_16BIT
  604. #ifdef STORE_FIRST_SAF
  605. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  606. #else
  607. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  608. #endif
  609. #else
  610. #ifdef STORE_FIRST_SAF
  611. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  612. #else
  613. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  614. #endif
  615. #endif
  616. #ifdef NO_EMBED_CAMERA
  617. "MNDX"
  618. #else
  619. "MND"
  620. #endif
  621. #else
  622. #ifdef RANGE_16BIT
  623. #ifdef STORE_FIRST_SAF
  624. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  625. #else
  626. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  627. #endif
  628. #else
  629. #ifdef STORE_FIRST_SAF
  630. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  631. #else
  632. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %dM, %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(), LGS_MIRROR,
  633. #endif
  634. #endif
  635. #ifdef NO_EMBED_CAMERA
  636. "LFSX"
  637. #else
  638. "LFS"
  639. #endif
  640. #endif
  641. #endif
  642. #else
  643. #ifdef LGS_PLS_1
  644. #ifdef RANGE_16BIT
  645. #ifdef STORE_FIRST_SAF
  646. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  647. #else
  648. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  649. #endif
  650. #else
  651. #ifdef STORE_FIRST_SAF
  652. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  653. #else
  654. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  655. #endif
  656. #endif
  657. #ifdef NO_EMBED_CAMERA
  658. #ifdef LGS_PLS_200
  659. "PLSX100"
  660. #else
  661. "PLSX1"
  662. #endif
  663. #else
  664. #ifdef LGS_PLS_200
  665. "PLS100"
  666. #else
  667. "PLS1"
  668. #endif
  669. #endif
  670. #else
  671. #ifdef RANGE_16BIT
  672. #ifdef STORE_FIRST_SAF
  673. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  674. #else
  675. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s 16b %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  676. #endif
  677. #else
  678. #ifdef STORE_FIRST_SAF
  679. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s F%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  680. #else
  681. s_nSoftwareVersion = sprintf( s_pSoftwareVersion, "%s %s%s%s%s%s %s %s %s", CLgVersion::GetBuildTimeStr(),
  682. #endif
  683. #endif
  684. #ifdef NO_EMBED_CAMERA
  685. #ifdef ALS_300
  686. #ifdef ALS_300_BM
  687. "ALSX20K"
  688. #else
  689. "ALSX300"
  690. #endif
  691. #else
  692. "ALSX"
  693. #endif
  694. #else
  695. #ifdef ALS_300
  696. #ifdef ALS_300_BM
  697. "ALS20K"
  698. #else
  699. "ALS300"
  700. #endif
  701. #else
  702. "ALS"
  703. #endif
  704. #endif
  705. #endif
  706. #endif // LGS_MIRROR
  707. #endif // COMPILE_AS_GETFILE
  708. ,( m_pBoard->getBoardType() == BT_VORTEX_SX || m_pBoard->getBoardType() == BT_VORTEX_DX || m_pBoard->getBoardType() == BT_VORTEX_MX )?"d":"i"
  709. ,( g_bNoBlackTargets )?"B":""
  710. ,(m_pBoard->workingEnabled())?((( m_pBoard->getBoardWM() == WM_BLO_ONLY ) || ( m_pBoard->getBoardWM() == WM_FW_UPGRADE ) )?"BLO":""):"NLC"
  711. ,( g_bWatchDogEnable )?"W":""
  712. #ifdef STORE_FIRST_SAF
  713. #ifdef INFINITE_SAF_STUDY
  714. ,( g_bSAFFreezEnable )?((m_Detector[0].isSAFFrozen())?((g_bSAFFileEnable)?"F":"M"):"S"):"D"
  715. #else
  716. ,( g_bSAFFreezEnable )?((g_bSAFFileEnable)?"F":"M"):"D"
  717. #endif
  718. #endif
  719. //#if defined( LGS_PLS_1 ) || defined( LGS_FOD ) || defined( LGS_STEPPER ) || defined( LGS_MND )
  720. , m_pBoard->GetBFW()
  721. , m_pBoard->GetBSW()
  722. //#endif
  723. , m_pBoard->GetBSN() );
  724. //printf("SW:%s\n", s_pSoftwareVersion );
  725. //printf("Done\n");
  726. #ifdef WATCHDOG_ENABLED
  727. //printf("Start Watchdog\n");
  728. // start watchdog
  729. if( g_bWatchDogEnable ) if( !m_WatchDog.Create() ) return false;
  730. //printf("Done\n");
  731. #endif
  732. #ifndef COMPILE_AS_GETFILE
  733. //printf("Issue Board Reset\n");
  734. //m_pBoard->Reset();
  735. // printf("Done\n");
  736. #endif
  737. #ifndef COMM_WITHOUT_INTERRUPTS
  738. // m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  739. // m_pCameraComm->SetFCT( false ); // Disable usage of timer with Camera Programm Port
  740. if ( ! m_bTimerISR ){ // setup Timer Interupt Procedure
  741. printf("ISR -> Setup Timer!\n");
  742. #ifndef NO_EMBED_CAMERA
  743. if( m_pCameraComm->m_bFollowControlTimer || m_pComm485->m_bFollowControlTimer ) ){
  744. #else
  745. if( m_pComm485->m_bFollowControlTimer ){
  746. #endif
  747. intTimerCC();
  748. m_bTimerISR = initISR( 10 );
  749. } else {
  750. #ifndef NO_EMBED_CAMERA
  751. m_pCameraComm->SetFCT( false ); // Disable usage of WD timer
  752. #endif
  753. m_pComm485->SetFCT( false ); // Disable usage of timer with Main Programm Port
  754. };
  755. #ifdef DEBUG
  756. printf("Done\n");
  757. #endif
  758. };
  759. #endif
  760. m_bIsCreated = true;
  761. return m_bIsCreated;
  762. };
  763. void CKernel::Destroy(){
  764. #ifdef DEBUG_PRINTOUT_MSGS
  765. if( m_bIsCreated ){
  766. debug("Kernel Destroy");
  767. } else {
  768. debug("Reset Components in Create!");
  769. };
  770. #endif
  771. #ifndef NO_EMBED_CAMERA
  772. if( m_pCamera ){
  773. delete( m_pCamera );
  774. m_pCamera = NULL;
  775. };
  776. if( m_pCameraComm ) {
  777. delete( m_pCameraComm );
  778. m_pCameraComm = NULL;
  779. };
  780. #endif
  781. if( m_pComm485 ) {
  782. delete( m_pComm485 );
  783. m_pComm485 = NULL;
  784. };
  785. #ifndef COMPILE_AS_GETFILE
  786. if ( m_bTimerISR ) resignISR();
  787. #endif
  788. #ifdef DEBUG_PRINTOUT_MSGS
  789. debugProcBegin("GetFile Destroy");
  790. #endif
  791. m_GetFile.Destroy();
  792. #ifdef DEBUG_PRINTOUT_MSGS
  793. debugProcEnd();
  794. debugProcBegin("Protocol Destroy");
  795. #endif
  796. m_Protocol.Destroy();
  797. #ifdef DEBUG_PRINTOUT_MSGS
  798. debugProcEnd();
  799. debugProcBegin("Detector[0] Destroy");
  800. #endif
  801. m_Detector[0].Destroy();
  802. #ifdef DEBUG_PRINTOUT_MSGS
  803. debugProcEnd();
  804. #endif
  805. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  806. #ifdef DEBUG_PRINTOUT_MSGS
  807. debugProcBegin("Detector[1] Destroy");
  808. #endif
  809. m_Detector[1].Destroy();
  810. #ifdef DEBUG_PRINTOUT_MSGS
  811. debugProcEnd();
  812. #endif
  813. #endif
  814. #if defined( LGS_MIRROR ) && !defined( LGS_MND )
  815. #ifdef DEBUG_PRINTOUT_MSGS
  816. debugProcBegin("Detector[2] Destroy");
  817. #endif
  818. m_Detector[2].Destroy();
  819. #ifdef DEBUG_PRINTOUT_MSGS
  820. debugProcEnd();
  821. debugProcBegin("Detector[3] Destroy");
  822. #endif
  823. m_Detector[3].Destroy();
  824. #ifdef DEBUG_PRINTOUT_MSGS
  825. debugProcEnd();
  826. debugProcBegin("Tracker[0] Destroy");
  827. #endif
  828. m_Tracker[0].Destroy();
  829. #ifdef DEBUG_PRINTOUT_MSGS
  830. debugProcEnd();
  831. #endif
  832. #else
  833. #ifdef DEBUG_PRINTOUT_MSGS
  834. debugProcBegin("Tracker[0] Destroy");
  835. #endif
  836. m_Tracker[0].Destroy();
  837. #ifdef DEBUG_PRINTOUT_MSGS
  838. debugProcEnd();
  839. #endif
  840. #if !defined(LGS_PLS_1) && !defined( LGS_MND )
  841. #ifdef DEBUG_PRINTOUT_MSGS
  842. debugProcBegin("Tracker[1] Destroy");
  843. #endif
  844. m_Tracker[1].Destroy();
  845. #ifdef DEBUG_PRINTOUT_MSGS
  846. debugProcEnd();
  847. #endif
  848. #endif
  849. #endif
  850. #ifdef DEBUG_PRINTOUT_MSGS
  851. debugProcBegin("Voltage Control Destroy");
  852. #endif
  853. m_Voltage.Destroy();
  854. #ifdef DEBUG_PRINTOUT_MSGS
  855. debugProcEnd();
  856. debugProcBegin("Relay Destroy");
  857. #endif
  858. m_Relay.Destroy();
  859. #ifdef DEBUG_PRINTOUT_MSGS
  860. debugProcEnd();
  861. #endif
  862. #ifndef RANGE_16BIT
  863. #ifdef DEBUG_PRINTOUT_MSGS
  864. debugProcBegin("Calibrator[0] Destroy");
  865. #endif
  866. m_Calibrator[0].Destroy();
  867. #ifdef DEBUG_PRINTOUT_MSGS
  868. debugProcEnd();
  869. #endif
  870. #endif
  871. #ifndef LGS_MIRROR
  872. #if !defined( LGS_PLS_1 ) && !defined( LGS_MND )
  873. #ifndef RANGE_16BIT
  874. #ifdef DEBUG_PRINTOUT_MSGS
  875. debugProcBegin("Calibrator[1] Destroy");
  876. #endif
  877. m_Calibrator[1].Destroy();
  878. #ifdef DEBUG_PRINTOUT_MSGS
  879. debugProcEnd();
  880. #endif
  881. #endif
  882. #endif
  883. #endif
  884. #ifdef DEBUG_PRINTOUT_MSGS
  885. debugProcBegin("Auto-Reset Destroy");
  886. #endif
  887. m_AutoReset.Destroy();
  888. #ifdef DEBUG_PRINTOUT_MSGS
  889. debugProcEnd();
  890. #endif
  891. m_pBoard = NULL;
  892. m_pShadow = NULL;
  893. m_bRun = true;
  894. m_bIsCreated = false;
  895. #ifdef DEBUG_PRINTOUT_MSGS
  896. debug("Exit From Kernel Destroy!");
  897. #endif
  898. }