Commit 9f94fef5 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #73 from Susurrus/linechart_adj

Linechart UI improvements
parents 1b8cec27 387e4884
...@@ -25,8 +25,11 @@ ...@@ -25,8 +25,11 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout" columnstretch="5,5,5,5,100"> <property name="styleSheet">
<item row="0" column="0" colspan="4"> <string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="5,0,0">
<item row="0" column="0" rowspan="3">
<widget class="QGroupBox" name="curveGroupBox"> <widget class="QGroupBox" name="curveGroupBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
...@@ -46,13 +49,16 @@ ...@@ -46,13 +49,16 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title"> <property name="title">
<string>Curve Selection</string> <string>Curve Selection</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0">
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
...@@ -82,6 +88,9 @@ ...@@ -82,6 +88,9 @@
<property name="autoFillBackground"> <property name="autoFillBackground">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
...@@ -99,17 +108,103 @@ ...@@ -99,17 +108,103 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>219</width> <width>368</width>
<height>475</height> <height>488</height>
</rect> </rect>
</property> </property>
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QComboBox" name="uasSelectionBox">
<item>
<property name="text">
<string>All MAVs</string>
</property>
</item>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="shortNameCheckBox">
<property name="toolTip">
<string>Display only variable names in curve list</string>
</property>
<property name="text">
<string>Short Names</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showUnitsCheckBox">
<property name="toolTip">
<string>Display variable units in curve list</string>
</property>
<property name="whatsThis">
<string>Display variable units in curve list</string>
</property>
<property name="text">
<string>Show units</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QPushButton" name="recolorButton">
<property name="toolTip">
<string>Rotate color scheme for all curves</string>
</property>
<property name="text">
<string>Recolor</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="4" rowspan="4"> <item row="0" column="2" rowspan="3">
<widget class="QGroupBox" name="diagramGroupBox"> <widget class="QGroupBox" name="diagramGroupBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
...@@ -129,47 +224,14 @@ ...@@ -129,47 +224,14 @@
<height>300</height> <height>300</height>
</size> </size>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title"> <property name="title">
<string>Diagram</string> <string>Diagram</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QCheckBox" name="shortNameCheckBox">
<property name="text">
<string>Short Names</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QPushButton" name="recolorButton">
<property name="text">
<string>Recolor</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="4">
<widget class="QComboBox" name="uasSelectionBox">
<item>
<property name="text">
<string>All MAVs</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
...@@ -135,8 +135,6 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent ...@@ -135,8 +135,6 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent
variance->setText("Variance"); variance->setText("Variance");
curvesWidgetLayout->addWidget(variance, labelRow, 6); curvesWidgetLayout->addWidget(variance, labelRow, 6);
// Add and customize plot elements (right side)
// Create the layout // Create the layout
createLayout(); createLayout();
...@@ -184,7 +182,7 @@ void LinechartWidget::writeSettings() ...@@ -184,7 +182,7 @@ void LinechartWidget::writeSettings()
QSettings settings; QSettings settings;
settings.beginGroup("LINECHART"); settings.beginGroup("LINECHART");
if (timeButton) settings.setValue("ENFORCE_GROUNDTIME", timeButton->isChecked()); if (timeButton) settings.setValue("ENFORCE_GROUNDTIME", timeButton->isChecked());
if (unitsCheckBox) settings.setValue("SHOW_UNITS", unitsCheckBox->isChecked()); if (ui.showUnitsCheckBox) settings.setValue("SHOW_UNITS", ui.showUnitsCheckBox->isChecked());
if (ui.shortNameCheckBox) settings.setValue("SHORT_NAMES", ui.shortNameCheckBox->isChecked()); if (ui.shortNameCheckBox) settings.setValue("SHORT_NAMES", ui.shortNameCheckBox->isChecked());
settings.endGroup(); settings.endGroup();
settings.sync(); settings.sync();
...@@ -200,7 +198,7 @@ void LinechartWidget::readSettings() ...@@ -200,7 +198,7 @@ void LinechartWidget::readSettings()
activePlot->enforceGroundTime(settings.value("ENFORCE_GROUNDTIME", timeButton->isChecked()).toBool()); activePlot->enforceGroundTime(settings.value("ENFORCE_GROUNDTIME", timeButton->isChecked()).toBool());
timeButton->setChecked(settings.value("ENFORCE_GROUNDTIME", timeButton->isChecked()).toBool()); timeButton->setChecked(settings.value("ENFORCE_GROUNDTIME", timeButton->isChecked()).toBool());
} }
if (unitsCheckBox) unitsCheckBox->setChecked(settings.value("SHOW_UNITS", unitsCheckBox->isChecked()).toBool()); if (ui.showUnitsCheckBox) ui.showUnitsCheckBox->setChecked(settings.value("SHOW_UNITS", ui.showUnitsCheckBox->isChecked()).toBool());
if (ui.shortNameCheckBox) ui.shortNameCheckBox->setChecked(settings.value("SHORT_NAMES", ui.shortNameCheckBox->isChecked()).toBool()); if (ui.shortNameCheckBox) ui.shortNameCheckBox->setChecked(settings.value("SHORT_NAMES", ui.shortNameCheckBox->isChecked()).toBool());
settings.endGroup(); settings.endGroup();
} }
...@@ -278,13 +276,9 @@ void LinechartWidget::createLayout() ...@@ -278,13 +276,9 @@ void LinechartWidget::createLayout()
connect(timeButton, SIGNAL(clicked(bool)), activePlot, SLOT(enforceGroundTime(bool))); connect(timeButton, SIGNAL(clicked(bool)), activePlot, SLOT(enforceGroundTime(bool)));
connect(timeButton, SIGNAL(clicked()), this, SLOT(writeSettings())); connect(timeButton, SIGNAL(clicked()), this, SLOT(writeSettings()));
unitsCheckBox = new QCheckBox(this); // Initialize the "Show units" checkbox. This is configured in the .ui file, so all
unitsCheckBox->setText(tr("Show units")); // we do here is attach the clicked() signal.
unitsCheckBox->setChecked(true); connect(ui.showUnitsCheckBox, SIGNAL(clicked()), this, SLOT(writeSettings()));
unitsCheckBox->setToolTip(tr("Enable unit display in curve list"));
unitsCheckBox->setWhatsThis(tr("Enable unit display in curve list"));
layout->addWidget(unitsCheckBox, 1, 5);
connect(unitsCheckBox, SIGNAL(clicked()), this, SLOT(writeSettings()));
ui.diagramGroupBox->setLayout(layout); ui.diagramGroupBox->setLayout(layout);
...@@ -671,8 +665,8 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit) ...@@ -671,8 +665,8 @@ void LinechartWidget::addCurve(const QString& curve, const QString& unit)
unitLabel->setToolTip(tr("Unit of ") + curve); unitLabel->setToolTip(tr("Unit of ") + curve);
unitLabel->setWhatsThis(tr("Unit of ") + curve); unitLabel->setWhatsThis(tr("Unit of ") + curve);
curvesWidgetLayout->addWidget(unitLabel, labelRow, 4); curvesWidgetLayout->addWidget(unitLabel, labelRow, 4);
unitLabel->setVisible(unitsCheckBox->isChecked()); unitLabel->setVisible(ui.showUnitsCheckBox->isChecked());
connect(unitsCheckBox, SIGNAL(clicked(bool)), unitLabel, SLOT(setVisible(bool))); connect(ui.showUnitsCheckBox, SIGNAL(clicked(bool)), unitLabel, SLOT(setVisible(bool)));
// Mean // Mean
mean = new QLabel(this); mean = new QLabel(this);
......
...@@ -163,7 +163,6 @@ protected: ...@@ -163,7 +163,6 @@ protected:
QToolButton* scalingLinearButton; QToolButton* scalingLinearButton;
QToolButton* scalingLogButton; QToolButton* scalingLogButton;
QToolButton* logButton; QToolButton* logButton;
QPointer<QCheckBox> unitsCheckBox;
QPointer<QCheckBox> timeButton; QPointer<QCheckBox> timeButton;
QFile* logFile; QFile* logFile;
......
...@@ -63,6 +63,7 @@ void Linecharts::hideEvent(QHideEvent* event) ...@@ -63,6 +63,7 @@ void Linecharts::hideEvent(QHideEvent* event)
void Linecharts::selectSystem(int systemid) void Linecharts::selectSystem(int systemid)
{ {
Q_UNUSED(systemid);
// QWidget* prevWidget = currentWidget(); // QWidget* prevWidget = currentWidget();
// if (prevWidget) // if (prevWidget)
// { // {
......
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