Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Wed Nov 22, 2017 7:27 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Sep 01, 2009 9:02 am 
Offline
User avatar

Joined: Thu May 17, 2007 7:09 am
Posts: 47
Location: Cape Cod, MA
Hi,

I am trying to add some functionality to my app where the user can basically disable the display at will. I need to turn off the backlight and blank the screen immediately. I can make this happen fine using the ScreenSaverV2 object and letting it go through its timeout routine; however, if I set the object's state directly to _SS_BacklightOff, it dims the backlight but does not blank out the screen as I would expect it to (and the documentation states it will). Is it possible some other screen event I am trying to do at the same time is interfering with this process? Any help appreciated.

--Rob


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 9:14 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
I just did some experimenting.

Is the BacklightOff property set to 0? If so, this causes some odd behavior. Basically the ScreenSaver sets up a "expected states" table internally. If BacklightOff is zero, then it omits the backlight off state from that table and cannot properly blank the screen (technically, blanking the screen involves simply covering it in black)

This may not be the ideal behavior, but it seems to be what is happening. Try setting your BacklightOff property to non-zero. If you don't ever want the backlight to turn off due to inactivity, try setting it to 0x70000000, which will effectively disable it (unless the unit is idle for about 3500 years).

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 9:31 am 
Offline
User avatar

Joined: Thu May 17, 2007 7:09 am
Posts: 47
Location: Cape Cod, MA
Jeremy,

I assume you meant BacklightOff_time property. That did the trick. I just set it to 1 before changing the state and now it blacks out the screen. I was kind of heading down this path... I had changed LaunchScreenSaver_time to non-zero and witnessed a failed experiment before posting my question.

QSI's support and responsiveness is, as always, awesome.

--Rob


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 9:41 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Yeah, I meant backlight_off time. (I was just setting it in Layout View, rather than in code)

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 9:45 am 
Offline
User avatar

Joined: Thu May 17, 2007 7:09 am
Posts: 47
Location: Cape Cod, MA
Ok, next question. :-) How to I prevent screen touches from reactivating the backlight and unblanking the screen? I have a global variable that holds onto the state of whether I want the screen permanently blanked or not. In the EnterState() function of ScreenSaverV2 I am checking this global and not calling the default handler if the global blank state is set, but this doesn't help. I assume there is some screenpress event I need to capture somewhere, maybe?


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 9:59 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
You *may* be wandering outside of screen saver territory here.

If you want to black out the screen, you could easily enough write this function

Code:
func Blackout()
    SetSystemSetting(sys_backlight, 0, sysact_donow)
    BlankRect.enabled=true 'A black rectangle, that is normally disabled and covers the entire screen
    SendToFront(BlankRect)
endfunc


If you do want to do it through the screen saver, try using the EnterState event in the ScreenSaver

Code:
func EnterState(newState as _SS_States) returns boolean
    if (curState == _SS_BacklightOff) and (newState <> _SS_BacklightOff) then
        return false
    else
        return default (newState)
    endif
endfunc

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Tue Sep 01, 2009 10:31 am 
Offline
User avatar

Joined: Thu May 17, 2007 7:09 am
Posts: 47
Location: Cape Cod, MA
That worked perfect. I had tried that before but was returning true instead of false, and the screen was still unblanking. Thanks again!


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