public void fillCommandObject(GpsBabelCommand gbc) { if(radioButtonAerial.Checked) { gbc.MapType = MapType.Aerial; } else if(radioButtonColorAerial.Checked) { gbc.MapType = MapType.ColorAerial; } else if(radioButtonTopo.Checked) { gbc.MapType = MapType.Topo; } else if(radioButtonNone.Checked) { gbc.MapType = MapType.None; } gbc.OutputIOType = iotype; gbc.OutputFileName = OutputFileName; gbc.OutputCustom = OutputCustomArgs; gbc.OutputFormat = fileSelector.FormatName; gbc.OutputOptions = fileSelector.getOptionsText(); }
public void fillCommandObject(GpsBabelCommand gbc) { gbc.InputIOType = iotype; gbc.InputFileName = InputFileName; gbc.InputCustom = InputCustomArgs; gbc.InputFormat = fileSelector.FormatName; gbc.InputOptions = fileSelector.getOptionsText(); }
private void fillCommandObject(GpsBabelCommand gbc) { gbc.ProcessWaypointsInformation = wptCheckBox.Checked; gbc.ProcessTracksInformation = trkCheckBox.Checked; gbc.ProcessRoutesInformation = rteCheckBox.Checked; gbc.SynthesizeShortnames = shortnamesCheckBox.Checked; gbc.AdHoc = adHocTextBox.Text.Trim(); }
public void fillCommandObject(GpsBabelCommand gbc) { gbc.FilterOptions = m_textPane.OptionsText; }
// args will contain list of files dragged onto QM icon when starting the program public GpsBabelWrapperForm(string[] args) { LibSys.StatusBar.WriteLine("Starting GUI"); Project.mainForm = this; // Project.MessageBox needs this one (TODO:check this....) Args = (string[])args.Clone(); // we need to null out some elements as we process them Project.serverAvailable = true; ProgressMonitor.CountActive(); // just to have this class loaded and working. // LibSys.StatusBar.WriteLine("Greeting"); // if(m_greeting.Length > 0) // { // m_greeting = m_greeting + "\n\n...initializing, please wait...\n...framework " + Environment.Version; // // display greeting in a separate thread, and proceed with initializing: // m_greetingThread = new Thread( new ThreadStart(ShowGreeting)); // m_greetingThread.IsBackground = true; // terminate with the main process // m_greetingThread.Name = "Greeting"; // m_greetingThread.Start(); // } // // Required for Windows Form Designer support // InitializeComponent(); this.Text = Project.PROGRAM_NAME_HUMAN; this.aboutMenuItem.Text = "&About " + Project.PROGRAM_NAME_HUMAN; LibSys.StatusBar.setInterface(statusBar, statusBar2, mainProgressBar); LibSys.StatusBar.WriteLine("GUI up"); Project.recentFilesFirstIndex = this.fileMainMenuItem.MenuItems.Count; this.Text = Project.PROGRAM_NAME_HUMAN; Project.ReadOptions(); qmStartDelay.Value = Project.QuakeMapStartupDelay; if(Project.GpsBabelExecutable.Length == 0) { Project.resetGpsBabelExecutable(); } executableTextBox.Text = Project.GpsBabelExecutable; if(Project.QuakeMapExecutable.Length == 0) { Project.resetQuakeMapExecutable(); } executableQmTextBox.Text = Project.QuakeMapExecutable; m_gbc = new GpsBabelCommand(); m_inputControl = new InputControl(); m_outputControl = new OutputControl(); m_filtersPane = new FiltersPane(); m_inputControl.formatDoc = m_gbc.GetHelpXml(); m_outputControl.formatDoc = m_gbc.GetHelpXml(); m_filtersPane.filterDoc = m_gbc.GetHelpXml(); if (Project.firstRun) { m_outputControl.selectQuakeMapMode(); string sampleFile = Path.Combine(Project.startupPath, "dana-point.gpx"); if (File.Exists(sampleFile)) { m_inputControl.InputFileName = sampleFile; } } m_inputControl.Dock = DockStyle.Fill; inputGroupBox.Controls.Add(m_inputControl); m_inputControl.selectionChanged += new EventHandler(onInputSelectionChanged); m_inputControl.gpsSelectionChanged += new EventHandler(onInputGpsSelectionChanged); m_outputControl.Dock = DockStyle.Fill; outputGroupBox.Controls.Add(m_outputControl); m_outputControl.selectionChanged += new EventHandler(onOutputSelectionChanged); m_outputControl.gpsSelectionChanged += new EventHandler(onOutputGpsSelectionChanged); //m_filtersPane.Dock = DockStyle.Fill; filterTabPanel.Controls.Add(m_filtersPane); m_filtersPane.selectionChanged += new EventHandler(onFilterSelectionChanged); // good place to have camera coordinates set here, if supplied in command line: // /lat=34.123 /lon=-117.234 /elev=5000 /map=aerial (topo,color) processArgs(); // we need it as early as possible, before first web load - WebsiteInfo.init(Project.CGIBINPTR_URL) below - occured. Project.ApplyGlobalHTTPProxy(false); if(Project.mainFormMaximized) { this.WindowState = System.Windows.Forms.FormWindowState.Maximized; } else if(Project.fitsScreen(Project.mainFormX, Project.mainFormY, Project.mainFormWidth, Project.mainFormHeight) && Project.mainFormWidth > 300 && Project.mainFormHeight > 200) { this.Location = new Point(Project.mainFormX, Project.mainFormY); this.ClientSize = new System.Drawing.Size(Project.mainFormWidth, Project.mainFormHeight); // causes Resize() //this.Size = new System.Drawing.Size(Project.mainFormWidth, Project.mainFormHeight); // causes Resize() // this.Width = Project.mainFormWidth; // this.Height = Project.mainFormHeight; //this.Bounds = new System.Drawing.Rectangle(Project.mainFormX, Project.mainFormY, Project.mainFormWidth, Project.mainFormHeight); } WebsiteInfo.init(Project.CGIBINPTR_URL); // try to reach the QuakeMap server if(WebsiteInfo.HasReachedServer) { setInternetAvailable(true); // string message = "\nReached server: " + Project.PROGRAM_MAIN_SERVER + "\n "; // Project.MessageBox(null, message); } else { setInternetAvailable(false); // string message = "\nWarning: couldn't reach server: " + Project.PROGRAM_MAIN_SERVER + "\n\nWorking offline.\n "; // Project.ErrorBox(null, message); } if(Project.upgradeMessage.Length > 0) { new DlgUpgradeMessage(Project.upgradeMessage).ShowDialog(); } LibSys.StatusBar.WriteLine("Init"); //add dt worker method to the thread pool / queue a task //Project.threadPool.PostRequest (new WorkRequestDelegate (runInit), "MainForm init"); ThreadPool2.QueueUserWorkItem(new WaitCallback (runInit), "MainForm init"); periodicMaintenanceTimer.Interval = 1000; periodicMaintenanceTimer.Tick += new EventHandler(periodicMaintenance); periodicMaintenanceTimer.Start(); this.fillCommandObject(m_gbc); m_inputControl.fillCommandObject(m_gbc); m_outputControl.fillCommandObject(m_gbc); reEvaluate(); #if DEBUG try { string fileName = Project.GetMiscPath("gbhelp.xml"); m_gbc.GetHelpXml().Save(fileName); // Project.RunBrowser(fileName); } catch {} #endif inResize = false; }