Beispiel #1
0
TankLeveler::TankLeveler(ExtPlanePanel *panel, ExtPlaneConnection *conn) :
    PanelItem(panel, PanelItemTypeGauge, PanelItemShapeCircular),
   _tankNumber(0),
   tankShortDesignation("C"),
   quantityValue(0),
   valueMax(110),
   scaleFactor(1),
   _client(this, typeName(), conn),
   bottomImage(":/images/DR400_engine_FUEL_Tank.png"),
   bottomPixmap(0),
   needleImage(":/images/DR400_engine_FUEL_Tank_needle.png")
   {


        //init
        //subscibe to dataref
        _client.subscribeDataRef("sim/cockpit2/fuel/fuel_quantity", 1.0);

        conn->registerClient(&_client);
        connect(&_client, SIGNAL(refChanged(QString,QStringList)), this, SLOT(quantityChanged(QString,QStringList)));

        //set size
        if (! bottomImage.isNull()) {
        //dimension the item with the default background image
        this->setSize(bottomImage.width(),bottomImage.height());
        }

    }
Beispiel #2
0
void BillItemMeasure::updateQuantity(){
    double v = m_d->parser->evaluate( m_d->formula );
    if( m_d->unitMeasure ) {
        v = m_d->unitMeasure->applyPrecision( v );
    }
    if( v != m_d->quantity ){
        m_d->quantity = v;
        emit quantityChanged( v );
    }
}
Beispiel #3
0
void Tire::setQuantity(unsigned int quantity)
{
    _quantity = quantity;
    emit quantityChanged();
}