mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
PerfMon.dll: Fixed incorrect measure value (http://rainmeter.net/forum/viewtopic.php?f=14&t=11599)
This commit is contained in:
parent
2f2f5e6efa
commit
fb5a425eb8
@ -39,7 +39,6 @@ CMeasurePlugin::CMeasurePlugin(CMeterWindow* meterWindow, const WCHAR* name) : C
|
|||||||
m_GetStringFunc(),
|
m_GetStringFunc(),
|
||||||
m_ExecuteBangFunc()
|
m_ExecuteBangFunc()
|
||||||
{
|
{
|
||||||
m_MaxValue = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -206,24 +205,25 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
|||||||
m_Update2 = true;
|
m_Update2 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
double maxValue = 0;
|
double oldMaxValue = m_MaxValue;
|
||||||
|
|
||||||
if (initializeFunc)
|
if (initializeFunc)
|
||||||
{
|
{
|
||||||
maxValue = ((INITIALIZE)initializeFunc)(m_Plugin, parser.GetFilename().c_str(), section, m_ID);
|
m_MaxValue = ((INITIALIZE)initializeFunc)(m_Plugin, parser.GetFilename().c_str(), section, m_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::wstring& szMaxValue = parser.ReadString(section, L"MaxValue", L"");
|
const std::wstring& szMaxValue = parser.ReadString(section, L"MaxValue", L"");
|
||||||
if (szMaxValue.empty())
|
if (!szMaxValue.empty())
|
||||||
{
|
{
|
||||||
m_MaxValue = maxValue;
|
m_MaxValue = oldMaxValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_MaxValue == 0)
|
if (m_MaxValue == 0.0)
|
||||||
{
|
{
|
||||||
m_MaxValue = 1;
|
m_MaxValue = 1.0;
|
||||||
m_LogMaxValue = true;
|
m_LogMaxValue = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Reset to default
|
// Reset to default
|
||||||
SetDllDirectory(L"");
|
SetDllDirectory(L"");
|
||||||
|
@ -54,6 +54,8 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
|||||||
measure->counterName = RmReadString(rm, L"PerfMonCounter", L"");
|
measure->counterName = RmReadString(rm, L"PerfMonCounter", L"");
|
||||||
measure->instanceName = RmReadString(rm, L"PerfMonInstance", L"");
|
measure->instanceName = RmReadString(rm, L"PerfMonInstance", L"");
|
||||||
measure->difference = RmReadInt(rm, L"PerfMonDifference", 1) == 1;
|
measure->difference = RmReadInt(rm, L"PerfMonDifference", 1) == 1;
|
||||||
|
|
||||||
|
*maxValue = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PLUGIN_EXPORT double Update(void* data)
|
PLUGIN_EXPORT double Update(void* data)
|
||||||
|
Loading…
Reference in New Issue
Block a user