Dmps3SystemControlFrontPanelBrightness Method |
Sets the front panel brightness to the specified setting.
Namespace: Crestron.SimplSharpPro.DMAssembly: SimplSharpPro (in SimplSharpPro.dll) Version: 2.21.121
Syntaxpublic void FrontPanelBrightness(
eDmSystemFrontPanelBrightness brightnessSetting
)
Parameters
- brightnessSetting eDmSystemFrontPanelBrightness
- Indicates the brightness setting for the front panel
Exceptions
Example
The following will show how to adjust the front panel brightness of the DMPS and read the feedback of the current setting.
public class Dmps3System : CrestronControlSystem
{
private CTimer _brightnessCycleTimer;
private Dmps3SystemControl _dmps3SystemControl;
public override void InitializeSystem()
{
base.InitializeSystem();
if (SystemControl == null)
{
ErrorLog.Error("Application requires to be apart of a DMPS system.");
return;
}
if (SystemControl.SystemControlType == eSystemControlType.Dmps3SystemControl)
_dmps3SystemControl = SystemControl as Dmps3SystemControl;
else
{
ErrorLog.Error("Incorrect Dmps3 system for this application.");
return;
}
_brightnessCycleTimer = new CTimer(BrightnessCycleTimerMethod, null, 5000, 5000);
DMSystemChange += Dmps3System_DMSystemChange;
CrestronEnvironment.ProgramStatusEventHandler += ProgramStatusChange;
}
void Dmps3System_DMSystemChange(Switch device, DMSystemEventArgs args)
{
switch (args.EventId)
{
case(DMSystemEventIds.FrontPanelBrightnessHighEventId):
if (_dmps3SystemControl.FrontPanelBrightnessHighFeedBack.BoolValue)
CrestronConsole.PrintLine("Front panel brightness is set to high.");
break;
case(DMSystemEventIds.FrontPanelBrightnessLowEventId):
if (_dmps3SystemControl.FrontPanelBrightnessLowFeedBack.BoolValue)
CrestronConsole.PrintLine("Front panel brightness is set to low.");
break;
case(DMSystemEventIds.FrontPanelBrightnessMediumEventId):
if (_dmps3SystemControl.FrontPanelBrightnessMediumFeedBack.BoolValue)
CrestronConsole.PrintLine("Front panel brightness is set to medium.");
break;
}
}
private void ProgramStatusChange(eProgramStatusEventType programEventType)
{
if (programEventType == eProgramStatusEventType.Stopping)
_brightnessCycleTimer.Dispose();
}
private eDmSystemFrontPanelBrightness _nextBrightnessSetting = eDmSystemFrontPanelBrightness.High;
private void BrightnessCycleTimerMethod(object userSpecificObject)
{
switch (_nextBrightnessSetting)
{
case eDmSystemFrontPanelBrightness.Low:
case eDmSystemFrontPanelBrightness.Medium:
_nextBrightnessSetting++;
break;
case eDmSystemFrontPanelBrightness.High:
_nextBrightnessSetting = eDmSystemFrontPanelBrightness.Low;
break;
default:
throw new ArgumentOutOfRangeException();
}
_dmps3SystemControl.FrontPanelBrightness(_nextBrightnessSetting);
}
}Version Information
.NET
Supported in: 6.0
.NET Compact Framework
Supported in: 3.5
See Also