Exemplo n.º 1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="table"></param>
        /// <param name="filePath"></param>
        /// <param name="isTempPath">是否是临时路径,如果是,则不进行提示</param>
        /// <param name="enableDelete"></param>
        public ObsFileChartEditForm(string filePath, bool isTempPath = false, bool isSort = false, bool isDrawAll = false, bool enableDelete = false)
        {
            InitializeComponent();
            this.isDrawAll = isDrawAll;
            this.ObsFile   = RinexObsFileReader.Read(filePath);

            this.Text  = ObsFile.Header.FileName;
            this.Table = ObsFile.BuildObjectTable(isDrawAll);
            if (isSort)
            {
                Table.ParamNames.Sort();
            }
            this.ObsFilePath = filePath;
            this.chartControl1.EnableDelete = enableDelete;
            this.ObsFile = ObsFile;
            if (enableDelete)
            {
                if (!isTempPath)
                {
                    Geo.Utils.FormUtil.ShowWarningMessageBox("请注意,所做修改将直接替换原文件!注意备份。\r\n" + filePath);
                }
                this.chartControl1.DataDeleting += ChartControl1_DataDeleting;
            }

            Draw(Table);
        }
Exemplo n.º 2
0
        private void ChartControl1_DataDeleting(Dictionary <string, IntSegment> obj)
        {
            var segment    = obj.First().Value;
            var indexes    = Table.GetIndexValues <Time>();
            var startEpoch = indexes[segment.Start];
            var endEpoch   = indexes[segment.End];
            var timeperiod = new TimePeriod(startEpoch, endEpoch);

            var prns = new List <SatelliteNumber>();

            foreach (var kv in obj)
            {
                prns.Add(SatelliteNumber.Parse(kv.Key));
            }

            ObsFile.Remove(prns, timeperiod);

            RinexObsFileWriter.Write(ObsFile, ObsFilePath);

            this.ObsFile = RinexObsFileReader.Read(ObsFilePath);
            this.Table   = ObsFile.BuildObjectTable(isDrawAll);

            Draw(Table);
        }