/** * Method: TextFeedbackEvent * Access: public * Description: Receive hardware status text feedback from S+, store in variable, and push value to subscribed Interfaces via event */ public void TextFeedbackEvent(ushort _action, string _txt) { SecurityCommand act = (SecurityCommand)_action; switch (act) { case SecurityCommand.Text_StatusFeedback_Line1: currentStatusText_Line1 = _txt; break; case SecurityCommand.Text_StatusFeedback_Line2: currentStatusText_Line2 = _txt; break; case SecurityCommand.Text_KeypadStars: currentKeypadStars = _txt; break; } if (TextUpdateEvent != null) { TextUpdateEvent(act, _txt); } }
// Function to send Custom Button labels to Interfaces // Function to send Function Button labels to Interfaces /** * Method: SendSecurityCommand * Access: public * Description: Receive Commands from Interfaces and pass to S+ via TriggerSendCommand delegate */ public void SendSecurityCommand(SecurityCommand _cmd, ushort _state) { if (TriggerSendCommand != null) { TriggerSendCommand((ushort)_cmd, _state); } }
/** * Method: FeedbackEvent * Access: public * Description: Receive hardware feedback from S+, store in variable, and push value to subscribed Interfaces via event */ public void FeedbackEvent(ushort _action, ushort _state) { SecurityCommand act = (SecurityCommand)_action; switch (act) { case SecurityCommand.ArmAway_Fb: if (_state == 1) { currentArmState = SecurityArmState.ArmAway; } break; case SecurityCommand.ArmHome_Fb: if (_state == 1) { currentArmState = SecurityArmState.ArmHome; } break; case SecurityCommand.ArmNight_Fb: if (_state == 1) { currentArmState = SecurityArmState.ArmNight; } break; case SecurityCommand.Disarm_Fb: if (_state == 1) { currentArmState = SecurityArmState.Disarmed; } break; case SecurityCommand.Custom_01_Fb: customButtonFeedback[0] = _state == 1 ? true : false; break; case SecurityCommand.Custom_02_Fb: customButtonFeedback[1] = _state == 1 ? true : false; break; case SecurityCommand.Custom_03_Fb: customButtonFeedback[2] = _state == 1 ? true : false; break; case SecurityCommand.Custom_04_Fb: customButtonFeedback[3] = _state == 1 ? true : false; break; case SecurityCommand.Custom_05_Fb: customButtonFeedback[4] = _state == 1 ? true : false; break; case SecurityCommand.Custom_06_Fb: customButtonFeedback[5] = _state == 1 ? true : false; break; } // Broadcast to UpdateEvent subscribers if (this.UpdateEvent != null) { UpdateEvent(act, _state); } }