Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 6:01 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Sep 22, 2006 2:22 pm 
Offline

Joined: Mon Sep 18, 2006 12:20 pm
Posts: 60
My project contains several Timers to do various different things. I have a some periodic timers and some oneshot ones that I reenable when needed at execution time. My application was working well until...In an effort to organize my code better, I made a container object to "hold" all my Timer objects. This did not cause any problem with the periodic timer that is enabled by default at startup. The oneshot timers now don't seem to work when I enable them. If I drag the timer back to the Global area, it fixes it.



JIC, I made sure the object holder is enabled but that didn't help.



Am I missing something about the object parent/child relationship that would cause this to happen.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 22, 2006 3:13 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
I went ahead and created a quick workspace according to your description. You can download it here: www.qsiforums.com/files/timerdemo.qly



Everything worked for me as expected. Can you look at it and see if I had the general structure right? FYI, timers 1 and 2 are periodic. Timers 3 and 4 are one shot. Timer 1 and 3 are initially enabled. Timer 2 and 4 are initially disabled. All timers are children of Screen_2



Ron here had an idea: If you are using the _ShowScreen function to switch screens, it may be disabling your holder screen. You might try to verify that the holder screen is actually enabled at the time that you are missing the time ticks. If that is the case, we can work around it. Please let me know your findings.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 7:17 am 
Offline

Joined: Mon Sep 18, 2006 12:20 pm
Posts: 60
Yup, that was the case, the _ShowScreen was disabling it.

So in my ObjectHolder, I made the enabled validation function only set enabled=true vs enabled=newvalue. Don't know if this is the best solution but it works now.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 7:27 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Actually, that is pretty clever. The initial workaround I had in mind was a lot more complex. (Assuming you never want to disable this screen, which it sounds like you don't). Your solution is good and I cannot off the top of my head see any problems with it.



Actually there is another simple workaround -- _ShowScreen should only disable sibling objects (e.g. two screens at the global level are siblings) if their screen rectangles intersect. In other words, _ShowScreen attempts to disable other screens which would obscure the one you are trying to show, but won't disable ones that won't. So simply moving the holder screen to some obscure location like -10000, -10000 should solve the problem as well. I guess I am already in the habit of doing this, so I haven't really had a lot of problem with _ShowScreen and holder type screens (which is why I didn't recognize the problem immediately).

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group