- Main Page
- Classes
- Files

- File List
- File Members

# slsDetectorUsers.h

Go to the documentation of this file.

    00001 #ifndef SLS_DETECTOR_USERS_H
    00002 #define SLS_DETECTOR_USERS_H
    00003
    00004
    00005
    00016 class detectorData;
    00017 class multiSlsDetector;
    00018 class multiSlsDetectorCommand;
    00019
    00020
    00021 #include <stdint.h>
    00022 #include <string>
    00023
    00024
    00025 using namespace std;
    00026
    00027
    00028
    00029 /*
    00030    \mainpage
    00031 <CENTER><H1>API for SLS detectors data acquisition</H1></CENTER>
    00032 <HR>
    00033 */
    00085 class slsDetectorUsers
    00086  {
    00087
    00088  public:
    00089
    00091    slsDetectorUsers(int id=0);
    00092
    00093
    00095    virtual ~slsDetectorUsers();
    00096
    00097
    00098
    00103    string getDetectorDeveloper();
    00104
    00105
    00106
    00111   int setOnline(int const online=-1);
    00112
    00117   void startMeasurement();
    00118
    00123    int stopMeasurement();
    00124
    00129    int getDetectorStatus();
    00130
    00134    string getFilePath();
    00135
    00141    string setFilePath(string s);
    00142
    00147    string getFileName();
    00148
    00155    string setFileName(string s);
    00156
    00161    int getFileIndex();
    00162
    00168    int setFileIndex(int i);
    00169
    00174    string getFlatFieldCorrectionDir();
    00175
    00181    string setFlatFieldCorrectionDir(string dir);
    00182
    00187    string getFlatFieldCorrectionFile();
    00188
    00194    int setFlatFieldCorrectionFile(string fname="");
    00195
    00196
    00197
    00203    int enableFlatFieldCorrection(int i=-1);
    00204
    00210    int enableCountRateCorrection(int i=-1);
    00211
    00217    int enablePixelMaskCorrection(int i=-1);
    00218
    00224    int enableAngularConversion(int i=-1);
    00225
    00228    int enableWriteToFile(int i=-1);
    00229
    00236    int setPositions(int nPos, double *pos);
    00237
    00243    int getPositions(double *pos=NULL);
    00244
    00253    int setDetectorSize(int x0=-1, int y0=-1, int nx=-1, int ny=-1);
    00254
    00255
    00264    int getDetectorSize(int &x0, int &y0, int &nx, int &ny);
    00273    int getMaximumDetectorSize(int &nx, int &ny);
    00274
    00275
    00281    int setBitDepth(int i=-1);
    00282
    00283
    00284
    00290    int setSettings(int isettings=-1);
    00291
    00296    int getThresholdEnergy();
    00297
    00298
    00304    int setThresholdEnergy(int e_eV);
    00305
    00306
    00314    double setExposureTime(double t=-1, bool inseconds=false);
    00315
    00322    double setExposurePeriod(double t=-1, bool inseconds=false);
    00323
    00330    double setDelayAfterTrigger(double t=-1, bool inseconds=false);
    00331
    00337    int64_t setNumberOfGates(int64_t t=-1);
    00338
    00344    int64_t setNumberOfFrames(int64_t t=-1);
    00345
    00351    int64_t setNumberOfCycles(int64_t t=-1);
    00352
    00353
    00359    int setTimingMode(int pol=-1);
    00360
    00366    int readConfigurationFile(string const fname);
    00367
    00368
    00375    int dumpDetectorSetup(string const fname);
    00382    int retrieveDetectorSetup(string const fname);
    00383
    00388    string getDetectorType();
    00389
    00395    int setReceiverMode(int n=-1);
    00396
    00402    void registerDataCallback(int( *userCallback)(detectorData* d, int f, int s, void*), void *pArg);
    00403
    00409    void registerRawDataCallback(int( *userCallback)(double* p, int n, void*), void *pArg);
    00410
    00416   virtual void initDataset(int refresh);
    00417
    00418
    00429   virtual void addFrame(double *data, double pos, double i0, double t, string fname, double var);
    00430
    00439   virtual void finalizeDataset(double *a, double *v, double *e, int &np);
    00440
    00441
    00447    int enableDataStreamingFromReceiver(int i=-1);
    00448
    00449
    00454   int64_t getModuleFirmwareVersion();
    00455
    00461   int64_t getModuleSerialNumber(int imod=-1);
    00462
    00467   int64_t getDetectorFirmwareVersion();
    00468
    00473   int64_t getDetectorSerialNumber();
    00474
    00479   int64_t getDetectorSoftwareVersion();
    00480
    00485   int64_t getThisSoftwareVersion();
    00486
    00492    void registerAcquisitionFinishedCallback(int( *func)(double,int, void*), void *pArg);
    00493
    00499    void registerGetPositionCallback( double (*func)(void*),void *arg);
    00504    void registerConnectChannelsCallback( int (*func)(void*),void *arg);
    00509    void registerDisconnectChannelsCallback( int (*func)(void*),void *arg);
    00514    void registerGoToPositionCallback( int (*func)(double,void*),void *arg);
    00519    void registerGoToPositionNoWaitCallback( int (*func)(double,void*),void *arg);
    00524    void registerGetI0Callback( double (*func)(int,void*),void *arg);
    00525
    00533    string putCommand(int narg, char *args[], int pos=-1);
    00534
    00542    string getCommand(int narg, char *args[], int pos=-1);
    00543
    00544   /************************************************************************
    00545
    00546                            STATIC FUNCTIONS
    00547
    00548   *********************************************************************/
    00549
    00554   static string runStatusType(int s){                                   \
    00555     switch (s) {                                                        \
    00556     case 0:     return string("idle");                                  \
    00557     case 1:       return string("error");                               \
    00558     case 2:      return  string("waiting");                             \
    00559     case 3:      return string("finished");                             \
    00560     case 4:      return string("data");                                 \
    00561     case 5:      return string("running");                              \
    00562     default:       return string("unknown");                            \
    00563     }};
    00564
    00565
    00566
    00572   static int getDetectorSettings(string s){             \
    00573     if (s=="standard") return 0;                        \
    00574     if (s=="fast") return 1;                            \
    00575     if (s=="highgain") return 2;                        \
    00576     if (s=="dynamicgain") return 3;                     \
    00577     if (s=="lowgain") return 4;                         \
    00578     if (s=="mediumgain") return 5;                      \
    00579     if (s=="veryhighgain") return 6;                    \
    00580     return -1;                                   };
    00581
    00586   static string getDetectorSettings(int s){\
    00587     switch(s) {                                         \
    00588     case 0:      return string("standard");\
    00589     case 1:      return string("fast");\
    00590     case 2:      return string("highgain");\
    00591     case 3:    return string("dynamicgain");    \
    00592     case 4:    return string("lowgain");                \
    00593     case 5:    return string("mediumgain");     \
    00594     case 6:    return string("veryhighgain");                   \
    00595     default:    return string("undefined");                     \
    00596     }};
    00597
    00598
    00599
    00606   static string getTimingMode(int f){   \
    00607     switch(f) {                                          \
    00608     case 0:      return string( "auto");                        \
    00609     case 1: return string("trigger");                   \
    00610     case 2: return string("ro_trigger");                                \
    00611     case 3: return string("gating");                    \
    00612     case 4: return string("triggered_gating");  \
    00613     default:    return string( "unknown");                              \
    00614     }      };
    00615
    00622   static int getTimingMode(string s){                                   \
    00623     if (s== "auto") return 0;                                           \
    00624     if (s== "trigger") return 1;                                        \
    00625     if (s== "ro_trigger") return 2;                                     \
    00626     if (s== "gating") return 3;                                         \
    00627     if (s== "triggered_gating") return 4;                               \
    00628     return -1;                                                  };
    00629
    00630  private:
    00631   multiSlsDetector *myDetector;
    00632   multiSlsDetectorCommand *myCmd;
    00633  };
    00634
    00635 #endif

All Classes Files Functions Variables Defines