private static async Task WriteDataForTimeStreamAsync(IQiDataService data, List <AFValue> afValues, string streamId) { var dataList = afValues.Select(val => new PIQiTypes.TimeData() { Timestamp = val.Timestamp, Value = (DateTime)val.Value }).ToList(); await data.UpdateValuesAsync(streamId, dataList); }
private static async Task WriteDataForIntegerStreamAsync(IQiDataService data, List <AFValue> afValues, string streamId) { var dataList = new List <PIQiTypes.IntegerData>(); dataList.AddRange(afValues.Select(val => new PIQiTypes.IntegerData() { Timestamp = val.Timestamp, Value = val.ValueAsInt32() })); await data.UpdateValuesAsync(streamId, dataList); }