//SQL数据库返回结果类型转换:由IDataReader转持久化类数据集 private static List <PSLCalcuItem> IDataReader2PSLCalcuItems(IDataReader reader) { List <PSLCalcuItem> items = new List <PSLCalcuItem>(); while (reader.Read()) { PSLCalcuItem item = new PSLCalcuItem(); DAOSupport.ReaderToObject(reader, item); items.Add(item); } return(items); }
//SQL数据库返回结果类型转换:由IDataReader转持久化类数据集 private static List <OPCTagIdMap> IDataReader2OPCTagIdMap(IDataReader reader) { List <OPCTagIdMap> items = new List <OPCTagIdMap>(); while (reader.Read()) { OPCTagIdMap item = new OPCTagIdMap(); DAOSupport.ReaderToObject(reader, item); items.Add(item); } return(items); }
//读取OPC表数据,返回起止时刻间的原值,返回起止时刻点的前值(或插值) #endregion #region 辅助函数 //SQL数据库返回结果类型转换:由IDataReader转持久化类数据集 private static List <OPCDataItem> IDataReader2OPCDataItems_old(IDataReader reader) { List <OPCDataItem> items = new List <OPCDataItem>(); while (reader.Read()) { OPCDataItem item = new OPCDataItem(); DAOSupport.ReaderToObject(reader, item); items.Add(item); } return(items); }
//SQL数据库返回结果类型转换:由IDataReader转持久化类数据集 private static string[][] IDataReader2string(IDataReader reader) { List <PSLTimeRecord> items = new List <PSLTimeRecord>(); while (reader.Read()) { PSLTimeRecord item = new PSLTimeRecord(); DAOSupport.ReaderToObject(reader, item); items.Add(item); } string[][] results = new string[items.Count + 1][]; results[0] = new string[22] { "算法名称", "起始时间", "起始时间ms", "反射前", "反射前ms", "过滤前", "过滤前ms", "计算前", "计算前ms", "写结果", "写结果前", "更新信息前", "更新信息前ms", "结束时间", "结束时间ms", "读时间", "反射时间", "过滤时间", "计算时间", "写结果时间", "更新界面时间", "总时间" }; for (int i = 0; i < items.Count; i++) { results[i + 1] = new string[22]; results[i + 1][0] = items[i].modulename; results[i + 1][1] = items[i].beforereaddata.ToString(); results[i + 1][2] = items[i].beforereaddatams.ToString(); results[i + 1][3] = items[i].beforereflection.ToString(); results[i + 1][4] = items[i].beforereflectionms.ToString(); results[i + 1][5] = items[i].beforefilter.ToString(); results[i + 1][6] = items[i].beforefilterms.ToString(); results[i + 1][7] = items[i].beforecalcu.ToString(); results[i + 1][8] = items[i].beforecalcums.ToString(); results[i + 1][9] = items[i].beforewritedata.ToString(); results[i + 1][10] = items[i].beforewritedatams.ToString(); results[i + 1][11] = items[i].beforeupdatecalcuInfo.ToString(); results[i + 1][12] = items[i].beforeupdatecalcuInfoms.ToString(); results[i + 1][13] = items[i].endcurrent.ToString(); results[i + 1][14] = items[i].endcurrentms.ToString(); results[i + 1][15] = items[i].readspan.ToString(); results[i + 1][16] = items[i].reflectionspan.ToString(); results[i + 1][17] = items[i].filterspan.ToString(); results[i + 1][18] = items[i].calcuspan.ToString(); results[i + 1][19] = items[i].writespan.ToString(); results[i + 1][20] = items[i].updatespan.ToString(); results[i + 1][21] = items[i].totalspan.ToString(); } return(results); }