private void frmCommSettingsOkBtn_Click(object sender, EventArgs e) { CommonUtilsClass class2 = new CommonUtilsClass(); try { if (this.comm != null) { int num = Convert.ToInt32(this.frmCommOpenBufferSizeTxtBox.Text); if (num > 0x1388) { MessageBox.Show("Max lines is 5000", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); num = 0x1388; } class2.DisplayBuffer = num; } else { clsGlobal.MiscStringUpdate = this.frmCommOpenBufferSizeTxtBox.Text; } } catch (Exception exception) { MessageBox.Show(exception.Message, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Hand); } base.DialogResult = DialogResult.OK; base.Close(); }
public frmCommDisplayBufferSizeUpdate(CommunicationManager parentCommWindow) { this.CUC = new CommonUtilsClass(); this.InitializeComponent(); this.CommWindow = parentCommWindow; this.frmCommOpenBufferSizeTxtBox.Text = this.CUC.DisplayBuffer.ToString(); }
private void parseFile() { EventHandler method = null; EventHandler handler2 = null; EventHandler handler3 = null; EventHandler handler4 = null; EventHandler handler5 = null; EventHandler handler6 = null; EventHandler handler7 = null; EventHandler handler8 = null; CommonUtilsClass class2 = new CommonUtilsClass(); string timeStamp = string.Empty; int millisecondsTimeout = 500; bool flag = false; Label_002C: try { switch (this._playState) { case _playStates.IDLE: millisecondsTimeout = 500; this._fileIndex = 0L; if (method == null) { method = delegate { this.frmFileReplayTrackBar.Enabled = true; }; } this.frmFileReplayTrackBar.Invoke(method); goto Label_080E; case _playStates.PLAY: millisecondsTimeout = this.speedDelay; class2.viewPause = false; if (handler3 == null) { handler3 = delegate { this.frmFileReplayTrackBar.Enabled = false; }; } this.frmFileReplayTrackBar.Invoke(handler3); if (this._fileHdlr != null) { string csvString = this._fileHdlr[this._fileIndex]; try { string str4; if (csvString == "EOF") { if (MessageBox.Show("End of file reached! -- Rewind?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { this._fileIndex = 0L; this.comm.WriteApp("User marker: Rewind and retart"); } else { this._playState = _playStates.IDLE; if (handler4 == null) { handler4 = delegate { this.Text = "Stop: " + this._logFileName; }; } base.Invoke(handler4); } if (handler5 == null) { handler5 = delegate { this.frmFileReplayTrackBar.Value = this.frmFileReplayTrackBar.Maximum; }; } this.frmFileReplayTrackBar.Invoke(handler5); goto Label_080E; } string inputString = string.Empty; bool flag2 = false; CommonClass.MessageType normal = CommonClass.MessageType.Normal; csvString = csvString.TrimEnd(new char[] { '\n' }); csvString = csvString.TrimEnd(new char[] { '\r' }); switch (this._fileType) { case CommonClass.TransmissionType.Text: inputString = csvString; normal = CommonClass.MessageType.Incoming; timeStamp = string.Empty; goto Label_04F9; case CommonClass.TransmissionType.GP2: { csvString = csvString.ToUpper(); if (!csvString.Contains("A0 A2")) { goto Label_0280; } int index = csvString.IndexOf("A0 A2"); int num3 = csvString.IndexOf("("); inputString = csvString.Substring(index); str4 = csvString.Substring(num3 + 1, 1); if (!(str4 == "0")) { break; } normal = CommonClass.MessageType.Incoming; goto Label_04F9; } case CommonClass.TransmissionType.GPS: { inputString = csvString; normal = CommonClass.MessageType.Normal; csvString = csvString.Replace(" ", ""); string messageProtocol = this.comm.MessageProtocol; if (this.comm.MessageProtocol == "OSP") { messageProtocol = "SSB"; } if (csvString.StartsWith("2,")) { this.comm.getSatellitesDataForGUIFromCSV(2, 0, messageProtocol, csvString); } else if (csvString.StartsWith("4,")) { this.comm.getSatellitesDataForGUIFromCSV(4, 0, messageProtocol, csvString); } else if (csvString.StartsWith("41,")) { this.comm.getSatellitesDataForGUIFromCSV(0x29, 0, messageProtocol, csvString); } else { if (!csvString.StartsWith("225,")) { goto Label_04A1; } if (!csvString.StartsWith("225,00")) { goto Label_03D1; } if (!clsGlobal.IsMarketingUser() && (csvString.Length > 1)) { string str6 = string.Empty; for (int i = 6; i < csvString.Length; i += 2) { byte num5 = (byte) int.Parse(csvString.Substring(i, 2), NumberStyles.HexNumber); num5 = (byte) (num5 ^ 0xff); str6 = str6 + Convert.ToChar(num5); } inputString = str6; } } goto Label_04F9; } default: inputString = csvString; normal = CommonClass.MessageType.Normal; timeStamp = string.Empty; goto Label_04F9; } switch (str4) { case "1": case "2": normal = CommonClass.MessageType.Incoming; break; } goto Label_04F9; Label_0280: inputString = csvString; goto Label_04F9; Label_03D1: if (csvString.StartsWith("225,6")) { this.GetTTFFFromCSV(csvString); if (!this.comm.AutoReplyCtrl.AutoReplyParams.AutoReply && (this._ttffDisplay != null)) { ReceiverReset resetCtrl = this.comm.RxCtrl.ResetCtrl; resetCtrl.ResetCount++; this._ttffDisplay.updateTTFFNow(); } } else if (csvString.StartsWith("225,7")) { this.GetTTFFFromCSV(csvString); if (this.comm.AutoReplyCtrl.AutoReplyParams.AutoReply && (this._ttffDisplay != null)) { ReceiverReset reset2 = this.comm.RxCtrl.ResetCtrl; reset2.ResetCount++; this._ttffDisplay.updateTTFFNow(); } } goto Label_04F9; Label_04A1: if (csvString.StartsWith("69,")) { this.comm.AutoReplyCtrl.AutoReplyParams.AutoReply = true; if (csvString.StartsWith("69,1")) { this.getOSPPosition(csvString); } } Label_04F9: flag2 = this.comm.File_DataReceived(normal, inputString, this._isMatchRegularExpression, this._regMatchString, timeStamp); this.rtbDisplayProccess(); if (flag2) { this._count++; if ((this._lastPlayState != _playStates.FORWARD) && (this._lastPlayState != _playStates.BACKWARD)) { if (handler6 == null) { handler6 = delegate { this.frmFileReplayOccurrence.Text = "Match: " + this._count.ToString() + " found"; }; } this.frmFileReplayOccurrence.Invoke(handler6); } this._playState = _playStates.PAUSE; } this._fileIndex = this._fileHdlr.Index + 1L; if (this._totalFileSize != 0L) { int processPercentage = (int) ((((double) this._fileHdlr.Index) / ((double) this._totalFileSize)) * 100.0); this.frmFileReplayTrackBar.Invoke((MethodInvoker)delegate { this.frmFileReplayTrackBar.Value = processPercentage; }); } if (this.comm._isEpochMessage) { this.comm._isEpochMessage = false; if (this._lastPlayState != _playStates.BACKWARD) { if (this._epochList.Count >= 100) { this._epochList.RemoveAt(0); } if (!this._epochList.Contains(this._fileIndex - 1L)) { this._epochList.Add(this._fileIndex - 1L); this._epochIndex = this._epochList.Count - 1; } } } } catch (Exception exception) { if (this._playState != _playStates.QUIT) { MessageBox.Show(string.Format("Error: {0}\n{1}", exception.Message, csvString), "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand); this._fileIndex = this._fileHdlr.Index + 1L; } } } goto Label_080E; case _playStates.PAUSE: millisecondsTimeout = 500; if (handler2 == null) { handler2 = delegate { this.frmFileReplayTrackBar.Enabled = true; }; } this.frmFileReplayTrackBar.Invoke(handler2); goto Label_080E; case _playStates.FORWARD: if (handler7 == null) { handler7 = delegate { this.frmFileReplayTrackBar.Enabled = false; }; } this.frmFileReplayTrackBar.Invoke(handler7); this.comm._isCheckEpoch = true; this._lastPlayState = this._playState; this._playState = _playStates.PLAY; this._epochIndex++; if (this._epochIndex > (this._epochList.Count - 1)) { this._epochIndex = this._epochList.Count - 1; if (this._epochIndex < 0) { this._epochIndex = 0; } } goto Label_080E; case _playStates.BACKWARD: if (handler8 == null) { handler8 = delegate { this.frmFileReplayTrackBar.Enabled = false; }; } this.frmFileReplayTrackBar.Invoke(handler8); this.comm._isCheckEpoch = true; this._lastPlayState = this._playState; if (this._epochIndex < 1) { MessageBox.Show("Reached end of backward list", "Warning"); this._epochIndex = 0; this._playState = _playStates.PAUSE; } else { this._fileIndex = this._epochList[this._epochIndex - 1]; this._epochIndex--; this._playState = _playStates.PLAY; } goto Label_080E; case _playStates.QUIT: flag = true; goto Label_080E; } millisecondsTimeout = this.speedDelay; } catch (Exception exception2) { if (this._playState != _playStates.QUIT) { MessageBox.Show(string.Format("Error: frmFileReplay: parseFile() {0}", exception2.ToString()), "ERROR", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Hand); this._fileIndex = this._fileHdlr.Index + 1L; } } Label_080E: if (flag) { return; } Thread.Sleep(millisecondsTimeout); goto Label_002C; }
private void frmSaveSettingsOnClosing_CommOpen(string filePath) { StreamWriter writer; CommonUtilsClass class2 = new CommonUtilsClass(); if (File.Exists(filePath)) { if ((File.GetAttributes(filePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) { MessageBox.Show(string.Format("File is read only - Window locations were not saved!\n{0}", filePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.Cursor = Cursors.Default; return; } writer = new StreamWriter(filePath); } else { writer = File.CreateText(filePath); } if (writer != null) { writer.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); writer.WriteLine("<windows>"); string str2 = string.Empty; int num = this.comm.RequireHostRun ? 1 : 0; int num2 = 0; if (this.comm.InputDeviceMode == CommonClass.InputDeviceModes.RS232) { num2 = 1; } else if (this.comm.InputDeviceMode == CommonClass.InputDeviceModes.TCP_Client) { num2 = 2; } else if (this.comm.InputDeviceMode == CommonClass.InputDeviceModes.TCP_Server) { num2 = 3; } else if (this.comm.InputDeviceMode == CommonClass.InputDeviceModes.I2C) { num2 = 4; } else { num2 = 0; } string format = "<mainWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\" comport=\"{6}\" baud=\"{7}\" rxType=\"{8}\" messageProtocol=\"{9}\" viewType=\"{10}\" bufferSize=\"{11}\" controlVersion=\"{12}\" aidingVersion=\"{13}\" TCPClientPortNum=\"{14}\" TCPClientHostName=\"{15}\" TCPServerPortNum=\"{16}\" TCPServerHostName=\"{17}\" TrackerPort=\"{18}\" ResetPort=\"{19}\" HostPort1=\"{20}\" RequiredHostRun=\"{21}\" InputDeviceMode=\"{22}\" HostAppFilePath=\"{23}\" DefaultTCXOFreq=\"{24}\" LNAType=\"{25}\" ReadBuffer=\"{26}\" LDOMode=\"{27}\" RequireEE=\"{28}\" EESelect=\"{29}\" ServerName=\"{30}\" ServerPort=\"{31}\" AuthenticationCode=\"{32}\" EEDayNum=\"{33}\" BankTime=\"{34}\" ProdFamily=\"{35}\" RxName=\"{36}\" >"; str2 = string.Format(format, new object[] { base.Name, base.Top.ToString(), base.Left.ToString(), base.Width.ToString(), base.Height.ToString(), base.WindowState.ToString(), this.comm.PortName, this.comm.BaudRate, this.comm.RxType, this.comm.MessageProtocol, this.comm.RxCurrentTransmissionType.ToString(), class2.DisplayBuffer.ToString(), this.comm.AutoReplyCtrl.ControlChannelVersion.ToString(), this.comm.AutoReplyCtrl.AidingProtocolVersion.ToString(), this.comm.CMC.HostAppClient.TCPClientPortNum, this.comm.CMC.HostAppClient.TCPClientHostName, this.comm.CMC.HostAppServer.TCPServerPortNum, this.comm.CMC.HostAppServer.TCPServerHostName, this.comm.TrackerPort, this.comm.ResetPort, this.comm.HostPair1, num, num2, this.comm.HostSWFilePath, this.comm.DefaultTCXOFreq, this.comm.LNAType, this.comm.ReadBuffer.ToString(), this.comm.LDOMode.ToString(), this.comm.RequireEE, this.comm.EESelect, this.comm.ServerName, this.comm.ServerPort, this.comm.AuthenticationCode, this.comm.EEDayNum, this.comm.BankTime, ((int) this.comm.ProductFamily).ToString(), this.comm.RxName }); writer.WriteLine(str2); writer.WriteLine("</mainWindow>"); writer.WriteLine("</windows>"); writer.Close(); } }
private void frmSaveSettingsLoad_CommOpen(string filePath) { CommonUtilsClass class2 = new CommonUtilsClass(); if (!File.Exists(filePath)) { MessageBox.Show(string.Format("{0}\n not found use default", filePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); filePath = this._defaultWindowsRestoredFilePath; } if (File.Exists(filePath)) { try { this._appWindowsSettings.Load(filePath); foreach (XmlNode node in this._appWindowsSettings.SelectNodes("/windows/mainWindow")) { string str2; string str4; string str5; if (((str2 = node.Attributes["name"].Value.ToString()) == null) || !(str2 == "frmCommOpen")) { goto Label_0706; } this.comm.MessageProtocol = node.Attributes["messageProtocol"].Value.ToString(); this.comm.PortName = node.Attributes["comport"].Value.ToString(); this.comm.BaudRate = node.Attributes["baud"].Value.ToString(); this.comm.CMC.HostAppClient.TCPClientPortNum = Convert.ToInt32(node.Attributes["TCPClientPortNum"].Value); this.comm.CMC.HostAppClient.TCPClientHostName = node.Attributes["TCPClientHostName"].Value.ToString(); this.comm.CMC.HostAppServer.TCPServerPortNum = Convert.ToInt32(node.Attributes["TCPServerPortNum"].Value); this.comm.CMC.HostAppServer.TCPServerHostName = node.Attributes["TCPServerHostName"].Value.ToString(); this.comm.TrackerPort = node.Attributes["TrackerPort"].Value.ToString(); this.comm.ResetPort = node.Attributes["ResetPort"].Value.ToString(); this.comm.HostPair1 = node.Attributes["HostPort1"].Value.ToString(); this.comm.HostSWFilePath = node.Attributes["HostAppFilePath"].Value.ToString(); this.comm.DefaultTCXOFreq = node.Attributes["DefaultTCXOFreq"].Value.ToString(); this.comm.LNAType = Convert.ToInt32(node.Attributes["LNAType"].Value.ToString()); this.comm.ReadBuffer = Convert.ToInt32(node.Attributes["ReadBuffer"].Value.ToString()); this.comm.LDOMode = Convert.ToInt32(node.Attributes["LDOMode"].Value.ToString()); this.comm.RxName = node.Attributes["RxName"].Value.ToString(); this.comm.EESelect = node.Attributes["EESelect"].Value.ToString(); this.comm.ServerName = node.Attributes["ServerName"].Value.ToString(); this.comm.ServerPort = node.Attributes["ServerPort"].Value.ToString(); this.comm.AuthenticationCode = node.Attributes["AuthenticationCode"].Value.ToString(); this.comm.EEDayNum = node.Attributes["EEDayNum"].Value.ToString(); this.comm.BankTime = node.Attributes["BankTime"].Value.ToString(); this.comm.ProductFamily = (CommonClass.ProductType) Convert.ToInt32(node.Attributes["ProdFamily"].Value.ToString()); if (node.Attributes["RequiredHostRun"].Value.ToString() == "1") { this.comm.RequireHostRun = true; if (node.Attributes["RequireEE"].Value.ToString() == "True") { this.comm.RequireEE = true; } else { this.comm.RequireEE = false; } } else { this.comm.RequireHostRun = false; } string str3 = node.Attributes["InputDeviceMode"].Value.ToString(); if (str3 == null) { goto Label_0544; } if (!(str3 == "1")) { if (str3 == "2") { goto Label_051A; } if (str3 == "3") { goto Label_0528; } if (str3 == "4") { goto Label_0536; } goto Label_0544; } this.comm.InputDeviceMode = CommonClass.InputDeviceModes.RS232; goto Label_0550; Label_051A: this.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Client; goto Label_0550; Label_0528: this.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Server; goto Label_0550; Label_0536: this.comm.InputDeviceMode = CommonClass.InputDeviceModes.I2C; goto Label_0550; Label_0544: this.comm.InputDeviceMode = CommonClass.InputDeviceModes.FilePlayBack; Label_0550: if ((str4 = node.Attributes["rxType"].Value.ToString()) != null) { if (!(str4 == "SLC")) { if (str4 == "GSW") { goto Label_05B7; } if (str4 == "TTB") { goto Label_05C5; } if (str4 == "NMEA") { goto Label_05D3; } } else { this.comm.RxType = CommunicationManager.ReceiverType.SLC; } } goto Label_05DF; Label_05B7: this.comm.RxType = CommunicationManager.ReceiverType.GSW; goto Label_05DF; Label_05C5: this.comm.RxType = CommunicationManager.ReceiverType.TTB; goto Label_05DF; Label_05D3: this.comm.RxType = CommunicationManager.ReceiverType.NMEA; Label_05DF: if ((str5 = node.Attributes["viewType"].Value.ToString()) != null) { if (!(str5 == "CSV")) { if (str5 == "GP2") { goto Label_0657; } if (str5 == "HEX") { goto Label_0665; } if (str5 == "SSB") { goto Label_0673; } if (str5 == "TEXT") { goto Label_0681; } } else { this.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GPS; } } goto Label_068D; Label_0657: this.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GP2; goto Label_068D; Label_0665: this.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Hex; goto Label_068D; Label_0673: this.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.SSB; goto Label_068D; Label_0681: this.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Text; Label_068D: class2.DisplayBuffer = Convert.ToInt32(node.Attributes["bufferSize"].Value.ToString()); this.comm.AutoReplyCtrl.ControlChannelVersion = node.Attributes["controlVersion"].Value.ToString(); this.comm.AutoReplyCtrl.AidingProtocolVersion = node.Attributes["aidingVersion"].Value.ToString(); Label_0706: this.loadLocation(this, node.Attributes["top"].Value.ToString(), node.Attributes["left"].Value.ToString(), node.Attributes["width"].Value.ToString(), node.Attributes["height"].Value.ToString(), node.Attributes["windowState"].Value.ToString()); } } catch (Exception exception) { MessageBox.Show("frmMDIMain() + frmSaveSettingsLoad() " + exception.ToString()); } } this.Refresh(); }
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; }
private void cleanupClass() { this.dataGui = null; if (this.dataPlot != null) { this.dataPlot.Dispose(); this.dataPlot = null; } if (this._debugViewRTBDisplay != null) { this._debugViewRTBDisplay = null; } if (this._displayPanelCompass != null) { this._displayPanelCompass.Dispose(); this._displayPanelCompass = null; } if (this._displayPanelDRSensors != null) { this._displayPanelDRSensors.Dispose(); this._displayPanelDRSensors = null; } if (this._displayPanelDRStatusStates != null) { this._displayPanelDRStatusStates.Dispose(); this._displayPanelDRStatusStates = null; } if (this._displayPanelLocation != null) { this._displayPanelLocation.Dispose(); this._displayPanelLocation = null; } if (this._displayPanelMEMS != null) { this._displayPanelMEMS.Dispose(); this._displayPanelMEMS = null; } if (this._displayPanelPitch != null) { this._displayPanelPitch.Dispose(); this._displayPanelPitch = null; } if (this._displayPanelRoll != null) { this._displayPanelRoll.Dispose(); this._displayPanelRoll = null; } if (this._displayPanelSatelliteStats != null) { this._displayPanelSatelliteStats.Dispose(); this._displayPanelSatelliteStats = null; } if (this._displayPanelSignal != null) { this._displayPanelSignal.Dispose(); this._displayPanelSignal = null; } if (this._displayPanelSVs != null) { this._displayPanelSVs.Dispose(); this._displayPanelSVs = null; } if (this._displayPanelSVTraj != null) { this._displayPanelSVTraj.Dispose(); this._displayPanelSVTraj = null; } if (this._errorViewRTBDisplay != null) { this._errorViewRTBDisplay = null; } if (this._responseViewRTBDisplay != null) { this._responseViewRTBDisplay = null; } if (this.RxCtrl != null) { this.RxCtrl.Dispose(); this.RxCtrl = null; } this.ListenersCtrl = null; this.AutoReplyCtrl = null; if (this.TTBPort != null) { this.TTBPort.Dispose(); this.TTBPort = null; } if (this.comPort != null) { this.comPort.Dispose(); this.comPort = null; } this.NavigationParamrters = null; this.NavTruthDataHash = null; this.NavSolutionParams = null; this.TrackerICCtrl = null; this.SiRFNavStartStop = null; this.m_NavData = null; this._CSVBuff = null; this.m_Protocols.Dispose(); this.m_Protocols = null; this.CMC = null; this.Log = null; this.ToSendMsgQueue.Clear(); this.ToSendMsgQueue = null; this.ErrorStringList.Clear(); this.ErrorStringList = null; this.UserSpecifiedMsgList.Clear(); this.UserSpecifiedMsgList = null; this.UserSpecifiedSubStringList.Clear(); this.UserSpecifiedSubStringList = null; this._inDataBytes.Clear(); this._inDataBytes = null; }
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; } }
private void SetupRS232Comm() { CommonUtilsClass class2 = new CommonUtilsClass(); if (this.comm != null) { try { this.comm.Parity = this.cboParity.SelectedItem.ToString(); this.comm.StopBits = this.cboStop.SelectedItem.ToString(); this.comm.DataBits = this.cboData.SelectedItem.ToString(); this.comm.BaudRate = this.cboBaud.Text; this.comm.PortName = this.cboPort.Text; this.comm.FlowControl = this.cboFlowControl.SelectedIndex; this.comm.ReadBuffer = Convert.ToInt32(this.cboReadBuffer.Text); this.comm.MessageProtocol = this.cboProtocols.SelectedItem.ToString(); this.comm.AutoReplyCtrl.ControlChannelVersion = this.cboFVersion.Text.ToString(); this.comm.AutoReplyCtrl.AidingProtocolVersion = this.cboAI3Version.Text.ToString(); } catch (Exception exception) { MessageBox.Show(exception.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand); } if (this.frmComSettingsSLCRadioBtn.Checked) { this.comm.RxType = CommunicationManager.ReceiverType.SLC; } else if (this.frmComSettingsTTBRadioBtn.Checked) { this.comm.RxType = CommunicationManager.ReceiverType.TTB; } else if (this.frmComSettingsGSWRadioBtn.Checked) { this.comm.RxType = CommunicationManager.ReceiverType.GSW; } this.UpdateRxTransmissionType(); try { class2.DisplayBuffer = Convert.ToInt32(this.frmCommOpenBufferSizeTxtBox.Text); } catch (Exception exception2) { MessageBox.Show(exception2.Message, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } this.comm.InputDeviceMode = CommonClass.InputDeviceModes.RS232; this.comm.HostPair1 = this.hostAppCboHostPair1.Text; if (this.comm.ProductFamily == CommonClass.ProductType.GSD4e) { this.comm.ResetPort = this.gsd4eOnOffPortComboBox.Text; } } }
public frmCommSettings(ref CommunicationManager parentCommWindow) { CommonUtilsClass class2 = new CommonUtilsClass(); this.InitializeComponent(); this.CommWindow = parentCommWindow; if (this.comm != null) { this.frmCommOpenBufferSizeTxtBox.Text = class2.DisplayBuffer.ToString(); this.CMC = this.comm.CMC; } }
private bool frmSaveSettingsRead(string filePath) { CommonUtilsClass class2 = new CommonUtilsClass(); bool flag = false; if (!File.Exists(filePath)) { MessageBox.Show(string.Format("{0}\n not found use default", filePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); filePath = _defaultWindowsRestoredFilePath; } if (File.Exists(filePath)) { try { _appWindowsSettings.Load(filePath); XmlNodeList list = _appWindowsSettings.SelectNodes("/windows/mainWindow"); PortManager manager = null; foreach (XmlNode node in list) { string str2; string str4; string str5; if ((((str2 = node.Attributes["name"].Value.ToString()) == null) || !(str2 == "Port")) || (node.Attributes["comport"].Value.ToString() == clsGlobal.FilePlayBackPortName)) { continue; } if (PortManagerHash.Count != 0) { goto Label_1411; } manager = new PortManager(); manager.comm.PortName = node.Attributes["comport"].Value.ToString(); manager.comm.sourceDeviceName = manager.comm.PortName; manager.comm.MessageProtocol = node.Attributes["messageProtocol"].Value.ToString(); manager.comm.BaudRate = node.Attributes["baud"].Value.ToString(); manager.comm.FlowControl = Convert.ToInt32(node.Attributes["flowControl"].Value.ToString()); manager.comm.CMC.HostAppClient.TCPClientPortNum = Convert.ToInt32(node.Attributes["TCPClientPortNum"].Value); manager.comm.CMC.HostAppClient.TCPClientHostName = node.Attributes["TCPClientHostName"].Value.ToString(); manager.comm.CMC.HostAppServer.TCPServerPortNum = Convert.ToInt32(node.Attributes["TCPServerPortNum"].Value); manager.comm.CMC.HostAppServer.TCPServerHostName = node.Attributes["TCPServerHostName"].Value.ToString(); manager.comm.TrackerPort = node.Attributes["TrackerPort"].Value.ToString(); manager.comm.ResetPort = node.Attributes["ResetPort"].Value.ToString(); manager.comm.HostPair1 = node.Attributes["HostPort1"].Value.ToString(); manager.comm.HostSWFilePath = node.Attributes["HostAppFilePath"].Value.ToString(); manager.comm.HostAppCfgFilePath = node.Attributes["HostAppCfgFilePath"].Value.ToString(); manager.comm.HostAppMEMSCfgPath = node.Attributes["HostAppMEMSCfgPath"].Value.ToString(); manager.comm.DefaultTCXOFreq = node.Attributes["DefaultTCXOFreq"].Value.ToString(); manager.comm.LNAType = Convert.ToInt32(node.Attributes["LNAType"].Value.ToString()); manager.comm.ReadBuffer = Convert.ToInt32(node.Attributes["ReadBuffer"].Value.ToString()); manager.comm.LDOMode = Convert.ToInt32(node.Attributes["LDOMode"].Value.ToString()); manager.comm.RxName = node.Attributes["RxName"].Value.ToString(); manager.comm.IsVersion4_1_A8AndAbove = node.Attributes["IsVersionGreater4_1_A8"].Value.ToString() == "1"; manager.comm.EESelect = node.Attributes["EESelect"].Value.ToString(); manager.comm.ServerName = node.Attributes["ServerName"].Value.ToString(); manager.comm.ServerPort = node.Attributes["ServerPort"].Value.ToString(); manager.comm.AuthenticationCode = node.Attributes["AuthenticationCode"].Value.ToString(); manager.comm.EEDayNum = node.Attributes["EEDayNum"].Value.ToString(); manager.comm.BankTime = node.Attributes["BankTime"].Value.ToString(); manager.comm.ProductFamily = (CommonClass.ProductType) Convert.ToInt32(node.Attributes["ProdFamily"].Value.ToString()); if (node.Attributes["RequiredHostRun"].Value.ToString() == "1") { manager.comm.RequireHostRun = true; if (node.Attributes["RequireEE"].Value.ToString() == "True") { manager.comm.RequireEE = true; } else { manager.comm.RequireEE = false; } } else { manager.comm.RequireHostRun = false; } string str3 = node.Attributes["InputDeviceMode"].Value.ToString(); if (str3 == null) { goto Label_0661; } if (!(str3 == "1")) { if (str3 == "2") { goto Label_0637; } if (str3 == "3") { goto Label_0645; } if (str3 == "4") { goto Label_0653; } goto Label_0661; } manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.RS232; goto Label_066D; Label_0637: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Client; goto Label_066D; Label_0645: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Server; goto Label_066D; Label_0653: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.I2C; goto Label_066D; Label_0661: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.FilePlayBack; Label_066D: if ((str4 = node.Attributes["rxType"].Value.ToString()) != null) { if (!(str4 == "SLC")) { if (str4 == "GSW") { goto Label_06D5; } if (str4 == "TTB") { goto Label_06E3; } if (str4 == "NMEA") { goto Label_06F1; } } else { manager.comm.RxType = CommunicationManager.ReceiverType.SLC; } } goto Label_06FD; Label_06D5: manager.comm.RxType = CommunicationManager.ReceiverType.GSW; goto Label_06FD; Label_06E3: manager.comm.RxType = CommunicationManager.ReceiverType.TTB; goto Label_06FD; Label_06F1: manager.comm.RxType = CommunicationManager.ReceiverType.NMEA; Label_06FD: if ((str5 = node.Attributes["viewType"].Value.ToString()) != null) { if (!(str5 == "GPS")) { if (str5 == "GP2") { goto Label_0776; } if (str5 == "HEX") { goto Label_0784; } if (str5 == "SSB") { goto Label_0792; } if (str5 == "TEXT") { goto Label_07A0; } } else { manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GPS; } } goto Label_07AC; Label_0776: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GP2; goto Label_07AC; Label_0784: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Hex; goto Label_07AC; Label_0792: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.SSB; goto Label_07AC; Label_07A0: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Text; Label_07AC: class2.DisplayBuffer = Convert.ToInt32(node.Attributes["bufferSize"].Value.ToString()); manager.comm.AutoReplyCtrl.ControlChannelVersion = node.Attributes["controlVersion"].Value.ToString(); manager.comm.AutoReplyCtrl.AidingProtocolVersion = node.Attributes["aidingVersion"].Value.ToString(); foreach (XmlNode node2 in node) { switch (node2.Attributes["name"].Value.ToString()) { case "frmCommInputMessage": manager.InputCommandLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.InputCommandLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.InputCommandLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.InputCommandLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); manager.InputCommandLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.InputCommandLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.InputCommandLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.InputCommandLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommRadarMap": manager.SVsMapLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.SVsMapLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.SVsMapLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.SVsMapLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmSatelliteStats": manager.SatelliteStatsLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.SatelliteStatsLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.SatelliteStatsLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.SatelliteStatsLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommLocationMap": manager.LocationMapLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.LocationMapLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.LocationMapLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.LocationMapLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommSignalView": manager.SignalViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.SignalViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.SignalViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.SignalViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommMessageFilter": manager.MessageViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.MessageViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.MessageViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.MessageViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmTTFFDisplay": manager.TTFFDisplayLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.TTFFDisplayLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.TTFFDisplayLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.TTFFDisplayLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmSiRFAware": manager.SiRFawareLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.SiRFawareLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.SiRFawareLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.SiRFawareLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommDebugView": manager.DebugViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.DebugViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.DebugViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.DebugViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommResponseView": manager.ResponseViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.ResponseViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.ResponseViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.ResponseViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCommErrorView": manager.ErrorViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.ErrorViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.ErrorViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.ErrorViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmInterenceReport": manager.InterferenceLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.InterferenceLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.InterferenceLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.InterferenceLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; case "frmCompassView": manager.CompassViewLocation.Left = Convert.ToInt32(node2.Attributes["left"].Value.ToString()); manager.CompassViewLocation.Top = Convert.ToInt32(node2.Attributes["top"].Value.ToString()); manager.CompassViewLocation.Width = Convert.ToInt32(node2.Attributes["width"].Value.ToString()); manager.CompassViewLocation.Height = Convert.ToInt32(node2.Attributes["height"].Value.ToString()); break; } } if (!PortManagerHash.ContainsKey(manager.comm.PortName)) { PortManagerHash.Add(manager.comm.PortName, manager); } else { PortManagerHash[manager.comm.PortName] = manager; } updateToolStripPortComboBox(manager.comm.PortName, true); manager.UpdateMainWindow += new PortManager.updateParentEventHandler(updateMainWindowTitle); toolStripNumPortTxtBox.Text = PortManagerHash.Count.ToString(); manager.PerPortToolStrip = AddPortToolbar((toolStripMain.Location.Y + (0x19 * PortManagerHash.Count)) + 0x23, manager.comm.PortName); updateGUIOnConnectNDisconnect(manager); goto Label_1E7A; Label_1411: foreach (XmlNode node3 in node) { switch (node3.Attributes["name"].Value.ToString()) { case "frmCommInputMessage": InputCommandLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); InputCommandLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); InputCommandLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); InputCommandLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommRadarMap": SVsMapLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); SVsMapLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); SVsMapLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); SVsMapLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmSatelliteStats": SatelliteStatsLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); SatelliteStatsLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); SatelliteStatsLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); SatelliteStatsLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommLocationMap": LocationMapLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); LocationMapLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); LocationMapLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); LocationMapLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommSignalView": SignalViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); SignalViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); SignalViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); SignalViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommMessageFilter": MessageViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); MessageViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); MessageViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); MessageViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmTTFFDisplay": TTFFDisplayLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); TTFFDisplayLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); TTFFDisplayLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); TTFFDisplayLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmSiRFAware": SiRFawareLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); SiRFawareLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); SiRFawareLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); SiRFawareLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommDebugView": DebugViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); DebugViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); DebugViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); DebugViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommResponseView": ResponseViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); ResponseViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); ResponseViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); ResponseViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCommErrorView": ErrorViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); ErrorViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); ErrorViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); ErrorViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmInterenceReport": InterferenceLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); InterferenceLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); InterferenceLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); InterferenceLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; case "frmCompassView": CompassViewLocation.Left = Convert.ToInt32(node3.Attributes["left"].Value.ToString()); CompassViewLocation.Top = Convert.ToInt32(node3.Attributes["top"].Value.ToString()); CompassViewLocation.Width = Convert.ToInt32(node3.Attributes["width"].Value.ToString()); CompassViewLocation.Height = Convert.ToInt32(node3.Attributes["height"].Value.ToString()); break; } } Label_1E7A: flag = true; } if ((PortManagerHash.Count > 1) && !toolStripPortComboBox.Items.Contains("All")) { toolStripPortComboBox.Items.Add("All"); } } catch (Exception exception) { MessageBox.Show("frmMDIMain() + frmSaveSettingsLoad() " + exception.ToString()); } } return flag; }
private void frmSaveSettingsOnClosing(string filePath) { StreamWriter writer; CommonUtilsClass class2 = new CommonUtilsClass(); if (File.Exists(filePath)) { if ((File.GetAttributes(filePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) { MessageBox.Show(string.Format("File is read only - Window locations were not saved!\n{0}", filePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); Cursor = Cursors.Default; return; } writer = new StreamWriter(filePath); } else { writer = File.CreateText(filePath); } if (writer != null) { object[] objArray; writer.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); writer.WriteLine("<windows>"); string str2 = string.Empty; foreach (string str3 in PortManagerHash.Keys) { PortManager manager = (PortManager) PortManagerHash[str3]; if ((manager != null) && (manager.comm.PortName != clsGlobal.FilePlayBackPortName)) { int num = manager.comm.RequireHostRun ? 1 : 0; int num2 = 0; if (manager.comm.InputDeviceMode == CommonClass.InputDeviceModes.RS232) { num2 = 1; } else if (manager.comm.InputDeviceMode == CommonClass.InputDeviceModes.TCP_Client) { num2 = 2; } else if (manager.comm.InputDeviceMode == CommonClass.InputDeviceModes.TCP_Server) { num2 = 3; } else if (manager.comm.InputDeviceMode == CommonClass.InputDeviceModes.I2C) { num2 = 4; } else { num2 = 0; } string format = "<mainWindow name=\"{0}\" comport=\"{1}\" baud=\"{2}\" rxType=\"{3}\" messageProtocol=\"{4}\" viewType=\"{5}\" bufferSize=\"{6}\" controlVersion=\"{7}\" aidingVersion=\"{8}\" TCPClientPortNum=\"{9}\" TCPClientHostName=\"{10}\" TCPServerPortNum=\"{11}\" TCPServerHostName=\"{12}\" TrackerPort=\"{13}\" ResetPort=\"{14}\" HostPort1=\"{15}\" RequiredHostRun=\"{16}\" InputDeviceMode=\"{17}\" HostAppFilePath=\"{18}\" DefaultTCXOFreq=\"{19}\" LNAType=\"{20}\" ReadBuffer=\"{21}\" LDOMode=\"{22}\" IsVersionGreater4_1_A8=\"{23}\" RequireEE=\"{24}\" EESelect=\"{25}\" ServerName=\"{26}\" ServerPort=\"{27}\" AuthenticationCode=\"{28}\" EEDayNum=\"{29}\" BankTime=\"{30}\" ProdFamily=\"{31}\" RxName=\"{32}\" flowControl=\"{33}\" HostAppCfgFilePath=\"{34}\" HostAppMEMSCfgPath=\"{35}\" >"; objArray = new object[0x24]; objArray[0] = "Port"; objArray[1] = manager.comm.PortName; objArray[2] = manager.comm.BaudRate; objArray[3] = manager.comm.RxType; objArray[4] = manager.comm.MessageProtocol; objArray[5] = manager.comm.RxCurrentTransmissionType.ToString(); int displayBuffer = class2.DisplayBuffer; objArray[6] = displayBuffer.ToString(); objArray[7] = manager.comm.AutoReplyCtrl.ControlChannelVersion.ToString(); objArray[8] = manager.comm.AutoReplyCtrl.AidingProtocolVersion.ToString(); objArray[9] = manager.comm.CMC.HostAppClient.TCPClientPortNum; objArray[10] = manager.comm.CMC.HostAppClient.TCPClientHostName; objArray[11] = manager.comm.CMC.HostAppServer.TCPServerPortNum; objArray[12] = manager.comm.CMC.HostAppServer.TCPServerHostName; objArray[13] = manager.comm.TrackerPort; objArray[14] = manager.comm.ResetPort; objArray[15] = manager.comm.HostPair1; objArray[0x10] = num; objArray[0x11] = num2; objArray[0x12] = manager.comm.HostSWFilePath; objArray[0x13] = manager.comm.DefaultTCXOFreq; objArray[20] = manager.comm.LNAType; objArray[0x15] = manager.comm.ReadBuffer.ToString(); objArray[0x16] = manager.comm.LDOMode.ToString(); objArray[0x17] = manager.comm.IsVersion4_1_A8AndAbove ? "1" : "0"; objArray[0x18] = manager.comm.RequireEE; objArray[0x19] = manager.comm.EESelect; objArray[0x1a] = manager.comm.ServerName; objArray[0x1b] = manager.comm.ServerPort; objArray[0x1c] = manager.comm.AuthenticationCode; objArray[0x1d] = manager.comm.EEDayNum; objArray[30] = manager.comm.BankTime; objArray[0x1f] = ((int) manager.comm.ProductFamily).ToString(); objArray[0x20] = manager.comm.RxName; objArray[0x21] = manager.comm.FlowControl; objArray[0x22] = manager.comm.HostAppCfgFilePath; objArray[0x23] = manager.comm.HostAppMEMSCfgPath; str2 = string.Format(format, objArray); writer.WriteLine(str2); if ((manager._signalStrengthPanel != null) && manager.SignalViewLocation.IsOpen) { frmCommSignalView view = manager._signalStrengthPanel; manager.SignalViewLocation.Width = view.Width; manager.SignalViewLocation.Height = view.Height; manager.SignalViewLocation.Left = view.Left; manager.SignalViewLocation.Top = view.Top; str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", new object[] { view.Name, view.Top.ToString(), view.Left.ToString(), view.Width.ToString(), view.Height.ToString(), view.WindowState.ToString() }); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._svsMapPanel != null) && manager.SVsMapLocation.IsOpen) { frmCommRadarMap map = manager._svsMapPanel; manager.SVsMapLocation.Width = map.Width; manager.SVsMapLocation.Height = map.Height; manager.SVsMapLocation.Left = map.Left; manager.SVsMapLocation.Top = map.Top; str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", new object[] { map.Name, map.Top.ToString(), map.Left.ToString(), map.Width.ToString(), map.Height.ToString(), map.WindowState.ToString() }); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._svsTrajPanel != null) && manager.SVTrajViewLocation.IsOpen) { frmCommSVTrajectory trajectory = manager._svsTrajPanel; manager.SVTrajViewLocation.Width = trajectory.Width; manager.SVTrajViewLocation.Height = trajectory.Height; manager.SVTrajViewLocation.Left = trajectory.Left; manager.SVTrajViewLocation.Top = trajectory.Top; str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", new object[] { trajectory.Name, trajectory.Top.ToString(), trajectory.Left.ToString(), trajectory.Width.ToString(), trajectory.Height.ToString(), trajectory.WindowState.ToString() }); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._svsCNoPanel != null) && manager.SVCNoViewLocation.IsOpen) { frmCommSVAvgCNo no = manager._svsCNoPanel; manager.SVCNoViewLocation.Width = no.Width; manager.SVCNoViewLocation.Height = no.Height; manager.SVCNoViewLocation.Left = no.Left; manager.SVCNoViewLocation.Top = no.Top; str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", new object[] { no.Name, no.Top.ToString(), no.Left.ToString(), no.Width.ToString(), no.Height.ToString(), no.WindowState.ToString() }); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._svsTrackedVsTimePanel != null) && manager.SVTrackedVsTimeViewLocation.IsOpen) { frmCommSVTrackedVsTime time = manager._svsTrackedVsTimePanel; manager.SVTrackedVsTimeViewLocation.Width = time.Width; manager.SVTrackedVsTimeViewLocation.Height = time.Height; manager.SVTrackedVsTimeViewLocation.Left = time.Left; manager.SVTrackedVsTimeViewLocation.Top = time.Top; str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", new object[] { time.Name, time.Top.ToString(), time.Left.ToString(), time.Width.ToString(), time.Height.ToString(), time.WindowState.ToString() }); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager.NavVsTimeView != null) && manager.NavVsTimeLocation.IsOpen) { frmCommNavAccVsTime navVsTimeView = manager.NavVsTimeView; manager.NavVsTimeLocation.Width = navVsTimeView.Width; manager.NavVsTimeLocation.Height = navVsTimeView.Height; manager.NavVsTimeLocation.Left = navVsTimeView.Left; manager.NavVsTimeLocation.Top = navVsTimeView.Top; object[] args = new object[6]; args[0] = navVsTimeView.Name; args[1] = navVsTimeView.Top.ToString(); args[2] = navVsTimeView.Left.ToString(); displayBuffer = navVsTimeView.Width; args[3] = displayBuffer.ToString(); displayBuffer = navVsTimeView.Height; args[4] = displayBuffer.ToString(); args[5] = navVsTimeView.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", args); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._SatelliteStats != null) && manager.SatelliteStatsLocation.IsOpen) { frmSatelliteStats stats = manager._SatelliteStats; manager.SatelliteStatsLocation.Width = stats.Width; manager.SatelliteStatsLocation.Height = stats.Height; manager.SatelliteStatsLocation.Left = stats.Left; manager.SatelliteStatsLocation.Top = stats.Top; objArray = new object[6]; objArray[0] = stats.Name; displayBuffer = stats.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = stats.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = stats.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = stats.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = stats.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._locationViewPanel != null) && manager.LocationMapLocation.IsOpen) { frmCommLocationMap map2 = manager._locationViewPanel; manager.LocationMapLocation.Width = map2.Width; manager.LocationMapLocation.Height = map2.Height; manager.LocationMapLocation.Left = map2.Left; manager.LocationMapLocation.Top = map2.Top; objArray = new object[7]; objArray[0] = map2.Name; displayBuffer = map2.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = map2.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = map2.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = map2.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = map2.WindowState.ToString(); objArray[6] = map2.CommWindow.LocationMapRadius.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\" locationMapRadius=\"{6}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._inputCommands != null) && manager.InputCommandLocation.IsOpen) { frmCommInputMessage message = manager._inputCommands; manager.InputCommandLocation.Width = message.Width; manager.InputCommandLocation.Height = message.Height; manager.InputCommandLocation.Left = message.Left; manager.InputCommandLocation.Top = message.Top; objArray = new object[6]; objArray[0] = message.Name; displayBuffer = message.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = message.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = message.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = message.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = message.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._ttffDisplay != null) && manager.TTFFDisplayLocation.IsOpen) { frmTTFFDisplay display = manager._ttffDisplay; manager.TTFFDisplayLocation.Width = display.Width; manager.TTFFDisplayLocation.Height = display.Height; manager.TTFFDisplayLocation.Left = display.Left; manager.TTFFDisplayLocation.Top = display.Top; objArray = new object[6]; objArray[0] = display.Name; displayBuffer = display.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = display.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = display.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = display.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = display.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager.DebugView != null) && manager.DebugViewLocation.IsOpen) { frmCommDebugView debugView = manager.DebugView; manager.DebugViewLocation.Width = debugView.Width; manager.DebugViewLocation.Height = debugView.Height; manager.DebugViewLocation.Left = debugView.Left; manager.DebugViewLocation.Top = debugView.Top; objArray = new object[6]; objArray[0] = debugView.Name; displayBuffer = debugView.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = debugView.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = debugView.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = debugView.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = debugView.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._responseView != null) && manager.ResponseViewLocation.IsOpen) { frmCommResponseView view3 = manager._responseView; manager.ResponseViewLocation.Width = view3.Width; manager.ResponseViewLocation.Height = view3.Height; manager.ResponseViewLocation.Left = view3.Left; manager.ResponseViewLocation.Top = view3.Top; objArray = new object[6]; objArray[0] = view3.Name; displayBuffer = view3.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = view3.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = view3.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = view3.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = view3.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._errorView != null) && manager.ErrorViewLocation.IsOpen) { frmCommErrorView view4 = manager._errorView; manager.ErrorViewLocation.Width = view4.Width; manager.ErrorViewLocation.Height = view4.Height; manager.ErrorViewLocation.Left = view4.Left; manager.ErrorViewLocation.Top = view4.Top; objArray = new object[6]; objArray[0] = view4.Name; displayBuffer = view4.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = view4.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = view4.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = view4.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = view4.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._interferenceReport != null) && manager.InterferenceLocation.IsOpen) { frmInterferenceReport report = manager._interferenceReport; manager.InterferenceLocation.Width = report.Width; manager.InterferenceLocation.Height = report.Height; manager.InterferenceLocation.Left = report.Left; manager.InterferenceLocation.Top = report.Top; objArray = new object[6]; objArray[0] = report.Name; displayBuffer = report.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = report.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = report.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = report.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = report.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._SiRFAware != null) && manager.SiRFawareLocation.IsOpen) { frmCommSiRFawareV2 ev = manager._SiRFAware; manager.SiRFawareLocation.Width = ev.Width; manager.SiRFawareLocation.Height = ev.Height; manager.SiRFawareLocation.Left = ev.Left; manager.SiRFawareLocation.Top = ev.Top; objArray = new object[6]; objArray[0] = ev.Name; displayBuffer = ev.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = ev.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = ev.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = ev.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = ev.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager.MessageView != null) && manager.MessageViewLocation.IsOpen) { frmCommMessageFilter messageView = manager.MessageView; manager.MessageViewLocation.Width = messageView.Width; manager.MessageViewLocation.Height = messageView.Height; manager.MessageViewLocation.Left = messageView.Left; manager.MessageViewLocation.Top = messageView.Top; objArray = new object[6]; objArray[0] = messageView.Name; displayBuffer = messageView.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = messageView.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = messageView.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = messageView.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = messageView.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } if ((manager._compassView != null) && manager.CompassViewLocation.IsOpen) { frmCompassView view5 = manager._compassView; manager.CompassViewLocation.Width = view5.Width; manager.CompassViewLocation.Height = view5.Height; manager.CompassViewLocation.Left = view5.Left; manager.CompassViewLocation.Top = view5.Top; objArray = new object[6]; objArray[0] = view5.Name; displayBuffer = view5.Top; objArray[1] = displayBuffer.ToString(); displayBuffer = view5.Left; objArray[2] = displayBuffer.ToString(); displayBuffer = view5.Width; objArray[3] = displayBuffer.ToString(); displayBuffer = view5.Height; objArray[4] = displayBuffer.ToString(); objArray[5] = view5.WindowState.ToString(); str2 = string.Format("<subWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</subWindow>"); } writer.WriteLine("</mainWindow>"); } } foreach (Form form in base.MdiChildren) { str2 = string.Empty; switch (form.Name) { case "frmPerformanceMonitor": case "frmPython": case "frmAutomationTests": case "frmFileReplay": case "frmGPIBCtrl": case "frmRackCtrl": case "frmSimplexCtrl": case "frmSPAzCtrl": case "frmRFPlaybackConfig": case "frmRFPlaybackCtrl": case "frmE911Report": case "frmNavPerformanceReport": objArray = new object[] { form.Name, form.Top.ToString(), form.Left.ToString(), form.Width.ToString(), form.Height.ToString(), form.WindowState.ToString() }; str2 = string.Format("<mainWindow name=\"{0}\" top=\"{1}\" left=\"{2}\" width=\"{3}\" height=\"{4}\" windowState=\"{5}\">", objArray); writer.WriteLine(str2); writer.WriteLine("</mainWindow>"); break; } } writer.WriteLine("</windows>"); writer.Close(); } }
private void frmSaveSettingsLoad(string filePath) { CommonUtilsClass class2 = new CommonUtilsClass(); if (!File.Exists(filePath)) { MessageBox.Show(string.Format("{0}\n not found use default", filePath), "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); filePath = _defaultWindowsRestoredFilePath; } isLoading = true; if (File.Exists(filePath)) { try { _appWindowsSettings.Load(filePath); XmlNodeList list = _appWindowsSettings.SelectNodes("/windows/mainWindow"); object messageView = null; object obj3 = null; foreach (XmlNode node in list) { PortManager manager; frmCommOpen open; string str3; string str4; string str5; string str7; string str8; string str9; obj3 = null; switch (node.Attributes["name"].Value.ToString()) { case "Port": if (node.Attributes["comport"].Value.ToString() == clsGlobal.FilePlayBackPortName) { continue; } manager = new PortManager(); manager.comm.PortName = node.Attributes["comport"].Value.ToString(); manager.comm.sourceDeviceName = manager.comm.PortName; manager.comm.MessageProtocol = node.Attributes["messageProtocol"].Value.ToString(); manager.comm.BaudRate = node.Attributes["baud"].Value.ToString(); manager.comm.FlowControl = Convert.ToInt32(node.Attributes["flowControl"].Value.ToString()); manager.comm.CMC.HostAppClient.TCPClientPortNum = Convert.ToInt32(node.Attributes["TCPClientPortNum"].Value); manager.comm.CMC.HostAppClient.TCPClientHostName = node.Attributes["TCPClientHostName"].Value.ToString(); manager.comm.CMC.HostAppServer.TCPServerPortNum = Convert.ToInt32(node.Attributes["TCPServerPortNum"].Value); manager.comm.CMC.HostAppServer.TCPServerHostName = node.Attributes["TCPServerHostName"].Value.ToString(); manager.comm.TrackerPort = node.Attributes["TrackerPort"].Value.ToString(); manager.comm.ResetPort = node.Attributes["ResetPort"].Value.ToString(); manager.comm.HostPair1 = node.Attributes["HostPort1"].Value.ToString(); manager.comm.HostSWFilePath = node.Attributes["HostAppFilePath"].Value.ToString(); manager.comm.HostAppCfgFilePath = node.Attributes["HostAppCfgFilePath"].Value.ToString(); manager.comm.HostAppMEMSCfgPath = node.Attributes["HostAppMEMSCfgPath"].Value.ToString(); manager.comm.DefaultTCXOFreq = node.Attributes["DefaultTCXOFreq"].Value.ToString(); manager.comm.LNAType = Convert.ToInt32(node.Attributes["LNAType"].Value.ToString()); manager.comm.ReadBuffer = Convert.ToInt32(node.Attributes["ReadBuffer"].Value.ToString()); manager.comm.LDOMode = Convert.ToInt32(node.Attributes["LDOMode"].Value.ToString()); manager.comm.RxName = node.Attributes["RxName"].Value.ToString(); manager.comm.IsVersion4_1_A8AndAbove = node.Attributes["IsVersionGreater4_1_A8"].Value.ToString() == "1"; manager.comm.EESelect = node.Attributes["EESelect"].Value.ToString(); manager.comm.ServerName = node.Attributes["ServerName"].Value.ToString(); manager.comm.ServerPort = node.Attributes["ServerPort"].Value.ToString(); manager.comm.AuthenticationCode = node.Attributes["AuthenticationCode"].Value.ToString(); manager.comm.EEDayNum = node.Attributes["EEDayNum"].Value.ToString(); manager.comm.BankTime = node.Attributes["BankTime"].Value.ToString(); manager.comm.ProductFamily = (CommonClass.ProductType) Convert.ToInt32(node.Attributes["ProdFamily"].Value.ToString()); if (!(node.Attributes["RequiredHostRun"].Value.ToString() == "1")) { goto Label_06FD; } manager.comm.RequireHostRun = true; if (!(node.Attributes["RequireEE"].Value.ToString() == "True")) { break; } manager.comm.RequireEE = true; goto Label_070A; case "frmCommOpen": obj3 = CreateCommWindow(); open = (frmCommOpen) obj3; clsGlobal.IsMarketingUser(); open.comm.MessageProtocol = node.Attributes["messageProtocol"].Value.ToString(); open.comm.PortName = node.Attributes["comport"].Value.ToString(); open.comm.BaudRate = node.Attributes["baud"].Value.ToString(); open.comm.CMC.HostAppClient.TCPClientPortNum = Convert.ToInt32(node.Attributes["TCPClientPortNum"].Value); open.comm.CMC.HostAppClient.TCPClientHostName = node.Attributes["TCPClientHostName"].Value.ToString(); open.comm.CMC.HostAppServer.TCPServerPortNum = Convert.ToInt32(node.Attributes["TCPServerPortNum"].Value); open.comm.CMC.HostAppServer.TCPServerHostName = node.Attributes["TCPServerHostName"].Value.ToString(); open.comm.TrackerPort = node.Attributes["TrackerPort"].Value.ToString(); open.comm.ResetPort = node.Attributes["ResetPort"].Value.ToString(); open.comm.HostPair1 = node.Attributes["HostPort1"].Value.ToString(); open.comm.HostSWFilePath = node.Attributes["HostAppFilePath"].Value.ToString(); open.comm.DefaultTCXOFreq = node.Attributes["DefaultTCXOFreq"].Value.ToString(); open.comm.LNAType = Convert.ToInt32(node.Attributes["LNAType"].Value.ToString()); open.comm.ReadBuffer = Convert.ToInt32(node.Attributes["ReadBuffer"].Value.ToString()); open.comm.LDOMode = Convert.ToInt32(node.Attributes["LDOMode"].Value.ToString()); open.comm.RxName = node.Attributes["RxName"].Value.ToString(); open.comm.EESelect = node.Attributes["EESelect"].Value.ToString(); open.comm.ServerName = node.Attributes["ServerName"].Value.ToString(); open.comm.ServerPort = node.Attributes["ServerPort"].Value.ToString(); open.comm.AuthenticationCode = node.Attributes["AuthenticationCode"].Value.ToString(); open.comm.EEDayNum = node.Attributes["EEDayNum"].Value.ToString(); open.comm.BankTime = node.Attributes["BankTime"].Value.ToString(); open.comm.ProductFamily = (CommonClass.ProductType) Convert.ToInt32(node.Attributes["ProdFamily"].Value.ToString()); if (!(node.Attributes["RequiredHostRun"].Value.ToString() == "1")) { goto Label_2402; } open.comm.RequireHostRun = true; if (!(node.Attributes["RequireEE"].Value.ToString() == "True")) { goto Label_23F3; } open.comm.RequireEE = true; goto Label_240F; case "frmPerformanceMonitor": obj3 = CreatefrmPerformanceMonitorWindow(); goto Label_291E; case "frmPython": obj3 = CreatePythonWindow(); goto Label_291E; case "frmAutomationTests": obj3 = CreateAutomationTestWindow(); goto Label_291E; case "frmFileReplay": obj3 = CreateFileReplayWindow(); goto Label_291E; /* * //! case "frmGPIBCtrl": obj3 = CreateGPIBCtrlWindow(); goto Label_291E; */ case "frmRackCtrl": obj3 = CreateTestRackCtrl(); goto Label_291E; case "frmSimplexCtrl": obj3 = CreateSimplexCtrlWindow(); goto Label_291E; case "frmSPAzCtrl": obj3 = CreateSPAzCtrlWindow(); goto Label_291E; case "frmRFPlaybackConfig": obj3 = CreateRFReplayConfigWindow(); goto Label_291E; case "frmRFPlaybackCtrl": obj3 = CreateRFReplayPlaybackWindow(); goto Label_291E; case "frmRFCaptureCtrl": obj3 = CreateRFReplayCaptureWindow(); goto Label_291E; case "frmE911Report": obj3 = CreateE911CtrlWindow("E911"); goto Label_291E; case "frmNavPerformanceReport": obj3 = CreatePerformanceReportCtrlWindow(); goto Label_291E; default: goto Label_291E; } manager.comm.RequireEE = false; goto Label_070A; Label_06FD: manager.comm.RequireHostRun = false; Label_070A: if ((str3 = node.Attributes["InputDeviceMode"].Value.ToString()) == null) { goto Label_0783; } if (!(str3 == "1")) { if (str3 == "2") { goto Label_0765; } if (str3 == "3") { goto Label_0774; } goto Label_0783; } manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.RS232; goto Label_0790; Label_0765: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Client; goto Label_0790; Label_0774: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Server; goto Label_0790; Label_0783: manager.comm.InputDeviceMode = CommonClass.InputDeviceModes.FilePlayBack; Label_0790: if ((str4 = node.Attributes["rxType"].Value.ToString()) != null) { if (!(str4 == "SLC")) { if (str4 == "GSW") { goto Label_07F9; } if (str4 == "TTB") { goto Label_0808; } if (str4 == "NMEA") { goto Label_0817; } } else { manager.comm.RxType = CommunicationManager.ReceiverType.SLC; } } goto Label_0824; Label_07F9: manager.comm.RxType = CommunicationManager.ReceiverType.GSW; goto Label_0824; Label_0808: manager.comm.RxType = CommunicationManager.ReceiverType.TTB; goto Label_0824; Label_0817: manager.comm.RxType = CommunicationManager.ReceiverType.NMEA; Label_0824: if ((str5 = node.Attributes["viewType"].Value.ToString()) != null) { if (!(str5 == "GPS")) { if (str5 == "GP2") { goto Label_089E; } if (str5 == "HEX") { goto Label_08AD; } if (str5 == "SSB") { goto Label_08BC; } if (str5 == "TEXT") { goto Label_08CB; } } else { manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GPS; } } goto Label_08D8; Label_089E: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GP2; goto Label_08D8; Label_08AD: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Hex; goto Label_08D8; Label_08BC: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.SSB; goto Label_08D8; Label_08CB: manager.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Text; Label_08D8: class2.DisplayBuffer = Convert.ToInt32(node.Attributes["bufferSize"].Value.ToString()); manager.comm.AutoReplyCtrl.ControlChannelVersion = node.Attributes["controlVersion"].Value.ToString(); manager.comm.AutoReplyCtrl.AidingProtocolVersion = node.Attributes["aidingVersion"].Value.ToString(); foreach (XmlNode node2 in node) { messageView = null; switch (node2.Attributes["name"].Value.ToString()) { case "frmCommInputMessage": manager._inputCommands = CreateInputCommandsWin(manager); if (manager._inputCommands != null) { manager._inputCommands.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._inputCommands.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._inputCommands.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._inputCommands.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.InputCommandLocation.Top = manager._inputCommands.WinTop; manager.InputCommandLocation.Left = manager._inputCommands.WinLeft; manager.InputCommandLocation.Width = manager._inputCommands.WinWidth; manager.InputCommandLocation.Height = manager._inputCommands.WinHeight; manager.InputCommandLocation.IsOpen = true; messageView = manager._inputCommands; } break; case "frmCommRadarMap": manager._svsMapPanel = CreateRadarViewWin(manager); if (manager._svsMapPanel != null) { manager._svsMapPanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._svsMapPanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._svsMapPanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._svsMapPanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SVsMapLocation.Top = manager._svsMapPanel.WinTop; manager.SVsMapLocation.Left = manager._svsMapPanel.WinLeft; manager.SVsMapLocation.Width = manager._svsMapPanel.WinWidth; manager.SVsMapLocation.Height = manager._svsMapPanel.WinHeight; manager.SVsMapLocation.IsOpen = true; messageView = manager._svsMapPanel; } break; case "frmCommSVTrajectory": manager._svsTrajPanel = CreateSVTrajWin(manager); if (manager._svsTrajPanel != null) { manager._svsTrajPanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._svsTrajPanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._svsTrajPanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._svsTrajPanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SVTrajViewLocation.Top = manager._svsTrajPanel.WinTop; manager.SVTrajViewLocation.Left = manager._svsTrajPanel.WinLeft; manager.SVTrajViewLocation.Width = manager._svsTrajPanel.WinWidth; manager.SVTrajViewLocation.Height = manager._svsTrajPanel.WinHeight; manager.SVTrajViewLocation.IsOpen = true; messageView = manager._svsTrajPanel; } break; case "frmCommSVAvgCNo": manager._svsCNoPanel = CreateSVCNoWin(manager); if (manager._svsCNoPanel != null) { manager._svsCNoPanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._svsCNoPanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._svsCNoPanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._svsCNoPanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SVCNoViewLocation.Top = manager._svsCNoPanel.WinTop; manager.SVCNoViewLocation.Left = manager._svsCNoPanel.WinLeft; manager.SVCNoViewLocation.Width = manager._svsCNoPanel.WinWidth; manager.SVCNoViewLocation.Height = manager._svsCNoPanel.WinHeight; manager.SVCNoViewLocation.IsOpen = true; messageView = manager._svsCNoPanel; } break; case "frmCommSVTrackedVsTime": manager._svsTrackedVsTimePanel = CreateSVTrackedVsTimeWin(manager); if (manager._svsTrackedVsTimePanel != null) { manager._svsTrackedVsTimePanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._svsTrackedVsTimePanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._svsTrackedVsTimePanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._svsTrackedVsTimePanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SVTrackedVsTimeViewLocation.Top = manager._svsTrackedVsTimePanel.WinTop; manager.SVTrackedVsTimeViewLocation.Left = manager._svsTrackedVsTimePanel.WinLeft; manager.SVTrackedVsTimeViewLocation.Width = manager._svsTrackedVsTimePanel.WinWidth; manager.SVTrackedVsTimeViewLocation.Height = manager._svsTrackedVsTimePanel.WinHeight; manager.SVTrackedVsTimeViewLocation.IsOpen = true; messageView = manager._svsTrackedVsTimePanel; } break; case "frmSatelliteStats": manager._SatelliteStats = CreateSatelliteStatsWin(manager); if (manager._SatelliteStats != null) { manager._SatelliteStats.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._SatelliteStats.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._SatelliteStats.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._SatelliteStats.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SatelliteStatsLocation.Top = manager._SatelliteStats.WinTop; manager.SatelliteStatsLocation.Left = manager._SatelliteStats.WinLeft; manager.SatelliteStatsLocation.Width = manager._SatelliteStats.WinWidth; manager.SatelliteStatsLocation.Height = manager._SatelliteStats.WinHeight; manager.SatelliteStatsLocation.IsOpen = true; messageView = manager._SatelliteStats; } break; case "frmCommLocationMap": manager._locationViewPanel = CreateLocationMapWin(manager); if (manager._locationViewPanel != null) { manager._locationViewPanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._locationViewPanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._locationViewPanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._locationViewPanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.LocationMapLocation.Top = manager._locationViewPanel.WinTop; manager.LocationMapLocation.Left = manager._locationViewPanel.WinLeft; manager.LocationMapLocation.Width = manager._locationViewPanel.WinWidth; manager.LocationMapLocation.Height = manager._locationViewPanel.WinHeight; manager.LocationMapLocation.IsOpen = true; manager.comm.LocationMapRadius = Convert.ToDouble(node2.Attributes["locationMapRadius"].Value.ToString()); messageView = manager._locationViewPanel; } break; case "frmCommSignalView": manager._signalStrengthPanel = CreateSignalViewWin(manager); if (manager._signalStrengthPanel != null) { manager._signalStrengthPanel.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._signalStrengthPanel.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._signalStrengthPanel.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._signalStrengthPanel.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SignalViewLocation.Top = manager._signalStrengthPanel.WinTop; manager.SignalViewLocation.Left = manager._signalStrengthPanel.WinLeft; manager.SignalViewLocation.Width = manager._signalStrengthPanel.WinWidth; manager.SignalViewLocation.Height = manager._signalStrengthPanel.WinHeight; manager.SignalViewLocation.IsOpen = true; messageView = manager._signalStrengthPanel; } break; case "frmCommMessageFilter": manager.MessageView = CreateMessageViewWin(manager); if (manager.MessageView != null) { manager.MessageView.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager.MessageView.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager.MessageView.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager.MessageView.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.MessageViewLocation.Top = manager.MessageView.WinTop; manager.MessageViewLocation.Left = manager.MessageView.WinLeft; manager.MessageViewLocation.Width = manager.MessageView.WinWidth; manager.MessageViewLocation.Height = manager.MessageView.WinHeight; manager.MessageViewLocation.IsOpen = true; messageView = manager.MessageView; } break; case "frmTTFFDisplay": manager._ttffDisplay = CreateTTFFWin(manager); if (manager._ttffDisplay != null) { manager._ttffDisplay.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._ttffDisplay.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._ttffDisplay.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._ttffDisplay.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.TTFFDisplayLocation.Top = manager._ttffDisplay.WinTop; manager.TTFFDisplayLocation.Left = manager._ttffDisplay.WinLeft; manager.TTFFDisplayLocation.Width = manager._ttffDisplay.WinWidth; manager.TTFFDisplayLocation.Height = manager._ttffDisplay.WinHeight; manager.TTFFDisplayLocation.IsOpen = true; messageView = manager._ttffDisplay; } break; case "frmCommSiRFawareV2": manager._SiRFAware = CreateSiRFawareWin(manager); if (manager._SiRFAware != null) { manager._SiRFAware.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._SiRFAware.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._SiRFAware.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._SiRFAware.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.SiRFawareLocation.Top = manager._SiRFAware.WinTop; manager.SiRFawareLocation.Left = manager._SiRFAware.WinLeft; manager.SiRFawareLocation.Width = manager._SiRFAware.WinWidth; manager.SiRFawareLocation.Height = manager._SiRFAware.WinHeight; manager.SiRFawareLocation.IsOpen = true; messageView = manager._SiRFAware; } break; case "frmCommDebugView": manager.DebugView = CreateDebugViewWin(manager); if (manager.DebugView != null) { manager.DebugView.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager.DebugView.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager.DebugView.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager.DebugView.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.DebugViewLocation.Top = manager.DebugView.WinTop; manager.DebugViewLocation.Left = manager.DebugView.WinLeft; manager.DebugViewLocation.Width = manager.DebugView.WinWidth; manager.DebugViewLocation.Height = manager.DebugView.WinHeight; manager.DebugViewLocation.IsOpen = true; messageView = manager.DebugView; } break; case "frmCommResponseView": manager._responseView = CreateResponseViewWin(manager); if (manager._responseView != null) { manager._responseView.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._responseView.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._responseView.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._responseView.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.ResponseViewLocation.Top = manager._responseView.WinTop; manager.ResponseViewLocation.Left = manager._responseView.WinLeft; manager.ResponseViewLocation.Width = manager._responseView.WinWidth; manager.ResponseViewLocation.Height = manager._responseView.WinHeight; manager.ResponseViewLocation.IsOpen = true; messageView = manager._responseView; } break; case "frmCommErrorView": manager._errorView = CreateErrorViewWin(manager); if (manager._errorView != null) { manager._errorView.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._errorView.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._errorView.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._errorView.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.ErrorViewLocation.Top = manager._errorView.WinTop; manager.ErrorViewLocation.Left = manager._errorView.WinLeft; manager.ErrorViewLocation.Width = manager._errorView.WinWidth; manager.ErrorViewLocation.Height = manager._errorView.WinHeight; manager.ErrorViewLocation.IsOpen = true; messageView = manager._errorView; } break; case "frmInterenceReport": manager._interferenceReport = CreateInterferenceReportWindow(manager); if (manager._interferenceReport != null) { manager._interferenceReport.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._interferenceReport.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._interferenceReport.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._interferenceReport.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.InterferenceLocation.Top = manager._interferenceReport.WinTop; manager.InterferenceLocation.Left = manager._interferenceReport.WinLeft; manager.InterferenceLocation.Width = manager._interferenceReport.WinWidth; manager.InterferenceLocation.Height = manager._interferenceReport.WinHeight; manager.InterferenceLocation.IsOpen = true; messageView = manager._interferenceReport; } break; case "frmCompassView": manager._compassView = CreateCompassViewWin(manager); if (manager._compassView != null) { manager._compassView.WinTop = Convert.ToInt32(node2.Attributes["top"].Value); manager._compassView.WinLeft = Convert.ToInt32(node2.Attributes["left"].Value); manager._compassView.WinWidth = Convert.ToInt32(node2.Attributes["width"].Value); manager._compassView.WinHeight = Convert.ToInt32(node2.Attributes["height"].Value); manager.CompassViewLocation.Top = manager._compassView.WinTop; manager.CompassViewLocation.Left = manager._compassView.WinLeft; manager.CompassViewLocation.Width = manager._compassView.WinWidth; manager.CompassViewLocation.Height = manager._compassView.WinHeight; manager.CompassViewLocation.IsOpen = true; messageView = manager._compassView; } break; } if (messageView != null) { loadLocation((Form) messageView, node2.Attributes["top"].Value.ToString(), node2.Attributes["left"].Value.ToString(), node2.Attributes["width"].Value.ToString(), node2.Attributes["height"].Value.ToString(), node2.Attributes["windowState"].Value.ToString()); } } if (!PortManagerHash.ContainsKey(manager.comm.PortName)) { PortManagerHash.Add(manager.comm.PortName, manager); } else { PortManagerHash[manager.comm.PortName] = manager; } updateToolStripPortComboBox(manager.comm.PortName, true); manager.UpdateMainWindow += new PortManager.updateParentEventHandler(updateMainWindowTitle); toolStripNumPortTxtBox.Text = PortManagerHash.Count.ToString(); manager.PerPortToolStrip = AddPortToolbar((toolStripMain.Location.Y + (0x19 * PortManagerHash.Count)) + 0x23, manager.comm.PortName); updateGUIOnConnectNDisconnect(manager); manager.comm.SetupRxCtrl(); goto Label_291E; Label_23F3: open.comm.RequireEE = false; goto Label_240F; Label_2402: open.comm.RequireHostRun = false; Label_240F: if ((str7 = node.Attributes["InputDeviceMode"].Value.ToString()) == null) { goto Label_2488; } if (!(str7 == "1")) { if (str7 == "2") { goto Label_246A; } if (str7 == "3") { goto Label_2479; } goto Label_2488; } open.comm.InputDeviceMode = CommonClass.InputDeviceModes.RS232; goto Label_2495; Label_246A: open.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Client; goto Label_2495; Label_2479: open.comm.InputDeviceMode = CommonClass.InputDeviceModes.TCP_Server; goto Label_2495; Label_2488: open.comm.InputDeviceMode = CommonClass.InputDeviceModes.FilePlayBack; Label_2495: if ((str8 = node.Attributes["rxType"].Value.ToString()) != null) { if (!(str8 == "SLC")) { if (str8 == "GSW") { goto Label_24FE; } if (str8 == "TTB") { goto Label_250D; } if (str8 == "NMEA") { goto Label_251C; } } else { open.comm.RxType = CommunicationManager.ReceiverType.SLC; } } goto Label_2529; Label_24FE: open.comm.RxType = CommunicationManager.ReceiverType.GSW; goto Label_2529; Label_250D: open.comm.RxType = CommunicationManager.ReceiverType.TTB; goto Label_2529; Label_251C: open.comm.RxType = CommunicationManager.ReceiverType.NMEA; Label_2529: if ((str9 = node.Attributes["viewType"].Value.ToString()) != null) { if (!(str9 == "GPS")) { if (str9 == "GP2") { goto Label_25A3; } if (str9 == "HEX") { goto Label_25B2; } if (str9 == "SSB") { goto Label_25C1; } if (str9 == "TEXT") { goto Label_25D0; } } else { open.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GPS; } } goto Label_25DD; Label_25A3: open.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.GP2; goto Label_25DD; Label_25B2: open.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Hex; goto Label_25DD; Label_25C1: open.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.SSB; goto Label_25DD; Label_25D0: open.comm.RxCurrentTransmissionType = CommunicationManager.TransmissionType.Text; Label_25DD: class2.DisplayBuffer = Convert.ToInt32(node.Attributes["bufferSize"].Value.ToString()); open.comm.AutoReplyCtrl.ControlChannelVersion = node.Attributes["controlVersion"].Value.ToString(); open.comm.AutoReplyCtrl.AidingProtocolVersion = node.Attributes["aidingVersion"].Value.ToString(); foreach (XmlNode node3 in node) { messageView = null; switch (node3.Attributes["name"].Value.ToString()) { case "frmCommInputMessage": messageView = open.CreateInputCommandsWin(); break; case "frmCommRadarMap": messageView = open.CreateSVsMapWin(); break; case "frmSatelliteStats": messageView = open.CreateSatelliteStatsWin(); break; case "frmCommLocationMap": messageView = open.CreateLocationMapWin(); open.comm.LocationMapRadius = Convert.ToDouble(node3.Attributes["locationMapRadius"].Value.ToString()); break; case "frmCommSignalView": messageView = open.CreateSignalViewWin(); break; case "frmEncryCtrl": messageView = open.CreateEncrypCtrlWin(); break; case "frmCommMessageFilter": open.frmCommOpenToolFilterCustom_Create(); break; case "frmTTFFDisplay": messageView = open.CreateTTFFWin(); break; case "frmSiRFAware": messageView = open.CreateSiRFAwareWin(); break; } if (messageView != null) { loadLocation((Form) messageView, node3.Attributes["top"].Value.ToString(), node3.Attributes["left"].Value.ToString(), node3.Attributes["width"].Value.ToString(), node3.Attributes["height"].Value.ToString(), node3.Attributes["windowState"].Value.ToString()); } } Label_291E: if (obj3 != null) { loadLocation((Form) obj3, node.Attributes["top"].Value.ToString(), node.Attributes["left"].Value.ToString(), node.Attributes["width"].Value.ToString(), node.Attributes["height"].Value.ToString(), node.Attributes["windowState"].Value.ToString()); } } if ((PortManagerHash.Count > 1) && !toolStripPortComboBox.Items.Contains("All")) { toolStripPortComboBox.Items.Add("All"); } if (toolStripNumPortTxtBox.Text == clsGlobal.FilePlayBackPortName) { toolStripNumPortTxtBox.Text = ""; } } catch (Exception exception) { MessageBox.Show("frmMDIMain() + frmSaveSettingsLoad() " + exception.ToString()); } } isLoading = false; Refresh(); }
private void parseFile() { EventHandler method = null; EventHandler handler2 = null; EventHandler handler3 = null; EventHandler handler4 = null; EventHandler handler5 = null; EventHandler handler6 = null; EventHandler handler7 = null; CommonUtilsClass class2 = new CommonUtilsClass(); string timeStamp = string.Empty; int millisecondsTimeout = 500; bool flag = false; PortManager manager = (PortManager) PortManagerHash[clsGlobal.FilePlayBackPortName]; Thread.CurrentThread.CurrentCulture = clsGlobal.MyCulture; Label_004F: try { switch (_playState) { case _playStates.IDLE: millisecondsTimeout = 500; _fileIndex = 0L; if (method == null) { method = delegate { filePlayBackTrackBar.Enabled = true; }; } filePlayBackTrackBar.Invoke(method); goto Label_0B9D; case _playStates.PLAY: millisecondsTimeout = _speedDelay; class2.viewPause = false; if (handler3 == null) { handler3 = delegate { filePlayBackTrackBar.Enabled = false; }; } filePlayBackTrackBar.Invoke(handler3); if (_fileHdlr != null) { string input = _fileHdlr[_fileIndex]; try { string str7; if (input == "EOF") { if (MessageBox.Show("End of file reached! -- Rewind?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes) { _fileIndex = 0L; if (((manager != null) && (manager._SiRFAware != null)) && manager.SiRFawareLocation.IsOpen) { manager._SiRFAware.SirfawareGUIInit(); } } else { _playState = _playStates.IDLE; if (handler4 == null) { handler4 = delegate { Text = string.Format("{0}: File Playback Stop", clsGlobal.SiRFLiveVersion); }; } base.Invoke(handler4); } if (handler5 == null) { handler5 = delegate { filePlayBackTrackBar.Value = filePlayBackTrackBar.Maximum; }; } filePlayBackTrackBar.Invoke(handler5); goto Label_0B9D; } string inputString = string.Empty; CommonClass.MessageType normal = CommonClass.MessageType.Normal; input = input.TrimEnd(new char[] { '\n' }); input = input.TrimEnd(new char[] { '\r' }); string pattern = @"\(1\)\tA0 A2 \w+ \w+ 80"; string str5 = @"\(1\)\tA0 A2 \w+ \w+ D6"; string str6 = @"(?<rt>\w+) \w+ \w+ B0 B3"; Regex regex = new Regex(pattern, RegexOptions.Compiled); if (regex.IsMatch(input)) { manager.comm.RxCtrl.ResetCtrl.ResetDataInit(); regex = new Regex(str6, RegexOptions.Compiled); if (regex.IsMatch(input)) { try { byte maskByte = byte.Parse(regex.Match(input).Result("${rt}"), NumberStyles.HexNumber); manager.comm.RxCtrl.ResetCtrl.ResetType = SSB_Format.GetResetTypeFromBitMap(maskByte); } catch { } } else { manager.comm.RxCtrl.ResetCtrl.ResetType = "Unknown"; } } regex = new Regex(str5, RegexOptions.Compiled); if (regex.IsMatch(input)) { manager.comm.AutoReplyCtrl.AutoReplyParams.AutoReply = true; } switch (_fileType) { case CommonClass.TransmissionType.Text: inputString = input; normal = CommonClass.MessageType.Incoming; timeStamp = string.Empty; goto Label_0863; case CommonClass.TransmissionType.GP2: { input = input.ToUpper(); if (!input.Contains("A0 A2")) { goto Label_03A9; } int index = input.IndexOf("A0 A2"); int num4 = input.IndexOf("("); inputString = input.Substring(index); str7 = input.Substring(num4 + 1, 1); if (!(str7 == "0")) { break; } normal = CommonClass.MessageType.Incoming; goto Label_0863; } case CommonClass.TransmissionType.GPS: { inputString = input; normal = CommonClass.MessageType.Normal; input = input.Replace(" ", ""); string messageProtocol = manager.comm.MessageProtocol; if (manager.comm.MessageProtocol == "OSP") { messageProtocol = "SSB"; } if (input.StartsWith("2,")) { manager.comm.getSatellitesDataForGUIFromCSV(2, 0, messageProtocol, input); } else if (input.StartsWith("4,")) { manager.comm.getSatellitesDataForGUIFromCSV(4, 0, messageProtocol, input); } else if (input.StartsWith("41,")) { manager.comm.getSatellitesDataForGUIFromCSV(0x29, 0, messageProtocol, input); } else if (input.StartsWith("30,")) { manager.comm.getSatellitesDataForGUIFromCSV(30, 0, messageProtocol, input); } else { if (!input.StartsWith("225,")) { goto Label_05FD; } if (!input.StartsWith("225,00")) { goto Label_053A; } if (!clsGlobal.IsMarketingUser() && (input.Length > 1)) { string str9 = string.Empty; string[] strArray = input.Split(new char[] { ',' }); for (int i = 2; i < strArray.Length; i += 2) { byte num6 = (byte) int.Parse(strArray[i], NumberStyles.HexNumber); num6 = (byte) (num6 ^ 0xff); str9 = str9 + Convert.ToChar(num6); } inputString = str9; } } goto Label_0863; } default: inputString = input; normal = CommonClass.MessageType.Normal; timeStamp = string.Empty; goto Label_0863; } switch (str7) { case "1": case "2": normal = CommonClass.MessageType.Outgoing; break; } goto Label_0863; Label_03A9: inputString = input; goto Label_0863; Label_053A: if (input.StartsWith("225,6")) { manager.GetTTFFFromCSVString(input); if ((!manager.comm.AutoReplyCtrl.AutoReplyParams.AutoReply && (manager._ttffDisplay != null)) && manager.TTFFDisplayLocation.IsOpen) { manager._ttffDisplay.updateTTFFNow(); } } else if (input.StartsWith("225,7")) { manager.GetTTFFFromCSVString(input); if ((manager.comm.AutoReplyCtrl.AutoReplyParams.AutoReply && (manager._ttffDisplay != null)) && manager.TTFFDisplayLocation.IsOpen) { manager._ttffDisplay.updateTTFFNow(); } } goto Label_0863; Label_05FD: if (input.StartsWith("69,")) { manager.comm.AutoReplyCtrl.AutoReplyParams.AutoReply = true; if (input.StartsWith("69,1")) { manager.GetOSPPositionFormCSVString(input); } } else if (input.StartsWith("77,")) { if ((manager._SiRFAware != null) && manager.SiRFawareLocation.IsOpen) { Hashtable siRFAwareScanResHash = null; if (input.StartsWith("77,1")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 1, "OSP", input); } else if (input.StartsWith("77,2")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 2, "OSP", input); } else if (input.StartsWith("77,3")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 3, "OSP", input); } else if (input.StartsWith("77,4")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 4, "OSP", input); } else if (input.StartsWith("77,5")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 5, "OSP", input); } else if (input.StartsWith("77,7")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 7, "OSP", input); } manager._SiRFAware.UpdateSiRFawareGUI(siRFAwareScanResHash); } } else if (input.Contains("TTFF(s)")) { try { if (manager._SiRFAware != null) { string[] strArray2 = input.Split(new char[] { '=' }); manager._SiRFAware.TTFF = double.Parse(strArray2[1]); if (manager.SiRFawareLocation.IsOpen) { manager._SiRFAware.UpdateSiRFawareGUITime(); } } } catch { } } else if (input.Contains("TotalTimeinSiRFaware(s)")) { try { if (manager._SiRFAware != null) { string[] strArray3 = input.Split(new char[] { '=' }); manager._SiRFAware.TotalMPMTime = double.Parse(strArray3[1]); if (manager.SiRFawareLocation.IsOpen) { manager._SiRFAware.UpdateSiRFawareGUITime(); } } } catch { } } Label_0863: if (manager.comm.File_DataReceived(normal, inputString, manager.comm.DebugViewIsMatchEnable, manager.comm.DebugViewMatchString, timeStamp)) { _playState = _playStates.PAUSE; updateFilePlaybackPauseBtn(true); } _fileIndex = _fileHdlr.Index + 1L; if (_totalFileSize != 0L) { int processPercentage = (int) ((((double) _fileHdlr.Index) / ((double) _totalFileSize)) * 100.0); filePlayBackTrackBar.Invoke((MethodInvoker)delegate { filePlayBackTrackBar.Value = processPercentage; }); } if (manager.comm._isEpochMessage) { manager.comm._isEpochMessage = false; if (_lastPlayState != _playStates.BACKWARD) { if (_epochList.Count >= 100) { _epochList.RemoveAt(0); } if (!_epochList.Contains(_fileIndex - 1L)) { _epochList.Add(_fileIndex - 1L); _epochIndex = _epochList.Count - 1; } } } } catch (Exception exception) { if (_playState != _playStates.QUIT) { string errorStr = string.Format("Error: {0}\n{1}", exception.Message, input); if ((manager != null) && (manager.comm != null)) { manager.comm.ErrorPrint(errorStr); } _fileIndex = _fileHdlr.Index + 1L; } } } goto Label_0B9D; case _playStates.PAUSE: millisecondsTimeout = 500; if (handler2 == null) { handler2 = delegate { filePlayBackTrackBar.Enabled = true; }; } filePlayBackTrackBar.Invoke(handler2); goto Label_0B9D; case _playStates.FORWARD: if (_playState != _lastPlayState) { manager.comm.WriteApp("User marker: Go forward to next epoch"); } if (handler6 == null) { handler6 = delegate { filePlayBackTrackBar.Enabled = false; }; } filePlayBackTrackBar.Invoke(handler6); manager.comm._isCheckEpoch = true; _lastPlayState = _playState; _playState = _playStates.PLAY; _epochIndex++; if (_epochIndex > (_epochList.Count - 1)) { _epochIndex = _epochList.Count - 1; if (_epochIndex < 0) { _epochIndex = 0; } } goto Label_0B9D; case _playStates.BACKWARD: if (_playState != _lastPlayState) { manager.comm.WriteApp("User marker: Go backward to last epoch"); } if (handler7 == null) { handler7 = delegate { filePlayBackTrackBar.Enabled = false; }; } filePlayBackTrackBar.Invoke(handler7); manager.comm._isCheckEpoch = true; _lastPlayState = _playState; if (_epochIndex < 1) { MessageBox.Show("Reached end of backward list", "File Playback", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); _epochIndex = 0; _playState = _playStates.PAUSE; } else { _fileIndex = _epochList[_epochIndex - 1]; _epochIndex--; _playState = _playStates.PLAY; } goto Label_0B9D; case _playStates.QUIT: updateFilePlaybackPauseBtn(false); flag = true; goto Label_0B9D; } millisecondsTimeout = _speedDelay; } catch (Exception exception2) { if (_playState != _playStates.QUIT) { MessageBox.Show(string.Format("Error: frmFileReplay: parseFile() {0}", exception2.ToString()), "ERROR", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Hand); _fileIndex = _fileHdlr.Index + 1L; } } Label_0B9D: if (!flag) { Thread.Sleep(millisecondsTimeout); goto Label_004F; } manager.CloseAll(); base.Invoke((MethodInvoker)delegate { toolStripNumPortTxtBox.Text = PortManagerHash.Count.ToString(); toolStripPortComboBox.Items.Remove(clsGlobal.FilePlayBackPortName); if (toolStripPortComboBox.Items.Count >= 1) { toolStripPortComboBox.Text = toolStripPortComboBox.Items[0].ToString(); } }); class2 = null; if (manager.comm.RxCtrl != null) { manager.comm.RxCtrl.Dispose(); manager.comm.RxCtrl = null; } manager.comm.Dispose(); manager.comm = null; manager = null; GC.Collect(2); }
public frmCommDisplayBufferSizeUpdate(string updateString) { this.CUC = new CommonUtilsClass(); this.InitializeComponent(); this.frmCommOpenBufferSizeTxtBox.Text = updateString; }