public string SendCommand(DCTCommand command) { string strReturn = String.Empty; /* Removed by Icyer 2006/12/04 * if(socket == null || socket.Connected == false) * { * Open(); * } */ // Added by Icyer 2006/12/04 if (client_status != DSC19ClientStatus.Connecting) { Open(); } // Added end DSC19CommandList comList = new DSC19CommandList(); //socket.Send(comList.GetCommand(command)); // Removed by Icyer 2006/12/04 // Added by Icyer 2006/12/04 byte[] strCmd = comList.GetCommand(command); // 发送命令 SendToClient(this.ClientID, strCmd); // Added end if (OnSendData != null) { OnSendData(this , new CommandEventArgs(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + OUT + command.ToString())); } return(strReturn); }
public string SendCommand(DCTCommand command) { string strReturn = String.Empty; if (socket == null || socket.Connected == false) { Open(); } DCN500CommandList comList = new DCN500CommandList(); socket.Send(comList.GetCommand(command)); if (OnSendData != null) { OnSendData(this , new CommandEventArgs(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + OUT + command.ToString())); } return(strReturn); }
public string SendCommand(DCTCommand command) { Open(); DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(this.DataProvider); DCTMessage dctMessage = _DCTFacade.CreateNewDCTMessage(); dctMessage.FromAddress = _LocalAddress; dctMessage.FromPort = _LocalPort; dctMessage.ToAddress = _ClientAddress; dctMessage.ToPort = _ClientPort; dctMessage.Direction = DCTMessageDirection.ServerToClient; dctMessage.MessageType = DCTMessageType.Command; dctMessage.MessageContent = command.ToString(); dctMessage.Status = DCTMessageStatus.New; dctMessage.MaintainUser = "******"; dctMessage.MaintainDate = dbDateTime.DBDate; dctMessage.MaintainTime = dbDateTime.DBTime; this._DCTFacade.AddDCTMessage(dctMessage); return(command.ToString()); }
static BaseActionStack() { #region 控制DCT 发声音的 try { BeepSuccess = bool.Parse(System.Configuration.ConfigurationSettings.AppSettings["BeepSuccess"]); } catch { BeepSuccess = true; } try { BeepError = bool.Parse(System.Configuration.ConfigurationSettings.AppSettings["BeepError"]); } catch { BeepError = true; } try { BeepInterval = int.Parse(System.Configuration.ConfigurationSettings.AppSettings["BeepInterval"]); } catch { BeepInterval = 1500; } try { BeepCount = int.Parse(System.Configuration.ConfigurationSettings.AppSettings["BeepCount"]); } catch { BeepCount = 3; } try { if (System.Configuration.ConfigurationSettings.AppSettings["BeepType"] == "short") { BeepType = DCTCommand.SpeakerOn; } else { BeepType = DCTCommand.SpeakerOff; } } catch { BeepType = DCTCommand.SpeakerOff; } #endregion if (System.Configuration.ConfigurationSettings.AppSettings["Language"] == "CHS") // 简体中文 { MutiLanguages.Language = "CHS"; } else if (System.Configuration.ConfigurationSettings.AppSettings["Language"] == "CHT") // 繁体中文 { MutiLanguages.Language = "CHT"; } else if (System.Configuration.ConfigurationSettings.AppSettings["Language"] == "ENU") // 英文 { MutiLanguages.Language = "ENU"; } }
public byte[] GetCommand(DCTCommand commandName) { return(dctCommandList[commandName] as byte[]); }