Rainmeter.stats is now updated periodically only if NetTotal measure has been used in current session.

This commit is contained in:
Birunthan Mohanathas 2012-01-28 18:44:19 +00:00
parent e14ef154f3
commit 92864ea360
4 changed files with 10 additions and 2 deletions

View File

@ -478,6 +478,7 @@ void CMeasureNet::ReadConfig(CConfigParser& parser, const WCHAR* section, NET ne
{ {
netName = L"NetTotalSpeed"; netName = L"NetTotalSpeed";
value = Rainmeter->GetGlobalConfig().netInSpeed + Rainmeter->GetGlobalConfig().netOutSpeed; value = Rainmeter->GetGlobalConfig().netInSpeed + Rainmeter->GetGlobalConfig().netOutSpeed;
CSystem::SetNetworkStatisticsTimer();
} }
double maxValue = parser.ReadFloat(section, L"MaxValue", -1); double maxValue = parser.ReadFloat(section, L"MaxValue", -1);

View File

@ -30,7 +30,8 @@ typedef VOID (NETIOAPI_API_ * FPFREEMIBTABLE)(PVOID Memory);
class CMeasureNet : public CMeasure class CMeasureNet : public CMeasure
{ {
public: public:
enum NET { enum NET
{
NET_IN, NET_IN,
NET_OUT, NET_OUT,
NET_TOTAL NET_TOTAL

View File

@ -124,7 +124,6 @@ void CSystem::Initialize(HINSTANCE instance)
WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL); SetTimer(c_Window, TIMER_SHOWDESKTOP, INTERVAL_SHOWDESKTOP, NULL);
SetTimer(c_Window, TIMER_NETSTATS, INTERVAL_NETSTATS, NULL);
SetTimer(c_Window, TIMER_DELETELATER, INTERVAL_DELETELATER, NULL); SetTimer(c_Window, TIMER_DELETELATER, INTERVAL_DELETELATER, NULL);
} }
@ -159,6 +158,11 @@ void CSystem::Finalize()
} }
} }
void CSystem::SetNetworkStatisticsTimer()
{
static bool set = SetTimer(c_Window, TIMER_NETSTATS, INTERVAL_NETSTATS, NULL);
}
/* /*
** MyInfoEnumProc ** MyInfoEnumProc
** **

View File

@ -56,6 +56,8 @@ public:
static void Initialize(HINSTANCE instance); static void Initialize(HINSTANCE instance);
static void Finalize(); static void Finalize();
static void SetNetworkStatisticsTimer();
static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; } static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; }
static size_t GetMonitorCount(); static size_t GetMonitorCount();