This commit is contained in:
Brian Ferguson 2014-01-01 09:14:49 -07:00
parent 1383c046e0
commit 1a345f1ad8
4 changed files with 15 additions and 6 deletions

View File

@ -114,6 +114,7 @@
<ClCompile Include="MeasureScript.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="MeasureString.cpp" />
<ClCompile Include="MeasureTime.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
@ -306,6 +307,7 @@
<ClInclude Include="MeasurePlugin.h" />
<ClInclude Include="MeasureRegistry.h" />
<ClInclude Include="MeasureScript.h" />
<ClInclude Include="MeasureString.h" />
<ClInclude Include="MeasureTime.h" />
<ClInclude Include="MeasureUptime.h" />
<ClInclude Include="MeasureVirtualMemory.h" />

View File

@ -396,6 +396,9 @@
<ClCompile Include="IfActions.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MeasureString.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ConfigParser.h">
@ -677,6 +680,9 @@
<ClInclude Include="IfActions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="MeasureString.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Library.rc">

View File

@ -29,6 +29,7 @@
#include "MeasureUptime.h"
#include "MeasurePlugin.h"
#include "MeasureRegistry.h"
#include "MeasureString.h"
#include "MeasureTime.h"
#include "MeasureCalc.h"
#include "MeasureScript.h"
@ -795,6 +796,10 @@ Measure* Measure::Create(const WCHAR* measure, MeterWindow* meterWindow, const W
{
return new MeasureScript(meterWindow, name);
}
else if (_wcsicmp(L"String", measure) == 0)
{
return new MeasureString(meterWindow, name);
}
LogErrorF(meterWindow, L"Measure=%s is not valid in [%s]", measure, name);

View File

@ -96,12 +96,8 @@ void MeasureCalc::ReadOptions(ConfigParser& parser, const WCHAR* section)
m_UpdateRandom = parser.ReadBool(section, L"UpdateRandom", false);
const size_t range = (m_HighBound - m_LowBound) + 1;
m_UniqueRandom = parser.ReadBool(section, L"UniqueRandom", false);
if (m_UniqueRandom && range > DEFAULT_UNIQUELIMIT)
{
m_UniqueRandom = false;
}
else if (!m_UniqueRandom)
m_UniqueRandom = (range <= DEFAULT_UNIQUELIMIT) && parser.ReadBool(section, L"UniqueRandom", false);
if (!m_UniqueRandom)
{
m_UniqueNumbers.clear();
}