/// <summary> /// 转换结果类型 /// </summary> /// <param name="LevelGradeType"></param> /// <returns></returns> public static ResultState GradeToResultState(GnssGradeType LevelGradeType) { ResultState resultState = ResultState.Unknown; switch (LevelGradeType) { case GnssGradeType.AA: case GnssGradeType.A: resultState = ResultState.Good; break; case GnssGradeType.B: case GnssGradeType.C: resultState = ResultState.Acceptable; break; case GnssGradeType.D: case GnssGradeType.E: resultState = ResultState.Warning; break; case GnssGradeType.No: resultState = ResultState.Bad; break; case GnssGradeType.Unknown: resultState = ResultState.Unknown; break; default: resultState = ResultState.Unknown; break; } return(resultState); }
/// <summary> /// 构造函数 /// </summary> /// <param name="GnssGradeType"></param> public ResultBackGroundStyle(GnssGradeType GnssGradeType) { BackGroundBrush = new SolidBrush(Color.White); // Brushes.White; BackGroundBrushSelected = new SolidBrush(Color.DarkGray); //Brushes.DarkGray; var ResultState = GnssGradeTypeHelper.GradeToResultState(GnssGradeType); this.Init(ResultState); }
/// <summary> /// 获取当前精度所处等级 /// </summary> /// <param name="closureErrorMeter">闭合差,单位:米</param> /// <param name="distanceMeter">距离,单位:米</param> /// <returns></returns> public static GnssGradeType GetGnssGrade(double closureErrorMeter, double distanceMeter) { closureErrorMeter = Math.Abs(closureErrorMeter); var grades = Enum.GetNames(typeof(GnssGradeType)); foreach (var grade in grades)//顺序从小到达 { GnssGradeType gnssGrade = Geo.Utils.EnumUtil.Parse <GnssGradeType>(grade); var tolerance = GnssReveiverNominalAccuracy.GetGnssGradeToleranceMeter(gnssGrade, distanceMeter); if (closureErrorMeter < tolerance) { return(gnssGrade); } } return(GnssGradeType.No); }
/// <summary> /// GNSS网的精度限差, 单位米 /// </summary> /// <param name="gnssGrade">GNSS网等级</param> /// <param name="distanceMeter">基线长度,单位米</param> /// <returns>GNSS网的精度限差, 单位米</returns> public static double GetGnssGradeToleranceMeter(GnssGradeType gnssGrade, double distanceMeter) { double fixedError = 3; double coefOfProportion = 1; switch (gnssGrade) { case GnssGradeType.AA: fixedError = 3; coefOfProportion = 0.01; break; case GnssGradeType.A: fixedError = 5; coefOfProportion = 0.1; break; case GnssGradeType.B: fixedError = 8; coefOfProportion = 1; break; case GnssGradeType.C: fixedError = 10; coefOfProportion = 5; break; case GnssGradeType.D: fixedError = 10; coefOfProportion = 10; break; case GnssGradeType.E: fixedError = 10; coefOfProportion = 20; break; default: break; } var mm = GnssReveiverNominalAccuracy.GetToleranceErrorMilliMeter(fixedError, coefOfProportion, distanceMeter); return(mm * 0.001); //单位转换为米 }