mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
Merge remote-tracking branch 'origin/remote/origin/banig/ScopeChanges' into next
This commit is contained in:
commit
af189cc0ab
@ -114,6 +114,7 @@ QWidget* ScopeGadgetOptionsPage::createPage(QWidget *parent)
|
|||||||
connect(options_page->btnRemoveCurve, SIGNAL(clicked()), this, SLOT(on_btnRemoveCurve_clicked()));
|
connect(options_page->btnRemoveCurve, SIGNAL(clicked()), this, SLOT(on_btnRemoveCurve_clicked()));
|
||||||
connect(options_page->lstCurves, SIGNAL(currentRowChanged(int)), this, SLOT(on_lstCurves_currentRowChanged(int)));
|
connect(options_page->lstCurves, SIGNAL(currentRowChanged(int)), this, SLOT(on_lstCurves_currentRowChanged(int)));
|
||||||
connect(options_page->btnColor, SIGNAL(clicked()), this, SLOT(on_btnColor_clicked()));
|
connect(options_page->btnColor, SIGNAL(clicked()), this, SLOT(on_btnColor_clicked()));
|
||||||
|
connect(options_page->spnRefreshInterval, SIGNAL(valueChanged(int )), this, SLOT(on_spnRefreshInterval_valueChanged(int)));
|
||||||
|
|
||||||
setYAxisWidgetFromPlotCurve();
|
setYAxisWidgetFromPlotCurve();
|
||||||
|
|
||||||
@ -349,3 +350,34 @@ void ScopeGadgetOptionsPage::on_loggingEnable_clicked()
|
|||||||
options_page->LoggingLabel->setEnabled(en);
|
options_page->LoggingLabel->setEnabled(en);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScopeGadgetOptionsPage::on_spnRefreshInterval_valueChanged(int )
|
||||||
|
{
|
||||||
|
validateRefreshInterval();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScopeGadgetOptionsPage::validateRefreshInterval()
|
||||||
|
{
|
||||||
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
|
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
|
||||||
|
for(int iIndex = 0; iIndex < options_page->lstCurves->count();iIndex++) {
|
||||||
|
QListWidgetItem* listItem = options_page->lstCurves->item(iIndex);
|
||||||
|
|
||||||
|
QString uavObject = listItem->data(Qt::UserRole + 0).toString();
|
||||||
|
|
||||||
|
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject((uavObject)));
|
||||||
|
if(!obj) {
|
||||||
|
qDebug() << "Object " << uavObject << " is missing";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(options_page->spnRefreshInterval->value() < obj->getMetadata().flightTelemetryUpdatePeriod)
|
||||||
|
{
|
||||||
|
options_page->lblWarnings->setText("The refresh interval is faster than some or all telemetry objects.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
options_page->lblWarnings->setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -70,8 +70,10 @@ private:
|
|||||||
void setCurvePlotProperties(QListWidgetItem *listWidgetItem, QString uavObject, QString uavField, int scale, int interpolation, QVariant varColor);
|
void setCurvePlotProperties(QListWidgetItem *listWidgetItem, QString uavObject, QString uavField, int scale, int interpolation, QVariant varColor);
|
||||||
void setYAxisWidgetFromPlotCurve();
|
void setYAxisWidgetFromPlotCurve();
|
||||||
void setButtonColor(const QColor &color);
|
void setButtonColor(const QColor &color);
|
||||||
|
void validateRefreshInterval();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void on_spnRefreshInterval_valueChanged(int );
|
||||||
void on_lstCurves_currentRowChanged(int currentRow);
|
void on_lstCurves_currentRowChanged(int currentRow);
|
||||||
void on_btnRemoveCurve_clicked();
|
void on_btnRemoveCurve_clicked();
|
||||||
void on_btnAddCurve_clicked();
|
void on_btnAddCurve_clicked();
|
||||||
|
@ -6,14 +6,68 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>550</width>
|
<width>544</width>
|
||||||
<height>405</height>
|
<height>342</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lblWarnings">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>255</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>0</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>120</red>
|
||||||
|
<green>120</green>
|
||||||
|
<blue>120</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeConstraint">
|
<property name="sizeConstraint">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user