Esempio n. 1
0
        public override AddCoordinateSystemResponse Execute(AddCoordinateSystemArgument arg)
        {
            // Construct the function to be used
            var func = new AddCoordinateSystemComputeFunc();

            // Send the appropriate response to the caller
            return(Compute.Apply(func, arg));
        }
Esempio n. 2
0
        /// <summary>
        /// Executes the generic request by instantiating the required ComputeFunc and sending it to
        /// the compute projection on the grid as defined by the GridName and Role parameters in this request
        /// </summary>
        public override TResponse Execute(TArgument arg)
        {
            // Construct the function to be used
            var func = new TComputeFunc();

            // Send the request to the application service pool and retrieve the result
            // and return it to the caller
            return(Compute.Apply(func, arg));
        }
Esempio n. 3
0
 /// <summary>
 /// Processes a set of TAG files from a machine into a project synchronously
 /// </summary>
 public override ProcessTAGFileResponse Execute(ProcessTAGFileRequestArgument arg)
 {
     try
     {
         // Send the appropriate response to the caller
         return(Compute.Apply(func, arg));
     }
     catch (Exception e)
     {
         _log.LogError(e, $"Exception occurred during execution of {nameof(Execute)}");
         return(null);
     }
 }
Esempio n. 4
0
        public override IClientLeafSubGrid Execute(ISurfaceElevationPatchArgument arg)
        {
            var cachingSupported = arg.SurveyedSurfacePatchType != SurveyedSurfacePatchType.CompositeElevations && _cache != null;

            // Check the item is available in the cache
            if (cachingSupported && _cache?.Get(arg.OTGCellBottomLeftX, arg.OTGCellBottomLeftY) is IClientLeafSubGrid cacheResult)
            {
                return(_cache.ExtractFromCachedItem(cacheResult, arg.ProcessingMap, arg.SurveyedSurfacePatchType));
            }

            SubGridTreeBitmapSubGridBits savedMap = null;

            // Always request the full sub grid from the surveyed surface engine unless composite elevations are requested
            if (cachingSupported)
            {
                savedMap          = arg.ProcessingMap;
                arg.ProcessingMap = SubGridTreeBitmapSubGridBits.FullMask;
            }

            var subGridInvalidationVersion = cachingSupported ? _cache.InvalidationVersion : 0;

            IClientLeafSubGrid clientResult = null;
            var result = Compute.Apply(_computeFunc, arg);

            if (result?.Bytes != null)
            {
                clientResult = _clientLeafSubGridFactory.GetSubGrid(arg.SurveyedSurfacePatchType == SurveyedSurfacePatchType.CompositeElevations ? GridDataType.CompositeHeights : GridDataType.HeightAndTime);
                clientResult.FromBytes(result.Bytes);

                // For now, only cache non-composite elevation sub grids
                if (cachingSupported)
                {
                    _cache?.Add(clientResult, subGridInvalidationVersion);
                }

                if (savedMap != null)
                {
                    clientResult = _cache.ExtractFromCachedItem(clientResult, savedMap, arg.SurveyedSurfacePatchType);
                }
            }

            return(clientResult);
        }
Esempio n. 5
0
 /// <summary>
 /// Processes a set of TAG files from a machine into a project synchronously
 /// </summary>
 /// <param name="arg"></param>
 /// <returns></returns>
 public override SubmitTAGFileResponse Execute(SubmitTAGFileRequestArgument arg) => Compute.Apply(func, arg);
Esempio n. 6
0
 /// <summary>
 /// Processes an override event for a machine into a project synchronously
 /// </summary>
 public override OverrideEventResponse Execute(OverrideEventRequestArgument arg) => Compute.Apply(func, arg);