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)); }
AttitudeIndicator::AttitudeIndicator( QWidget *parent): QwtDial(parent), d_gradient(0.0) { setMode(RotateScale); setWrapping(true); setOrigin(270.0); setScaleComponents( QwtAbstractScaleDraw::Ticks ); setScale(0, 0, 30.0); const QColor color = palette().color(QPalette::Text); setNeedle(new AttitudeIndicatorNeedle(color)); }
SpeedoMeter::SpeedoMeter(QWidget *parent): QwtDial(parent), d_label("km/h") { setWrapping(false); setReadOnly(true); setOrigin(135.0); setScaleArc(0.0, 270.0); scaleDraw()->setSpacing(8); QwtDialSimpleNeedle *needle = new QwtDialSimpleNeedle( QwtDialSimpleNeedle::Arrow, true, Qt::red, QColor(Qt::gray).light(130)); setNeedle(needle); setScaleOptions(ScaleTicks | ScaleLabel); setScaleTicks(0, 4, 8); }
AirspeedIndicator::AirspeedIndicator(ExtPlanePanel *panel, ExtPlaneConnection *conn) : NeedleInstrument(panel), _client(this, typeName(), conn), interpolator(0, 5) { conn->registerClient(&_client); _client.subscribeDataRef("sim/cockpit2/gauges/indicators/airspeed_kts_pilot", 0.3); // _client.subscribeDataRef("simulated", 1); connect(&_client, SIGNAL(refChanged(QString,double)), &interpolator, SLOT(valueChanged(QString,double))); connect(&interpolator, SIGNAL(interpolatedValueChanged(QString,double)), this, SLOT(speedChanged(QString,double))); setBars(20, 10); setNumbers(50); setUnit(VELOCITY_KTS); setMaxValue(300); setVso(35); setVs(50); setVfe(110); setVno(150); setVne(200); yellowTriangle = vs; setNeedle(new GABalancedNeedle(this)); }
Dial::Dial( QWidget * parent ) : QwtDial( parent ), d_label( "[a.u.]" ) { setWrapping( false ); setReadOnly( true ); setOrigin( 135.0 ); setScaleArc( 0.0, 270.0 ); scaleDraw()->setSpacing( 8 ); QwtDialSimpleNeedle * needle = new QwtDialSimpleNeedle( QwtDialSimpleNeedle::Arrow, true, Qt::red, QColor( Qt::gray ).light( 130 ) ); setNeedle( needle ); setScaleComponents( QwtAbstractScaleDraw::Ticks | QwtAbstractScaleDraw::Labels ); setScaleTicks( 0, 4, 8 ); }