Commit a77c0418 authored by Michael Carpenter's avatar Michael Carpenter

Fixed some some graphical glitches in the new RC calibration screen

parent 2f353997
......@@ -49,6 +49,8 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
ui->rollWidget->setName("Roll");
ui->yawWidget->setOrientation(Qt::Horizontal);
ui->yawWidget->setName("Yaw");
ui->pitchWidget->setName("Pitch");
ui->throttleWidget->setName("Throttle");
ui->radio5Widget->setOrientation(Qt::Horizontal);
ui->radio5Widget->setName("Radio 5");
ui->radio6Widget->setOrientation(Qt::Horizontal);
......@@ -72,6 +74,7 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
ui->rcCalibrationButton->setCheckable(true);
connect(ui->rcCalibrationButton, SIGNAL(clicked(bool)), this, SLOT(toggleCalibrationRC(bool)));
connect(ui->setButton, SIGNAL(clicked()), this, SLOT(writeParameters()));
connect(ui->refreshButton,SIGNAL(clicked()),mav,SLOT(requestParameters()));
connect(ui->rcModeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRCModeIndex(int)));
//connect(ui->setTrimButton, SIGNAL(clicked()), this, SLOT(setTrimPositions()));
......@@ -840,13 +843,18 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
updateStatus(QString("Reading from system %1").arg(mav->getUASName()));
// Since a system is now connected, enable the VehicleConfig UI.
ui->tabWidget->setEnabled(true);
//ui->tabWidget->setEnabled(true);
ui->setButton->setEnabled(true);
ui->refreshButton->setEnabled(true);
ui->readButton->setEnabled(true);
ui->writeButton->setEnabled(true);
ui->loadFileButton->setEnabled(true);
ui->saveFileButton->setEnabled(true);
if (mav->getAutopilotTypeName() == "ARDUPILOTMEGA")
{
ui->readButton->hide();
ui->writeButton->hide();
}
}
void QGCVehicleConfig::resetCalibrationRC()
......
......@@ -800,8 +800,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>537</height>
<width>20</width>
<height>20</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
......@@ -1062,11 +1062,120 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QPushButton" name="storeButton">
<property name="text">
<string>Store to EEPROM</string>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QPushButton" name="writeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Copy current parameters in non-permanent memory of the aircraft to permanent memory. Transmit your parameters first to write these.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Write (ROM)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="setButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Set current parameters in non-permanent onboard memory.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Set (UAS)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="readButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Copy parameters from permanent memory to non-permanent current memory of aircraft. DOES NOT update the parameters in this view, click refresh after copying them to get them.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string>Read (ROM)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="refreshButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Load parameters currently in non-permanent memory of aircraft.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Get (UAS)</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="loadFileButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Load parameters from a file on this computer in the view. To write them to the aircraft, use transmit after loading them.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Load (File)</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="saveFileButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Save parameters in this view to a file on this computer.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Save (File)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
......
......@@ -31,7 +31,7 @@ void QGCRadioChannelDisplay::paintEvent(QPaintEvent *event)
painter.drawRect(0,0,width()-1,(height()-1) - (painter.fontMetrics().height() * 2));
painter.setBrush(Qt::SolidPattern);
painter.setPen(QColor::fromRgb(50,255,50));
int newval = (height()-2-(painter.fontMetrics().height() * 2)) * ((float)m_value / 3000.0);
int newval = (height()-2-(painter.fontMetrics().height() * 2)) * ((float)m_value / 3001.0);
int newvaly = (height()-2-(painter.fontMetrics().height() * 2)) - newval;
painter.drawRect(1,newvaly,width()-3,((height()-2) - newvaly - (painter.fontMetrics().height() * 2)));
QString valstr = QString::number(m_value);
......@@ -64,7 +64,7 @@ void QGCRadioChannelDisplay::paintEvent(QPaintEvent *event)
painter.drawRect(0,0,width()-1,(height()-1) - (painter.fontMetrics().height() * 2));
painter.setBrush(Qt::SolidPattern);
painter.setPen(QColor::fromRgb(50,255,50));
painter.drawRect(1,1,(width()-1) * ((float)m_value / 3000.0),(height()-3) - (painter.fontMetrics().height() * 2));
painter.drawRect(1,1,(width()-3) * ((float)m_value / 3000.0),(height()-3) - (painter.fontMetrics().height() * 2));
painter.setPen(QColor::fromRgb(255,255,255));
QString valstr = QString::number(m_value);
painter.drawText((width()/2.0) - (painter.fontMetrics().width(m_name)/2.0),((height()-3) - (painter.fontMetrics().height()*1)),m_name);
......
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