pixrad.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. // Copyright (c) 2006-2017 THALES. All Rights Reserved.
  2. // All the information contained in this file remain the sole and exclusive
  3. // property of THALES and shall not be disclosed by the recipient to a third
  4. // party without the prior consent of THALES.
  5. /*! \file pixrad.h
  6. Abstract:
  7. This module defines the PixRad API.
  8. It includes :
  9. - the prototypes of the functions that manages the acquisition, storage and correction
  10. of images coming from detectors through acquisition boards.
  11. */
  12. #ifndef PIXRAD_H
  13. #define PIXRAD_H
  14. #include "pixrad-types.h"
  15. #if defined(WIN32)
  16. #if defined(PIXRAD_EXPORTS)
  17. #define PIXRAD_API __declspec(dllexport)
  18. #else
  19. #define PIXRAD_API __declspec(dllimport)
  20. #endif
  21. #else
  22. #define PIXRAD_API __attribute__((visibility("default")))
  23. #endif
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /*
  28. Prototypes of PixRad exported fonctions
  29. */
  30. //! Register the function that will hook the events from PixRad.
  31. /*!
  32. \param eventCallbackProc : [in] address of the function that will hook events
  33. \param customData : [in] arbitrary parameter passed when the callback is called
  34. \return ERR_SUCCESS
  35. */
  36. PIXRAD_API error_status TED_PixRad_RegisterEventCallback( eventCallback_t eventCallbackProc, void* customData = NULL );
  37. //! Unregister the function that hooks the events from PixRad.
  38. /*!
  39. \return ERR_SUCCESS
  40. */
  41. PIXRAD_API error_status TED_PixRad_UnregisterEventCallback( eventCallback_t eventCallbackProc = NULL );
  42. //! Register the function that will hook the output messages from PixRad.
  43. /*!
  44. \param outputCallbackProc : [in] address of the function that will hook messages
  45. \param customData : [in] arbitrary parameter passed when the callback is called
  46. \return ERR_SUCCESS
  47. */
  48. PIXRAD_API error_status TED_PixRad_RegisterOutputMsgCallback( outputCallback_t outputCallbackProc, void* customData = NULL );
  49. //! Unregister the function that will hook the output messages from PixRad.
  50. /*!
  51. \return ERR_SUCCESS
  52. */
  53. PIXRAD_API error_status TED_PixRad_UnregisterOutputMsgCallback( outputCallback_t outputCallbackProc = NULL );
  54. //! Initialise the library, the detectors and boards.//
  55. /*!
  56. This function must be called before any other PixRad functions except register callback functions.
  57. \param workingDirectory : [in] working directory path where library search ini files
  58. \return ERR_SUCCESS if successfull
  59. \return ERR_UNKNOWN_ERROR
  60. \return ERR_CONFIG_PARAMETER, ERR_CONFIG_FILE, ERR_CONFIG_FILE_NOT_FOUND
  61. \return ERR_ACQ_INIT_FAILED, ERR_DETECTOR_INIT_FAILED, ERR_LICENCE
  62. \return ERR_MEMORY_ALLOC
  63. \return ERR_ALREADY_OPEN, ERR_CLOSE_PENDING,
  64. \return ERR_DETECTOR_COMMUNICATION, ERR_DETECTOR_UNREACHABLE
  65. */
  66. PIXRAD_API error_status TED_PixRad_Open( const char* workingDirectory );
  67. //! Free the driver, the memory and eventually stops acquisition to quit correctly.//
  68. /*!
  69. \return ERR_SUCCESS if successfull
  70. \return ERR_ACQ_NOT_CLOSE
  71. */
  72. PIXRAD_API error_status TED_PixRad_Close();
  73. //! Connects a given detector slot using a specified connection path.//
  74. /*!
  75. \param detector : [in] Number of detector
  76. \param connectPath : [in] Connection path
  77. \return ERR_SUCCESS if successfull else error code
  78. */
  79. PIXRAD_API error_status TED_PixRad_Connect( unsigned short detector, const char* connectPath );
  80. //! Disconnects a given detector slot.//
  81. /*!
  82. \param detector : [in] Number of detector
  83. \return ERR_SUCCESS if successfull else error code
  84. */
  85. PIXRAD_API error_status TED_PixRad_Disconnect( unsigned short detector );
  86. //! For locked detectors, requests a session id to initiate communication and to allow to transmit a new counter value.
  87. /*!
  88. \see TED_Pixrad_TransmitDetectorLicenseSessionData to change locking counter
  89. \return ERR_SUCCESS if successfull else error code
  90. \note : In case of ERR_SUCCESS Session ID is transmited asynchronously with an upcoming event
  91. */
  92. PIXRAD_API error_status TED_PixRad_RequestDetectorLicenseSession();
  93. //! For locked detectors when a request session id has been initiated (TED_PixRad_RequestDetectorLicenseSession), allows to cancel it (if one notice that detector can't be unlocked)
  94. //! instead of waiting for a timeout
  95. /*!
  96. \see TED_Pixrad_TransmitDetectorLicenseSessionData to change locking counter
  97. \return ERR_SUCCESS if successfull else error code
  98. \note : In case of ERR_SUCCESS Session ID is transmited asynchronously with an upcoming event
  99. */
  100. PIXRAD_API error_status TED_PixRad_CancelDetectorLicenseSession();
  101. //! For locked detectors, when session id has been retrieved, allows to update locking counter.
  102. /*!
  103. \see TED_PixRad_RequestDetectorLicenseSession to request session id.
  104. \param licenseSessionData : [in] User license session data
  105. \param dataSize : [in] User data size in bytes
  106. \return ERR_SUCCESS if successfull else error code
  107. \note : In case of ERR_SUCCESS user should wait for an asynchronous event to know the status of the update :
  108. - EVT_END_DETECTOR_LICENSE_SESSION_REQUEST if the update is the result of a direct update during an already opened pixrad session
  109. - EVT_DETECTOR_INIT if the update is the result of a connection with a locked detector
  110. */
  111. PIXRAD_API error_status TED_PixRad_TransmitDetectorLicenseSessionData( const char* licenseSessionData, const unsigned short dataSize );
  112. //! Scans detectors to check their availability.//
  113. /*!
  114. Refreshes the list of connected detectors by connecting
  115. new available detectors and removing detectors not available anymore.
  116. \param scanType : [in] type of scan to be performed:
  117. - scan existing detectors
  118. - scan new detectors
  119. - scan both
  120. \return ERR_SUCCESS if successfull else error code
  121. */
  122. PIXRAD_API error_status TED_PixRad_ScanDetectors( scan_type scanType );
  123. //! Set new value for detector's wifi connection ssid/passwd
  124. /*!
  125. \param ssid : [in] New connection ssid
  126. \param passwd : [in] New associated password
  127. \return ERR_SUCCESS if successfull else error code
  128. */
  129. PIXRAD_API error_status TED_PixRad_SwitchSSID( const char* ssid, const char* passwd );
  130. //! Set user metadata in image's header
  131. /*!
  132. \param data : [in] User data
  133. \param dataSize : [in] User data size in bytes
  134. */
  135. PIXRAD_API error_status TED_PixRad_SetImageMetadata( const char* data, const unsigned short dataSize );
  136. //! Set parameters for a given application mode.
  137. /*!
  138. \param applicationMode : [in] application mode
  139. \param parameters : array containing the parameters to apply
  140. \param nbParameters : number of parameters in the set
  141. \return ERR_SUCCESS if successfull else error code
  142. */
  143. PIXRAD_API error_status TED_PixRad_SetApplicationParameters( application_mode applicationMode, const ApplicationParameter* parameters, unsigned int nbParameters );
  144. //! This function starts an image acquisition on a given application mode using the currently defined parameters ( cf. TED_PixRad_SetApplicationParameters ).
  145. /*!
  146. \param applicationMode : [in] application mode
  147. \return ERR_SUCCESS if successfull else error code
  148. */
  149. PIXRAD_API error_status TED_PixRad_ApplicationAcquisition( application_mode applicationMode );
  150. //! This function starts an image acquisition.
  151. /*!
  152. The type of acquisiton defines the image type (offset, X or DM).
  153. The correction applied depends on the value corrections.
  154. \param applicationMode : [in] application mode
  155. \param image : [in] type of acquisition ( cf. TED_PixRad_StartAcquisition arg )
  156. \param correction : [in] value of correction applied
  157. \param data: [in] size of the output image
  158. \param preview : [in] preview
  159. \return ERR_SUCCESS if successfull else error code
  160. */
  161. PIXRAD_API error_status TED_PixRad_StartAcquisition( application_mode applicationMode, image_type image, correction_type correction, data_type data, bool preview = false );
  162. //! This function starts an image acquisition : the second image in case of Dual Energy.
  163. /*!
  164. \param gainReferenceId : [in] number of the gain reference
  165. \return ERR_SUCCESS if successfull else error code
  166. */
  167. PIXRAD_API error_status TED_PixRad_StartFrame( unsigned short gainReferenceId = defaultReferenceId );
  168. //! This function resume a sequence acquisition.
  169. /*!
  170. \return ERR_SUCCESS if successfull else error code
  171. */
  172. PIXRAD_API error_status TED_PixRad_ResumeAcquisition();
  173. //! This function stops a sequence acquisition.
  174. /*!
  175. \return ERR_SUCCESS if successfull else error code
  176. */
  177. PIXRAD_API error_status TED_PixRad_StopAcquisition();
  178. //! This function store an image buffer in fxd file format.
  179. /*!
  180. The image buffer should contain the image previously acquired.
  181. Fxd format is a proprietary format easily readable with the ImageJ image viewer.
  182. \param filePath : [in] The path + name of the file destination
  183. \param bufStruct : [in] the image structure containing the image to store
  184. \return ERR_SUCCESS if successfull else error code
  185. */
  186. PIXRAD_API error_status TED_PixRad_SaveImage( const char* filePath, const AcquisitionImage& bufStruct );
  187. //! This function load an image buffer from an fxd file format.
  188. /*!
  189. The image buffer is allocated and managed inside the function and freed automatically,
  190. so no deallocation must be perform by users programs explicitly.
  191. Fxd format is a proprietary format easily readable with the ImageJ image viewer.
  192. \param filePath : [in] The path + name of the file source
  193. \param bufStruct : [in] the image structure containing the image retrieved from the file
  194. \return ERR_SUCCESS if successfull else error code
  195. */
  196. PIXRAD_API error_status TED_PixRad_LoadImage( const char* filePath, AcquisitionImage& bufStruct );
  197. //! This function returns the last image stored in the detector
  198. /*!
  199. The correction used when the acquisition of the image was requested can be applied to the
  200. image
  201. \param applyCorrection : [in] true to correct the image
  202. \return ERR_SUCCESS if successfull else error code
  203. */
  204. PIXRAD_API error_status TED_PixRad_RecoverLastImage( bool applyCorrection );
  205. //! List stored image in detector
  206. /*!
  207. \return ERR_SUCCESS if successfull else error code
  208. */
  209. PIXRAD_API error_status TED_PixRad_GetStoredImageList( );
  210. //! This function returns the given stored image in the detector
  211. /*!
  212. \param number : [in] the requested stored image number
  213. \param preview : [in] is preview needed
  214. \param full : [in] is full image needed
  215. \param type : [in] needed image format
  216. \return ERR_SUCCESS if successfull else error code
  217. */
  218. PIXRAD_API error_status TED_PixRad_GetStoredImage( unsigned short number, bool preview, bool full, data_type type );
  219. //! This function removes the given stored image in the detector
  220. /*!
  221. \param number : [in] the stored image number to remove
  222. \return ERR_SUCCESS if successfull else error code
  223. */
  224. PIXRAD_API error_status TED_PixRad_RemoveStoredImage( unsigned short number );
  225. //! This function transfers all the stored images into a given directory as fxd files
  226. /*!
  227. \param dirPath : [in] the requested local transfer path
  228. \param preview : [in] is preview needed
  229. \param full : [in] is full image needed
  230. \param type : [in] needed image format
  231. \return ERR_SUCCESS if successfull else error code
  232. */
  233. PIXRAD_API error_status TED_PixRad_TransferStoredImages( const char* dirPath, bool preview, bool full, data_type type );
  234. //! This function removes every image stored in the detector
  235. /*!
  236. \return ERR_SUCCESS if successfull else error code
  237. */
  238. PIXRAD_API error_status TED_PixRad_RemoveAllStoredImages();
  239. //! This function changes the WIFI parameters
  240. /*!
  241. \param scanChannel : [in] true to scan channel
  242. \param channel : [in] channel number, only used if scan channel is false
  243. \param FEPower : [in] power of the front end
  244. \param DSPower : [in] power of the docking station
  245. \return ERR_SUCCESS if successfull else error code
  246. */
  247. PIXRAD_API error_status TED_PixRad_SetWifiParameters( bool scanChannel, unsigned short channel, unsigned short FEPower, unsigned short DSPower );
  248. //! This function changes the detector pattern
  249. /*!
  250. \param pattern : [in] the new detector pattern
  251. \return ERR_SUCCESS if successfull else error code
  252. */
  253. PIXRAD_API error_status TED_PixRad_SetPattern( detector_pattern pattern );
  254. //! Use to get a pointer on the structure that contains information about the software specifications.
  255. /*!
  256. \param configParams : [out] Pointer on the structure
  257. \return ERR_SUCCESS if successfull else error code
  258. */
  259. PIXRAD_API error_status TED_PixRad_GetConfigParameters( ConfigParameters& configParams );
  260. //! Get the current state of the detectors.
  261. /*!
  262. \return ERR_SUCCESS if successfull else error code
  263. */
  264. PIXRAD_API error_status TED_PixRad_GetHardwareStatus();
  265. //! Get the current state of a given detector.
  266. /*!
  267. \param detector : [in] Number of detector
  268. \return ERR_SUCCESS if successfull else error code
  269. */
  270. PIXRAD_API error_status TED_PixRad_GetDetectorHardwareStatus( unsigned short detector );
  271. //! Get the current state of the wifi
  272. /*!
  273. \return ERR_SUCCESS if successfull else error code
  274. */
  275. PIXRAD_API error_status TED_PixRad_GetWifiStatus();
  276. //! Get the current state of the wifi for a given detector
  277. /*!
  278. \param detector : [in] Number of detector
  279. \return ERR_SUCCESS if successfull else error code
  280. */
  281. PIXRAD_API error_status TED_PixRad_GetDetectorWifiStatus( unsigned short detector );
  282. //! Control detector status polling
  283. /*!
  284. \param detector : [in] Number of detector
  285. \param enable : [in] true to enable function, false to disable it
  286. \return ERR_SUCCESS if successfull else error code
  287. */
  288. PIXRAD_API error_status TED_PixRad_DetectorStatusPolling( unsigned short detector, bool enable );
  289. //! Get the all current voltages of the detectors.
  290. /*!
  291. \return ERR_SUCCESS if successfull else error code
  292. */
  293. PIXRAD_API error_status TED_PixRad_GetVoltage();
  294. //! Get the current system status.
  295. /*!
  296. \param systemStatus : [out] pointer on system status
  297. \return ERR_SUCCESS if successfull else error code
  298. */
  299. PIXRAD_API error_status TED_PixRad_GetSystemStatus( SystemStatus& systemStatus );
  300. //! Get the current system calibration time status.
  301. /*!
  302. \param systemCalibrationTimeStatus : [out] pointer on system calibration time status
  303. \return ERR_SUCCESS if successfull else error code
  304. */
  305. PIXRAD_API error_status TED_PixRad_GetSystemCalibrationTimeStatus( SystemCalibrationTimeStatus& systemCalibrationTimeStatus );
  306. //! Get the current system state.
  307. /*!
  308. \param systemState : [out] pointer on system state
  309. \return ERR_SUCCESS if successfull else error code
  310. */
  311. PIXRAD_API error_status TED_PixRad_GetSystemState( system_state& systemState );
  312. //! Set the system in a defined system state.
  313. /*!
  314. By default, the system state is in QUIET_STATE
  315. \param systemState : [in] system state
  316. \return ERR_SUCCESS if successfull else error code
  317. */
  318. PIXRAD_API error_status TED_PixRad_SetSystemState( system_state systemState );
  319. //! Load the gain reference, the offset reference and the defect map in memory.
  320. /*!
  321. All the references corresponding to systemMode are stored in fxd files located in
  322. a path specified in the configuration file.
  323. The fxd file should contains one image, if not, the first image is loaded.
  324. \param applicationMode : [in] application mode
  325. \param operatingMode : [in] operating mode
  326. \param detectorMode : [in] detector mode
  327. \param gainReferenceId : [in] number of the gain reference
  328. \param dmReferenceId : [in] number of the dm reference
  329. \return ERR_SUCCESS if successfull else error code
  330. */
  331. PIXRAD_API error_status TED_PixRad_LoadReferences( application_mode applicationMode = APPLICATION_MODE1, operating_mode operatingMode = OM_DEFAULT, unsigned short detectorMode = defaultDetectorMode,
  332. unsigned short gainReferenceId = defaultReferenceId, unsigned short dmReferenceId = defaultReferenceId );
  333. //! Load the gain reference in memory.
  334. /*!
  335. The references corresponding to systemMode is stored in a fxd file located in
  336. a path specified in the configuration file.
  337. The fxd file should contains one image, if not, the first image is loaded.
  338. \param applicationMode : [in] application mode
  339. \param gainReferenceId : [in] number of the gain reference
  340. \return ERR_SUCCESS if successfull else error code
  341. */
  342. PIXRAD_API error_status TED_PixRad_LoadGainReference( application_mode applicationMode = APPLICATION_MODE1, unsigned short gainReferenceId = defaultReferenceId );
  343. //! Unloand all the references in memory.
  344. /*!
  345. \param applicationMode : [in] application mode
  346. \return ERR_SUCCESS if successfull else error code
  347. */
  348. PIXRAD_API error_status TED_PixRad_UnloadReferences( application_mode applicationMode = APPLICATION_MODE1 );
  349. //! This function sycnhronizes the references between host and detector
  350. /*!
  351. \param applicationMode : [in] application mode
  352. \param type : [in] type of synchronisation
  353. \return ERR_SUCCESS if successfull else error code
  354. */
  355. PIXRAD_API error_status TED_PixRad_SynchronizeReferences( application_mode applicationMode = APPLICATION_MODE1, synchronization_type type = SYNCHRO_BIDIRECTIONAL );
  356. //! This function remove the references of the detector
  357. /*!
  358. \param type : [in] type of removal
  359. \return ERR_SUCCESS if successfull else error code
  360. */
  361. PIXRAD_API error_status TED_PixRad_ClearSynchroReferences( removal_type type = REMOVE_ALL );
  362. //! Acquire and create image references that DON'T need xRays.
  363. /*!
  364. Offset Calibration :
  365. - Acquire a sequence for each offset delay, average and normalise and store it
  366. in the system-delay Offset reference file.
  367. Pixels Cluster Defect Detection
  368. - Calcul the number of pixels cluster defect and their coordinates and then calcul
  369. and save pixels cluster defect reference in the PixelsClusterDefect reference file.
  370. The offset reference is saved in the XXX_OffsetRefZZ_DetModeY.fxd file.
  371. The pixels cluster reference is saved in the XXX_PixelClusterDefectRef_DetModeY.fxd file
  372. XXX represents the Detector Serial-number
  373. Y the Detector mode
  374. ZZ the value concerned in the temporal grid
  375. The gain type is in the name : "GainLinRef" or "GainPolyRef"
  376. Note: The offset standby reference is saved in the XXX_OffsetRefStandby_DetModeY.fxd file
  377. \param applicationMode : [in] application mode
  378. \param operatingMode : [in] operating mode
  379. \param detectorMode : [in] detector mode
  380. \return ERR_SUCCESS if successfull else error code
  381. */
  382. PIXRAD_API error_status TED_PixRad_DarkCalibration( application_mode applicationMode = APPLICATION_MODE1, operating_mode operatingMode = OM_DEFAULT,
  383. unsigned short detectorMode = defaultDetectorMode );
  384. //! Acquire and create image references that need xRays.
  385. /*!
  386. Gain calibration
  387. - Acquire a sequence, averages and stores it
  388. in the system gain reference file specified in the configuration file.
  389. Update Defect Map
  390. - The defectmap is also saved in the XXX_DefectMapRef_DetModeY_Z.fxd file.
  391. The gain reference is saved in the XXX_GainLinRef_DetModeY_W.fxd file (for linear gain)
  392. or XXX_GainPolyRef_DetModeY_W.fxd file (for each gain poly reference file)
  393. XXX represents the Detector Serial-number
  394. Y the Detector mode
  395. Z the Defect map Reference Id
  396. W the Gain Refrence Id
  397. The gain type is in the name : "GainLinRef" or "GainPolyRef"
  398. \param applicationMode : [in] application mode
  399. \param gainReferenceId : [in] number of the gain reference
  400. \param dmReferenceId : [in] number of the dm reference
  401. \return ERR_SUCCESS if successfull else error code
  402. */
  403. PIXRAD_API error_status TED_PixRad_XRayCalibration( application_mode applicationMode = APPLICATION_MODE1, unsigned short gainReferenceId = defaultReferenceId,
  404. unsigned short dmReferenceId = defaultReferenceId );
  405. //! Acquire and create a gain image reference.
  406. /*!
  407. The gain reference is saved in the XXX_GainLinRef_DetModeY_W.fxd file
  408. (for linear gain) or XXX_GainPolyRef_DetModeY_W.fxd file (for all the gain poly references)
  409. XXX represents the Detector Serial-number
  410. Y the Detector mode
  411. W the Gain Id Reference
  412. The gain type is in the name : "GainLinRef" or "GainPolyRef"
  413. \param applicationMode : [in] application mode
  414. \param gainReferenceId : [in] number of the gain reference
  415. \return ERR_SUCCESS if successfull else error code
  416. */
  417. PIXRAD_API error_status TED_PixRad_GainCalibration( application_mode applicationMode = APPLICATION_MODE1, unsigned short gainReferenceId = defaultReferenceId );
  418. //! refresh and save all the offset refrences.
  419. /*!
  420. \param applicationMode : [in] application mode
  421. \return ERR_SUCCESS if successfull else error code
  422. */
  423. PIXRAD_API error_status TED_PixRad_RefreshCalibration( application_mode applicationMode = APPLICATION_MODE1 );
  424. //! generate the dark images for acceptance test (for noiseDSP).
  425. /*!
  426. \param applicationMode : [in] application mode
  427. \return ERR_SUCCESS if successfull else error code
  428. */
  429. PIXRAD_API error_status TED_PixRad_DarkAcceptanceTest( application_mode applicationMode = APPLICATION_MODE1 );
  430. //! generate the images with x-ray for acceptance test (for ECV, sensitivity, dose field flatness).
  431. /*!
  432. \param applicationMode : [in]application mode
  433. \return ERR_SUCCESS if successfull else error code
  434. */
  435. PIXRAD_API error_status TED_PixRad_XRayAcceptanceTest( application_mode applicationMode = APPLICATION_MODE1 );
  436. //! computes the required acceptance test (for ECV).
  437. /*!
  438. \param testType : [in]acceptance test type
  439. \param applicationMode : [in]application mode
  440. \return ERR_SUCCESS if successfull else error code
  441. */
  442. PIXRAD_API error_status TED_PixRad_ComputeAcceptanceTest( acceptance_test testType, application_mode applicationMode = APPLICATION_MODE1 );
  443. //! Cancel calibration or acceptance test.
  444. /*!
  445. \return ERR_SUCCESS if successfull else error code
  446. */
  447. PIXRAD_API error_status TED_PixRad_CancelSequence();
  448. //! allows to pursue calibration or acceptance test
  449. /*!
  450. Customer system needs to pursue calibration on reception of following events:
  451. EVT_DOSE_PARAM_REQUEST , EVT_OFFSET_VALID_LIMIT , EVT_OFFSET_INVALID, EVT_X_DOSE_LEVEL,EVT_X_OBJECT_CHECKED , EVT_SEQUENCE_FAILURE .
  452. \return ERR_SUCCESS if successfull else error code
  453. */
  454. PIXRAD_API error_status TED_PixRad_ResumeSequence();
  455. //! set the detector currently active.
  456. /*!
  457. \param activeDetector : [in] Number of detector
  458. \return ERR_SUCCESS if successfull ERR_ERROR
  459. */
  460. PIXRAD_API error_status TED_PixRad_SetActiveDetector( unsigned short activeDetector );
  461. //! get the detector currently active.
  462. /*!
  463. \param activeDetector : [out] Number of the currently active detector
  464. \return ERR_SUCCESS
  465. */
  466. PIXRAD_API error_status TED_PixRad_GetActiveDetector( unsigned short& activeDetector );
  467. //! save image references after TED_PixRad_StartAcquisition.
  468. /*!
  469. The references are saved to fxd files in XXXXXX_YYYY-MM-DD_HH-MM-SS located in the
  470. "reference path" directory (specified in the configuration file).
  471. \return ERR_SUCCESS if successfull else error code
  472. */
  473. PIXRAD_API error_status TED_PixRad_GetLastAcquisitionData();
  474. //! performs all detector self tests in sequence.
  475. /*!
  476. \return ERR_SUCCESS if successfull else error code
  477. */
  478. PIXRAD_API error_status TED_PixRad_PerformDetectorSelfTest();
  479. //! reset detector.
  480. /*!
  481. \return ERR_SUCCESS if successfull else error code
  482. */
  483. PIXRAD_API error_status TED_PixRad_ResetDetector();
  484. //! Set Output Port.
  485. /*!
  486. \param boardNumber : [in] board number
  487. \param outputPort : [in] set output port of ACQ card
  488. \return ERR_SUCCESS if successfull else error code
  489. */
  490. PIXRAD_API error_status TED_PixRad_SetBoardOutputPort( unsigned short boardNumber, unsigned char outputPort );
  491. //! Get Output Port.
  492. /*!
  493. \param boardNumber : [in] board number
  494. \param outputPort : [out] get output port of ACQ card
  495. \return ERR_SUCCESS if successfull else error code
  496. */
  497. PIXRAD_API error_status TED_PixRad_GetBoardOutputPort( unsigned short boardNumber, unsigned char& outputPort );
  498. //! Get Input Port.
  499. /*!
  500. \param boardNumber : [in] board number
  501. \param inputPort : [out] get input port of ACQ card
  502. \return ERR_SUCCESS if successfull else error code
  503. */
  504. PIXRAD_API error_status TED_PixRad_GetBoardInputPort( unsigned short boardNumber, unsigned char& inputPort );
  505. //! Start the battery calibration
  506. /*!
  507. \return ERR_SUCCESS if successfull else error code
  508. */
  509. PIXRAD_API error_status TED_PixRad_StartBatteryCalibration();
  510. //! End the battery calibration
  511. /*!
  512. \return ERR_SUCCESS if successfull else error code
  513. */
  514. PIXRAD_API error_status TED_PixRad_StopBatteryCalibration();
  515. //! Control a detector function
  516. /*!
  517. \param detectorControl : [in] the detector function to control
  518. \param enable : [in] true to enable function, false to disable it
  519. \return ERR_SUCCESS if successfull else error code
  520. */
  521. PIXRAD_API error_status TED_PixRad_DetectorControl( control_type detectorControl, bool enable );
  522. //! Set a detector parameter value
  523. /*!
  524. \param detectorParameter : [in] the detector parameter to set
  525. \param value : [in] the parameter value to set
  526. \return ERR_SUCCESS if successfull else error code
  527. */
  528. PIXRAD_API error_status TED_PixRad_SetDetectorParameterValue( parameter_type detectorParameter, unsigned int value );
  529. //! Get a detector parameter value
  530. /*!
  531. \param detectorParameter : [in] the detector parameter to get
  532. \return ERR_SUCCESS if successfull else error code
  533. */
  534. PIXRAD_API error_status TED_PixRad_GetDetectorParameterValue( parameter_type detectorParameter );
  535. //! Get detector information
  536. /*!
  537. \param detectorInformation : [in] the detector information to get
  538. \return ERR_SUCCESS if successfull else error code
  539. */
  540. PIXRAD_API error_status TED_PixRad_GetDetectorInformation( information_type detectorInformation );
  541. //! Set detector configuration
  542. /*!
  543. \param detectorConfig : [in] the detector configuration to set
  544. \param parameter : [in] the configuration parameter to set according to the detector config type
  545. \return ERR_SUCCESS if successfull else error code
  546. */
  547. PIXRAD_API error_status TED_PixRad_DetectorConfig( config_type detectorConfig, const void* parameter );
  548. //! Controls specific detector modes
  549. /*!
  550. \param applicationMode : [in] application mode
  551. \param type : [in] application control type
  552. \param enable: [in] true to enable function, false to disable it
  553. \return true if valid, false otherwise
  554. */
  555. PIXRAD_API error_status TED_PixRad_ApplicationControl( application_mode applicationMode, application_control_type controlType, bool enable );
  556. //! Control module polling
  557. /*!
  558. \param enable : [in] true to enable function, false to disable it
  559. \return ERR_SUCCESS if successfull else error code
  560. */
  561. PIXRAD_API error_status TED_PixRad_ModulePolling( bool enable );
  562. //! Get specific info from the given module
  563. /*!
  564. \param moduleNumber : [in] module number
  565. \param infoType : [in] information type (DETECTOR_SERIAL_NUMBER,DETECTOR_SSID,DETECTOR_IP,DETECTOR_HOST_IP)
  566. \return ERR_SUCCESS if successfull else error code
  567. */
  568. PIXRAD_API error_status TED_PixRad_ModuleGetInfo( unsigned short moduleNumber, module_info infoType );
  569. //! Use given module to get infrared id
  570. /*!
  571. \param moduleNumber : [in] module number
  572. \return ERR_SUCCESS if successfull else error code
  573. */
  574. PIXRAD_API error_status TED_PixRad_ModuleGetIrId( unsigned short moduleNumber );
  575. //! Use given module to set new infrared id
  576. /*!
  577. \param moduleNumber : [in] module number
  578. \param irId : [in] the infrared id
  579. \return ERR_SUCCESS if successfull else error code
  580. */
  581. PIXRAD_API error_status TED_PixRad_ModuleSetIrId( unsigned short moduleNumber, unsigned int irId );
  582. //! Use given module to set a new ip configuration
  583. /*!
  584. \param moduleNumber : [in] module number
  585. \param detectorIp : [in] new detector ip
  586. \param hostIp : [in] new host ip
  587. \return ERR_SUCCESS if successfull else error code
  588. */
  589. PIXRAD_API error_status TED_PixRad_ModuleSetIpConfig( unsigned short moduleNumber, const char* detectorIp, const char* hostIp );
  590. //! Use given module to set a new ssid/passwd
  591. /*!
  592. \param moduleNumber : [in] module number
  593. \param ssid : [in] new ssid
  594. \param password : [in] associated password
  595. \return ERR_SUCCESS if successfull else error code
  596. */
  597. PIXRAD_API error_status TED_PixRad_ModuleSwitchSSID( unsigned short moduleNumber, const char* ssid, const char* password );
  598. //! Use given module to set a new network configuration ( new ip configuration + new ip configuration )
  599. /*!
  600. \param moduleNumber : [in] module number
  601. \param ssid : [in] new ssid
  602. \param password : [in] associated password
  603. \param detectorIp : [in] new detector ip
  604. \param hostIp : [in] new host ip
  605. \return ERR_SUCCESS if successfull else error code
  606. */
  607. PIXRAD_API error_status TED_PixRad_ModuleSetNetworkConfig( unsigned short moduleNumber, const char* ssid, const char* password, const char* detectorIp, const char* hostIp );
  608. //! Check the validity of a given detector/host ip configuration
  609. /*!
  610. \param detectorIp : [in] detector ip address ( XX.XX.XX.XX )
  611. \param hostCIDR : [in] host cidr address ( XX.XX.XX.XX/XX )
  612. \return true if valid, false otherwise
  613. */
  614. PIXRAD_API bool TED_PixRad_CheckIpConfig( const char* detectorIp, const char* hostCIDR );
  615. //! Open a new remote storage session on the active detector
  616. /*!
  617. \return ERR_SUCCESS if successfull else error code
  618. */
  619. PIXRAD_API error_status TED_PixRad_OpenRemoteStorageSession();
  620. //! Close the remote storage session on the active detector
  621. /*!
  622. \return ERR_SUCCESS if successfull else error code
  623. */
  624. PIXRAD_API error_status TED_PixRad_CloseRemoteStorageSession();
  625. #ifdef __cplusplus
  626. }
  627. #endif
  628. #endif //PIXRAD_H