Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Write to test...");

            /* proof works
             * HeaderLocationOnPage enumHLocation =  HeaderLocationOnPage.MiddleEntry;
             * HeaderLocationOnPage enumHLocation2 = HeaderLocationOnPage.MiddleEntry;
             * enumHLocation2 = HeaderLocationOnPage.SecondToLastEntry;
             * int m = (int) enumHLocation;
             * Console.WriteLine(m + " " + enumHLocation + " " +  enumHLocation2.ToString() +  " if same=" + (enumHLocation == enumHLocation2) );
             *
             */



            Console.WriteLine("width=" + Constants.pageWidth + " height=" + Constants.InchpageHeight + "spacerHeight=" + Constants.spacerHeight + " in inches.");


            GeneatingFunction gen = new GeneatingFunction(); //create all data

            /* proof works
             * int x = GeneatingFunction.HoreseSequence;
             * Console.WriteLine("x=" + x);
             * for(int m=0; m < 5; m++)
             * {
             *  Console.WriteLine("GeneatingFunction.HoreseSequence=" + GeneatingFunction.HoreseSequence);
             * }
             */

            //testLibcall(); need to do pubicly with gacutil cmdline utility to avoid recompiling
            // gen.generatePdfCard(1);  //track 5-12 //data for debugging
            List <CardStruct.Race> allRacesOnaTrack = gen.generateCardStructFullCard();

            CardStruct.debugPrintACard(allRacesOnaTrack);
            List <CardStruct.Race> output = new PdfPageCalculation().calculate(allRacesOnaTrack);

            System.Diagnostics.Debug.Print("AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER AFTER ");
            CardStruct.debugPrintACard(output);
            System.Diagnostics.Debug.WriteLine("^^^^^^^^^^^^^^^^ENDED^^^^^^^^^^^^^^^^^^");


            // StitchedFinalPdf pdfData =  gen.generateAPdfStructure(1);// 1 track only
            Console.WriteLine("==============!!!!!!!!!!!================!!!!!!!!!!!!=============");
            //Console.WriteLine("1StitchedFinalPdf=" + pdfData); // 1 track at a time
            Console.WriteLine("==============END================!!!!!!!!!!!!=============");
            //funcCreateRaceDelegatePrint(); //create a dummy race and see printout
            // stringTestForGeneralizing();
            //PageOptimization.tryPageCalculation(pdfData.trackList.First());
            //List<PageDetail> pgDetails =  PageOptimization.optimizeSpace(pdfData.trackList.First());
            //PdfPageCalculation.debugPrintPgDetails(pgDetails);

            Console.ReadKey();
        }
Пример #2
0
        public List <CardStruct.Race> calculate(List <CardStruct.Race> races) //*** 1.
        {
            System.Diagnostics.Debug.WriteLine("++++++++++++11111+++++++");

            CardStruct.debugPrintACard(races);

            System.Diagnostics.Debug.WriteLine("++++++++++++start at +++++++" + DateTime.Now + "\n");
            Stopwatch sw = new Stopwatch(); sw.Start();

            List <Race <Horse> > raceList = prepInput(races);
            //log.Info( "Debug-5: " + raceList);
            List <CardStruct.Race> raceout = processToFitOnPageAndReturn(raceList);

            sw.Stop();
            Console.WriteLine(String.Format("elapsed time: {0} millisecond", sw.ElapsedMilliseconds));


            System.Diagnostics.Debug.WriteLine("+++++++++++++++++end at+++++++++++++++++++" + DateTime.Now + "\n");
            // CardStruct.debugPrintACard(raceout);

            return(raceout);
        }