Example #1
0
        private void button_combine_Click(object sender, EventArgs e)
        {
            var pathA = this.fileOpenControlA.FilePath;
            var pathB = this.fileOpenControlB.FilePath;

            if (!File.Exists(pathA) || !File.Exists(pathB))
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("请选择模糊度文件后再试!");
                return;
            }

            var ambiA = PeriodRmsedNumeralStoarge.Read(pathA);
            var ambiB = PeriodRmsedNumeralStoarge.Read(pathB);

            var result = PeriodRmsedNumeralStoarge.Combine(ambiA, ambiB);

            objectTableControlA.DataBind(ambiA.ToTable());
            objectTableControlB.DataBind(ambiB.ToTable());
            objectTableControlC.DataBind(result.ToTable());

            var outputPath = Path.Combine(Setting.TempDirectory, "CombinedOf" + Path.GetFileNameWithoutExtension(pathA) + "And" + Path.GetFileNameWithoutExtension(pathB) + Setting.AmbiguityFileExtension);
            var table      = result.ToTable();
            var writer     = new ObjectTableWriter(outputPath);

            writer.Write(table);
            writer.Close();
            Geo.Utils.FormUtil.ShowOkAndOpenDirectory(Setting.TempDirectory);
        }
        private void button_run_Click(object sender, EventArgs e)
        {
            var floatPath  = fileOpenControl_ionoFreeFloat.FilePath;
            var mwPath     = this.fileOpenControl_mwWide.FilePath;
            var mwTable    = ObjectTableReader.Read(mwPath);
            var floatTable = ObjectTableReader.Read(floatPath);

            //Group 文件包括, Index	Site	Name	Group	Value	Rms
            //参数文件包括,ParamName,Value, Rms
            //首先求取宽项模糊度
            GroupedValueService    wmValues           = new GroupedValueService(mwTable);
            ParamValueService      paramValueService  = new ParamValueService(floatTable);
            NameRmsedNumeralVector wideLaneVector     = GetIntMwDoubleDiffers(paramValueService, wmValues);
            WeightedVector         rawFloatAmbiCycles = paramValueService.GetWeightedVector();

            WeightedVector fixedParams = DoFixIonoFreeDoubleDifferAmbiguity(rawFloatAmbiCycles, wideLaneVector);

            //输出结果
            ObjectTableStorage fixedParam = BuildFixedParamTable(fixedParams);

            objectTableControl1.DataBind(fixedParam);

            var path = Path.Combine(directorySelectionControl1.Path, "FixedParams" + Setting.AmbiguityFileExtension);

            ObjectTableWriter.Write(fixedParam, path);

            Geo.Utils.FormUtil.ShowOkAndOpenDirectory(path);
        }
Example #3
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="table"></param>
        public void DataBind(ObjectTableStorage table)
        {
            var title = table.Name + ", 共 " + table.ColCount + "列 × " + table.RowCount + "行";

            log.Debug("绑定显示 " + title);

            this.TableObjectStorage = table;
            try
            {
                //this.Invoke(new Action(() =>//采用Invoke将出错
                //{
                this.dataGridView1.DataSource   = table.GetDataTable();
                toolStripLabel_info.Text        = title;
                bindingSource1.DataSource       = this.dataGridView1.DataSource;
                bindingNavigator1.BindingSource = bindingSource1;
                //}));
            }catch (Exception ex)
            {
                this.dataGridView1.DataSource   = null;
                bindingSource1.DataSource       = null;
                bindingNavigator1.BindingSource = bindingSource1;


                var path = Path.Combine(Application.StartupPath, table.Name + ".txt.xls");
                Gdp.Utils.FormUtil.ShowIfOpenDirMessageBox(path, "数据显示出错:" + ex.Message
                                                           + "\r\n" + "数据已保存在:" + path + ", 是否打开?");
                ObjectTableWriter.Write(table, path);
            }
        }
Example #4
0
        private void Complete()
        {
            if (!button_Run.Enabled)
            {
                table.Name = "SiteInfo";
                var path = Path.Combine(this.OutputDirectory, "SiteInfo.txt.xls");

                Utils.FileUtil.CheckOrCreateDirectory(this.OutputDirectory);


                button_Run.Enabled = true;
                var span                 = DateTime.Now - startTime;
                var m                    = span.TotalMinutes;
                var seconds              = span.TotalSeconds;
                int FileCount            = this.fileOpenControl1.FileCount;
                TableObjectViewForm form = new TableObjectViewForm(table);
                form.Show();
                ObjectTableWriter.Write(table, path);
                string info = "Completed, the total number is " + FileCount + ". The time consumption is " + m.ToString("0.000") + "m=" + seconds.ToString("0.00") + "s, with an average of " + (seconds / FileCount).ToString("0.000") + "s each file";

                Utils.FormUtil.ShowOkAndOpenDirectory(path, info + ", open it?");
                ShowInfo(info);
                log.Info(info);
                this.progressBar1.Value = this.progressBar1.Maximum;
            }
        }
Example #5
0
 public DataEventMapper(ObjectTableWriter fieldsWriter, ObjectTableReader fieldsReader)
 {
     ReportSerializer  = new ExecutionReportSerializer();
     CommandSerializer = new ExecutionCommandSerializer(fieldsWriter, fieldsReader);
     StopSerializer    = new StopSerializer(fieldsWriter, fieldsReader);
     RegisterType(CommandSerializer.ToBson, CommandSerializer.ToCommand);
     RegisterType(ReportSerializer.ToBson, ReportSerializer.ToReport);
     RegisterType(StopSerializer.ToBson, StopSerializer.ToStop);
     RegisterType(PortfolioSerializer.ToBson, PortfolioSerializer.ToPortfolio);
 }
        public StopSerializer(ObjectTableWriter writer, ObjectTableReader reader)
        {
            if (writer != null)
            {
                _fieldsWriter = writer;
            }

            if (reader != null)
            {
                _fieldsReader = reader;
            }
        }
        public ExecutionCommandSerializer(ObjectTableWriter writer, ObjectTableReader reader)
        {
            if (writer != null)
            {
                _fieldsWriter = writer;
            }

            if (reader != null)
            {
                _fieldsReader = reader;
            }
        }
Example #8
0
 /// <summary>
 /// 保存产品
 /// </summary>
 /// <param name="outputPath"></param>
 public void SaveProduct(string outputPath)
 {
     if (AmbiguityStorage != null)
     {
         var product = AmbiguityStorage.GetProduct();
         var table   = product.ToTable();
         if (table.RowCount == 0 || table.ColCount == 0)
         {
             return;
         }
         var writer = new ObjectTableWriter(outputPath);
         writer.Write(table);
         writer.Close();
     }
 }
Example #9
0
        public override void  Complete()
        {
            base.Complete();

            var table  = paramAnalyzer.GetTotalFileParamConvergenceTable();
            var table2 = paramAnalyzer.GetTotalFileParamRmsTable();

            this.BindTableA(table);
            this.BindTableB(table2);

            var path = Path.Combine(this.OutputDirectory, table.Name + Geo.Setting.TextTableFileExtension);

            ObjectTableWriter.Write(table, path);
            path = Path.Combine(this.OutputDirectory, table2.Name + Geo.Setting.TextTableFileExtension);
            ObjectTableWriter.Write(table2, path);
        }
Example #10
0
        /// <summary>
        /// 多路径效应因子
        /// </summary>
        private Dictionary <FrequenceType, double> GetMultipathFactors()
        {
            ObjectTableStorage table = BuildObjectTable();
            var aveRms = table.GetAveragesWithStdDev();

            var table2     = BuildObjectTable2();
            var OutputPath = Path.Combine(Setting.GnsserConfig.TempDirectory, FileName + "_Mp.xls");
            var writer     = new ObjectTableWriter(OutputPath);

            writer.Write(table2);

            Dictionary <FrequenceType, double> data = new Dictionary <FrequenceType, double>();

            foreach (var val in aveRms)
            {
                var type = Geo.Utils.EnumUtil.Parse <FrequenceType>(val.Key);
                data.Add(type, val.Value[1]);
            }

            return(data);
        }
Example #11
0
        private void button_combine_Click(object sender, EventArgs e)
        {
            var epochParamPath    = this.fileOpenControl_EpochParam.FilePath;
            var epochParamRmsPath = this.fileOpenControl_EpochParamRms.FilePath;
            var maxBreak          = namedIntControl_allowBreakCount.GetValue();

            if (!File.Exists(epochParamPath))
            {
                Geo.Utils.FormUtil.ShowWarningMessageBox("请选择参数文件后再试!");
                return;
            }
            double defaultRms = namedFloatControl_defaultRms.GetValue();
            PeriodParamExtractor periodParamExtractor = new PeriodParamExtractor(epochParamPath, epochParamRmsPath, maxBreak, defaultRms);
            var result = periodParamExtractor.Build().ToTable();

            var outputPath = Path.Combine(Setting.TempDirectory, Path.GetFileNameWithoutExtension(epochParamPath) + Setting.AmbiguityFileExtension);

            this.objectTableControlB.DataBind(result);
            ObjectTableWriter.Write(result, outputPath);

            Geo.Utils.FormUtil.ShowOkAndOpenDirectory(Setting.TempDirectory);
        }
Example #12
0
        public void DataBind(MatrixEquation mat)
        {
            Entity = (mat);

            //具有固定参数,则生成打开
            if (this.HasOrEnableFixedParam)
            {
                var fixedStorage = this.GetFixedParamStorage();
                if (fixedStorage != null)
                {
                    ParamFixedMatrixEquationBuilder equationBuilder = new ParamFixedMatrixEquationBuilder(fixedStorage);
                    var newEq = equationBuilder.Build(Entity);

                    MatrixEquationForm form = new MatrixEquationForm();
                    form.DataBind(newEq);
                    form.Show();
                }
            }

            StringBuilder sb = new StringBuilder();

            if (Entity.MaxSize > MaxOrderToShow)
            {
                sb.Append("超出最大显示阶数:" + Entity.MaxSize);
            }
            else
            {
                //左右方程
                this.richTextBoxControl_left.Text  = Entity.LeftSide.ToReadableText();
                this.richTextBoxControl_right.Text = Entity.RightSide.ToReadableText();

                if (Entity.HasWeightOfRightSide)
                {
                    richTextBoxControl_weightOfU.Text = Entity.QofU.ToReadableText();
                }

                sb.AppendLine("方程文本");
                sb.AppendLine(Entity.ToReadableText());
            }

            //法方程与观测残差
            var normal = Entity.NormalEquation;

            sb.AppendLine("法方程文本");
            sb.AppendLine(normal.ToReadableText());

            sb.AppendLine("参数计算结果");
            var est = normal.GetEstimated();

            sb.AppendLine(est.ToReadableText());

            var table = est.GetObjectTable();

            this.objectTableControl_result.DataBind(table);
            //写结果
            var paramPath = Path.Combine(OutputDirectory, "EstimatedParamOf" + Entity.Name + Setting.ParamFileExtension);

            ObjectTableWriter.Write(table, paramPath);


            sb.AppendLine("观测残差");
            sb.AppendLine(normal.GetResidual().ToReadableText());


            this.richTextBoxControl_result.Text = sb.ToString();
        }
        private void DataBind(MatrixEquation mat)
        {
            Entity = mat;



            //具有固定参数,则生成打开
            if (this.HasOrEnableFixedParam)
            {
                var fixedStorage = this.GetFixedParamStorage();
                if (fixedStorage != null)
                {
                    ParamFixedMatrixEquationBuilder equationBuilder = new ParamFixedMatrixEquationBuilder(fixedStorage);
                    var newEq = equationBuilder.Build(Entity);

                    MatrixEquationForm form = new MatrixEquationForm();
                    form.DataBind(newEq);
                    form.Show();
                }
            }



            this.richTextBoxControl_left.Text = Entity.LeftSide.ToReadableText();
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(Entity.RightSide.ToReadableText());

            if (Entity.HasWeightOfRightSide && Entity.QofU.RowCount < 100)
            {
                sb.AppendLine("右边权逆阵");
                sb.AppendLine(Entity.QofU.ToReadableText());
            }

            this.richTextBoxControl_right.Text = sb.ToString();

            //输出
            var path = Path.Combine(OutputDirectory, mat.Name + Setting.TextMatrixEquationFileExtension);

            WriteToTextFile(path);


            //法方程与观测残差
            sb = new StringBuilder();
            var normal = Entity.NormalEquation;

            sb.AppendLine("法方程文本");
            sb.AppendLine(normal.ToReadableText());

            sb.AppendLine("参数计算结果");
            var est = normal.GetEstimated();

            sb.AppendLine(est.ToReadableText());

            var table = est.GetObjectTable();

            this.objectTableControl1.DataBind(table);
            //写结果
            var paramPath = Path.Combine(OutputDirectory, "EstimatedParamOf" + Entity.Name + Setting.ParamFileExtension);

            ObjectTableWriter.Write(table, paramPath);


            sb.AppendLine("观测残差");
            sb.AppendLine(normal.GetResidual().ToReadableText());

            richTextBoxControl_normal.Text = sb.ToString();
        }
 /// <summary>
 /// 设置订单或STOP的自定义数据的存储方法
 /// </summary>
 /// <param name="writer"></param>
 /// <returns></returns>
 public StrategyServer SetFieldsWriter(ObjectTableWriter writer)
 {
     _fieldsWriter = writer;
     return this;
 }
        protected override void Run(string[] oPathes)
        {
            this.BasePrn = baseSatSelectingControl1.SelectedPrn;
            //if (BasePrn.SatelliteType != SatelliteType.G)
            //{
            //    Geo.Utils.FormUtil.ShowWarningMessageBox("暂只支持GPS系统");
            //    return;
            //}

            this.ProgressBar.InitProcess(oPathes.LongLength);

            //输出的采样间隔
            var isAnasysOrTable = checkBox_anasysOrTable.Checked;
            var isSmoothRange   = checkBox_IsSmoothRange.Checked;

            if (isAnasysOrTable)//平均法
            {
                var builder = new SiteMwValueManagerBuilder(oPathes, AngleCut);
                builder.IsSmoothRange     = isSmoothRange;
                builder.OneFileProcessed += Builder_OneFileProcessed;

                var result = builder.Build();
                ProduceAndShow(result);
            }
            else //表格法,序贯平差法
            {
                var builder = new MwTableBuilder(oPathes, AngleCut, namedIntControl_emptyRowCount.Value, this.OutputDirectory, this.SatelliteTypes, IsOutputSmoothed);
                builder.AveMaxBreakCount = namedIntControl_aveMaxBeakCount.GetValue();
                builder.AveMaxDiffer     = namedFloatControl_aveMaxDiffer.GetValue();
                builder.AveMinCount      = namedIntControl_aveMinCount.GetValue();

                builder.IsSmoothRange     = isSmoothRange;
                builder.OneFileProcessed += Builder_OneFileProcessed;
                builder.Build();
                //输出
                log.Info("生成完毕,准备输出。");

                this.BindTableA(builder.RawMwValue.First);
                this.BindTableB(builder.MwPeriodAverage);

                //是否生成和输出平滑MW
                if (IsOutputSmoothed)
                {
                    this.BindTableB(builder.SmoothedMwValue.First);
                    this.BindTableC(builder.FractionOfSmoothedMwValue.First);

                    builder.SmoothedMwValue.WriteAllToFileAndClearBuffer(builder.SmoothedMwValue.First);
                }
                //是否输出原始数据
                if (IsOutputRawMw)
                {
                    builder.RawMwValue.WriteAllToFileAndClearBuffer(builder.RawMwValue.First);
                }

                //输出时段结果
                var periodAvePath = Path.Combine(OutputDirectory, builder.MwPeriodAverage.Name + Setting.TextGroupFileExtension);
                ObjectTableWriter.Write(builder.MwPeriodAverage, periodAvePath);

                if (IsOutputFraction)
                {
                    builder.FractionOfSmoothedMwValue.WriteAllToFileAndClearBuffer(builder.FractionOfSmoothedMwValue.First);
                }
            }
            this.ProgressBar.Full();
        }
Example #16
0
        public override void Write(IMatrix matrix)
        {
            Matrix mat = new Matrix(matrix);

            ObjectTableWriter.Write(mat.GetObectTable(), Stream, this.Encoding);
        }