Example #1
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 #2
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);
             }
         }
     }
 }
Example #3
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 #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
 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 #6
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 #7
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 #8
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 #9
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);
                     }
                 }
             }
         }
     }
 }