Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sun Nov 19, 2017 8:49 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jul 23, 2009 11:59 am 
Offline

Joined: Sun Nov 09, 2008 7:01 pm
Posts: 21
Hi,

I would like to know the most efficient way to update a number of screen Label V2 objects.

For example, in my application I have a label with white text on a blue background. 500 ms later I then want to show the same text but with a black label background. The label would keep alternating between the two states. For the least amount of internal processing for this, is it better to have two objects on top of each other (one for each visual state), and then enable and disable the top most object at 500 ms to therefore reveal the object below it, or should I just have one object and change the "bgcolor" property each time?

The first method obviously has the disadvantage of having two objects created when only one is really needed, but each would theoretically already be in their proper state without rendering. The second method only has one object but I assume it needs to be re-rendered with each property change.

I mention all of this because I have a lot of other data processing going on and would like to know which of the above two methods is actually best. I am not sure if having two objects would really make enough of a difference to warrant their use over just one object and changing its properties. Also, depending on what is going on, I have 4 other labels that might need to flash this way, although only 1 flashing label would be on screen at a time.

By the way, I forgot to mention that although it is possible to provide a "blink period" property for a label, I actually need to sync the flashing label with a visible clock that I have in another label. If I use a built-in blink period then over the course of a few seconds the blink rate looks slightly off from the incrementing seconds of the time I am displaying. By using one of the above two methods I can keep the blink rate in perfect sync with the incrementing seconds.

Thanks!

BBlair


Top
 Profile  
 
PostPosted: Thu Jul 23, 2009 12:09 pm 
Offline

Joined: Sun Nov 09, 2008 7:01 pm
Posts: 21
Just for further "Qlarity" (!), the time I am displaying is not generated by the G58 itself, (otherwise why would it's "seconds" display be out of sync with a label's "blinkperiod" that is all obviously generated by the G58?). My timing is coming through Ethernet and from another device which, due to it's update rates can vary by a few ms occasionally before getting back in sync. I therefore want to always "flash" the label(s) at this time from the external source, and not the G58's, otherwise I could just use the "blinkperiod".

Again though, my real question is whether it is more efficient from a processing standpoint to have two or more objects layered on top of each other and then just enable or disable them, or have just one object and keep altering its properties.

Again, thanks.

BBlair.


Top
 Profile  
 
PostPosted: Thu Jul 23, 2009 1:38 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Assuming you have draw caching enabled (the default), AND you are not modifying ANY label properties other than the enabled property, two labels would probably be faster. However the difference would be extremely minor for most labels. In any other case, a single label will probably be faster.

Regardless of which is faster, the difference is probably negligible (and frankly if your application is so busy it is struggling to keep up with a label update every 500 ms, there are other areas that are in much greater need of optimization than a label update).

If you really want to get the most out of your labels, you might consider using the old LabelLite object (Ctrl+L->[Add Existing Library]->[x] "Show legacy Libraries" -> EnhancedText.lib).

That label is about as fast as you can write a label object in Qlarity. (and missing a lot of the features that make the labelV2 nice to work with).

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Thu Jul 23, 2009 1:43 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Here's some links to some topics on Qlarity program optimization that might be useful.

Why did my program lock up or not update as expected?
viewtopic.php?f=4&t=164

BDF fonts vs. TTF fonts
viewtopic.php?f=4&t=422

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Fri Jul 24, 2009 7:59 am 
Offline

Joined: Sun Nov 09, 2008 7:01 pm
Posts: 21
Thanks guys.

BBlair


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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