/* Bruker.API.CommonTypes.h Header File for Bruker Common-Interface Microsoft Visual Studio 2015 */ #pragma once #ifndef BrukerAPICommonFunctionsH #define BrukerAPICommonFunctionsH #include #include #include #include #include #include namespace BrukerDll { struct TOpenClientOptions; struct TRTAPISpectrumHeaderRec; struct TRTCalibResults; struct TRTCalibSettings; struct TRTDetectorRanges; struct TRTDetectorStatus; struct TRTHardwareConfiguration; struct TRTSpectrometerStatus; #pragma pack(push, 1) // structure to describe a point, should be compatible to Windows.Point struct TPoint { int32_t X; int32_t Y; }; #pragma pack(pop) #pragma pack(push, 1) struct TRTSpectrumHeaderRec { uint8_t IdentifierLength; char Identifier[25]; // 'Rontec XRay spectrum' int32_t Version; // Version information int32_t Size; // Size in byte double DateTime; // Delphi 5.0 version of date and time int32_t ChannelCount; // int32_t ChannelOffset; // First channel index double CalibrationAbs; // Energy of first channel double CalibrationLin; // keV per channel double SigmaAbs; // Sigma^2 energy calibration double SigmaLin; // additional data compared to normal Roentec header int32_t RealTime; // real measure time in ms int32_t LifeTime; // life time in ms }; #pragma pack(pop) typedef TRTSpectrumHeaderRec* PRTSpectrumHeaderRec; #pragma pack(push, 1) struct TRTCalibSettings { int32_t Version; // Version of record structure, should be '1' at the moment int32_t Element1; char* Line1; double Energy1; int32_t Element2; char* Line2; double Energy2; int32_t MaxTime; // Maximum time to calibrate in ms, '0' indicates to use a internal statistics to decide to stop #ifdef BRUKERAPIESPRITH bool ShowProgress; // Show progress information #endif }; #pragma pack(pop) typedef TRTCalibSettings* PRTCalibSettings; #pragma pack(push, 1) struct TRTCalibResults { int32_t Version; double CalibLin, CalibAbs, FWHM, Fano; }; #pragma pack(pop) typedef TRTCalibResults* PRTCalibResults; #pragma pack(push, 1) struct TRTDetectorStatus { int32_t Version; // Version of structure, useful for later extensions int32_t Status; // -1=not present, 0=present but inactive, 1=active uint32_t CountRate; // Current input count rate in cps int32_t Temperature; // Current temperature in °C uint32_t CoolingMode; // Cooling mode (0=off, 1=on, 2=max. 3=heating, 4=unknown) }; #pragma pack(pop) #pragma pack(push, 1) struct TRTSpectrometerStatus { int32_t Version; // Version of structure, useful for later extensions TRTDetectorStatus DetectorStatus[4/*# range 0..3*/];// Detector information uint32_t Status; // 0=not detected, 1=standby, 2=interlock, 3=stopped, 4=running bool Ready; }; #pragma pack(pop) #pragma pack(push, 1) struct TRTDetectorRanges { int32_t MaxEnergy[8/*# range 0..7*/]; int32_t PulseThroughPut[8/*# range 0..7*/]; int32_t EnergyIndexCount; int32_t PulseIndexCount; }; #pragma pack(pop) typedef TRTDetectorRanges* PRTDetectorRanges; #pragma pack(push, 1) struct TRTHardwareConfiguration { int32_t Detector[4]; // [0..3] is SPU bool EBSD; bool Raster; int32_t XrayTube; }; #pragma pack(pop) typedef TRTHardwareConfiguration* PRTHardwareConfiguration; #pragma pack(push, 1) struct TOpenClientOptions { int32_t Version; int32_t GUIMode; bool StartNew; uint8_t IdentifierLength; char TCPHost[64]; // from version 2 uint16_t TCPPort; // from version 2 }; #pragma pack(pop) typedef TOpenClientOptions* POpenClientOptions; enum TAPILogType { allError, allWarning, allInfo }; // noch zu klären // TAPILogTypes = set of TAPILogType; typedef TPoint TPointArray[]; typedef TPointArray* PPointArray; typedef void* TPointerArray[]; typedef void** PPointerArray; // Error constants generated from client program const int32_t IFC_ERROR_IN_EXECUTION = -1; const int32_t IFC_ERROR_WRONG_PARAMETER = -2; const int32_t IFC_ERROR_SPECTRUM_BUFFER_EMPTY = -3; const int32_t IFC_ERROR_PARAMETER_MISSED = -4; const int32_t IFC_ERROR_TOO_MANY_PARAMETERS = -5; const int32_t IFC_ERROR_USER_TERMINATED = -6; const int32_t IFC_ERROR_TIMEOUT = -7; const int32_t IFC_ERROR_UNKNOWN_VALUE_NAME = -8; const int32_t IFC_ERROR_WRONG_VALUE_TYPE = -9; const int32_t IFC_ERROR_WRONG_LICENCE = -10; const int32_t IFC_ERROR_RESULT_BUFFER_INSUFFICIENT = -11; const int32_t IFC_ERROR_HARDWARE_LOCKED = -12; const int32_t IFC_ERROR_SEQUENCE = -13; const int32_t IFC_WARNING_WRONG_ELEMENT = 1; const int32_t IFS_ERROR_PARAMETER_MISSED = -51; // returned by RTIFCServer.dll 24.2.2011 '11' -> '51' const int32_t IFS_ERROR_FUNCTION_NOT_IMPLEMENTED = -52; // returned by RTIFCServer.dll 24.2.2011 '11' -> '52' const int32_t IFS_ERROR_FUNTION_EXCEPTED = -53; // Errors coming from OpenClient() const int32_t CONN_ERROR_UNKNOWN = -21; const int32_t CONN_ERROR_INTERFACE_NOT_CONNECTED = -22; const int32_t CONN_ERROR_PARAMETER_MISSED = -23; const int32_t CONN_ERROR_ANSWER_TIMEOUT = -24; const int32_t CONN_ERROR_SERVER_NOT_RESPONDING = -25; const int32_t CONN_ERROR_RESULT_MISSED = -26; const int32_t CONN_ERROR_NO_INTERFACE = -27; const int32_t CONN_ERROR_INVALID_LOGIN = -28; const int32_t CONN_ERROR_NO_CONNECTION_TO_SERVER = -29; const int32_t CONN_ERROR_SERVER = -30; const int32_t CONN_ERROR_ACTION_ABORTED = -31; // Error constants generated from Bruker.API.*.dll const int32_t ERROR_WRONG_PARAMETER = -101; const int32_t ERROR_FILE_NOT_EXIST = -102; const int32_t ERROR_NO_CONNECTION = -103; const int32_t ERROR_NO_ANSWER = -104; const int32_t ERROR_CAN_NOT_START_PROCESS = -105; const int32_t ERROR_INVALID_RESULT_DATA = -106; const int32_t ERROR_SETTINGS_NOT_FOUND = -107; const int32_t ERROR_NO_SERVER_CONNECTION = -108; // no direct call to server possible (used in '..Direct' calls const int32_t ERROR_IN_EXECUTION = -109; const int32_t ERROR_IFC_BUSY = -110; // State constants generated from Bruker.API.*.dll const int32_t STATE_WAS_RUNNING_BEFORE = -201; bool LoadCommonFunctions(const LPCTSTR LibFile); // Convert int32_t to String std::string IntToString(int32_t number); // Convert Double to String std::string DoubleToString(double number); //---------------------------------------------------------------------------------- // Interface functions of Bruker.API.*.DLL //---------------------------------------------------------------------------------- /// Set active language for interface /// Language identifier, 'ge' for german, any other for english int32_t SetLanguage(char* Language); /// Query all known servers which can be used by API /// Buffer for list of available server names /// Initial size of this buffer int32_t QueryServers(char* pServerList, int32_t BufSize); /// Query all running client programs for a given server /// name of the server to be queried /// Buffer for list of available clients /// Initial size of this buffer int32_t QueryUser(char* pServer, char* pClientBuf, int32_t BufSize); /// Start Esprit and login automatically. Connection is done via Windows messaging, so Esprit must be installed on the same computer /// Password of user with UserName /// Whether to start the user interface or not /// Reference connection identifier, which must be used in all following API calls /// Function call sucessful or not (0 = success, otherwise error) int32_t OpenClient(char* pServer, char* pUser, char* pPassword, bool StartNew, bool GUI, uint32_t& CID); /// Start Esprit and login automatically. Connection is done via Windows messaging, so Esprit must be installed on the same computer /// Password of user with UserName /// Structure with connection options /// Reference connection identifier, which must be used in all following API calls /// Function call sucessful or not (0 = success, otherwise error) int32_t OpenClientEx(char* pServer, char* pUser, char* pPassword, const TOpenClientOptions& Options, uint32_t& CID); /// Login to a running Esprit. Connection is done via TCP, so Esprit can be installed on any computer which is accessible via TCP/IP /// Password of user with UserName /// IP address of the computer with Esprit /// IP port used by Esprit (default port is 5328), Esprit must be running before one can use this function /// Structure with connection options /// Reference connection identifier, which must be used in all following API calls /// Function call sucessful or not (0 = success, otherwise error) int32_t OpenClientTCP(char* pServer, char* pUser, char* pPassword, char* pHost, uint16_t Port, const TOpenClientOptions Options, uint32_t& CID); /// Query some information about a specific connection /// pointer to string to be filled from API with some useful information /// Size of this buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t QueryInfo(uint32_t CID, char* pInfo, int32_t BufSize); /// Close corrent API connection, Esprit remains running, CID cannot be used anymore after this call /// Function call sucessful or not (0 = success, otherwise error) int32_t CloseConnection(uint32_t CID); /// Shutdown Esprit, CID cannot be used anymore after this call /// Function call sucessful or not (0 = success, otherwise error) int32_t CloseClient(uint32_t CID); /// Returns description string for error values /// error value returned from an API call /// buffer to string provided by caller, to be filled from API /// in: Size of this buffer, out: size used /// Function call sucessful or not (0 = success, otherwise error) int32_t GetDebugErrorString(uint32_t CID, int32_t aError, char* pErrorStr, int32_t& BufSize); /// Writes description string for error values to log /// Error value returned from an API call /// Function call sucessful or not (0 = success, otherwise error) int32_t WriteDebugErrorStringToLog(uint32_t CID, int32_t aError); /// Is a specific client connection ok? /// Function call sucessful or not (0 = success, otherwise error) int32_t CheckConnection(uint32_t CID); /// Combines output of several spectrometers into one virtual spectrometer (to increase pulse rate for example) /// bit combination of spectrometers to combine /// Function call sucessful or not (0 = success, otherwise error) int32_t CombineSpectrometer(uint32_t CID, int32_t Devices); /// /// Number of spectrometer (1 in most cases) /// Structure with status information from spectrometers and connected detectors /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerStatus(uint32_t CID, int32_t SPU, TRTSpectrometerStatus& Status); /// /// Number of spectrometer (1 in most cases) /// Number of detector (1 in most cases) /// Cooling mode (0=off, 1=on, 2=max. 3=heating, 4=unknown) /// Function call sucessful or not (0 = success, otherwise error) int32_t SetDetectorCoolingMode(uint32_t CID, int32_t SPU, int32_t Det, int32_t aCoolingMode); /// /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t ResetSpectrometerInterlock(uint32_t CID, int32_t SPU); /// /// Number of spectrometer (1 in most cases) /// Measure time in ms (0 means endless measurement) /// Function call sucessful or not (0 = success, otherwise error) int32_t StartSpectrumMeasurement(uint32_t CID, int32_t Device, uint32_t RealTime); /// /// Number of spectrometer (1 in most cases) /// Life time in ms (>0) /// Function call sucessful or not (0 = success, otherwise error) int32_t StartSpectrumLifeTimeMeasurement(uint32_t CID, int32_t Device, uint32_t LifeTime); /// /// Number of spectrometer (1 in most cases) /// Lower spectrum region borders for counter measurement (in keV) /// Higher spectrum region borders for counter measurement (in keV) /// Counter value for automatic measurement stop /// Function call sucessful or not (0 = success, otherwise error) int32_t StartSpectrumCounterMeasurement(uint32_t CID, int32_t SPU, double StartEnergy, double EndEnergy, uint32_t Counts); /// /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t StopSpectrumMeasurement(uint32_t CID, int32_t Device); /// Read status of ongoing spectrum aquisition /// Number of spectrometer (1 in most cases) /// Aquisition active or not /// State of aquisition in % (100 % means ready) /// /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrumMeasureState(uint32_t CID, int32_t Device, bool& Running, double& State, double& PulseRate); /// Read status of ongoing spectrum aquisition /// Number of spectrometer (1 in most cases) /// Aquisition active or not /// State of aquisition in % (100 % means ready) /// current input pulse rate in cps /// current measure time in ms /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrumMeasureStateEx(uint32_t CID, int32_t Device, bool& Running, double& State, double& PulseRate, int32_t& RealTime); /// Read current spectrum from spectrometer to buffer /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t ReadSpectrum(uint32_t CID, int32_t Device); /// Read current spectrometer configuration /// Number of spectrometer (1 in most cases) /// Index of selected max energy setting /// Index of selected max throughput setting /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerConfiguration(uint32_t CID, int32_t SPU, uint32_t& MaxEnergyIndex, uint32_t& PulseThroughputIndex); /// Read current detector configuration /// Number of spectrometer (1 in most cases) /// Number of detector (1 in most cases) /// Index of selected max energy setting /// Index of selected max throughput setting /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerConfigurationEx(uint32_t CID, int32_t SPU, int32_t Det, uint32_t& MaxEnergyIndex, uint32_t& PulseThroughputIndex); /// Set configuration for a given detector /// Number of spectrometer (1 in most cases) /// Number of detector (1 in most cases) /// Index of selected max energy setting /// Index of selected max throughput setting /// Function call sucessful or not (0 = success, otherwise error) int32_t SetSpectrometerConfiguration(uint32_t CID, int32_t SPU, int32_t Det, const uint32_t MaxEnergyIndex, const uint32_t PulseThroughputIndex); /// Switch detectors into 'active' mode for a given spectrometer /// Number of spectrometer (1 in most cases) /// Active Detectors as bitmask (1 shl 0, etc.) /// Function call sucessful or not (0 = success, otherwise error) int32_t SetActiveDetectors(uint32_t CID, int32_t SPU, const uint32_t Detectors); /// Read active detectors of a given spectrometer /// Number of spectrometer (1 in most cases) /// Active Detectors as bitmask (1 shl 0, etc.) /// Function call sucessful or not (0 = success, otherwise error) int32_t GetActiveDetectors(uint32_t CID, int32_t SPU, uint32_t& Detectors); /// /// Number of spectrometer (1 in most cases) /// Available Detectors as bitmask (1 shl 0, etc.) /// Function call sucessful or not (0 = success, otherwise error) int32_t GetAvailableDetectors(uint32_t CID, int32_t SPU, uint32_t& Detectors); /// Ask for available WDS detetcors /// Number of spectrometer (1 in most cases) /// Available WDS detectors as bitmask (1 shl 0, etc.) /// Function call sucessful or not (0 = success, otherwise error) int32_t GetAvailableWDSDetectors(uint32_t CID, int32_t SPU, uint32_t& Detectors); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t GetHardwareConfiguration(uint32_t CID, TRTHardwareConfiguration& aHardwareConfiguration); /// Perform spectrometer eneryg/channel calibration /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t CalibrateSpectrometer(uint32_t CID, int32_t Device, bool ShowProgress, PRTCalibSettings Settings, PRTCalibResults Results); /// Read a named parameter from spectrometer /// Number of spectrometer (1 in most cases) /// Type of the parameter to read (Byte,Boolean,Word,Integer,Double,Memory) /// Pointer to variable of that type /// if ParamType is Memory than BufSize if size of the memory block described by 'Buffer' /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerParam(uint32_t CID, int32_t Device, char* ParamName, char* ParamType, void* Buffer, int32_t BufSize); /// Reads the amount of available spectrometers /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerCount(uint32_t CID, int32_t& Value); /// Gets SpectrometerRanges (Pulserate and EnergyRange) /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrometerRanges(uint32_t CID, int32_t SPU, int32_t Det, TRTDetectorRanges& aDetectorSettings); /// Read full parameter block of current spectrometer params (needed to create full Bruker spectrum) int32_t GetSpectrometerParams(uint32_t CID, int32_t SPU, void* Buffer, int32_t& BufSize); /// /// Number of buffer (1..n for spectrometer, 0 for loaded spectrum) /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrum(uint32_t CID, int32_t Buffer, PRTSpectrumHeaderRec pSpectrumBuf, int32_t BufSize); /// Quantify spectrum in given buffer, returns /// Number of buffer (1..n for spectrometer, 0 for loaded spectrum) /// Name of the method file, this file must exist /// Function call sucessful or not (0 = success, otherwise error) int32_t QuantifySpectrum(uint32_t CID, int32_t Buffer, char* pMethodName, char* pParams, char* pResultBuf, int32_t ResultBufSize); /// Sends a RCL 2.2 command to spectrometer and returns the answer (see RCL 2.2 description of commands) /// Number of spectrometer (1 in most cases) /// Pointer to zero terminated command string /// Pointer buffer for zero terminated answer string /// Size of this buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t SendRCLCommand(uint32_t CID, int32_t Device, char* pCommand, char* pAnswer, int32_t AnswerBufSize); /// Sends a RCL 2.2 command to spectrometer, does not wait for answer (see RCL 2.2 description of commands) /// Number of spectrometer (1 in most cases) /// Pointer to zero terminated command string /// Function call sucessful or not (0 = success, otherwise error) int32_t SendRCLCommandOnly(uint32_t CID, int32_t Device, char* Command); /// Receives the answer of the above function /// Number of spectrometer (1 in most cases) /// Pointer buffer for zero terminated answer string /// Size of this buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t ReceiveRCLAnswer(uint32_t CID, int32_t Device, char* Answer, int32_t AnswerBufSize); /// Interupts hardware communication to specified device until 'UnlockSpectrometer' is called /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t LockSpectrometer(uint32_t CID, int32_t Device); /// /// Number of spectrometer (1 in most cases) /// Function call sucessful or not (0 = success, otherwise error) int32_t UnlockSpectrometer(uint32_t CID, int32_t Device); /// Load spectrum from file to buffer /// Complete filename for spectrum (normally with *.spx extension) /// Function call sucessful or not (0 = success, otherwise error) int32_t LoadSpectrum(uint32_t CID, char* pFileName); /// Send spectrum back to 'loaded' buffer /// Bruker spectrum buffer /// size of spectrum buffer // Remarks : if one wants to use that function one has to build a complete Bruker spectrum with // functions 'GetSpectrum', 'GetSpectrometerParams' and 'CreateSpectrum' /// Function call sucessful or not (0 = success, otherwise error) int32_t PutSpectrum(uint32_t CID, void* Spectrum, int32_t BufSize); /// Save spectrum buffer to file /// Complete filename for spectrum (normally with *.spx extension) /// Function call sucessful or not (0 = success, otherwise error) int32_t SaveSpectrum(uint32_t CID, int32_t Buffer, char* pFileName); /// Create a complete Bruker spectrum from /// Function call sucessful or not (0 = success, otherwise error) int32_t CreateSpectrum(char* SpectrometerParams, PRTSpectrumHeaderRec SpectrumData, char* ResultData, int32_t& ResultSize); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t GetCorrectedSpectrum(char* SpectrometerParams, PRTSpectrumHeaderRec Spectrum, double* ResultData); /// Show spectrum in Esprit UI /// Function call sucessful or not (0 = success, otherwise error) int32_t ShowSpectrum(uint32_t CID, int32_t Buffer, char* Name); /// Delete spectrum from presentation in UI /// Function call sucessful or not (0 = success, otherwise error) int32_t DeleteSpectrum(uint32_t CID, char* aName); /// Create and return a graphic for spectrum presentation /// Buffer index (0 for loaded spectrum buffer, > 0 for spectrometer buffers) /// Requested graphic width /// Requested graphic Height /// Requested grapghic format (bmp, png, jpeg, tif) /// should be able to save the whole image /// input is maximum, output is really used /// Function call sucessful or not (0 = success, otherwise error) int32_t GetSpectrumGraphic(uint32_t CID, int32_t Buffer, int32_t Width, int32_t Height, char* Format, void* ResultBuf, uint32_t& ResultBufSize); /// Get a list of avaliable hardware profiles from client /// Function call sucessful or not (0 = success, otherwise error) int32_t GetHardwareProfiles(uint32_t CID, char* pProfiles, int32_t BufSize); /// Set a specific hardware profile /// Function call sucessful or not (0 = success, otherwise error) int32_t SetHardwareProfile(uint32_t CID, char* pProfile); /// Get a list of avaliable quantification methods /// Function call sucessful or not (0 = success, otherwise error) int32_t GetQuantificationMethods(uint32_t CID, bool AutomaticOnly, char* pMethods, int32_t BufSize); /// Get a list of predefined elements from a given quant method /// Function call sucessful or not (0 = success, otherwise error) int32_t GetQuantificationMethodElements(uint32_t CID, char* MethodName, char* ElementBuffer, int32_t BufSize); /// Call method editor for a given quant method /// Function call sucessful or not (0 = success, otherwise error) int32_t EditQuantificationMethod(uint32_t CID, char* MethodName); /// Loads a method and saves it again. purpose: rename, conversion from mtd into mtdx /// Function call sucessful or not (0 = success, otherwise error) int32_t CopyQuantificationMethod(uint32_t CID, char* MethodName, char* TargetName, bool ToProfile); /// Get a channel region for desired element and X ray line /// Function call sucessful or not (0 = success, otherwise error) int32_t GetRegionForElement(uint32_t CID, int32_t Buffer, char* Params, char* ResultBuf, int32_t ResultBufSize); // Xray tube functions /// /// tube voltate [Volt] /// tube current [µA] /// index of selected filter /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayTubeSetConfiguration(uint32_t CID, int32_t Tube, uint32_t HighVoltage, uint32_t Current, uint32_t FilterIndex); /// /// tube voltate [Volt] /// tube current [µA] /// index of selected filter /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayTubeGetState(uint32_t CID, int32_t Tube, uint32_t& HighVoltage, uint32_t& Current, uint32_t& FilterIndex, bool& ShutterOpen); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayTubeOpenShutter(uint32_t CID, int32_t Tube); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayTubeCloseShutter(uint32_t CID, int32_t Tube); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayTubeHVOn(uint32_t CID, int32_t Tube, int32_t DestHV, int32_t DestCurrent, bool HVOn); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t XRaySetActiveTube(uint32_t CID, int32_t Tube); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t XRayGetActiveTube(uint32_t CID, int32_t& Tube); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t SetImageExportParameter(uint32_t CID, int32_t ExportImageWidth, bool ExportWithOverlay); // Hypermap functions, function 'HyMapStart' is specific for Esprit/M4 /// /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapStop(uint32_t CID, bool WaitForFrameEnd); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapClearDatabase(uint32_t CID); /// Query status of a hypermap measurement /// acquisition active or not /// state of acquisition in % /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetState(uint32_t CID, bool& Running, double& MeasureState); /// Query status of a hypermap measurement /// acquisition active or not /// state of acquisition in % /// line which is currently scanned (0...map height-1) /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetStateEx(uint32_t CID, bool& Running, double& MeasureState, int32_t& CurrentLine); /// Query spectrum from a specific X/Y location in the map /// X coordinate /// Y coordinate /// Correct the spectrum for detector artefacts or not /// pointer to memory, must have space for one full spectrum /// preallocated size of the spectrum buffer, recommended is a size of 64kB /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetXYSpectrum(uint32_t CID, int32_t X, int32_t Y, bool Corrected, PRTSpectrumHeaderRec SpectrumBuffer, int32_t BufferSize); /// Query spectra from a specific location in the map /// X coordinate /// Y coordinate /// Number of spectra with increasing X coordinate on line Y /// Correct the spectrum for detector artefacts or not /// pointer to array of pointers for spectra, must have space for 'Count' pointers, each with allocated space for a full spectrum /// preallocated size of the spectrum buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetLineSpectra(uint32_t CID, int32_t X, int32_t Y, int32_t Count, bool Corrected, PPointerArray SpectrumBuffer, int32_t BufferSize); /// Query spectra from a specific location in the map, spectra are transmitted compressed internally. Funcction is much faster than "HyMapGetLineSpectra" /// X coordinate /// Y coordinate /// Number of spectra with increasing X coordinate on line Y /// Correct the spectrum for detector artefacts or not /// pointer to array of pointers for spectra, must have space for 'Count' pointers, each with allocated space for a full spectrum /// preallocated size of the spectrum buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetCompressedLineSpectra(uint32_t CID, int32_t X, int32_t Y, int32_t Count, bool Corrected, PPointerArray SpectrumBuffer, int32_t BufferSize); /// /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapQuantifySpectra(uint32_t CID, PPointArray Points, int32_t PointCount, int32_t Binning, char* MethodName, char* Params, char* ResultBuf, int32_t ResultBufSize); /// /// file name /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapSaveToFile(uint32_t CID, char* aFileName); /// Load a hypermap file (*.bcf) /// file name /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapLoadFromFile(unsigned _int32 CID, char* aFileName, int32_t& Width, int32_t& Height, int32_t& DetCount, int32_t& ImgCount); /// /// pointer to memory, must have space for one full spectrum /// size of the above buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetMaxPixelSpectrum(uint32_t CID, PRTSpectrumHeaderRec SpectrumBuffer, int32_t BufferSize); #ifdef BRUKERAPIESPRITH int32_t HyMapQuantifyMaxPixelSpectrum(uint32_t CID, char* MethodName, char* Params, char* ResultBuf, int32_t ResultBufSize); #endif /// /// name of method to be used /// buffer to get a list of atomic numbers as result of element identification /// size of element buffer /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapAutoIdent(uint32_t CID, char* pMethodName, char* pElementBuffer, int32_t ElementBufSize); /// /// Requested graphic format (bmp, png, jpeg, tif) /// the plane to be shown /// should be able to save the whole image /// input is maximum, output is really used /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetImage(uint32_t CID, char* Format, int32_t ImgChannel, void* Buffer, uint32_t& BufferSize); /// /// index of the elemen to be shown /// should be able to save the whole image /// input is maximum, output is really used /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetElementData(uint32_t CID, int32_t ElementIndex, void* Buffer, uint32_t& BufferSize); /// /// Requested graphic format (bmp, png, jpeg, tif) /// the plane to be shown /// should be able to save the whole image /// input is maximum, output is really used /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetElementImage(uint32_t CID, char* Format, int32_t ElementIndex, void* Buffer, uint32_t& BufferSize); /// /// Requested graphic format (bmp, png, jpeg, tif) /// should be able to save the whole image /// input is maximum, output is really used /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapGetMixedMapImage(uint32_t CID, char* Format, void* Buffer, uint32_t& BufferSize); /// /// Image channel /// file name /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapSaveImage(uint32_t CID, int32_t ImgChannel, char* aFileName); /// /// Plane to be shown /// file name /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapSaveElementImage(uint32_t CID, int32_t ElementIndex, char* aFileName); /// /// file name /// Function call sucessful or not (0 = success, otherwise error) int32_t HyMapSaveMixedMapImage(uint32_t CID, char* aFileName); } #endif // BrukerAPICommonFunctionsH