예제 #1
0
 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);
 }
예제 #2
0
        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);
        }