public bool SetDevices(string CommPort, ref SL_Comm_Util Comm, string IntruAddr) { this.CommAddr = CommPort; this.ElecsComm = Comm; this.InstruAddr = IntruAddr; return(true); }
public bool ComSetting(string CommAddr, ref SL_Comm_Util Comm) { bool ret = false; ElecsComm = new SL_Comm_Util(CommAddr, "115200", "8", "None", "1"); if (ElecsComm.CommOpen()) { Comm = ElecsComm; ret = true; } return(ret); }
public bool Open(string CommAddr, string Baudrate, string Parity, string DataBit, string StopBit) { ElecsComm = new SL_Comm_Util(CommAddr, Baudrate, DataBit, Parity, StopBit); if (ElecsComm.CommOpen()) { return(true); } else { return(false); } }
public bool Open(string CommAddr) { ElecsComm = new SL_Comm_Util(CommAddr, "115200", "8", "None", "1"); //20170724 if (ElecsComm.CommOpen()) { return(true); } else { return(false); } }
private bool DealWithSystem(string SystemCmd, byte ElecsType, ref string RdStr) { int Times = 0; if (ElecsType == (byte)CmdType.Write) { string[] Parameter = SystemCmd.Split(DelimiterChars); if (ElecsComm != null && Parameter[0].CompareTo("elecs.close") == 0) { ElecsComm.CommClose(); ElecsComm = null; } if (Parameter[0].CompareTo("system") == 0) { RdStr = SystemInfo(); } if (Parameter[0].CompareTo("pause") == 0) { RdStr = "Pause"; } if (Parameter[0].CompareTo("sleep") == 0) { if (Parameter.Length > 1 && int.TryParse(Parameter[1], out Times)) { Thread.Sleep(Times); } } if (Parameter[0].CompareTo("load") == 0) { if (Parameter.Length > 1) { ExeScriptFile(Parameter[1], ref RdStr); } } } return(true); }
public bool Close() { ElecsComm.CommClose(); ElecsComm = null; return(true); }
public bool SetCommDevice(ref SL_Comm_Util Comm) { this.ElecsComm = Comm; return(true); }