/// <summary> /// 获取参数表数据转换成ListParaData /// </summary> /// <returns></returns> public static List <ParaData> GetListParaData() { List <ParaData> lstPara = null; if (PubSyswareCom.IsRuntimeServerStarted()) { //获取参数的值 object obj = null; PubSyswareCom.GetParameterNames(string.Empty, ref obj); //转换为字符串数组 if (obj is Object[]) { lstPara = new List <ParaData>(); object[] objName = obj as Object[]; for (int i = 0; i < objName.Count(); i++) { Object objValue = null; PubSyswareCom.mGetParameter(string.Empty, objName[i].ToString(), ref objValue); if (objValue != null) { //参数 if (objName[i].ToString() != "weightData" && objName[i].ToString() != "coreEnvelopeData") { ParaData data = new ParaData(); data.paraName = objName[i].ToString(); try { data.paraValue = Convert.ToDouble(objValue.ToString()); } catch (Exception e) { data.paraValue = 0; XLog.Write(e.Message); } lstPara.Add(data); } } } } } else { MessageBox.Show("TDE/IDE 没有启动成功"); } return(lstPara); }
/// <summary> /// 获取参数表数据转换成ListParaData /// </summary> /// <returns></returns> public static List <ParaData> GetListParaData() { List <ParaData> lstPara = null; if (PubSyswareCom.IsRuntimeServerStarted()) { //获取参数的值 object obj = null; PubSyswareCom.GetParameterNames(string.Empty, ref obj); //转换为字符串数组 if (obj is Object[]) { lstPara = new List <ParaData>(); object[] objName = obj as Object[]; for (int i = 0; i < objName.Count(); i++) { Object objValue = null; PubSyswareCom.mGetParameter(string.Empty, objName[i].ToString(), ref objValue); if (objValue != null) { //参数 if (objName[i].ToString() != "weightData" && objName[i].ToString() != "coreEnvelopeData") { ParaData data = new ParaData(); data.paraName = objName[i].ToString(); data.paraValue = Convert.ToDouble(objValue.ToString()); lstPara.Add(data); } } } } } return(lstPara); }