Add "Paused=0/1" to measures. This is an addition to a883e9d.

This commit is contained in:
Brian Ferguson 2013-07-15 11:59:58 -06:00
parent 6e9bc98d0b
commit 8bf1f6aec8
2 changed files with 19 additions and 2 deletions

View File

@ -129,6 +129,7 @@ void Measure::ReadOptions(ConfigParser& parser, const WCHAR* section)
m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0); m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0);
m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0); m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0);
m_Paused = 0!=parser.ReadInt(section, L"Paused", 0);
m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue); m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue);
m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue); m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue);
@ -188,6 +189,22 @@ void Measure::Enable()
m_MeterWindow->GetParser().SetValue(m_Name, L"Disabled", L"0"); m_MeterWindow->GetParser().SetValue(m_Name, L"Disabled", L"0");
} }
void Measure::Pause()
{
m_Paused = true;
// Change the option as well to avoid reset in ReadOptions().
m_MeterWindow->GetParser().SetValue(m_Name, L"Paused", L"1");
}
void Measure::Unpause()
{
m_Paused = false;
// Change the option as well to avoid reset in ReadOptions().
m_MeterWindow->GetParser().SetValue(m_Name, L"Paused", L"0");
}
/* /*
** Substitues text using a straight find and replace method ** Substitues text using a straight find and replace method
*/ */

View File

@ -66,8 +66,8 @@ public:
void Enable(); void Enable();
bool IsDisabled() { return m_Disabled; } bool IsDisabled() { return m_Disabled; }
void Pause() { m_Paused = true; } void Pause();
void Unpause() { m_Paused = false; } void Unpause();
bool IsPaused() { return m_Paused; } bool IsPaused() { return m_Paused; }
virtual void Command(const std::wstring& command); virtual void Command(const std::wstring& command);