Skip to content
Snippets Groups Projects
Commit c2ec60f5 authored by beuchatp's avatar beuchatp
Browse files

Added destination labels to tuning controller

parent 311d4b0c
No related branches found
No related tags found
No related merge requests found
......@@ -860,6 +860,188 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame_A_left">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:green;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_23">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Destination A</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_A_right">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:green;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>80</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="frame_B_left">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:green;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Destination B</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_B_right">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color:green;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
......@@ -878,7 +1060,7 @@
<item row="9" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>step 2: click toggle button to test the performance</string>
<string>step 2: click toggle button to change the destination</string>
</property>
</widget>
</item>
......
......@@ -55,6 +55,12 @@ TuningControllerTab::TuningControllerTab(QWidget *parent) :
ui->lineEdit_setpoint->setText( QString::number( m_current_setpoint, 'f', DECIMAL_PLACES_SETPOINT) );
ui->frame_A_left->setVisible(false);
ui->frame_A_right->setVisible(false);
ui->frame_B_left->setVisible(false);
ui->frame_B_right->setVisible(false);
#ifdef CATKIN_MAKE
//ros::init();
......@@ -324,13 +330,37 @@ void TuningControllerTab::on_button_setpoint_toggle_clicked()
float new_setpoint = 0.0;
if (setpoint_copy < SETPOINT_X_MINUS)
{
new_setpoint = SETPOINT_X_MINUS;
ui->frame_A_left->setVisible(true);
ui->frame_A_right->setVisible(true);
ui->frame_B_left->setVisible(false);
ui->frame_B_right->setVisible(false);
}
else if (setpoint_copy < 0.0)
{
new_setpoint = SETPOINT_X_PLUS;
ui->frame_A_left->setVisible(false);
ui->frame_A_right->setVisible(false);
ui->frame_B_left->setVisible(true);
ui->frame_B_right->setVisible(true);
}
else if (setpoint_copy > SETPOINT_X_PLUS)
{
new_setpoint = SETPOINT_X_PLUS;
ui->frame_A_left->setVisible(false);
ui->frame_A_right->setVisible(false);
ui->frame_B_left->setVisible(true);
ui->frame_B_right->setVisible(true);
}
else
{
new_setpoint = SETPOINT_X_MINUS;
ui->frame_A_left->setVisible(true);
ui->frame_A_right->setVisible(true);
ui->frame_B_left->setVisible(false);
ui->frame_B_right->setVisible(false);
}
ui->lineEdit_setpoint->setText( QString::number( new_setpoint, 'f', DECIMAL_PLACES_SETPOINT) );
float lineEdit_as_float_rounded = (ui->lineEdit_setpoint->text()).toFloat();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment