Commit dce0dfa1 authored by roangel's avatar roangel
Browse files

fixed small detail

parent 4ee74e9b
......@@ -103,6 +103,8 @@ private:
Setpoint m_safe_setpoint;
Setpoint m_custom_setpoint;
int m_battery_state;
ros::Publisher crazyRadioCommandPublisher;
ros::Subscriber crazyRadioStatusSubscriber;
ros::Publisher PPSClientCommandPublisher;
......
......@@ -92,6 +92,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
disableGUI();
highlightSafeControllerTab();
ui->label_battery->setStyleSheet("QLabel { color : red; }");
m_battery_state = BATTERY_STATE_NORMAL;
}
......@@ -109,7 +110,10 @@ void MainWindow::disableGUI()
void MainWindow::enableGUI()
{
// ui->groupBox_general->setEnabled(true);
ui->groupBox_4->setEnabled(true);
if(m_battery_state == BATTERY_STATE_NORMAL)
{
ui->groupBox_4->setEnabled(true);
}
}
void MainWindow::highlightSafeControllerTab()
......@@ -197,10 +201,12 @@ void MainWindow::batteryStateChangedCallback(const std_msgs::Int32& msg)
qstr.append("Low Battery!");
ui->groupBox_4->setEnabled(false);
ui->label_battery->setText(qstr);
m_battery_state = BATTERY_STATE_LOW;
break;
case BATTERY_STATE_NORMAL:
ui->groupBox_4->setEnabled(true);
ui->label_battery->clear();
m_battery_state = BATTERY_STATE_NORMAL;
break;
default:
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment