예제 #1
0
 public List<Demodulation> GetDlSinrListByUe(ISimulationUser user)
 {
     if (this._mcsInstance != null)
     {
         SimulationUser user2 = user as SimulationUser;
         int txNum = SimulationTools.GetTxNum(user2.BestServiceCarrier);
         Terminal terminal = user.LTEUser.Terminal;
         LTETerminal terminal2 = terminal.NetTerminalList[0] as LTETerminal;
         LTEService service2 = SimulationTools.GetUnionPsService(user.LTEUser.Service).PSServiceDic[NetWorkType.LTE] as LTEService;
         Mobility mobility = user.LTEUser.Mobility;
         MIMO mimo = this._mcsInstance.GetMIMO(txNum, terminal2.RxAntNumber, user2.IsSmSupported);
         return this._mcsInstance.GetDemodulation(terminal.Reception, mobility, mimo, service2.DLBLER);
     }
     GlobalParameter parameter = GlobalParameter.getInstance();
     List<Demodulation> list = new List<Demodulation>();
     float[] dlTargetSinrSFBC = parameter.m_DlTargetSinrSFBC;
     for (int i = 0; i < dlTargetSinrSFBC.Length; i++)
     {
         Demodulation item = new Demodulation();
         item.Sinr = dlTargetSinrSFBC[i];
         item.McsIndex = i + 1;
         list.Add(item);
     }
     return list;
 }
예제 #2
0
 private bool ImportData(bool isUpdate, DataTable dt, out string failedMsg)
 {
     failedMsg = string.Empty;
     this.m_tempList.Clear();
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         if (!this.importDataValidate(dt, i, ref failedMsg))
         {
             object obj2 = failedMsg;
             failedMsg = string.Concat(new object[] { obj2, "(Row=", i + 2, ")" });
             return false;
         }
         Demodulation item = new Demodulation();
         item.McsIndex = int.Parse(dt.Rows[i][0].ToString());
         item.Sinr = float.Parse(dt.Rows[i][1].ToString());
         this.m_tempList.Add(item);
     }
     return true;
 }
예제 #3
0
 private bool GetPastValidate(ref string info, ref Demodulation newDemodulation, int rowIndex, int startColumsIndex, string[] pastValue)
 {
     DataRow copyRow;
     DataTable dataTable = this.InitDataTable();
     bool flag = false;
     if (rowIndex > (this.dataGridView1.Rows.Count - 2))
     {
         copyRow = this.GetCopyDataToNewRow(rowIndex, startColumsIndex, dataTable, pastValue);
         flag = !this.GetMCSIndexForNewRow(ref info, copyRow) || !this.ValidateRowValue(copyRow, ref newDemodulation, ref info);
     }
     else
     {
         copyRow = this.GetCopyDataToOldRow(rowIndex, startColumsIndex, dataTable, pastValue);
         flag = !this.IsMCSIndexValueFair(ref info, rowIndex, copyRow) || !this.ValidateRowValue(copyRow, ref newDemodulation, ref info);
     }
     if (flag)
     {
         this.dataGridView1.Rows.Clear();
         this.Init();
         this.showPanle();
         MessageBox.Show(info, "Warning", MessageBoxButtons.OK);
         return false;
     }
     return true;
 }
예제 #4
0
 private void CopyClipboard()
 {
     IDataObject dataObject = Clipboard.GetDataObject();
     if (dataObject.GetDataPresent(DataFormats.Text))
     {
         string txt = (string) dataObject.GetData(DataFormats.Text);
         string[][] textArray = null;
         textArray = this.TryParse(txt);
         if (textArray != null)
         {
             int startRowIndex = this.dataGridView1.SelectedCells[0].RowIndex;
             int startColumsIndex = this.dataGridView1.SelectedCells[0].ColumnIndex;
             for (int i = 0; i < this.dataGridView1.SelectedCells.Count; i++)
             {
                 this.GetRowStartIndex(ref startRowIndex, i);
                 this.GetColumsStartIndex(ref startColumsIndex, i);
             }
             int rowIndex = startRowIndex;
             for (int j = 0; j < textArray.Length; j++)
             {
                 string info = "";
                 Demodulation newDemodulation = new Demodulation();
                 if (!this.GetPastValidate(ref info, ref newDemodulation, rowIndex, startColumsIndex, textArray[j]))
                 {
                     this.dataGridView1.Rows.Clear();
                     this.Init();
                     this.showPanle();
                     return;
                 }
                 bool isNew = rowIndex >= (this.dataGridView1.Rows.Count - 1);
                 this.UpdataSINR(isNew, newDemodulation, rowIndex);
                 rowIndex++;
             }
             this.dataGridView1.Rows.Clear();
             this.Init();
             this.showPanle();
         }
     }
 }
예제 #5
0
 private int CompareSINR(Demodulation a, Demodulation b)
 {
     int num = a.Sinr.CompareTo(b.Sinr);
     if (num == 0)
     {
         return a.McsIndex.CompareTo(b.McsIndex);
     }
     return num;
 }
예제 #6
0
 private bool ValidateRowValue(DataRow row, ref Demodulation demodulation, ref string info)
 {
     bool flag = true;
     flag &= this.CheckMcsIndexFair(row, ref info);
     flag &= this.CheckSINRNull(row, ref info);
     flag &= this.CheckSINRFair(row, ref info);
     if (flag)
     {
         demodulation.McsIndex = Convert.ToInt32(row["mcsIndex"]);
         demodulation.Sinr = float.Parse(row["sinr"].ToString());
     }
     return flag;
 }
예제 #7
0
 private void UpdateList()
 {
     this.m_tempList.Clear();
     for (int i = 0; i < (this.dataGridView1.Rows.Count - 1); i++)
     {
         Demodulation item = new Demodulation();
         item.McsIndex = int.Parse(this.dataGridView1.Rows[i].Cells["mcsIndex"].Value.ToString());
         item.Sinr = float.Parse(this.dataGridView1.Rows[i].Cells["sinr"].Value.ToString());
         this.m_tempList.Add(item);
     }
 }
예제 #8
0
 private void UpdataSINR(bool isNew, Demodulation newDemodulation, int rowIndex)
 {
     if (isNew)
     {
         this.m_tempList.Add(newDemodulation);
     }
     else
     {
         int mcsIndex = int.Parse(this.dataGridView1.Rows[rowIndex].Cells["mcsIndex"].Value.ToString());
         int num = this.m_tempList.FindIndex(delegate (Demodulation demo) {
             return demo.McsIndex.Equals(mcsIndex);
         });
         this.m_tempList[num] = newDemodulation;
     }
 }
예제 #9
0
 protected List<Demodulation> GetDemodulationList(string p_strMCS)
 {
     List<Demodulation> list = new List<Demodulation>();
     string str = p_strMCS;
     char[] separator = new char[] { ' ' };
     string[] strArray = str.Split(separator);
     for (int i = 0; i < (strArray.Length / 2); i++)
     {
         Demodulation item = new Demodulation();
         item.McsIndex = int.Parse(strArray[i * 2]);
         item.Sinr = float.Parse(strArray[(i * 2) + 1]);
         list.Add(item);
     }
     return list;
 }