Esempio n. 1
0
        /// <summary>
        /// Default no-args constructor that initializes internal state to 'null';
        /// </summary>
        public ProfileCell()
        {
            Layers = new ProfileLayers();

            CellLowestElev           = Consts.NullHeight;
            CellHighestElev          = Consts.NullHeight;
            CellLastElev             = Consts.NullHeight;
            CellFirstElev            = Consts.NullHeight;
            CellLowestCompositeElev  = Consts.NullHeight;
            CellHighestCompositeElev = Consts.NullHeight;
            CellLastCompositeElev    = Consts.NullHeight;
            CellFirstCompositeElev   = Consts.NullHeight;
            DesignElev = Consts.NullHeight;

            CellMaterialTemperature     = CellPassConsts.NullMaterialTemperatureValue;
            CellMaterialTemperatureElev = Consts.NullHeight;

            AttributeExistenceFlags = ProfileCellAttributeExistenceFlags.None;

            CellMaxSpeed = 0;
            CellMinSpeed = CellPassConsts.NullMachineSpeed;

            CellCCV                       = CellPassConsts.NullCCV;
            CellCCVElev                   = Consts.NullHeight;
            CellTargetCCV                 = CellPassConsts.NullCCV;
            CellPreviousMeasuredCCV       = CellPassConsts.NullCCV;
            CellPreviousMeasuredTargetCCV = CellPassConsts.NullCCV;

            CellCCA       = CellPassConsts.NullCCA;
            CellCCAElev   = Consts.NullHeight;
            CellTargetCCA = CellPassConsts.NullCCA;

            CellMDP       = CellPassConsts.NullMDP;
            CellMDPElev   = Consts.NullHeight;
            CellTargetMDP = CellPassConsts.NullMDP;
        }
Esempio n. 2
0
        /// <summary>
        /// Serializes content from the writer
        /// </summary>
        public override void InternalFromBinary(IBinaryRawReader reader)
        {
            base.InternalFromBinary(reader);

            var version = VersionSerializationHelper.CheckVersionByte(reader, VERSION_NUMBER);

            if (version == 1)
            {
                Layers = new ProfileLayers();
                var numberOfLayers = reader.ReadInt();

                for (var i = 1; i <= numberOfLayers; i++)
                {
                    var layer = new ProfileLayer(this);
                    layer.FromBinary(reader);

                    Layers.Add(layer, -1);
                }

                CellLowestElev           = reader.ReadFloat();
                CellHighestElev          = reader.ReadFloat();
                CellLastElev             = reader.ReadFloat();
                CellFirstElev            = reader.ReadFloat();
                CellLowestCompositeElev  = reader.ReadFloat();
                CellHighestCompositeElev = reader.ReadFloat();
                CellLastCompositeElev    = reader.ReadFloat();
                CellFirstCompositeElev   = reader.ReadFloat();

                CellCCV                       = reader.ReadShort();
                CellTargetCCV                 = reader.ReadShort();
                CellPreviousMeasuredCCV       = reader.ReadShort();
                CellPreviousMeasuredTargetCCV = reader.ReadShort();

                CellCCVElev = reader.ReadFloat();

                CellMDP       = reader.ReadShort();
                CellTargetMDP = reader.ReadShort();
                CellMDPElev   = reader.ReadFloat();

                CellCCA       = reader.ReadByte();
                CellTargetCCA = reader.ReadShort();
                CellCCAElev   = reader.ReadFloat();

                CellTopLayerThickness  = reader.ReadFloat();
                IncludesProductionData = reader.ReadBoolean();

                TopLayerPassCount = (ushort)reader.ReadInt();
                TopLayerPassCountTargetRangeMin = (ushort)reader.ReadInt();
                TopLayerPassCountTargetRangeMax = (ushort)reader.ReadInt();

                CellMaxSpeed = (ushort)reader.ReadInt();
                CellMinSpeed = (ushort)reader.ReadInt();

                (Passes ?? (Passes = new FilteredMultiplePassInfo())).FromBinary(reader);

                FilteredPassFlags       = reader.ReadBooleanArray();
                FilteredPassCount       = reader.ReadInt();
                FilteredHalfPassCount   = reader.ReadInt();
                AttributeExistenceFlags = (ProfileCellAttributeExistenceFlags)reader.ReadInt();

                CellMaterialTemperature        = (ushort)reader.ReadInt();
                CellMaterialTemperatureWarnMin = (ushort)reader.ReadInt();
                CellMaterialTemperatureWarnMax = (ushort)reader.ReadInt();

                CellMaterialTemperatureElev = reader.ReadFloat();
            }
        }