public void ReadAutoReplyData(string filepath) { IniHelper helper = new IniHelper(filepath); string section = string.Empty; string key = string.Empty; string msg = string.Empty; section = "TTB_TIME_AIDING"; key = "ENABLE"; try { this.AutoReplyCtrl.TTBTimeAidingParams.Enable = Convert.ToByte(helper.IniReadValue(section, key)) == 1; if (this.AutoReplyCtrl.TTBTimeAidingParams.Enable) { this.AutoReplyCtrl.TimeTransferCtrl.Reply = true; this.AutoReplyCtrl.AutoReplyParams.AutoReplyTimeTrans = true; } } catch (Exception exception) { msg = "TTB_TIME_AIDING ENABLE: " + exception.Message; this.WriteApp(msg); } key = "TYPE"; try { this.AutoReplyCtrl.TTBTimeAidingParams.Type = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception2) { msg = "TTB_TIME_AIDING TYPE: " + exception2.Message; this.WriteApp(msg); } key = "TIME_ACC"; try { this.AutoReplyCtrl.TTBTimeAidingParams.Accuracy = Convert.ToUInt16(helper.IniReadValue(section, key)); } catch (Exception exception3) { msg = "TTB_TIME_AIDING TIME_ACC: " + exception3.Message; this.WriteApp(msg); } key = "TIME_SKEW"; try { this.AutoReplyCtrl.TTBTimeAidingParams.Skew = Convert.ToUInt32(helper.IniReadValue(section, key)); } catch (Exception exception4) { msg = "TTB_TIME_AIDING TIME_ACC: " + exception4.Message; this.WriteApp(msg); } section = "FREQ_AIDING"; key = "REPLY"; try { this.AutoReplyCtrl.FreqTransferCtrl.Reply = Convert.ToByte(helper.IniReadValue(section, key)) == 1; this.AutoReplyCtrl.AutoReplyParams.AutoReplyFreqTrans = this.AutoReplyCtrl.FreqTransferCtrl.Reply; } catch (Exception exception5) { msg = "FREQ_AIDING REPLY: " + exception5.Message; this.WriteApp(msg); } key = "USE_FREQ_AIDING"; try { this.AutoReplyCtrl.FreqTransferCtrl.UseFreqAiding = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception6) { msg = "USE_FREQ_AIDING: " + exception6.Message; this.WriteApp(msg); } key = "TIME_TAG"; try { this.AutoReplyCtrl.FreqTransferCtrl.TimeTag = Convert.ToUInt32(helper.IniReadValue(section, key)); } catch (Exception exception7) { msg = "FREQ_AIDING TIME_TAG: " + exception7.Message; this.WriteApp(msg); } key = "REF_CLOCK_INFO"; try { this.AutoReplyCtrl.FreqTransferCtrl.RefClkInfo = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception8) { msg = "FREQ_AIDING REF_CLOCK_INFO: " + exception8.Message; this.WriteApp(msg); } key = "REL_FREQ_ACC"; try { this.AutoReplyCtrl.FreqTransferCtrl.Accuracy = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception9) { msg = "FREQ_AIDING REL_FREQ_ACC: " + exception9.Message; this.WriteApp(msg); } key = "SCALED_FREQ_OFFSET"; try { this.AutoReplyCtrl.FreqTransferCtrl.ScaledFreqOffset = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception10) { msg = "FREQ_AIDING SCALED_FREQ_OFFSET: " + exception10.Message; this.WriteApp(msg); } key = "EXT_CLOCK_SKEW"; try { this.AutoReplyCtrl.FreqTransferCtrl.ExtClkSkewppm = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception11) { msg = "FREQ_AIDING EXT_CLOCK_SKEW: " + exception11.Message; this.WriteApp(msg); } key = "NORMIMAL_FREQ"; try { this.AutoReplyCtrl.FreqTransferCtrl.NomFreq = Convert.ToInt64(helper.IniReadValue(section, key)); } catch (Exception exception12) { msg = "FREQ_AIDING NORMIMAL_FREQ: " + exception12.Message; this.WriteApp(msg); } key = "INCLUDE_NORM_FREQ"; try { this.AutoReplyCtrl.FreqTransferCtrl.IncludeNormFreq = Convert.ToByte(helper.IniReadValue(section, key)) == 1; } catch (Exception exception13) { msg = "FREQ_AIDING NORMIMAL_FREQ: " + exception13.Message; this.WriteApp(msg); } key = "FREQ_METHOD"; try { this.AutoReplyCtrl.FreqTransferCtrl.FreqAidingMethod = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception14) { msg = "FREQ_AIDING FREQ_METHOD: " + exception14.Message; this.WriteApp(msg); } key = "DEFAULT_FREQ_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.DefaultFreqIndex = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception15) { msg = "FREQ_AIDING DEFAULT_FREQ_GUI_INDEX: " + exception15.Message; this.WriteApp(msg); } this._lastClockDrift = clsGlobal.DEFAULT_RF_FREQ[this.AutoReplyCtrl.FreqTransferCtrl.DefaultFreqIndex]; key = "SPECIFIED_FREQ_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.SpecifiedRefFreq = Convert.ToInt16(helper.IniReadValue(section, key)) == 1; } catch (Exception exception16) { msg = "FREQ_AIDING SPECIFIED_FREQ_GUI_INDEX: " + exception16.Message; this.WriteApp(msg); } key = "SLC_REPORT_FREQ_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.SLCReportFreqGuiIndex = Convert.ToInt16(helper.IniReadValue(section, key)) == 1; } catch (Exception exception17) { msg = "FREQ_AIDING SLC_REPORT_FREQ_GUI_INDEX: " + exception17.Message; this.WriteApp(msg); } key = "REF_CLOCK_REQUEST_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.RefClockRequestGuiIndex = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception18) { msg = "FREQ_AIDING REF_CLOCK_REQUEST_GUI_INDEX: " + exception18.Message; this.WriteApp(msg); } key = "REF_CLOCK_ONOFF_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.RefClockOnOffGuiIndex = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception19) { msg = "FREQ_AIDING REF_CLOCK_REQUEST_GUI_INDEX: " + exception19.Message; this.WriteApp(msg); } key = "EXT_REF_CLOCK_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.ExtRefClockGuiIndex = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception20) { msg = "FREQ_AIDING EXT_REF_CLOCK_GUI_INDEX: " + exception20.Message; this.WriteApp(msg); } key = "SCALED_FREQ_OFFSET_GUI_INDEX"; try { this.AutoReplyCtrl.FreqTransferCtrl.ScaledFreqOffsetGuiIndex = Convert.ToInt16(helper.IniReadValue(section, key)); } catch (Exception exception21) { msg = "FREQ_AIDING SCALED_FREQ_OFFSET_GUI_INDEX: " + exception21.Message; this.WriteApp(msg); } key = "FREQ_ACC_USER_GUI"; try { this.AutoReplyCtrl.FreqTransferCtrl.FreqAccUserSpecifiedGui = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception22) { msg = "FREQ_ACC_USER_GUI: " + exception22.Message; this.WriteApp(msg); } key = "FREQ_OFFSET_USER_GUI"; try { this.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetUserSpecifiedGui = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception23) { msg = "FREQ_OFFSET_USER_GUI: " + exception23.Message; this.WriteApp(msg); } key = "FREQ_ACC_RX_GUI"; try { this.AutoReplyCtrl.FreqTransferCtrl.FreqAccFromRxGui = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception24) { msg = "FREQ_ACC_RX_GUI: " + exception24.Message; this.WriteApp(msg); } key = "FREQ_OFFSET_RX_GUI"; try { this.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetFromRxGui = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception25) { msg = "FREQ_OFFSET_RX_GUI: " + exception25.Message; this.WriteApp(msg); } if (this.AutoReplyCtrl.FreqTransferCtrl.SpecifiedRefFreq) { this.AutoReplyCtrl.FreqTransferCtrl.FreqOffset = this.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetUserSpecifiedGui; this.AutoReplyCtrl.FreqTransferCtrl.Accuracy = this.AutoReplyCtrl.FreqTransferCtrl.FreqAccUserSpecifiedGui; } else { this.AutoReplyCtrl.FreqTransferCtrl.FreqOffset = this.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetFromRxGui; this.AutoReplyCtrl.FreqTransferCtrl.Accuracy = this.AutoReplyCtrl.FreqTransferCtrl.FreqAccFromRxGui; } key = "USE_TTB_FREQ"; try { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForFreqAid = Convert.ToInt32(helper.IniReadValue(section, key)) == 1; } catch (Exception exception26) { msg = "USE_TTB_FREQ: " + exception26.Message; this.WriteApp(msg); } key = "IGNORE_XO"; try { this.AutoReplyCtrl.AutoReplyParams.FreqAidingIgnoreXO = Convert.ToInt32(helper.IniReadValue(section, key)) == 1; } catch (Exception exception27) { msg = "IGNORE_XO: " + exception27.Message; this.WriteApp(msg); } this.AutoReplyCtrl.AutoReplyFreqTransferResp(); section = "HW_CONFIG"; key = "REPLY"; if (helper.IniReadValue(section, key) == "1") { this.AutoReplyCtrl.HWCfgCtrl.Reply = true; if (this.AutoReplyCtrl.TTBTimeAidingParams.Enable || this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForFreqAid) { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForHwCfg = true; } else { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForHwCfg = false; } } else { this.AutoReplyCtrl.HWCfgCtrl.Reply = false; } this.AutoReplyCtrl.AutoReplyParams.AutoReplyHWCfg = this.AutoReplyCtrl.HWCfgCtrl.Reply; key = "PRECISE_TIME_ENABLED"; try { this.AutoReplyCtrl.HWCfgCtrl.PreciseTimeEnabled = Convert.ToByte(helper.IniReadValue(section, key)); if (this.AutoReplyCtrl.HWCfgCtrl.PreciseTimeEnabled == 1) { if (this.AutoReplyCtrl.TTBTimeAidingParams.Enable) { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = true; } else { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = false; } } } catch (Exception exception28) { msg = "PRECISE_TIME_ENABLED: " + exception28.Message; this.WriteApp(msg); } key = "PRECISE_TIME_DIRECTION"; try { this.AutoReplyCtrl.HWCfgCtrl.PreciseTimeDirection = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception29) { msg = "PRECISE_TIME_DIRECTION: " + exception29.Message; this.WriteApp(msg); } key = "FREQ_AIDED_ENABLED"; try { this.AutoReplyCtrl.HWCfgCtrl.FreqAidEnabled = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception30) { msg = "FREQ_AIDED_ENABLED: " + exception30.Message; this.WriteApp(msg); } key = "FREQ_AIDED_METHOD"; try { this.AutoReplyCtrl.HWCfgCtrl.FreqAidMethod = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception31) { msg = "FREQ_AIDED_METHOD: " + exception31.Message; this.WriteApp(msg); } key = "RTC_AVAILABLE"; try { this.AutoReplyCtrl.HWCfgCtrl.RTCAvailabe = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception32) { msg = "RTC_AVAILABLE: " + exception32.Message; this.WriteApp(msg); } key = "RTC_SOURCE"; try { this.AutoReplyCtrl.HWCfgCtrl.RTCSource = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception33) { msg = "RTC_SOURCE: " + exception33.Message; this.WriteApp(msg); } key = "COARSE_TIME_ENABLE"; try { this.AutoReplyCtrl.HWCfgCtrl.CoarseTimeEnabled = Convert.ToByte(helper.IniReadValue(section, key)); if (this.AutoReplyCtrl.HWCfgCtrl.CoarseTimeEnabled == 1) { if (this.AutoReplyCtrl.TTBTimeAidingParams.Enable) { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = true; } else { this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = false; } } } catch (Exception exception34) { msg = "COARSE_TIME_ENABLE: " + exception34.Message; this.WriteApp(msg); } key = "REF_CLOCK_ENABLED"; try { this.AutoReplyCtrl.HWCfgCtrl.RefClkEnabled = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception35) { msg = "REF_CLOCK_ENABLED: " + exception35.Message; this.WriteApp(msg); } key = "NORMINAL_FREQ_HZ"; try { this.AutoReplyCtrl.HWCfgCtrl.NorminalFreqHz = Convert.ToInt64(helper.IniReadValue(section, key)); } catch (Exception exception36) { msg = "NORMINAL_FREQ_HZ: " + exception36.Message; this.WriteApp(msg); } key = "ENHANCED_NETWORK"; try { this.AutoReplyCtrl.HWCfgCtrl.NetworkEnhanceType = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception37) { msg = "ENHANCED_NETWORK: " + exception37.Message; this.WriteApp(msg); } this.AutoReplyCtrl.AutoReplyHWCfgResp(); section = "APPROXIMATE_POSITION"; key = "REPLY"; try { this.AutoReplyCtrl.ApproxPositionCtrl.Reply = Convert.ToByte(helper.IniReadValue(section, key)) == 1; } catch (Exception exception38) { msg = "APPROXIMATE_POSITION REPLY: " + exception38.Message; this.WriteApp(msg); } this.AutoReplyCtrl.AutoReplyParams.AutoReplyApproxPos = this.AutoReplyCtrl.ApproxPositionCtrl.Reply; key = "REJECT"; try { this.AutoReplyCtrl.ApproxPositionCtrl.Reject = Convert.ToByte(helper.IniReadValue(section, key)) == 1; } catch (Exception exception39) { msg = "APPROXIMATE_POSITION REJECT: " + exception39.Message; this.WriteApp(msg); } key = "LAT"; try { this.AutoReplyCtrl.ApproxPositionCtrl.Lat = Convert.ToDouble(helper.IniReadValue(section, key)); this.RxCtrl.RxNavData.RefLat = this.AutoReplyCtrl.ApproxPositionCtrl.Lat; } catch (Exception exception40) { msg = "APPROXIMATE_POSITION LAT: " + exception40.Message; this.WriteApp(msg); } key = "LON"; try { this.AutoReplyCtrl.ApproxPositionCtrl.Lon = Convert.ToDouble(helper.IniReadValue(section, key)); this.RxCtrl.RxNavData.RefLon = this.AutoReplyCtrl.ApproxPositionCtrl.Lon; } catch (Exception exception41) { msg = "APPROXIMATE_POSITION LON: " + exception41.Message; this.WriteApp(msg); } key = "ALT"; try { this.AutoReplyCtrl.ApproxPositionCtrl.Alt = Convert.ToDouble(helper.IniReadValue(section, key)); this.RxCtrl.RxNavData.RefAlt = this.AutoReplyCtrl.ApproxPositionCtrl.Alt; } catch (Exception exception42) { msg = "APPROXIMATE_POSITION ALT: " + exception42.Message; this.WriteApp(msg); } key = "EST_HOR_ERR"; try { this.AutoReplyCtrl.ApproxPositionCtrl.EstHorrErr = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception43) { msg = "APPROXIMATE_POSITION EST_HOR_ERR: " + exception43.Message; this.WriteApp(msg); } key = "EST_VER_ERR"; try { this.AutoReplyCtrl.ApproxPositionCtrl.EstVertiErr = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception44) { msg = "APPROXIMATE_POSITION EST_VER_ERR: " + exception44.Message; this.WriteApp(msg); } key = "LAT_SKEW"; try { this.AutoReplyCtrl.ApproxPositionCtrl.DistanceSkew = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception45) { msg = "APPROXIMATE_POSITION LAT_SKEW: " + exception45.Message; this.WriteApp(msg); } key = "LON_SKEW"; try { this.AutoReplyCtrl.ApproxPositionCtrl.HeadingSkew = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception46) { msg = "APPROXIMATE_POSITION LON_SKEW: " + exception46.Message; this.WriteApp(msg); } key = "LOC_NAME"; this.m_NavData.RefLocationName = helper.IniReadValue(section, key); this.AutoReplyCtrl.AutoReplyApproxPositionResp(); section = "TIME_AIDING"; key = "REPLY"; try { this.AutoReplyCtrl.TimeTransferCtrl.Reply = Convert.ToByte(helper.IniReadValue(section, key)) == 1; this.AutoReplyCtrl.AutoReplyParams.AutoReplyTimeTrans = this.AutoReplyCtrl.TimeTransferCtrl.Reply; } catch (Exception exception47) { msg = "TIME_AIDING REPLY: " + exception47.Message; this.WriteApp(msg); } key = "REJECT"; try { this.AutoReplyCtrl.TimeTransferCtrl.Reject = Convert.ToByte(helper.IniReadValue(section, key)) == 1; } catch (Exception exception48) { msg = "TIME_AIDING REJECT: " + exception48.Message; this.WriteApp(msg); } key = "TIME_AIDING_TYPE"; try { this.AutoReplyCtrl.TimeTransferCtrl.TTType = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception49) { msg = "TIME_AIDING_TYPE: " + exception49.Message; this.WriteApp(msg); } key = "TIME_ACC"; try { this.AutoReplyCtrl.TimeTransferCtrl.Accuracy = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception50) { msg = "TIME_ACC: " + exception50.Message; this.WriteApp(msg); } key = "SKEW"; try { this.AutoReplyCtrl.TimeTransferCtrl.Skew = Convert.ToDouble(helper.IniReadValue(section, key)); } catch (Exception exception51) { msg = "SKEW: " + exception51.Message; this.WriteApp(msg); } key = "UTC_OFFSET"; try { this.RxCtrl.UTCOffset = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception52) { msg = "UTC Offset: " + exception52.Message; this.WriteApp(msg); } key = "TIME_AIDING_SOURCE"; int num = 0; try { num = Convert.ToInt32(helper.IniReadValue(section, key)); } catch (Exception exception53) { msg = "TIME_AIDING_SOURCE: " + exception53.Message; this.WriteApp(msg); } switch (num) { case 1: this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = false; this.AutoReplyCtrl.AutoReplyParams.UseDOS_ForTimeAid = true; this.AutoReplyCtrl.TimeTransferCtrl.Reject = false; break; case 2: this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = true; this.AutoReplyCtrl.AutoReplyParams.UseDOS_ForTimeAid = false; this.AutoReplyCtrl.TimeTransferCtrl.Reject = false; break; default: this.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid = false; this.AutoReplyCtrl.AutoReplyParams.UseDOS_ForTimeAid = false; this.AutoReplyCtrl.TimeTransferCtrl.Reject = true; break; } this.AutoReplyCtrl.AutoReplyTimeTransferResp(); section = "POSITION_AIDING"; key = "REPLY"; try { this.AutoReplyCtrl.AutoReplyParams.AutoPosReq = Convert.ToByte(helper.IniReadValue(section, key)) == 1; } catch (Exception exception54) { msg = "POSITION_AIDING REPLY: " + exception54.Message; this.WriteApp(msg); } key = "NUM_FIXED"; try { this.AutoReplyCtrl.PositionRequestCtrl.NumFixes = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception55) { msg = "NUM_FIXED: " + exception55.Message; this.WriteApp(msg); } key = "TIME_BETWEEN_FIXES"; try { this.AutoReplyCtrl.PositionRequestCtrl.TimeBtwFixes = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception56) { msg = "TIME_BETWEEN_FIXES: " + exception56.Message; this.WriteApp(msg); } key = "HOR_ERR_MAX"; try { this.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception57) { msg = "HOR_ERR_MAX: " + exception57.Message; this.WriteApp(msg); } key = "VERT_ERR_MAX"; try { this.AutoReplyCtrl.PositionRequestCtrl.VertErrMax = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception58) { msg = "VERT_ERR_MAX: " + exception58.Message; this.WriteApp(msg); } key = "RESP_TIME_MAX"; try { this.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception59) { msg = "RESP_TIME_MAX: " + exception59.Message; this.WriteApp(msg); } key = "TIME_ACC_PRIORITY"; try { this.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception60) { msg = "TIME_ACC_PRIORITY: " + exception60.Message; this.WriteApp(msg); } key = "LOC_METHOD"; try { this.AutoReplyCtrl.PositionRequestCtrl.LocMethod = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception61) { msg = "LOC_METHOD: " + exception61.Message; this.WriteApp(msg); } key = "EPH_SOURCE"; try { this.AutoReplyCtrl.PositionRequestCtrl.EphSource = Convert.ToByte(helper.IniReadValue(section, key)); switch (this.AutoReplyCtrl.PositionRequestCtrl.EphSource) { case 0: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromTTB = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_ExtEph_fromFile = false; goto Label_1551; case 1: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromFile = true; this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromTTB = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_ExtEph_fromFile = false; goto Label_1551; case 2: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromTTB = true; this.AutoReplyCtrl.AutoReplyParams.AutoAid_ExtEph_fromFile = false; goto Label_1551; case 3: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromTTB = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_ExtEph_fromFile = true; goto Label_1551; } this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_Eph_fromTTB = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_ExtEph_fromFile = false; } catch (Exception exception62) { msg = "EPH_SOURCE: " + exception62.Message; this.WriteApp(msg); } Label_1551: key = "EPH_FILEPATH"; this.AutoReplyCtrl.EphFilePath = helper.IniReadValue(section, key); key = "EPH_REPLY"; try { this.AutoReplyCtrl.PositionRequestCtrl.EphReply = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception63) { msg = "EPH_REPLY: " + exception63.Message; this.WriteApp(msg); } key = "ACQ_ASSIST_SOURCE"; try { this.AutoReplyCtrl.PositionRequestCtrl.AcqAssistSource = Convert.ToByte(helper.IniReadValue(section, key)); switch (this.AutoReplyCtrl.PositionRequestCtrl.AcqAssistSource) { case 0: this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromTTB = false; goto Label_16A3; case 1: this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromTTB = true; goto Label_16A3; case 2: this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromFile = true; this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromTTB = false; goto Label_16A3; } this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromFile = false; this.AutoReplyCtrl.AutoReplyParams.AutoAid_AcqData_fromTTB = false; } catch (Exception exception64) { msg = "ACQ_ASSIST_SOURCE: " + exception64.Message; this.WriteApp(msg); } Label_16A3: key = "ACQ_ASSIST_REPLY"; try { this.AutoReplyCtrl.PositionRequestCtrl.AcqAssistReply = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception65) { msg = "ACQ_ASSIST_REPLY: " + exception65.Message; this.WriteApp(msg); } key = "ACQ_ASSIST_FILEPATH"; this.AutoReplyCtrl.AcqDataFilePath = helper.IniReadValue(section, key); key = "ALM_SOURCE"; try { this.AutoReplyCtrl.PositionRequestCtrl.AlmSource = Convert.ToByte(helper.IniReadValue(section, key)); switch (this.AutoReplyCtrl.PositionRequestCtrl.AlmSource) { case 0: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Alm = false; goto Label_179A; case 1: this.AutoReplyCtrl.AutoReplyParams.AutoAid_Alm = true; goto Label_179A; } this.AutoReplyCtrl.AutoReplyParams.AutoAid_Alm = false; } catch (Exception exception66) { msg = "ALM_SOURCE: " + exception66.Message; this.WriteApp(msg); } Label_179A: key = "ALM_REPLY"; try { this.AutoReplyCtrl.PositionRequestCtrl.AlmReply = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception67) { msg = "ALM_REPLY: " + exception67.Message; this.WriteApp(msg); } key = "NAVBIT_SOURCE"; try { this.AutoReplyCtrl.PositionRequestCtrl.NavBitSource = Convert.ToByte(helper.IniReadValue(section, key)); switch (this.AutoReplyCtrl.PositionRequestCtrl.NavBitSource) { case 0: this.AutoReplyCtrl.AutoReplyParams.AutoAid_NavBit = false; goto Label_1878; case 1: this.AutoReplyCtrl.AutoReplyParams.AutoAid_NavBit = true; goto Label_1878; } this.AutoReplyCtrl.AutoReplyParams.AutoAid_NavBit = false; } catch (Exception exception68) { msg = "NAVBIT_SOURCE: " + exception68.Message; this.WriteApp(msg); } Label_1878: key = "NAVBIT_REPLY"; try { this.AutoReplyCtrl.PositionRequestCtrl.NavBitReply = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception69) { msg = "NAVBIT_REPLY: " + exception69.Message; this.WriteApp(msg); } this.AutoReplyCtrl.AutoSendPositionRequestMsg(); this.AutoReplyCtrl.UpdateAutoReplyStatus(); }
private void frmLowPowerLoadSettings() { string path = clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetup.cfg"; string text = "\n"; if (!File.Exists(path)) { text = "Config file not found: \n" + path + "\n"; MessageBox.Show(text, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand); } IniHelper helper = new IniHelper(path); string section = string.Empty; string key = string.Empty; section = "POWER_MODE"; key = "MODE"; try { this.comm.LowPowerParams.Mode = Convert.ToByte(helper.IniReadValue(section, key)); } catch (Exception exception) { text = text + "APM num fixes: " + exception.Message + "\n"; } key = "APM_NUM_FIXES"; try { this.comm.LowPowerParams.APMNumFixes = Convert.ToByte(helper.IniReadValue(section, key)); this.apmNumFixesTxtBox.Text = this.comm.LowPowerParams.APMNumFixes.ToString(); } catch (Exception exception2) { text = text + "APM num fixes: " + exception2.Message + "\n"; } key = "APM_TBF"; try { this.comm.LowPowerParams.APMTBF = Convert.ToByte(helper.IniReadValue(section, key)); this.apmTBFTxtBox.Text = this.comm.LowPowerParams.APMTBF.ToString(); } catch (Exception exception3) { text = text + "APM TBF: " + exception3.Message + "\n"; } key = "APM_DUTY_CYCLE"; try { this.comm.LowPowerParams.APMDutyCycle = Convert.ToByte(helper.IniReadValue(section, key)); this.apmDutyCycleTxtBox.Text = this.comm.LowPowerParams.APMDutyCycle.ToString(); } catch (Exception exception4) { text = text + "APM duty cycle: " + exception4.Message + "\n"; } key = "APM_MAX_HOR_ERR"; try { this.comm.LowPowerParams.APMMaxHrzError = Convert.ToByte(helper.IniReadValue(section, key)); this.apmMaxHrzErrorTxtBox.Text = this.comm.LowPowerParams.APMMaxHrzError.ToString(); } catch (Exception exception5) { text = text + "APM max Hrz. error: " + exception5.Message + "\n"; } key = "APM_MAX_VERT_ERR"; try { this.comm.LowPowerParams.APMMaxVrtError = Convert.ToByte(helper.IniReadValue(section, key)); if (this.comm.LowPowerParams.APMMaxVrtError >= 8) { this.apmMaxVrtErrorComboBox.Items.Add(this.comm.LowPowerParams.APMMaxVrtError.ToString()); this.apmMaxVrtErrorComboBox.Text = this.comm.LowPowerParams.APMMaxVrtError.ToString(); } else { this.apmMaxVrtErrorComboBox.SelectedIndex = this.comm.LowPowerParams.APMMaxVrtError; } } catch (Exception exception6) { text = text + "APM max Vrt. error: " + exception6.Message + "\n"; } key = "APM_PRIORITY"; try { this.comm.LowPowerParams.APMPriority = Convert.ToByte(helper.IniReadValue(section, key)); if (this.comm.LowPowerParams.APMPriority > 3) { this.apmPriorityComboBox.Items.Add(this.comm.LowPowerParams.APMPriority.ToString()); this.apmPriorityComboBox.Text = this.comm.LowPowerParams.APMPriority.ToString(); } else { this.apmPriorityComboBox.SelectedIndex = this.comm.LowPowerParams.APMPriority - 1; } } catch (Exception exception7) { text = text + "APM priority: " + exception7.Message + "\n"; } key = "APM_MAX_OFFTIME"; try { this.comm.LowPowerParams.APMMaxOffTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.apmMaxOffTimeTxtBox.Text = this.comm.LowPowerParams.APMMaxOffTime.ToString(); } catch (Exception exception8) { text = text + "APM max off time: " + exception8.Message + "\n"; } key = "APM_MAX_SEARCH_TIME"; try { this.comm.LowPowerParams.APMMaxSearchTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.apmMaxSearchTimeTxtBox.Text = this.comm.LowPowerParams.APMMaxSearchTime.ToString(); } catch (Exception exception9) { text = text + "APM max search time: " + exception9.Message + "\n"; } key = "APM_TIME_ACC_PRIORITY"; try { this.comm.LowPowerParams.APMTimeAccPriority = Convert.ToByte(helper.IniReadValue(section, key)); if (this.comm.LowPowerParams.APMTimeAccPriority > 3) { this.apmTimeAccPriorityComboBox.Items.Add(this.comm.LowPowerParams.APMTimeAccPriority.ToString()); this.apmTimeAccPriorityComboBox.Text = this.comm.LowPowerParams.APMTimeAccPriority.ToString(); } else { this.apmTimeAccPriorityComboBox.SelectedIndex = this.comm.LowPowerParams.APMTimeAccPriority; } } catch (Exception exception10) { text = text + "APM time acc priority: " + exception10.Message + "\n"; } key = "TP_UPDATE"; try { this.comm.LowPowerParams.TPUpdateRate = Convert.ToSByte(helper.IniReadValue(section, key)); this.tpUpdateRateCmbBox.Text = this.comm.LowPowerParams.TPUpdateRate.ToString(); } catch (Exception exception11) { text = text + "TP update rate: " + exception11.Message + "\n"; } key = "TP_ONTIME"; try { this.comm.LowPowerParams.TPOnTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.tpOnTimeCmbBox.Text = this.comm.LowPowerParams.TPOnTime.ToString(); } catch (Exception exception12) { text = text + "TP on time: " + exception12.Message + "\n"; } key = "TP_MAX_OFF_TIME"; try { this.comm.LowPowerParams.TPMaxOffTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.tpMaxOffTimeTxtBox.Text = this.comm.LowPowerParams.TPMaxOffTime.ToString(); } catch (Exception exception13) { text = text + "TP max off time: " + exception13.Message + "\n"; } key = "TP_MAX_SEARCH_TIME"; try { this.comm.LowPowerParams.TPMaxSearchTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.tpMaxSearchTimeTxtBox.Text = this.comm.LowPowerParams.TPMaxSearchTime.ToString(); } catch (Exception exception14) { text = text + "TP max search time: " + exception14.Message + "\n"; } key = "PTF_PERIOD"; try { this.comm.LowPowerParams.PTFPeriod = Convert.ToUInt32(helper.IniReadValue(section, key)); this.ptfPeriodTxtBox.Text = this.comm.LowPowerParams.PTFPeriod.ToString(); } catch (Exception exception15) { text = text + "PTF period: " + exception15.Message + "\n"; } key = "PTF_MAX_SEARCH_TIME"; try { this.comm.LowPowerParams.PTFMaxSearchTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.ptfMaxSearchTimeTxtBox.Text = this.comm.LowPowerParams.PTFMaxSearchTime.ToString(); } catch (Exception exception16) { text = text + "PTF max search time: " + exception16.Message + "\n"; } key = "PTF_MAX_OFF_TIME"; try { this.comm.LowPowerParams.PTFMaxOffTime = Convert.ToUInt32(helper.IniReadValue(section, key)); this.ptfMaxOffTimeTxtBox.Text = this.comm.LowPowerParams.PTFMaxOffTime.ToString(); } catch (Exception exception17) { text = text + "PTF max off time: " + exception17.Message + "\n"; } }
public static float GetCalibrationAtten(float cableLoss, int level, string type) { IniHelper helper = new IniHelper(clsGlobal.InstalledDirectory + @"\scripts\stationCalValues.cfg"); float num2 = Convert.ToSingle(helper.IniReadValue("CABLE_LOSS", "CAL_CABLE_LOSS")); float num3 = Convert.ToSingle(helper.IniReadValue(type.ToUpper(), level.ToString())); if (num2 < cableLoss) { return (num3 - (cableLoss - num2)); } if (num2 > cableLoss) { return (num3 + (num2 - cableLoss)); } return num3; }
private void frmFileAnalysis_Load(object sender, EventArgs e) { if (this._fileType == ".gpx") { this.includeDateTimeChkBox.Enabled = true; this.includeDateTimeChkBox.Visible = true; } else if (this._fileType == ".gps") { this.includeDateTimeChkBox.Enabled = false; this.includeDateTimeChkBox.Visible = false; } else if (this._fileType == ".bin") { this.includeDateTimeChkBox.Enabled = false; this.includeDateTimeChkBox.Visible = false; } else { this.includeDateTimeChkBox.Enabled = true; this.includeDateTimeChkBox.Visible = true; } try { IniHelper helper = new IniHelper(this.fileAnalysisIniPath); foreach (string str2 in helper.IniReadValue("SETUP", "AVAILABLE_CATEGORY").Split(new char[] { ',' })) { this.availableCategoryList.Add(str2); this.fileAnalysisCategoryList.Items.Add(str2); } } catch { } }