Пример #1
0
        private void zoomButton_Click(object sender, System.EventArgs e)
        {
            ArrayList selected = GetSelectedRows(geotiffDataGrid);

            if (selected.Count > 0)
            {
                ClearMessages();
                CustomMapsCache.resetBoundaries();
                int       column = 0;
                DataTable table  = m_geotiffDS.Tables[0];
                foreach (int row in selected)
                {
                    long      cmId = (long)((int)geotiffDataGrid[row, column]);
                    CustomMap cm   = CustomMapsCache.getCustomMapById(cmId);
                    if (cm != null)
                    {
                        CustomMapsCache.pushBoundaries(cm.TopLeft);
                        CustomMapsCache.pushBoundaries(cm.BottomRight);
                    }
                }
                PictureManager.This.CameraManager.zoomToCorners(CustomMapsCache.TopLeft, CustomMapsCache.BottomRight);
            }
            else
            {
                Project.ShowPopup(zoomButton, "\nselect a custom map first" + Project.SELECT_HELP, Point.Empty);
            }
        }
Пример #2
0
        private void setCustomMapsEnabled(DataGrid dataGrid, DataSet dataSet, bool enabled, Control owner)
        {
            ArrayList selected = GetSelectedRows(dataGrid);

            if (selected.Count > 0)
            {
                ClearMessages();
                int       column = 0;
                DataTable table  = dataSet.Tables[0];
                foreach (int row in selected)
                {
                    long      cmId = (long)((int)geotiffDataGrid[row, column]);
                    CustomMap cm   = CustomMapsCache.getCustomMapById(cmId);
                    if (cm != null)
                    {
                        // rows in the table are numbered differently than rows in the grid, so we go by track ID:
                        for (int indx = 0; indx < table.Rows.Count; indx++)
                        {
                            long rowCustomMapId = (long)((int)table.Rows[indx][column]);
                            if (rowCustomMapId == cmId)
                            {
                                cm.Enabled = enabled;
                                table.Rows[indx]["displayed"] = enabled;
                                break;
                            }
                        }
                    }
                }
                PutOnMap();
            }
            else
            {
                Project.ShowPopup(owner, "\nselect a custom map first" + Project.SELECT_HELP, Point.Empty);
            }
        }
Пример #3
0
        private void unlistCustomMap(long id)
        {
            CustomMap cm = CustomMapsCache.getCustomMapById(id);

            if (cm != null)
            {
                for (int i = 0; i < Project.FileDescrList.Count; i++)
                {
                    FormattedFileDescr ffd = (FormattedFileDescr)Project.FileDescrList[i];
                    if (ffd.filename.Equals(cm.Source))
                    {
                        Project.FileDescrList.RemoveAt(i);
                        break;
                    }
                }
            }
        }
Пример #4
0
        private void HandleCustomMapPersistChanges(object sender, BoolValueChangedEventArgs e)
        {
#if DEBUG
            string str = "Persist changed: row " + e.Row + "   value " + e.BoolValue;
#endif
            int       column    = 0;
            DataTable table     = m_geotiffDS.Tables[0];
            int       row       = e.Row;
            long      geotiffId = (long)((int)geotiffDataGrid[row, column]);
            CustomMap cm        = CustomMapsCache.getCustomMapById(geotiffId);
#if DEBUG
            str += "  " + row + "=" + geotiffId + " ";
#endif
            if (cm != null)
            {
                cm.Persist = e.BoolValue;
                //PutOnMap();
            }
#if DEBUG
            LibSys.StatusBar.Trace(str);
            //messageLabel.Text = str;
#endif
        }