mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Had a bit of spare time so tried out the policy design pattern I've been learning about, applying it to PQ converters.
Some interesting results: * Minor simplification of PQ converters and unit ctors; may not seem like much, but I think it enables possible future simplifications of a similar kind. * CMeasurementPrefix is gone, no longer needed. Now prefixes are applied at the template stage. * Apart from that, PQs public API is unchanged. * Discovered that ft/s^2 conversion factor was wrong: fixed.
This commit is contained in:
@@ -15,15 +15,9 @@ namespace BlackMiscTest
|
||||
*/
|
||||
int CSamplesPhysicalQuantities::samples()
|
||||
{
|
||||
|
||||
// cases which must not work
|
||||
// CMeasurementUnit mu; //must not work
|
||||
// CLengthUnit du1(CAngleUnit::rad());
|
||||
|
||||
CMeasurementPrefix pf1 = CMeasurementPrefix::h();
|
||||
CMeasurementPrefix pf2 = CMeasurementPrefix::M();
|
||||
qDebug() << pf1 << pf2 << (1.0 * pf1.toDouble());
|
||||
|
||||
CLengthUnit lu1(CLengthUnit::cm());
|
||||
CLengthUnit lu2(CLengthUnit::ft());
|
||||
QString lu1s = lu1.toQString(true);
|
||||
|
||||
Reference in New Issue
Block a user