public IChannelMetadataRecord ToChannelMetadataRecord(IChannelMetadataRecord channelMetadata, IIndexMetadataRecord indexMetadata) { var uri = GetChannelUri(channelMetadata.ChannelName); var channel = new ChannelMetadataRecord { ChannelUri = uri, ContentType = uri.ContentType, ChannelId = channelMetadata.ChannelId, ChannelName = channelMetadata.ChannelName, Uom = channelMetadata.Uom, MeasureClass = channelMetadata.MeasureClass, DataType = channelMetadata.DataType, Description = channelMetadata.Description, Uuid = channelMetadata.Uuid, Status = (ChannelStatuses)channelMetadata.Status, Source = channelMetadata.Source, Indexes = new[] { indexMetadata } .OfType <IndexMetadataRecord>() .ToList(), CustomData = new Dictionary <string, DataValue>() }; return(channel); }
private LogCurveInfo ToLogCurveInfo(IChannelMetadataRecord channel) { return(new LogCurveInfo() { Mnemonic = channel.ChannelName, Unit = channel.Uom, CurveDescription = channel.Description, TypeLogData = LogDataType.@double, }); }
private ChannelStreamingInfo ToChannelStreamingInfo(IChannelMetadataRecord channel, bool receiveChangeNotification, object startIndex) { return(new ChannelStreamingInfo { ChannelId = channel.ChannelId, StartIndex = new StreamingStartIndex { Item = startIndex }, ReceiveChangeNotification = receiveChangeNotification }); }
private ChannelSubscribeInfo ToChannelSubscribeInfo(IChannelMetadataRecord channel, object lastIndex = null, bool infill = true, bool dataChanges = true) { return(new ChannelSubscribeInfo { ChannelId = channel.ChannelId, LastIndex = new IndexValue { Item = lastIndex }, Infill = infill, DataChanges = dataChanges }); }
private LogCurveInfo ToLogCurveInfo(IChannelMetadataRecord channel) { return(new LogCurveInfo { Mnemonic = new ShortNameStruct(channel.ChannelName), Uid = channel.ChannelName, Unit = channel.Uom, CurveDescription = string.IsNullOrWhiteSpace(channel.Description) ? channel.ChannelName : channel.Description, TypeLogData = LogDataType.@double }); }
private LogCurveInfo ToLogCurveInfo(IChannelMetadataRecord channel) { return(new LogCurveInfo() { Uid = channel.Uuid, Mnemonic = channel.ChannelName, Unit = string.IsNullOrEmpty(channel.Uom) ? "unitless" : channel.Uom, CurveDescription = string.IsNullOrWhiteSpace(channel.Description) ? channel.ChannelName : channel.Description, TypeLogData = LogDataType.@double, ColumnIndex = (short?)channel.ChannelId }); }
public IIndexMetadataRecord ToIndexMetadataRecord(IChannelMetadataRecord channelMetadata, int scale = 3) { return(new IndexMetadataRecord { Uri = GetChannelUri(channelMetadata.ChannelName), Mnemonic = channelMetadata.ChannelName, Description = channelMetadata.Description, Uom = channelMetadata.Uom, Scale = scale, IndexType = Model.LogIndexType == LogIndexType.datetime || Model.LogIndexType == LogIndexType.elapsedtime ? ChannelIndexTypes.Time : ChannelIndexTypes.Depth, Direction = IndexDirections.Increasing, CustomData = new Dictionary <string, DataValue>(0) }); }
/// <summary> /// Initializes a new instance of the <see cref="ChannelMetadataViewModel"/> class. /// </summary> /// <param name="record">The record.</param> public ChannelMetadataViewModel(IChannelMetadataRecord record) { Record = record; }