public ISubSystemData ConvertXls(XlsTable[] xlsTables) { PredictionSystemData predictionData = new PredictionSystemData(); IEventViewService eventViewService = this.m_AppContext.Lookup(typeof(IEventViewService).FullName) as IEventViewService; foreach (XlsTable table in xlsTables) { if (table.TableName == LTEPredictionResource.PREDICTION_TABLE_NAME) { XLSPredictionDataExportTool.PredictionTableToData(predictionData, table, eventViewService); this.PredictionTableToData(predictionData, table, eventViewService); } } return predictionData; }
private void SetTreeState(PredictionSystemData psd, TreeNode rootNode, string nodename) { foreach (TreeNode node in rootNode.Nodes) { string str = nodename + node.Text; if ((node.Level == 3) && (nodename.Contains("PDSCH MCS") || nodename.Contains("PUSCH MCS"))) { str = str + node.Tag.ToString(); } this.m_PredictionResultManager.NodeCheckEvent(node, psd.PredictionTreeState[str] != 1); node.StateImageIndex = psd.PredictionTreeState[str]; this.SetTreeState(psd, node, str); } }
private void SaveTreeState(PredictionSystemData psd, TreeNode rootNode, string nodename) { foreach (TreeNode node in rootNode.Nodes) { string key = nodename + node.Text; if ((node.Level == 3) && (nodename.Contains("PDSCH MCS") || nodename.Contains("PUSCH MCS"))) { key = key + node.Tag.ToString(); } psd.PredictionTreeState.Add(key, node.StateImageIndex); this.SaveTreeState(psd, node, key); } }
public ISubSystemData Serialize() { PredictionSystemData psd = new PredictionSystemData(); psd.PredictionConfig = this.m_PredictionGroupsManager.PredictionConfigTemplate; psd.PredictionGroupList = this.m_PredictionGroupsManager.PredictionGroups; psd.RootNodeState = this.m_PredictionGroupsManager.RootNode.StateImageIndex; psd.NeedShowIndex = this.m_PredictionGroupsManager.PredictionLegendManagement.m_needShowIndexdic; this.SaveTreeState(psd, this.m_PredictionGroupsManager.RootNode, string.Empty); return psd; }
private void PredictionTableToData(PredictionSystemData predictionData, XlsTable xTable, IEventViewService eventViewService) { PredictionConfig config = new PredictionConfig(); for (int i = 0; i < xTable.Data.Rows.Count; i++) { DataRow row = xTable.Data.Rows[i]; try { config.Resolution = float.Parse(row["Default Resolution(m)"].ToString()); config.UEHeight = float.Parse(row["Receiver Height(m)"].ToString()); } catch (Exception exception) { eventViewService.WriteLog(string.Format(LTEPredictionResource.PREDICTION_TABLE_CONVERT_FAIL, Convert.ToString((int) (i + 1))), Huawei.UNet.Frame.Interface.LogLevel.Warning); WriteLog.Logger.Error(exception.StackTrace); config = null; } } predictionData.PredictionConfig = config; }