Ejemplo n.º 1
0
        private JobProcessor2 CreateJobProcessor(FJobRequest fJobRequest, int instanceNum)
        {
            FGenJob       job    = CreateJob(fJobRequest);
            JobProcessor2 result = new JobProcessor2(job, instanceNum);

            return(result);
        }
Ejemplo n.º 2
0
        public Job(FJobRequest fJobRequest, string requestMsgId)
        {
            FJobRequest  = fJobRequest;
            RequestMsgId = requestMsgId;

            FGenJob fGenJob = BuildFGenJob(fJobRequest);

            FGenerator = new FGenerator(fGenJob);

            //_position = new KPoint(fJobRequest.Area.Point.X * FGenerator.BLOCK_WIDTH, fJobRequest.Area.Point.Y * FGenerator.BLOCK_HEIGHT);
            _position = new KPoint(fJobRequest.Area.Point.X, fJobRequest.Area.Point.Y);

            _subJobIterator = new SubJobIterator(this);
            ResetSubJobsRemainingToBeSent();

            _closed = false;

            Debug.WriteLine($"Creating new Repo. Name: {Name}, JobId: {JobId}.");
            _countsRepo = new ValueRecords <KPoint, SubJobResult>(Name);
            ReportRepoContents();

            //Debug.WriteLine($"Starting to get histogram for {Name} at {DateTime.Now.ToString(DiagTimeFormat)}.");
            //Dictionary<int, int> h = GetHistogram();
            //Debug.WriteLine($"Histogram complete for {Name} at {DateTime.Now.ToString(DiagTimeFormat)}.");
        }
Ejemplo n.º 3
0
        public void TestGetXCounts()
        {
            FGenJob    fjob       = CreateJob();
            FGenerator fGenerator = new FGenerator(fjob);

            for (int j = 0; j < 100; j++)
            {
                System.Diagnostics.Debug.WriteLine($"y: {j}:");

                UInt32[] counts = fGenerator.GetXCounts(j);
            }
        }
Ejemplo n.º 4
0
        private FGenJob CreateJob()
        {
            PointDd start = new PointDd(new Dd(-2), new Dd(-1));
            PointDd end   = new PointDd(new Dd(1), new Dd(1));

            SizeInt samplePoints  = new SizeInt(FGenerator.BLOCK_WIDTH, FGenerator.BLOCK_HEIGHT);
            uint    maxIterations = 300;

            RectangleInt area = new RectangleInt(new PointInt(0, 0), samplePoints);

            FGenJob fGenJob = new FGenJob(42, start, end, samplePoints, maxIterations, area);

            return(fGenJob);
        }
Ejemplo n.º 5
0
        private FGenJob CreateJob(FJobRequest fJobRequest)
        {
            PointDd start = new PointDd(new Dd(fJobRequest.Coords.StartX), new Dd(fJobRequest.Coords.StartY));
            PointDd end   = new PointDd(new Dd(fJobRequest.Coords.EndX), new Dd(fJobRequest.Coords.EndY));

            qdDotNet.SizeInt      samplePoints = new qdDotNet.SizeInt(fJobRequest.SamplePoints.W, fJobRequest.SamplePoints.H);
            qdDotNet.RectangleInt area         = new qdDotNet.RectangleInt(
                new qdDotNet.PointInt(fJobRequest.Area.Point.X, fJobRequest.Area.Point.Y),
                new qdDotNet.SizeInt(fJobRequest.Area.Size.W, fJobRequest.Area.Size.H));

            FGenJob fGenJob = new FGenJob(fJobRequest.JobId, start, end, samplePoints, fJobRequest.MaxIterations, area);

            return(fGenJob);
        }
Ejemplo n.º 6
0
        public void TestGetFillXCount()
        {
            FGenJob    fjob       = CreateJob();
            FGenerator fGenerator = new FGenerator(fjob);

            int size = FGenerator.BLOCK_HEIGHT * FGenerator.BLOCK_WIDTH;

            uint[]   counts    = new uint[size];
            bool[]   doneFlags = new bool[size];
            double[] zValues   = new double[size * 4];

            PointInt position = new PointInt(0, 0);

            fGenerator.FillCounts(position, ref counts, ref doneFlags, ref zValues);
        }
Ejemplo n.º 7
0
        public void TestGetCounts()
        {
            FGenJob    fjob       = CreateJob();
            FGenerator fGenerator = new FGenerator(fjob);

            UInt32[] counts = fGenerator.GetCounts();

            //int ptr = 0;

            //for (int j = 0; j < 10; j++)
            //{
            //	System.Diagnostics.Debug.WriteLine($"y: {j}:");

            //	for (int i = 0; i < 10; i++)
            //	{
            //		System.Diagnostics.Debug.Write($"{counts[ptr++]}   ");
            //	}
            //}
        }
Ejemplo n.º 8
0
 public JobProcessor2(FGenJob fGenJob, int instanceNum)
 {
     _fGenerator = new FGenerator(fGenJob);
     _cts        = new CancellationTokenSource();
     InstanceNum = instanceNum;
 }
Ejemplo n.º 9
0
 public void TestCreateGenerator()
 {
     FGenJob    fjob       = CreateJob();
     FGenerator fGenerator = new FGenerator(fjob);
 }
Ejemplo n.º 10
0
 public void TestCreateJob()
 {
     FGenJob fjob = CreateJob();
 }
Ejemplo n.º 11
0
 public JobProcessor(FGenJob fGenJob)
 {
     _fGenerator = new FGenerator(fGenJob);
     _cts        = new CancellationTokenSource();
 }