Esempio n. 1
0
        private void minMaxToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAdjustAlarm f = new frmAdjustAlarm();

            f.ShowDialog();
            if (f.IsSave == "Y")
            {
                al = new AlarmValue();;
                LoadData();
            }
        }
        public NodeEvent GetEvent(ZWaveNode node, byte[] message)
        {
            NodeEvent nodeEvent = null;
            byte      cmdType   = message[1];

            if (cmdType == (byte)Command.SensorAlarmReport)
            {
                var alarm = AlarmValue.Parse(message);
                nodeEvent = new NodeEvent(node, alarm.EventType, alarm.Value, 0);
            }
            return(nodeEvent);
        }
Esempio n. 3
0
        public virtual bool HandleBasicReport(byte[] message)
        {
            bool handled = false;
            //
            //byte cmdLength = message[6];
            byte cmdClass = message[7];
            byte cmdType  = message[8];

            //
            if (cmdClass == (byte)CommandClass.Basic && (cmdType == (byte)Command.BasicReport || cmdType == (byte)Command.BasicSet))
            {
                nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, ParameterType.LEVEL, (double)message[9]);
                handled = true;
            }
            else if (cmdClass == (byte)CommandClass.SceneActivation && cmdType == (byte)Command.SceneActivationSet)
            {
                nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, ParameterType.GENERIC, (double)message[9]);
                handled = true;
            }
            else if (cmdClass == (byte)CommandClass.SensorBinary && cmdType == (byte)Command.SensorBinaryReport)
            {
                nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, ParameterType.GENERIC, message[9]);
                handled = true;
            }
            else if (cmdClass == (byte)CommandClass.SensorMultilevel && cmdType == (byte)Command.SensorMultilevelReport)
            {
                var sensor = SensorValue.Parse(message);
                if (sensor.Parameter == ZWaveSensorParameter.UNKNOWN)
                {
                    byte key = message[9];
                    nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, ParameterType.GENERIC, sensor.Value);
                    Console.WriteLine("\nUNHANDLED SENSOR PARAMETER TYPE => " + key + "\n");
                }
                else
                {
                    nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, sensor.EventType, sensor.Value);
                    handled = true;
                }
            }
            else if ((cmdClass == (byte)CommandClass.SensorAlarm && cmdType == (byte)Command.SensorAlarmReport) || (cmdClass == (byte)CommandClass.Alarm && cmdType == (byte)Command.AlarmReport))
            {
                var alarm = AlarmValue.Parse(message);
                nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, alarm.EventType, alarm.Value);
                handled = true;
            }
            return(handled);
        }
Esempio n. 4
0
 private void frmMonitor_Load(object sender, EventArgs e)
 {
     SetTextColor();
     al = new AlarmValue();
     LoadData();
 }