コード例 #1
0
ファイル: variometer.cpp プロジェクト: Nicolou/ExtPlane-Panel
void Variometer::loadSettings(QSettings &settings) {
    PanelItem::loadSettings(settings);
    QString unitname = settings.value("unit").toString();
    VelocityUnit unit = Units::velocityUnitForName(unitname);
    setUnit(unit);
    setMaxValue(settings.value("maxvalue", 300).toDouble());
    setIsTotalEnergy(settings.value("totalenergy", false).toBool());
}
コード例 #2
0
void Variometer::loadSettings(QSettings &settings) {
    NeedleInstrument::loadSettings(settings);
    QString unitname = settings.value("unit").toString();
    VelocityUnit unit = Units::velocityUnitForName(unitname);
    setUnit(unit);
    setMaxValue(settings.value("maxvalue", 300).toFloat());
    setNumberScale(settings.value("scalevalue", 1.).toFloat());
    setIsTotalEnergy(settings.value("totalenergy", false).toBool());
}
コード例 #3
0
Variometer::Variometer(QObject *parent, ExtPlaneConnection *conn) : NeedleInstrument(parent), _client(this, typeName(), conn) {
    conn->registerClient(&_client);
    _client.subscribeDataRef("sim/flightmodel/position/vh_ind_fpm", 2.0);
    connect(&_client, SIGNAL(refChanged(QString,double)), this, SLOT(velocityChanged(QString,double)));
    setBars(500, 100);
    setNumbers(500);
    setNumberScale(0.01);
    setUnit(VELOCITY_FPM);
    setMaxValue(2000);
    setMinTextValue(-2000);
    isTotalEnergy = false;
    setIsTotalEnergy(false);
}
コード例 #4
0
ファイル: variometer.cpp プロジェクト: Nicolou/ExtPlane-Panel
Variometer::Variometer(ExtPlanePanel *panel, ExtPlaneConnection *conn) : NeedleInstrument(panel),
    _client(this, typeName(), conn), interpolator(0, 3) {
    conn->registerClient(&_client);
    _client.subscribeDataRef("sim/flightmodel/position/vh_ind", VARIOMETER_ACCURACY);
    connect(&_client, SIGNAL(refChanged(QString,double)), &interpolator, SLOT(valueChanged(QString,double)));
    connect(&interpolator, SIGNAL(interpolatedValueChanged(QString,double)), this, SLOT(velocityChanged(QString,double)));
    setBars(1, 0.5);
    setNumbers(1);
    setUnit(VELOCITY_MS);
    setMaxValue(5);
    isTotalEnergy = false;
    setIsTotalEnergy(false);
    setNeedle(new GABalancedNeedle(this));
}