diff --git a/src/FactSystem/FactMetaData.cc b/src/FactSystem/FactMetaData.cc index 7a2089f60505f93c7f6a6f569a6c16d46d02e938..5fefc819e799a4892d37d64a9cdbae9c93d48083 100644 --- a/src/FactSystem/FactMetaData.cc +++ b/src/FactSystem/FactMetaData.cc @@ -38,6 +38,7 @@ const FactMetaData::BuiltInTranslation_s FactMetaData::_rgBuiltInTranslations[] = { { "centi-degrees", "degrees", FactMetaData::_centiDegreesToDegrees, FactMetaData::_degreesToCentiDegrees }, { "radians", "degrees", FactMetaData::_radiansToDegrees, FactMetaData::_degreesToRadians }, + { "norm", "%", FactMetaData::_normToPercent, FactMetaData::_percentToNorm }, }; // Translations driven by app settings @@ -449,6 +450,16 @@ QVariant FactMetaData::_knotsToMetersPerSecond(const QVariant& knots) return QVariant(knots.toDouble() * 0.51444444444); } +QVariant FactMetaData::_percentToNorm(const QVariant& percent) +{ + return QVariant(percent.toDouble() / 100.0); +} + +QVariant FactMetaData::_normToPercent(const QVariant& normalized) +{ + return QVariant(normalized.toDouble() * 100.0); +} + void FactMetaData::setRawUnits(const QString& rawUnits) { _rawUnits = rawUnits; diff --git a/src/FactSystem/FactMetaData.h b/src/FactSystem/FactMetaData.h index bfdcb3a924d0a4633116bfaeb1ef15481156d8c0..ed21cba003adce02dd2bd7aa212562ebc8546dc0 100644 --- a/src/FactSystem/FactMetaData.h +++ b/src/FactSystem/FactMetaData.h @@ -163,6 +163,8 @@ private: static QVariant _kilometersPerHourToMetersPerSecond(const QVariant& kilometersPerHour); static QVariant _metersPerSecondToKnots(const QVariant& metersPerSecond); static QVariant _knotsToMetersPerSecond(const QVariant& knots); + static QVariant _percentToNorm(const QVariant& percent); + static QVariant _normToPercent(const QVariant& normalized); struct AppSettingsTranslation_s { const char* rawUnits;