public UInt32 Map(EnumeratedWorkingData currentMeter, List <WorkingData> meters, SpatialRecord spatialRecord)
        {
            var ddi     = _representationMapper.Map(currentMeter.Representation);
            var creator = _enumeratedMeterFactory.GetMeterCreator(ddi.GetValueOrDefault());

            //The intent of the meters parameter below is to send in those meters that reconcile to a single DLV.
            //Since we are not exporting condensed DDIS at this time, just passing in the collection.
            return(creator.GetMetersValue(meters, spatialRecord));
        }
Esempio n. 2
0
        private double GetResolution(NumericRepresentationValue value)
        {
            var ddi        = _representationMapper.Map(value.Representation);
            var resolution = 1d;

            if (_ddis.ContainsKey(ddi.GetValueOrDefault()))
            {
                resolution = _ddis[ddi.GetValueOrDefault()].Resolution;
            }
            return(resolution);
        }
Esempio n. 3
0
        private NumericWorkingData MapNumericMeter(DLV dlv, int sectionId, int order)
        {
            var meter = new NumericWorkingData
            {
                UnitOfMeasure      = _representationMapper.GetUnitForDdi(Convert.ToInt32(dlv.A, 16)),
                DeviceElementUseId = sectionId,
                Representation     = _representationMapper.Map(Convert.ToInt32(dlv.A, 16))
            };

            meter.Id.UniqueIds.Add(_uniqueIdMapper.Map("DLV" + order));
            return(meter);
        }
Esempio n. 4
0
        public UInt32 Map(ISOEnumeratedMeter currentMeter, List <WorkingData> meters, SpatialRecord spatialRecord)
        {
            var matchingMeters = meters.Where(x => x.Id.FindIntIsoId() == currentMeter.Id.FindIntIsoId()).ToList();
            var ddi            = _representationMapper.Map(currentMeter.Representation);

            if (ddi == 141 && currentMeter.DeviceElementUseId != 0)
            {
                ddi = 161;
            }

            var creator = _enumeratedMeterFactory.GetMeterCreator(ddi.GetValueOrDefault());

            return(creator.GetMetersValue(matchingMeters, spatialRecord));
        }
Esempio n. 5
0
        public DLV Map(WorkingData meter)
        {
            var representation = _representationMapper.Map(meter.Representation);

            var dlv = new DLV();

            if (representation == null)
            {
                dlv.A = null;
            }
            else
            {
                if (meter.Representation != null && meter.Representation.Code == "dtRecordingStatus" && meter.DeviceElementUseId != 0)
                {
                    dlv.A = "161";
                }
                else
                {
                    dlv.A = representation.ToString();
                }
            }

            return(dlv);
        }