mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
refs #212, methods for parsing values
* PQ, set by other PQ * PQ, set NULL * PQ, CPqTime, implemented parse to string * CPqTime to QTime
This commit is contained in:
@@ -94,6 +94,9 @@ namespace BlackMisc
|
||||
//! Is quantity null?
|
||||
bool isNull() const { return this->m_unit.isNull(); }
|
||||
|
||||
//! Set null
|
||||
void setNull() { this->m_unit = MU::nullUnit(); }
|
||||
|
||||
//! Value in given unit
|
||||
double value(const MU &unit) const;
|
||||
|
||||
@@ -116,7 +119,13 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Rounded value in given unit
|
||||
//! Set by other PQ
|
||||
void set(const PQ &pq)
|
||||
{
|
||||
this->m_value = pq.m_value;
|
||||
this->m_unit = pq.m_unit;
|
||||
}
|
||||
|
||||
//! Rounded value in given unit
|
||||
double valueRounded(const MU &unit, int digits = -1) const;
|
||||
|
||||
@@ -225,6 +234,9 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::fromJson
|
||||
virtual void fromJson(const QJsonObject &json) override;
|
||||
|
||||
//! \copydoc CValueObject::parseFromString
|
||||
virtual void parseFromString(const QString &value) override;
|
||||
|
||||
//! Register metadata of unit and quantity
|
||||
static void registerMetadata();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user