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()); } }
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 ); } }
void Tire::setQuantity(unsigned int quantity) { _quantity = quantity; emit quantityChanged(); }