当前位置: 首页>>代码示例>>C#>>正文


C# ZWaveNode.RaiseUpdateParameterEvent方法代码示例

本文整理汇总了C#中ZWaveNode.RaiseUpdateParameterEvent方法的典型用法代码示例。如果您正苦于以下问题:C# ZWaveNode.RaiseUpdateParameterEvent方法的具体用法?C# ZWaveNode.RaiseUpdateParameterEvent怎么用?C# ZWaveNode.RaiseUpdateParameterEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZWaveNode的用法示例。


在下文中一共展示了ZWaveNode.RaiseUpdateParameterEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetNodeHost

 public void SetNodeHost(ZWaveNode node)
 {
     nodeHost = node;
     nodeHost.RaiseUpdateParameterEvent(nodeHost, 0, ParameterType.PARAMETER_WATTS, 0);
 }
开发者ID:jarrettv,项目名称:HomeGenie,代码行数:5,代码来源:Meter.cs

示例2: GetEvent

        public static ZWaveEvent GetEvent(ZWaveNode node, byte[] message)
        {
            ZWaveEvent nodeEvent = null;

            byte cmdClass = message[7];
            byte cmdType = message[8];
            byte instanceCmdClass = message[9];

            switch (cmdType)
            {
            case (byte)Command.MultiInstanceReport:
            case (byte)Command.MultiInstaceV2Encapsulated:

                byte[] instanceMessage;
                byte instanceNumber = message[9];

                // if it's a COMMAND_MULTIINSTANCEV2_ENCAP we shift key and val +1 byte
                if (cmdType == (byte)Command.MultiInstaceV2Encapsulated)
                {
                    instanceCmdClass = message[11];
                    instanceMessage = new byte[message.Length - 4];
                    System.Array.Copy(message, 4, instanceMessage, 0, message.Length - 4);
                }
                else
                {
                    instanceCmdClass = message[10];
                    instanceMessage = new byte[message.Length - 3];
                    System.Array.Copy(message, 3, instanceMessage, 0, message.Length - 3);
                }

                switch (instanceCmdClass)
                {
                case (byte)CommandClass.Basic:
                    nodeEvent = Basic.GetEvent(node, instanceMessage);
                    break;
                case (byte)CommandClass.Alarm:
                    nodeEvent = Alarm.GetEvent(node, instanceMessage);
                    break;
                case (byte)CommandClass.SensorAlarm:
                    nodeEvent = SensorAlarm.GetEvent(node, instanceMessage);
                    break;
                case (byte)CommandClass.SceneActivation:
                    nodeEvent = SceneActivation.GetEvent(node, instanceMessage);
                    break;
                case (byte)CommandClass.SwitchBinary:
                    nodeEvent = SwitchBinary.GetEvent(node, instanceMessage);
                    if (nodeEvent != null)
                    {
                        node.RaiseUpdateParameterEvent(instanceNumber, EventParameter.MultiinstanceSwitchBinary, nodeEvent.Value);
                    }
                    break;
                case (byte)CommandClass.SwitchMultilevel:
                    nodeEvent = SwitchMultilevel.GetEvent(node, instanceMessage);
                    if (nodeEvent != null)
                    {
                        node.RaiseUpdateParameterEvent(instanceNumber, EventParameter.MultiinstanceSwitchMultilevel, nodeEvent.Value);
                    }
                    break;
                case (byte)CommandClass.SensorBinary:
                    nodeEvent = SensorBinary.GetEvent(node, instanceMessage);
                    if (nodeEvent != null)
                    {
                        node.RaiseUpdateParameterEvent(instanceNumber, EventParameter.MultiinstanceSensorBinary, nodeEvent.Value);
                    }
                    break;
                case (byte)CommandClass.SensorMultilevel:
                    nodeEvent = SensorMultilevel.GetEvent(node, instanceMessage);
                    if (nodeEvent != null)
                    {
                        node.RaiseUpdateParameterEvent(instanceNumber, EventParameter.MultiinstanceSensorMultilevel, nodeEvent.Value);
                    }
                    break;
                case (byte)CommandClass.Meter:
                    nodeEvent = Meter.GetEvent(node, instanceMessage);
                    break;
                }

                if (nodeEvent != null)
                {
                    nodeEvent.Instance = (int)message[9];
                }

                break;

            case (byte)Command.MultiInstanceCountReport:
                byte instanceCount = message[10];
                switch (instanceCmdClass)
                {
                case (byte)CommandClass.SwitchBinary:
                    nodeEvent = new ZWaveEvent(node, EventParameter.MultiinstanceSwitchBinaryCount, instanceCount, 0);
                    break;
                case (byte)CommandClass.SwitchMultilevel:
                    nodeEvent = new ZWaveEvent(node, EventParameter.MultiinstanceSwitchMultilevelCount, instanceCount, 0);
                    break;
                case (byte)CommandClass.SensorBinary:
                    nodeEvent = new ZWaveEvent(node, EventParameter.MultiinstanceSensorBinaryCount, instanceCount, 0);
                    break;
                case (byte)CommandClass.SensorMultilevel:
                    nodeEvent = new ZWaveEvent(node, EventParameter.MultiinstanceSensorMultilevelCount, instanceCount, 0);
                    break;
//.........这里部分代码省略.........
开发者ID:RichCattell,项目名称:HomeGenie,代码行数:101,代码来源:MultiInstance.cs


注:本文中的ZWaveNode.RaiseUpdateParameterEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。