From: Michal Sojka Date: Fri, 24 Apr 2009 18:42:55 +0000 (+0200) Subject: robomon: Working start plug X-Git-Tag: eb2009~22^2~6^2~1 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/eurobot/public.git/commitdiff_plain/dfe7ba44aef213f03dc9cc7b0e36935ac332cc5e robomon: Working start plug --- diff --git a/src/robomon/RobomonAtlantis.cpp b/src/robomon/RobomonAtlantis.cpp index 87ef3df2..bf1adb72 100644 --- a/src/robomon/RobomonAtlantis.cpp +++ b/src/robomon/RobomonAtlantis.cpp @@ -184,8 +184,8 @@ void RobomonAtlantis::createMiscGroupBox() obstacleSimulationCheckBox->setShortcut(tr("o")); layout->addWidget(obstacleSimulationCheckBox); - startBtn = new QPushButton("Start"); - layout->addWidget(startBtn); + startPlug = new QCheckBox("Start plug"); + layout->addWidget(startPlug); miscGroupBox->setLayout(layout); } @@ -452,8 +452,8 @@ void RobomonAtlantis::createActions() connect(showMapPushButton, SIGNAL(clicked()), this, SLOT(showMap())); - connect(startBtn, SIGNAL(clicked()), this, SLOT(sendStart())); - + connect(startPlug, SIGNAL(stateChanged(int)), this, SLOT(sendStart(int))); + /* obstacle simulation */ simulationEnabled = 0; connect(obstacleSimulationCheckBox, SIGNAL(stateChanged(int)), @@ -1118,8 +1118,8 @@ double RobomonAtlantis::distanceToObstacleHokuyo(int beamnum, Point obstacle, do return distance; } -void RobomonAtlantis::sendStart() +void RobomonAtlantis::sendStart(int plug) { - orte.robot_cmd.start = 1; + orte.robot_cmd.start = plug ? 0 : 1; ORTEPublicationSend(orte.publication_robot_cmd); } diff --git a/src/robomon/RobomonAtlantis.h b/src/robomon/RobomonAtlantis.h index d5b354fd..16df9dad 100644 --- a/src/robomon/RobomonAtlantis.h +++ b/src/robomon/RobomonAtlantis.h @@ -81,7 +81,7 @@ private slots: void pick(); void setBelts(int value); void setChelae(int value); - void sendStart(); + void sendStart(int plug); /************************************************************ * ORTE @@ -182,7 +182,7 @@ private: QLabel *fsm_main_state; QLabel *fsm_act_state; QLabel *fsm_motion_state; - QPushButton *startBtn; + QCheckBox *startPlug; /* robot */ Robot *robotActPos;