Example #1
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 #2
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 #3
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 #4
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 #5
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);
                     }
                 }
             }
         }
     }
 }