示例#1
0
 public ProcessRunning ProcessRunning()
 {
     ZWave.Log("WCFService", "ProcessRunning");
     return(new ProcessRunning()
     {
         IsRunning = managedProcess.IsProcessRunning(), Process = managedProcess.CurrentProcessName(), Arguments = managedProcess.CurrentProcessArguments()
     });
 }
示例#2
0
        public Boolean NodePollingOff(string NodeID, string Value)
        {
            byte nodeID;

            ZWave.Log("WCFService", "NodePollngOn");
            if (byte.TryParse(NodeID, out nodeID))
            {
                zwaveControl.DisablePoll(nodeID, Value);
                return(true);
            }
            return(false);
        }
示例#3
0
        public Boolean NodeLocation(string NodeID, String Value)
        {
            byte nodeID;

            ZWave.Log("WCFService", "NodeLocation:" + NodeID + "," + Value);
            if (byte.TryParse(NodeID, out nodeID))
            {
                zwaveControl.SetNodeLocation(nodeID, Value);
                return(true);
            }
            return(false);
        }
示例#4
0
        public Boolean NodeBasic(string NodeID, string Value)
        {
            byte nodeID, value;

            ZWave.Log("WCFService", "NodeBasic");
            if (byte.TryParse(NodeID, out nodeID) && byte.TryParse(Value, out value))
            {
                zwaveControl.SetNodeBasic(nodeID, value);
                return(true);
            }

            return(false);
        }
示例#5
0
        public List <NodeDetail> Nodes()
        {
            List <NodeDetail> nodeList = new List <NodeDetail>();
            ZWaveNode         n        = new ZWaveNode();

            ZWave.Log("WCFService", "Nodes");
            foreach (Byte nodeID in zwaveControl.ListOfNodeIDs())
            {
                nodeList.Add(new NodeDetail()
                {
                    NodeID     = nodeID
                    , Name     = zwaveControl.NodeName(nodeID)
                    , Type     = zwaveControl.NodeType(nodeID)
                    , Location = zwaveControl.NodeLocation(nodeID)
                    , Basic    = zwaveControl.NodeBasic(nodeID)
                    , Level    = zwaveControl.NodeLevel(nodeID)
                });
            }

            return(nodeList);
        }
示例#6
0
        public NodeDetail Node(string NodeID)
        {
            ZWave.Log("WCFService", "Node");
            byte       nodeID;
            ZWaveNode  n          = new ZWaveNode();
            NodeDetail nodeDetail = new NodeDetail();

            if (byte.TryParse(NodeID, out nodeID))
            {
                nodeDetail = new NodeDetail()
                {
                    NodeID     = nodeID
                    , Name     = zwaveControl.NodeName(nodeID)
                    , Type     = zwaveControl.NodeType(nodeID)
                    , Location = zwaveControl.NodeLocation(nodeID)
                    , Basic    = zwaveControl.NodeBasic(nodeID)
                    , Level    = zwaveControl.NodeLevel(nodeID)
                };
            }

            return(nodeDetail);
        }
示例#7
0
 public Boolean StopProcess()
 {
     ZWave.Log("WCFService", "StopProcess");
     managedProcess.StopProcess();
     return(true);
 }
示例#8
0
 public Boolean StartProcess(string Process, string Arguments)
 {
     ZWave.Log("WCFService", "StartProcess: " + Process + " with " + Arguments);
     managedProcess.StartProcess(Process, Arguments);
     return(true);
 }
示例#9
0
 public Boolean AllOff()
 {
     ZWave.Log("WCFService", "All Off");
     zwaveControl.AllOff();
     return(true);
 }
示例#10
0
 public Boolean IsAvailable()
 {
     ZWave.Log("WCFService", "IsAvailable");
     return(zwaveControl.IsNetworkReady);
 }
示例#11
0
 public Niviane()
 {
     zwaveControl   = new ZWave(Properties.Settings.Default.ZWaveConfigPath, Properties.Settings.Default.ZWaveSerialPort, Properties.Settings.Default.ZWavePollInterval, Properties.Settings.Default.LogFilePath);
     managedProcess = new ProcessControl(Properties.Settings.Default.LogFilePath);
 }