How to receive BacklightTurnedOff event

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
MarkTX
Posts: 9
Joined: Fri Dec 30, 2011 11:03 am

How to receive BacklightTurnedOff event

Post by MarkTX »

Hello,
I am using a Qterm A12 panel in an outdoor environment.

When the internal temperature rises above a threshold, I want to programmatically enable the screensaver, so that the backlight will turn off after 3 minutes of non-activity. This code does that, so far, so good:

// Set backlight timeout to 180 seconds
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetBacklightTimout(180);

// Set backlight to automatically turn off Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(true);

Then, when the internal temperature drops below another threshold, I want to programmatically turn the backlight back on and disable the screen saver. This code does that, so far, so good:

// Turn on backilight.
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().TurnBacklightOn();

// Turn off screen saver
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(false);

The problem I have is that when the screen is dark and the user touches it, if the user presses an area of the screen that has a button, the button action will be performed. Which was not intended, or a good thing.

To me, the soultion would be to subscribe to the public BacklightTurnedOff event, and handle accordingly, but my event handler never fires:

// Subscribe to event
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().BacklightTurnedOff += new EventHandler(BacklightOffEvent);

// Event handler.... this never fires
void BacklightOffEvent (object sender, EventArgs myEventArgs)
{
// Go to a blank or buttonless screen, that when pressed, returns to the
// previous screen (which was the active screen when the backlight turned off).
Globals.Logo_Screen.Show();
}

How can I receive the BacklightTurnedOff event? Or how, in some other way, achieve my goal that no accidental button actions be performed?

Thanks

User avatar
Russ C.
Posts: 213
Joined: Thu Nov 16, 2017 3:32 pm
Contact:

Re: How to receive BacklightTurnedOff event

Post by Russ C. »

We tested the code you posted, and it appears to work in iX 2.40 SP4, it will trigger the <Screen>.Show(); event
Best regards,

Russ
(801) 708-6690
Technical Support
Contact Us

Beijer Electronics AB
http://www.beijerelectronics.us

MarkTX
Posts: 9
Joined: Fri Dec 30, 2011 11:03 am

Re: How to receive BacklightTurnedOff event

Post by MarkTX »

We have several X2E-12HPs in our lab and are able to verify that the BacklightTurnedOff event does indeed now work as expected. Even better, our tests revealed that the touch screen now exhibits what I would call the correct behavior - onscreen buttons no longer generate click events if the screen is touched to reactivate the back light. The BacklightTurnedOff event is no longer needed for this case! Very nice all the same. Thanks for your reply.

Post Reply