/// <summary> /// 获取支路包含的所有参数 /// </summary> /// <param name="buildId"></param> /// <param name="energyCode"></param> /// <param name="circuitID"></param> /// <returns></returns> public HistoryParamViewModel GetViewModel(string buildId, string energyCode, string circuitID) { //List<ParamClassify> paramClassifyList = context.GetMeterParamClassify(buildId, circuitID); List <MeterParam> meterParamList = context.GetMeterParam(buildId, circuitID); HistoryParamViewModel viewMode = new HistoryParamViewModel(); viewMode.MeterParam = meterParamList; return(viewMode); }
/// <summary> /// 获取支路包含的所有参数 /// </summary> /// <param name="buildId"></param> /// <param name="energyCode"></param> /// <param name="circuitID"></param> /// <returns></returns> public HistoryParamViewModel GetViewModel(string buildId, string circuitID) { List <MeterParam> meterParamList = context.GetMeterParam(buildId, circuitID); string startTime = DateTime.Now.ToString("yyyy-MM-dd"); //获取仪表参数ID,并传入GetParamValue中获取其数据 List <string> paramIDs = new List <string>();; foreach (var pID in meterParamList) { paramIDs.Add(pID.ParamID); } List <HistoryParameterValue> parameterValue = context.GetParamValue(circuitID, paramIDs.ToArray(), startTime, 5); HistoryParamViewModel viewMode = new HistoryParamViewModel(); //viewMode.MeterParam = meterParamList; viewMode.Data = parameterValue; return(viewMode); }