From 61f088e59cf699b472501bb28c3b5442fa7374eb Mon Sep 17 00:00:00 2001 From: Brian Ferguson Date: Thu, 10 Jan 2013 23:48:31 -0700 Subject: [PATCH] Fixed issue with 8330415 --- Library/Measure.cpp | 3 ++- Library/Measure.h | 3 +++ Library/MeterWindow.cpp | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index c6eaebe2..721dec95 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -88,7 +88,8 @@ CMeasure::CMeasure(CMeterWindow* meterWindow, const WCHAR* name) : CSection(name m_Disabled(false), m_Initialized(false), m_OldValue(0.0), - m_OldStringValue(L"") + m_OldStringValue(L""), + m_SkipFirstChange(true) { } diff --git a/Library/Measure.h b/Library/Measure.h index db9134ce..03e04536 100644 --- a/Library/Measure.h +++ b/Library/Measure.h @@ -74,6 +74,8 @@ public: double GetOldValue() { return m_OldValue; } void SetOldStringValue(std::wstring value) { m_OldStringValue = value; } std::wstring GetOldStringValue() { return m_OldStringValue; } + void SetFirstChange(bool value) { m_SkipFirstChange = value; } + bool GetFirstChange() { return m_SkipFirstChange; } CMeterWindow* GetMeterWindow() { return m_MeterWindow; } @@ -123,6 +125,7 @@ protected: std::wstring m_OnChangeAction; double m_OldValue; std::wstring m_OldStringValue; + bool m_SkipFirstChange; CMeterWindow* m_MeterWindow; }; diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index defde84d..355563b0 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -2693,8 +2693,15 @@ void CMeterWindow::Update(bool refresh) double newValue = (*i)->GetValue(); const WCHAR* newStringValue = (*i)->GetStringValue(AUTOSCALE_OFF, 1, -1, false); std::wstring changeAction = (*i)->GetOnChangeAction(); + bool skip = (*i)->GetFirstChange(); - if (((*i)->GetOldValue() != newValue || (*i)->GetOldStringValue() != newStringValue) && !changeAction.empty() && m_UpdateCounter > 1) + if (skip) + { + (*i)->SetOldValue(newValue); + (*i)->SetOldStringValue(newStringValue); + (*i)->SetFirstChange(false); + } + else if (((*i)->GetOldValue() != newValue || (*i)->GetOldStringValue() != newStringValue) && !changeAction.empty()) { (*i)->SetOldValue(newValue); (*i)->SetOldStringValue(newStringValue);