To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 9c37a13d authored by beuchatp's avatar beuchatp
Browse files

Added a mutex to the RF status label, and adjust the clearing and updating of...

Added a mutex to the RF status label, and adjust the clearing and updating of the bettery status label, seems to be working without too many freezes... will always require more testing
parent 7a37a533
......@@ -223,6 +223,7 @@ private:
QMutex m_flying_state_mutex;
QMutex voltage_field_mutex;
QMutex battery_status_label_mutex;
QMutex rf_status_label_mutex;
int m_battery_state;
// BATTERY EMPTY VOLTAGES (THESE SHOULD BE READ IN AS PARAMTERS)
//const std::vector<float> m_cutoff_voltages {3.1966, 3.2711, 3.3061, 3.3229, 3.3423, 3.3592, 3.3694, 3.385, 3.4006, 3.4044, 3.4228, 3.4228, 3.4301, 3.4445, 3.4531, 3.4677, 3.4705, 3.4712, 3.4756, 3.483, 3.4944, 3.5008, 3.5008, 3.5084, 3.511, 3.5122, 3.5243, 3.5329, 3.5412, 3.5529, 3.5609, 3.5625, 3.5638, 3.5848, 3.6016, 3.6089, 3.6223, 3.628, 3.6299, 3.6436, 3.6649, 3.6878, 3.6983, 3.7171, 3.7231, 3.7464, 3.7664, 3.7938, 3.8008, 3.816, 3.8313, 3.8482, 3.866, 3.8857, 3.8984, 3.9159, 3.9302, 3.9691, 3.997, 4.14 };
......
......@@ -481,11 +481,13 @@ void MainWindow::setCrazyRadioStatus(int radio_status)
case CONNECTED:
{
// SET THE APPROPRIATE IMAGE FOR THE RADIOSTATUS LABEL
ui->rf_status_label->clear();
rf_status_label_mutex.lock();
//ui->rf_status_label->clear();
QPixmap rf_connected_pixmap(":/images/rf_connected.png");
ui->rf_status_label->setPixmap(rf_connected_pixmap);
ui->rf_status_label->setScaledContents(true);
ui->rf_status_label->update();
//ui->rf_status_label->update();
rf_status_label_mutex.unlock();
// ENABLE THE REMAINDER OF THE GUI
enableGUI();
break;
......@@ -494,22 +496,26 @@ void MainWindow::setCrazyRadioStatus(int radio_status)
case CONNECTING:
{
// SET THE APPROPRIATE IMAGE FOR THE RADIO STATUS LABEL
ui->rf_status_label->clear();
rf_status_label_mutex.lock();
//ui->rf_status_label->clear();
QPixmap rf_connecting_pixmap(":/images/rf_connecting.png");
ui->rf_status_label->setPixmap(rf_connecting_pixmap);
ui->rf_status_label->setScaledContents(true);
ui->rf_status_label->update();
//ui->rf_status_label->update();
rf_status_label_mutex.unlock();
break;
}
case DISCONNECTED:
{
// SET THE APPROPRIATE IMAGE FOR THE RADIO STATUS LABEL
ui->rf_status_label->clear();
rf_status_label_mutex.lock();
//ui->rf_status_label->clear();
QPixmap rf_disconnected_pixmap(":/images/rf_disconnected.png");
ui->rf_status_label->setPixmap(rf_disconnected_pixmap);
ui->rf_status_label->setScaledContents(true);
ui->rf_status_label->update();
//ui->rf_status_label->update();
rf_status_label_mutex.unlock();
// SET THE BATTERY VOLTAGE FIELD TO BE BLANK
QString qstr = "-.-- V";
voltage_field_mutex.lock();
......
Markdown is supported
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