12class KilobotExperiment :
public QObject
16 KilobotExperiment() {}
17 virtual ~KilobotExperiment()
21 int serviceInterval = 100;
23 virtual QWidget * createGUI() {
return NULL;}
26 void updateKilobotStates();
27 void getInitialKilobotStates();
28 void experimentComplete();
29 void saveImage(QString);
30 void saveVideoFrames(QString,
unsigned int);
33 void setTrackingType(
int);
34 void sendBroadcastingState(
bool);
37 void drawCircle(QPointF pos,
float r, QColor col,
int thickness, std::string text,
bool transparent=
false);
38 void drawLine(std::vector<cv::Point> pos, QColor col,
int thickness, std::string text,
bool transparent);
40 void drawCircleOnRecordedImage(QPointF pos,
float r, QColor col,
int thickness, std::string text);
41 void clearDrawingsOnRecordedImage();
45 virtual void initialise(
bool) = 0;
46 virtual void stopExperiment() {}
48 void setRuntimeIdentificationLock(
bool lock) {this->runtimeIdentificationLock = lock;}
49 void GetMsgsQueueState(
bool state){ ThereIsMsgsToSend=state;}
62 this->currKilobot = kilobot;
63 updateKilobotState(kilobotCopy);
77 this->currKilobot = kilobot;
79 kilobot->disconnect(SIGNAL(sendUpdateToExperiment(
Kilobot*,
Kilobot)));
81 setupInitialKilobotState(kilobotCopy);
86 emit signalKilobot(msg);
91 bool runtimeIdentificationLock =
false;
92 bool ThereIsMsgsToSend=
false;
94 void setCurrentKilobotEnvironment(KilobotEnvironment * environment) {
95 if (currKilobot != NULL && environment != NULL) {
96 QObject::disconnect(currKilobot,SIGNAL(sendUpdateToHardware(Kilobot)), 0, 0);
97 QObject::connect(currKilobot,SIGNAL(sendUpdateToHardware(Kilobot)), environment, SLOT(updateVirtualSensor(Kilobot)));
101 virtual void updateKilobotState(Kilobot) {}
102 virtual void setupInitialKilobotState(Kilobot) {}
105 Kilobot * currKilobot = NULL;