mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Added TimeStamp option to Time measures
This commit is contained in:
parent
1ba617d829
commit
de1cfb8504
@ -46,7 +46,8 @@ int GetYearDay(int year, int month, int day)
|
|||||||
*/
|
*/
|
||||||
CMeasureTime::CMeasureTime(CMeterWindow* meterWindow, const WCHAR* name) : CMeasure(meterWindow, name),
|
CMeasureTime::CMeasureTime(CMeterWindow* meterWindow, const WCHAR* name) : CMeasure(meterWindow, name),
|
||||||
m_DeltaTime(),
|
m_DeltaTime(),
|
||||||
m_Time()
|
m_Time(),
|
||||||
|
m_TimeStamp(-1)
|
||||||
{
|
{
|
||||||
/* Set time zone from TZ environment variable. If TZ is not set,
|
/* Set time zone from TZ environment variable. If TZ is not set,
|
||||||
* the operating system is queried to obtain the default value
|
* the operating system is queried to obtain the default value
|
||||||
@ -88,6 +89,8 @@ void CMeasureTime::TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CMeasureTime::FillCurrentTime()
|
void CMeasureTime::FillCurrentTime()
|
||||||
|
{
|
||||||
|
if (m_TimeStamp < 0.0)
|
||||||
{
|
{
|
||||||
FILETIME ftUTCTime;
|
FILETIME ftUTCTime;
|
||||||
GetSystemTimeAsFileTime(&ftUTCTime);
|
GetSystemTimeAsFileTime(&ftUTCTime);
|
||||||
@ -99,6 +102,11 @@ void CMeasureTime::FillCurrentTime()
|
|||||||
|
|
||||||
m_Time.QuadPart += m_DeltaTime.QuadPart;
|
m_Time.QuadPart += m_DeltaTime.QuadPart;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Time.QuadPart = (LONGLONG)(m_TimeStamp * 10000000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Updates the current time
|
** Updates the current time
|
||||||
@ -221,6 +229,8 @@ void CMeasureTime::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
|
|
||||||
m_Format = parser.ReadString(section, L"Format", L"");
|
m_Format = parser.ReadString(section, L"Format", L"");
|
||||||
|
|
||||||
|
m_TimeStamp = parser.ReadFloat(section, L"TimeStamp", -1);
|
||||||
|
|
||||||
const WCHAR* timezone = parser.ReadString(section, L"TimeZone", L"local").c_str();
|
const WCHAR* timezone = parser.ReadString(section, L"TimeZone", L"local").c_str();
|
||||||
if (_wcsicmp(L"local", timezone) == 0)
|
if (_wcsicmp(L"local", timezone) == 0)
|
||||||
{
|
{
|
||||||
|
@ -42,6 +42,8 @@ private:
|
|||||||
std::wstring m_Format;
|
std::wstring m_Format;
|
||||||
LARGE_INTEGER m_DeltaTime;
|
LARGE_INTEGER m_DeltaTime;
|
||||||
LARGE_INTEGER m_Time;
|
LARGE_INTEGER m_Time;
|
||||||
|
|
||||||
|
double m_TimeStamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user