public void UpdateAllPortSubWinTitle(PortManager target) { if (target != null) { updateSignalViewTitle(target); updateSVsMapViewTitle(target); updateLocationMapViewTitle(target); updateTTFFViewTitle(target); updateResponseViewTitle(target); updateDebugViewTitle(target); updateErrorViewTitle(target); updateInterferenceViewTitle(target); updateSatellitesStatsViewTitle(target); updateSiRFawareViewTitle(target); updateInputCommandTitle(target); updateTransmitMessageTitle(target); updateSVsTrajViewTitle(target); updateSVsCNoViewTitle(target); updateSVsTrackedVsTimeViewTitle(target); } }
private frmCommSignalView localCreateSignalViewWin(PortManager target) { if ((target._signalStrengthPanel != null) && !target._signalStrengthPanel.IsDisposed) { target._signalStrengthPanel.Close(); } else { string str = target.comm.sourceDeviceName + ": Signal View"; if ((target._signalStrengthPanel == null) || target._signalStrengthPanel.IsDisposed) { target._signalStrengthPanel = new frmCommSignalView(); if (target.SignalViewLocation.Width != 0) { target._signalStrengthPanel.Width = target.SignalViewLocation.Width; target._signalStrengthPanel.WinWidth = target.SignalViewLocation.Width; } if (target.SignalViewLocation.Height != 0) { target._signalStrengthPanel.Height = target.SignalViewLocation.Height; target._signalStrengthPanel.WinHeight = target.SignalViewLocation.Height; } if (target.SignalViewLocation.Left != 0) { target._signalStrengthPanel.Left = target.SignalViewLocation.Left; target._signalStrengthPanel.WinLeft = target.SignalViewLocation.Left; } if (target.SignalViewLocation.Top != 0) { target._signalStrengthPanel.Top = target.SignalViewLocation.Top; target._signalStrengthPanel.WinTop = target.SignalViewLocation.Top; } target._signalStrengthPanel.Show(); target.SignalViewLocation.IsOpen = true; } target._signalStrengthPanel.CommWindow = target.comm; target._signalStrengthPanel.Text = str; target._signalStrengthPanel.UpdatePortManager += new frmCommSignalView.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._signalStrengthPanel.BringToFront(); } return target._signalStrengthPanel; }
private frmCommSiRFawareV2 localCreateSiRFawareWin(PortManager target) { string str = target.comm.sourceDeviceName + ": SiRFaware"; if ((target._SiRFAware == null) || target._SiRFAware.IsDisposed) { target._SiRFAware = new frmCommSiRFawareV2(target.comm); if (target.SiRFawareLocation.Width != 0) { target._SiRFAware.Width = target.SiRFawareLocation.Width; target._SiRFAware.WinWidth = target.SiRFawareLocation.Width; } if (target.SiRFawareLocation.Height != 0) { target._SiRFAware.Height = target.SiRFawareLocation.Height; target._SiRFAware.WinHeight = target.SiRFawareLocation.Height; } if (target.SiRFawareLocation.Left != 0) { target._SiRFAware.Left = target.SiRFawareLocation.Left; target._SiRFAware.WinLeft = target.SiRFawareLocation.Left; } if (target.SiRFawareLocation.Top != 0) { target._SiRFAware.Top = target.SiRFawareLocation.Top; target._SiRFAware.WinTop = target.SiRFawareLocation.Top; } target.SiRFawareLocation.IsOpen = true; target._SiRFAware.StartListen(); } else if (target.SiRFawareLocation.IsOpen) { target._SiRFAware.Close(); } else { target.SiRFawareLocation.IsOpen = true; target._SiRFAware.StartListen(); } target._SiRFAware.Text = str; target._SiRFAware.UpdatePortManager += new frmCommSiRFawareV2.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._SiRFAware.Show(); target._SiRFAware.BringToFront(); return target._SiRFAware; }
private frmInterferenceReport localCreateInterferenceReportWindow(PortManager target) { string str = target.comm.sourceDeviceName + ": Interference Detection"; if ((target._interferenceReport == null) || target._interferenceReport.IsDisposed) { target._interferenceReport = new frmInterferenceReport(target.comm); if (target.InterferenceLocation.Width != 0) { target._interferenceReport.Width = target.InterferenceLocation.Width; target._interferenceReport.WinWidth = target.InterferenceLocation.Width; } if (target.InterferenceLocation.Height != 0) { target._interferenceReport.Height = target.InterferenceLocation.Height; target._interferenceReport.WinHeight = target.InterferenceLocation.Height; } if (target.InterferenceLocation.Left != 0) { target._interferenceReport.Left = target.InterferenceLocation.Left; target._interferenceReport.WinLeft = target.InterferenceLocation.Left; } if (target.InterferenceLocation.Top != 0) { target._interferenceReport.Top = target.InterferenceLocation.Top; target._interferenceReport.WinTop = target.InterferenceLocation.Top; } target._interferenceReport.Show(); target.InterferenceLocation.IsOpen = true; } else if (target.InterferenceLocation.IsOpen) { target._interferenceReport.Close(); } else { target._interferenceReport.Show(); target.InterferenceLocation.IsOpen = true; target._interferenceReport.StartListen(); } target._interferenceReport.Text = str; target._interferenceReport.UpdatePortManager += new frmInterferenceReport.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._interferenceReport.BringToFront(); return target._interferenceReport; }
private frmCommResponseView localCreateResponseViewWin(PortManager target) { if ((target._responseView != null) && !target._responseView.IsDisposed) { target._responseView.Close(); } else { string str = target.comm.sourceDeviceName + ": Response View"; if ((target._responseView == null) || target._responseView.IsDisposed) { target._responseView = new frmCommResponseView(); if (target.ResponseViewLocation.Width != 0) { target._responseView.Width = target.ResponseViewLocation.Width; target._responseView.WinWidth = target.ResponseViewLocation.Width; } if (target.ResponseViewLocation.Height != 0) { target._responseView.Height = target.ResponseViewLocation.Height; target._responseView.WinHeight = target.ResponseViewLocation.Height; } if (target.ResponseViewLocation.Left != 0) { target._responseView.Left = target.ResponseViewLocation.Left; target._responseView.WinLeft = target.ResponseViewLocation.Left; } if (target.ResponseViewLocation.Top != 0) { target._responseView.Top = target.ResponseViewLocation.Top; target._responseView.WinTop = target.ResponseViewLocation.Top; } target._responseView.Show(); target.ResponseViewLocation.IsOpen = true; } target._responseView.CommWindow = target.comm; target._responseView.Text = str; target._responseView.UpdatePortManager += new frmCommResponseView.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._responseView.BringToFront(); } return target._responseView; }
public void CreateEncrypCtrlWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Set Developer Debug Levels"; frmEncryCtrl ctrl = new frmEncryCtrl(target.comm); ctrl.CommWindow = target.comm; ctrl.Text = str; ctrl.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
public frmCommLocationMap CreateLocationMapWin(PortManager target) { EventHandler method = null; if (!base.IsDisposed) { if (base.InvokeRequired) { if (method == null) { method = delegate { target._locationViewPanel = localCreateLocationMapWin(target); }; } base.Invoke(method); } else { target._locationViewPanel = localCreateLocationMapWin(target); } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } return target._locationViewPanel; }
private void CreateGyroFacCalWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Gyro Factory Calibration"; frmSetDRGyroFacCal cal = new frmSetDRGyroFacCal(target.comm); cal.Text = str; cal.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
private void CreateLogFileWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { if (target.comm != null) { if (target.comm.Log.IsFileOpen()) { if (MessageBox.Show(string.Format("{0}: Logging in progress. Proceeding will close the current log.\n\n\t Continue?", target.comm.PortName), "Log File Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { target.comm.Log.CloseFile(); } } else { string str = target.comm.sourceDeviceName + ": Log File"; frmLogDuration duration = new frmLogDuration(target.comm); duration.Text = str; duration.ShowDialog(); } } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
private void createAutoReplySummaryWindow(PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = "Auto Reply Summary: " + target.comm.sourceDeviceName; frmAutoReplySummary summary = new frmAutoReplySummary(); summary.CommWindow = target.comm; summary.Text = str; summary.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
private void createAutoReplyWindow(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Auto Reply"; if (target.comm.IsSourceDeviceOpen()) { frmAutoReply reply = new frmAutoReply(); if (reply != null) { reply.CommWindow = target.comm; reply.Text = str; if ((reply.ShowDialog() != DialogResult.Cancel) && target.comm.Log.IsFileOpen()) { target.comm.WriteApp(utils_AutoReply.getAutoReplySummary(target.comm)); } } } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } if ((target._ttffDisplay != null) && target.TTFFDisplayLocation.IsOpen) { target._ttffDisplay.SetTTFFMsgIndication(); } } }
private PortManager callCreateRxSettingsWindow(PortManager target) { if (target == null) { return target; } if (target.comm != null) { string portName = target.comm.PortName; if (!createRxSettingsWindow(ref target.comm)) { return null; } if (manualConnect(ref target.comm)) { if (portName != target.comm.PortName) { PortManagerHash.Remove(portName); updateToolStripPortComboBox(portName, false); } if (target != null) { if (PortManagerHash.ContainsKey(target.comm.PortName)) { PortManagerHash[target.comm.PortName] = target; } else { PortManagerHash.Add(target.comm.PortName, target); } target.RunAsyncProcess(); target.comm.Log.DurationLoggingStatusLabel = logManagerStatusLabel; target.comm.Log.UpdateMainWindow += new LogManager.UpdateParentEventHandler(updateLogFileBtn); target.comm.UpdatePortMainWinTitle += new CommunicationManager.UpdateParentPortEventHandler(UpdateWinTitle); } updateToolStripPortComboBox(target.comm.PortName, true); return target; } MessageBox.Show(target.comm.ConnectErrorString, "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } return null; }
private PortManager callCreateRxSettingsWindow() { PortManager manager = new PortManager(); if (createRxSettingsWindow(ref manager.comm)) { if (PortManagerHash.ContainsKey(manager.comm.PortName)) { PortManager manager2 = (PortManager) PortManagerHash[manager.comm.PortName]; if (manager2 != null) { manager = manager2; } } if (!manualConnect(ref manager.comm)) { return null; } if (manager != null) { if (PortManagerHash.ContainsKey(manager.comm.PortName)) { PortManagerHash[manager.comm.PortName] = manager; } else { PortManagerHash.Add(manager.comm.PortName, manager); } manager.RunAsyncProcess(); manager.comm.Log.DurationLoggingStatusLabel = logManagerStatusLabel; manager.comm.Log.UpdateMainWindow += new LogManager.UpdateParentEventHandler(updateLogFileBtn); manager.comm.UpdatePortMainWinTitle += new CommunicationManager.UpdateParentPortEventHandler(UpdateWinTitle); } return manager; } manager.comm.Dispose(); manager.comm = null; manager = null; return null; }
internal frmCommInputMessage CreateInputCommandsWin(PortManager target) { if (target == null) { return null; } if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Predefined Message"; if ((target._inputCommands == null) || target._inputCommands.IsDisposed) { target._inputCommands = new frmCommInputMessage(); if (target.InputCommandLocation.Width != 0) { target._inputCommands.Width = target.InputCommandLocation.Width; target._inputCommands.WinWidth = target.InputCommandLocation.Width; } if (target.InputCommandLocation.Height != 0) { target._inputCommands.Height = target.InputCommandLocation.Height; target._inputCommands.WinHeight = target.InputCommandLocation.Height; } if (target.InputCommandLocation.Left != 0) { target._inputCommands.Left = target.InputCommandLocation.Left; target._inputCommands.WinLeft = target.InputCommandLocation.Left; } if (target.InputCommandLocation.Top != 0) { target._inputCommands.Top = target.InputCommandLocation.Top; target._inputCommands.WinTop = target.InputCommandLocation.Top; } target._inputCommands.UpdatePortManager += new frmCommInputMessage.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); } target._inputCommands.CommWindow = target.comm; target._inputCommands.Text = str; target._inputCommands.Show(); target.InputCommandLocation.IsOpen = true; target._inputCommands.BringToFront(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } return target._inputCommands; }
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 createLowPowerInputWindow(ref PortManager target) { if ((target != null) && ((target.comm != null) && target.comm.IsSourceDeviceOpen())) { new frmLowPower(target.comm).ShowDialog(); } }
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 createPeekPokeWin(PortManager target) { EventHandler method = null; if (target != null) { if (!base.IsDisposed) { if (method == null) { method = delegate { if ((target._peekPokeWin != null) && !target._peekPokeWin.IsDisposed) { target._peekPokeWin.Close(); } else { string str = target.comm.sourceDeviceName + ": Peek Poke"; if ((target._peekPokeWin == null) || target._peekPokeWin.IsDisposed) { target._peekPokeWin = new frmPeekPokeMem(target.comm); if (target.PeekPokeLocation.Width != 0) { target._peekPokeWin.Width = target.PeekPokeLocation.Width; target._peekPokeWin.WinWidth = target.PeekPokeLocation.Width; } if (target.PeekPokeLocation.Height != 0) { target._peekPokeWin.Height = target.PeekPokeLocation.Height; target._peekPokeWin.WinHeight = target.PeekPokeLocation.Height; } if (target.PeekPokeLocation.Left != 0) { target._peekPokeWin.Left = target.PeekPokeLocation.Left; target._peekPokeWin.WinLeft = target.PeekPokeLocation.Left; } if (target.PeekPokeLocation.Top != 0) { target._peekPokeWin.Top = target.PeekPokeLocation.Top; target._peekPokeWin.WinTop = target.PeekPokeLocation.Top; } target._peekPokeWin.UpdatePortManager += new frmPeekPokeMem.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); } target._peekPokeWin.Text = str; target._peekPokeWin.Show(); target.PeekPokeLocation.IsOpen = true; if (target._responseView != null) { target._responseView.BringToFront(); } } }; } base.Invoke(method); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
public frmInterferenceReport CreateInterferenceReportWindow(PortManager target) { EventHandler method = null; if (target == null) { return null; } if (!base.IsDisposed) { if (target.comm != null) { if (base.InvokeRequired) { if (method == null) { method = delegate { target._interferenceReport = localCreateInterferenceReportWindow(target); }; } base.Invoke(method); } else { target._interferenceReport = localCreateInterferenceReportWindow(target); } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } return target._interferenceReport; }
private void CreatePowerMaskWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Power Mask"; frmMaskPower power = new frmMaskPower(target.comm); power.Text = str; power.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
public void CreateLowPowerBufferWin(PortManager target) { if (target != null) { if ((target._lowPowerBufferView == null) || target._lowPowerBufferView.IsDisposed) { target._lowPowerBufferView = new frmLPBufferWindow(target.comm); } target._lowPowerBufferView.ShowDialog(); } }
private void CreateSetPollGenericSensorParamWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Set/Poll Generic Sensor Parameters"; frmDRSetPollGenericSensParams @params = new frmDRSetPollGenericSensParams(target.comm); @params.Text = str; @params.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
private frmMEMSView localCreateMEMSViewWin(PortManager target) { string str = target.comm.sourceDeviceName + ": MEMS"; if ((target._memsView == null) || target._memsView.IsDisposed) { target._memsView = new frmMEMSView(target.comm); if (target.MEMSLocation.Width != 0) { target._memsView.Width = target.MEMSLocation.Width; target._memsView.WinWidth = target.MEMSLocation.Width; } if (target.MEMSLocation.Height != 0) { target._memsView.Height = target.MEMSLocation.Height; target._memsView.WinHeight = target.MEMSLocation.Height; } if (target.MEMSLocation.Left != 0) { target._memsView.Left = target.MEMSLocation.Left; target._memsView.WinLeft = target.MEMSLocation.Left; } if (target.MEMSLocation.Top != 0) { target._memsView.Top = target.MEMSLocation.Top; target._memsView.WinTop = target.MEMSLocation.Top; } target._memsView.Show(); target.MEMSLocation.IsOpen = true; } else if (target.MEMSLocation.IsOpen) { target._memsView.Close(); } else { target._memsView.Show(); target.MEMSLocation.IsOpen = true; } target._memsView.Text = str; target._memsView.UpdatePortManager += new frmMEMSView.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._memsView.BringToFront(); return target._memsView; }
private void CreateStaticNavWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Static Nav"; frmStaticNav nav = new frmStaticNav(target.comm); nav.Text = str; nav.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
private frmSatelliteStats localCreateSatelliteStatsWin(PortManager target) { string str = target.comm.sourceDeviceName + ": Satellite Statistics"; if ((target._SatelliteStats == null) || target._SatelliteStats.IsDisposed) { target._SatelliteStats = new frmSatelliteStats(target.comm); if (target.SatelliteStatsLocation.Width != 0) { target._SatelliteStats.Width = target.SatelliteStatsLocation.Width; target._SatelliteStats.WinWidth = target.SatelliteStatsLocation.Width; } if (target.SatelliteStatsLocation.Height != 0) { target._SatelliteStats.Height = target.SatelliteStatsLocation.Height; target._SatelliteStats.WinHeight = target.SatelliteStatsLocation.Height; } if (target.SatelliteStatsLocation.Left != 0) { target._SatelliteStats.Left = target.SatelliteStatsLocation.Left; target._SatelliteStats.WinLeft = target.SatelliteStatsLocation.Left; } if (target.SatelliteStatsLocation.Top != 0) { target._SatelliteStats.Top = target.SatelliteStatsLocation.Top; target._SatelliteStats.WinTop = target.SatelliteStatsLocation.Top; } target._SatelliteStats.Show(); target.SatelliteStatsLocation.IsOpen = true; } else if (target.SatelliteStatsLocation.IsOpen) { target._SatelliteStats.Close(); } else { target._SatelliteStats.Show(); target.SatelliteStatsLocation.IsOpen = true; } target._SatelliteStats.Text = str; target._SatelliteStats.UpdatePortManager += new frmSatelliteStats.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); target._SatelliteStats.BringToFront(); return target._SatelliteStats; }
private void CreateSwitchOperationModeWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { string str = target.comm.sourceDeviceName + ": Switch Operation Mode"; frmSwitchOperationMode mode = new frmSwitchOperationMode(target.comm); mode.Text = str; mode.ShowDialog(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
public frmCommMessageFilter CreateMessageViewWin(PortManager target) { EventHandler method = null; if (target == null) { return null; } if (!base.IsDisposed) { if (base.InvokeRequired) { if (method == null) { method = delegate { target.MessageView = localCreateMessageViewWin(target); }; } base.Invoke(method); } else { target.MessageView = localCreateMessageViewWin(target); } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } return target.MessageView; }
private void CreateTransmitSerialMessageWin(PortManager target) { if (target != null) { if (target.comm.IsSourceDeviceOpen()) { string str = target.comm.sourceDeviceName + ": User Defined Message"; if ((target._transmitSerialMessageWin == null) || target._transmitSerialMessageWin.IsDisposed) { target._transmitSerialMessageWin = new frmTransmitSerialMessage(target.comm); if (target.TransmitSerialMessageLocation.Width != 0) { target._transmitSerialMessageWin.Width = target.TransmitSerialMessageLocation.Width; target._transmitSerialMessageWin.WinWidth = target.TransmitSerialMessageLocation.Width; } if (target.TransmitSerialMessageLocation.Height != 0) { target._transmitSerialMessageWin.Height = target.TransmitSerialMessageLocation.Height; target._transmitSerialMessageWin.WinHeight = target.TransmitSerialMessageLocation.Height; } if (target.TransmitSerialMessageLocation.Left != 0) { target._transmitSerialMessageWin.Left = target.TransmitSerialMessageLocation.Left; target._transmitSerialMessageWin.WinLeft = target.TransmitSerialMessageLocation.Left; } if (target.TransmitSerialMessageLocation.Top != 0) { target._transmitSerialMessageWin.Top = target.TransmitSerialMessageLocation.Top; target._transmitSerialMessageWin.WinTop = target.TransmitSerialMessageLocation.Top; } target._transmitSerialMessageWin.UpdatePortManager += new frmTransmitSerialMessage.UpdateWindowEventHandler(target.UpdateSubWindowOnClosed); } target._transmitSerialMessageWin.Show(); target.TransmitSerialMessageLocation.IsOpen = true; target._transmitSerialMessageWin.Text = str; target._transmitSerialMessageWin.BringToFront(); } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }
public void Summary_MPM(string directoryPath) { StreamReader reader = null; StreamWriter writer = null; PortManager manager = new PortManager(); List<string> list = null; List<double> list2 = new List<double>(); List<double> list3 = new List<double>(); List<double> list4 = new List<double>(); List<double> list5 = new List<double>(); List<double> list6 = new List<double>(); List<double> list7 = new List<double>(); try { FileInfo[] files = new DirectoryInfo(directoryPath).GetFiles("*.gps"); int[] numArray = new int[8]; string[] strArray = new string[] { "Not Use", "SV Data", "Eph Collection", "Almanac Collection", "GPS Update", "Recovery Mode", "Not Use", "Full Pwr SV Data Update" }; if (files.Length != 0) { new ArrayList(); foreach (FileInfo info2 in files) { reader = info2.OpenText(); writer = new StreamWriter(info2.FullName.Replace(".gps", "_mpmPar.csv")); List<SiRFawareStatsParams> list8 = new List<SiRFawareStatsParams>(); list = new List<string>(); string name = info2.Name; Hashtable siRFAwareScanResHash = null; string csvString = reader.ReadLine(); string str3 = "Not Detect"; bool flag = false; bool flag2 = false; for (int i = 0; i < numArray.Length; i++) { numArray[i] = 0; } while (csvString != null) { if (csvString.StartsWith("77,1")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 1, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (csvString.StartsWith("77,2")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 2, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (csvString.StartsWith("77,3")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 3, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (csvString.StartsWith("77,4")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 4, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (csvString.StartsWith("77,5")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 5, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (csvString.StartsWith("77,7")) { siRFAwareScanResHash = manager.comm.getMPMStatsDataForGUIFromCSV(0x4d, 7, "OSP", csvString); flag2 = true; list.Add(csvString); } else if (!flag && csvString.Contains("SW Version")) { string pattern = @"SW Version*:\s*(?<swVer>.*)"; Regex regex = new Regex(pattern, RegexOptions.Compiled); if (regex.IsMatch(csvString)) { str3 = regex.Match(csvString).Result("${swVer}"); flag = true; list.Add(csvString); } } if (flag2) { SiRFawareStatsParams item = manager.comm.RxCtrl.DecodeMPMStats(siRFAwareScanResHash); if (item != null) { list8.Add(item); } } csvString = reader.ReadLine(); } list2.Clear(); list3.Clear(); list4.Clear(); list5.Clear(); list6.Clear(); list7.Clear(); foreach (SiRFawareStatsParams params2 in list8) { if (params2.isValid_TimeSpentInFullPowerSec) { list2.Add((double) params2.TOW); list3.Add((double) params2.TimeSpentInFullPowerSec); } if (params2.isValid_TotalSVMeasureWithBE) { list4.Add((double) params2.TOW); list5.Add((double) params2.TotalSVMeasureWithBE); } if (params2.isValid_TotalSVMeasureWithEE) { list6.Add((double) params2.TOW); list7.Add((double) params2.TotalSVMeasureWithEE); } if ((params2.UpdateType >= 0) && (params2.UpdateType < numArray.Length)) { numArray[params2.UpdateType]++; } } frmMPMStatsPlots plots = new frmMPMStatsPlots(); string label = "On Time(s)"; Color blue = Color.Blue; plots.SetPlotData(list2.ToArray(), list3.ToArray(), "SiRFaware Plot(s)", label, blue); plots.Show(); label = "Total SVs With BE"; blue = Color.Green; plots.SetPlotData(list4.ToArray(), list5.ToArray(), "SiRFaware Plot(s)", label, blue); plots.AddCurveToPlot(); label = "Total SVs With EE"; blue = Color.Purple; plots.SetPlotData(list6.ToArray(), list7.ToArray(), "SiRFaware Plot(s)", label, blue); plots.AddCurveToPlot(); plots.Width = 0x3e8; plots.SavePlots(info2.FullName.Replace(".gps", ".jpeg")); plots.Close(); writer.WriteLine("Data File Path = {0}", name); writer.WriteLine("SW Version = {0}", str3); for (int j = 1; j < numArray.Length; j++) { if (j != 6) { writer.WriteLine("{0} = {1}", strArray[j], numArray[j]); } } writer.WriteLine("End Summary"); foreach (string str6 in list) { writer.WriteLine(str6); } reader.Close(); writer.Close(); if (list != null) { list.Clear(); list = null; } } this.mpmReportGen(directoryPath); } } catch { list2.Clear(); list3.Clear(); list4.Clear(); list5.Clear(); list6.Clear(); list7.Clear(); if (reader != null) { reader.Close(); reader = null; } if (writer != null) { writer.Close(); writer = null; } if (manager != null) { manager = null; } if (list != null) { list.Clear(); list = null; } } }
public void PerPortUpdateConnectBtnImage(PortManager target) { CommunicationManager comm; bool isConnect; if (target != null) { comm = target.comm; isConnect = false; base.BeginInvoke((MethodInvoker)delegate { if (comm != null) { isConnect = comm.IsSourceDeviceOpen(); } if (isConnect) { if (target.PerPortToolStrip != null) { target.PerPortToolStrip.Items[_toolStripConnectBtnIdx].Image = Resources.connect; target.PerPortToolStrip.Items[_toolStripConnectBtnIdx].Text = "Disconnect"; } } else if (target.PerPortToolStrip != null) { target.PerPortToolStrip.Items[_toolStripConnectBtnIdx].Image = Resources.disconnect; target.PerPortToolStrip.Items[_toolStripConnectBtnIdx].Text = "Connect"; } }); } }