예제 #1
0
        private FJobResult GetResultFromSubJob(int jobId, PointInt position, SubJobResult subJobResult)
        {
            MqMessages.PointInt resultPos = new MqMessages.PointInt(
                position.X() * FGenerator.BLOCK_WIDTH,
                position.Y() * FGenerator.BLOCK_HEIGHT
                );

            MqMessages.SizeInt      resultSize = new MqMessages.SizeInt(FGenerator.BLOCK_WIDTH, FGenerator.BLOCK_HEIGHT);
            MqMessages.RectangleInt area       = new MqMessages.RectangleInt(resultPos, resultSize);

            FJobResult fJobResult = new FJobResult(jobId, area, subJobResult.Counts);

            return(fJobResult);
        }
예제 #2
0
        private void ProcessSubJob(JobProcessor2 jobProcessor, PointInt position, string requestMsgId, MessageQueue outQ)
        {
            int jobId = jobProcessor.FGenJob.JobId;

            //int w = jobProcessor.FGenJob.Area.W();

            //uint[] counts = jobProcessor.GetCountsForLine(linePtr);

            SubJobResult subJobResult = jobProcessor.GetEmptySubJobResult();

            jobProcessor.FillCountsForBlock(position, subJobResult);
            //Debug.WriteLine(ReportSampleOfCounts(subJobResult.Counts));

            FJobResult fJobResult = GetResultFromSubJob(jobId, position, subJobResult);

            Message r = new Message(fJobResult)
            {
                CorrelationId = requestMsgId
            };

            Console.WriteLine($"Sending a response message with corId = {FMsgId(requestMsgId)}, instance:{jobProcessor.InstanceNum}.");
            outQ.Send(r);
        }