Click or drag to resize

C2nLcdb3 Class

Multi-Purpose LCD Keypad providing a 2.0” LCD screen, with 16bit color and a capacitive touch area surrounding the screen that can be configured in the factory as one of several unique products.

This class will trigger BaseEvent and SystemChange events.

Inheritance Hierarchy

Namespace: Crestron.SimplSharpPro.Keypads
Assembly: Crestron.SimplSharpPro.Keypads (in Crestron.SimplSharpPro.Keypads.dll) Version: 2.21.121
Syntax
C#
public sealed class C2nLcdb3 : C2nLcdBXXBaseClass

The C2nLcdb3 type exposes the following members.

Constructors
 NameDescription
Public methodC2nLcdb3(UInt32, CrestronControlSystem) Constructor to generate a new C2nLcdb3 device.
Public methodC2nLcdb3(UInt32, IDeviceBranch) Constructor to generate a new C2nLcdb3 device.
Top
Properties
 NameDescription
Public propertyBacklightControl The Backlight object.

This property will trigger BaseEvent event with C2nLcdBXXBaseClass.


(Inherited from C2nLcdBXXBaseClass)
Public propertyButton Get the collection of the Button objects for this device.
(Inherited from C2nLcdBXXBaseClass)
Public propertyClimateControl The Climate object.

This property will trigger BaseEvent event with C2nLcdBXXBaseClass.


(Inherited from C2nLcdBXXBaseClass)
Public propertyConnectedIpList A property containing the list of the ConnectedIpInformation objects which contain information about the devices that are connected to this IP ID. This property is only valid for an ethernet device. If this is not an ethernet device, then this property will return null. If this is an ethernet device, the list will be non-null. It will be empty if no devices are connected. The order of items in this list is not guaranteed.
(Inherited from GenericDevice)
Public propertyCurrentPageFeedback Property to report the number of the page currently displayed by the device. This property value is a numerical representation of the page currently displayed on the device screen.

This property will trigger BaseEvent event with CurrentPageFeedbackEventId.


(Inherited from C2nLcdBXXBaseClass)
Public propertyCode exampleDescription Get/Set the description of this device.
(Inherited from GenericBase)
Public propertyDesiredPage Property to select the page we want the device to display. This property value is a numerical representation of the page we want the device to display when we pulse the property TriggerPageChange value.
(Inherited from C2nLcdBXXBaseClass)
Public propertyDisposed Property to indicate if the device has been disposed.
(Inherited from GenericDevice)
Public propertyID Property to get the ID of the device.
(Inherited from GenericDevice)
Public propertyIsOnline Property to get the current online state of the device.
(Inherited from GenericDevice)
Public propertyLeft Get the Button object corresponding to the Left button for this device.
(Inherited from C2nLcdBXXBaseClass)
Public propertyLightingSystem The Lighting System object.

This property will trigger SystemChange event with LightingSystem.


(Inherited from C2nLcdBXXBaseClass)
Public propertyMediaControl The Media object.

This property will trigger BaseEvent event with C2nLcdBXXBaseClass.


(Inherited from C2nLcdBXXBaseClass)
Public propertyMiddle Get the Button object corresponding to the Middle button for this device.
(Inherited from C2nLcdBXXBaseClass)
Public propertyName Get the name of this device.
(Inherited from GenericBase)
Public propertyPageChangeInvalidFeedback Property to indicate that page number selected is invalid. This property value becomes 'true' momentarily and again becomes 'false', when TriggerPageChange value is pulsed and an invalid page number input to DesiredPage.

The BaseEvent event will trigger with PageChangeInvalidFeedbackEventId.


(Inherited from C2nLcdBXXBaseClass)
Public propertyParent The parent that a given object was added to.
(Inherited from GenericBase)
Public propertyRegisterable Property to indicate that this device can be registered.
(Inherited from GenericDevice)
Public propertyRegistered Property to get the current registration state of the device.
(Inherited from GenericDevice)
Public propertyRegistrationFailureReason Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice)
Public propertyRight Get the Button object corresponding to the Right button for this device.
(Inherited from C2nLcdBXXBaseClass)
Public propertyScreenSaverActiveFeedback Property to indicate the screen saver active status. This property value will be 'true' while the device’s screen is asleep and 'false' when the screen backlight is lit.

The BaseEvent event will trigger with ScreenSaverActiveFeedbackEventId.


(Inherited from C2nLcdBXXBaseClass)
Public propertyShadingSystem The Shading System object.

This property will trigger SystemChange event with ShadingSystem.


(Inherited from C2nLcdBXXBaseClass)
Protected propertySIMPLDeviceImplementation Internal protected member used for actual device control.
(Inherited from GenericDevice)
Public propertySuspendScreenUpdate Property to suspend the screen update. While 'true', this property will suppress any updates to the device’s screen. This is used at times when there are multiple pieces of information that you want to appear on the screen simultaneously, rather than see them filter in one at a time.
(Inherited from C2nLcdBXXBaseClass)
Public propertySystemSetup The Setup object.

This property will trigger BaseEvent event with C2nLcdBXXBaseClass.


(Inherited from C2nLcdBXXBaseClass)
Public propertyType Property to determine to type of device this is.
(Inherited from GenericDevice)
Public propertyUnRegistrationFailureReason Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice)
Public propertyUserSpecifiedObject Can be assigned anything that user wants.
(Inherited from GenericBase)
Protected propertyXioEndpointStubSIMPLDevice The SIMPL "stub" Device that the XiO Director creates for an endpoint to send the 1C/0E to the correct place in hierarchy.
(Inherited from GenericDevice)
Top
Methods
 NameDescription
Public methodActivateScreenSaver Method to set the screen to go to “sleep”. This is basically forces a timeout. The unit will still wake up under normal circumstances.
(Inherited from C2nLcdBXXBaseClass)
Public methodDispose Clean up of resources.
(Inherited from GenericBase)
Protected methodDispose(Boolean) Method to perform the actual disposing of the device.
(Inherited from GenericDevice)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Destructor of the device.
(Inherited from GenericDevice)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodOnBaseEvent(Int32) Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase)
Protected methodOnBaseEvent(Int32, UInt16) Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase)
Public methodRegister Register this device with the system.
(Inherited from GenericDevice)
Public methodToString Return the name of the device.
(Inherited from GenericDevice)
Public methodUnRegister Unregister this device with the system. This function can not be called from the device's own SigChange event handler.

On successful unregistration, if this device supports the OnlineStatusChange event, it will trigger indicating the device when offline.


(Inherited from GenericDevice)
Top
Events
 NameDescription
Public eventBaseEvent Generic base event, triggered when the there are no other handlers available for a specific EventID.
(Inherited from GenericBase)
Public eventButtonStateChange Event fired when a button state change was received from the device.
(Inherited from C2nLcdBXXBaseClass)
Public eventIpInformationChange Event that tells what IP Address is connected/disconnected from an IP ID for a non-UDP device. This is only valid for an Ethernet device. An exception will be thrown if it is not.
(Inherited from GenericDevice)
Public eventOnlineStatusChange Event triggered when the Online status of the device changes.
(Inherited from GenericDevice)
Top
Example
C#
static C2nLcdB3 _keypad;

   public ControlSystemC2nLcdB3()
   {
       CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a C2N-LCD-B3 International Keypad CreateDevice command", ConsoleAccessLevelEnum.AccessOperator);
   }

   public void CreateDeviceCmd(String args)
   {
       //Initialize the C2N-LCD-B3 device for Cresnet Communication
       _keypad = new C2nLcdb3(0x03, this);

       _keypad.BaseEvent += KeypadEventHandler;
       _keypad.ButtonStateChange += KeypadButtonChange;
       _keypad.LightingSystem.SystemChange += LightingSystem_SystemChange;
       _keypad.ShadingSystem.SystemChange += ShadingSystem_SystemChange;

       // Now setup the keypad
       _keypad.ShadingSystem.NumberOfScenes.UShortValue = 2;
       _keypad.ShadingSystem.Scenes[1].Name.StringValue = "Morning";
       _keypad.ShadingSystem.Scenes[2].Name.StringValue = "Night";
       _keypad.ShadingSystem.NumberOfLightsOrShades.UShortValue = 4;

        CrestronConsole.PrintLine(" Number of shading loads is {0} ", _keypad.ShadingSystem.Loads.Count);
        foreach (C2nLcdBXXBaseClass.Load shadingLoad in _keypad.ShadingSystem.Loads)
        {
            CrestronConsole.PrintLine(" Lighting load number is {0} ", shadingLoad.Number);
            shadingLoad.Name.StringValue = "SL" + shadingLoad.Number;
            shadingLoad.Level.UShortValue = 25;
        }

        _keypad.LightingSystem.NumberOfScenes.UShortValue = 3;
        _keypad.LightingSystem.Scenes[1].Name.StringValue = "Party1";
        _keypad.LightingSystem.Scenes[2].Name.StringValue = "Party2";
        _keypad.LightingSystem.Scenes[3].Name.StringValue = "Party3";
        _keypad.LightingSystem.NumberOfLightsOrShades.UShortValue = 3;

        CrestronConsole.PrintLine(" Number of lighting loads is {0} ", _keypad.LightingSystem.Loads.Count);
        foreach (C2nLcdBXXBaseClass.Load lightingLoad in _keypad.LightingSystem.Loads)
        {
            CrestronConsole.PrintLine(" Lighting load number is {0} ", lightingLoad.Number);
            lightingLoad.Name.StringValue = "LL" + lightingLoad.Number;
            lightingLoad.Level.UShortValue = 125;
        }

        foreach (C2nLcdBXXBaseClass.Load shadingLoad in _keypad.ShadingSystem.Loads)
        {
            CrestronConsole.PrintLine(" Shading load number is {0} ", shadingLoad.Number);
            shadingLoad.Name.StringValue = "SL" + shadingLoad.Number;
            shadingLoad.Level.UShortValue = 25;
        }

       //Register the C2N-LCD-B3 Keypad with the Control system
       _keypad.Register();
   }

   // Method to handle slot sig change events for C2N-LCD-B3 Keypad.
   static void KeypadEventHandler(GenericBase device, BaseEventArgs args)
   {
       if (args.EventId == C2nLcdBXXBaseClass.ScreenSaverActiveFeedbackEventId)
       {
           CrestronConsole.PrintLine("{0} Screen Saver Active Feedback event occurred\r\n", device.ToString());
       }
       else if (args.EventId == C2nLcdBXXBaseClass.PageChangeInvalidFeedbackEventId)
       {
           CrestronConsole.PrintLine("{0} Page Change Invalid Feedback event occurred\r\n", device.ToString());
       }
   }

   // Sig callback for handling C2N-LCD-B3 button events.
   void KeypadButtonChange(GenericBase currentDevice, ButtonEventArgs args)
   {
       for (uint i = 1; i <= _keypad.Button.Count; i++)
       {
           if (args.Button.Number == _keypad.Button[i].Number)
           {
               CrestronConsole.PrintLine("Button{0}'s state is {1}\r\n", i, args.Button.State);
           }
       }
   }

   // Shading system change handler
   void ShadingSystem_SystemChange(object sender, GenericEventArgs args)
   {
       C2nLcdBXXBaseClass.LoadSystem shadingLoad = sender as C2nLcdBXXBaseClass.LoadSystem;
       CrestronConsole.PrintLine(" System change fired for {2} with args eventId {0}:{1} ", args.EventId, args.Index, shadingLoad.ToString());

       switch (args.EventId)
       {
           case C2nLcdBXXBaseClass.RaiseFeedbackEventId:
               CrestronConsole.PrintLine(" Raise feedback fired for shade load {0} and value is {1} and string is {2} ", args.Index, shadingLoad.Loads[args.Index].RaiseFeedback.UShortValue, shadingLoad.Loads[args.Index].ToString());
               break;
           case C2nLcdBXXBaseClass.LowerFeedbackEventId:
               CrestronConsole.PrintLine(" Lower feedback fired for shade load {0} and value is {1}  and string is {2} ", args.Index, shadingLoad.Loads[args.Index].LowerFeedback.UShortValue, shadingLoad.Loads[args.Index].ToString());
              break;
           case C2nLcdBXXBaseClass.LowerRoomFeedbackEventId:
               break;
           case C2nLcdBXXBaseClass.RecallSceneFeedbackEventId:
               CrestronConsole.PrintLine(" Recall scene feedback fired for shade scene {0} and value is {1} and string is {2} ", args.Index, shadingLoad.Scenes[args.Index].RecallFeedback.BoolValue, shadingLoad.Scenes[args.Index].ToString());
               break;
       }
   }

   // Lighting system change handler
   void LightingSystem_SystemChange(object sender, GenericEventArgs args)
   {
       C2nLcdBXXBaseClass.LoadSystem lightingLoad = sender as C2nLcdBXXBaseClass.LoadSystem;
       CrestronConsole.PrintLine(" System change fired for {2} with args eventId {0}:{1} ", args.EventId, args.Index, lightingLoad.ToString());

       switch (args.EventId)
       {
           case C2nLcdBXXBaseClass.RaiseFeedbackEventId:
               CrestronConsole.PrintLine(" Raise feedback fired for light load {0} and value is {1} and string {2} ", args.Index, lightingLoad.Loads[args.Index].RaiseFeedback.UShortValue, lightingLoad.Loads[args.Index]);
               break;
           case C2nLcdBXXBaseClass.LowerFeedbackEventId:
               CrestronConsole.PrintLine(" Lower feedback fired for light load {0} and value is {1} and string is {2} ", args.Index, lightingLoad.Loads[args.Index].LowerFeedback.UShortValue, lightingLoad.Loads[args.Index]);
               break;
           case C2nLcdBXXBaseClass.LowerRoomFeedbackEventId:
               break;
           case C2nLcdBXXBaseClass.RecallSceneFeedbackEventId:
               CrestronConsole.PrintLine(" Recall scene feedback fired for lighting scene {0} and value is {1} and string is {2} ", args.Index, lightingLoad.Scenes[args.Index].RecallFeedback.BoolValue, lightingLoad.Loads[args.Index]);
               break;
           case C2nLcdBXXBaseClass.AmbientLightLevelFeedbackEventId:
               CrestronConsole.PrintLine(" Ambient feedback is {0} ", lightingLoad.AmbientLightLevelFeedback.ToString());
               break;
       }
   }

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also