示例#1
0
        private void DlgGpsManager_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //LibSys.StatusBar.Trace("DlgGpsManager_Closing");
            if(!duplicate)
            {
                this.closeButton.Enabled = false;
                Cursor.Current = Cursors.WaitCursor;

                if(m_commandThread != null)
                {
                    //LibSys.StatusBar.Trace("DlgGpsManager_Closing (thread running)");
                    closing = true;		// disables all callbacks; make CompleteCallback close dialog
                    if(this.rtStopButton.Visible)
                    {
                        doRefresh = doRefreshFull = true;

                        stopRealTimeThread();	// will likely cause completeCallback called, where doRefreshFull will cause ProcesCameraMove()

                        //m_cameraManager.ProcessCameraMove();	// make sure that trackpoints are renumbered and end point labeled

            //						this.setupTabPage.Enabled = true;
            //						this.dataTabPage.Enabled = true;
            //						this.optionsTabPage.Enabled = true;

                        gpsBasicsGroupBox.BackColor = Color.Yellow;
                        gpsBasicsGroupBox.Text = "stopped";

                        e.Cancel = true;
                        return;				// will have to close in callback
                    }
                    else
                    {
                        killGpsThread();
                    }
                }

                if(this.makeComboBox.SelectedIndex >= 0)		// may be -1 in some weird dialog-closing phases
                {
                    Project.gpsMakeIndex = this.makeComboBox.SelectedIndex;
                    Project.gpsModelIndex = this.modelComboBox.SelectedIndex;
                    Project.gpsInterfaceIndex = this.interfaceComboBox.SelectedIndex;
                    Project.restoreOrDefaultGpsSettings();
                }

                this.dataTabPage.Controls.Clear();		// we don't want static GPS buttons panel to dispose, so we remove it early

                cleanGpsVehicle();

                This = null;
            }
        }
示例#2
0
        public DlgGpsManager(GpsInsertWaypoint insertWaypoint, CameraManager cameraManager,
			PictureManager pictureManager, ArrayList waypoints, ArrayList routes, string command)
        {
            //LibSys.StatusBar.Trace("DlgGpsManager()");
            if(isUp)
            {
                // duplicate for this instance stays true, so that all functions are disabled
                // and the form will be closed on load.
                this.duplicate = true;
                this.Load += new System.EventHandler(this.DlgGpsManager_Load);	// we will close this instance on load
            }
            else
            {
                This = this;
                duplicate = false;

                m_insertWaypoint = insertWaypoint;
                m_cameraManager = cameraManager;
                m_pictureManager = pictureManager;
                m_waypoints = waypoints == null ? WaypointsCache.WaypointsAll : waypoints;
                m_routes = routes == null ? WaypointsCache.RoutesAll : routes;
                m_command = command;

                //
                // Required for Windows Form Designer support
                //
                InitializeComponent();

                this.SuspendLayout();
                populateGpsPanel();

                //#if DEBUG
                //			Project.gpsLogProtocol = true;
                //			Project.gpsLogPackets = true;
                //			Project.gpsLogErrors = true;
                //#else
                Project.gpsLogProtocol = false;
                Project.gpsLogPackets = false;
                Project.gpsLogErrors = false;
                //#endif

                Project.setDlgIcon(this);
                //LibSys.StatusBar.Trace("DlgGpsManager() done");

                m_initialColor = gpsBasicsGroupBox.BackColor;
                gpsBasicsGroupBox.BackColor = Color.Yellow;
                gpsBasicsGroupBox.Text = "stopped";

                progressDetailDelta = progressGroupBox.Height;
                maxShrinkDelta = progressDetailDelta + Math.Abs(this.PointToScreen(progressDetailButton.Bounds.Location).Y - this.PointToScreen(shrinkMaxButton.Bounds.Location).Y) - slopeLabel.Height;
                this.ResumeLayout(true);
            }
        }