コード例 #1
0
        private protected EarthGridDefinition(BufferedBinaryReader reader) : base(reader)
        {
            EarthShapeCode = reader.ReadUInt8();

            EarthRadius    = reader.ReadScaledValue();
            EarthMajorAxis = reader.ReadScaledValue();
            EarthMinorAxis = reader.ReadScaledValue();

            EarthShape = ComputeEarthShape();
        }
コード例 #2
0
        internal ProductDefinition0000(BufferedBinaryReader reader, Discipline discipline) : base(
                reader, discipline)
        {
            GeneratingProcessIdentifier = reader.ReadUInt8();
            HoursAfter              = reader.ReadUInt16();
            MinutesAfter            = reader.ReadUInt8();
            ObservationalDataCutoff = TimeSpan.FromHours(HoursAfter) + TimeSpan.FromMinutes(MinutesAfter);
            TimeRangeUnit           = (TimeRangeUnit)reader.ReadUInt8();
            ForecastTime            = reader.ReadInt32();

            FirstFixedSurfaceType  = (FixedSurfaceType)reader.ReadUInt8();
            FirstFixedSurfaceValue = reader.ReadScaledValue();

            SecondFixedSurfaceType  = (FixedSurfaceType)reader.ReadUInt8();
            SecondFixedSurfaceValue = reader.ReadScaledValue();

            RegisterContent(ProductDefinitionContent.GeneratingProcessId, () => GeneratingProcessIdentifier);
            RegisterContent(ProductDefinitionContent.ObservationalDataCutoff, () => ObservationalDataCutoff);
            var forecastTime = CalculateTimeRangeFrom(TimeRangeUnit, ForecastTime);

            if (forecastTime.HasValue)
            {
                RegisterContent(ProductDefinitionContent.ForecastTime, () => forecastTime.Value);
            }

            RegisterContent(ProductDefinitionContent.FirstFixedSurfaceType, () => FirstFixedSurfaceType);
            if (FirstFixedSurfaceValue.HasValue)
            {
                RegisterContent(ProductDefinitionContent.FirstFixedSurfaceValue, () => FirstFixedSurfaceValue.Value);
            }
            RegisterContent(ProductDefinitionContent.SecondFixedSurfaceType, () => SecondFixedSurfaceType);
            if (SecondFixedSurfaceValue.HasValue)
            {
                RegisterContent(ProductDefinitionContent.SecondFixedSurfaceValue, () => SecondFixedSurfaceValue.Value);
            }
        }