Commit a23be949 authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #272 from Susurrus/vehicle_config

Fixed some display of parameters where no vehicle-specific config is specified
parents a0a4efbd 18a7f56e
......@@ -263,11 +263,7 @@ void QGCParamSlider::endEditMode()
switch (parameterValue.type())
{
case QVariant::Char:
ui->intValueSpinBox->show();
break;
case QVariant::Int:
ui->intValueSpinBox->show();
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
break;
......@@ -381,14 +377,6 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->editSelectParamComboBox->addItem(parameterName, paramIndex);
}
if (this->parameterName == "RC5_MIN")
{
int stopper = 1;
}
if (parameterName == "RC5_MIN")
{
int stpoper = 1;
}
if (visibleParam != "")
{
if (parameterName == visibleParam)
......@@ -427,51 +415,51 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setRange(0, UINT8_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(255);
ui->editMaxSpinBox->setValue(UINT8_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QVariant::Int:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toInt());
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->intValueSpinBox->setRange(INT32_MIN, INT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMinSpinBox->setValue(0);
ui->editMaxSpinBox->setValue(INT32_MAX);
ui->editMinSpinBox->setValue(INT32_MIN);
}
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setMinimum(0);
ui->intValueSpinBox->setRange(0, UINT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMaxSpinBox->setValue(UINT32_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QMetaType::Float:
ui->doubleValueSpinBox->setValue(value.toFloat());
ui->doubleValueSpinBox->show();
ui->doubleValueSpinBox->setEnabled(true);
ui->intValueSpinBox->hide();
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(10000);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
break;
default:
qCritical() << "ERROR: NO VALID PARAM TYPE";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment