iCub-main
dc1394thread.h
Go to the documentation of this file.
1 #ifndef DC1394THREAD_H
2 #define DC1394THREAD_H
3 
4 #include <QThread>
5 #include <yarp/dev/IFrameGrabberControls.h>
6 #include <yarp/dev/IFrameGrabberControlsDC1394.h>
7 #include <yarp/dev/PolyDriver.h>
8 #include <QMutex>
9 #include <QWaitCondition>
10 #include <QSize>
11 #include <QQueue>
12 #include <QVariant>
13 
14 typedef enum {
40  _unknown
42 
43 class DC1394Thread : public QThread
44 {
45  Q_OBJECT
46 
47 
48 
49 public:
50  explicit DC1394Thread(char *loc, char *rem, QObject *parent = 0);
51  void stop();
52  void initFormatTab();
53  void init();
54  void reload();
55  void reset();
56  void loadDefualt();
57  void setTransmissionDC1394(QVariantList arg);
58  void setPowerDC1394(QVariantList arg);
59  void setFormat7WindowDC1394(QVariantList arg);
60  void setVideoModeDC1394(QVariantList arg);
61  void setColorCodingDC1394(QVariantList arg);
62  void setFPSDC1394(QVariantList arg);
63  void setISOSpeedDC1394(QVariantList);
64  void setBytesPerPacketDC1394(QVariantList arg);
65  void setOperationModeDC1394(QVariantList arg);
66 
67  /*** Sliders ***/
68  void sliderRefresh(QVariantList arg);
69  void sliderWBRefresh(QVariantList arg);
70  void sliderPropagate(QVariantList arg);
71  void sliderWBPropagate(QVariantList arg);
72  void sliderSetFeatureDC1394(QVariantList arg);
73  void sliderWBSetFeatureDC1394(QVariantList arg);
74  void sliderOnePush(QVariantList arg);
75  void sliderWBOnePush(QVariantList arg);
76  void sliderRadioAuto(QVariantList arg);
77  void sliderPower(QVariantList arg);
78  void sliderHasFeature(QVariantList arg);
79  bool getCameraDescription(CameraDescriptor *camera);
80 
81 private:
82  yarp::dev::PolyDriver *grabberControl;
83  yarp::dev::IFrameGrabberControls *fgControl;
84  yarp::dev::IFrameGrabberControlsDC1394 *DC1394Control;
85 
86  QMutex semaphore;
87 
88  QMutex mutex;
89  QMutex mutex1;
90  QWaitCondition waitCond;
91  bool keepRunning;
92 
93  QString rem;
94  QString loc;
95 
96 
97  QQueue <QVariantList> taskList;
98 
99  int opCounter;
100 
101 protected:
102  void run();
103 // void initDC1394();
104 
105 signals:
106  void done();
107  void initFormatTabDone(uint,uint,uint);
108  void initDone(uint,uint,uint,
109  bool, uint, QSize, QSize, QSize,
110  QSize,QSize,uint,bool);
111  void reloadDone(uint,uint,QSize, QSize, QSize,
112  QSize,QSize,uint,uint,uint,uint,uint);
113 
114  void resetDone(uint,uint,bool);
115  void loadDefaultDone(uint,uint,bool);
125  void sliderRefreshDone(QObject*,bool,bool,bool,bool,bool,bool,double);
126  void sliderWBRefreshDone(QObject*,bool,bool,bool,bool,bool,bool,double,double);
129  void sliderSetFeatureDC1394Done(QObject*,double);
130  void sliderWBSetFeatureDC1394Done(QObject*,double,double);
131  void sliderOnePushDone(QObject*,double);
132  void sliderWBOnePushDone(QObject*,double,double);
133  void sliderRadioAutoDone(QObject*,bool,bool);
134  void sliderPowerDone(QObject*,bool,bool,bool,bool);
135  void sliderHasFeatureDone(QObject*,bool);
136 
137  void startLoading();
138  void stopLoading();
139 
140 public slots:
141  void doTask(threadFunction);
142  void doTask(threadFunction, QVariantList args);
143 
144 };
145 
146 #endif // DC1394THREAD_H
void sliderPower(QVariantList arg)
void setPowerDC1394Done()
void setFormat7WindowDC1394(QVariantList arg)
void reloadDone(uint, uint, QSize, QSize, QSize, QSize, QSize, uint, uint, uint, uint, uint)
void sliderSetFeatureDC1394Done(QObject *, double)
void setTransmissionDC1394(QVariantList arg)
void sliderWBRefreshDone(QObject *, bool, bool, bool, bool, bool, bool, double, double)
void sliderOnePush(QVariantList arg)
void setFPSDC1394Done()
void startLoading()
void sliderHasFeatureDone(QObject *, bool)
void initFormatTab()
void setBytesPerPacketDC1394(QVariantList arg)
void setTransmissionDC1394Done()
void setColorCodingDC1394(QVariantList arg)
void sliderWBSetFeatureDC1394Done(QObject *, double, double)
void sliderPropagate(QVariantList arg)
void sliderRefresh(QVariantList arg)
void setOperationModeDC1394(QVariantList arg)
void sliderRadioAuto(QVariantList arg)
void sliderSetFeatureDC1394(QVariantList arg)
void loadDefualt()
void sliderOnePushDone(QObject *, double)
void setPowerDC1394(QVariantList arg)
void setISOSpeedDC1394(QVariantList)
void setISOSpeedDC1394Done()
void stopLoading()
void sliderRefreshDone(QObject *, bool, bool, bool, bool, bool, bool, double)
void doTask(threadFunction)
void sliderWBSetFeatureDC1394(QVariantList arg)
void setOperationModeDC1394Done()
void loadDefaultDone(uint, uint, bool)
void sliderWBOnePush(QVariantList arg)
void setColorCodingDC1394Done()
void setVideoModeDC1394Done()
void resetDone(uint, uint, bool)
void setFormat7WindowDC1394Done()
void sliderWBRefresh(QVariantList arg)
void setBytesPerPacketDC1394Done()
void initFormatTabDone(uint, uint, uint)
DC1394Thread(char *loc, char *rem, QObject *parent=0)
Definition: dc1394thread.cpp:6
void sliderPowerDone(QObject *, bool, bool, bool, bool)
void sliderHasFeature(QVariantList arg)
bool getCameraDescription(CameraDescriptor *camera)
void sliderRadioAutoDone(QObject *, bool, bool)
void sliderWBOnePushDone(QObject *, double, double)
void initDone(uint, uint, uint, bool, uint, QSize, QSize, QSize, QSize, QSize, uint, bool)
void setVideoModeDC1394(QVariantList arg)
void sliderWBPropagate(QVariantList arg)
void sliderPropagateDone()
void sliderWBPropagateDone()
void setFPSDC1394(QVariantList arg)
threadFunction
Definition: dc1394thread.h:14
@ _setOperationModeDC1394
Definition: dc1394thread.h:28
@ _setBytesPerPacketDC1394
Definition: dc1394thread.h:27
@ _setFPSDC1394
Definition: dc1394thread.h:25
@ _setPowerDC1394
Definition: dc1394thread.h:21
@ _initFormatTab
Definition: dc1394thread.h:16
@ _setTransmissionDC1394
Definition: dc1394thread.h:20
@ _unknown
Definition: dc1394thread.h:40
@ _sliderOnePush
Definition: dc1394thread.h:35
@ _sliderSetFeature
Definition: dc1394thread.h:33
@ _init
Definition: dc1394thread.h:15
@ _sliderPropagate
Definition: dc1394thread.h:31
@ _sliderWBOnePush
Definition: dc1394thread.h:36
@ _reload
Definition: dc1394thread.h:17
@ _sliderRadioAuto
Definition: dc1394thread.h:37
@ _sliderRefresh
Definition: dc1394thread.h:29
@ _sliderWBPropagate
Definition: dc1394thread.h:32
@ _setVideoModeDC1394
Definition: dc1394thread.h:23
@ _setISOSpeedDC1394
Definition: dc1394thread.h:26
@ _loadDefault
Definition: dc1394thread.h:19
@ _setFormat7WindowDC1394
Definition: dc1394thread.h:22
@ _sliderWBRefresh
Definition: dc1394thread.h:30
@ _sliderPower
Definition: dc1394thread.h:38
@ _reset
Definition: dc1394thread.h:18
@ _setColorCodingDC1394
Definition: dc1394thread.h:24
@ _sliderWBSetFeature
Definition: dc1394thread.h:34
@ _sliderHasFeature
Definition: dc1394thread.h:39