Hz |
This class will trigger ButtonStateChange and BaseEvent events.
public sealed class HzKpcn : HzKpBase, IHzKpBacklight, IIOPorts
The HzKpcn type exposes the following members.
| Name | Description | |
|---|---|---|
| HzKpcn(UInt32, CrestronControlSystem) | Constructor to generate a new HzKpcn object connected to Control system. | |
| HzKpcn(UInt32, IDeviceBranch) | Constructor to generate a new HzKpcn object on IDeviceBranch. |
| Name | Description | |
|---|---|---|
| BacklightLedSettings |
Backlight LED Settings present on this device.
This property will trigger BaseEvent with event IDs defined in HzKpBase. | |
| Button |
Collection of buttons supported by the device.
(Inherited from KeypadBase) | |
| ConnectedIpList |
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) | |
| Description |
Get/Set the description of this device.
(Inherited from GenericBase) | |
| Disposed |
Property to indicate if the device has been disposed.
(Inherited from GenericDevice) | |
| Feedbacks |
Property to get the collection of feedbacks with on and active indicators on HzKpBase.
(Inherited from HzKpBase) | |
| ID |
Property to get the ID of the device.
(Inherited from GenericDevice) | |
| IsOnline |
Property to get the current online state of the device.
(Inherited from GenericDevice) | |
| LedBacklightEnabledFeedback |
Property to indicate the current LED Backlight status set by the EnableLedBacklight or DisableLedBacklight methods.
true = LEDs enabled, false = LEDs disabled
This property will trigger BaseEvent with event id LedBacklightEnabledEventId. (Inherited from HzKpBase) | |
| Name |
Get the name of this device.
(Inherited from GenericBase) | |
| NumberOfVersiPorts | Number of versiports this device supports. | |
| ParameterActiveFeedbackBlinkRate |
Parameter to define the fade blink rate time between the LED On color and LED Off color.
Value in seconds (units of 0.01 sec precision) for the blink/fade period of the LEDs when they are in active feedback state.
Valid range is from 0.1 to 2 seconds. 1 second is represented as 100.
Default value is 0.75 seconds.
Use the SecondsToUshort(Single) to convert
the seconds to a ushort value or the UshortToSeconds(UInt16) to convert
the ushort value to seconds.
(Inherited from HzKpBase) | |
| ParameterAlternateColorTheme | Parameter to select the color theme that is applied to the particular Button Feedback as set by the corresponding ButtonAlternateFeedback (true = Use Alternate Color Theme; false = Use Local Color Theme). If Custom is chosen, then the corresponding RedOrHue, GreenOrSaturation and BlueOrValue properties will get processed instead of preset internal color themes that match much of the defined 'local' color themes. Refer HzKpBaseeLedAlternateColorTheme enum for valid values. | |
| ParameterCustomColorInputType |
Selects whether the properties in LedDayOnSettings/
LedDayOffSettings/
LedNightOnSettings/
LedNightOffSettings are to be processed as RGB (Red/Green/Blue) or HSV (Hue/Saturation/Value) component values.
Refer HzKpBaseeCustomColorInputType enum for valid values.
(Inherited from HzKpBase) | |
| ParameterDayNightThresholdSetting |
Indicates which internal setting to use when device is automatically configured to switch between day and
night mode based on sensor reading. Default (0) indicates it uses either the factory default threshold
setting or the manually calibrated setting if it was saved at least once. Other preset selections are
estimated values based on a typical room brightness setting.
Valid values are from 0 to 5.
Refer HzKpBaseeDayNightThresholdSetting enum for valid values.
(Inherited from HzKpBase) | |
| ParameterDoubleTapSpeed |
Returns and sets the time between the end of the first tap and the start of the second tap for a
"DoubleTap" to be recognized.
Use the SecondsToUshort(Single) to convert
the seconds to a ushort value or the UshortToSeconds(UInt16) to convert
the ushort value to seconds.
Valid range is from 0.2 seconds to 1.0 seconds. 1 second is represented as 100.
(Inherited from HzKpBase) | |
| ParameterFakeFeedback |
Parameter to set and get the Fake Feedback state.
When set to true, the LED corresponding to button will fade blink between On LED color and Off LED color
at the ParameterActiveFeedbackBlinkRate time, for a minimum of 2 sec, until the
State or Active property value is initialized to
some other state.
(Inherited from HzKpBase) | |
| ParameterHoldTime |
Time value in seconds. A press longer than this value triggers a Hold event. A press shorter than this
value triggers a Tap or DoubleTap event.
Use the SecondsToUshort(Single) to convert
the seconds to a ushort value or the UshortToSeconds(UInt16) to convert
the ushort value to seconds.
Valid range is from 0.2 seconds to 1.0 seconds. 1 second is represented as 100.
(Inherited from HzKpBase) | |
| ParameterIsLargeRockerButtonInstalled |
Returns and sets the setting that tells the keypad if a large rocker button is installed
false – LEDs on row 2 and 4 are enabled
true – LEDs on row 2 and 4 are disabled
This parameter requires device firmware version 2.000.0050 or greater (Inherited from HzKpBase) | |
| ParameterWaitForDoubleTap |
Returns and sets the setting that determines whether a "Tap" should be sent immediately.
false – Tap is reported at the end of every short press, DoubleTap is reported at the end of the second short press.
true – Tap reporting is postponed to see if a second tap comes in. In this case only DoubleTap is reported.
(Inherited from HzKpBase) | |
| Parent |
The parent that a given object was added to.
(Inherited from GenericBase) | |
| Registerable |
Property to indicate that this device can be registered.
(Inherited from GenericDevice) | |
| Registered |
Property to get the current registration state of the device.
(Inherited from GenericDevice) | |
| RegistrationFailureReason |
Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice) | |
| SIMPLDeviceImplementation |
Internal protected member used for actual device control.
(Inherited from GenericDevice) | |
| Type |
Property to determine to type of device this is.
(Inherited from GenericDevice) | |
| UnRegistrationFailureReason |
Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice) | |
| UserSpecifiedObject |
Can be assigned anything that user wants.
(Inherited from GenericBase) | |
| VersiPorts | Collection of versiports on the control system. | |
| XioEndpointStubSIMPLDevice |
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) |
| Name | Description | |
|---|---|---|
| DisableLedBacklight |
Method to disable all LED functionality and keeps them off.
(Inherited from HzKpBase) | |
| Dispose |
Clean up of resources.
(Inherited from GenericBase) | |
| Dispose(Boolean) |
Method to perform the actual disposing of the device.
(Inherited from GenericDevice) | |
| EnableLedBacklight |
Method to enable all LED normal functionality for all operating modes.
(Inherited from HzKpBase) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize |
Destructor of the device.
(Inherited from GenericDevice) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| OnBaseEvent(Int32) |
Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase) | |
| OnBaseEvent(Int32, UInt16) |
Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase) | |
| Register |
Register this device with the system.
(Inherited from GenericDevice) | |
| SendParameters |
This will send the parameters fields (if any) to the device. It allows the parameters to be modified and resent without unregistering and re-registering
a device.
(Inherited from HzKpBase) | |
| ToString |
Return the name of the device.
(Inherited from GenericDevice) | |
| UnRegister |
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) |
| Name | Description | |
|---|---|---|
| BaseEvent |
Generic base event, triggered when the there are no other handlers available
for a specific EventID.
(Inherited from GenericBase) | |
| ButtonStateChange |
Event fired when a button state change was received from the device.
(Inherited from KeypadBase) | |
| IpInformationChange |
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) | |
| OnlineStatusChange |
Event triggered when the Online status of the device changes.
(Inherited from GenericDevice) |
| Name | Description | |
|---|---|---|
| _Buttons |
Collection that contains button objects.
(Inherited from KeypadBase) |
using System; using Crestron.SimplSharp; // For Basic SIMPL# Classes using Crestron.SimplSharpPro; // For Basic SIMPL#Pro classes using Crestron.SimplSharpPro.CrestronThread; // For Threading using Crestron.SimplSharpPro.DeviceSupport; // For Generic Device Support using Crestron.SimplSharpPro.Keypads; namespace HzKpcnSSPProgram { public class ControlSystemHzKpcn : CrestronControlSystem { static HzKpcn _hzKpcn; // Constructor of the Control System Class. Make sure the constructor always exists. // If it doesn't exit, the code will not run on your 3-Series processor. public ControlSystemHzKpcn() { CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "HZ-KPCN CreateDevice Command", ConsoleAccessLevelEnum.AccessProgrammer); CrestronConsole.AddNewConsoleCommand(EnableDayTimeCmd, "EnableDayTime", "HZ-KPCN EnableDayTime Command", ConsoleAccessLevelEnum.AccessProgrammer); CrestronConsole.AddNewConsoleCommand(EnableNightTimeCmd, "EnableNightTime", "HZ-KPCN EnableNightTime Command", ConsoleAccessLevelEnum.AccessProgrammer); CrestronConsole.AddNewConsoleCommand(EnableManualDayNightTimeCmd, "EnableManDayNightTime", "HZ-KPCN EnableManualDayNightTime Command", ConsoleAccessLevelEnum.AccessProgrammer); CrestronConsole.AddNewConsoleCommand(SetActiveFeedbackCmd, "SetActiveFeedback", "HZ-KPCN SetActiveFeedback Command", ConsoleAccessLevelEnum.AccessProgrammer); } //Method to enable/disable the active feedback public void SetActiveFeedbackCmd(string args) { var str = args.Split(' '); _hzKpcn.Feedbacks[Convert.ToUInt16(str[0])].Active.BoolValue = Convert.ToBoolean(str[1]); } //Method to handle the button state change events public void HzKpcnButtonStateChange(GenericBase device, ButtonEventArgs args) { CrestronConsole.PrintLine("Button{0} name is {1} state is {2} horiz loc {3} vert loc {4}", args.Button.Number, args.Button.Name, args.Button.State, args.Button.HorizontalLocation, args.Button.VerticalLocation); //To determine Horizon V1 button events based on Button.Number use the following values if (args.Button.Number == 1) CrestronConsole.PrintLine("Button #1 Left Event"); else if (args.Button.Number == 2) CrestronConsole.PrintLine("Button #1 Center Event"); else if (args.Button.Number == 3) CrestronConsole.PrintLine("Button #1 Right Event"); else if (args.Button.Number == 4) CrestronConsole.PrintLine("Button #2 Left Event"); else if (args.Button.Number == 5) CrestronConsole.PrintLine("Button #2 Center Event"); else if (args.Button.Number == 6) CrestronConsole.PrintLine("Button #2 Right Event"); else if (args.Button.Number == 7) CrestronConsole.PrintLine("Button #3 Left Event"); else if (args.Button.Number == 8) CrestronConsole.PrintLine("Button #3 Center Event"); else if (args.Button.Number == 9) CrestronConsole.PrintLine("Button #3 Right Event"); else if (args.Button.Number == 10) CrestronConsole.PrintLine("Button #4 Left Event"); else if (args.Button.Number == 11) CrestronConsole.PrintLine("Button #4 Center Event"); else if (args.Button.Number == 12) CrestronConsole.PrintLine("Button #4 Right Event"); else if (args.Button.Number == 13) CrestronConsole.PrintLine("Button #5 Left Event"); else if (args.Button.Number == 14) CrestronConsole.PrintLine("Button #5 Center Event"); else if (args.Button.Number == 15) CrestronConsole.PrintLine("Button #5 Right Event"); } //Method to create the device object for HZ-KPCN public void CreateDeviceCmd(string args) { try { _hzKpcn = new HzKpcn(0x25, this); Thread.MaxNumberOfUserThreads = 20; _hzKpcn.ButtonStateChange += HzKpcnButtonStateChange; _hzKpcn.BaseEvent += HzKpcnBacklightLedSettingsChange; _hzKpcn.VersiPorts[1].VersiportChange += HzKpcnVersiportStateChange_EventHandler; _hzKpcn.VersiPorts[2].VersiportChange += HzKpcnVersiportStateChange_EventHandler; _hzKpcn.VersiPorts[1].SetVersiportConfiguration(eVersiportConfiguration.DigitalInput); _hzKpcn.VersiPorts[1].DisablePullUpResistor = false; _hzKpcn.VersiPorts[2].SetVersiportConfiguration(eVersiportConfiguration.DigitalInput); _hzKpcn.VersiPorts[2].DisablePullUpResistor = true; //Register HZ-KPCN if (_hzKpcn.Register() != eDeviceRegistrationUnRegistrationResponse.Success) ErrorLog.Error("Error Registering the HZ-KPCN at {0}: {1}", _hzKpcn.ID, _hzKpcn.RegistrationFailureReason); } catch (Exception e) { ErrorLog.Error("Error in the constructor: {0}", e.Message); } } //Method to handle the Backlight LED Setting slot sig change events static void HzKpcnBacklightLedSettingsChange(GenericBase device, BaseEventArgs args) { if (args.EventId == HzKpcn.InDayTimeEventId) { CrestronConsole.PrintLine("In Day Time Feedback Event received, state is {0}", ((HzKpcn)device).BacklightLedSettings.InDayTimeFeedback.BoolValue); } } // Sig callback for handling HZ-KPCN Versiport State change events. static void HzKpcnVersiportStateChange_EventHandler(Versiport vport, VersiportEventArgs args) { switch (args.Event) { case eVersiportEvent.AnalogInChange: CrestronConsole.Print("AnalogInChange event for Versiport{0} received, State is {1}\r\n", vport.ID, vport.DigitalIn); break; case eVersiportEvent.DigitalInChange: CrestronConsole.Print("DigitalInChange event for Versiport{0} received, Value is {1}\r\n", vport.ID, vport.AnalogIn); break; } } //Method to enable the DayTime Mode public void EnableDayTimeCmd(string args) { _hzKpcn.BacklightLedSettings.EnableDayTime(); } //Method to enable the NightTime Mode public void EnableNightTimeCmd(string args) { _hzKpcn.BacklightLedSettings.EnableNightTime(); } //Method to enable the Manual Day Night Time Mode public void EnableManualDayNightTimeCmd(string args) { _hzKpcn.BacklightLedSettings.EnableManualDayNightTime.BoolValue = Convert.ToBoolean(args); } } }