Ejemplo n.º 1
0
        /// <summary>
        /// Convert Raptor data to the data to return from the Web API
        /// </summary>
        /// <param name="ms">Memory stream of data from Raptor</param>
        /// <param name="liftBuildSettings">Lift build settings from project settings used in the Raptor profile calculations</param>
        /// <returns>The profile data</returns>
        private CompactionProfileResult <CompactionProfileCell> ConvertProfileResult(MemoryStream ms, LiftBuildSettings liftBuildSettings)
        {
            log.LogDebug("Converting profile result");

            var pdsiProfile = new PDSProfile();
            var packager    = new TICProfileCellListPackager();

            packager.CellList = new TICProfileCellList();

            packager.ReadFromStream(ms);

            ms.Close();

            pdsiProfile.Assign(packager.CellList);

            pdsiProfile.GridDistanceBetweenProfilePoints = packager.GridDistanceBetweenProfilePoints;

            var profileCells = pdsiProfile.cells.Select(c => new ProfileCellData(
                                                            c.station,
                                                            c.interceptLength,
                                                            c.firstPassHeight,
                                                            c.lastPassHeight,
                                                            c.lowestPassHeight,
                                                            c.highestPassHeight,
                                                            c.compositeFirstPassHeight,
                                                            c.compositeLastPassHeight,
                                                            c.compositeLowestPassHeight,
                                                            c.compositeHighestPassHeight,
                                                            c.designHeight,
                                                            c.CCV,
                                                            c.TargetCCV,
                                                            c.CCVElev,
                                                            c.PrevCCV,
                                                            c.PrevTargetCCV,
                                                            c.MDP,
                                                            c.TargetMDP,
                                                            c.MDPElev,
                                                            c.materialTemperature,
                                                            c.materialTemperatureWarnMin,
                                                            c.materialTemperatureWarnMax,
                                                            c.materialTemperatureElev,
                                                            c.topLayerThickness,
                                                            c.topLayerPassCount,
                                                            c.topLayerPassCountTargetRange.Min,
                                                            c.topLayerPassCountTargetRange.Max,
                                                            c.cellMinSpeed,
                                                            c.cellMaxSpeed
                                                            )).ToList();

            return(ProcessProductionDataProfileCells(profileCells, pdsiProfile.GridDistanceBetweenProfilePoints, liftBuildSettings));
        }
Ejemplo n.º 2
0
        private static ProfileResult ConvertProfileResult(MemoryStream ms, Guid callID)
        {
            List <StationLLPoint> points = null;

            PDSProfile pdsiProfile = new PDSProfile();

            var packager = new TICProfileCellListPackager()
            {
                CellList = new TICProfileCellList()
            };

            packager.ReadFromStream(ms);

            ms.Close();

            pdsiProfile.Assign(packager.CellList);
            pdsiProfile.GridDistanceBetweenProfilePoints = packager.GridDistanceBetweenProfilePoints;

            if (packager.LatLongList != null) // For an alignment profile we return the lat long list to draw the profile line. slicer tool will just be a zero count
            {
                points = packager.LatLongList.ToList().ConvertAll(delegate(TWGS84StationPoint p)
                {
                    return(new StationLLPoint {
                        station = p.Station, lat = p.Lat * Coordinates.RADIANS_TO_DEGREES, lng = p.Lon * Coordinates.RADIANS_TO_DEGREES
                    });
                });
            }

            var profileCells = pdsiProfile.cells.Select(c => new ProfileCellData(
                                                            c.station,
                                                            c.interceptLength,
                                                            c.firstPassHeight,
                                                            c.lastPassHeight,
                                                            c.lowestPassHeight,
                                                            c.highestPassHeight,
                                                            c.compositeFirstPassHeight,
                                                            c.compositeLastPassHeight,
                                                            c.compositeLowestPassHeight,
                                                            c.compositeHighestPassHeight,
                                                            c.designHeight,
                                                            c.CCV,
                                                            c.TargetCCV,
                                                            c.CCVElev,
                                                            c.PrevCCV,
                                                            c.PrevTargetCCV,
                                                            c.MDP,
                                                            c.TargetMDP,
                                                            c.MDPElev,
                                                            c.materialTemperature,
                                                            c.materialTemperatureWarnMin,
                                                            c.materialTemperatureWarnMax,
                                                            c.materialTemperatureElev,
                                                            c.topLayerThickness,
                                                            c.topLayerPassCount,
                                                            c.topLayerPassCountTargetRange.Min,
                                                            c.topLayerPassCountTargetRange.Max,
                                                            c.cellMinSpeed,
                                                            c.cellMaxSpeed
                                                            )).ToList();

            var profile = ProcessProfileCells(profileCells, pdsiProfile.GridDistanceBetweenProfilePoints, callID);

            CheckForProductionDataPresence(profile, points);

            return(profile);
        }