Beispiel #1
0
        private void button_draw_Click(object sender, EventArgs e)
        {
            if (InstantValueStorage == null)
            {
                MessageBox.Show("请先计算,再绘图!"); return;
            }
            //Draw(CycleSlipDetector.CycleSlipStorage);
            var form = new CommonChartForm(InstantValueStorage);

            form.Text = "CycleSlip Of " + InstantValueStorage.Count + " Prns";
            form.Show();
        }
Beispiel #2
0
        private void button_run_Click(object sender, EventArgs e)
        {
            EphemerisService = GlobalNavEphemerisService.Instance;
            var prnStrs = namedStringControl_prn.GetValue();

            Prns    = SatelliteNumber.ParsePRNsBySplliter(prnStrs);
            cutOff  = namedFloatControl1AngleCut.GetValue();
            siteXyz = XYZ.Parse(this.namedStringControl_coord.GetValue());

            TableObject = new ObjectTableStorage();


            Geo.TimeLooper looper = timeLoopControl1.GetTimeLooper();
            looper.Looping   += Looper_Looping;
            looper.Completed += Looper_Completed;

            looper.Run();
            looper.Complete();


            var indexName = TableObject.GetIndexColName();

            var chart = chart1.ChartAreas[0];

            chart.BorderDashStyle = ChartDashStyle.Dash;
            chart.BorderWidth     = 1;
            //chart.AxisY.LineWidth = 5;
            chart.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;

            var seriesDic = new BaseDictionary <SatelliteNumber, Series>("卫星雷达图",
                                                                         new Func <SatelliteNumber, Series>(key =>
            {
                Series series     = new Series(key.ToString());
                series.ChartType  = SeriesChartType.Polar;
                series.YValueType = ChartValueType.Double;
                series.XValueType = ChartValueType.Double;
                //series["PolarDrawingStyle"] = "Line";
                //series["PolarDrawingStyle"] = "Line";
                series.MarkerSize  = 5;
                series.MarkerStyle = MarkerStyle.Circle;

                series.MarkerSize  = 5;
                series.BorderWidth = 5;

                return(series);
            }));

            foreach (var row in TableObject.BufferedValues)
            {
                var rowData = new BaseDictionary <SatelliteNumber, DataPoint>("", m => new DataPoint());
                foreach (var item in row)
                {
                    if (item.Key == indexName)
                    {
                        continue;
                    }
                    var prn = SatelliteNumber.Parse(item.Key);

                    var valName = item.Key;
                    if (valName.Contains(Elevation))
                    {
                        rowData.GetOrCreate(prn).SetValueY(item.Value);
                    }
                    if (valName.Contains(Azimuth))
                    {
                        rowData.GetOrCreate(prn).XValue = Geo.Utils.ObjectUtil.GetNumeral(item.Value);
                    }
                }

                foreach (var kv in rowData.Data)
                {
                    seriesDic.GetOrCreate(kv.Key).Points.Add(kv.Value);
                }
            }

            chart1.Series.Clear();
            foreach (var item in seriesDic)
            {
                chart1.Series.Add(item);
            }

            CommonChartForm form  = new CommonChartForm();
            var             char1 = form.Chart.ChartAreas[0];

            char1.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
            int defaulFontSize = 14;

            form.Chart.Series.Clear();
            var chart0 = form.Chart.ChartAreas[0];

            chart0.AxisX.IsLabelAutoFit              = true;
            chart0.AxisX.LabelAutoFitMinFontSize     = defaulFontSize;
            chart0.AxisY.IsLabelAutoFit              = true;
            chart0.AxisY.LabelAutoFitMinFontSize     = defaulFontSize;
            chart0.AxisX.LabelStyle.Font             = new Font(FontSettingOption.DefaultFontFamily, defaulFontSize, FontStyle.Regular, GraphicsUnit.Pixel);
            chart0.AxisY.LabelStyle.Font             = new Font(FontSettingOption.DefaultFontFamily, defaulFontSize, FontStyle.Regular, GraphicsUnit.Pixel);
            form.Chart.Legends[0].AutoFitMinFontSize = defaulFontSize;

            foreach (var item in seriesDic)
            {
                form.Chart.Series.Add(item);
            }
            form.Show();
        }
Beispiel #3
0
        public static void ShowChartForm(ObjectTableStorage TableObject)
        {
            var indexName = TableObject.GetIndexColName();
            var seriesDic = new BaseDictionary <SatelliteNumber, Series>("卫星雷达图",
                                                                         new Func <SatelliteNumber, Series>(key =>
            {
                Series series     = new Series(key.ToString());
                series.ChartType  = SeriesChartType.Polar;
                series.YValueType = ChartValueType.Double;
                series.XValueType = ChartValueType.Double;
                //series["PolarDrawingStyle"] = "Line";
                //series["PolarDrawingStyle"] = "Line";
                series.MarkerSize  = 5;
                series.MarkerStyle = MarkerStyle.Circle;

                series.MarkerSize  = 5;
                series.BorderWidth = 5;

                return(series);
            }));

            foreach (var row in TableObject.BufferedValues)
            {
                var rowData = new BaseDictionary <SatelliteNumber, DataPoint>("", m => new DataPoint());
                foreach (var item in row)
                {
                    if (item.Key == indexName)
                    {
                        continue;
                    }
                    var prn = SatelliteNumber.Parse(item.Key);

                    var valName = item.Key;
                    if (valName.Contains(Elevation))
                    {
                        rowData.GetOrCreate(prn).SetValueY(item.Value);
                    }
                    if (valName.Contains(Azimuth))
                    {
                        rowData.GetOrCreate(prn).XValue = Geo.Utils.ObjectUtil.GetNumeral(item.Value);
                    }
                }

                foreach (var kv in rowData.Data)
                {
                    seriesDic.GetOrCreate(kv.Key).Points.Add(kv.Value);
                }
            }

            CommonChartForm form = new CommonChartForm();

            form.Text = TableObject.Name;
            var char1 = form.Chart.ChartAreas[0];

            char1.AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
            int defaulFontSize = 14;

            form.Chart.Series.Clear();
            var chart0 = form.Chart.ChartAreas[0];

            chart0.AxisX.IsLabelAutoFit              = true;
            chart0.AxisX.LabelAutoFitMinFontSize     = defaulFontSize;
            chart0.AxisY.IsLabelAutoFit              = true;
            chart0.AxisY.LabelAutoFitMinFontSize     = defaulFontSize;
            chart0.AxisX.LabelStyle.Font             = new Font(FontSettingOption.DefaultFontFamily, defaulFontSize, FontStyle.Regular, GraphicsUnit.Pixel);
            chart0.AxisY.LabelStyle.Font             = new Font(FontSettingOption.DefaultFontFamily, defaulFontSize, FontStyle.Regular, GraphicsUnit.Pixel);
            form.Chart.Legends[0].AutoFitMinFontSize = defaulFontSize;

            foreach (var item in seriesDic)
            {
                form.Chart.Series.Add(item);
            }
            form.Show();
        }