Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » Feature request: Synchronized timers?
Feature request: Synchronized timers? [message #36137] Thu, 03 May 2012 08:29 Go to previous message
steffen is currently offline  steffen
Messages: 38
Registered: May 2007
Location: Denmark
Member

Hi,

I'm making a touch screen user interface for displaying information received by ModbusTCP. One part of this is showing alarms as flashing indicators, like ctrl's where I toggle the face color on a timer callback.

If more alarms is active at the same time, I would like them to flash "in sync".

In CtrlTimer, the lowest accessible function is SetTimerCallback, which only takes a delay parameter, I would like an overloaded function which also takes an initial delay parameter, so I could use a modulo of the GetTimeClick() as initial time value.

Current function:
void SetTimeCallback(int delay_ms, Callback cb, void *id) {
	Mutex::Lock __(sTimerLock);
	ASSERT(abs(delay_ms) < 0x40000000);
	LLOG("SetTimeCallback " << delay_ms << " " << id);
	sTimeCallback(GetTickCount() + abs(delay_ms), delay_ms, cb, id);
}

I simply wish for something like:
void SetTimeCallback(int initial_delay_ms, int delay_ms, Callback cb, void *id) {
	Mutex::Lock __(sTimerLock);
	ASSERT(abs(delay_ms) < 0x40000000);
	LLOG("SetTimeCallback " << delay_ms << " " << id);
	sTimeCallback(initial_delay_ms, delay_ms, cb, id);
}

Or should I do it in a completely different way?
 
Read Message
Read Message
Previous Topic: notes about callback
Next Topic: Callback to refresh docked window
Goto Forum:
  


Current Time: Fri Mar 29 09:02:17 CET 2024

Total time taken to generate the page: 0.01244 seconds