/// <summary> /// Отправить архивный срез SCADA-Серверу /// </summary> public bool SendArchive(KPLogic.ParamSrez arcSrez) { bool result; SrezTableLight.Srez srez = ConvertSrez(arcSrez); return(srez == null || SendArchive(srez, out result) && result); }
/// <summary> /// Отправить текущий срез SCADA-Серверу /// </summary> public bool SendSrez(KPLogic.ParamSrez curSrez) { bool result; SrezTableLight.Srez srez = ConvertSrez(curSrez); return(srez == null || SendSrez(srez, out result) && result); }
/// <summary> /// Преобразовать среза параметров в срез входных каналов /// </summary> private SrezTableLight.Srez ConvertSrez(KPLogic.ParamSrez paramSrez) { List <int> bindedIndexes; int cnlCnt; if (paramSrez == null) { bindedIndexes = null; cnlCnt = 0; } else { bindedIndexes = paramSrez.GetBindedParamIndexes(); cnlCnt = bindedIndexes.Count; } if (cnlCnt == 0) { return(null); } else { SrezTableLight.Srez srez = new SrezTableLight.Srez(paramSrez.DateTime, cnlCnt); for (int i = 0; i < cnlCnt; i++) { int paramInd = bindedIndexes[i]; srez.CnlNums[i] = paramSrez.KPParams[paramInd].CnlNum; KPLogic.ParamData paramData = paramSrez.Data[paramInd]; SrezTableLight.CnlData cnlData = new SrezTableLight.CnlData(paramData.Val, paramData.Stat); srez.CnlData[i] = cnlData; } return(srez); } }