Example #1
0
        private IIndexMetadataRecord ToIndexMetadataRecord(IEtpAdapter etpAdapter, Channel entity, ChannelIndex indexChannel, int scale = 3)
        {
            var metadata = etpAdapter.CreateIndexMetadata(
                uri: indexChannel.GetUri(entity),
                isTimeIndex: indexChannel.IsTimeIndex(true),
                isIncreasing: indexChannel.IsIncreasing());

            metadata.Mnemonic    = indexChannel.Mnemonic;
            metadata.Description = indexChannel.Mnemonic;
            metadata.Uom         = Units.GetUnit(indexChannel.Uom);
            metadata.Scale       = scale;

            return(metadata);
        }
Example #2
0
 private IndexMetadataRecord ToIndexMetadataRecord(Channel entity, ChannelIndex indexChannel, int scale = 3)
 {
     return(new IndexMetadataRecord()
     {
         Uri = indexChannel.GetUri(entity),
         Mnemonic = indexChannel.Mnemonic,
         Description = indexChannel.Mnemonic,
         Uom = Units.GetUnit(indexChannel.Uom),
         Scale = scale,
         IndexType = indexChannel.IsTimeIndex(true)
             ? ChannelIndexTypes.Time
             : ChannelIndexTypes.Depth,
         Direction = indexChannel.IsIncreasing()
             ? IndexDirections.Increasing
             : IndexDirections.Decreasing,
         CustomData = new Dictionary <string, DataValue>(0),
     });
 }