public Receiver(HttpContext context, ReceiverType type, int maxResponseLength, string htmlFileCallback) { _context = context; _type = type; _state = State.NotOpen; _maxResponseLength = maxResponseLength; _htmlFileCallback = htmlFileCallback; }
public bool Broadcast(ClientSession client, String message, ReceiverType receiver, String CharacterName = "", long CharacterId = -1) { switch (receiver) { case ReceiverType.All: foreach (ClientSession session in sessions) { session.Client.SendPacket(message); } break; case ReceiverType.AllExceptMe: foreach (ClientSession session in sessions.Where(c => c != client)) { session.Client.SendPacket(message); } break; case ReceiverType.AllOnMap: foreach (ClientSession session in sessions.Where(s => s.Character != null && s.Character.MapId.Equals(client.Character.MapId))) { session.Client.SendPacket(message); } break; case ReceiverType.AllOnMapExceptMe: foreach (ClientSession session in sessions.Where(s => s.Character != null && s.Character.MapId.Equals(client.Character.MapId) && s.Character.CharacterId != client.Character.CharacterId)) { session.Client.SendPacket(message); } break; case ReceiverType.OnlyMe: client.Client.SendPacket(message); break; case ReceiverType.OnlySomeone: ClientSession session2 = sessions.FirstOrDefault(s => s.Character != null && s.Character.Name.Equals(CharacterName) || s.Character.CharacterId.Equals(CharacterId)); if (session2 != null) { session2.Client.SendPacket(message); return true; } return false; case ReceiverType.AllOnMapNoEmoBlocked: foreach (ClientSession session in sessions.Where(s => s.Character != null && s.Character.MapId.Equals(client.Character.MapId) && !s.Character.EmoticonsBlocked)) { session.Client.SendPacket(message); } break; } return true; }
public BroadcastPacket(ClientSession session, string packet, ReceiverType receiver, string someonesCharacterName = "", long someonesCharacterId = -1, int xCoordinate = 0, int yCoordinate = 0) { Sender = session; Packet = packet; Receiver = receiver; SomeonesCharacterName = someonesCharacterName; SomeonesCharacterId = someonesCharacterId; XCoordinate = xCoordinate; YCoordinate = yCoordinate; }
public void Broadcast(PacketDefinition packet, ReceiverType receiver = ReceiverType.All) => Broadcast(null, packet, receiver);
public SendErrorMessage(Guid MessageId, Guid SenderId, ReceiverType receiverType, Guid errorMessageId, string message) : base(MessageId, SenderId, receiverType, MessageType.erroe , JsonConvert.SerializeObject(new Dictionary <string, object> { { "ErrorMessageId", errorMessageId }, { "Message", message } })) { }
public void Broadcast(string packet, ReceiverType receiver = ReceiverType.All) => Broadcast(null, packet, receiver);
public MapPacket(ClientSession session, string content, ReceiverType receiver) { Session = session; Content = content; Receiver = receiver; }
public NameValueCollection MassPayment(IEnumerable<PayReceiver> receivers, CurrencyCodeType currencyCodeType, ReceiverType receiverType, string emailSubject) { var request = getQueryWithCredentials(); request["METHOD"] = "MassPay"; request["CURRENCYCODE"] = currencyCodeType.ToString(); request["RECEIVERTYPE"] = receiverType.ToString(); addOptionalValueToRequest("EMAILSUBJECT", emailSubject, request); addItems(receiverType, receivers, request); return request; }
public static ArraySegment <byte> CreateCloseMessage(ReceiverType type, byte[] closeArray) { return(new ArraySegment <byte>(closeArray)); }
public CommunicationManager(string baud, string par, string sBits, string dBits, string name, CommonClass.MyRichTextBox rtb, MyPanel pnl, MyPanel pn_SVs, MyPanel pn_Loc, ReceiverType rx) { this._ok2send = true; this.SendFlag = 1; this._baudRate = string.Empty; this._parity = string.Empty; this._stopBits = string.Empty; this._dataBits = string.Empty; this._portName = string.Empty; this._portNum = "-1"; this._TTBPortNum = "-1"; this._rxName = string.Empty; this._sourceDeviceName = string.Empty; this._readBuffer = 0x2000; this._lowPowerParams = new lowPowerParams(); this.comPort = new CommWrapper(); this.SrcDeviceName = string.Empty; this.lockread = new object(); this.lockwrite = new object(); this._protocol = "SSB"; this._rxType = ReceiverType.SLC; this.m_Protocols = new MsgFactory(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols.xml"); this.m_NavData = new NavigationAnalysisData(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\ReferenceLocation.xml"); this.m_TestSetup = new TestSetup(); this._productFamily = CommonClass.ProductType.GSD4e; this._trackerPort = string.Empty; this._resetPort = string.Empty; this._hostPair1 = string.Empty; this._requiredRunHost = true; this._hostSWFilePath = string.Empty; this._hostAppCfgFilePath = string.Empty; this._hostAppMEMSCfgPath = string.Empty; this._I2CmasterAddr = string.Empty; this._I2CslaveAddr = string.Empty; this._I2Cport = string.Empty; this.DefaultTCXOFreq = string.Empty; this.TrackerPortSelect = "uart"; this.OnOffLineUsage = "uart_cts"; this.ExtSResetNLineUsage = "uart_dtr"; this.WarmupDelay = 0x3ff; this.DebugSettings = 1; this.IsVersion4_1_A8AndAbove = true; this._requireEE = true; this._eeSelected = string.Empty; this._serverName = string.Empty; this._serverPort = string.Empty; this._authenCode = string.Empty; this._eeDayNum = string.Empty; this._bankTime = string.Empty; this.dataGui = new DataForGUI(); this.dataGui_ALL = new DataForGUI(60); this.SignalDataQ_ALL = new Queue<SignalData>(); this.TotalOfGroupMsg1 = 1; this.dataICTrack = new TrackerIC(); this.RxCtrl = new Receiver(); this.AutoReplyCtrl = new AutoReplyMgr(); this.TTBPort = new CommWrapper(); this.TrackerICCtrl = new TrackerIC(); this.SiRFNavStartStop = new SiRFNavParams(); this.NavigationParamrters = new NavigationParametersClass(); this.NavSolutionParams = new NavSolutionClass(); this.ConnectErrorString = string.Empty; this._hwCfgMsgQName = string.Empty; this._timeAidMsgQName = string.Empty; this._freqAidMsgQName = string.Empty; this._posAidMsgQName = string.Empty; this._posReqAckMsgQName = string.Empty; this._autoReplyConfigFilePath = clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetupAutoReply.cfg"; this.ErrorLogFilePath = string.Empty; this.DisplayQueue = new Queue(MAX_MSG_BUFFER); this.ToSwitchProtocol = "OSP"; this.ToSwitchBaud = "115200"; this._messageProtocol = "OSP"; this._currentProtocol = "OSP"; this._currentBaud = "115200"; this._IMUFilePath = ""; this._aidingProtocol = "SSB"; this._myWindowTitle = string.Empty; this._CSVBuff = new byte[MAX_BYTES_BUFFER]; this._enableLocationMapView = true; this._enableSignalView = true; this._enableSVsMap = true; this._enableSatelliteStats = true; this._monitorNav = true; this._enableMEMSView = true; this._enableCompassView = true; this._locationMapRadius = 5.0; this._responseViewRTBDisplay = new CommonUtilsClass(); this._errorViewRTBDisplay = new CommonUtilsClass(); this._debugViewRTBDisplay = new CommonUtilsClass(); this.StringRxNavParams = string.Empty; this._helperFunctions = new HelperFunctions(); this._dataReadLock = new object(); this.DisplayDataLock = new object(); this._inDataBytes = new List<byte>(); this.ErrorStringList = new List<string>(); this.LockErrorLog = new object(); this.ErrorCfgFilePath = clsGlobal.InstalledDirectory + @"\Config\errorLists.cfg"; this.UserSpecifiedLogCfgFilePath = clsGlobal.InstalledDirectory + @"\Config\userMessageLists.cfg"; this.UserSpecifiedMsgList = new List<string>(); this.UserSpecifiedSubStringList = new List<string>(); this.StringDRNavStatus = string.Empty; this.StringDRNavState = string.Empty; this.StringDRNavSubsystemData = string.Empty; this.StringDRInputCarBusData = string.Empty; this.StringDRSensorData = string.Empty; this.I2CModeSwitchDone = true; this.NavTruthDataHash = new Hashtable(); this._debugViewMatchStr = string.Empty; this.ToSendMsgQueue = new Queue(); this._lockwrite = new object(); this.MAX_SIG_BUFFER = 5; this.LockSignalDataUpdate = new object(); this.LockSignalDataUpdate_ALL = new object(); this.SignalDataQ = new Queue<SignalData>(); this.NMEA_navMode = "No Fix"; this._lockCommErrorCnt = new object(); this.m_NavData = new NavigationAnalysisData(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\ReferenceLocation.xml"); this._baudRate = baud; this._parity = par; this._stopBits = sBits; this._dataBits = dBits; this._portName = name; this._displayPanelSignal = pnl; this._displayPanelSVs = pn_SVs; this._displayPanelLocation = pn_Loc; this._rxType = rx; this._rxType = ReceiverType.SLC; this.RxTransType = TransmissionType.GPS; this._idx_CSVBuff = 0; this._CSVBuff.Initialize(); this._b1 = 0; this._b2 = 0; this._nmea_Str = ""; this._lastAidingSessionReportedClockDrift = 0.0; this._lastClockDrift = 0; }
public void Broadcast(ClientSession client, string content, ReceiverType receiver = ReceiverType.All, string characterName = "", long characterId = -1) { try { SpreadBroadcastpacket(new BroadcastPacket(client, content, receiver, characterName, characterId)); } catch (Exception ex) { Logger.Error(ex); } }
public void FilePlaybackCommSetup() { string str = this._messageProtocol; if (str != null) { if (!(str == "SSB")) { if (!(str == "OSP")) { if (str == "NMEA") { this._txTransType = TransmissionType.Text; this.RxTransType = TransmissionType.Text; this.LogFormat = TransmissionType.Text; this._rxType = ReceiverType.NMEA; this.RxCtrl = new NMEAReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ResetCtrl = new NMEAReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.ListenersCtrl = new NMEAListnerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; } return; } } else { this._txTransType = TransmissionType.GP2; this.LogFormat = TransmissionType.GPS; this.RxCtrl = new SS3AndGSD3TWReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; if (this._rxType == ReceiverType.GSW) { this._aidingProtocol = "SSB"; } else { this._aidingProtocol = "AI3"; } this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ControlChannelProtocolFile = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_F.xml"; this.RxCtrl.ControlChannelVersion = "2.1"; this.RxCtrl.ResetCtrl = new FAndSSBReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.AutoReplyCtrl = new AutoReplyMgr_F(this.RxCtrl.ControlChannelProtocolFile); this.AutoReplyCtrl.ControlChannelVersion = this.RxCtrl.ControlChannelVersion; this.ListenersCtrl = new ListenerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; this.AutoReplyCtrl = new AutoReplyMgr_F(); return; } this._txTransType = TransmissionType.GP2; this.LogFormat = TransmissionType.GPS; this.RxCtrl = new OSPReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ControlChannelProtocolFile = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_F.xml"; this.RxCtrl.ControlChannelVersion = "1.0"; this.RxCtrl.ResetCtrl = new OSPReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.AutoReplyCtrl = new AutoReplyMgr_OSP(this.RxCtrl.ControlChannelProtocolFile); this.AutoReplyCtrl.ControlChannelVersion = this.RxCtrl.ControlChannelVersion; this.ListenersCtrl = new OSPListnerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; } }
/// <summary> /// 发送消息 /// </summary> /// <param name="receiveId">接收者ID</param> /// <param name="receiverType">接收者类别</param> /// <param name="message">消息</param> /// <returns></returns> public async Task SendMessageAsync(Guid receiveId, ReceiverType receiverType, string message) { await SendMessageAsync(receiveId, receiverType, MessageType.message, message); }
/// <summary> /// 发送消息 /// </summary> /// <param name="receiveId">接收者ID</param> /// <param name="receiverType">接收者类别</param> /// <param name="messageType">消息类别</param> /// <param name="message">消息</param> /// <returns></returns> public async Task SendMessageAsync(Guid receiveId, ReceiverType receiverType, MessageType messageType, string message) { var sendMessage = new SendMessage(Guid.NewGuid(), UserId, receiveId, receiverType, messageType, message); await WebSocketClient.SendMassage(Newtonsoft.Json.JsonConvert.SerializeObject(sendMessage)); }
void Send(NetworkStream stream, ReceiverType receiverType, CommandType command) { MyProtocol.Protocol.SendCommand(stream, receiverType, command); }
void Send(NetworkStream stream, ReceiverType receiverType, byte[] data) { MyProtocol.Protocol.SendRawData(stream, receiverType, data); }
void Send(NetworkStream stream, ReceiverType receiverType, string message) { MyProtocol.Protocol.SendString(stream, receiverType, message); }
public void Broadcast(ClientSession client, PacketDefinition packet, ReceiverType receiver = ReceiverType.All, string characterName = "", long characterId = -1) => Broadcast(client, PacketFactory.Serialize(packet), receiver, characterName, characterId);
public bool SetupRxCtrl() { bool flag = false; try { this.m_Protocols.m_messageProtocol = this._messageProtocol; string str = this._messageProtocol; if (str != null) { if (!(str == "SSB")) { if (str == "OSP") { goto Label_0205; } if (str == "NMEA") { goto Label_0398; } } else { this._txTransType = TransmissionType.GP2; this.LogFormat = TransmissionType.GPS; this.RxCtrl = new SS3AndGSD3TWReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; if (this._rxType == ReceiverType.GSW) { this._aidingProtocol = "SSB"; } else { this._aidingProtocol = "AI3"; } this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ControlChannelProtocolFile = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_F.xml"; this.RxCtrl.ControlChannelVersion = "2.1"; this.RxCtrl.AidingProtocolVersion = "2.2"; this.RxCtrl.ResetCtrl = new FAndSSBReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.RxCtrl.ResetCtrl.ResetGPSTimer = this.RxCtrl.GPSTimerEngine; this.AutoReplyCtrl = new AutoReplyMgr_F(this.RxCtrl.ControlChannelProtocolFile); this.AutoReplyCtrl.ControlChannelVersion = this.RxCtrl.ControlChannelVersion; this.AutoReplyCtrl.AidingProtocolVersion = this.RxCtrl.AidingProtocolVersion; this.ListenersCtrl = new ListenerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; } } goto Label_0493; Label_0205: this._txTransType = TransmissionType.GP2; this.LogFormat = TransmissionType.GPS; this.RxCtrl = new OSPReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ControlChannelProtocolFile = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_F.xml"; this.RxCtrl.ControlChannelVersion = "1.0"; this.RxCtrl.AidingProtocolVersion = "1.0"; this.RxCtrl.ResetCtrl = new OSPReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.RxCtrl.ResetCtrl.ResetGPSTimer = this.RxCtrl.GPSTimerEngine; this.AutoReplyCtrl = new AutoReplyMgr_OSP(this.RxCtrl.ControlChannelProtocolFile); this.AutoReplyCtrl.ControlChannelVersion = this.RxCtrl.ControlChannelVersion; this.AutoReplyCtrl.AidingProtocolVersion = this.RxCtrl.AidingProtocolVersion; this.ListenersCtrl = new OSPListnerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; goto Label_0493; Label_0398: this._txTransType = TransmissionType.Text; this.RxTransType = TransmissionType.Text; this.LogFormat = TransmissionType.Text; this._rxType = ReceiverType.NMEA; this.RxCtrl = new NMEAReceiver(); this.RxCtrl.RxCommWindow = this; this.RxCtrl.DutStationSetup = this.m_TestSetup; this.RxCtrl.RxNavData = this.m_NavData; this.RxCtrl.MessageProtocol = this._messageProtocol; this.RxCtrl.AidingProtocol = this._aidingProtocol; this.RxCtrl.ResetCtrl = new NMEAReset(); this.RxCtrl.ResetCtrl.ResetComm = this; this.RxCtrl.ResetCtrl.DutStationSetup = this.RxCtrl.DutStationSetup; this.RxCtrl.ResetCtrl.ResetNavData = this.RxCtrl.RxNavData; this.ListenersCtrl = new NMEAListnerManager(); this.ListenersCtrl.AidingProtocol = this._aidingProtocol; this.ListenersCtrl.RxType = this._rxType; Label_0493: flag = true; } catch (Exception exception) { this.ErrorPrint(exception.Message); flag = false; } return flag; }
public void Broadcast(ClientSession client, PacketDefinition packet, ReceiverType receiver = ReceiverType.All, string characterName = "", long characterId = -1) { Broadcast(client, PacketFactory.Serialize(packet), receiver, characterName, characterId); }
public SendReadStatusMessage(Guid MessageId, Guid SenderId, ReceiverType receiverType, Guid receiveMessageId, bool status, string message) : base(MessageId, SenderId, receiverType, MessageType.readStatusChange , JsonConvert.SerializeObject(new Dictionary <string, object> { { "ReceiveMessageId", receiveMessageId }, { "Status", status }, { "Message", message } })) { }
public MapPacket(string characterName, string packet, ReceiverType all) { this.characterName = characterName; this.packet = packet; this.all = all; }
public CommunicationManager(bool hasPlotData) { this._ok2send = true; this.SendFlag = 1; this._baudRate = string.Empty; this._parity = string.Empty; this._stopBits = string.Empty; this._dataBits = string.Empty; this._portName = string.Empty; this._portNum = "-1"; this._TTBPortNum = "-1"; this._rxName = string.Empty; this._sourceDeviceName = string.Empty; this._readBuffer = 0x2000; this._lowPowerParams = new lowPowerParams(); this.comPort = new CommWrapper(); this.SrcDeviceName = string.Empty; this.lockread = new object(); this.lockwrite = new object(); this._protocol = "SSB"; this._rxType = ReceiverType.SLC; this.m_Protocols = new MsgFactory(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols.xml"); this.m_NavData = new NavigationAnalysisData(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\ReferenceLocation.xml"); this.m_TestSetup = new TestSetup(); this._productFamily = CommonClass.ProductType.GSD4e; this._trackerPort = string.Empty; this._resetPort = string.Empty; this._hostPair1 = string.Empty; this._requiredRunHost = true; this._hostSWFilePath = string.Empty; this._hostAppCfgFilePath = string.Empty; this._hostAppMEMSCfgPath = string.Empty; this._I2CmasterAddr = string.Empty; this._I2CslaveAddr = string.Empty; this._I2Cport = string.Empty; this.DefaultTCXOFreq = string.Empty; this.TrackerPortSelect = "uart"; this.OnOffLineUsage = "uart_cts"; this.ExtSResetNLineUsage = "uart_dtr"; this.WarmupDelay = 0x3ff; this.DebugSettings = 1; this.IsVersion4_1_A8AndAbove = true; this._requireEE = true; this._eeSelected = string.Empty; this._serverName = string.Empty; this._serverPort = string.Empty; this._authenCode = string.Empty; this._eeDayNum = string.Empty; this._bankTime = string.Empty; this.dataGui = new DataForGUI(); this.dataGui_ALL = new DataForGUI(60); this.SignalDataQ_ALL = new Queue<SignalData>(); this.TotalOfGroupMsg1 = 1; this.dataICTrack = new TrackerIC(); this.RxCtrl = new Receiver(); this.AutoReplyCtrl = new AutoReplyMgr(); this.TTBPort = new CommWrapper(); this.TrackerICCtrl = new TrackerIC(); this.SiRFNavStartStop = new SiRFNavParams(); this.NavigationParamrters = new NavigationParametersClass(); this.NavSolutionParams = new NavSolutionClass(); this.ConnectErrorString = string.Empty; this._hwCfgMsgQName = string.Empty; this._timeAidMsgQName = string.Empty; this._freqAidMsgQName = string.Empty; this._posAidMsgQName = string.Empty; this._posReqAckMsgQName = string.Empty; this._autoReplyConfigFilePath = clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetupAutoReply.cfg"; this.ErrorLogFilePath = string.Empty; this.DisplayQueue = new Queue(MAX_MSG_BUFFER); this.ToSwitchProtocol = "OSP"; this.ToSwitchBaud = "115200"; this._messageProtocol = "OSP"; this._currentProtocol = "OSP"; this._currentBaud = "115200"; this._IMUFilePath = ""; this._aidingProtocol = "SSB"; this._myWindowTitle = string.Empty; this._CSVBuff = new byte[MAX_BYTES_BUFFER]; this._enableLocationMapView = true; this._enableSignalView = true; this._enableSVsMap = true; this._enableSatelliteStats = true; this._monitorNav = true; this._enableMEMSView = true; this._enableCompassView = true; this._locationMapRadius = 5.0; this._responseViewRTBDisplay = new CommonUtilsClass(); this._errorViewRTBDisplay = new CommonUtilsClass(); this._debugViewRTBDisplay = new CommonUtilsClass(); this.StringRxNavParams = string.Empty; this._helperFunctions = new HelperFunctions(); this._dataReadLock = new object(); this.DisplayDataLock = new object(); this._inDataBytes = new List<byte>(); this.ErrorStringList = new List<string>(); this.LockErrorLog = new object(); this.ErrorCfgFilePath = clsGlobal.InstalledDirectory + @"\Config\errorLists.cfg"; this.UserSpecifiedLogCfgFilePath = clsGlobal.InstalledDirectory + @"\Config\userMessageLists.cfg"; this.UserSpecifiedMsgList = new List<string>(); this.UserSpecifiedSubStringList = new List<string>(); this.StringDRNavStatus = string.Empty; this.StringDRNavState = string.Empty; this.StringDRNavSubsystemData = string.Empty; this.StringDRInputCarBusData = string.Empty; this.StringDRSensorData = string.Empty; this.I2CModeSwitchDone = true; this.NavTruthDataHash = new Hashtable(); this._debugViewMatchStr = string.Empty; this.ToSendMsgQueue = new Queue(); this._lockwrite = new object(); this.MAX_SIG_BUFFER = 5; this.LockSignalDataUpdate = new object(); this.LockSignalDataUpdate_ALL = new object(); this.SignalDataQ = new Queue<SignalData>(); this.NMEA_navMode = "No Fix"; this._lockCommErrorCnt = new object(); if (hasPlotData) { this.dataPlot = new DataForPlotting(); } this.m_NavData = new NavigationAnalysisData(ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\ReferenceLocation.xml"); this._baudRate = "115200"; this._parity = "None"; this._stopBits = "1"; this._dataBits = "8"; this._portName = "COM8"; this._rxType = ReceiverType.SLC; this.RxTransType = TransmissionType.GPS; this.LogFormat = TransmissionType.GPS; this._idx_CSVBuff = 0; this._CSVBuff.Initialize(); this._b1 = 0; this._b2 = 0; this._nmea_Str = ""; this._lastAidingSessionReportedClockDrift = 0.0; this._lastClockDrift = 0; this._log = new LogManager(clsGlobal.SiRFLiveVersion); this.CMC = new CommMgrClass(); if (File.Exists(this.ErrorCfgFilePath)) { this.ErrorStringList.Clear(); StreamReader reader = new StreamReader(this.ErrorCfgFilePath); string str = reader.ReadLine(); if ((str != null) && (str != string.Empty)) { foreach (string str2 in str.Split(new char[] { '%' })) { string str3 = str2.TrimEnd(new char[0]); this.ErrorStringList.Add(str3.TrimStart(new char[0])); } } reader.Close(); reader.Dispose(); reader = null; } if (File.Exists(this.UserSpecifiedLogCfgFilePath)) { this.UserSpecifiedMsgList.Clear(); this.UserSpecifiedSubStringList.Clear(); StreamReader reader2 = new StreamReader(this.UserSpecifiedLogCfgFilePath); string str4 = reader2.ReadLine(); if ((str4 != null) && (str4 != string.Empty)) { foreach (string str5 in str4.Split(new char[] { '%' })) { string str6 = str5.TrimEnd(new char[0]); this.UserSpecifiedMsgList.Add(str6.TrimStart(new char[0])); } str4 = reader2.ReadLine(); } if ((str4 != null) && (str4 != string.Empty)) { foreach (string str7 in str4.Split(new char[] { '%' })) { string str8 = str7.TrimEnd(new char[0]); this.UserSpecifiedSubStringList.Add(str8.TrimStart(new char[0])); } } if (this.UserSpecifiedSubStringList.Count < this.UserSpecifiedMsgList.Count) { int num = this.UserSpecifiedMsgList.Count - this.UserSpecifiedSubStringList.Count; for (int i = 0; i < num; i++) { this.UserSpecifiedSubStringList.Add("Y"); } } reader2.Close(); reader2.Dispose(); reader2 = null; } }
public ProductReceiver(int productID, string emailAddress, ReceiverType receiverType) { _productID = productID; _emailAddress = emailAddress; _receiverType = receiverType; }
public void SwitchProtocol() { if (this.ToSwitchProtocol != this._messageProtocol) { this.AutoDetectProtocolAndBaudDone = false; Thread.Sleep(50); this._messageProtocol = this.ToSwitchProtocol; if (this._messageProtocol == "OSP") { this._rxType = ReceiverType.SLC; this.RxTransType = TransmissionType.GPS; this._txTransType = TransmissionType.GP2; } else if (this._messageProtocol == "NMEA") { this.dataGui.AGC_Gain = 0; this._rxType = ReceiverType.NMEA; this.RxTransType = TransmissionType.Text; this._txTransType = TransmissionType.Text; } this.BaudRate = this.ToSwitchBaud; this.SetupRxCtrl(); this.portDataInit(); Thread.Sleep(5); int num = 0; bool flag = false; uint baud = uint.Parse(this.BaudRate); while (num++ < 5) { flag = this.comPort.UpdateBaudSettings(baud); if (flag) { break; } Thread.Sleep(1); } this.portDataInit(); if (flag) { if (this._messageProtocol == "OSP") { this.RxCtrl.SetMessageRateForFactory(); } } else { this.ErrorPrint("Error updating port"); } this.AutoDetectProtocolAndBaudDone = true; } }
public void Broadcast(ClientSession client, PacketBase packet, ReceiverType receiver = ReceiverType.All, string characterName = "", long characterId = -1, int delay = 0) { Broadcast(client, PacketFactory.Deserialize(packet), receiver, characterName, characterId, delay); }
/// <summary> /// Inform client(s) about the Packet. /// </summary> /// <param name="session">Session of the sender.</param> /// <param name="packet">The packet content to send.</param> /// <param name="receiver">The receiver(s) of the Packet.</param> public void BroadCast(ClientSession session, string packet, ReceiverType receiver) { QueuePacket(new MapPacket(session, packet, receiver)); }
public static ArraySegment<byte> CreateSendsMessage(ReceiverType type, List<PendingSend> sends) { MessageWriter writer = new MessageWriter(); writer.WriteSends(sends); ArraySegment<byte> sendsSegment = writer.GetSegment(); if (type != ReceiverType.HtmlFile) { return sendsSegment; } else { MessageWriter htmlFileWriter = new MessageWriter(); htmlFileWriter.WriteBytes(s_htmlFileSendMessagesStart); htmlFileWriter.WriteJsonString(new ArraySegment<byte>(sendsSegment.Array, sendsSegment.Offset, sendsSegment.Count - 1)); htmlFileWriter.WriteBytes(s_htmlFileSendMessagesEnd); return htmlFileWriter.GetSegment(); } }
public static ArraySegment<byte> CreateCloseMessage(ReceiverType type, byte[] closeArray) { return new ArraySegment<byte>(closeArray); }
void addItems(ReceiverType receiverType, IEnumerable<PayReceiver> receivers, NameValueCollection request) { int index = 0; foreach (var receiver in receivers) { if (receiverType == ReceiverType.EmailAddress) request["L_EMAIL" + index] = receiver.ReceiverId; else if (receiverType == ReceiverType.UserID) request["L_RECEIVERID" + index] = receiver.ReceiverId; else throw new NotImplementedException(string.Format("ReceiverType {0} is not implemented", receiverType)); request["L_AMT" + index] = receiver.Amount.ToString("0.00"); addOptionalValueToRequest("L_UNIQUEID" + index, receiver.UniqueId, request); addOptionalValueToRequest("L_NOTE" + index, receiver.Note, request); index++; } }
public ReceiveMessage(Guid MessageId, Guid SenderId, Guid ReceiverId, MessageType MessageType, ReceiverType ReceiverType, string Message) { this.MessageId = MessageId; this.SenderId = SenderId; this.ReceiverId = ReceiverId; this.MessageType = MessageType; this.ReceiverType = ReceiverType; this.Message = Message; }