Ejemplo n.º 1
0
        //===================// Constructor //===================//

        public SecurityKeypad()
        {
            currentStatusText_Line1 = "";
            currentStatusText_Line2 = "";
            currentKeypadStars      = "";
            customButtonCount       = 0;
            customButtonLabels      = new List <string>();
            functionButtonLabels    = new string[4] {
                "", "", "", ""
            };
            customButtonFeedback = new bool[6] {
                false, false, false, false, false, false
            };
            currentArmState = SecurityArmState.Unknown;
        }
Ejemplo n.º 2
0
        /**
         * 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);
            }
        }