public void OnControllerEvent(ControllerEventArgs e) { if (ControllerEvent != null) { ControllerEvent(this, e); } }
/* class USBDeviceInfo { public USBDeviceInfo(string deviceID, string pnpDeviceID, string description) { this.DeviceID = deviceID; this.PnpDeviceID = pnpDeviceID; this.Description = description; } public string DeviceID { get; private set; } public string PnpDeviceID { get; private set; } public string Description { get; private set; } } */ // fired either at startup time and after a new z-wave node has been added to the controller private void DiscoveryEvent(object sender, ControllerEventArgs e) { switch (e.Status) { case ControllerStatus.DiscoveryStart: RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Discovery Started" }); break; case ControllerStatus.DiscoveryEnd: RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Discovery Complete" }); if (InterfaceModulesChangedAction != null) InterfaceModulesChangedAction(new InterfaceModulesChangedAction(){ Domain = this.Domain }); break; case ControllerStatus.NodeAdded: RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Added node " + e.NodeId }); lastAddedNode = e.NodeId; if (InterfaceModulesChangedAction != null) InterfaceModulesChangedAction(new InterfaceModulesChangedAction(){ Domain = this.Domain }); break; case ControllerStatus.NodeUpdated: RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Updated node " + e.NodeId }); //if (InterfaceModulesChangedAction != null) InterfaceModulesChangedAction(new InterfaceModulesChangedAction(){ Domain = this.Domain }); break; case ControllerStatus.NodeRemoved: lastRemovedNode = e.NodeId; RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Removed node " + e.NodeId }); if (InterfaceModulesChangedAction != null) InterfaceModulesChangedAction(new InterfaceModulesChangedAction(){ Domain = this.Domain }); break; case ControllerStatus.NodeError: RaisePropertyChanged(new InterfacePropertyChangedAction() { Domain = this.Domain, SourceId = "1", SourceType = "Z-Wave Controller", Path = "Controller.Status", Value = "Node " + e.NodeId + " response timeout!" }); break; } }