05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

SyncObject.h
Go to the documentation of this file.
1
7 #ifndef SYNCOBJECT_H
8 #define SYNCOBJECT_H
9
10 #include <QThread>
11 #include <QTimer>
12 #include <QList>
13 #include <QSemaphore>
14 #include "CameraThread.h"
15 #include "CameraObject.h"
16 #include "ProcessorThread.h"
17 #include "ProcessorObject.h"
21 class SyncObject : public QObject
22 {
23 Q_OBJECT
24
25 public:
26 SyncObject()
27 {
28 //t1=0;
29 //t2=0;
30 fps = 0.0;
31 syncSem = new QSemaphore;
32 syncTimer = new QTimer;
33 connect ( this, SIGNAL( startTimer(int) ), syncTimer, SLOT( start(int) ) );
34 connect ( this, SIGNAL( stopTimer() ), syncTimer, SLOT( stop() ) );
35 isRunning = false;
36
37
38 }
39 ~SyncObject()
40 {
41 qDebug("deleting so");
42 disconnect ( this, SIGNAL( startTimer(int) ), syncTimer, SLOT( start(int) ) );
43 disconnect ( this, SIGNAL( stopTimer() ), syncTimer, SLOT( stop() ) );
44
45 delete syncSem;
46 delete syncTimer;
47 }
48
49 public:
50 QSemaphore * syncSem;
51
52 bool isRunning;
53
54 QList<CameraThread *> getCameraList() const;
55
56 QList<ProcessorThread *> getProcessorList() const;
57
58 private:
59 QTimer * syncTimer;
60 QList<CameraThread*> cameraList;
61 QList<ProcessorThread*> processorList;
62
63 int64 t1,t2;
64 float fps;
65 bool first_run;
66
67 public slots:
68 void startAcquisition(int T);
69 void stopAcquisition();
70 void connectCamera(CameraThread * ct);
71 void disconnectCamera(CameraThread * ct);
72 void connectProcessor(ProcessorThread * pt);
73 void disconnectProcessor(ProcessorThread * pt);
74 void sync();
75
76
77 signals:
78 void startTimer(int);
79 void stopTimer();
80
81 void cStart();
82 void cSync();
83 void cGrab();
84 void cStop();
85
86 void pStart();
87 void pProcess(int,int);
88 void pStop();
89 //void cameraConnected(int id);
90 //void processorConnected(int id);
91 void operationDone();
92 void displayFPS(float);
93
94 };
97 #endif
SyncObject::cStop
void cStop()
SyncObject::cStart
void cStart()
SyncObject::sync
void sync()
ProcessorThread.h
CameraThread.h
SyncObject::disconnectCamera
void disconnectCamera(CameraThread *ct)
SyncObject::cGrab
void cGrab()
SyncObject::startAcquisition
void startAcquisition(int T)
CameraThread
Wrapper object containing single camera working thread.
Definition: CameraThread.h:18
SyncObject::disconnectProcessor
void disconnectProcessor(ProcessorThread *pt)
SyncObject::operationDone
void operationDone()
SyncObject::pStop
void pStop()
SyncObject::displayFPS
void displayFPS(float)
SyncObject::connectProcessor
void connectProcessor(ProcessorThread *pt)
SyncObject
Definition: SyncObject.h:21
CameraObject.h
SyncObject::cSync
void cSync()
SyncObject::startTimer
void startTimer(int)
SyncObject::SyncObject
SyncObject()
Definition: SyncObject.h:26
ProcessorThread
Wrapper object containing single processor working thread.
Definition: ProcessorThread.h:18
SyncObject::syncSem
QSemaphore * syncSem
Definition: SyncObject.h:50
SyncObject::stopTimer
void stopTimer()
SyncObject::stopAcquisition
void stopAcquisition()
SyncObject::getCameraList
QList< CameraThread * > getCameraList() const
SyncObject::connectCamera
void connectCamera(CameraThread *ct)
SyncObject::getProcessorList
QList< ProcessorThread * > getProcessorList() const
SyncObject::~SyncObject
~SyncObject()
Definition: SyncObject.h:39
ProcessorObject.h
SyncObject::isRunning
bool isRunning
Definition: SyncObject.h:52
SyncObject::pProcess
void pProcess(int, int)
SyncObject::pStart
void pStart()