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