Example #1
0
void IndicatorDisplay::createSettings(QGridLayout *layout) {
    DisplayInstrument::createSettings(layout);



    // Presets
    // Warning: do not change the order
    layout->addWidget(new QLabel("Load Preset", layout->parentWidget()));
    QComboBox *combobox = new QComboBox(layout->parentWidget());
    combobox->addItem("");
    // On/off types
    combobox->addItem("Brakes");
    combobox->addItem("Gear");
    combobox->addItem("Battery");
    combobox->addItem("Engine Fire");
    combobox->addItem("Fuel Pressure");
    combobox->addItem("Oil Pressure");
    combobox->addItem("Oil Temperature");
    combobox->addItem("Fuel Low");
    combobox->addItem("Ice Detected");
    combobox->addItem("Beacon Lights");
    combobox->addItem("Landing Lights");
    combobox->addItem("Navigation Lights");
    combobox->addItem("Taxi Lights");
    combobox->addItem("Strobe Lights");
    // Custom types
    combobox->addItem("");
    combobox->addItem("Custom Dataref");
    combobox->addItem("Custom Label");
    // Value types
    combobox->addItem("");
    combobox->addItem("Cabin Alt");
    combobox->addItem("Total Fuel");
    combobox->addItem("Outside Temp");
    combobox->addItem("Cabin Pressure Rate");
    combobox->addItem("Cabin AP Rate");

    // Add to layout and connect
    layout->addWidget(combobox);
    connect(combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(loadPreset(int)));
    connect(combobox, SIGNAL(currentIndexChanged(int)), layout->parentWidget()->window(), SLOT(close())); // This is kindof a hack, but we need to close the window to reflect the changes to the gui

    // Standard settings
    createLineEditSetting(layout,"DataRef",_datarefName,SLOT(setDataRefName(QString)));
    createNumberInputSetting(layout,"Threshold",_threshold,SLOT(setThreshold(float)));
    createSliderSetting(layout,"Strength On",0,100,_strengthOn,SLOT(setStrengthOn(int)));
    createSliderSetting(layout,"Strength Off",0,100,_strengthOff,SLOT(setStrengthOff(int)));
    createLineEditSetting(layout,"Label On",_labelOn,SLOT(setLabelOn(QString)));
    createLineEditSetting(layout,"Label Off",_labelOff,SLOT(setLabelOff(QString)));
    createColorSetting(layout,"Label Color",_labelColor,SLOT(setLabelColor(QColor)));
    createCheckboxSetting(layout,"Show Value",_showValue,SLOT(setShowValue(bool)));
    createColorSetting(layout,"Value Color",_valueColor,SLOT(setValueColor(QColor)));
    createNumberInputSetting(layout,"Value Divisor",_valueDivisor,SLOT(setValueDivisor(float)));
}
Example #2
0
void EngineDisplay::createGaugeSetSettings(QGridLayout *layout, QString name, bool enabled, double dataRefMin, double dataRefMax, double rangeMin, double rangeMax, QColor color) {
    createCheckboxSetting(layout,name+" Enabled",enabled,QString("1set"+name+"Enabled(bool)").toStdString().c_str());
    createNumberInputSetting(layout,name+" DataRef Min",dataRefMin,QString("1set"+name+"DatarefMinimum(float)").toStdString().c_str());
    createNumberInputSetting(layout,name+" DataRef Max",dataRefMax,QString("1set"+name+"DatarefMaximum(float)").toStdString().c_str());
    createNumberInputSetting(layout,name+" Range Min",rangeMin,QString("1set"+name+"RangeMinimum(float)").toStdString().c_str());
    createNumberInputSetting(layout,name+" Range Max",rangeMax,QString("1set"+name+"RangeMaximum(float)").toStdString().c_str());
    createColorSetting(layout,name+" Color",color,QString("1set"+name+"Color(QColor)").toStdString().c_str());
}
Example #3
0
void IndicatorLight::createSettings(QGridLayout *layout) {
    PanelItem::createSettings(layout);

    // Standard settings
    createLineEditSetting(layout,"DataRef",_datarefName,SLOT(setDataRefName(QString)));
    createNumberInputSetting(layout,"Threshold",_threshold,SLOT(setThreshold(float)));
    createSliderSetting(layout,"Strength On",0,100,_strengthOn,SLOT(setStrengthOn(int)));
    createSliderSetting(layout,"Strength Off",0,100,_strengthOff,SLOT(setStrengthOff(int)));
    createLineEditSetting(layout,"Label On",_labelOn,SLOT(setLabelOn(QString)));
    createLineEditSetting(layout,"Label Off",_labelOff,SLOT(setLabelOff(QString)));
    createColorSetting(layout,"Label Color",_labelColor,SLOT(setLabelColor(QColor)));
    createSliderSetting(layout,"Label Glow",0,100,_glowStrength,SLOT(setGlowStrength(int)));

    // Presets
    layout->addWidget(new QLabel("Load Preset", layout->parentWidget()));
    QComboBox *combobox = new QComboBox(layout->parentWidget());
    combobox->addItem("");
    combobox->addItem("Brakes");
    combobox->addItem("Gear");
    combobox->addItem("Battery");
    combobox->addItem("Engine Fire");
    combobox->addItem("Fuel Pressure");
    combobox->addItem("Oil Pressure");
    combobox->addItem("Oil Temperature");
    combobox->addItem("Fuel Low");
    combobox->addItem("Ice Detected");
    combobox->addItem("Beacon Lights");
    combobox->addItem("Landing Lights");
    combobox->addItem("Navigation Lights");
    combobox->addItem("Taxi Lights");
    combobox->addItem("Strobe Lights");
    layout->addWidget(combobox);
    connect(combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(loadPreset(int)));
    connect(combobox, SIGNAL(currentIndexChanged(int)), layout->parentWidget()->window(), SLOT(close())); // This is kindof a hack, but we need to close the window to reflect the changes to the gui

}