From 3c985273383c54e451e2157a8ff363f0887f1d27 Mon Sep 17 00:00:00 2001 From: jsmorley Date: Sun, 19 Feb 2012 15:45:43 +0000 Subject: [PATCH] Add: Formulas now allowed in the following settings: LineWidth LineLength StartAngle RotationAngle Angle ImageRotate MinValue MaxValue IfAboveValue IfEqualValue IfBelowValue --- Library/Measure.cpp | 10 +++++----- Library/MeterRotator.cpp | 4 ++-- Library/MeterRoundLine.cpp | 8 ++++---- Library/MeterString.cpp | 2 +- Library/TintedImage.cpp | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 10cdab44..db33a77e 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -152,18 +152,18 @@ void CMeasure::ReadConfig(CConfigParser& parser, const WCHAR* section) m_UpdateCounter = m_UpdateDivider = updateDivider; } - m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue); - m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue); + m_MinValue = parser.ReadFormula(section, L"MinValue", m_MinValue); + m_MaxValue = parser.ReadFormula(section, L"MaxValue", m_MaxValue); // The ifabove/ifbelow define actions that are ran when the value goes above/below the given number. - m_IfAboveValue = parser.ReadFloat(section, L"IfAboveValue", 0.0); + m_IfAboveValue = parser.ReadFormula(section, L"IfAboveValue", 0.0); m_IfAboveAction = parser.ReadString(section, L"IfAboveAction", L"", false); - m_IfBelowValue = parser.ReadFloat(section, L"IfBelowValue", 0.0); + m_IfBelowValue = parser.ReadFormula(section, L"IfBelowValue", 0.0); m_IfBelowAction = parser.ReadString(section, L"IfBelowAction", L"", false); - m_IfEqualValue = parser.ReadFloat(section, L"IfEqualValue", 0.0); + m_IfEqualValue = parser.ReadFormula(section, L"IfEqualValue", 0.0); m_IfEqualAction = parser.ReadString(section, L"IfEqualAction", L"", false); m_AverageSize = parser.ReadUInt(section, L"AverageSize", 0); diff --git a/Library/MeterRotator.cpp b/Library/MeterRotator.cpp index 35767f95..2179e47b 100644 --- a/Library/MeterRotator.cpp +++ b/Library/MeterRotator.cpp @@ -107,8 +107,8 @@ void CMeterRotator::ReadConfig(CConfigParser& parser, const WCHAR* section) m_OffsetX = parser.ReadFloat(section, L"OffsetX", 0.0); m_OffsetY = parser.ReadFloat(section, L"OffsetY", 0.0); - m_StartAngle = parser.ReadFloat(section, L"StartAngle", 0.0); - m_RotationAngle = parser.ReadFloat(section, L"RotationAngle", 6.2832); + m_StartAngle = parser.ReadFormula(section, L"StartAngle", 0.0); + m_RotationAngle = parser.ReadFormula(section, L"RotationAngle", 6.2832); m_ValueRemainder = parser.ReadInt(section, L"ValueReminder", 0); // Typo m_ValueRemainder = parser.ReadInt(section, L"ValueRemainder", m_ValueRemainder); diff --git a/Library/MeterRoundLine.cpp b/Library/MeterRoundLine.cpp index df6c1d8f..13223d91 100644 --- a/Library/MeterRoundLine.cpp +++ b/Library/MeterRoundLine.cpp @@ -71,11 +71,11 @@ void CMeterRoundLine::ReadConfig(CConfigParser& parser, const WCHAR* section) // Read common configs CMeter::ReadConfig(parser, section); - m_LineWidth = parser.ReadFloat(section, L"LineWidth", 1.0); - m_LineLength = parser.ReadFloat(section, L"LineLength", 20.0); + m_LineWidth = parser.ReadFormula(section, L"LineWidth", 1.0); + m_LineLength = parser.ReadFormula(section, L"LineLength", 20.0); m_LineStart = parser.ReadFormula(section, L"LineStart", -1.0); - m_StartAngle = parser.ReadFloat(section, L"StartAngle", 0.0); - m_RotationAngle = parser.ReadFloat(section, L"RotationAngle", 6.2832); + m_StartAngle = parser.ReadFormula(section, L"StartAngle", 0.0); + m_RotationAngle = parser.ReadFormula(section, L"RotationAngle", 6.2832); m_ValueRemainder = parser.ReadInt(section, L"ValueReminder", 0); // Typo m_ValueRemainder = parser.ReadInt(section, L"ValueRemainder", m_ValueRemainder); m_LineColor = parser.ReadColor(section, L"LineColor", Color::Black); diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index 532bf964..c10db3a7 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -328,7 +328,7 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section) m_NumOfDecimals = parser.ReadInt(section, L"NumOfDecimals", -1); - m_Angle = (Gdiplus::REAL)parser.ReadFloat(section, L"Angle", 0.0); + m_Angle = (Gdiplus::REAL)parser.ReadFormula(section, L"Angle", 0.0); const std::wstring& autoscale = parser.ReadString(section, L"AutoScale", L"0"); int autoscaleValue = _wtoi(autoscale.c_str()); diff --git a/Library/TintedImage.cpp b/Library/TintedImage.cpp index a08392d2..e888c6cc 100644 --- a/Library/TintedImage.cpp +++ b/Library/TintedImage.cpp @@ -762,7 +762,7 @@ void CTintedImage::ReadConfig(CConfigParser& parser, const WCHAR* section) if (!m_DisableTransform) { - m_Rotate = (REAL)parser.ReadFloat(section, m_ConfigArray[ConfigIndexImageRotate], 0.0); + m_Rotate = (REAL)parser.ReadFormula(section, m_ConfigArray[ConfigIndexImageRotate], 0.0); } m_NeedsTransform = (oldFlip != m_Flip || oldRotate != m_Rotate);