1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-935 Adds Responsiveness sliders to basic stabilization screen.

This commit is contained in:
Fredrik Arvidsson 2013-05-05 12:45:35 +02:00
parent 1758885266
commit 176bd3c4f7
15 changed files with 4408 additions and 2449 deletions

View File

@ -1,18 +1 @@
/* Windows styles */ /* Windows styles */
QGroupBox {
border: 1px solid gray;
border-radius: 3px;
margin-top: 1ex;
padding: 1ex 0px 0px 0px;
font-size: 11px;
font-weight: bold;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top left;
left: 7px;
top: -1ex;
padding: 0px 3px;
}

View File

@ -67,49 +67,49 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
QIcon *icon = new QIcon(); QIcon *icon = new QIcon();
icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new DefaultHwSettingsWidget(this); qwd = new DefaultHwSettingsWidget(this);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/vehicle_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/vehicle_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/vehicle_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/vehicle_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigVehicleTypeWidget(this); qwd = new ConfigVehicleTypeWidget(this);
ftw->insertTab(ConfigGadgetWidget::aircraft, qwd, *icon, QString("Vehicle")); ftw->insertTab(ConfigGadgetWidget::aircraft, qwd, *icon, QString("Vehicle"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/input_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/input_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/input_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/input_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigInputWidget(this); qwd = new ConfigInputWidget(this);
ftw->insertTab(ConfigGadgetWidget::input, qwd, *icon, QString("Input")); ftw->insertTab(ConfigGadgetWidget::input, qwd, *icon, QString("Input"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/output_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/output_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/output_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/output_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigOutputWidget(this); qwd = new ConfigOutputWidget(this);
ftw->insertTab(ConfigGadgetWidget::output, qwd, *icon, QString("Output")); ftw->insertTab(ConfigGadgetWidget::output, qwd, *icon, QString("Output"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new DefaultAttitudeWidget(this); qwd = new DefaultAttitudeWidget(this);
ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/stabilization_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/stabilization_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/stabilization_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/stabilization_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigStabilizationWidget(this); qwd = new ConfigStabilizationWidget(this);
ftw->insertTab(ConfigGadgetWidget::stabilization, qwd, *icon, QString("Stabilization")); ftw->insertTab(ConfigGadgetWidget::stabilization, qwd, *icon, QString("Stabilization"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/camstab_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/camstab_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/camstab_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/camstab_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigCameraStabilizationWidget(this); qwd = new ConfigCameraStabilizationWidget(this);
ftw->insertTab(ConfigGadgetWidget::camerastabilization, qwd, *icon, QString("Camera Stab")); ftw->insertTab(ConfigGadgetWidget::camerastabilization, qwd, *icon, QString("Camera Stab"));
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/txpid_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/txpid_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/txpid_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/txpid_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigTxPIDWidget(this); qwd = new ConfigTxPIDWidget(this);
ftw->insertTab(ConfigGadgetWidget::txpid, qwd, *icon, QString("TxPID")); ftw->insertTab(ConfigGadgetWidget::txpid, qwd, *icon, QString("TxPID"));
ftw->setCurrentIndex(ConfigGadgetWidget::hardware); ftw->setCurrentIndex(ConfigGadgetWidget::hardware);
@ -117,29 +117,29 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
// Listen to autopilot connection events // Listen to autopilot connection events
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
TelemetryManager* telMngr = pm->getObject<TelemetryManager>(); TelemetryManager *telMngr = pm->getObject<TelemetryManager>();
connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect())); connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()));
connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect())); connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()));
// And check whether by any chance we are not already connected // And check whether by any chance we are not already connected
if (telMngr->isConnected()) { if (telMngr->isConnected()) {
onAutopilotConnect(); onAutopilotConnect();
} }
help = 0; help = 0;
connect(ftw,SIGNAL(currentAboutToShow(int,bool*)), this, SLOT(tabAboutToChange(int,bool*))); connect(ftw, SIGNAL(currentAboutToShow(int, bool *)), this, SLOT(tabAboutToChange(int, bool *)));
// Connect to the PipXStatus object updates // Connect to the PipXStatus object updates
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
oplinkStatusObj = dynamic_cast<UAVDataObject*>(objManager->getObject("OPLinkStatus")); oplinkStatusObj = dynamic_cast<UAVDataObject *>(objManager->getObject("OPLinkStatus"));
if (oplinkStatusObj != NULL ) { if (oplinkStatusObj != NULL) {
connect(oplinkStatusObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateOPLinkStatus(UAVObject*))); connect(oplinkStatusObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateOPLinkStatus(UAVObject *)));
} else { } else {
qDebug() << "Error: Object is unknown (OPLinkStatus)."; qDebug() << "Error: Object is unknown (OPLinkStatus).";
} }
// Create the timer that is used to timeout the connection to the OPLink. // Create the timer that is used to timeout the connection to the OPLink.
oplinkTimeout = new QTimer(this); oplinkTimeout = new QTimer(this);
connect(oplinkTimeout, SIGNAL(timeout()), this, SLOT(onOPLinkDisconnect())); connect(oplinkTimeout, SIGNAL(timeout()), this, SLOT(onOPLinkDisconnect()));
oplinkConnected = false; oplinkConnected = false;
} }
@ -152,7 +152,7 @@ ConfigGadgetWidget::~ConfigGadgetWidget()
void ConfigGadgetWidget::startInputWizard() void ConfigGadgetWidget::startInputWizard()
{ {
ftw->setCurrentIndex(ConfigGadgetWidget::input); ftw->setCurrentIndex(ConfigGadgetWidget::input);
ConfigInputWidget* inputWidget = dynamic_cast<ConfigInputWidget*>(ftw->getWidget(ConfigGadgetWidget::input)); ConfigInputWidget *inputWidget = dynamic_cast<ConfigInputWidget *>(ftw->getWidget(ConfigGadgetWidget::input));
Q_ASSERT(inputWidget); Q_ASSERT(inputWidget);
inputWidget->startInputWizard(); inputWidget->startInputWizard();
} }
@ -162,11 +162,12 @@ void ConfigGadgetWidget::resizeEvent(QResizeEvent *event)
QWidget::resizeEvent(event); QWidget::resizeEvent(event);
} }
void ConfigGadgetWidget::onAutopilotDisconnect() { void ConfigGadgetWidget::onAutopilotDisconnect()
{
int selectedIndex = ftw->currentIndex(); int selectedIndex = ftw->currentIndex();
QIcon *icon = new QIcon(); QIcon *icon = new QIcon();
icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off);
QWidget *qwd = new DefaultAttitudeWidget(this); QWidget *qwd = new DefaultAttitudeWidget(this);
@ -176,7 +177,7 @@ void ConfigGadgetWidget::onAutopilotDisconnect() {
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new DefaultHwSettingsWidget(this); qwd = new DefaultHwSettingsWidget(this);
ftw->removeTab(ConfigGadgetWidget::hardware); ftw->removeTab(ConfigGadgetWidget::hardware);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware"));
@ -185,20 +186,20 @@ void ConfigGadgetWidget::onAutopilotDisconnect() {
emit autopilotDisconnected(); emit autopilotDisconnected();
} }
void ConfigGadgetWidget::onAutopilotConnect() { void ConfigGadgetWidget::onAutopilotConnect()
{
qDebug()<<"ConfigGadgetWidget onAutopilotConnect"; qDebug() << "ConfigGadgetWidget onAutopilotConnect";
// First of all, check what Board type we are talking to, and // First of all, check what Board type we are talking to, and
// if necessary, remove/add tabs in the config gadget: // if necessary, remove/add tabs in the config gadget:
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>(); UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
if (utilMngr) { if (utilMngr) {
int selectedIndex = ftw->currentIndex(); int selectedIndex = ftw->currentIndex();
int board = utilMngr->getBoardModel(); int board = utilMngr->getBoardModel();
if ((board & 0xff00) == 1024) { if ((board & 0xff00) == 1024) {
// CopterControl family // CopterControl family
QIcon *icon = new QIcon(); QIcon *icon = new QIcon();
icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off);
QWidget *qwd = new ConfigCCAttitudeWidget(this); QWidget *qwd = new ConfigCCAttitudeWidget(this);
@ -208,14 +209,13 @@ void ConfigGadgetWidget::onAutopilotConnect() {
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigCCHWWidget(this); qwd = new ConfigCCHWWidget(this);
ftw->removeTab(ConfigGadgetWidget::hardware); ftw->removeTab(ConfigGadgetWidget::hardware);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware"));
} else if ((board & 0xff00) == 0x0900) { } else if ((board & 0xff00) == 0x0900) {
// Revolution family // Revolution family
QIcon *icon = new QIcon(); QIcon *icon = new QIcon();
icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off);
QWidget *qwd = new ConfigRevoWidget(this); QWidget *qwd = new ConfigRevoWidget(this);
@ -225,35 +225,33 @@ void ConfigGadgetWidget::onAutopilotConnect() {
icon = new QIcon(); icon = new QIcon();
icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigRevoHWWidget(this); qwd = new ConfigRevoHWWidget(this);
ftw->removeTab(ConfigGadgetWidget::hardware); ftw->removeTab(ConfigGadgetWidget::hardware);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware"));
} else { } else {
//Unknown board // Unknown board
qDebug() << "Unknown board " << board; qDebug() << "Unknown board " << board;
} }
ftw->setCurrentIndex(selectedIndex); ftw->setCurrentIndex(selectedIndex);
} }
emit autopilotConnected(); emit autopilotConnected();
} }
void ConfigGadgetWidget::tabAboutToChange(int i, bool * proceed) void ConfigGadgetWidget::tabAboutToChange(int i, bool *proceed)
{ {
Q_UNUSED(i); Q_UNUSED(i);
*proceed = true; *proceed = true;
ConfigTaskWidget * wid = qobject_cast<ConfigTaskWidget *>(ftw->currentWidget()); ConfigTaskWidget *wid = qobject_cast<ConfigTaskWidget *>(ftw->currentWidget());
if(!wid) { if (!wid) {
return; return;
} }
if(wid->isDirty()) if (wid->isDirty()) {
{ int ans = QMessageBox::warning(this, tr("Unsaved changes"), tr("The tab you are leaving has unsaved changes,"
int ans=QMessageBox::warning(this,tr("Unsaved changes"),tr("The tab you are leaving has unsaved changes," "if you proceed they will be lost."
"if you proceed they will be lost." "Do you still want to proceed?"), QMessageBox::Yes, QMessageBox::No);
"Do you still want to proceed?"),QMessageBox::Yes,QMessageBox::No); if (ans == QMessageBox::No) {
if(ans==QMessageBox::No) { *proceed = false;
*proceed=false;
} else { } else {
wid->setDirty(false); wid->setDirty(false);
} }
@ -261,14 +259,13 @@ void ConfigGadgetWidget::tabAboutToChange(int i, bool * proceed)
} }
/*! /*!
\brief Called by updates to @OPLinkStatus \brief Called by updates to @OPLinkStatus
*/ */
void ConfigGadgetWidget::updateOPLinkStatus(UAVObject *) void ConfigGadgetWidget::updateOPLinkStatus(UAVObject *)
{ {
// Restart the disconnection timer. // Restart the disconnection timer.
oplinkTimeout->start(5000); oplinkTimeout->start(5000);
if (!oplinkConnected) if (!oplinkConnected) {
{
qDebug() << "ConfigGadgetWidget onOPLinkConnect"; qDebug() << "ConfigGadgetWidget onOPLinkConnect";
QIcon *icon = new QIcon(); QIcon *icon = new QIcon();
@ -281,9 +278,10 @@ void ConfigGadgetWidget::updateOPLinkStatus(UAVObject *)
} }
} }
void ConfigGadgetWidget::onOPLinkDisconnect() { void ConfigGadgetWidget::onOPLinkDisconnect()
qDebug()<<"ConfigGadgetWidget onOPLinkDisconnect"; {
oplinkTimeout->stop(); qDebug() << "ConfigGadgetWidget onOPLinkDisconnect";
ftw->removeTab(ConfigGadgetWidget::oplink); oplinkTimeout->stop();
oplinkConnected = false; ftw->removeTab(ConfigGadgetWidget::oplink);
oplinkConnected = false;
} }

View File

@ -45,9 +45,10 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
ui->setupUi(this); ui->setupUi(this);
ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
Core::Internal::GeneralSettings* settings = pm->getObject<Core::Internal::GeneralSettings>(); Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
if(!settings->useExpertMode()) {
if (!settings->useExpertMode()) {
ui->saveStabilizationToRAM_6->setVisible(false); ui->saveStabilizationToRAM_6->setVisible(false);
} }
@ -56,18 +57,18 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
realtimeUpdates = new QTimer(this); realtimeUpdates = new QTimer(this);
connect(realtimeUpdates, SIGNAL(timeout()), this, SLOT(apply())); connect(realtimeUpdates, SIGNAL(timeout()), this, SLOT(apply()));
connect(ui->realTimeUpdates_6, SIGNAL(stateChanged(int)), this, SLOT(realtimeUpdatesSlot(int))); connect(ui->realTimeUpdates_6, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
addWidget(ui->realTimeUpdates_6); addWidget(ui->realTimeUpdates_6);
connect(ui->realTimeUpdates_8, SIGNAL(stateChanged(int)), this, SLOT(realtimeUpdatesSlot(int))); connect(ui->realTimeUpdates_8, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
addWidget(ui->realTimeUpdates_8); addWidget(ui->realTimeUpdates_8);
connect(ui->checkBox_7, SIGNAL(stateChanged(int)), this, SLOT(linkCheckBoxes(int))); connect(ui->checkBox_7, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBox_7); addWidget(ui->checkBox_7);
connect(ui->checkBox_2, SIGNAL(stateChanged(int)), this, SLOT(linkCheckBoxes(int))); connect(ui->checkBox_2, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBox_2); addWidget(ui->checkBox_2);
connect(ui->checkBox_8, SIGNAL(stateChanged(int)), this, SLOT(linkCheckBoxes(int))); connect(ui->checkBox_8, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBox_8); addWidget(ui->checkBox_8);
connect(ui->checkBox_3, SIGNAL(stateChanged(int)), this, SLOT(linkCheckBoxes(int))); connect(ui->checkBox_3, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBox_3); addWidget(ui->checkBox_3);
addWidget(ui->pushButton_2); addWidget(ui->pushButton_2);
@ -80,7 +81,12 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
addWidget(ui->pushButton_22); addWidget(ui->pushButton_22);
addWidget(ui->pushButton_23); addWidget(ui->pushButton_23);
connect(this, SIGNAL(widgetContentsChanged(QWidget*)), this, SLOT(processLinkedWidgets(QWidget*))); addWidget(ui->basicResponsivenessGroupBox);
connect(ui->basicResponsivenessGroupBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->advancedResponsivenessGroupBox);
connect(ui->advancedResponsivenessGroupBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *)));
// Link by default // Link by default
ui->checkBox_7->setChecked(true); ui->checkBox_7->setChecked(true);
@ -95,100 +101,91 @@ ConfigStabilizationWidget::~ConfigStabilizationWidget()
// Do nothing // Do nothing
} }
void ConfigStabilizationWidget::realtimeUpdatesSlot(int value)
{
ui->realTimeUpdates_6->setCheckState((Qt::CheckState)value);
ui->realTimeUpdates_8->setCheckState((Qt::CheckState)value);
if(value == Qt::Checked && !realtimeUpdates->isActive()) { void ConfigStabilizationWidget::refreshWidgetsValues(UAVObject *o)
{
ConfigTaskWidget::refreshWidgetsValues(o);
ui->basicResponsivenessGroupBox->setChecked(ui->rateRollKp_3->value() == ui->ratePitchKp_4->value() &&
ui->rateRollKi_3->value() == ui->ratePitchKi_4->value());
}
void ConfigStabilizationWidget::realtimeUpdatesSlot(bool value)
{
ui->realTimeUpdates_6->setChecked(value);
ui->realTimeUpdates_8->setChecked(value);
if (value && !realtimeUpdates->isActive()) {
realtimeUpdates->start(300); realtimeUpdates->start(300);
} } else {
else if(value == Qt::Unchecked) {
realtimeUpdates->stop(); realtimeUpdates->stop();
} }
} }
void ConfigStabilizationWidget::linkCheckBoxes(int value) void ConfigStabilizationWidget::linkCheckBoxes(bool value)
{ {
if(sender() == ui->checkBox_7) { if (sender() == ui->checkBox_7) {
ui->checkBox_3->setCheckState((Qt::CheckState)value); ui->checkBox_3->setChecked(value);
} } else if (sender() == ui->checkBox_3) {
else if(sender() == ui->checkBox_3) { ui->checkBox_7->setChecked(value);
ui->checkBox_7->setCheckState((Qt::CheckState)value); } else if (sender() == ui->checkBox_8) {
} ui->checkBox_2->setChecked(value);
else if(sender( )== ui->checkBox_8) { } else if (sender() == ui->checkBox_2) {
ui->checkBox_2->setCheckState((Qt::CheckState)value); ui->checkBox_8->setChecked(value);
} } else if (sender() == ui->basicResponsivenessGroupBox) {
else if(sender() == ui->checkBox_2) { ui->advancedResponsivenessGroupBox->setChecked(!value);
ui->checkBox_8->setCheckState((Qt::CheckState)value); if(value) {
processLinkedWidgets(ui->AttitudeResponsivenessSlider);
processLinkedWidgets(ui->RateResponsivenessSlider);
}
} else if (sender() == ui->advancedResponsivenessGroupBox) {
ui->basicResponsivenessGroupBox->setChecked(!value);
} }
} }
void ConfigStabilizationWidget::processLinkedWidgets(QWidget * widget) void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
{ {
if(ui->checkBox_7->checkState()==Qt::Checked) if (ui->checkBox_7->isChecked()) {
{ if (widget == ui->RateRollKp_2) {
if(widget== ui->RateRollKp_2)
{
ui->RatePitchKp->setValue(ui->RateRollKp_2->value()); ui->RatePitchKp->setValue(ui->RateRollKp_2->value());
} } else if (widget == ui->RateRollKi_2) {
else if(widget== ui->RateRollKi_2)
{
ui->RatePitchKi->setValue(ui->RateRollKi_2->value()); ui->RatePitchKi->setValue(ui->RateRollKi_2->value());
} } else if (widget == ui->RateRollILimit_2) {
else if(widget== ui->RateRollILimit_2)
{
ui->RatePitchILimit->setValue(ui->RateRollILimit_2->value()); ui->RatePitchILimit->setValue(ui->RateRollILimit_2->value());
} } else if (widget == ui->RatePitchKp) {
else if(widget== ui->RatePitchKp)
{
ui->RateRollKp_2->setValue(ui->RatePitchKp->value()); ui->RateRollKp_2->setValue(ui->RatePitchKp->value());
} } else if (widget == ui->RatePitchKi) {
else if(widget== ui->RatePitchKi)
{
ui->RateRollKi_2->setValue(ui->RatePitchKi->value()); ui->RateRollKi_2->setValue(ui->RatePitchKi->value());
} } else if (widget == ui->RatePitchILimit) {
else if(widget== ui->RatePitchILimit)
{
ui->RateRollILimit_2->setValue(ui->RatePitchILimit->value()); ui->RateRollILimit_2->setValue(ui->RatePitchILimit->value());
} } else if (widget == ui->RollRateKd) {
else if(widget== ui->RollRateKd)
{
ui->PitchRateKd->setValue(ui->RollRateKd->value()); ui->PitchRateKd->setValue(ui->RollRateKd->value());
} } else if (widget == ui->PitchRateKd) {
else if(widget== ui->PitchRateKd)
{
ui->RollRateKd->setValue(ui->PitchRateKd->value()); ui->RollRateKd->setValue(ui->PitchRateKd->value());
} }
} }
if(ui->checkBox_8->checkState()==Qt::Checked)
{ if (ui->checkBox_8->isChecked()) {
if(widget== ui->AttitudeRollKp) if (widget == ui->AttitudeRollKp) {
{
ui->AttitudePitchKp_2->setValue(ui->AttitudeRollKp->value()); ui->AttitudePitchKp_2->setValue(ui->AttitudeRollKp->value());
} } else if (widget == ui->AttitudeRollKi) {
else if(widget== ui->AttitudeRollKi)
{
ui->AttitudePitchKi_2->setValue(ui->AttitudeRollKi->value()); ui->AttitudePitchKi_2->setValue(ui->AttitudeRollKi->value());
} } else if (widget == ui->AttitudeRollILimit) {
else if(widget== ui->AttitudeRollILimit)
{
ui->AttitudePitchILimit_2->setValue(ui->AttitudeRollILimit->value()); ui->AttitudePitchILimit_2->setValue(ui->AttitudeRollILimit->value());
} } else if (widget == ui->AttitudePitchKp_2) {
else if(widget== ui->AttitudePitchKp_2)
{
ui->AttitudeRollKp->setValue(ui->AttitudePitchKp_2->value()); ui->AttitudeRollKp->setValue(ui->AttitudePitchKp_2->value());
} } else if (widget == ui->AttitudePitchKi_2) {
else if(widget== ui->AttitudePitchKi_2)
{
ui->AttitudeRollKi->setValue(ui->AttitudePitchKi_2->value()); ui->AttitudeRollKi->setValue(ui->AttitudePitchKi_2->value());
} } else if (widget == ui->AttitudePitchILimit_2) {
else if(widget== ui->AttitudePitchILimit_2)
{
ui->AttitudeRollILimit->setValue(ui->AttitudePitchILimit_2->value()); ui->AttitudeRollILimit->setValue(ui->AttitudePitchILimit_2->value());
} }
} }
if(ui->basicResponsivenessGroupBox->isChecked()) {
if (widget == ui->AttitudeResponsivenessSlider) {
ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value());
} else if (widget == ui->RateResponsivenessSlider) {
ui->ratePitchKi_4->setValue(ui->RateResponsivenessSlider->value());
}
}
} }

View File

@ -48,9 +48,13 @@ public:
private: private:
Ui_StabilizationWidget *ui; Ui_StabilizationWidget *ui;
QTimer * realtimeUpdates; QTimer * realtimeUpdates;
protected slots:
void refreshWidgetsValues(UAVObject *o = NULL);
private slots: private slots:
void realtimeUpdatesSlot(int); void realtimeUpdatesSlot(bool value);
void linkCheckBoxes(int value); void linkCheckBoxes(bool value);
void processLinkedWidgets(QWidget*); void processLinkedWidgets(QWidget*);
}; };

View File

@ -108,30 +108,3 @@ void ConfigTxPIDWidget::saveSettings()
UAVObject *obj = HwSettings::GetInstance(getObjectManager()); UAVObject *obj = HwSettings::GetInstance(getObjectManager());
saveObjectToSD(obj); saveObjectToSD(obj);
} }
void ConfigTxPIDWidget::enableControls(bool enable)
{
/*
m_txpid->PID1->setEnabled(enable);
m_txpid->PID2->setEnabled(enable);
m_txpid->PID3->setEnabled(enable);
m_txpid->Input1->setEnabled(enable);
m_txpid->Input2->setEnabled(enable);
m_txpid->Input3->setEnabled(enable);
m_txpid->MinPID1->setEnabled(enable);
m_txpid->MinPID2->setEnabled(enable);
m_txpid->MinPID3->setEnabled(enable);
m_txpid->MaxPID1->setEnabled(enable);
m_txpid->MaxPID2->setEnabled(enable);
m_txpid->MaxPID3->setEnabled(enable);
m_txpid->ThrottleMin->setEnabled(enable);
m_txpid->ThrottleMax->setEnabled(enable);
m_txpid->UpdateMode->setEnabled(enable);
*/
ConfigTaskWidget::setEnabled(enable);
}

View File

@ -44,7 +44,6 @@ private slots:
void refreshValues(); void refreshValues();
void applySettings(); void applySettings();
void saveSettings(); void saveSettings();
void enableControls(bool enable);
}; };
#endif // CONFIGTXPIDWIDGET_H #endif // CONFIGTXPIDWIDGET_H

View File

@ -4,15 +4,14 @@
#include "manualcontrolsettings.h" #include "manualcontrolsettings.h"
#include "gcsreceiver.h" #include "gcsreceiver.h"
inputChannelForm::inputChannelForm(QWidget *parent,bool showlegend) : inputChannelForm::inputChannelForm(QWidget *parent, bool showlegend) :
ConfigTaskWidget(parent), ConfigTaskWidget(parent),
ui(new Ui::inputChannelForm) ui(new Ui::inputChannelForm)
{ {
ui->setupUi(this); ui->setupUi(this);
//The first time through the loop, keep the legend. All other times, delete it. // The first time through the loop, keep the legend. All other times, delete it.
if(!showlegend) if (!showlegend) {
{
layout()->removeWidget(ui->legend0); layout()->removeWidget(ui->legend0);
layout()->removeWidget(ui->legend1); layout()->removeWidget(ui->legend1);
layout()->removeWidget(ui->legend2); layout()->removeWidget(ui->legend2);
@ -27,19 +26,18 @@ inputChannelForm::inputChannelForm(QWidget *parent,bool showlegend) :
delete ui->legend4; delete ui->legend4;
delete ui->legend5; delete ui->legend5;
delete ui->legend6; delete ui->legend6;
} }
connect(ui->channelMin,SIGNAL(valueChanged(int)),this,SLOT(minMaxUpdated())); connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated()));
connect(ui->channelMax,SIGNAL(valueChanged(int)),this,SLOT(minMaxUpdated())); connect(ui->channelMax, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated()));
connect(ui->channelGroup,SIGNAL(currentIndexChanged(int)),this,SLOT(groupUpdated())); connect(ui->channelGroup, SIGNAL(currentIndexChanged(int)), this, SLOT(groupUpdated()));
connect(ui->channelNeutral,SIGNAL(valueChanged(int)), this, SLOT(neutralUpdated(int))); connect(ui->channelNeutral, SIGNAL(valueChanged(int)), this, SLOT(neutralUpdated(int)));
// This is awkward but since we want the UI to be a dropdown but the field is not an enum // This is awkward but since we want the UI to be a dropdown but the field is not an enum
// it breaks the UAUVObject widget relation of the task gadget. Running the data through // it breaks the UAUVObject widget relation of the task gadget. Running the data through
// a spin box fixes this // a spin box fixes this
connect(ui->channelNumberDropdown,SIGNAL(currentIndexChanged(int)),this,SLOT(channelDropdownUpdated(int))); connect(ui->channelNumberDropdown, SIGNAL(currentIndexChanged(int)), this, SLOT(channelDropdownUpdated(int)));
connect(ui->channelNumber,SIGNAL(valueChanged(int)),this,SLOT(channelNumberUpdated(int))); connect(ui->channelNumber, SIGNAL(valueChanged(int)), this, SLOT(channelNumberUpdated(int)));
disableMouseWheelEvents(); disableMouseWheelEvents();
} }
@ -54,26 +52,28 @@ void inputChannelForm::setName(QString &name)
{ {
ui->channelName->setText(name); ui->channelName->setText(name);
QFontMetrics metrics(ui->channelName->font()); QFontMetrics metrics(ui->channelName->font());
int width=metrics.width(name)+5; int width = metrics.width(name) + 5;
foreach(inputChannelForm * form,parent()->findChildren<inputChannelForm*>()) foreach(inputChannelForm * form, parent()->findChildren<inputChannelForm *>()) {
{ if (form == this) {
if(form==this)
continue; continue;
if(form->ui->channelName->minimumSize().width()<width) }
form->ui->channelName->setMinimumSize(width,0); if (form->ui->channelName->minimumSize().width() < width) {
else form->ui->channelName->setMinimumSize(width, 0);
width=form->ui->channelName->minimumSize().width(); } else {
width = form->ui->channelName->minimumSize().width();
}
} }
ui->channelName->setMinimumSize(width,0); ui->channelName->setMinimumSize(width, 0);
} }
/** /**
* Update the direction of the slider and boundaries * Update the direction of the slider and boundaries
*/ */
void inputChannelForm::minMaxUpdated() void inputChannelForm::minMaxUpdated()
{ {
bool reverse = ui->channelMin->value() > ui->channelMax->value(); bool reverse = ui->channelMin->value() > ui->channelMax->value();
if(reverse) {
if (reverse) {
ui->channelNeutral->setMinimum(ui->channelMax->value()); ui->channelNeutral->setMinimum(ui->channelMax->value());
ui->channelNeutral->setMaximum(ui->channelMin->value()); ui->channelNeutral->setMaximum(ui->channelMin->value());
} else { } else {
@ -91,11 +91,11 @@ void inputChannelForm::neutralUpdated(int newval)
} }
/** /**
* Update the channel options based on the selected receiver type * Update the channel options based on the selected receiver type
* *
* I fully admit this is terrible practice to embed data within UI * I fully admit this is terrible practice to embed data within UI
* like this. Open to suggestions. JC 2011-09-07 * like this. Open to suggestions. JC 2011-09-07
*/ */
void inputChannelForm::groupUpdated() void inputChannelForm::groupUpdated()
{ {
ui->channelNumberDropdown->clear(); ui->channelNumberDropdown->clear();
@ -103,7 +103,7 @@ void inputChannelForm::groupUpdated()
quint8 count = 0; quint8 count = 0;
switch(ui->channelGroup->currentIndex()) { switch (ui->channelGroup->currentIndex()) {
case -1: // Nothing selected case -1: // Nothing selected
count = 0; count = 0;
break; break;
@ -129,24 +129,25 @@ void inputChannelForm::groupUpdated()
Q_ASSERT(0); Q_ASSERT(0);
} }
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++) {
ui->channelNumberDropdown->addItem(QString(tr("Chan %1").arg(i+1))); ui->channelNumberDropdown->addItem(QString(tr("Chan %1").arg(i + 1)));
}
ui->channelNumber->setMaximum(count); ui->channelNumber->setMaximum(count);
ui->channelNumber->setMinimum(0); ui->channelNumber->setMinimum(0);
} }
/** /**
* Update the dropdown from the hidden control * Update the dropdown from the hidden control
*/ */
void inputChannelForm::channelDropdownUpdated(int newval) void inputChannelForm::channelDropdownUpdated(int newval)
{ {
ui->channelNumber->setValue(newval); ui->channelNumber->setValue(newval);
} }
/** /**
* Update the hidden control from the dropdown * Update the hidden control from the dropdown
*/ */
void inputChannelForm::channelNumberUpdated(int newval) void inputChannelForm::channelNumberUpdated(int newval)
{ {
ui->channelNumberDropdown->setCurrentIndex(newval); ui->channelNumberDropdown->setCurrentIndex(newval);

View File

@ -38,7 +38,7 @@ MixerCurve::MixerCurve(QWidget *parent) :
m_mixerUI->setupUi(this); m_mixerUI->setupUi(this);
// setup some convienence pointers // setup some convienence pointers
m_curve = m_mixerUI->CurveWidget; m_curve = m_mixerUI->CurveWidget;
m_settings = m_mixerUI->CurveSettings; m_settings = m_mixerUI->CurveSettings;
@ -56,10 +56,10 @@ MixerCurve::MixerCurve(QWidget *parent) :
// wire up our signals // wire up our signals
connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged())); connect(m_mixerUI->CurveType, SIGNAL(currentIndexChanged(int)), this, SLOT(CurveTypeChanged()));
connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve())); connect(m_mixerUI->ResetCurve, SIGNAL(clicked()), this, SLOT(ResetCurve()));
connect(m_mixerUI->PopupCurve, SIGNAL(clicked()),this,SLOT(PopupCurve())); connect(m_mixerUI->PopupCurve, SIGNAL(clicked()), this, SLOT(PopupCurve()));
connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve())); connect(m_mixerUI->GenerateCurve, SIGNAL(clicked()), this, SLOT(GenerateCurve()));
connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable())); connect(m_curve, SIGNAL(curveUpdated()), this, SLOT(UpdateSettingsTable()));
connect(m_settings, SIGNAL(cellChanged(int,int)), this, SLOT(SettingsTableChanged())); connect(m_settings, SIGNAL(cellChanged(int, int)), this, SLOT(SettingsTableChanged()));
connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double))); connect(m_mixerUI->CurveMin, SIGNAL(valueChanged(double)), this, SLOT(CurveMinChanged(double)));
connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double))); connect(m_mixerUI->CurveMax, SIGNAL(valueChanged(double)), this, SLOT(CurveMaxChanged(double)));
connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve())); connect(m_mixerUI->CurveStep, SIGNAL(valueChanged(double)), this, SLOT(GenerateCurve()));
@ -79,26 +79,26 @@ void MixerCurve::setMixerType(MixerCurveType curveType)
m_mixerUI->CurveMax->setMaximum(1.0); m_mixerUI->CurveMax->setMaximum(1.0);
switch (m_curveType) { switch (m_curveType) {
case MixerCurve::MIXERCURVE_THROTTLE: case MixerCurve::MIXERCURVE_THROTTLE:
{ {
m_mixerUI->SettingsGroup->setTitle("Throttle Curve"); m_mixerUI->SettingsGroup->setTitle("Throttle Curve");
m_curve->setRange(0.0, 1.0); m_curve->setRange(0.0, 1.0);
m_mixerUI->CurveMin->setMinimum(0.0); m_mixerUI->CurveMin->setMinimum(0.0);
m_mixerUI->CurveMax->setMinimum(0.0); m_mixerUI->CurveMax->setMinimum(0.0);
break; break;
} }
case MixerCurve::MIXERCURVE_PITCH: case MixerCurve::MIXERCURVE_PITCH:
{ {
m_mixerUI->SettingsGroup->setTitle("Pitch Curve"); m_mixerUI->SettingsGroup->setTitle("Pitch Curve");
m_curve->setRange(-1.0, 1.0); m_curve->setRange(-1.0, 1.0);
m_mixerUI->CurveMin->setMinimum(-1.0); m_mixerUI->CurveMin->setMinimum(-1.0);
m_mixerUI->CurveMax->setMinimum(-1.0); m_mixerUI->CurveMax->setMinimum(-1.0);
break; break;
} }
} }
m_spinDelegate->setRange(m_mixerUI->CurveMin->minimum(), m_mixerUI->CurveMax->maximum()); m_spinDelegate->setRange(m_mixerUI->CurveMin->minimum(), m_mixerUI->CurveMax->maximum());
for (int i=0; i<MixerCurveWidget::NODE_NUMELEM; i++) { for (int i = 0; i < MixerCurveWidget::NODE_NUMELEM; i++) {
m_settings->setItemDelegateForRow(i, m_spinDelegate); m_settings->setItemDelegateForRow(i, m_spinDelegate);
} }
@ -121,7 +121,7 @@ void MixerCurve::PopupCurve()
m_mixerUI->SettingsGroup->show(); m_mixerUI->SettingsGroup->show();
m_mixerUI->PopupCurve->hide(); m_mixerUI->PopupCurve->hide();
PopupWidget* popup = new PopupWidget(); PopupWidget *popup = new PopupWidget();
popup->popUp(this); popup->popUp(this);
m_mixerUI->SettingsGroup->hide(); m_mixerUI->SettingsGroup->hide();
@ -130,7 +130,7 @@ void MixerCurve::PopupCurve()
void MixerCurve::UpdateCurveUI() void MixerCurve::UpdateCurveUI()
{ {
//get the user settings // get the user settings
QString curveType = m_mixerUI->CurveType->currentText(); QString curveType = m_mixerUI->CurveType->currentText();
@ -138,7 +138,7 @@ void MixerCurve::UpdateCurveUI()
m_mixerUI->CurveStep->setMaximum(100.0); m_mixerUI->CurveStep->setMaximum(100.0);
m_mixerUI->CurveStep->setSingleStep(1.00); m_mixerUI->CurveStep->setSingleStep(1.00);
//set default visible // set default visible
m_mixerUI->minLabel->setVisible(true); m_mixerUI->minLabel->setVisible(true);
m_mixerUI->CurveMin->setVisible(true); m_mixerUI->CurveMin->setVisible(true);
m_mixerUI->maxLabel->setVisible(false); m_mixerUI->maxLabel->setVisible(false);
@ -146,8 +146,7 @@ void MixerCurve::UpdateCurveUI()
m_mixerUI->stepLabel->setVisible(false); m_mixerUI->stepLabel->setVisible(false);
m_mixerUI->CurveStep->setVisible(false); m_mixerUI->CurveStep->setVisible(false);
if ( curveType.compare("Flat")==0) if (curveType.compare("Flat") == 0) {
{
m_mixerUI->minLabel->setVisible(false); m_mixerUI->minLabel->setVisible(false);
m_mixerUI->CurveMin->setVisible(false); m_mixerUI->CurveMin->setVisible(false);
m_mixerUI->stepLabel->setVisible(true); m_mixerUI->stepLabel->setVisible(true);
@ -157,13 +156,11 @@ void MixerCurve::UpdateCurveUI()
m_mixerUI->CurveStep->setSingleStep(0.01); m_mixerUI->CurveStep->setSingleStep(0.01);
m_mixerUI->CurveStep->setValue(m_mixerUI->CurveMax->value() / 2); m_mixerUI->CurveStep->setValue(m_mixerUI->CurveMax->value() / 2);
} }
if ( curveType.compare("Linear")==0) if (curveType.compare("Linear") == 0) {
{
m_mixerUI->maxLabel->setVisible(true); m_mixerUI->maxLabel->setVisible(true);
m_mixerUI->CurveMax->setVisible(true); m_mixerUI->CurveMax->setVisible(true);
} }
if ( curveType.compare("Step")==0) if (curveType.compare("Step") == 0) {
{
m_mixerUI->maxLabel->setVisible(true); m_mixerUI->maxLabel->setVisible(true);
m_mixerUI->CurveMax->setVisible(true); m_mixerUI->CurveMax->setVisible(true);
m_mixerUI->stepLabel->setText("Step at"); m_mixerUI->stepLabel->setText("Step at");
@ -172,8 +169,7 @@ void MixerCurve::UpdateCurveUI()
m_mixerUI->CurveStep->setMinimum(1.0); m_mixerUI->CurveStep->setMinimum(1.0);
} }
if ( curveType.compare("Exp")==0) if (curveType.compare("Exp") == 0) {
{
m_mixerUI->maxLabel->setVisible(true); m_mixerUI->maxLabel->setVisible(true);
m_mixerUI->CurveMax->setVisible(true); m_mixerUI->CurveMax->setVisible(true);
m_mixerUI->stepLabel->setText("Power"); m_mixerUI->stepLabel->setText("Power");
@ -182,13 +178,12 @@ void MixerCurve::UpdateCurveUI()
m_mixerUI->CurveStep->setMinimum(1.0); m_mixerUI->CurveStep->setMinimum(1.0);
} }
if ( curveType.compare("Log")==0) if (curveType.compare("Log") == 0) {
{
m_mixerUI->maxLabel->setVisible(true); m_mixerUI->maxLabel->setVisible(true);
m_mixerUI->CurveMax->setVisible(true); m_mixerUI->CurveMax->setVisible(true);
m_mixerUI->stepLabel->setText("Power"); m_mixerUI->stepLabel->setText("Power");
m_mixerUI->stepLabel->setVisible(true); m_mixerUI->stepLabel->setVisible(true);
m_mixerUI->CurveStep->setVisible(true); m_mixerUI->CurveStep->setVisible(true);
m_mixerUI->CurveStep->setMinimum(1.0); m_mixerUI->CurveStep->setMinimum(1.0);
} }
@ -197,61 +192,52 @@ void MixerCurve::UpdateCurveUI()
void MixerCurve::GenerateCurve() void MixerCurve::GenerateCurve()
{ {
double scale; double scale;
double newValue; double newValue;
//get the user settings // get the user settings
double value1 = getCurveMin(); double value1 = getCurveMin();
double value2 = getCurveMax(); double value2 = getCurveMax();
double value3 = getCurveStep(); double value3 = getCurveStep();
QString CurveType = m_mixerUI->CurveType->currentText(); QString CurveType = m_mixerUI->CurveType->currentText();
QList<double> points; QList<double> points;
for (int i=0; i<MixerCurveWidget::NODE_NUMELEM; i++) for (int i = 0; i < MixerCurveWidget::NODE_NUMELEM; i++) {
{ scale = ((double)i / (double)(MixerCurveWidget::NODE_NUMELEM - 1));
scale =((double)i/(double)(MixerCurveWidget::NODE_NUMELEM - 1));
if ( CurveType.compare("Flat")==0) if (CurveType.compare("Flat") == 0) {
{ points.append(value3);
points.append(value3); }
} if (CurveType.compare("Linear") == 0) {
if ( CurveType.compare("Linear")==0) newValue = value1 + (scale * (value2 - value1));
{ points.append(newValue);
newValue =value1 +(scale*(value2-value1)); }
points.append(newValue); if (CurveType.compare("Step") == 0) {
} if (scale * 100 < value3) {
if ( CurveType.compare("Step")==0) points.append(value1);
{ } else {
if (scale*100<value3) points.append(value2);
{ }
points.append(value1); }
} if (CurveType.compare("Exp") == 0) {
else newValue = value1 + (((exp(scale * (value3 / 10)) - 1)) / (exp((value3 / 10)) - 1) * (value2 - value1));
{ points.append(newValue);
points.append(value2); }
} if (CurveType.compare("Log") == 0) {
} newValue = value1 + (((log(scale * (value3 * 2) + 1)) / (log(1 + (value3 * 2)))) * (value2 - value1));
if ( CurveType.compare("Exp")==0) points.append(newValue);
{ }
newValue =value1 +(((exp(scale*(value3/10))-1))/(exp((value3/10))-1)*(value2-value1)); }
points.append(newValue);
}
if ( CurveType.compare("Log")==0)
{
newValue = value1 +(((log(scale*(value3*2)+1))/(log(1+(value3*2))))*(value2-value1));
points.append(newValue);
}
}
setCurve(&points); setCurve(&points);
} }
/** /**
Wrappers for mixercurvewidget. Wrappers for mixercurvewidget.
*/ */
void MixerCurve::initCurve (const QList<double>* points) void MixerCurve::initCurve(const QList<double> *points)
{ {
m_curve->setCurve(points); m_curve->setCurve(points);
UpdateSettingsTable(); UpdateSettingsTable();
@ -269,11 +255,12 @@ void MixerCurve::initLinearCurve(int numPoints, double maxValue, double minValue
m_curve->initLinearCurve(numPoints, maxValue, minValue); m_curve->initLinearCurve(numPoints, maxValue, minValue);
if (m_spinDelegate) if (m_spinDelegate) {
m_spinDelegate->setRange(minValue, maxValue); m_spinDelegate->setRange(minValue, maxValue);
}
} }
void MixerCurve::setCurve(const QList<double>* points) void MixerCurve::setCurve(const QList<double> *points)
{ {
m_curve->setCurve(points); m_curve->setCurve(points);
UpdateSettingsTable(); UpdateSettingsTable();
@ -281,7 +268,7 @@ void MixerCurve::setCurve(const QList<double>* points)
void MixerCurve::setMin(double value) void MixerCurve::setMin(double value)
{ {
//m_curve->setMin(value); // m_curve->setMin(value);
m_mixerUI->CurveMin->setMinimum(value); m_mixerUI->CurveMin->setMinimum(value);
} }
@ -292,7 +279,7 @@ double MixerCurve::getMin()
void MixerCurve::setMax(double value) void MixerCurve::setMax(double value)
{ {
//m_curve->setMax(value); // m_curve->setMax(value);
m_mixerUI->CurveMax->setMaximum(value); m_mixerUI->CurveMax->setMaximum(value);
} }
@ -326,11 +313,11 @@ void MixerCurve::UpdateSettingsTable()
QList<double> points = m_curve->getCurve(); QList<double> points = m_curve->getCurve();
int ptCnt = points.count(); int ptCnt = points.count();
for (int i=0; i<ptCnt; i++) for (int i = 0; i < ptCnt; i++) {
{ QTableWidgetItem *item = m_settings->item(i, 0);
QTableWidgetItem* item = m_settings->item(i, 0); if (item) {
if (item) item->setText(QString().sprintf("%.2f", points.at((ptCnt - 1) - i)));
item->setText(QString().sprintf("%.2f",points.at( (ptCnt - 1) - i ))); }
} }
} }
@ -338,12 +325,12 @@ void MixerCurve::SettingsTableChanged()
{ {
QList<double> points; QList<double> points;
for (int i=0; i < m_settings->rowCount(); i++) for (int i = 0; i < m_settings->rowCount(); i++) {
{ QTableWidgetItem *item = m_settings->item(i, 0);
QTableWidgetItem* item = m_settings->item(i, 0);
if (item) if (item) {
points.push_front(item->text().toDouble()); points.push_front(item->text().toDouble());
}
} }
m_mixerUI->CurveMin->setValue(points.first()); m_mixerUI->CurveMin->setValue(points.first());
@ -369,7 +356,7 @@ void MixerCurve::CurveMinChanged(double value)
void MixerCurve::CurveMaxChanged(double value) void MixerCurve::CurveMaxChanged(double value)
{ {
// the max changed so redraw the curve // the max changed so redraw the curve
// mixercurvewidget::setCurve will trim any points above max // mixercurvewidget::setCurve will trim any points above max
QList<double> points = m_curve->getCurve(); QList<double> points = m_curve->getCurve();
points.removeLast(); points.removeLast();
points.append(value); points.append(value);
@ -381,23 +368,25 @@ void MixerCurve::showEvent(QShowEvent *event)
Q_UNUSED(event); Q_UNUSED(event);
m_settings->resizeColumnsToContents(); m_settings->resizeColumnsToContents();
m_settings->setColumnWidth(0,(m_settings->width()- m_settings->verticalHeader()->width())); m_settings->setColumnWidth(0, (m_settings->width() - m_settings->verticalHeader()->width()));
int h = (m_settings->height() - m_settings->horizontalHeader()->height()) / m_settings->rowCount(); int h = (m_settings->height() - m_settings->horizontalHeader()->height()) / m_settings->rowCount();
for (int i=0; i<m_settings->rowCount(); i++) for (int i = 0; i < m_settings->rowCount(); i++) {
m_settings->setRowHeight(i, h); m_settings->setRowHeight(i, h);
}
m_curve->showEvent(event); m_curve->showEvent(event);
} }
void MixerCurve::resizeEvent(QResizeEvent* event) void MixerCurve::resizeEvent(QResizeEvent *event)
{ {
m_settings->resizeColumnsToContents(); m_settings->resizeColumnsToContents();
m_settings->setColumnWidth(0,(m_settings->width() - m_settings->verticalHeader()->width())); m_settings->setColumnWidth(0, (m_settings->width() - m_settings->verticalHeader()->width()));
int h = (m_settings->height() - m_settings->horizontalHeader()->height()) / m_settings->rowCount(); int h = (m_settings->height() - m_settings->horizontalHeader()->height()) / m_settings->rowCount();
for (int i=0; i<m_settings->rowCount(); i++) for (int i = 0; i < m_settings->rowCount(); i++) {
m_settings->setRowHeight(i, h); m_settings->setRowHeight(i, h);
}
m_curve->resizeEvent(event); m_curve->resizeEvent(event);
} }

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1076</width> <width>1075</width>
<height>834</height> <height>834</height>
</rect> </rect>
</property> </property>
@ -589,6 +589,9 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth"> <property name="lineWidth">
<number>0</number> <number>0</number>
</property> </property>
@ -600,11 +603,2023 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1046</width> <width>1045</width>
<height>751</height> <height>751</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<item>
<widget class="QGroupBox" name="basicResponsivenessGroupBox">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title">
<string>Responsiveness</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="flat">
<bool>false</bool>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_7" rowstretch="0,0">
<property name="margin">
<number>12</number>
</property>
<item row="0" column="4">
<widget class="QPushButton" name="pushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Default</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<spacer name="horizontalSpacer_37">
<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="1" column="0" colspan="5">
<widget class="QGroupBox" name="groupBox_7">
<property name="styleSheet">
<string>QGroupBox{border: 0px;}</string>
</property>
<property name="title">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="3">
<widget class="QLabel" name="label_143">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>14</red>
<green>200</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>150</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(14, 200, 14, 255), stop:0.78607 rgba(6, 150, 6 , 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Snappy</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QSpinBox" name="spinBox">
<property name="minimumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>500</number>
</property>
<property name="value">
<number>150</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollMax</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="1" colspan="5">
<widget class="QSlider" name="RateResponsivenessSlider">
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>800</number>
</property>
<property name="value">
<number>450</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Roll</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_50">
<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="6">
<widget class="QSpinBox" name="spinBox_2">
<property name="minimumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>800</number>
</property>
<property name="value">
<number>300</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Roll</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_51">
<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="0" column="1">
<widget class="QLabel" name="label_142">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>34</red>
<green>34</green>
<blue>200</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>6</red>
<green>6</green>
<blue>150</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(34, 34, 200, 255), stop:0.78607 rgba(6, 6, 150, 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Moderate</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="label_144">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>200</red>
<green>14</green>
<blue>14</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>160</red>
<green>6</green>
<blue>6</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(200, 14, 14, 255), stop:0.78607 rgba(160 , 6, 6 , 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Insane</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>78</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Attitude mode</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>78</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Rate mode</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" colspan="5">
<widget class="QSlider" name="AttitudeResponsivenessSlider">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>500</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:RollMax</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="1" colspan="5">
<widget class="QSlider" name="RateYawResponsivenessSlider">
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>800</number>
</property>
<property name="value">
<number>450</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Yaw</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>78</width>
<height>16</height>
</size>
</property>
<property name="text">
<string>Rate mode yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QSpinBox" name="spinBox_5">
<property name="minimumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>800</number>
</property>
<property name="value">
<number>300</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:ManualRate</string>
<string>element:Yaw</string>
<string>haslimits:no</string>
<string>scale:1</string>
<string>buttongroup:6,20</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="RateStabilizationGroup_15"> <widget class="QGroupBox" name="RateStabilizationGroup_15">
<property name="sizePolicy"> <property name="sizePolicy">
@ -1157,7 +3172,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -1166,569 +3181,15 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_11" columnstretch="0,1,0,1,0,1,0"> <layout class="QGridLayout" name="gridLayout_11" columnstretch="0,1,0,1,0,1,0">
<item row="0" column="0"> <property name="leftMargin">
<spacer name="horizontalSpacer_44"> <number>0</number>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> <property name="rightMargin">
</property> <number>0</number>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="bottomMargin">
<width>40</width> <number>0</number>
<height>20</height> </property>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_138">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="2"> <item row="0" column="2">
<spacer name="horizontalSpacer_16"> <spacer name="horizontalSpacer_16">
<property name="orientation"> <property name="orientation">
@ -1742,555 +3203,18 @@ border-radius: 5;</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="3"> <item row="0" column="0">
<widget class="QLabel" name="label_139"> <spacer name="horizontalSpacer_44">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>40</width>
<height>16</height> <height>20</height>
</size> </size>
</property> </property>
<property name="palette"> </spacer>
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Pitch</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="4">
<spacer name="horizontalSpacer_20"> <spacer name="horizontalSpacer_20">
@ -2855,45 +3779,557 @@ border-radius: 5;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="6"> <item row="0" column="3">
<spacer name="horizontalSpacer_45"> <widget class="QLabel" name="label_139">
<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="1" column="0">
<widget class="QLabel" name="label_141">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>78</width> <width>0</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Proportional</string> <string>Pitch</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="1">
<widget class="QSlider" name="horizontalSlider_76"> <widget class="QSlider" name="horizontalSlider_76">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -2947,7 +4383,7 @@ Then lower the value by 5 or so.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="2" column="2">
<widget class="QSpinBox" name="spinBox_7"> <widget class="QSpinBox" name="spinBox_7">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -2986,97 +4422,32 @@ Then lower the value by 5 or so.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="2" column="0">
<widget class="QSlider" name="PitchPSlider"> <widget class="QLabel" name="label_141">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>78</width>
<height>25</height> <height>16</height>
</size> </size>
</property> </property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Slowly raise Proportional until you start seeing clear oscillations when you fly.
Then lower the value by 5 or so.</string>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="maximum"> <property name="text">
<number>100</number> <string>Proportional</string>
</property> </property>
<property name="sliderPosition"> <property name="alignment">
<number>50</number> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="2" column="5">
<widget class="QSpinBox" name="spinBox_PitchRateP">
<property name="minimumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Slowly raise Proportional until you start seeing clear oscillations when you fly.
Then lower the value by 5 or so.</string>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>200</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QSlider" name="horizontalSlider_78"> <widget class="QSlider" name="horizontalSlider_78">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -3127,7 +4498,97 @@ Then lower the value by 5 or so.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="6"> <item row="2" column="3">
<widget class="QSlider" name="PitchPSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Slowly raise Proportional until you start seeing clear oscillations when you fly.
Then lower the value by 5 or so.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="sliderPosition">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QSpinBox" name="spinBox_PitchRateP">
<property name="minimumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>22</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Slowly raise Proportional until you start seeing clear oscillations when you fly.
Then lower the value by 5 or so.</string>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="value">
<number>200</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Kp</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QSpinBox" name="spinBox_12"> <widget class="QSpinBox" name="spinBox_12">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -3166,26 +4627,7 @@ Then lower the value by 5 or so.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="1">
<widget class="QLabel" name="label_145">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Integral</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSlider" name="horizontalSlider_79"> <widget class="QSlider" name="horizontalSlider_79">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -3236,7 +4678,26 @@ value as the Kp.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="3" column="0">
<widget class="QLabel" name="label_145">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Integral</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QSpinBox" name="spinBox_8"> <widget class="QSpinBox" name="spinBox_8">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -3275,59 +4736,8 @@ value as the Kp.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="3" column="6">
<widget class="QSlider" name="horizontalSlider_80"> <widget class="QSpinBox" name="spinBox_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>As a rule of thumb, you can set the Integral at roughly the same
value as the Kp.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="sliderPosition">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QSpinBox" name="spinBox_9">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
@ -3356,7 +4766,7 @@ value as the Kp.</string>
<property name="objrelation" stdset="0"> <property name="objrelation" stdset="0">
<stringlist> <stringlist>
<string>objname:StabilizationSettings</string> <string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string> <string>fieldname:YawRatePID</string>
<string>element:Ki</string> <string>element:Ki</string>
<string>haslimits:yes</string> <string>haslimits:yes</string>
<string>scale:0.0001</string> <string>scale:0.0001</string>
@ -3365,7 +4775,7 @@ value as the Kp.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="5"> <item row="3" column="5">
<widget class="QSlider" name="horizontalSlider_81"> <widget class="QSlider" name="horizontalSlider_81">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -3416,8 +4826,59 @@ value as the Kp.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="6"> <item row="3" column="3">
<widget class="QSpinBox" name="spinBox_10"> <widget class="QSlider" name="horizontalSlider_80">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>As a rule of thumb, you can set the Integral at roughly the same
value as the Kp.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="sliderPosition">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>25</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:StabilizationSettings</string>
<string>fieldname:PitchRatePID</string>
<string>element:Ki</string>
<string>haslimits:yes</string>
<string>scale:0.0001</string>
<string>buttongroup:1,10</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QSpinBox" name="spinBox_9">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>50</width>
@ -3446,7 +4907,7 @@ value as the Kp.</string>
<property name="objrelation" stdset="0"> <property name="objrelation" stdset="0">
<stringlist> <stringlist>
<string>objname:StabilizationSettings</string> <string>objname:StabilizationSettings</string>
<string>fieldname:YawRatePID</string> <string>fieldname:PitchRatePID</string>
<string>element:Ki</string> <string>element:Ki</string>
<string>haslimits:yes</string> <string>haslimits:yes</string>
<string>scale:0.0001</string> <string>scale:0.0001</string>
@ -3455,6 +4916,569 @@ value as the Kp.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QLabel" name="label_138">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>16</height>
</size>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</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>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Light">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>58</red>
<green>58</green>
<blue>58</blue>
</color>
</brush>
</colorrole>
<colorrole role="Midlight">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>48</red>
<green>48</green>
<blue>48</blue>
</color>
</brush>
</colorrole>
<colorrole role="Dark">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>19</red>
<green>19</green>
<blue>19</blue>
</color>
</brush>
</colorrole>
<colorrole role="Mid">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>26</red>
<green>26</green>
<blue>26</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="BrightText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="LinearGradientPattern">
<gradient startx="0.507000000000000" starty="0.000000000000000" endx="0.507000000000000" endy="0.772000000000000" type="LinearGradient" spread="ReflectSpread" coordinatemode="ObjectBoundingMode">
<gradientstop position="0.208955000000000">
<color alpha="255">
<red>74</red>
<green>74</green>
<blue>74</blue>
</color>
</gradientstop>
<gradientstop position="0.786070000000000">
<color alpha="255">
<red>36</red>
<green>36</green>
<blue>36</blue>
</color>
</gradientstop>
</gradient>
</brush>
</colorrole>
<colorrole role="Shadow">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="AlternateBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>39</red>
<green>39</green>
<blue>39</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipBase">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>220</blue>
</color>
</brush>
</colorrole>
<colorrole role="ToolTipText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;</string>
</property>
<property name="text">
<string>Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="6">
<spacer name="horizontalSpacer_45">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -4510,7 +6534,7 @@ value as the Kp.</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -4519,6 +6543,15 @@ value as the Kp.</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_12" columnstretch="0,1,0,1,0,1,0"> <layout class="QGridLayout" name="gridLayout_12" columnstretch="0,1,0,1,0,1,0">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_150"> <widget class="QLabel" name="label_150">
<property name="sizePolicy"> <property name="sizePolicy">
@ -6978,7 +9011,7 @@ border-radius: 5;</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1046</width> <width>1045</width>
<height>751</height> <height>751</height>
</rect> </rect>
</property> </property>
@ -6986,8 +9019,11 @@ border-radius: 5;</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
<property name="spacing">
<number>9</number>
</property>
<property name="margin"> <property name="margin">
<number>12</number> <number>9</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="RateStabilizationGroup_8"> <widget class="QGroupBox" name="RateStabilizationGroup_8">
@ -7524,7 +9560,7 @@ border-radius: 5;</string>
</palette> </palette>
</property> </property>
<property name="title"> <property name="title">
<string>Rate Stabization Coefficients (Inner Loop)</string> <string>Rate Stabilization Coefficients (Inner Loop)</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -8033,7 +10069,7 @@ border-radius: 5;</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -8045,8 +10081,11 @@ border-radius: 5;</string>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>0</number>
</property> </property>
<item row="3" column="4"> <item row="3" column="4">
<widget class="QDoubleSpinBox" name="PitchRateKd"> <widget class="QDoubleSpinBox" name="PitchRateKd">
@ -10849,7 +12888,7 @@ Then lower the value by 20% or so.</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="title"> <property name="title">
<string>Attitude Stabization Coefficients (Outer Loop)</string> <string>Attitude Stabilization Coefficients (Outer Loop)</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -11358,7 +13397,7 @@ Then lower the value by 20% or so.</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -11370,6 +13409,12 @@ Then lower the value by 20% or so.</string>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<spacer name="horizontalSpacer_8"> <spacer name="horizontalSpacer_8">
<property name="orientation"> <property name="orientation">
@ -13442,7 +15487,7 @@ border-radius: 5;</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="RateStabilizationGroup_6"> <widget class="QGroupBox" name="advancedResponsivenessGroupBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -13976,11 +16021,17 @@ border-radius: 5;</string>
</palette> </palette>
</property> </property>
<property name="title"> <property name="title">
<string>Stick Range and Limits</string> <string>Stick Responsiveness</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_18"> <layout class="QGridLayout" name="gridLayout_18">
<property name="margin"> <property name="margin">
<number>12</number> <number>12</number>
@ -14475,7 +16526,7 @@ border-radius: 5;</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -14487,6 +16538,12 @@ border-radius: 5;</string>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>0</number> <number>0</number>
</property> </property>
@ -15944,7 +18001,7 @@ border-radius: 5;</string>
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text"> <property name="text">
<string>Full stick angle (deg)</string> <string>Attitude mode response (deg)</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -16746,7 +18803,7 @@ border-radius: 5;</string>
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text"> <property name="text">
<string>Full stick rate (deg/s)</string> <string>Rate mode response (deg/s)</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -16901,13 +18958,16 @@ border-radius: 5;</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1046</width> <width>1045</width>
<height>751</height> <height>751</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="verticalLayout_9">
<property name="spacing">
<number>9</number>
</property>
<property name="margin"> <property name="margin">
<number>12</number> <number>9</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="groupBox_4"> <widget class="QGroupBox" name="groupBox_4">
@ -16986,12 +19046,24 @@ border-radius: 5;</string>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="styleSheet">
<string>QGroupBox{border: 0px;}</string>
</property>
<property name="flat"> <property name="flat">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<property name="margin"> <property name="leftMargin">
<number>12</number> <number>0</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="label_50"> <widget class="QLabel" name="label_50">
@ -19823,6 +21895,9 @@ border-radius: 5;</string>
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="styleSheet">
<string>QGroupBox{border: 0px;}</string>
</property>
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
@ -19830,8 +21905,17 @@ border-radius: 5;</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_8" columnstretch="0,0,1,0,1,0,1,0"> <layout class="QGridLayout" name="gridLayout_8" columnstretch="0,0,1,0,1,0,1,0">
<property name="margin"> <property name="leftMargin">
<number>12</number> <number>0</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item row="1" column="4"> <item row="1" column="4">
<widget class="QDoubleSpinBox" name="RatePitchILimit"> <widget class="QDoubleSpinBox" name="RatePitchILimit">
@ -22962,7 +25046,7 @@ border-radius: 5;</string>
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true">QGroupBox{border: 0px;}</string>
</property> </property>
<property name="title"> <property name="title">
<string/> <string/>
@ -22971,8 +25055,17 @@ border-radius: 5;</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_14" columnstretch="0,1,0,1,0,1,0"> <layout class="QGridLayout" name="gridLayout_14" columnstretch="0,1,0,1,0,1,0">
<property name="margin"> <property name="leftMargin">
<number>12</number> <number>0</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item row="1" column="2"> <item row="1" column="2">
<spacer name="horizontalSpacer_41"> <spacer name="horizontalSpacer_41">

View File

@ -32,44 +32,45 @@
/** /**
* Constructor * Constructor
*/ */
ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),allowWidgetUpdates(true),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL) ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent), isConnected(false), allowWidgetUpdates(true), smartsave(NULL), dirty(false), outOfLimitsStyle("background-color: rgb(255, 0, 0);"), timeOut(NULL)
{ {
pm = ExtensionSystem::PluginManager::instance(); pm = ExtensionSystem::PluginManager::instance();
objManager = pm->getObject<UAVObjectManager>(); objManager = pm->getObject<UAVObjectManager>();
TelemetryManager* telMngr = pm->getObject<TelemetryManager>(); TelemetryManager *telMngr = pm->getObject<TelemetryManager>();
utilMngr = pm->getObject<UAVObjectUtilManager>(); utilMngr = pm->getObject<UAVObjectUtilManager>();
connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()),Qt::UniqueConnection); connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()), Qt::UniqueConnection);
connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()),Qt::UniqueConnection); connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()), Qt::UniqueConnection);
connect(telMngr, SIGNAL(connected()), this, SIGNAL(autoPilotConnected()),Qt::UniqueConnection); connect(telMngr, SIGNAL(connected()), this, SIGNAL(autoPilotConnected()), Qt::UniqueConnection);
connect(telMngr, SIGNAL(disconnected()), this, SIGNAL(autoPilotDisconnected()),Qt::UniqueConnection); connect(telMngr, SIGNAL(disconnected()), this, SIGNAL(autoPilotDisconnected()), Qt::UniqueConnection);
UAVSettingsImportExportFactory * importexportplugin = pm->getObject<UAVSettingsImportExportFactory>(); UAVSettingsImportExportFactory *importexportplugin = pm->getObject<UAVSettingsImportExportFactory>();
connect(importexportplugin,SIGNAL(importAboutToBegin()),this,SLOT(invalidateObjects())); connect(importexportplugin, SIGNAL(importAboutToBegin()), this, SLOT(invalidateObjects()));
} }
/** /**
* Add a widget to the dirty detection pool * Add a widget to the dirty detection pool
* @param widget to add to the detection pool * @param widget to add to the detection pool
*/ */
void ConfigTaskWidget::addWidget(QWidget * widget) void ConfigTaskWidget::addWidget(QWidget *widget)
{ {
addUAVObjectToWidgetRelation("","",widget); addUAVObjectToWidgetRelation("", "", widget);
} }
/** /**
* Add an object to the management system * Add an object to the management system
* @param objectName name of the object to add to the management system * @param objectName name of the object to add to the management system
*/ */
void ConfigTaskWidget::addUAVObject(QString objectName,QList<int> * reloadGroups) void ConfigTaskWidget::addUAVObject(QString objectName, QList<int> *reloadGroups)
{ {
addUAVObjectToWidgetRelation(objectName,"",NULL,0,1,false,reloadGroups); addUAVObjectToWidgetRelation(objectName, "", NULL, 0, 1, false, reloadGroups);
} }
void ConfigTaskWidget::addUAVObject(UAVObject *objectName, QList<int> *reloadGroups) void ConfigTaskWidget::addUAVObject(UAVObject *objectName, QList<int> *reloadGroups)
{ {
QString objstr; QString objstr;
if(objectName)
objstr=objectName->getName();
addUAVObject(objstr, reloadGroups);
if (objectName) {
objstr = objectName->getName();
}
addUAVObject(objstr, reloadGroups);
} }
/** /**
* Add an UAVObject field to widget relation to the management system * Add an UAVObject field to widget relation to the management system
@ -78,25 +79,29 @@ void ConfigTaskWidget::addUAVObject(UAVObject *objectName, QList<int> *reloadGro
* @param widget pointer to the widget whitch will display/define the field value * @param widget pointer to the widget whitch will display/define the field value
* @param index index of the field element to add to this relation * @param index index of the field element to add to this relation
*/ */
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget, QString index) void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index)
{ {
UAVObject *obj=NULL; UAVObject *obj = NULL;
UAVObjectField *_field=NULL; UAVObjectField *_field = NULL;
obj = objManager->getObject(QString(object));
obj = objManager->getObject(QString(object));
Q_ASSERT(obj); Q_ASSERT(obj);
_field = obj->getField(QString(field)); _field = obj->getField(QString(field));
Q_ASSERT(_field); Q_ASSERT(_field);
addUAVObjectToWidgetRelation(object,field,widget,_field->getElementNames().indexOf(index)); addUAVObjectToWidgetRelation(object, field, widget, _field->getElementNames().indexOf(index));
} }
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, QString index) void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString index)
{ {
QString objstr; QString objstr;
QString fieldstr; QString fieldstr;
if(obj)
objstr=obj->getName(); if (obj) {
if(field) objstr = obj->getName();
fieldstr=field->getName(); }
if (field) {
fieldstr = field->getName();
}
addUAVObjectToWidgetRelation(objstr, fieldstr, widget, index); addUAVObjectToWidgetRelation(objstr, fieldstr, widget, index);
} }
/** /**
@ -112,38 +117,45 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectFie
*/ */
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID) void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{ {
UAVObject *obj=objManager->getObject(QString(object),instID); UAVObject *obj = objManager->getObject(QString(object), instID);
Q_ASSERT(obj); Q_ASSERT(obj);
UAVObjectField *_field; UAVObjectField *_field;
int index=0; int index = 0;
if(!field.isEmpty() && obj) if (!field.isEmpty() && obj) {
{
_field = obj->getField(QString(field)); _field = obj->getField(QString(field));
if(!element.isEmpty()) if (!element.isEmpty()) {
index=_field->getElementNames().indexOf(QString(element)); index = _field->getElementNames().indexOf(QString(element));
}
} }
addUAVObjectToWidgetRelation(object, field, widget,index,scale,isLimited,defaultReloadGroups,instID); addUAVObjectToWidgetRelation(object, field, widget, index, scale, isLimited, defaultReloadGroups, instID);
} }
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID) void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{ {
QString objstr; QString objstr;
QString fieldstr; QString fieldstr;
if(obj)
objstr=obj->getName(); if (obj) {
if(field) objstr = obj->getName();
fieldstr=field->getName(); }
if (field) {
fieldstr = field->getName();
}
addUAVObjectToWidgetRelation(objstr, fieldstr, widget, element, scale, isLimited, defaultReloadGroups, instID); addUAVObjectToWidgetRelation(objstr, fieldstr, widget, element, scale, isLimited, defaultReloadGroups, instID);
} }
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject * obj,UAVObjectField * field, QWidget * widget, int index,double scale,bool isLimited,QList<int>* defaultReloadGroups, quint32 instID) void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, int index, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{ {
QString objstr; QString objstr;
QString fieldstr; QString fieldstr;
if(obj)
objstr=obj->getName(); if (obj) {
if(field) objstr = obj->getName();
fieldstr=field->getName(); }
addUAVObjectToWidgetRelation(objstr,fieldstr,widget,index,scale,isLimited,defaultReloadGroups,instID); if (field) {
fieldstr = field->getName();
}
addUAVObjectToWidgetRelation(objstr, fieldstr, widget, index, scale, isLimited, defaultReloadGroups, instID);
} }
/** /**
@ -157,63 +169,55 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject * obj,UAVObjectFie
* @param defaultReloadGroups default and reload groups this relation belongs to * @param defaultReloadGroups default and reload groups this relation belongs to
* @param instID instance ID of the object used on this relation * @param instID instance ID of the object used on this relation
*/ */
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget, int index,double scale,bool isLimited,QList<int>* defaultReloadGroups, quint32 instID) void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, int index, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{ {
if(addShadowWidget(object,field,widget,index,scale,isLimited,defaultReloadGroups,instID)) if (addShadowWidget(object, field, widget, index, scale, isLimited, defaultReloadGroups, instID)) {
return; return;
UAVObject *obj=NULL;
UAVObjectField *_field=NULL;
if(!object.isEmpty())
{
obj = objManager->getObject(QString(object),instID);
Q_ASSERT(obj);
objectUpdates.insert(obj,true);
connect(obj, SIGNAL(objectUpdated(UAVObject*)),this, SLOT(objectUpdated(UAVObject*)));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)), Qt::UniqueConnection);
} }
if(!field.isEmpty() && obj)
UAVObject *obj = NULL;
UAVObjectField *_field = NULL;
if (!object.isEmpty()) {
obj = objManager->getObject(QString(object), instID);
Q_ASSERT(obj);
objectUpdates.insert(obj, true);
connect(obj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(objectUpdated(UAVObject *)));
connect(obj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshWidgetsValues(UAVObject *)), Qt::UniqueConnection);
}
if (!field.isEmpty() && obj) {
_field = obj->getField(QString(field)); _field = obj->getField(QString(field));
objectToWidget * ow=new objectToWidget(); }
ow->field=_field; objectToWidget *ow = new objectToWidget();
ow->object=obj; ow->field = _field;
ow->widget=widget; ow->object = obj;
ow->index=index; ow->widget = widget;
ow->scale=scale; ow->index = index;
ow->isLimited=isLimited; ow->scale = scale;
ow->isLimited = isLimited;
objOfInterest.append(ow); objOfInterest.append(ow);
if(obj) if (obj) {
{ if (smartsave) {
if(smartsave) smartsave->addObject((UAVDataObject *)obj);
{
smartsave->addObject((UAVDataObject*)obj);
} }
} }
if(widget==NULL) if (widget == NULL) {
{ if (defaultReloadGroups && obj) {
if(defaultReloadGroups && obj) foreach(int i, *defaultReloadGroups) {
{ if (this->defaultReloadGroups.contains(i)) {
foreach(int i,*defaultReloadGroups)
{
if(this->defaultReloadGroups.contains(i))
{
this->defaultReloadGroups.value(i)->append(ow); this->defaultReloadGroups.value(i)->append(ow);
} } else {
else this->defaultReloadGroups.insert(i, new QList<objectToWidget *>());
{
this->defaultReloadGroups.insert(i,new QList<objectToWidget*>());
this->defaultReloadGroups.value(i)->append(ow); this->defaultReloadGroups.value(i)->append(ow);
} }
} }
} }
} } else {
else connectWidgetUpdatesToSlot(widget, SLOT(widgetsContentsChanged()));
{ if (defaultReloadGroups) {
connectWidgetUpdatesToSlot(widget,SLOT(widgetsContentsChanged())); addWidgetToDefaultReloadGroups(widget, defaultReloadGroups);
if(defaultReloadGroups) }
addWidgetToDefaultReloadGroups(widget,defaultReloadGroups); shadowsList.insert(widget, ow);
shadowsList.insert(widget,ow); loadWidgetLimits(widget, _field, index, isLimited, scale);
loadWidgetLimits(widget,_field,index,isLimited,scale);
} }
} }
/** /**
@ -221,20 +225,20 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
*/ */
ConfigTaskWidget::~ConfigTaskWidget() ConfigTaskWidget::~ConfigTaskWidget()
{ {
if(smartsave) if (smartsave) {
delete smartsave; delete smartsave;
foreach(QList<objectToWidget*>* pointer,defaultReloadGroups.values()) }
{ foreach(QList<objectToWidget *> *pointer, defaultReloadGroups.values()) {
if(pointer) if (pointer) {
delete pointer; delete pointer;
}
} }
foreach (objectToWidget* oTw, objOfInterest) foreach(objectToWidget * oTw, objOfInterest) {
{ if (oTw) {
if(oTw)
delete oTw; delete oTw;
}
} }
if(timeOut) if (timeOut) {
{
delete timeOut; delete timeOut;
timeOut = NULL; timeOut = NULL;
} }
@ -245,7 +249,8 @@ void ConfigTaskWidget::saveObjectToSD(UAVObject *obj)
// saveObjectToSD is now handled by the UAVUtils plugin in one // saveObjectToSD is now handled by the UAVUtils plugin in one
// central place (and one central queue) // central place (and one central queue)
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>(); UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
utilMngr->saveObjectToSD(obj); utilMngr->saveObjectToSD(obj);
} }
@ -253,9 +258,11 @@ void ConfigTaskWidget::saveObjectToSD(UAVObject *obj)
* Util function to get a pointer to the object manager * Util function to get a pointer to the object manager
* @return pointer to the UAVObjectManager * @return pointer to the UAVObjectManager
*/ */
UAVObjectManager* ConfigTaskWidget::getObjectManager() { UAVObjectManager *ConfigTaskWidget::getObjectManager()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager * objMngr = pm->getObject<UAVObjectManager>(); UAVObjectManager *objMngr = pm->getObject<UAVObjectManager>();
Q_ASSERT(objMngr); Q_ASSERT(objMngr);
return objMngr; return objMngr;
} }
@ -267,8 +274,10 @@ UAVObjectManager* ConfigTaskWidget::getObjectManager() {
double ConfigTaskWidget::listMean(QList<double> list) double ConfigTaskWidget::listMean(QList<double> list)
{ {
double accum = 0; double accum = 0;
for(int i = 0; i < list.size(); i++)
for (int i = 0; i < list.size(); i++) {
accum += list[i]; accum += list[i];
}
return accum / list.size(); return accum / list.size();
} }
@ -280,15 +289,17 @@ double ConfigTaskWidget::listMean(QList<double> list)
double ConfigTaskWidget::listVar(QList<double> list) double ConfigTaskWidget::listVar(QList<double> list)
{ {
double mean_accum = 0; double mean_accum = 0;
double var_accum = 0; double var_accum = 0;
double mean; double mean;
for(int i = 0; i < list.size(); i++) for (int i = 0; i < list.size(); i++) {
mean_accum += list[i]; mean_accum += list[i];
}
mean = mean_accum / list.size(); mean = mean_accum / list.size();
for(int i = 0; i < list.size(); i++) for (int i = 0; i < list.size(); i++) {
var_accum += (list[i] - mean) * (list[i] - mean); var_accum += (list[i] - mean) * (list[i] - mean);
}
// Use unbiased estimator // Use unbiased estimator
return var_accum / (list.size() - 1); return var_accum / (list.size() - 1);
@ -299,26 +310,26 @@ double ConfigTaskWidget::listVar(QList<double> list)
void ConfigTaskWidget::onAutopilotDisconnect() void ConfigTaskWidget::onAutopilotDisconnect()
{ {
isConnected=false; isConnected = false;
enableControls(false); enableControls(false);
invalidateObjects(); invalidateObjects();
} }
void ConfigTaskWidget::forceConnectedState()//dynamic widgets don't recieve the connected signal. This should be called instead. void ConfigTaskWidget::forceConnectedState() // dynamic widgets don't recieve the connected signal. This should be called instead.
{ {
isConnected=true; isConnected = true;
setDirty(false); setDirty(false);
} }
void ConfigTaskWidget::onAutopilotConnect() void ConfigTaskWidget::onAutopilotConnect()
{ {
if (utilMngr) if (utilMngr) {
currentBoard = utilMngr->getBoardModel();//TODO REMEMBER TO ADD THIS TO FORCE CONNECTED FUNC ON CC3D_RELEASE currentBoard = utilMngr->getBoardModel(); // TODO REMEMBER TO ADD THIS TO FORCE CONNECTED FUNC ON CC3D_RELEASE
}
invalidateObjects(); invalidateObjects();
isConnected=true; isConnected = true;
foreach(objectToWidget * ow,objOfInterest) foreach(objectToWidget * ow, objOfInterest) {
{ loadWidgetLimits(ow->widget, ow->field, ow->index, ow->isLimited, ow->scale);
loadWidgetLimits(ow->widget,ow->field,ow->index,ow->isLimited,ow->scale);
} }
setDirty(false); setDirty(false);
enableControls(true); enableControls(true);
@ -330,16 +341,15 @@ void ConfigTaskWidget::onAutopilotConnect()
*/ */
void ConfigTaskWidget::populateWidgets() void ConfigTaskWidget::populateWidgets()
{ {
bool dirtyBack=dirty; bool dirtyBack = dirty;
emit populateWidgetsRequested(); emit populateWidgetsRequested();
foreach(objectToWidget * ow,objOfInterest)
{ foreach(objectToWidget * ow, objOfInterest) {
if(ow->object==NULL || ow->field==NULL || ow->widget==NULL) if (ow->object == NULL || ow->field == NULL || ow->widget == NULL) {
{
// do nothing // do nothing
} else {
setWidgetFromField(ow->widget, ow->field, ow->index, ow->scale, ow->isLimited);
} }
else
setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited);
} }
setDirty(dirtyBack); setDirty(dirtyBack);
} }
@ -348,28 +358,24 @@ void ConfigTaskWidget::populateWidgets()
* object field added to the framework pool * object field added to the framework pool
* Overwrite this if you need to change the default behavior * Overwrite this if you need to change the default behavior
*/ */
void ConfigTaskWidget::refreshWidgetsValues(UAVObject * obj) void ConfigTaskWidget::refreshWidgetsValues(UAVObject *obj)
{ {
if (!allowWidgetUpdates) if (!allowWidgetUpdates) {
return; return;
}
bool dirtyBack=dirty; bool dirtyBack = dirty;
emit refreshWidgetsValuesRequested(); emit refreshWidgetsValuesRequested();
foreach(objectToWidget * ow,objOfInterest) foreach(objectToWidget * ow, objOfInterest) {
{ if (ow->object == NULL || ow->field == NULL || ow->widget == NULL) {
if(ow->object==NULL || ow->field==NULL || ow->widget==NULL) // do nothing
{ } else {
//do nothing if (ow->object == obj || obj == NULL) {
setWidgetFromField(ow->widget, ow->field, ow->index, ow->scale, ow->isLimited);
}
} }
else
{
if(ow->object==obj || obj==NULL)
setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited);
}
} }
setDirty(dirtyBack); setDirty(dirtyBack);
} }
/** /**
* SLOT function used to update the uavobject fields from widgets with relation to * SLOT function used to update the uavobject fields from widgets with relation to
@ -379,15 +385,11 @@ void ConfigTaskWidget::refreshWidgetsValues(UAVObject * obj)
void ConfigTaskWidget::updateObjectsFromWidgets() void ConfigTaskWidget::updateObjectsFromWidgets()
{ {
emit updateObjectsFromWidgetsRequested(); emit updateObjectsFromWidgetsRequested();
foreach(objectToWidget * ow,objOfInterest)
{
if(ow->object==NULL || ow->field==NULL)
{
foreach(objectToWidget * ow, objOfInterest) {
if (ow->object == NULL || ow->field == NULL) {} else {
setFieldFromWidget(ow->widget, ow->field, ow->index, ow->scale);
} }
else
setFieldFromWidget(ow->widget,ow->field,ow->index,ow->scale);
} }
} }
/** /**
@ -396,9 +398,11 @@ void ConfigTaskWidget::updateObjectsFromWidgets()
*/ */
void ConfigTaskWidget::helpButtonPressed() void ConfigTaskWidget::helpButtonPressed()
{ {
QString url=helpButtonList.value((QPushButton*)sender(),QString()); QString url = helpButtonList.value((QPushButton *)sender(), QString());
if(!url.isEmpty())
QDesktopServices::openUrl( QUrl(url, QUrl::StrictMode) ); if (!url.isEmpty()) {
QDesktopServices::openUrl(QUrl(url, QUrl::StrictMode));
}
} }
/** /**
* Add update and save buttons to the form * Add update and save buttons to the form
@ -408,25 +412,23 @@ void ConfigTaskWidget::helpButtonPressed()
*/ */
void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save) void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *save)
{ {
if(!smartsave) if (!smartsave) {
{ smartsave = new smartSaveButton();
smartsave=new smartSaveButton(); connect(smartsave, SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets()));
connect(smartsave,SIGNAL(preProcessOperations()), this, SLOT(updateObjectsFromWidgets())); connect(smartsave, SIGNAL(saveSuccessfull()), this, SLOT(clearDirty()));
connect(smartsave,SIGNAL(saveSuccessfull()),this,SLOT(clearDirty())); connect(smartsave, SIGNAL(beginOp()), this, SLOT(disableObjUpdates()));
connect(smartsave,SIGNAL(beginOp()),this,SLOT(disableObjUpdates())); connect(smartsave, SIGNAL(endOp()), this, SLOT(enableObjUpdates()));
connect(smartsave,SIGNAL(endOp()),this,SLOT(enableObjUpdates()));
} }
if(update && save) if (update && save) {
smartsave->addButtons(save,update); smartsave->addButtons(save, update);
else if (update) } else if (update) {
smartsave->addApplyButton(update); smartsave->addApplyButton(update);
else if (save) } else if (save) {
smartsave->addSaveButton(save); smartsave->addSaveButton(save);
if(objOfInterest.count()>0) }
{ if (objOfInterest.count() > 0) {
foreach(objectToWidget * oTw,objOfInterest) foreach(objectToWidget * oTw, objOfInterest) {
{ smartsave->addObject((UAVDataObject *)oTw->object);
smartsave->addObject((UAVDataObject*)oTw->object);
} }
} }
updateEnableControls(); updateEnableControls();
@ -439,18 +441,18 @@ void ConfigTaskWidget::addApplySaveButtons(QPushButton *update, QPushButton *sav
*/ */
void ConfigTaskWidget::enableControls(bool enable) void ConfigTaskWidget::enableControls(bool enable)
{ {
if(smartsave) { if (smartsave) {
smartsave->enableControls(enable); smartsave->enableControls(enable);
} }
foreach (QPushButton *button, reloadButtonList) { foreach(QPushButton * button, reloadButtonList) {
button->setEnabled(enable); button->setEnabled(enable);
} }
foreach(objectToWidget *ow,objOfInterest) { foreach(objectToWidget * ow, objOfInterest) {
if(ow->widget) { if (ow->widget) {
ow->widget->setEnabled(enable); ow->widget->setEnabled(enable);
foreach (shadow *sh, ow->shadowsList) { foreach(shadow * sh, ow->shadowsList) {
sh->widget->setEnabled(enable); sh->widget->setEnabled(enable);
} }
} }
@ -462,16 +464,13 @@ void ConfigTaskWidget::enableControls(bool enable)
*/ */
void ConfigTaskWidget::forceShadowUpdates() void ConfigTaskWidget::forceShadowUpdates()
{ {
foreach(objectToWidget * oTw,objOfInterest) foreach(objectToWidget * oTw, objOfInterest) {
{ foreach(shadow * sh, oTw->shadowsList) {
foreach (shadow * sh, oTw->shadowsList) disconnectWidgetUpdatesToSlot((QWidget *)sh->widget, SLOT(widgetsContentsChanged()));
{
disconnectWidgetUpdatesToSlot((QWidget*)sh->widget, SLOT(widgetsContentsChanged()));
checkWidgetsLimits(sh->widget, oTw->field, oTw->index, sh->isLimited, getVariantFromWidget(oTw->widget, oTw->scale, oTw->getUnits()), sh->scale); checkWidgetsLimits(sh->widget, oTw->field, oTw->index, sh->isLimited, getVariantFromWidget(oTw->widget, oTw->scale, oTw->getUnits()), sh->scale);
setWidgetFromVariant(sh->widget, getVariantFromWidget(oTw->widget, oTw->scale, oTw->getUnits()), sh->scale); setWidgetFromVariant(sh->widget, getVariantFromWidget(oTw->widget, oTw->scale, oTw->getUnits()), sh->scale);
emit widgetContentsChanged((QWidget*)sh->widget); emit widgetContentsChanged((QWidget *)sh->widget);
connectWidgetUpdatesToSlot((QWidget*)sh->widget, SLOT(widgetsContentsChanged())); connectWidgetUpdatesToSlot((QWidget *)sh->widget, SLOT(widgetsContentsChanged()));
} }
} }
setDirty(true); setDirty(true);
@ -481,49 +480,44 @@ void ConfigTaskWidget::forceShadowUpdates()
*/ */
void ConfigTaskWidget::widgetsContentsChanged() void ConfigTaskWidget::widgetsContentsChanged()
{ {
emit widgetContentsChanged((QWidget*)sender()); emit widgetContentsChanged((QWidget *)sender());
double scale; double scale;
objectToWidget * oTw= shadowsList.value((QWidget*)sender(),NULL); objectToWidget *oTw = shadowsList.value((QWidget *)sender(), NULL);
if(oTw)
{ if (oTw) {
if(oTw->widget==(QWidget*)sender()) if (oTw->widget == (QWidget *)sender()) {
{ scale = oTw->scale;
scale=oTw->scale; checkWidgetsLimits((QWidget *)sender(), oTw->field, oTw->index, oTw->isLimited, getVariantFromWidget((QWidget *)sender(),
checkWidgetsLimits((QWidget*)sender(), oTw->field, oTw->index, oTw->isLimited, getVariantFromWidget((QWidget*)sender(), oTw->scale, oTw->getUnits()), oTw->scale); oTw->scale, oTw->getUnits()), oTw->scale);
} } else {
else foreach(shadow * sh, oTw->shadowsList) {
{ if (sh->widget == (QWidget *)sender()) {
foreach (shadow * sh, oTw->shadowsList) scale = sh->scale;
{ checkWidgetsLimits((QWidget *)sender(), oTw->field, oTw->index, sh->isLimited, getVariantFromWidget((QWidget *)sender(),
if(sh->widget==(QWidget*)sender()) scale, oTw->getUnits()), scale);
{
scale=sh->scale;
checkWidgetsLimits((QWidget*)sender(), oTw->field, oTw->index, sh->isLimited, getVariantFromWidget((QWidget*)sender(), scale, oTw->getUnits()), scale);
} }
} }
} }
if(oTw->widget!=(QWidget *)sender()) if (oTw->widget != (QWidget *)sender()) {
{ disconnectWidgetUpdatesToSlot((QWidget *)oTw->widget, SLOT(widgetsContentsChanged()));
disconnectWidgetUpdatesToSlot((QWidget*)oTw->widget, SLOT(widgetsContentsChanged())); checkWidgetsLimits(oTw->widget, oTw->field, oTw->index, oTw->isLimited, getVariantFromWidget((QWidget *)sender(), scale, oTw->getUnits()), oTw->scale);
checkWidgetsLimits(oTw->widget, oTw->field, oTw->index, oTw->isLimited, getVariantFromWidget((QWidget*)sender(), scale, oTw->getUnits()), oTw->scale); setWidgetFromVariant(oTw->widget, getVariantFromWidget((QWidget *)sender(), scale, oTw->getUnits()), oTw->scale);
setWidgetFromVariant(oTw->widget, getVariantFromWidget((QWidget*)sender(), scale, oTw->getUnits()), oTw->scale); emit widgetContentsChanged((QWidget *)oTw->widget);
emit widgetContentsChanged((QWidget*)oTw->widget); connectWidgetUpdatesToSlot((QWidget *)oTw->widget, SLOT(widgetsContentsChanged()));
connectWidgetUpdatesToSlot((QWidget*)oTw->widget, SLOT(widgetsContentsChanged()));
} }
foreach (shadow * sh, oTw->shadowsList) foreach(shadow * sh, oTw->shadowsList) {
{ if (sh->widget != (QWidget *)sender()) {
if(sh->widget!=(QWidget*)sender()) disconnectWidgetUpdatesToSlot((QWidget *)sh->widget, SLOT(widgetsContentsChanged()));
{ checkWidgetsLimits(sh->widget, oTw->field, oTw->index, sh->isLimited, getVariantFromWidget((QWidget *)sender(), scale, oTw->getUnits()), sh->scale);
disconnectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged())); setWidgetFromVariant(sh->widget, getVariantFromWidget((QWidget *)sender(), scale, oTw->getUnits()), sh->scale);
checkWidgetsLimits(sh->widget, oTw->field, oTw->index, sh->isLimited, getVariantFromWidget((QWidget*)sender(), scale, oTw->getUnits()), sh->scale); emit widgetContentsChanged((QWidget *)sh->widget);
setWidgetFromVariant(sh->widget, getVariantFromWidget((QWidget*)sender(), scale, oTw->getUnits()), sh->scale); connectWidgetUpdatesToSlot((QWidget *)sh->widget, SLOT(widgetsContentsChanged()));
emit widgetContentsChanged((QWidget*)sh->widget);
connectWidgetUpdatesToSlot((QWidget*)sh->widget,SLOT(widgetsContentsChanged()));
} }
} }
} }
if(smartsave) if (smartsave) {
smartsave->resetIcons(); smartsave->resetIcons();
}
setDirty(true); setDirty(true);
} }
/** /**
@ -539,7 +533,7 @@ void ConfigTaskWidget::clearDirty()
*/ */
void ConfigTaskWidget::setDirty(bool value) void ConfigTaskWidget::setDirty(bool value)
{ {
dirty=value; dirty = value;
} }
/** /**
* Checks if the form is dirty (unsaved changes) * Checks if the form is dirty (unsaved changes)
@ -547,10 +541,11 @@ void ConfigTaskWidget::setDirty(bool value)
*/ */
bool ConfigTaskWidget::isDirty() bool ConfigTaskWidget::isDirty()
{ {
if(isConnected) if (isConnected) {
return dirty; return dirty;
else } else {
return false; return false;
}
} }
/** /**
* SLOT function used to disable widget contents changes when related object field changes * SLOT function used to disable widget contents changes when related object field changes
@ -558,9 +553,10 @@ bool ConfigTaskWidget::isDirty()
void ConfigTaskWidget::disableObjUpdates() void ConfigTaskWidget::disableObjUpdates()
{ {
allowWidgetUpdates = false; allowWidgetUpdates = false;
foreach(objectToWidget * obj,objOfInterest) foreach(objectToWidget * obj, objOfInterest) {
{ if (obj->object) {
if(obj->object)disconnect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*))); disconnect(obj->object, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshWidgetsValues(UAVObject *)));
}
} }
} }
/** /**
@ -569,10 +565,10 @@ void ConfigTaskWidget::disableObjUpdates()
void ConfigTaskWidget::enableObjUpdates() void ConfigTaskWidget::enableObjUpdates()
{ {
allowWidgetUpdates = true; allowWidgetUpdates = true;
foreach(objectToWidget * obj,objOfInterest) foreach(objectToWidget * obj, objOfInterest) {
{ if (obj->object) {
if(obj->object) connect(obj->object, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(refreshWidgetsValues(UAVObject *)), Qt::UniqueConnection);
connect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)), Qt::UniqueConnection); }
} }
} }
/** /**
@ -581,7 +577,7 @@ void ConfigTaskWidget::enableObjUpdates()
*/ */
void ConfigTaskWidget::objectUpdated(UAVObject *obj) void ConfigTaskWidget::objectUpdated(UAVObject *obj)
{ {
objectUpdates[obj]=true; objectUpdates[obj] = true;
} }
/** /**
* Checks if all objects added to the pool have already been updated * Checks if all objects added to the pool have already been updated
@ -589,13 +585,12 @@ void ConfigTaskWidget::objectUpdated(UAVObject *obj)
*/ */
bool ConfigTaskWidget::allObjectsUpdated() bool ConfigTaskWidget::allObjectsUpdated()
{ {
qDebug()<<"ConfigTaskWidge:allObjectsUpdated called"; qDebug() << "ConfigTaskWidge:allObjectsUpdated called";
bool ret=true; bool ret = true;
foreach(UAVObject *obj, objectUpdates.keys()) foreach(UAVObject * obj, objectUpdates.keys()) {
{ ret = ret & objectUpdates[obj];
ret=ret & objectUpdates[obj];
} }
qDebug()<<"Returned:"<<ret; qDebug() << "Returned:" << ret;
return ret; return ret;
} }
/** /**
@ -605,18 +600,16 @@ bool ConfigTaskWidget::allObjectsUpdated()
*/ */
void ConfigTaskWidget::addHelpButton(QPushButton *button, QString url) void ConfigTaskWidget::addHelpButton(QPushButton *button, QString url)
{ {
helpButtonList.insert(button,url); helpButtonList.insert(button, url);
connect(button,SIGNAL(clicked()),this,SLOT(helpButtonPressed())); connect(button, SIGNAL(clicked()), this, SLOT(helpButtonPressed()));
} }
/** /**
* Invalidates all the uav objects "is updated" flag * Invalidates all the uav objects "is updated" flag
*/ */
void ConfigTaskWidget::invalidateObjects() void ConfigTaskWidget::invalidateObjects()
{ {
foreach(UAVObject *obj, objectUpdates.keys()) foreach(UAVObject * obj, objectUpdates.keys()) {
{ objectUpdates[obj] = false;
objectUpdates[obj]=false;
} }
} }
/** /**
@ -624,16 +617,18 @@ void ConfigTaskWidget::invalidateObjects()
*/ */
void ConfigTaskWidget::apply() void ConfigTaskWidget::apply()
{ {
if(smartsave) if (smartsave) {
smartsave->apply(); smartsave->apply();
}
} }
/** /**
* SLOT call this to save changes to uav objects * SLOT call this to save changes to uav objects
*/ */
void ConfigTaskWidget::save() void ConfigTaskWidget::save()
{ {
if(smartsave) if (smartsave) {
smartsave->save(); smartsave->save();
}
} }
/** /**
* Adds a new shadow widget * Adds a new shadow widget
@ -641,50 +636,47 @@ void ConfigTaskWidget::save()
* This function doesn't have to be used directly, addUAVObjectToWidgetRelation will call it if a previous relation exhists. * This function doesn't have to be used directly, addUAVObjectToWidgetRelation will call it if a previous relation exhists.
* @return returns false if the shadow widget relation failed to be added (no previous relation exhisted) * @return returns false if the shadow widget relation failed to be added (no previous relation exhisted)
*/ */
bool ConfigTaskWidget::addShadowWidget(QString object, QString field, QWidget *widget, int index, double scale, bool isLimited,QList<int>* defaultReloadGroups,quint32 instID) bool ConfigTaskWidget::addShadowWidget(QString object, QString field, QWidget *widget, int index, double scale, bool isLimited,
QList<int> *defaultReloadGroups, quint32 instID)
{ {
foreach(objectToWidget * oTw,objOfInterest) foreach(objectToWidget * oTw, objOfInterest) {
{ if (!oTw->object || !oTw->widget || !oTw->field) {
if(!oTw->object || !oTw->widget || !oTw->field)
continue; continue;
if(oTw->object->getName()==object && oTw->field->getName()==field && oTw->index==index && oTw->object->getInstID()==instID) }
{ if (oTw->object->getName() == object && oTw->field->getName() == field && oTw->index == index && oTw->object->getInstID() == instID) {
shadow * sh=NULL; shadow *sh = NULL;
//prefer anything else to QLabel // prefer anything else to QLabel
if(qobject_cast<QLabel *>(oTw->widget) && !qobject_cast<QLabel *>(widget)) if (qobject_cast<QLabel *>(oTw->widget) && !qobject_cast<QLabel *>(widget)) {
{ sh = new shadow;
sh=new shadow; sh->isLimited = oTw->isLimited;
sh->isLimited=oTw->isLimited; sh->scale = oTw->scale;
sh->scale=oTw->scale; sh->widget = oTw->widget;
sh->widget=oTw->widget; oTw->isLimited = isLimited;
oTw->isLimited=isLimited; oTw->scale = scale;
oTw->scale=scale; oTw->widget = widget;
oTw->widget=widget;
} }
//prefer QDoubleSpinBox to anything else // prefer QDoubleSpinBox to anything else
else if(!qobject_cast<QDoubleSpinBox *>(oTw->widget) && qobject_cast<QDoubleSpinBox *>(widget)) else if (!qobject_cast<QDoubleSpinBox *>(oTw->widget) && qobject_cast<QDoubleSpinBox *>(widget)) {
{ sh = new shadow;
sh=new shadow; sh->isLimited = oTw->isLimited;
sh->isLimited=oTw->isLimited; sh->scale = oTw->scale;
sh->scale=oTw->scale; sh->widget = oTw->widget;
sh->widget=oTw->widget; oTw->isLimited = isLimited;
oTw->isLimited=isLimited; oTw->scale = scale;
oTw->scale=scale; oTw->widget = widget;
oTw->widget=widget; } else {
sh = new shadow;
sh->isLimited = isLimited;
sh->scale = scale;
sh->widget = widget;
} }
else shadowsList.insert(widget, oTw);
{
sh=new shadow;
sh->isLimited=isLimited;
sh->scale=scale;
sh->widget=widget;
}
shadowsList.insert(widget,oTw);
oTw->shadowsList.append(sh); oTw->shadowsList.append(sh);
connectWidgetUpdatesToSlot(widget,SLOT(widgetsContentsChanged())); connectWidgetUpdatesToSlot(widget, SLOT(widgetsContentsChanged()));
if(defaultReloadGroups) if (defaultReloadGroups) {
addWidgetToDefaultReloadGroups(widget,defaultReloadGroups); addWidgetToDefaultReloadGroups(widget, defaultReloadGroups);
loadWidgetLimits(widget,oTw->field,oTw->index,isLimited,scale); }
loadWidgetLimits(widget, oTw->field, oTw->index, isLimited, scale);
return true; return true;
} }
} }
@ -696,118 +688,115 @@ bool ConfigTaskWidget::addShadowWidget(QString object, QString field, QWidget *w
*/ */
void ConfigTaskWidget::autoLoadWidgets() void ConfigTaskWidget::autoLoadWidgets()
{ {
QPushButton * saveButtonWidget=NULL; QPushButton *saveButtonWidget = NULL;
QPushButton * applyButtonWidget=NULL; QPushButton *applyButtonWidget = NULL;
foreach(QWidget * widget,this->findChildren<QWidget*>())
{ foreach(QWidget * widget, this->findChildren<QWidget *>()) {
QVariant info=widget->property("objrelation"); QVariant info = widget->property("objrelation");
if(info.isValid())
{ if (info.isValid()) {
uiRelationAutomation uiRelation; uiRelationAutomation uiRelation;
uiRelation.buttonType=none; uiRelation.buttonType = none;
uiRelation.scale=1; uiRelation.scale = 1;
uiRelation.element=QString(); uiRelation.element = QString();
uiRelation.haslimits=false; uiRelation.haslimits = false;
foreach(QString str, info.toStringList()) foreach(QString str, info.toStringList()) {
{ QString prop = str.split(":").at(0);
QString prop=str.split(":").at(0); QString value = str.split(":").at(1);
QString value=str.split(":").at(1);
if(prop== "objname") if (prop == "objname") {
uiRelation.objname=value; uiRelation.objname = value;
else if(prop== "fieldname") } else if (prop == "fieldname") {
uiRelation.fieldname=value; uiRelation.fieldname = value;
else if(prop=="element") } else if (prop == "element") {
uiRelation.element=value; uiRelation.element = value;
else if(prop== "scale") } else if (prop == "scale") {
{ if (value == "null") {
if(value=="null") uiRelation.scale = 1;
uiRelation.scale=1; } else {
else uiRelation.scale = value.toDouble();
uiRelation.scale=value.toDouble(); }
} } else if (prop == "haslimits") {
else if(prop== "haslimits") if (value == "yes") {
{ uiRelation.haslimits = true;
if(value=="yes") } else {
uiRelation.haslimits=true; uiRelation.haslimits = false;
else }
uiRelation.haslimits=false; } else if (prop == "button") {
} if (value == "save") {
else if(prop== "button") uiRelation.buttonType = save_button;
{ } else if (value == "apply") {
if(value=="save") uiRelation.buttonType = apply_button;
uiRelation.buttonType=save_button; } else if (value == "reload") {
else if(value=="apply") uiRelation.buttonType = reload_button;
uiRelation.buttonType=apply_button; } else if (value == "default") {
else if(value=="reload") uiRelation.buttonType = default_button;
uiRelation.buttonType=reload_button; } else if (value == "help") {
else if(value=="default") uiRelation.buttonType = help_button;
uiRelation.buttonType=default_button; }
else if(value=="help") } else if (prop == "buttongroup") {
uiRelation.buttonType=help_button; foreach(QString s, value.split(",")) {
}
else if(prop== "buttongroup")
{
foreach(QString s,value.split(","))
{
uiRelation.buttonGroup.append(s.toInt()); uiRelation.buttonGroup.append(s.toInt());
} }
} else if (prop == "url") {
uiRelation.url = str.mid(str.indexOf(":") + 1);
} }
else if(prop=="url")
uiRelation.url=str.mid(str.indexOf(":")+1);
} }
if(!uiRelation.buttonType==none) if (!uiRelation.buttonType == none) {
{ QPushButton *button = NULL;
QPushButton * button=NULL; switch (uiRelation.buttonType) {
switch(uiRelation.buttonType)
{
case save_button: case save_button:
saveButtonWidget=qobject_cast<QPushButton *>(widget); saveButtonWidget = qobject_cast<QPushButton *>(widget);
if(saveButtonWidget) if (saveButtonWidget) {
addApplySaveButtons(NULL,saveButtonWidget); addApplySaveButtons(NULL, saveButtonWidget);
}
break; break;
case apply_button: case apply_button:
applyButtonWidget=qobject_cast<QPushButton *>(widget); applyButtonWidget = qobject_cast<QPushButton *>(widget);
if(applyButtonWidget) if (applyButtonWidget) {
addApplySaveButtons(applyButtonWidget,NULL); addApplySaveButtons(applyButtonWidget, NULL);
}
break; break;
case default_button: case default_button:
button=qobject_cast<QPushButton *>(widget); button = qobject_cast<QPushButton *>(widget);
if(button) if (button) {
addDefaultButton(button,uiRelation.buttonGroup.at(0)); addDefaultButton(button, uiRelation.buttonGroup.at(0));
}
break; break;
case reload_button: case reload_button:
button=qobject_cast<QPushButton *>(widget); button = qobject_cast<QPushButton *>(widget);
if(button) if (button) {
addReloadButton(button,uiRelation.buttonGroup.at(0)); addReloadButton(button, uiRelation.buttonGroup.at(0));
}
break; break;
case help_button: case help_button:
button=qobject_cast<QPushButton *>(widget); button = qobject_cast<QPushButton *>(widget);
if(button) if (button) {
addHelpButton(button,uiRelation.url); addHelpButton(button, uiRelation.url);
}
break; break;
default: default:
break; break;
} }
} } else {
else QWidget *wid = qobject_cast<QWidget *>(widget);
{ if (wid) {
QWidget * wid=qobject_cast<QWidget *>(widget); addUAVObjectToWidgetRelation(uiRelation.objname, uiRelation.fieldname, wid, uiRelation.element, uiRelation.scale, uiRelation.haslimits, &uiRelation.buttonGroup);
if(wid) }
addUAVObjectToWidgetRelation(uiRelation.objname,uiRelation.fieldname,wid,uiRelation.element,uiRelation.scale,uiRelation.haslimits,&uiRelation.buttonGroup);
} }
} }
} }
refreshWidgetsValues(); refreshWidgetsValues();
forceShadowUpdates(); forceShadowUpdates();
foreach(objectToWidget * ow,objOfInterest) foreach(objectToWidget * ow, objOfInterest) {
{ if (ow->widget) {
if(ow->widget) qDebug() << "Master:" << ow->widget->objectName();
qDebug()<<"Master:"<<ow->widget->objectName(); }
foreach(shadow * sh,ow->shadowsList) foreach(shadow * sh, ow->shadowsList) {
{ if (sh->widget) {
if(sh->widget) qDebug() << "Child" << sh->widget->objectName();
qDebug()<<"Child"<<sh->widget->objectName(); }
} }
} }
} }
@ -817,32 +806,26 @@ void ConfigTaskWidget::autoLoadWidgets()
* @param widget pointer to the widget to be added to the groups * @param widget pointer to the widget to be added to the groups
* @param groups list of the groups on which to add the widget * @param groups list of the groups on which to add the widget
*/ */
void ConfigTaskWidget::addWidgetToDefaultReloadGroups(QWidget *widget, QList<int> * groups) void ConfigTaskWidget::addWidgetToDefaultReloadGroups(QWidget *widget, QList<int> *groups)
{ {
foreach(objectToWidget * oTw,objOfInterest) foreach(objectToWidget * oTw, objOfInterest) {
{ bool addOTW = false;
bool addOTW=false;
if(oTw->widget==widget) if (oTw->widget == widget) {
addOTW=true; addOTW = true;
else } else {
{ foreach(shadow * sh, oTw->shadowsList) {
foreach(shadow * sh, oTw->shadowsList) if (sh->widget == widget) {
{ addOTW = true;
if(sh->widget==widget) }
addOTW=true;
} }
} }
if(addOTW) if (addOTW) {
{ foreach(int i, *groups) {
foreach(int i,*groups) if (defaultReloadGroups.contains(i)) {
{
if(defaultReloadGroups.contains(i))
{
defaultReloadGroups.value(i)->append(oTw); defaultReloadGroups.value(i)->append(oTw);
} } else {
else defaultReloadGroups.insert(i, new QList<objectToWidget *>());
{
defaultReloadGroups.insert(i,new QList<objectToWidget*>());
defaultReloadGroups.value(i)->append(oTw); defaultReloadGroups.value(i)->append(oTw);
} }
} }
@ -856,8 +839,8 @@ void ConfigTaskWidget::addWidgetToDefaultReloadGroups(QWidget *widget, QList<int
*/ */
void ConfigTaskWidget::addDefaultButton(QPushButton *button, int buttonGroup) void ConfigTaskWidget::addDefaultButton(QPushButton *button, int buttonGroup)
{ {
button->setProperty("group",buttonGroup); button->setProperty("group", buttonGroup);
connect(button,SIGNAL(clicked()),this,SLOT(defaultButtonClicked())); connect(button, SIGNAL(clicked()), this, SLOT(defaultButtonClicked()));
} }
/** /**
* Adds a button to a reload group * Adds a button to a reload group
@ -866,24 +849,25 @@ void ConfigTaskWidget::addDefaultButton(QPushButton *button, int buttonGroup)
*/ */
void ConfigTaskWidget::addReloadButton(QPushButton *button, int buttonGroup) void ConfigTaskWidget::addReloadButton(QPushButton *button, int buttonGroup)
{ {
button->setProperty("group",buttonGroup); button->setProperty("group", buttonGroup);
reloadButtonList.append(button); reloadButtonList.append(button);
connect(button,SIGNAL(clicked()),this,SLOT(reloadButtonClicked())); connect(button, SIGNAL(clicked()), this, SLOT(reloadButtonClicked()));
} }
/** /**
* Called when a default button is clicked * Called when a default button is clicked
*/ */
void ConfigTaskWidget::defaultButtonClicked() void ConfigTaskWidget::defaultButtonClicked()
{ {
int group=sender()->property("group").toInt(); int group = sender()->property("group").toInt();
emit defaultRequested(group); emit defaultRequested(group);
QList<objectToWidget*> * list=defaultReloadGroups.value(group);
foreach(objectToWidget * oTw,*list) QList<objectToWidget *> *list = defaultReloadGroups.value(group);
{ foreach(objectToWidget * oTw, *list) {
if(!oTw->object || !oTw->field) if (!oTw->object || !oTw->field) {
continue; continue;
UAVDataObject * temp=((UAVDataObject*)oTw->object)->dirtyClone(); }
setWidgetFromField(oTw->widget,temp->getField(oTw->field->getName()),oTw->index,oTw->scale,oTw->isLimited); UAVDataObject *temp = ((UAVDataObject *)oTw->object)->dirtyClone();
setWidgetFromField(oTw->widget, temp->getField(oTw->field->getName()), oTw->index, oTw->scale, oTw->isLimited);
} }
} }
/** /**
@ -891,145 +875,114 @@ void ConfigTaskWidget::defaultButtonClicked()
*/ */
void ConfigTaskWidget::reloadButtonClicked() void ConfigTaskWidget::reloadButtonClicked()
{ {
if(timeOut) if (timeOut) {
return; return;
int group=sender()->property("group").toInt(); }
QList<objectToWidget*> * list=defaultReloadGroups.value(group,NULL); int group = sender()->property("group").toInt();
if(!list) QList<objectToWidget *> *list = defaultReloadGroups.value(group, NULL);
if (!list) {
return; return;
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) ); }
timeOut=new QTimer(this); ObjectPersistence *objper = dynamic_cast<ObjectPersistence *>(getObjectManager()->getObject(ObjectPersistence::NAME));
QEventLoop * eventLoop=new QEventLoop(this); timeOut = new QTimer(this);
connect(timeOut, SIGNAL(timeout()),eventLoop,SLOT(quit())); QEventLoop *eventLoop = new QEventLoop(this);
connect(objper, SIGNAL(objectUpdated(UAVObject*)), eventLoop, SLOT(quit())); connect(timeOut, SIGNAL(timeout()), eventLoop, SLOT(quit()));
connect(objper, SIGNAL(objectUpdated(UAVObject *)), eventLoop, SLOT(quit()));
QList<temphelper> temp; QList<temphelper> temp;
foreach(objectToWidget * oTw,*list) foreach(objectToWidget * oTw, *list) {
{ if (oTw->object != NULL) {
if (oTw->object != NULL)
{
temphelper value; temphelper value;
value.objid=oTw->object->getObjID(); value.objid = oTw->object->getObjID();
value.objinstid=oTw->object->getInstID(); value.objinstid = oTw->object->getInstID();
if(temp.contains(value)) if (temp.contains(value)) {
continue; continue;
else } else {
temp.append(value); temp.append(value);
}
ObjectPersistence::DataFields data; ObjectPersistence::DataFields data;
data.Operation = ObjectPersistence::OPERATION_LOAD; data.Operation = ObjectPersistence::OPERATION_LOAD;
data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT;
data.ObjectID = oTw->object->getObjID(); data.ObjectID = oTw->object->getObjID();
data.InstanceID = oTw->object->getInstID(); data.InstanceID = oTw->object->getInstID();
objper->setData(data); objper->setData(data);
objper->updated(); objper->updated();
timeOut->start(500); timeOut->start(500);
eventLoop->exec(); eventLoop->exec();
if(timeOut->isActive()) if (timeOut->isActive()) {
{
oTw->object->requestUpdate(); oTw->object->requestUpdate();
if(oTw->widget) if (oTw->widget) {
setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited); setWidgetFromField(oTw->widget, oTw->field, oTw->index, oTw->scale, oTw->isLimited);
}
} }
timeOut->stop(); timeOut->stop();
} }
} }
if(eventLoop) if (eventLoop) {
{
delete eventLoop; delete eventLoop;
eventLoop=NULL; eventLoop = NULL;
} }
if(timeOut) if (timeOut) {
{
delete timeOut; delete timeOut;
timeOut=NULL; timeOut = NULL;
} }
} }
/** /**
* Connects widgets "contents changed" signals to a slot * Connects widgets "contents changed" signals to a slot
*/ */
void ConfigTaskWidget::connectWidgetUpdatesToSlot(QWidget * widget,const char* function) void ConfigTaskWidget::connectWidgetUpdatesToSlot(QWidget *widget, const char *function)
{ {
if(!widget) if (!widget) {
return; return;
if(QComboBox * cb=qobject_cast<QComboBox *>(widget))
{
connect(cb,SIGNAL(currentIndexChanged(int)),this,function);
} }
else if(QSlider * cb=qobject_cast<QSlider *>(widget)) if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
{ connect(cb, SIGNAL(currentIndexChanged(int)), this, function);
connect(cb,SIGNAL(valueChanged(int)),this,function); } else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
connect(cb, SIGNAL(valueChanged(int)), this, function);
} else if (MixerCurveWidget * cb = qobject_cast<MixerCurveWidget *>(widget)) {
connect(cb, SIGNAL(curveUpdated()), this, function);
} else if (QTableWidget * cb = qobject_cast<QTableWidget *>(widget)) {
connect(cb, SIGNAL(cellChanged(int, int)), this, function);
} else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
connect(cb, SIGNAL(valueChanged(int)), this, function);
} else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
connect(cb, SIGNAL(valueChanged(double)), this, function);
} else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
connect(cb, SIGNAL(stateChanged(int)), this, function);
} else if (QPushButton * cb = qobject_cast<QPushButton *>(widget)) {
connect(cb, SIGNAL(clicked()), this, function);
} else {
qDebug() << __FUNCTION__ << "widget to uavobject relation not implemented" << widget->metaObject()->className();
} }
else if(MixerCurveWidget * cb=qobject_cast<MixerCurveWidget *>(widget))
{
connect(cb,SIGNAL(curveUpdated()),this,function);
}
else if(QTableWidget * cb=qobject_cast<QTableWidget *>(widget))
{
connect(cb,SIGNAL(cellChanged(int,int)),this,function);
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget))
{
connect(cb,SIGNAL(valueChanged(int)),this,function);
}
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget))
{
connect(cb,SIGNAL(valueChanged(double)),this,function);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget))
{
connect(cb,SIGNAL(stateChanged(int)),this,function);
}
else if(QPushButton * cb=qobject_cast<QPushButton *>(widget))
{
connect(cb,SIGNAL(clicked()),this,function);
}
else
qDebug()<<__FUNCTION__<<"widget to uavobject relation not implemented"<<widget->metaObject()->className();
} }
/** /**
* Disconnects widgets "contents changed" signals to a slot * Disconnects widgets "contents changed" signals to a slot
*/ */
void ConfigTaskWidget::disconnectWidgetUpdatesToSlot(QWidget * widget,const char* function) void ConfigTaskWidget::disconnectWidgetUpdatesToSlot(QWidget *widget, const char *function)
{ {
if(!widget) if (!widget) {
return; return;
if(QComboBox * cb=qobject_cast<QComboBox *>(widget))
{
disconnect(cb,SIGNAL(currentIndexChanged(int)),this,function);
} }
else if(QSlider * cb=qobject_cast<QSlider *>(widget)) if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
{ disconnect(cb, SIGNAL(currentIndexChanged(int)), this, function);
disconnect(cb,SIGNAL(valueChanged(int)),this,function); } else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
disconnect(cb, SIGNAL(valueChanged(int)), this, function);
} else if (MixerCurveWidget * cb = qobject_cast<MixerCurveWidget *>(widget)) {
disconnect(cb, SIGNAL(curveUpdated()), this, function);
} else if (QTableWidget * cb = qobject_cast<QTableWidget *>(widget)) {
disconnect(cb, SIGNAL(cellChanged(int, int)), this, function);
} else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
disconnect(cb, SIGNAL(valueChanged(int)), this, function);
} else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
disconnect(cb, SIGNAL(valueChanged(double)), this, function);
} else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
disconnect(cb, SIGNAL(stateChanged(int)), this, function);
} else if (QPushButton * cb = qobject_cast<QPushButton *>(widget)) {
disconnect(cb, SIGNAL(clicked()), this, function);
} else {
qDebug() << __FUNCTION__ << "widget to uavobject relation not implemented" << widget->metaObject()->className();
} }
else if(MixerCurveWidget * cb=qobject_cast<MixerCurveWidget *>(widget))
{
disconnect(cb,SIGNAL(curveUpdated()),this,function);
}
else if(QTableWidget * cb=qobject_cast<QTableWidget *>(widget))
{
disconnect(cb,SIGNAL(cellChanged(int,int)),this,function);
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget))
{
disconnect(cb,SIGNAL(valueChanged(int)),this,function);
}
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget))
{
disconnect(cb,SIGNAL(valueChanged(double)),this,function);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget))
{
disconnect(cb,SIGNAL(stateChanged(int)),this,function);
}
else if(QPushButton * cb=qobject_cast<QPushButton *>(widget))
{
disconnect(cb,SIGNAL(clicked()),this,function);
}
else
qDebug()<<__FUNCTION__<<"widget to uavobject relation not implemented"<<widget->metaObject()->className();
} }
/** /**
* Sets a widget value from an UAVObject field * Sets a widget value from an UAVObject field
@ -1039,18 +992,18 @@ void ConfigTaskWidget::disconnectWidgetUpdatesToSlot(QWidget * widget,const char
* @param scale scale to be used on the assignement * @param scale scale to be used on the assignement
* @return returns true if the assignement was successfull * @return returns true if the assignement was successfull
*/ */
bool ConfigTaskWidget::setFieldFromWidget(QWidget * widget,UAVObjectField * field,int index,double scale) bool ConfigTaskWidget::setFieldFromWidget(QWidget *widget, UAVObjectField *field, int index, double scale)
{ {
if(!widget || !field) if (!widget || !field) {
return false; return false;
}
QVariant ret = getVariantFromWidget(widget, scale, field->getUnits()); QVariant ret = getVariantFromWidget(widget, scale, field->getUnits());
if(ret.isValid()) if (ret.isValid()) {
{ field->setValue(ret, index);
field->setValue(ret,index);
return true; return true;
} }
{ {
qDebug()<<__FUNCTION__<<"widget to uavobject relation not implemented"<<widget->metaObject()->className(); qDebug() << __FUNCTION__ << "widget to uavobject relation not implemented" << widget->metaObject()->className();
return false; return false;
} }
} }
@ -1062,38 +1015,27 @@ bool ConfigTaskWidget::setFieldFromWidget(QWidget * widget,UAVObjectField * fiel
*/ */
QVariant ConfigTaskWidget::getVariantFromWidget(QWidget *widget, double scale, QString units) QVariant ConfigTaskWidget::getVariantFromWidget(QWidget *widget, double scale, QString units)
{ {
if(QComboBox * cb=qobject_cast<QComboBox *>(widget)) if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
{
return (QString)cb->currentText(); return (QString)cb->currentText();
} } else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget)) return (double)(cb->value() * scale);
{ } else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
return (double)(cb->value()* scale); return (double)(cb->value() * scale);
} } else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget)) return (double)(cb->value() * scale);
{ } else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
return (double)(cb->value()* scale); return (QString)(cb->isChecked() ? "TRUE" : "FALSE");
} } else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
else if(QSlider * cb=qobject_cast<QSlider *>(widget))
{
return(double)(cb->value()* scale);
}
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget))
{
return (QString)(cb->isChecked()?"TRUE":"FALSE");
}
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget))
{
QString value = (QString)cb->displayText(); QString value = (QString)cb->displayText();
if(units == "hex") { if (units == "hex") {
bool ok; bool ok;
return value.toUInt(&ok, 16); return value.toUInt(&ok, 16);
} else { } else {
return value; return value;
} }
} } else {
else
return QVariant(); return QVariant();
}
} }
/** /**
* Sets a widget from a variant * Sets a widget from a variant
@ -1105,55 +1047,43 @@ QVariant ConfigTaskWidget::getVariantFromWidget(QWidget *widget, double scale, Q
*/ */
bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, double scale, QString units) bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, double scale, QString units)
{ {
if(QComboBox * cb=qobject_cast<QComboBox *>(widget)) if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
{
cb->setCurrentIndex(cb->findText(value.toString())); cb->setCurrentIndex(cb->findText(value.toString()));
return true; return true;
} } else if (QLabel * cb = qobject_cast<QLabel *>(widget)) {
else if(QLabel * cb=qobject_cast<QLabel *>(widget)) if (scale == 0) {
{
if(scale==0)
cb->setText(value.toString()); cb->setText(value.toString());
else } else {
cb->setText(QString::number((value.toDouble()/scale))); cb->setText(QString::number((value.toDouble() / scale)));
}
return true; return true;
} } else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget)) cb->setValue((double)(value.toDouble() / scale));
{
cb->setValue((double)(value.toDouble()/scale));
return true; return true;
} } else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget)) cb->setValue((int)qRound(value.toDouble() / scale));
{
cb->setValue((int)qRound(value.toDouble()/scale));
return true; return true;
} } else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
else if(QSlider * cb=qobject_cast<QSlider *>(widget)) cb->setValue((int)qRound(value.toDouble() / scale));
{
cb->setValue((int)qRound(value.toDouble()/scale));
return true; return true;
} } else if (QCheckBox * cb = qobject_cast<QCheckBox *>(widget)) {
else if(QCheckBox * cb=qobject_cast<QCheckBox *>(widget)) bool bvalue = value.toString() == "TRUE";
{
bool bvalue=value.toString()=="TRUE";
cb->setChecked(bvalue); cb->setChecked(bvalue);
return true; return true;
} } else if (QLineEdit * cb = qobject_cast<QLineEdit *>(widget)) {
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget)) if ((scale == 0) || (scale == 1)) {
{ if (units == "hex") {
if ((scale== 0) || (scale == 1)) {
if(units == "hex") {
cb->setText(QString::number(value.toUInt(), 16).toUpper()); cb->setText(QString::number(value.toUInt(), 16).toUpper());
} else { } else {
cb->setText(value.toString()); cb->setText(value.toString());
} }
} else { } else {
cb->setText(QString::number((value.toDouble()/scale))); cb->setText(QString::number((value.toDouble() / scale)));
} }
return true; return true;
} } else {
else
return false; return false;
}
} }
/** /**
@ -1177,185 +1107,154 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
* @param hasLimits set to true if you want to limit the values (check wiki) * @param hasLimits set to true if you want to limit the values (check wiki)
* @return returns true if the assignement was successfull * @return returns true if the assignement was successfull
*/ */
bool ConfigTaskWidget::setWidgetFromField(QWidget * widget,UAVObjectField * field,int index,double scale,bool hasLimits) bool ConfigTaskWidget::setWidgetFromField(QWidget *widget, UAVObjectField *field, int index, double scale, bool hasLimits)
{ {
if(!widget || !field) if (!widget || !field) {
return false; return false;
if(QComboBox * cb=qobject_cast<QComboBox *>(widget))
{
if(cb->count()==0)
loadWidgetLimits(cb,field,index,hasLimits,scale);
} }
QVariant var=field->getValue(index); if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
checkWidgetsLimits(widget,field,index,hasLimits,var,scale); if (cb->count() == 0) {
bool ret = setWidgetFromVariant(widget, var, scale, field->getUnits()); loadWidgetLimits(cb, field, index, hasLimits, scale);
if(ret) }
}
QVariant var = field->getValue(index);
checkWidgetsLimits(widget, field, index, hasLimits, var, scale);
bool ret = setWidgetFromVariant(widget, var, scale, field->getUnits());
if (ret) {
return true; return true;
else } else {
{ qDebug() << __FUNCTION__ << "widget to uavobject relation not implemented" << widget->metaObject()->className();
qDebug()<<__FUNCTION__<<"widget to uavobject relation not implemented"<<widget->metaObject()->className();
return false; return false;
} }
} }
void ConfigTaskWidget::checkWidgetsLimits(QWidget * widget,UAVObjectField * field,int index,bool hasLimits, QVariant value, double scale) void ConfigTaskWidget::checkWidgetsLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, QVariant value, double scale)
{ {
if(!hasLimits) if (!hasLimits) {
return; return;
if(!field->isWithinLimits(value,index,currentBoard))
{
if(!widget->property("styleBackup").isValid())
widget->setProperty("styleBackup",widget->styleSheet());
widget->setStyleSheet(outOfLimitsStyle);
widget->setProperty("wasOverLimits",(bool)true);
if(QComboBox * cb=qobject_cast<QComboBox *>(widget))
{
if(cb->findText(value.toString())==-1)
cb->addItem(value.toString());
}
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget))
{
if((double)(value.toDouble()/scale)>cb->maximum())
{
cb->setMaximum((double)(value.toDouble()/scale));
}
else if((double)(value.toDouble()/scale)<cb->minimum())
{
cb->setMinimum((double)(value.toDouble()/scale));
}
}
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget))
{
if((int)qRound(value.toDouble()/scale)>cb->maximum())
{
cb->setMaximum((int)qRound(value.toDouble()/scale));
}
else if((int)qRound(value.toDouble()/scale)<cb->minimum())
{
cb->setMinimum((int)qRound(value.toDouble()/scale));
}
}
else if(QSlider * cb=qobject_cast<QSlider *>(widget))
{
if((int)qRound(value.toDouble()/scale)>cb->maximum())
{
cb->setMaximum((int)qRound(value.toDouble()/scale));
}
else if((int)qRound(value.toDouble()/scale)<cb->minimum())
{
cb->setMinimum((int)qRound(value.toDouble()/scale));
}
}
} }
else if(widget->property("wasOverLimits").isValid()) if (!field->isWithinLimits(value, index, currentBoard)) {
{ if (!widget->property("styleBackup").isValid()) {
if(widget->property("wasOverLimits").toBool()) widget->setProperty("styleBackup", widget->styleSheet());
{ }
widget->setProperty("wasOverLimits",(bool)false); widget->setStyleSheet(outOfLimitsStyle);
if(widget->property("styleBackup").isValid()) widget->setProperty("wasOverLimits", (bool)true);
{ if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
QString style=widget->property("styleBackup").toString(); if (cb->findText(value.toString()) == -1) {
cb->addItem(value.toString());
}
} else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
if ((double)(value.toDouble() / scale) > cb->maximum()) {
cb->setMaximum((double)(value.toDouble() / scale));
} else if ((double)(value.toDouble() / scale) < cb->minimum()) {
cb->setMinimum((double)(value.toDouble() / scale));
}
} else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
if ((int)qRound(value.toDouble() / scale) > cb->maximum()) {
cb->setMaximum((int)qRound(value.toDouble() / scale));
} else if ((int)qRound(value.toDouble() / scale) < cb->minimum()) {
cb->setMinimum((int)qRound(value.toDouble() / scale));
}
} else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
if ((int)qRound(value.toDouble() / scale) > cb->maximum()) {
cb->setMaximum((int)qRound(value.toDouble() / scale));
} else if ((int)qRound(value.toDouble() / scale) < cb->minimum()) {
cb->setMinimum((int)qRound(value.toDouble() / scale));
}
}
} else if (widget->property("wasOverLimits").isValid()) {
if (widget->property("wasOverLimits").toBool()) {
widget->setProperty("wasOverLimits", (bool)false);
if (widget->property("styleBackup").isValid()) {
QString style = widget->property("styleBackup").toString();
widget->setStyleSheet(style); widget->setStyleSheet(style);
} }
loadWidgetLimits(widget,field,index,hasLimits,scale); loadWidgetLimits(widget, field, index, hasLimits, scale);
} }
} }
} }
void ConfigTaskWidget::loadWidgetLimits(QWidget * widget,UAVObjectField * field,int index,bool hasLimits,double scale) void ConfigTaskWidget::loadWidgetLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, double scale)
{ {
if(!widget || !field) if (!widget || !field) {
return; return;
if(QComboBox * cb=qobject_cast<QComboBox *>(widget)) }
{ if (QComboBox * cb = qobject_cast<QComboBox *>(widget)) {
cb->clear(); cb->clear();
QStringList option=field->getOptions(); QStringList option = field->getOptions();
if(hasLimits) if (hasLimits) {
{ foreach(QString str, option) {
foreach(QString str,option) if (field->isWithinLimits(str, index, currentBoard)) {
{
if(field->isWithinLimits(str,index,currentBoard))
cb->addItem(str); cb->addItem(str);
}
} }
} } else {
else
cb->addItems(option); cb->addItems(option);
}
} }
if(!hasLimits) if (!hasLimits) {
return; return;
else if(QDoubleSpinBox * cb=qobject_cast<QDoubleSpinBox *>(widget)) } else if (QDoubleSpinBox * cb = qobject_cast<QDoubleSpinBox *>(widget)) {
{ if (field->getMaxLimit(index).isValid()) {
if(field->getMaxLimit(index).isValid()) cb->setMaximum((double)(field->getMaxLimit(index, currentBoard).toDouble() / scale));
{
cb->setMaximum((double)(field->getMaxLimit(index,currentBoard).toDouble()/scale));
} }
if(field->getMinLimit(index,currentBoard).isValid()) if (field->getMinLimit(index, currentBoard).isValid()) {
{ cb->setMinimum((double)(field->getMinLimit(index, currentBoard).toDouble() / scale));
cb->setMinimum((double)(field->getMinLimit(index,currentBoard).toDouble()/scale));
} }
} } else if (QSpinBox * cb = qobject_cast<QSpinBox *>(widget)) {
else if(QSpinBox * cb=qobject_cast<QSpinBox *>(widget)) if (field->getMaxLimit(index, currentBoard).isValid()) {
{ cb->setMaximum((int)qRound(field->getMaxLimit(index, currentBoard).toDouble() / scale));
if(field->getMaxLimit(index,currentBoard).isValid())
{
cb->setMaximum((int)qRound(field->getMaxLimit(index,currentBoard).toDouble()/scale));
} }
if(field->getMinLimit(index,currentBoard).isValid()) if (field->getMinLimit(index, currentBoard).isValid()) {
{ cb->setMinimum((int)qRound(field->getMinLimit(index, currentBoard).toDouble() / scale));
cb->setMinimum((int)qRound(field->getMinLimit(index,currentBoard).toDouble()/scale));
} }
} } else if (QSlider * cb = qobject_cast<QSlider *>(widget)) {
else if(QSlider * cb=qobject_cast<QSlider *>(widget)) if (field->getMaxLimit(index, currentBoard).isValid()) {
{ cb->setMaximum((int)qRound(field->getMaxLimit(index, currentBoard).toDouble() / scale));
if(field->getMaxLimit(index,currentBoard).isValid())
{
cb->setMaximum((int)qRound(field->getMaxLimit(index,currentBoard).toDouble()/scale));
} }
if(field->getMinLimit(index,currentBoard).isValid()) if (field->getMinLimit(index, currentBoard).isValid()) {
{ cb->setMinimum((int)(field->getMinLimit(index, currentBoard).toDouble() / scale));
cb->setMinimum((int)(field->getMinLimit(index,currentBoard).toDouble()/scale));
} }
} }
} }
void ConfigTaskWidget::updateEnableControls() void ConfigTaskWidget::updateEnableControls()
{ {
TelemetryManager* telMngr = pm->getObject<TelemetryManager>(); TelemetryManager *telMngr = pm->getObject<TelemetryManager>();
Q_ASSERT(telMngr); Q_ASSERT(telMngr);
enableControls(telMngr->isConnected()); enableControls(telMngr->isConnected());
} }
void ConfigTaskWidget::disableMouseWheelEvents() void ConfigTaskWidget::disableMouseWheelEvents()
{ {
//Disable mouse wheel events // Disable mouse wheel events
foreach( QSpinBox * sp, findChildren<QSpinBox*>() ) { foreach(QSpinBox * sp, findChildren<QSpinBox *>()) {
sp->installEventFilter( this ); sp->installEventFilter(this);
} }
foreach( QDoubleSpinBox * sp, findChildren<QDoubleSpinBox*>() ) { foreach(QDoubleSpinBox * sp, findChildren<QDoubleSpinBox *>()) {
sp->installEventFilter( this ); sp->installEventFilter(this);
} }
foreach( QSlider * sp, findChildren<QSlider*>() ) { foreach(QSlider * sp, findChildren<QSlider *>()) {
sp->installEventFilter( this ); sp->installEventFilter(this);
} }
foreach( QComboBox * sp, findChildren<QComboBox*>() ) { foreach(QComboBox * sp, findChildren<QComboBox *>()) {
sp->installEventFilter( this ); sp->installEventFilter(this);
} }
} }
bool ConfigTaskWidget::eventFilter( QObject * obj, QEvent * evt ) { bool ConfigTaskWidget::eventFilter(QObject *obj, QEvent *evt)
//Filter all wheel events, and ignore them {
if ( evt->type() == QEvent::Wheel && // Filter all wheel events, and ignore them
(qobject_cast<QAbstractSpinBox*>( obj ) || if (evt->type() == QEvent::Wheel &&
qobject_cast<QComboBox*>( obj ) || (qobject_cast<QAbstractSpinBox *>(obj) ||
qobject_cast<QAbstractSlider*>( obj ) )) qobject_cast<QComboBox *>(obj) ||
{ qobject_cast<QAbstractSlider *>(obj))) {
evt->ignore(); evt->ignore();
return true; return true;
} }
return QWidget::eventFilter( obj, evt ); return QWidget::eventFilter(obj, evt);
} }
/** /**
@} @}
@} @}
*/ */

View File

@ -48,53 +48,49 @@
#include <QUrl> #include <QUrl>
#include <QEvent> #include <QEvent>
class UAVOBJECTWIDGETUTILS_EXPORT ConfigTaskWidget: public QWidget class UAVOBJECTWIDGETUTILS_EXPORT ConfigTaskWidget : public QWidget {
{
Q_OBJECT Q_OBJECT
public: public:
struct shadow struct shadow {
{ QWidget *widget;
QWidget * widget; double scale;
double scale; bool isLimited;
bool isLimited;
}; };
struct objectToWidget struct objectToWidget {
{ UAVObject *object;
UAVObject * object; UAVObjectField *field;
UAVObjectField * field; QWidget *widget;
QWidget * widget;
int index; int index;
double scale; double scale;
bool isLimited; bool isLimited;
QList<shadow *> shadowsList; QList<shadow *> shadowsList;
QString getUnits() const { QString getUnits() const
{
if (field) { if (field) {
return field->getUnits(); return field->getUnits();
} }
return QString(""); return QString("");
} }
}; };
struct temphelper struct temphelper {
{
quint32 objid; quint32 objid;
quint32 objinstid; quint32 objinstid;
bool operator==(const temphelper& lhs) bool operator==(const temphelper & lhs)
{ {
return (lhs.objid==this->objid && lhs.objinstid==this->objinstid); return lhs.objid == this->objid && lhs.objinstid == this->objinstid;
} }
}; };
enum buttonTypeEnum {none,save_button,apply_button,reload_button,default_button,help_button}; enum buttonTypeEnum { none, save_button, apply_button, reload_button, default_button, help_button };
struct uiRelationAutomation struct uiRelationAutomation {
{ QString objname;
QString objname; QString fieldname;
QString fieldname; QString element;
QString element; QString url;
QString url;
buttonTypeEnum buttonType; buttonTypeEnum buttonType;
QList<int> buttonGroup; QList<int> buttonGroup;
double scale; double scale;
bool haslimits; bool haslimits;
}; };
@ -103,37 +99,37 @@ public:
virtual ~ConfigTaskWidget(); virtual ~ConfigTaskWidget();
void disableMouseWheelEvents(); void disableMouseWheelEvents();
bool eventFilter( QObject * obj, QEvent * evt ); bool eventFilter(QObject *obj, QEvent *evt);
void saveObjectToSD(UAVObject *obj); void saveObjectToSD(UAVObject *obj);
UAVObjectManager* getObjectManager(); UAVObjectManager *getObjectManager();
static double listMean(QList<double> list); static double listMean(QList<double> list);
static double listVar(QList<double> list); static double listVar(QList<double> list);
void addUAVObject(QString objectName, QList<int> *reloadGroups=NULL); void addUAVObject(QString objectName, QList<int> *reloadGroups = NULL);
void addUAVObject(UAVObject * objectName, QList<int> *reloadGroups=NULL); void addUAVObject(UAVObject *objectName, QList<int> *reloadGroups = NULL);
void addWidget(QWidget * widget); void addWidget(QWidget *widget);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,int index=0,double scale=1,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0); void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, int index = 0, double scale = 1, bool isLimited = false, QList<int> *defaultReloadGroups = 0, quint32 instID = 0);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, int index=0, double scale=1, bool isLimited=false, QList<int> *defaultReloadGroups=0, quint32 instID=0); void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, int index = 0, double scale = 1, bool isLimited = false, QList<int> *defaultReloadGroups = 0, quint32 instID = 0);
void addUAVObjectToWidgetRelation(QString object,QString field,QWidget * widget,QString element,double scale,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0); void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString element, double scale, bool isLimited = false, QList<int> *defaultReloadGroups = 0, quint32 instID = 0);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field,QWidget * widget,QString element,double scale,bool isLimited=false,QList<int>* defaultReloadGroups=0,quint32 instID=0); void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString element, double scale, bool isLimited = false, QList<int> *defaultReloadGroups = 0, quint32 instID = 0);
void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index); void addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString index);
void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, QString index); void addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField *field, QWidget *widget, QString index);
//BUTTONS// // BUTTONS//
void addApplySaveButtons(QPushButton * update,QPushButton * save); void addApplySaveButtons(QPushButton *update, QPushButton *save);
void addReloadButton(QPushButton * button,int buttonGroup); void addReloadButton(QPushButton *button, int buttonGroup);
void addDefaultButton(QPushButton * button,int buttonGroup); void addDefaultButton(QPushButton *button, int buttonGroup);
////////// //////////
void addWidgetToDefaultReloadGroups(QWidget * widget, QList<int> *groups); void addWidgetToDefaultReloadGroups(QWidget *widget, QList<int> *groups);
bool addShadowWidget(QWidget * masterWidget, QWidget * shadowWidget,double shadowScale=1,bool shadowIsLimited=false); bool addShadowWidget(QWidget *masterWidget, QWidget *shadowWidget, double shadowScale = 1, bool shadowIsLimited = false);
bool addShadowWidget(QString object,QString field,QWidget * widget,int index=0,double scale=1,bool isLimited=false, QList<int> *defaultReloadGroups=NULL, quint32 instID=0); bool addShadowWidget(QString object, QString field, QWidget *widget, int index = 0, double scale = 1, bool isLimited = false, QList<int> *defaultReloadGroups = NULL, quint32 instID = 0);
void autoLoadWidgets(); void autoLoadWidgets();
@ -141,8 +137,11 @@ public:
void setDirty(bool value); void setDirty(bool value);
bool allObjectsUpdated(); bool allObjectsUpdated();
void setOutOfLimitsStyle(QString style){outOfLimitsStyle=style;} void setOutOfLimitsStyle(QString style)
void addHelpButton(QPushButton * button,QString url); {
outOfLimitsStyle = style;
}
void addHelpButton(QPushButton *button, QString url);
void forceShadowUpdates(); void forceShadowUpdates();
void forceConnectedState(); void forceConnectedState();
public slots: public slots:
@ -152,21 +151,21 @@ public slots:
void apply(); void apply();
void save(); void save();
signals: signals:
//fired when a widgets contents changes // fired when a widgets contents changes
void widgetContentsChanged(QWidget * widget); void widgetContentsChanged(QWidget *widget);
//fired when the framework requests that the widgets values be populated, use for custom behaviour // fired when the framework requests that the widgets values be populated, use for custom behaviour
void populateWidgetsRequested(); void populateWidgetsRequested();
//fired when the framework requests that the widgets values be refreshed, use for custom behaviour // fired when the framework requests that the widgets values be refreshed, use for custom behaviour
void refreshWidgetsValuesRequested(); void refreshWidgetsValuesRequested();
//fired when the framework requests that the UAVObject values be updated from the widgets value, use for custom behaviour // fired when the framework requests that the UAVObject values be updated from the widgets value, use for custom behaviour
void updateObjectsFromWidgetsRequested(); void updateObjectsFromWidgetsRequested();
//fired when the autopilot connects // fired when the autopilot connects
void autoPilotConnected(); void autoPilotConnected();
//fired when the autopilot disconnects // fired when the autopilot disconnects
void autoPilotDisconnected(); void autoPilotDisconnected();
void defaultRequested(int group); void defaultRequested(int group);
private slots: private slots:
void objectUpdated(UAVObject*); void objectUpdated(UAVObject *);
void defaultButtonClicked(); void defaultButtonClicked();
void reloadButtonClicked(); void reloadButtonClicked();
private: private:
@ -174,15 +173,15 @@ private:
bool isConnected; bool isConnected;
bool allowWidgetUpdates; bool allowWidgetUpdates;
QStringList objectsList; QStringList objectsList;
QList <objectToWidget*> objOfInterest; QList <objectToWidget *> objOfInterest;
ExtensionSystem::PluginManager *pm; ExtensionSystem::PluginManager *pm;
UAVObjectManager *objManager; UAVObjectManager *objManager;
UAVObjectUtilManager* utilMngr; UAVObjectUtilManager *utilMngr;
smartSaveButton *smartsave; smartSaveButton *smartsave;
QMap<UAVObject *,bool> objectUpdates; QMap<UAVObject *, bool> objectUpdates;
QMap<int,QList<objectToWidget*> *> defaultReloadGroups; QMap<int, QList<objectToWidget *> *> defaultReloadGroups;
QMap<QWidget *,objectToWidget*> shadowsList; QMap<QWidget *, objectToWidget *> shadowsList;
QMap<QPushButton *,QString> helpButtonList; QMap<QPushButton *, QString> helpButtonList;
QList<QPushButton *> reloadButtonList; QList<QPushButton *> reloadButtonList;
bool dirty; bool dirty;
bool setFieldFromWidget(QWidget *widget, UAVObjectField *field, int index, double scale); bool setFieldFromWidget(QWidget *widget, UAVObjectField *field, int index, double scale);
@ -194,7 +193,7 @@ private:
void disconnectWidgetUpdatesToSlot(QWidget *widget, const char *function); void disconnectWidgetUpdatesToSlot(QWidget *widget, const char *function);
void loadWidgetLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, double sclale); void loadWidgetLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, double sclale);
QString outOfLimitsStyle; QString outOfLimitsStyle;
QTimer * timeOut; QTimer *timeOut;
protected slots: protected slots:
virtual void disableObjUpdates(); virtual void disableObjUpdates();
@ -202,14 +201,13 @@ protected slots:
virtual void clearDirty(); virtual void clearDirty();
virtual void widgetsContentsChanged(); virtual void widgetsContentsChanged();
virtual void populateWidgets(); virtual void populateWidgets();
virtual void refreshWidgetsValues(UAVObject * obj=NULL); virtual void refreshWidgetsValues(UAVObject *obj = NULL);
virtual void updateObjectsFromWidgets(); virtual void updateObjectsFromWidgets();
virtual void helpButtonPressed(); virtual void helpButtonPressed();
protected: protected:
virtual void enableControls(bool enable); virtual void enableControls(bool enable);
void checkWidgetsLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, QVariant value, double scale); void checkWidgetsLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, QVariant value, double scale);
void updateEnableControls(); void updateEnableControls();
}; };
#endif // CONFIGTASKWIDGET_H #endif // CONFIGTASKWIDGET_H

View File

@ -39,8 +39,7 @@ QT_BEGIN_NAMESPACE
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE QT_END_NAMESPACE
class MixerNode : public QObject,public QGraphicsItem class MixerNode : public QObject, public QGraphicsItem {
{
Q_OBJECT Q_OBJECT
public: public:
MixerNode(MixerCurveWidget *graphWidget); MixerNode(MixerCurveWidget *graphWidget);
@ -48,15 +47,37 @@ public:
QList<Edge *> edges() const; QList<Edge *> edges() const;
enum { Type = UserType + 10 }; enum { Type = UserType + 10 };
int type() const { return Type; } int type() const
{
return Type;
}
void verticalMove(bool flag); void verticalMove(bool flag);
void setPositiveColor(QColor color = "#609FF2") {positiveColor = color; } void setPositiveColor(QColor color = "#609FF2")
void setNegativeColor(QColor color = "#EF5F5F") {negativeColor = color; } {
void setImage(QImage img) { image = img; } positiveColor = color;
void setDrawNode(bool draw) { drawNode = draw; } }
void setDrawText(bool draw) { drawText = draw; }
void setNegativeColor(QColor color = "#EF5F5F")
{
negativeColor = color;
}
void setImage(QImage img)
{
image = img;
}
void setDrawNode(bool draw)
{
drawNode = draw;
}
void setDrawText(bool draw)
{
drawText = draw;
}
QRectF boundingRect() const; QRectF boundingRect() const;
QPainterPath shape() const; QPainterPath shape() const;
@ -69,25 +90,24 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private: private:
QList<Edge *> edgeList; QList<Edge *> edgeList;
QPointF newPos; QPointF newPos;
MixerCurveWidget* graph; MixerCurveWidget *graph;
QColor positiveColor; QColor positiveColor;
QColor neutralColor; QColor neutralColor;
QColor negativeColor; QColor negativeColor;
QColor disabledColor; QColor disabledColor;
QColor disabledTextColor; QColor disabledTextColor;
QImage image; QImage image;
bool vertical;
bool drawNode;
bool drawText;
int index;
bool vertical;
bool drawNode;
bool drawText;
int index;
}; };
#endif // MIXERCURVEPOINT_H #endif // MIXERCURVEPOINT_H

View File

@ -37,57 +37,54 @@
#include "mixercurveline.h" #include "mixercurveline.h"
#include "uavobjectwidgetutils_global.h" #include "uavobjectwidgetutils_global.h"
class UAVOBJECTWIDGETUTILS_EXPORT MixerCurveWidget : public QGraphicsView class UAVOBJECTWIDGETUTILS_EXPORT MixerCurveWidget : public QGraphicsView {
{
Q_OBJECT Q_OBJECT
public: public:
MixerCurveWidget(QWidget *parent = 0); MixerCurveWidget(QWidget *parent = 0);
~MixerCurveWidget(); ~MixerCurveWidget();
friend class MixerCurve; friend class MixerCurve;
void itemMoved(double itemValue); // Callback when a point is moved, to be updated void itemMoved(double itemValue); // Callback when a point is moved, to be updated
void initCurve (const QList<double>* points); void initCurve(const QList<double> *points);
QList<double> getCurve(); QList<double> getCurve();
void initLinearCurve(int numPoints, double maxValue = 1, double minValue = 0); void initLinearCurve(int numPoints, double maxValue = 1, double minValue = 0);
void setCurve(const QList<double>* points); void setCurve(const QList<double> *points);
void setMin(double value); void setMin(double value);
double getMin(); double getMin();
void setMax(double value); void setMax(double value);
double getMax(); double getMax();
double setRange(double min, double max); double setRange(double min, double max);
static const int NODE_NUMELEM = 5; static const int NODE_NUMELEM = 5;
signals: signals:
void curveUpdated(); void curveUpdated();
void curveMinChanged(double value); void curveMinChanged(double value);
void curveMaxChanged(double value); void curveMaxChanged(double value);
private slots: private slots:
private: private:
QGraphicsSvgItem *plot; QGraphicsSvgItem *plot;
QList<Edge*> edgeList; QList<Edge *> edgeList;
QList<MixerNode*> nodeList; QList<MixerNode *> nodeList;
double curveMin; double curveMin;
double curveMax; double curveMax;
bool curveUpdating; bool curveUpdating;
void initNodes(int numPoints); void initNodes(int numPoints);
void setPositiveColor(QString color); void setPositiveColor(QString color);
void setNegativeColor(QString color); void setNegativeColor(QString color);
void resizeCommands(); void resizeCommands();
protected: protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);
void changeEvent(QEvent *event); void changeEvent(QEvent *event);
}; };
#endif /* MIXERCURVEWIDGET_H_ */ #endif /* MIXERCURVEWIDGET_H_ */

View File

@ -12,19 +12,24 @@ namespace Ui {
class PopupWidget; class PopupWidget;
} }
class UAVOBJECTWIDGETUTILS_EXPORT PopupWidget : public QDialog class UAVOBJECTWIDGETUTILS_EXPORT PopupWidget : public QDialog {
{
Q_OBJECT Q_OBJECT
public: public:
explicit PopupWidget(QWidget *parent = 0); explicit PopupWidget(QWidget *parent = 0);
void popUp(QWidget* widget = 0);
void setWidget(QWidget* widget);
QWidget* getWidget() { return m_widget; }
QHBoxLayout* getLayout() { return m_layout; }
signals: void popUp(QWidget *widget = 0);
void setWidget(QWidget *widget);
QWidget *getWidget()
{
return m_widget;
}
QHBoxLayout *getLayout()
{
return m_layout;
}
public slots: public slots:
bool close(); bool close();
void done(int result); void done(int result);
@ -33,12 +38,12 @@ private slots:
void closePopup(); void closePopup();
private: private:
QHBoxLayout* m_layout; QHBoxLayout *m_layout;
QWidget* m_widget; QWidget *m_widget;
QWidget* m_widgetParent; QWidget *m_widgetParent;
QPushButton* m_closeButton; QPushButton *m_closeButton;
int m_widgetWidth; int m_widgetWidth;
int m_widgetHeight; int m_widgetHeight;
}; };
#endif // POPUPWIDGET_H #endif // POPUPWIDGET_H

View File

@ -37,14 +37,15 @@
#include "uavobjectutilmanager.h" #include "uavobjectutilmanager.h"
#include <QObject> #include <QObject>
#include <QDebug> #include <QDebug>
class smartSaveButton:public QObject
{ class smartSaveButton : public QObject {
enum buttonTypeEnum {save_button,apply_button}; enum buttonTypeEnum { save_button, apply_button };
public: public:
Q_OBJECT Q_OBJECT
public: public:
smartSaveButton(); smartSaveButton();
void addButtons(QPushButton * save,QPushButton * apply); void addButtons(QPushButton *save, QPushButton *apply);
void setObjects(QList<UAVDataObject *>); void setObjects(QList<UAVDataObject *>);
void addObject(UAVDataObject *); void addObject(UAVDataObject *);
void clearObjects(); void clearObjects();
@ -53,32 +54,34 @@ public:
void addApplyButton(QPushButton *apply); void addApplyButton(QPushButton *apply);
void addSaveButton(QPushButton *save); void addSaveButton(QPushButton *save);
void resetIcons(); void resetIcons();
signals: signals:
void preProcessOperations(); void preProcessOperations();
void saveSuccessfull(); void saveSuccessfull();
void beginOp(); void beginOp();
void endOp(); void endOp();
public slots: public slots:
void apply(); void apply();
void save(); void save();
private slots: private slots:
void processClick(); void processClick();
void processOperation(QPushButton *button, bool save); void processOperation(QPushButton *button, bool save);
void transaction_finished(UAVObject* obj, bool result); void transaction_finished(UAVObject *obj, bool result);
void saving_finished(int,bool); void saving_finished(int, bool);
private: private:
quint32 current_objectID; quint32 current_objectID;
UAVDataObject * current_object; UAVDataObject *current_object;
bool up_result; bool up_result;
bool sv_result; bool sv_result;
QEventLoop loop; QEventLoop loop;
QList<UAVDataObject *> objects; QList<UAVDataObject *> objects;
QMap<QPushButton *,buttonTypeEnum> buttonList; QMap<QPushButton *, buttonTypeEnum> buttonList;
protected:
public slots: public slots:
void enableControls(bool value); void enableControls(bool value);
}; };