IQThread.h 1.53 KB
Newer Older
Jean-Luc Pons's avatar
Jean-Luc Pons committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
//+=============================================================================
//
// file :         IQThread.h
//
// description :  Include for the IQThread class.
//                This class is used for reading DD IQ data (TBT)
//
// project :      LiberaSparkSRBPM TANGO Device Server
//
// copyleft :     European Synchrotron Radiation Facility
//                BP 220, Grenoble 38043
//                FRANCE
//
//-=============================================================================

#ifndef LIBERASPARKSRBPM_IQTHREAD_H
#define LIBERASPARKSRBPM_IQTHREAD_H

#include <LiberaSparkSRBPM.h>

namespace LiberaSparkSRBPM_ns {

class IQThread : public omni_thread, public Tango::LogAdapter {

public:

    // Constructor
    IQThread(LiberaSparkSRBPM *,omni_mutex &);
    void *run_undetached(void *);
    bool exitThread;
    string threadStatus;
    bool isConnected;

private:

    vector<BP> iqValues;
    LiberaSparkSRBPM *ds;
    omni_mutex &mutex;

    std::shared_ptr<RSource>      m_dod;
    std::shared_ptr<DodClient>    m_dodClient;
    std::shared_ptr<Int32Buffer>  m_buf;

    bool OpenDod();
    void computePosition(std::shared_ptr<Int32Buffer> dd,size_t nb);

public:

    double *getIa(int *length);
    double *getIb(int *length);
    double *getIc(int *length);
    double *getId(int *length);
    double *getQa(int *length);
    double *getQb(int *length);
    double *getQc(int *length);
    double *getQd(int *length);

    void wakeup();

}; // class IQThread

} // namespace LiberaSparkSRBPM_ns

#endif //LIBERASPARKSRBPM_IQTHREAD_H