Example #1
0
 private int saveNExit()
 {
     int num = 0;
     IniHelper helper = new IniHelper(this.automationIniPath);
     string str = string.Empty;
     foreach (string str2 in this.scriptsFullPathLists)
     {
         str = str + str2 + ",";
     }
     str = str.TrimEnd(new char[] { ',' });
     if (str.Length != 0)
     {
         str.Replace(" ", "");
     }
     if (File.Exists(this.automationIniPath))
     {
         if ((File.GetAttributes(this.automationIniPath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
         {
             MessageBox.Show(string.Format("{0} File is read only!\nPlease change property and retry", this.automationIniPath), "Error");
             return 1;
         }
         helper.IniWriteValue("SETUP", "AVAILABLE_SCRIPTS", str);
         helper.IniWriteValue("SETUP", "SCRIPTS_DIR", this.autoTestDirVal.Text);
         if (this.autoTestSendEmailChkVal.Checked)
         {
             helper.IniWriteValue("SETUP", "SEND_EMAIL", "1");
         }
         else
         {
             helper.IniWriteValue("SETUP", "SEND_EMAIL", "0");
         }
         string str4 = this.autoTestEmailListVal.Text.Replace(" ", "");
         helper.IniWriteValue("EMAIL", "Email.Recipient", str4);
         return num;
     }
     StreamWriter writer = File.CreateText(this.automationIniPath);
     writer.WriteLine("[EMAIL]");
     writer.WriteLine("Email.Recipient={0}", this.autoTestEmailListVal.Text.Replace(" ", ""));
     writer.WriteLine("Email.Sender=\"[email protected]\"");
     writer.WriteLine("Email.Copy=\"\"");
     writer.WriteLine("Email.Priority=\"MailPriority.Normal\"");
     writer.WriteLine("Email.Encoding=\"Encoding.ASCII\"");
     writer.WriteLine("Email.Subject=\"SiRFLive Auto Test Report\"");
     writer.WriteLine("Email.Message=\"\nBest Regards\n\n SiRFLive Team\"");
     writer.WriteLine("Email.Smtp=\"192.168.2.254\"");
     writer.WriteLine("[SETUP]");
     writer.WriteLine("RESET_PERIOD_RANDOMIZATION_SEC=5");
     writer.WriteLine("SCRIPTS_DIR={0}", this.autoTestDirVal.Text);
     writer.WriteLine("AVAILABLE_SCRIPTS={0}", str);
     if (this.autoTestSendEmailChkVal.Checked)
     {
         writer.WriteLine("SEND_EMAIL=1");
     }
     else
     {
         writer.WriteLine("SEND_EMAIL=0");
     }
     writer.Close();
     return num;
 }
Example #2
0
 public frmFileAnalysis(string fileType)
 {
     this.InitializeComponent();
     string str = string.Empty;
     this._fileType = fileType;
     try
     {
         if (File.Exists(this.fileAnalysisIniPath))
         {
             this.autoIniIntf = new IniHelper(this.fileAnalysisIniPath);
             foreach (string str2 in this.autoIniIntf.GetKeys("EMAIL"))
             {
                 if (!str2.Contains("#"))
                 {
                     str = this.autoIniIntf.GetIniFileString("EMAIL", str2, "");
                     if (str.Length != 0)
                     {
                         str = str.Replace(" ", "").TrimEnd(new char[] { '\n' }).TrimEnd(new char[] { '\r' });
                         ConfigurationManager.AppSettings[str2] = str;
                     }
                 }
             }
             str = this.autoIniIntf.GetIniFileString("SETUP", "AVAILABLE_SCRIPTS", "");
             if (str.Length != 0)
             {
                 this.filesFullPathLists.Clear();
                 foreach (string str3 in str.Split(new char[] { ',' }))
                 {
                     if (str3.Length != 0)
                     {
                         this.addAvailableFiles(str3);
                     }
                 }
             }
             this.filesArray = this.filesFullPathLists.ToArray();
             this.autoTestDirVal.Text = this.autoIniIntf.GetIniFileString("SETUP", "SCRIPTS_DIR", "");
             str = this.autoIniIntf.GetIniFileString("SETUP", "SEND_EMAIL", "");
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "ERROR!");
     }
 }
Example #3
0
 public frmAutomationTests()
 {
     this.InitializeComponent();
     clsGlobal.Abort = false;
     clsGlobal.AbortSingle = false;
     clsGlobal.ScriptDone = true;
     IniHelper helper = new IniHelper(this.automationIniPath);
     string str = string.Empty;
     if (clsGlobal.IsMarketingUser())
     {
         this.autoTestEmailListLabel.Visible = false;
         this.autoTestEmailListVal.Visible = false;
         this.autoTestSendEmailChkVal.Visible = false;
     }
     try
     {
         if (File.Exists(this.automationIniPath))
         {
             foreach (string str2 in helper.GetKeys("EMAIL"))
             {
                 if (!str2.Contains("#"))
                 {
                     str = helper.GetIniFileString("EMAIL", str2, "");
                     if (str.Length != 0)
                     {
                         str = str.Replace(" ", "").TrimEnd(new char[] { '\n' }).TrimEnd(new char[] { '\r' });
                         ConfigurationManager.AppSettings[str2] = str;
                         if (str2 == "Email.Recipient")
                         {
                             this.autoTestEmailListVal.Text = ConfigurationManager.AppSettings[str2];
                         }
                     }
                 }
             }
             str = helper.GetIniFileString("SETUP", "AVAILABLE_SCRIPTS", "");
             if (str.Length != 0)
             {
                 this.scriptsFullPathLists.Clear();
                 foreach (string str3 in str.Split(new char[] { ',' }))
                 {
                     if (str3.Length != 0)
                     {
                         this.autoTestAddAvailableScripts(str3);
                     }
                 }
             }
             this.scriptsArray = this.scriptsFullPathLists.ToArray();
             this.autoTestDirVal.Text = helper.GetIniFileString("SETUP", "SCRIPTS_DIR", "");
             str = helper.GetIniFileString("SETUP", "SEND_EMAIL", "");
             if (str.Length != 0)
             {
                 if (str == "1")
                 {
                     this.autoTestSendEmailChkVal.Checked = true;
                 }
                 else
                 {
                     this.autoTestSendEmailChkVal.Checked = false;
                 }
             }
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "ERROR!");
     }
 }
Example #4
0
 private void configSaveBtn_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     int num = 0;
     IniHelper helper = new IniHelper(this.configFilePathVal.Text);
     if (!File.Exists(this.configFilePathVal.Text))
     {
         this.writeNewConfig(this.configFilePathVal.Text);
     }
     else
     {
         if (MessageBox.Show("File exists! -- Overwrite?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
         {
             this.Cursor = Cursors.Default;
             return;
         }
         if ((File.GetAttributes(this.configFilePathVal.Text) & FileAttributes.ReadOnly) != FileAttributes.ReadOnly)
         {
             while (num < (this.configDataGridView.Rows.Count - 1))
             {
                 string str = this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim();
                 if (((str == "EXTRA_HOST_APP_ARGVS") || (str == "SIM_FILE")) || str.StartsWith("TEST_"))
                 {
                     helper.IniWriteValue(this.configDataGridView.Rows[num].HeaderCell.Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[1].Value.ToString().Trim());
                 }
                 else
                 {
                     helper.IniWriteValue(this.configDataGridView.Rows[num].HeaderCell.Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[0].Value.ToString().Trim().Replace(" ", ""), this.configDataGridView.Rows[num].Cells[1].Value.ToString().Trim().Replace(" ", ""));
                 }
                 num++;
             }
         }
         else
         {
             MessageBox.Show("File is read only!\nPlease change property and retry", "Error");
             this.Cursor = Cursors.Default;
             return;
         }
     }
     helper.IniSiRFLiveRxSetupErrorCheck(this.configFilePathVal.Text);
     string text1 = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\Protocols\Protocols_AI3_Request.xml";
     helper.GetIniFileString("TEST_SETUP", "REQUIRED_AIDING", "");
     this.Cursor = Cursors.Default;
 }
Example #5
0
 internal void updateConfigList(string updatedData)
 {
     this.configDataGridView.Rows[this.currentSelectRowIdx].Cells[this.currentSelectCellIdx].Value = updatedData;
     int num = 0;
     string str3 = updatedData;
     if (str3 != null)
     {
         if (!(str3 == "RF_PLAYBACK"))
         {
             if (str3 == "SIM")
             {
                 for (int i = 0; i < (this.configDataGridView.Rows.Count - 1); i++)
                 {
                     if (this.configDataGridView.Rows[i].HeaderCell.Value.ToString() == "RF_PLAYBACK")
                     {
                         this.configDataGridView.Rows.RemoveAt(i);
                         i--;
                     }
                     if (this.configDataGridView.Rows[i].HeaderCell.Value.ToString() == "SIM")
                     {
                         num++;
                     }
                 }
             }
             else if (str3 == "LIVE")
             {
                 for (int j = 0; j < (this.configDataGridView.Rows.Count - 1); j++)
                 {
                     if ((this.configDataGridView.Rows[j].HeaderCell.Value.ToString() == "RF_PLAYBACK") || (this.configDataGridView.Rows[j].HeaderCell.Value.ToString() == "SIM"))
                     {
                         this.configDataGridView.Rows.RemoveAt(j);
                         j--;
                     }
                 }
             }
         }
         else
         {
             for (int k = 0; k < (this.configDataGridView.Rows.Count - 1); k++)
             {
                 if (this.configDataGridView.Rows[k].HeaderCell.Value.ToString() == "SIM")
                 {
                     this.configDataGridView.Rows.RemoveAt(k);
                     k--;
                 }
                 if (this.configDataGridView.Rows[k].HeaderCell.Value.ToString() == "RF_PLAYBACK")
                 {
                     num++;
                 }
             }
         }
     }
     if (num == 0)
     {
         IniHelper helper = new IniHelper(this.configFilePathVal.Text);
         helper.GetSections();
         List<string> list = new List<string>();
         string str = string.Empty;
         char[] trimChars = new char[] { '\n', '\r', '\t', '\0' };
         foreach (string str2 in helper.GetKeys(updatedData))
         {
             if (!str2.Contains("#"))
             {
                 int num5 = this.configDataGridView.Rows.Add();
                 str = helper.GetIniFileString(updatedData, str2, "");
                 this.configDataGridView.Rows[num5].HeaderCell.Value = updatedData;
                 this.configDataGridView.Rows[num5].Cells[0].Value = str2;
                 this.configDataGridView.Rows[num5].Cells[1].Value = str.TrimEnd(trimChars);
             }
         }
     }
 }
 private void writeAutoReplyData()
 {
     this.Cursor = Cursors.WaitCursor;
     IniHelper helper = new IniHelper(clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetupAutoReply.cfg");
     string section = string.Empty;
     string key = string.Empty;
     section = "TTB_TIME_AIDING";
     key = "ENABLE";
     if (this.comm.AutoReplyCtrl.TTBTimeAidingParams.Enable)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "TYPE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Type.ToString());
     key = "TIME_ACC";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Accuracy.ToString());
     key = "TIME_SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Skew.ToString());
     this.Cursor = Cursors.Default;
 }
Example #7
0
 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;
 }
Example #8
0
        public frmMDIMain()
        {
            InitializeComponent();

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
            clsGlobal.MyCulture = Thread.CurrentThread.CurrentCulture;
            clsGlobal.SiRFLiveAppConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            clsGlobal.InstalledDirectory = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.FullName;
            clsGlobal.SiRFLiveAppConfig.AppSettings.Settings.Remove("InstalledDirectory");
            clsGlobal.SiRFLiveAppConfig.AppSettings.Settings.Add("InstalledDirectory", clsGlobal.InstalledDirectory);
            clsGlobal.SiRFLiveAppConfig.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
            string xmlFile = clsGlobal.InstalledDirectory + @"\Config\UserAccessConfig.xml";

            UserAccess = new UserAccessMgr(xmlFile);
            CurrentUser = UserAccess.GetCurrentUser();
            clsGlobal.CurrentUser = CurrentUser;
            clsGlobal.userAccessNum = UserAccess.GetAccessNum();
            clsGlobal.SiRFLiveVersion = "SiRFLive " + SiRFLiveVersion.VersionNum + " " + CurrentUser;
            clsGlobal.SiRFLiveChangeNum = StripDollarSigns(SiRFLiveVersion.ChangeNum);
            clsGlobal.SiRFLiveChangeDate = StripDollarSigns(SiRFLiveVersion.DateTime);
            Text = clsGlobal.SiRFLiveVersion;
            _defaultWindowsRestoredFilePath = clsGlobal.InstalledDirectory + @"\Config\DefaultWindowsRestore.xml";
            _lastWindowsRestoredFilePath = clsGlobal.InstalledDirectory + @"\Config\LastWindowsRestore.xml";
            SearchMenu(CurrentUser);
            SearchToolStrip(CurrentUser);
            try
            {
                IniHelper helper = new IniHelper(clsGlobal.InstalledDirectory + @"\Config\SiRFLiveAutomation.cfg");
                clsGlobal.ResetPeriodRandomizationSec = int.Parse(helper.GetIniFileString("SETUP", "RESET_PERIOD_RANDOMIZATION_SEC", "5"));
            }
            catch
            {
                clsGlobal.ResetPeriodRandomizationSec = 5;
            }
            ReportCtrl = new Report();
            HostAppCtrl = new sysCmdExec();
            SpazCtrl = new SPAzMgr(0x378);
            SimCtrl = new Simplex();
            gcTimer.Elapsed += new ElapsedEventHandler(OnGCTimerEvent);
            gcTimer.Interval = 1800000.0;
            gcTimer.AutoReset = true;
            setDefaultWindowsLocation();
        }
Example #9
0
 public int CheckRxSetup(string configFilePath)
 {
     IniHelper helper = new IniHelper(configFilePath);
     return helper.IniSiRFLiveRxSetupErrorCheck(configFilePath);
 }
Example #10
0
 private int saveConfigToHash(string configFilePath)
 {
     if (File.Exists(configFilePath) && ((File.GetAttributes(configFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly))
     {
         MessageBox.Show(configFilePath + "\nFile is read only! Please change property and retry.", "Error");
         this.Cursor = Cursors.Default;
         return 1;
     }
     this.Cursor = Cursors.WaitCursor;
     IniHelper helper = new IniHelper(configFilePath);
     List<string> sections = helper.GetSections();
     List<string> list2 = new List<string>();
     foreach (string str in sections)
     {
         foreach (string str2 in helper.GetKeys(str))
         {
             if (!str2.Contains("#") && clsGlobal.AutomationParamsHash.ContainsKey(str2))
             {
                 helper.IniWriteValue(str, str2, (string) clsGlobal.AutomationParamsHash[str2]);
             }
         }
     }
     int num = helper.IniSiRFLiveRxSetupErrorCheck(configFilePath);
     this.Cursor = Cursors.Default;
     return num;
 }
Example #11
0
        public frmFileConversion(ConversionType conversionType)
        {
            this.InitializeComponent();
            IniHelper helper = new IniHelper(this.fileConversionIniPath);
            string str = string.Empty;
            this._conversionType = conversionType;
            switch (conversionType)
            {
                case ConversionType.GP2ToGPS:
                    this._fileType = ".gpx";
                    break;

                case ConversionType.BinToGPS_GP2:
                    this._fileType = ".bin";
                    break;

                case ConversionType.GPSToNMEA:
                case ConversionType.GPSToKML:
                    this._fileType = ".gps";
                    break;

                case ConversionType.NMEAToGPS:
                    this._fileType = ".nmea";
                    break;

                default:
                    this._fileType = ".gpx";
                    break;
            }
            try
            {
                if (File.Exists(this.fileConversionIniPath))
                {
                    foreach (string str2 in helper.GetKeys("EMAIL"))
                    {
                        if (!str2.Contains("#"))
                        {
                            str = helper.GetIniFileString("EMAIL", str2, "");
                            if (str.Length != 0)
                            {
                                str = str.Replace(" ", "").TrimEnd(new char[] { '\n' }).TrimEnd(new char[] { '\r' });
                                ConfigurationManager.AppSettings[str2] = str;
                            }
                        }
                    }
                    str = helper.GetIniFileString("SETUP", "AVAILABLE_SCRIPTS", "");
                    if (str.Length != 0)
                    {
                        this.filesFullPathLists.Clear();
                        foreach (string str3 in str.Split(new char[] { ',' }))
                        {
                            if (str3.Length != 0)
                            {
                                this.addAvailableFiles(str3);
                            }
                        }
                    }
                    this.filesArray = this.filesFullPathLists.ToArray();
                    this.autoTestDirVal.Text = helper.GetIniFileString("SETUP", "SCRIPTS_DIR", "");
                    str = helper.GetIniFileString("SETUP", "SEND_EMAIL", "");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "ERROR!");
            }
        }
Example #12
0
 private void readConfigToHash(string configFilePath)
 {
     IniHelper helper = new IniHelper(configFilePath);
     List<string> sections = helper.GetSections();
     List<string> list2 = new List<string>();
     char[] trimChars = new char[] { '\n', '\r', '\t', '\0' };
     foreach (string str in sections)
     {
         foreach (string str2 in helper.GetKeys(str))
         {
             if (!str2.Contains("#"))
             {
                 string str3 = helper.GetIniFileString(str, str2, "").TrimEnd(trimChars);
                 if (!clsGlobal.AutomationParamsHash.ContainsKey(str2))
                 {
                     if ((str2 != "BASE_TEST_LOG") && (str2 != "SIM_FILE"))
                     {
                         clsGlobal.AutomationParamsHash.Add(str2, str3.Replace(" ", ""));
                     }
                     else
                     {
                         clsGlobal.AutomationParamsHash.Add(str2, str3);
                     }
                 }
             }
         }
     }
 }
Example #13
0
 private void doneBtn_Click(object sender, EventArgs e)
 {
     this._errorFound = false;
     if (clsGlobal.AutomationParamsHash.ContainsKey("BASE_TEST_LOG") && (this.resultLogDirectoryTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["BASE_TEST_LOG"] = this.resultLogDirectoryTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("PLAYBACK_FILES") && (this.playbackFileListTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["PLAYBACK_FILES"] = this.playbackFileListTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("PLAY_TIME_LISTS") && (this.playbackTimeListTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["PLAY_TIME_LISTS"] = this.playbackTimeListTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("SIM_ADDRESS") && (this.simIPAddressTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["SIM_ADDRESS"] = this.simIPAddressTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("SIM_PORT") && (this.simPortTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["SIM_PORT"] = this.simPortTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("SIM_FILE") && (this.simFilePathTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["SIM_FILE"] = this.simFilePathTxtBox.Text;
     }
     if (clsGlobal.AutomationParamsHash.ContainsKey("SIM_START_ATTEN") && (this.simInitialAttenTxtBox.Text != string.Empty))
     {
         clsGlobal.AutomationParamsHash["SIM_START_ATTEN"] = this.simInitialAttenTxtBox.Text;
     }
     string path = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\scripts\SiRFLiveAutomationSetup.cfg";
     if (!File.Exists(path))
     {
         MessageBox.Show(string.Format("Config File does not exist!\n {0}", path), "Automation Test Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         base.DialogResult = System.Windows.Forms.DialogResult.Cancel;
         this._errorFound = true;
     }
     else
     {
         if (clsGlobal.IsMarketingUser())
         {
             this.updateConfigFile();
         }
         if (this.saveConfigToHash(path) == 0)
         {
             if ((this._testName == "3GPP") || (this._testName == "TIA916"))
             {
                 string str2 = string.Empty;
                 if (this._testName == "3GPP")
                 {
                     str2 = clsGlobal.InstalledDirectory + @"\scripts\3GPP\3GPP.cfg";
                 }
                 else
                 {
                     str2 = clsGlobal.InstalledDirectory + @"\scripts\TIA916\TIA916.cfg";
                 }
                 if (File.Exists(str2))
                 {
                     if ((File.GetAttributes(str2) & FileAttributes.ReadOnly) != FileAttributes.ReadOnly)
                     {
                         IniHelper helper = new IniHelper(str2);
                         if (this.simIPAddressTxtBox.Text != string.Empty)
                         {
                             helper.IniWriteValue("SIM", "SIM_ADDRESS", this.simIPAddressTxtBox.Text);
                         }
                         if (this.simPortTxtBox.Text != string.Empty)
                         {
                             helper.IniWriteValue("SIM", "SIM_PORT", this.simPortTxtBox.Text.Replace(" ", ""));
                         }
                     }
                     else
                     {
                         MessageBox.Show(string.Format("Readonly file! Please make sure file is not readonly before proceeding!\n{0}", str2), "Station Setup Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                         base.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                         this._errorFound = true;
                         return;
                     }
                 }
             }
             base.DialogResult = DialogResult.OK;
             clsGlobal.AutomationParamsHash.Clear();
             base.Close();
         }
     }
 }
Example #14
0
 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
     {
     }
 }
Example #15
0
 private void loadConfigFile(string configFilePath)
 {
     this.Cursor = Cursors.WaitCursor;
     if (!File.Exists(configFilePath))
     {
         MessageBox.Show("Configuration File does not exist", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.Cursor = Cursors.Default;
     }
     else
     {
         IniHelper helper = new IniHelper(configFilePath);
         List<string> sections = helper.GetSections();
         string key = string.Empty;
         string str2 = string.Empty;
         List<string> list2 = new List<string>();
         char[] trimChars = new char[] { '\n', '\r', '\t', '\0' };
         int num = 0;
         int num2 = 4;
         foreach (string str3 in sections)
         {
             int num3;
             string str4 = str3;
             if (str4 != null)
             {
                 if (!(str4 == "TESTS"))
                 {
                     if (str4 == "TEST_SETUP")
                     {
                         goto Label_01C0;
                     }
                     if (str4 == "AIDING_PARAMS")
                     {
                         goto Label_062C;
                     }
                 }
                 else
                 {
                     key = "SENSITIVITY_TEST1";
                     str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
                     this.frm3GPPConfigTest1ChkBox.Checked = str2 == "1";
                     key = "NOMINAL_ACCURACY_TEST2";
                     str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
                     this.frm3GPPConfigTest2ChkBox.Checked = str2 == "1";
                     key = "DYNAMIC_RANGE_TEST3";
                     str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
                     this.frm3GPPConfigTest3ChkBox.Checked = str2 == "1";
                     key = "MULTIPATH_TEST4";
                     str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
                     this.frm3GPPConfigTest4ChkBox.Checked = str2 == "1";
                     key = "MOVING_SCENARIO_TEST5";
                     str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
                     this.frm3GPPConfigTest5ChkBox.Checked = str2 == "1";
                 }
             }
             continue;
         Label_01C0:
             num3 = 1;
             while (num3 <= 5)
             {
                 key = "CYCLES_TEST" + num3.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
                 num3++;
             }
             if (!this.frm3GPPConfigTest1CyclesComboBox.Items.Contains(list2[num]))
             {
                 this.frm3GPPConfigTest1CyclesComboBox.Items.Add(list2[num]);
             }
             this.frm3GPPConfigTest1CyclesComboBox.Text = list2[num++];
             if (!this.frm3GPPConfigTest2CyclesComboBox.Items.Contains(list2[num]))
             {
                 this.frm3GPPConfigTest2CyclesComboBox.Items.Add(list2[num]);
             }
             this.frm3GPPConfigTest2CyclesComboBox.Text = list2[num++];
             if (!this.frm3GPPConfigTest3CyclesComboBox.Items.Contains(list2[num]))
             {
                 this.frm3GPPConfigTest3CyclesComboBox.Items.Add(list2[num]);
             }
             this.frm3GPPConfigTest3CyclesComboBox.Text = list2[num++];
             if (!this.frm3GPPConfigTest4CyclesComboBox.Items.Contains(list2[num]))
             {
                 this.frm3GPPConfigTest4CyclesComboBox.Items.Add(list2[num]);
             }
             this.frm3GPPConfigTest4CyclesComboBox.Text = list2[num++];
             num = 0;
             list2.Clear();
             for (int i = 1; i <= num2; i++)
             {
                 key = "SIGNAL_ATTN_TEST" + i.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1SignalAttnTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2SignalAttnTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3SignalAttnTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4SignalAttnTxtBox.Text = list2[num++];
             key = "MS_BASED_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsBasedChkBox.Checked = str2 == "1";
             key = "MS_ASSIST1_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAssist1ChkBox.Checked = str2 == "1";
             key = "MS_ASSIST2_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAssist2ChkBox.Checked = str2 == "1";
             key = "MSAB_B_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_BChkBox.Checked = str2 == "1";
             key = "MSAB_A1_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_A1ChkBox.Checked = str2 == "1";
             key = "MSAB_A2_TEST";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_A2ChkBox.Checked = str2 == "1";
             key = "CABLE_LOSS";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigCableLossTxtBox.Text = str2;
             key = "MS_BASED_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsBasedMarginTxtBox.Text = str2;
             key = "MS_ASSIST1_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAssist1MarginTxtBox.Text = str2;
             key = "MS_ASSIST2_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAssist2MarginTxtBox.Text = str2;
             key = "MSAB_B_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_BMarginTxtBox.Text = str2;
             key = "MSAB_A1_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_A1MarginTxtBox.Text = str2;
             key = "MSAB_A2_MARGIN";
             str2 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             this.frm3GPPConfigMsAB_A2MarginTxtBox.Text = str2;
             continue;
         Label_062C:
             key = "FREQ_TRANFER_METHOD";
             string str5 = helper.GetIniFileString(str3, key, "").TrimEnd(trimChars);
             if (str5 != null)
             {
                 if (!(str5 == "Counter"))
                 {
                     if (str5 == "NonCounter")
                     {
                         goto Label_0688;
                     }
                     if (str5 == "NoFreqReq")
                     {
                         goto Label_0696;
                     }
                 }
                 else
                 {
                     this.frm3GPPConfigCounterRadioBtn.Checked = true;
                 }
             }
             goto Label_06A2;
         Label_0688:
             this.frm3GPPConfigNonCounterRadioBtn.Checked = true;
             goto Label_06A2;
         Label_0696:
             this.frm3GPPConfigNoFreqReqRadioBtn.Checked = true;
         Label_06A2:
             num = 0;
             list2.Clear();
             for (int j = 1; j <= num2; j++)
             {
                 key = "REL_FREQ_ACC_TEST" + j.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1RelFreqAccTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2RelFreqAccTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3RelFreqAccTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4RelFreqAccTxtBox.Text = list2[num++];
             num = 0;
             list2.Clear();
             for (int k = 1; k <= num2; k++)
             {
                 key = "HRZ_QOS_TEST" + k.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1HrzQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2HrzQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3HrzQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4HrzQoSTxtBox.Text = list2[num++];
             num = 0;
             list2.Clear();
             for (int m = 1; m <= num2; m++)
             {
                 key = "VRT_QOS_TEST" + m.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1VrtQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2VrtQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3VrtQoSTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4VrtQoSTxtBox.Text = list2[num++];
             num = 0;
             list2.Clear();
             for (int n = 1; n <= num2; n++)
             {
                 key = "RESPONSE_TIME_MAX_TEST" + n.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1RespMaxTimeTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2RespMaxTimeTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3RespMaxTimeTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4RespMaxTimeTxtBox.Text = list2[num++];
             num = 0;
             list2.Clear();
             for (int num9 = 1; num9 <= num2; num9++)
             {
                 key = "PRIORITY_TEST" + num9.ToString();
                 list2.Add(helper.GetIniFileString(str3, key, "").TrimEnd(trimChars));
             }
             this.frm3GPPConfigTest1PriorityTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest2PriorityTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest3PriorityTxtBox.Text = list2[num++];
             this.frm3GPPConfigTest4PriorityTxtBox.Text = list2[num++];
         }
         this.Cursor = Cursors.Default;
     }
 }
Example #16
0
 private bool prinSDOHeader(StreamWriter s, Hashtable dH)
 {
     if (s == null)
     {
         return false;
     }
     string path = clsGlobal.InstalledDirectory + @"\Config\sdoHeaderName.cfg";
     if (!File.Exists(path))
     {
         path = null;
         return false;
     }
     IniHelper helper = new IniHelper(path);
     List<string> keys = helper.GetKeys("General");
     List<string> list2 = helper.GetKeys("TestStationInfo");
     List<string> list3 = helper.GetKeys("TestParameters");
     if (dH == null)
     {
         string str2 = "N/A";
         if (keys != null)
         {
             foreach (string str3 in keys)
             {
                 s.WriteLine(string.Format("{0}:{1}", str3, str2));
             }
         }
         if (list2 != null)
         {
             s.WriteLine("Test Station Info:");
             foreach (string str4 in list2)
             {
                 s.WriteLine(string.Format("{0}:{1}", str4, str2));
             }
         }
         if (list3 != null)
         {
             s.WriteLine("Test Parameters:");
             foreach (string str5 in list3)
             {
                 s.WriteLine(string.Format("{0}:{1}", str5, str2));
             }
         }
     }
     else
     {
         string str6 = string.Empty;
         if (keys != null)
         {
             foreach (string str7 in keys)
             {
                 if (dH.ContainsKey(str7))
                 {
                     str6 = (string) dH[str7];
                     s.WriteLine(string.Format("{0}:{1}", str7, str6));
                 }
             }
         }
         if (list2 != null)
         {
             s.WriteLine("Test Station Info:");
             foreach (string str8 in list2)
             {
                 if (dH.ContainsKey(str8))
                 {
                     str6 = (string) dH[str8];
                     if (str8.Contains("SW Version"))
                     {
                         s.WriteLine(string.Format("\tDUT {0}:{1}", str8, str6));
                     }
                     else
                     {
                         s.WriteLine(string.Format("\t{0}:{1}", str8, str6));
                     }
                 }
             }
         }
         if (list3 != null)
         {
             s.WriteLine("Test Parameters:");
             foreach (string str9 in list3)
             {
                 if (dH.ContainsKey(str9))
                 {
                     str6 = (string) dH[str9];
                     s.WriteLine(string.Format("\t{0}:{1}", str9, str6));
                 }
             }
         }
     }
     path = null;
     if (keys != null)
     {
         keys.Clear();
         keys = null;
     }
     if (list2 != null)
     {
         list2.Clear();
         list2 = null;
     }
     if (list3 != null)
     {
         list3.Clear();
         list3 = null;
     }
     return true;
 }
Example #17
0
 private int saveToConfigFile()
 {
     this.Cursor = Cursors.WaitCursor;
     IniHelper helper = new IniHelper(this._configFilePath);
     if (File.Exists(this._configFilePath))
     {
         if ((File.GetAttributes(this._configFilePath) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
         {
             MessageBox.Show(string.Format("Config File is read only!\nPlease change property and retry\n\n{0}", this._configFilePath), "Error");
             this.Cursor = Cursors.Default;
             return 1;
         }
         string section = "TESTS";
         string key = "SENSITIVITY_TEST1";
         int num = 1;
         int num2 = 0;
         if (this.frm3GPPConfigTest1ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "NOMINAL_ACCURACY_TEST2";
         if (this.frm3GPPConfigTest2ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "DYNAMIC_RANGE_TEST3";
         if (this.frm3GPPConfigTest3ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MULTIPATH_TEST4";
         if (this.frm3GPPConfigTest4ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MOVING_SCENARIO_TEST5";
         if (this.frm3GPPConfigTest5ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         section = "TEST_SETUP";
         key = "CYCLES_TEST" + num.ToString();
         try
         {
             num2 = Convert.ToInt32(this.frm3GPPConfigTest1CyclesComboBox.Text.ToString());
             helper.IniWriteValue(section, key, num2.ToString());
         }
         catch (Exception exception)
         {
             MessageBox.Show("Test " + num.ToString() + "# Cycles: " + exception.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "CYCLES_TEST" + num.ToString();
         try
         {
             num2 = Convert.ToInt32(this.frm3GPPConfigTest2CyclesComboBox.Text.ToString());
             helper.IniWriteValue(section, key, num2.ToString());
         }
         catch (Exception exception2)
         {
             MessageBox.Show("Test " + num.ToString() + "# Cycles: " + exception2.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "CYCLES_TEST" + num.ToString();
         try
         {
             num2 = Convert.ToInt32(this.frm3GPPConfigTest3CyclesComboBox.Text.ToString());
             helper.IniWriteValue(section, key, num2.ToString());
         }
         catch (Exception exception3)
         {
             MessageBox.Show("Test " + num.ToString() + "# Cycles: " + exception3.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "CYCLES_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, Convert.ToInt32(this.frm3GPPConfigTest4CyclesComboBox.Text.ToString()).ToString());
         }
         catch (Exception exception4)
         {
             MessageBox.Show("Test " + num.ToString() + "# Cycles: " + exception4.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         key = "MS_BASED_TEST";
         if (this.frm3GPPConfigMsBasedChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MS_ASSIST1_TEST";
         if (this.frm3GPPConfigMsAssist1ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MS_ASSIST2_TEST";
         if (this.frm3GPPConfigMsAssist2ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MSAB_B_TEST";
         if (this.frm3GPPConfigMsAB_BChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MSAB_A1_TEST";
         if (this.frm3GPPConfigMsAB_A1ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         key = "MSAB_A2_TEST";
         if (this.frm3GPPConfigMsAB_A2ChkBox.Checked)
         {
             helper.IniWriteValue(section, key, "1");
         }
         else
         {
             helper.IniWriteValue(section, key, "0");
         }
         List<string> list = new List<string>();
         list.Add(this.frm3GPPConfigMsBasedMarginTxtBox.Text);
         list.Add(this.frm3GPPConfigMsAssist1MarginTxtBox.Text);
         list.Add(this.frm3GPPConfigMsAssist2MarginTxtBox.Text);
         list.Add(this.frm3GPPConfigMsAB_BMarginTxtBox.Text);
         list.Add(this.frm3GPPConfigMsAB_A1MarginTxtBox.Text);
         list.Add(this.frm3GPPConfigMsAB_A2MarginTxtBox.Text);
         foreach (string str4 in list)
         {
             string[] strArray = str4.Split(new char[] { ',' });
             double num3 = 0.0;
             try
             {
                 if (strArray.Length > 1)
                 {
                     foreach (string str5 in strArray)
                     {
                         num3 = Convert.ToDouble(str5);
                         if ((num3 > 9.9) || (num3 < -9.9))
                         {
                             MessageBox.Show("Margin: " + num3.ToString() + " is not valid (range: -9.9 to 9.9)", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                             this.Cursor = Cursors.Default;
                             return 1;
                         }
                     }
                 }
                 else
                 {
                     num3 = Convert.ToDouble(strArray[0]);
                     if ((num3 > 9.9) || (num3 < -9.9))
                     {
                         MessageBox.Show("Margin: " + num3.ToString() + " is not valid (range: -9.9 to 9.9)", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                         this.Cursor = Cursors.Default;
                         return 1;
                     }
                 }
             }
             catch (Exception exception5)
             {
                 MessageBox.Show("Margin: " + exception5.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 this.Cursor = Cursors.Default;
                 return 1;
             }
         }
         key = "MS_BASED_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsBasedMarginTxtBox.Text);
         key = "MS_ASSIST1_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsAssist1MarginTxtBox.Text);
         key = "MS_ASSIST2_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsAssist2MarginTxtBox.Text);
         key = "MSAB_B_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsAB_BMarginTxtBox.Text);
         key = "MSAB_A1_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsAB_A1MarginTxtBox.Text);
         key = "MSAB_A2_MARGIN";
         helper.IniWriteValue(section, key, this.frm3GPPConfigMsAB_A2MarginTxtBox.Text);
         key = "CABLE_LOSS";
         try
         {
             helper.IniWriteValue(section, key, Convert.ToDouble(this.frm3GPPConfigCableLossTxtBox.Text.ToString()).ToString());
         }
         catch (Exception exception6)
         {
             MessageBox.Show("Cable Loss: " + exception6.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         section = "AIDING_PARAMS";
         key = "FREQ_TRANFER_METHOD";
         string str6 = "FREQ_AIDING";
         string str7 = "FREQ_METHOD";
         if (this.frm3GPPConfigCounterRadioBtn.Checked)
         {
             helper.IniWriteValue(section, key, "Counter");
             helper.IniWriteValue(str6, str7, "0");
             str7 = "USE_FREQ_AIDING";
             helper.IniWriteValue(str6, str7, "0");
         }
         else if (this.frm3GPPConfigNonCounterRadioBtn.Checked)
         {
             helper.IniWriteValue(section, key, "NonCounter");
             helper.IniWriteValue(str6, str7, "1");
             str7 = "USE_FREQ_AIDING";
             helper.IniWriteValue(str6, str7, "0");
         }
         else if (this.frm3GPPConfigNoFreqReqRadioBtn.Checked)
         {
             str7 = "USE_FREQ_AIDING";
             helper.IniWriteValue(section, key, "NoFreqReq");
             helper.IniWriteValue(str6, str7, "2");
         }
         else
         {
             helper.IniWriteValue(section, key, "NoFreqReq");
         }
         num = 1;
         key = "REL_FREQ_ACC_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest1RelFreqAccTxtBox.Text);
         }
         catch (Exception exception7)
         {
             MessageBox.Show("REL_FREQ_ACC_TEST " + num.ToString() + ": " + exception7.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "REL_FREQ_ACC_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest2RelFreqAccTxtBox.Text);
         }
         catch (Exception exception8)
         {
             MessageBox.Show("REL_FREQ_ACC_TEST " + num.ToString() + ": " + exception8.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "REL_FREQ_ACC_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest3RelFreqAccTxtBox.Text);
         }
         catch (Exception exception9)
         {
             MessageBox.Show("REL_FREQ_ACC_TEST " + num.ToString() + ": " + exception9.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "REL_FREQ_ACC_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest4RelFreqAccTxtBox.Text);
         }
         catch (Exception exception10)
         {
             MessageBox.Show("REL_FREQ_ACC_TEST " + num.ToString() + ": " + exception10.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num = 1;
         key = "HRZ_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest1HrzQoSTxtBox.Text);
         }
         catch (Exception exception11)
         {
             MessageBox.Show("HRZ_QOS_TEST " + num.ToString() + ": " + exception11.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "HRZ_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest2HrzQoSTxtBox.Text);
         }
         catch (Exception exception12)
         {
             MessageBox.Show("HRZ_QOS_TEST " + num.ToString() + ": " + exception12.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "HRZ_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest3HrzQoSTxtBox.Text);
         }
         catch (Exception exception13)
         {
             MessageBox.Show("HRZ_QOS_TEST " + num.ToString() + ": " + exception13.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "HRZ_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest4HrzQoSTxtBox.Text);
         }
         catch (Exception exception14)
         {
             MessageBox.Show("HRZ_QOS_TEST " + num.ToString() + ": " + exception14.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num = 1;
         key = "VRT_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest1VrtQoSTxtBox.Text);
         }
         catch (Exception exception15)
         {
             MessageBox.Show("VRT_QOS_TEST " + num.ToString() + ": " + exception15.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "VRT_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest2VrtQoSTxtBox.Text);
         }
         catch (Exception exception16)
         {
             MessageBox.Show("VRT_QOS_TEST " + num.ToString() + ": " + exception16.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "VRT_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest3VrtQoSTxtBox.Text);
         }
         catch (Exception exception17)
         {
             MessageBox.Show("VRT_QOS_TEST " + num.ToString() + ": " + exception17.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "VRT_QOS_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest4VrtQoSTxtBox.Text);
         }
         catch (Exception exception18)
         {
             MessageBox.Show("VRT_QOS_TEST " + num.ToString() + ": " + exception18.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num = 1;
         key = "RESPONSE_TIME_MAX_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest1RespMaxTimeTxtBox.Text);
         }
         catch (Exception exception19)
         {
             MessageBox.Show("RESPONSE_TIME_MAX_TEST " + num.ToString() + ": " + exception19.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "RESPONSE_TIME_MAX_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest2RespMaxTimeTxtBox.Text);
         }
         catch (Exception exception20)
         {
             MessageBox.Show("RESPONSE_TIME_MAX_TEST " + num.ToString() + ": " + exception20.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "RESPONSE_TIME_MAX_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest3RespMaxTimeTxtBox.Text);
         }
         catch (Exception exception21)
         {
             MessageBox.Show("RESPONSE_TIME_MAX_TEST " + num.ToString() + ": " + exception21.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "RESPONSE_TIME_MAX_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest4RespMaxTimeTxtBox.Text);
         }
         catch (Exception exception22)
         {
             MessageBox.Show("RESPONSE_TIME_MAX_TEST " + num.ToString() + ": " + exception22.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num = 1;
         key = "PRIORITY_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest1PriorityTxtBox.Text);
         }
         catch (Exception exception23)
         {
             MessageBox.Show("PRIORITY_TEST " + num.ToString() + ": " + exception23.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "PRIORITY_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest2PriorityTxtBox.Text);
         }
         catch (Exception exception24)
         {
             MessageBox.Show("PRIORITY_TEST " + num.ToString() + ": " + exception24.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "PRIORITY_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest3PriorityTxtBox.Text);
         }
         catch (Exception exception25)
         {
             MessageBox.Show("PRIORITY_TEST " + num.ToString() + ": " + exception25.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
         num++;
         key = "PRIORITY_TEST" + num.ToString();
         try
         {
             helper.IniWriteValue(section, key, this.frm3GPPConfigTest4PriorityTxtBox.Text);
         }
         catch (Exception exception26)
         {
             MessageBox.Show("PRIORITY_TEST " + num.ToString() + ": " + exception26.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.Cursor = Cursors.Default;
             return 1;
         }
     }
     this.Cursor = Cursors.Default;
     return 0;
 }
Example #18
0
 private void printResultStats(StreamWriter s, Hashtable dH)
 {
     if (((s != null) && (dH != null)) && (s != null))
     {
         string path = clsGlobal.InstalledDirectory + @"\Config\sdoHeaderName.cfg";
         if (!File.Exists(path))
         {
             path = null;
         }
         else
         {
             IniHelper helper = new IniHelper(path);
             List<string> keys = helper.GetKeys("Stats");
             s.WriteLine("Test Statistics:");
             SDOStatsElememt elememt = new SDOStatsElememt();
             if (keys != null)
             {
                 foreach (string str2 in keys)
                 {
                     elememt.Init();
                     if (dH.ContainsKey(str2))
                     {
                         elememt = (SDOStatsElememt) dH[str2];
                         if (elememt.Target != "N/A")
                         {
                             s.WriteLine(string.Format("\t{0}:", str2));
                             s.WriteLine(string.Format("\t\t- Target:{0}", elememt.Target));
                             s.WriteLine(string.Format("\t\t- Result:{0}", elememt.Value));
                             s.WriteLine(string.Format("\t\t- Comparison:{0}", elememt.Comparison));
                             s.WriteLine(string.Format("\t\t- Comparison Result:{0}", elememt.ComparisonResult));
                         }
                         else
                         {
                             s.WriteLine(string.Format("\t{0}:{1}", str2, elememt.Value));
                         }
                     }
                 }
             }
             elememt = null;
             keys.Clear();
             keys = null;
             helper = null;
         }
     }
 }
Example #19
0
 public void SetAutoReplyParameters(string configFile)
 {
     try
     {
         IniHelper helper = new IniHelper(configFile);
         string key = string.Empty;
         string category = string.Empty;
         category = "HW_CONFIG";
         key = "REPLY";
         this._hwCfgParams.Reply = helper.GetIniFileString(category, key, "") == "1";
         key = "PRECISE_TIME_ENABLED";
         this._hwCfgParams.PreciseTimeEnabled = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "PRECISE_TIME_DIRECTION";
         this._hwCfgParams.PreciseTimeDirection = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "FREQ_AIDED_ENABLED";
         this._hwCfgParams.FreqAidEnabled = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "FREQ_AIDED_METHOD";
         this._hwCfgParams.FreqAidMethod = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "RTC_AVAILABLE";
         this._hwCfgParams.RTCAvailabe = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "RTC_SOURCE";
         this._hwCfgParams.RTCSource = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "COARSE_TIME_ENABLE";
         this._hwCfgParams.CoarseTimeEnabled = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "REF_CLOCK_ENABLED";
         this._hwCfgParams.RefClkEnabled = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "NORMINAL_FREQ_HZ";
         this._hwCfgParams.NorminalFreqHz = Convert.ToInt64(helper.GetIniFileString(category, key, ""));
         key = "ENHANCED_NETWORK";
         this._hwCfgParams.NetworkEnhanceType = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         category = "APPROXIMATE_POSITION";
         key = "REPLY";
         this._approxPositionParams.Reply = helper.GetIniFileString(category, key, "") == "1";
         key = "LAT";
         this._approxPositionParams.Lat = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "LON";
         this._approxPositionParams.Lon = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "ALT";
         this._approxPositionParams.Alt = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "EST_HOR_ERR";
         this._approxPositionParams.EstHorrErr = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "EST_VER_ERR";
         this._approxPositionParams.EstVertiErr = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "LAT_SKEW";
         this._approxPositionParams.DistanceSkew = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "LON_SKEW";
         this._approxPositionParams.HeadingSkew = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         category = "TIME_AIDING";
         key = "TIME_AIDING_TYPE";
         this._ttbTimeAidingParams.Type = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "TIME_ACC";
         this._ttbTimeAidingParams.Accuracy = Convert.ToUInt32(helper.GetIniFileString(category, key, ""));
         key = "TIME_SKEW";
         this._ttbTimeAidingParams.Skew = Convert.ToUInt32(helper.GetIniFileString(category, key, ""));
         category = "FREQ_AIDING";
         key = "REPLY";
         this._freqTransferParams.Reply = helper.GetIniFileString(category, key, "") == "1";
         key = "FREQ_AIDING_TYPE";
         this._freqTransferParams.FreqAidingMethod = Convert.ToInt32(helper.GetIniFileString(category, key, ""));
         key = "SCALED_FREQ_OFFSET";
         this._freqTransferParams.ScaledFreqOffset = Convert.ToInt16(helper.GetIniFileString(category, key, ""));
         key = "REF_CLOCK_INFO";
         this._freqTransferParams.RefClkInfo = Convert.ToByte(helper.GetIniFileString(category, key, ""));
         key = "REL_FREQ_ACC";
         this._freqTransferParams.Accuracy = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "ECLK_SKEW";
         this._freqTransferParams.ExtClkSkewppm = Convert.ToDouble(helper.GetIniFileString(category, key, ""));
         key = "NORMINAL_FREQ";
         this._freqTransferParams.NomFreq = Convert.ToInt64(helper.GetIniFileString(category, key, ""));
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Example #20
0
 public virtual void GetReferencePosition(string siteName, string configFilePath)
 {
     string locationName = string.Empty;
     if (((configFilePath != string.Empty) && File.Exists(configFilePath)) && (siteName != string.Empty))
     {
         locationName = new IniHelper(configFilePath).GetIniFileString("SITE_NAME", siteName, "");
         if (this._commWindow != null)
         {
             PositionInLatLonAlt referencePosition = this._commWindow.m_NavData.GetReferencePosition(locationName);
             this._commWindow.m_NavData.RefAlt = referencePosition.altitude;
             this._commWindow.m_NavData.RefLat = referencePosition.latitude;
             this._commWindow.m_NavData.RefLon = referencePosition.longitude;
             this._commWindow.AutoReplyCtrl.ApproxPositionCtrl.Lat = referencePosition.latitude;
             this._commWindow.AutoReplyCtrl.ApproxPositionCtrl.Lon = referencePosition.longitude;
             this._commWindow.AutoReplyCtrl.ApproxPositionCtrl.Alt = referencePosition.altitude;
         }
     }
 }
Example #21
0
 private void configCheckBtn_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     string fPath = @".\tmpConfigFile.cfg";
     this.writeNewConfig(fPath);
     IniHelper helper = new IniHelper(fPath);
     if (File.Exists(fPath))
     {
         if (helper.IniSiRFLiveRxSetupErrorCheck(fPath) == 0)
         {
             MessageBox.Show("No Error Found", "Success");
         }
         File.Delete(fPath);
     }
     else
     {
         MessageBox.Show("File does not exist!", "ERROR!");
     }
     this.Cursor = Cursors.Default;
 }
Example #22
0
 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";
     }
 }
Example #23
0
 private void loadConfigFile()
 {
     this.Cursor = Cursors.WaitCursor;
     if (!File.Exists(this.configFilePathVal.Text))
     {
         MessageBox.Show("Configuration File does not exist", "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.Cursor = Cursors.Default;
     }
     else
     {
         IniHelper helper = new IniHelper(this.configFilePathVal.Text);
         List<string> sections = helper.GetSections();
         List<string> list2 = new List<string>();
         string str = string.Empty;
         char[] trimChars = new char[] { '\n', '\r', '\t', '\0' };
         this.configDataGridView.Rows.Clear();
         foreach (string str2 in sections)
         {
             if (((str2 != "RF_PLAYBACK") && (str2 != "SIM")) && ((str2 != "LIVE") && (str2 != "AIDING_PARAMS")))
             {
                 foreach (string str3 in helper.GetKeys(str2))
                 {
                     if (!str3.Contains("#"))
                     {
                         int num = this.configDataGridView.Rows.Add();
                         str = helper.GetIniFileString(str2, str3, "");
                         this.configDataGridView.Rows[num].HeaderCell.Value = str2;
                         this.configDataGridView.Rows[num].Cells[0].Value = str3;
                         this.configDataGridView.Rows[num].Cells[1].Value = str.TrimEnd(trimChars);
                         if (!clsGlobal.AutomationParamsHash.ContainsKey(str3))
                         {
                             if ((str3 != "BASE_TEST_LOG") && (str3 != "SIM_FILE"))
                             {
                                 clsGlobal.AutomationParamsHash.Add(str3, this.configDataGridView.Rows[num].Cells[1].Value.ToString().Replace(" ", ""));
                             }
                             else
                             {
                                 clsGlobal.AutomationParamsHash.Add(str3, this.configDataGridView.Rows[num].Cells[1].Value);
                             }
                         }
                     }
                 }
             }
         }
         string category = helper.GetIniFileString("TEST_SETUP", "SIGNAL_SOURCE", "");
         foreach (string str5 in helper.GetKeys(category))
         {
             if (!str5.Contains("#"))
             {
                 int num2 = this.configDataGridView.Rows.Add();
                 str = helper.GetIniFileString(category, str5, "");
                 this.configDataGridView.Rows[num2].HeaderCell.Value = category;
                 this.configDataGridView.Rows[num2].Cells[0].Value = str5;
                 this.configDataGridView.Rows[num2].Cells[1].Value = str.TrimEnd(trimChars);
                 if (!clsGlobal.AutomationParamsHash.ContainsKey(str5))
                 {
                     clsGlobal.AutomationParamsHash.Add(str5, this.configDataGridView.Rows[num2].Cells[1].Value);
                 }
             }
         }
         string str6 = helper.GetIniFileString("TEST_SETUP", "REQUIRED_AIDING", "");
         foreach (string str7 in helper.GetKeys("AIDING_PARAMS"))
         {
             if (!str7.Contains("#"))
             {
                 if (str6 == "1")
                 {
                     int num3 = this.configDataGridView.Rows.Add();
                     str = helper.GetIniFileString("AIDING_PARAMS", str7, "");
                     this.configDataGridView.Rows[num3].HeaderCell.Value = "AIDING_PARAMS";
                     this.configDataGridView.Rows[num3].Cells[0].Value = str7;
                     this.configDataGridView.Rows[num3].Cells[1].Value = str.TrimEnd(trimChars);
                 }
                 if (!clsGlobal.AutomationParamsHash.ContainsKey(str7))
                 {
                     clsGlobal.AutomationParamsHash.Add(str7, str.TrimEnd(trimChars));
                 }
             }
         }
         this.Cursor = Cursors.Default;
     }
 }
Example #24
0
 private void frmLowPowerSaveSettings()
 {
     this.Cursor = Cursors.WaitCursor;
     string path = clsGlobal.InstalledDirectory + @"\scripts\SiRFLiveAutomationSetup.cfg";
     if (!File.Exists(path))
     {
         MessageBox.Show("Config file does not exist -- Not saving" + path, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     if ((File.GetAttributes(path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
     {
         MessageBox.Show("Config file is read only!-- Not saving\n" + path, "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     IniHelper helper = new IniHelper(path);
     string section = string.Empty;
     string key = string.Empty;
     section = "POWER_MODE";
     key = "MODE";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.Mode.ToString());
     key = "APM_NUM_FIXES";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMNumFixes.ToString());
     key = "APM_TBF";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMTBF.ToString());
     key = "APM_DUTY_CYCLE";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMDutyCycle.ToString());
     key = "APM_MAX_HOR_ERR";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMMaxHrzError.ToString());
     key = "APM_MAX_VERT_ERR";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMMaxVrtError.ToString());
     key = "APM_PRIORITY";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMPriority.ToString());
     key = "APM_MAX_OFFTIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMMaxOffTime.ToString());
     key = "APM_MAX_SEARCH_TIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMMaxSearchTime.ToString());
     key = "APM_TIME_ACC_PRIORITY";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.APMTimeAccPriority.ToString());
     key = "TP_UPDATE";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.TPUpdateRate.ToString());
     key = "TP_ONTIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.TPOnTime.ToString());
     key = "TP_MAX_OFF_TIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.TPMaxOffTime.ToString());
     key = "TP_MAX_SEARCH_TIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.TPMaxSearchTime.ToString());
     key = "PTF_PERIOD";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.PTFPeriod.ToString());
     key = "PTF_MAX_SEARCH_TIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.PTFMaxSearchTime.ToString());
     key = "PTF_MAX_OFF_TIME";
     helper.IniWriteValue(section, key, this.comm.LowPowerParams.PTFMaxOffTime.ToString());
     this.Cursor = Cursors.Default;
 }
Example #25
0
        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();
        }
Example #26
0
 private void writeAutoReplyData(string filepath)
 {
     this.Cursor = Cursors.WaitCursor;
     IniHelper helper = new IniHelper(filepath);
     string section = string.Empty;
     string key = string.Empty;
     section = "HW_CONFIG";
     key = "REPLY";
     if (this.comm.AutoReplyCtrl.HWCfgCtrl.Reply)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "PRECISE_TIME_ENABLED";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.PreciseTimeEnabled.ToString());
     key = "PRECISE_TIME_DIRECTION";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.PreciseTimeDirection.ToString());
     key = "FREQ_AIDED_ENABLED";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.FreqAidEnabled.ToString());
     key = "FREQ_AIDED_ENABLED";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.FreqAidEnabled.ToString());
     key = "FREQ_AIDED_METHOD";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.FreqAidMethod.ToString());
     key = "RTC_AVAILABLE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.RTCAvailabe.ToString());
     key = "RTC_SOURCE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.RTCSource.ToString());
     key = "COARSE_TIME_ENABLE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.CoarseTimeEnabled.ToString());
     key = "REF_CLOCK_ENABLED";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.RefClkEnabled.ToString());
     key = "NORMINAL_FREQ_HZ";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.NorminalFreqHz.ToString());
     key = "ENHANCED_NETWORK";
     if (this.comm.AutoReplyCtrl.HWCfgCtrl.PreciseTimeEnabled == 0)
     {
         helper.IniWriteValue(section, key, "0");
         this.comm.AutoReplyCtrl.HWCfgCtrl.NetworkEnhanceType = 0;
     }
     else
     {
         helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.HWCfgCtrl.NetworkEnhanceType.ToString());
     }
     section = "APPROXIMATE_POSITION";
     key = "REPLY";
     if (this.comm.AutoReplyCtrl.ApproxPositionCtrl.Reply)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "REJECT";
     if (this.comm.AutoReplyCtrl.ApproxPositionCtrl.Reject)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "LAT";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.Lat.ToString());
     key = "LON";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.Lon.ToString());
     key = "ALT";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.Alt.ToString());
     key = "EST_HOR_ERR";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.EstHorrErr.ToString());
     key = "EST_VER_ERR";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.EstVertiErr.ToString());
     key = "LAT_SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.DistanceSkew.ToString());
     key = "LON_SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.ApproxPositionCtrl.HeadingSkew.ToString());
     key = "LOC_NAME";
     helper.IniWriteValue(section, key, this.comm.m_NavData.RefLocationName);
     section = "TIME_AIDING";
     key = "REPLY";
     if (this.comm.AutoReplyCtrl.TimeTransferCtrl.Reply)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "REJECT";
     if (this.comm.AutoReplyCtrl.TimeTransferCtrl.Reject)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "TIME_AIDING_TYPE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TimeTransferCtrl.TTType.ToString());
     key = "TIME_ACC";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TimeTransferCtrl.Accuracy.ToString());
     key = "SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TimeTransferCtrl.Skew.ToString());
     key = "UTC_OFFSET";
     helper.IniWriteValue(section, key, this.comm.RxCtrl.UTCOffset.ToString());
     key = "TIME_AIDING_SOURCE";
     int num = 0;
     if (this.comm.AutoReplyCtrl.AutoReplyParams.UseDOS_ForTimeAid)
     {
         num = 1;
         this.comm.AutoReplyCtrl.TTBTimeAidingParams.Enable = false;
     }
     else if (this.comm.AutoReplyCtrl.AutoReplyParams.UseTTB_ForTimeAid)
     {
         num = 2;
         this.comm.AutoReplyCtrl.TTBTimeAidingParams.Enable = true;
     }
     else
     {
         num = 0;
         this.comm.AutoReplyCtrl.TTBTimeAidingParams.Enable = false;
     }
     helper.IniWriteValue(section, key, num.ToString());
     section = "TTB_TIME_AIDING";
     key = "ENABLE";
     if (this.comm.AutoReplyCtrl.TTBTimeAidingParams.Enable)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "TYPE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Type.ToString());
     key = "TIME_ACC";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Accuracy.ToString());
     key = "TIME_SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.TTBTimeAidingParams.Skew.ToString());
     section = "FREQ_AIDING";
     key = "REPLY";
     if (this.comm.AutoReplyCtrl.FreqTransferCtrl.Reply)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "USE_FREQ_AIDING";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.UseFreqAiding.ToString());
     key = "TIME_TAG";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.TimeTag.ToString());
     key = "REF_CLOCK_INFO";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.RefClkInfo.ToString());
     key = "REL_FREQ_ACC";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.Accuracy.ToString());
     key = "SCALED_FREQ_OFFSET";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.ScaledFreqOffset.ToString());
     key = "EXT_CLOCK_SKEW";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.ExtClkSkewppm.ToString());
     key = "NORMIMAL_FREQ";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.NomFreq.ToString());
     key = "INCLUDE_NORM_FREQ";
     if (this.comm.AutoReplyCtrl.FreqTransferCtrl.IncludeNormFreq)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "FREQ_METHOD";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.FreqAidingMethod.ToString());
     key = "DEFAULT_FREQ_GUI_INDEX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.DefaultFreqIndex.ToString());
     key = "SPECIFIED_FREQ_GUI_INDEX";
     if (this.comm.AutoReplyCtrl.FreqTransferCtrl.SpecifiedRefFreq)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "SLC_REPORT_FREQ_GUI_INDEX";
     if (this.comm.AutoReplyCtrl.FreqTransferCtrl.SLCReportFreqGuiIndex)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "REF_CLOCK_REQUEST_GUI_INDEX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.RefClockRequestGuiIndex.ToString());
     key = "REF_CLOCK_ONOFF_GUI_INDEX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.RefClockOnOffGuiIndex.ToString());
     key = "EXT_REF_CLOCK_GUI_INDEX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.ExtRefClockGuiIndex.ToString());
     key = "SCALED_FREQ_OFFSET_GUI_INDEX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.ScaledFreqOffsetGuiIndex.ToString());
     key = "FREQ_ACC_USER_GUI";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.FreqAccUserSpecifiedGui.ToString());
     key = "FREQ_OFFSET_USER_GUI";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetUserSpecifiedGui.ToString());
     key = "FREQ_ACC_RX_GUI";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.FreqAccFromRxGui.ToString());
     key = "FREQ_OFFSET_RX_GUI";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.FreqTransferCtrl.FreqOffsetFromRxGui.ToString());
     key = "USE_TTB_FREQ";
     if (this.comm.AutoReplyCtrl.AutoReplyParams.UseTTB_ForFreqAid)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "IGNORE_XO";
     if (this.comm.AutoReplyCtrl.AutoReplyParams.FreqAidingIgnoreXO)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     section = "POSITION_AIDING";
     key = "REPLY";
     if (this.comm.AutoReplyCtrl.AutoReplyParams.AutoPosReq)
     {
         helper.IniWriteValue(section, key, "1");
     }
     else
     {
         helper.IniWriteValue(section, key, "0");
     }
     key = "NUM_FIXED";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.NumFixes.ToString());
     key = "TIME_BETWEEN_FIXES";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.TimeBtwFixes.ToString());
     key = "HOR_ERR_MAX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.HorrErrMax.ToString());
     key = "VERT_ERR_MAX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.VertErrMax.ToString());
     key = "RESP_TIME_MAX";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.RespTimeMax.ToString());
     key = "TIME_ACC_PRIORITY";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.TimeAccPriority.ToString());
     key = "LOC_METHOD";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.LocMethod.ToString());
     key = "EPH_SOURCE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.EphSource.ToString());
     key = "EPH_FILEPATH";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.EphFilePath.ToString());
     key = "EPH_REPLY";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.EphReply.ToString());
     key = "ACQ_ASSIST_SOURCE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.AcqAssistSource.ToString());
     key = "ACQ_ASSIST_REPLY";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.AcqAssistReply.ToString());
     key = "ACQ_ASSIST_FILEPATH";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.AcqDataFilePath.ToString());
     key = "ALM_SOURCE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.AlmSource.ToString());
     key = "ALM_REPLY";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.AlmReply.ToString());
     key = "NAVBIT_SOURCE";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.NavBitSource.ToString());
     key = "NAVBIT_REPLY";
     helper.IniWriteValue(section, key, this.comm.AutoReplyCtrl.PositionRequestCtrl.NavBitReply.ToString());
     this.Cursor = Cursors.Default;
 }