AgGateway.ADAPT.ISOv4Plugin.ImportMappers.LogMappers.BinaryReader.CreateSpatialValue C# (CSharp) Method

CreateSpatialValue() private static method

private static CreateSpatialValue ( TIM tim, byte order, int value ) : SpatialValue
tim AgGateway.ADAPT.ISOv4Plugin.Models.TIM
order byte
value int
return SpatialValue
        private static SpatialValue CreateSpatialValue(TIM tim, byte order, int value)
        {
            var dlvs = tim.Items.Where(x => x.GetType() == typeof (DLV));
            var matchingDlv = dlvs.ElementAtOrDefault(order) as DLV;

            if (matchingDlv == null)
                return null;

            var ddis = DdiLoader.Ddis;

            var resolution = 1d;
            if (matchingDlv.A != null && ddis.ContainsKey(Convert.ToInt32(matchingDlv.A, 16)))
                resolution = ddis[Convert.ToInt32(matchingDlv.A, 16)].Resolution;

            var spatialValue = new SpatialValue
            {
                Id = order,
                Dlv = matchingDlv,
                Value = value * resolution,
            };

            return spatialValue;
        }