Subversion Repositories svn1-original

Rev

Rev 160 | Rev 164 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 160 Rev 162
Line 68... Line 68...
68
void pri_leg_body(int leg);
68
void pri_leg_body(int leg);
69
void pri_eleg_body(int leg);
69
void pri_eleg_body(int leg);
70
void pri_csv_data ( void );
70
void pri_csv_data ( void );
71
 
71
 
72
 
72
 
73
menu_table  rpt_menu[] = {
73
//menu_table  rpt_menu[] = {
74
    { '1', "Print team order", pri_team },
74
//    { '1', "Print team order", pri_team },
75
    { '2', "Print end leg times", pri_leg },
75
//    { '2', "Print end leg times", pri_leg },
76
    { '3', "Print elapsed leg times", pri_eleg },
76
//    { '3', "Print elapsed leg times", pri_eleg },
77
    { '4', "Print final results", pri_final },
77
//    { '4', "Print final results", pri_final },
78
    { '5', "Print final results(All-HTML)", pri_final_html },
78
//    { '5', "Print final results(All-HTML)", pri_final_html },
79
    { '6', "Print Interim results", pri_interim },
79
//    { '6', "Print Interim results", pri_interim },
80
    { '7', "Update event and class placings", srt_place },
80
//    { '7', "Update event and class placings", srt_place },
81
    { '8', "Display summary information", display_summary },
81
//    { '8', "Display summary information", display_summary },
82
    { '9', "Print summary information", pri_summary },
82
//    { '9', "Print summary information", pri_summary },
83
    { 'a', "Print Awards only", pri_awards_html },
83
//    { 'a', "Print Awards only", pri_awards_html },
84
    { 'b', "Print Master Index only", pri_master_index },
84
//    { 'b', "Print Master Index only", pri_master_index },
85
    { 'c', "Print Name Index only", pri_name_index },
85
//    { 'c', "Print Name Index only", pri_name_index },
86
    { 'e', "Export CSV Report Data", pri_csv_data },
86
//    { 'e', "Export CSV Report Data", pri_csv_data },
87
    { 'z', "Print all reports", pri_all_reports },
87
//    { 'z', "Print all reports", pri_all_reports },
88
    
88
    
89
#if defined(HI_TECH_C) || defined(__TURBOC__)
89
//#if defined(HI_TECH_C) || defined(__TURBOC__)
90
    { 'S', "MS-DOS system", ms_system },
90
//    { 'S', "MS-DOS system", ms_system },
91
#endif
91
//#endif
92
    { 'q', "Return to main menu", 0 },
92
//    { 'q', "Return to main menu", 0 },
93
    { '\0' }
93
//    { '\0' }
94
};
94
//};
95
 
95
 
96
#define MAX_PLACE 11
96
#define MAX_PLACE 11
97
const char * place_text[] =
97
const char * place_text[] =
98
{
98
{
99
    "Zero'th",
99
    "Zero'th",
Line 170... Line 170...
170
 *  Returns:
170
 *  Returns:
171
 *      Nothing
171
 *      Nothing
172
 *
172
 *
173
 *========================================================================*/
173
 *========================================================================*/
174
 
174
 
175
void report(void)
175
//void report(void)
176
{
176
//{
177
    report_html = text;
177
//    report_html = text;
178
    if( load_report_data() )
178
//    if( load_report_data() )
179
        do_menu( "Report generation", "Select option", rpt_menu );
179
//        do_menu( "Report generation", "Select option", rpt_menu );
180
 
180
 
181
    if( sort_data )
181
//    if( sort_data )
182
        free( ( char * ) sort_data );
182
//        free( ( char * ) sort_data );
183
    if( sort_aux )
183
//    if( sort_aux )
184
        free( ( char * ) sort_aux );
184
//        free( ( char * ) sort_aux );
185
    if ( sort_name_data )
185
//    if ( sort_name_data )
186
        free( ( char * ) sort_name_data );
186
//        free( ( char * ) sort_name_data );
187
    sort_data = ( ty_s_data * ) 0;
187
//    sort_data = ( ty_s_data * ) 0;
188
    sort_aux = ( ty_s_aux * ) 0;
188
//    sort_aux = ( ty_s_aux * ) 0;
189
    sort_name_data = ( ty_s_namedata * ) 0;
189
//    sort_name_data = ( ty_s_namedata * ) 0;
190
}
190
//}
191
 
191
 
192
/*========================================================================
192
/*========================================================================
193
 *
193
 *
194
 *  Print in team order
194
 *  Print in team order
195
 *
195
 *
Line 208... Line 208...
208
 
208
 
209
void pri_team(void)
209
void pri_team(void)
210
{
210
{
211
    int         i, k;
211
    int         i, k;
212
 
212
 
213
    cur( 0, 5 );
213
    //cur( 0, 5 );
214
    printf( "Team information - in team order\n" );
214
    printf( "Team information - in team order\n" );
215
    printf( "\nPrinting team names\n" );
215
    printf( "\nPrinting team names\n" );
216
    flush_out();
216
    //flush_out();
217
 
217
 
218
    if( !open_printer( "", "name", 132, report_html, "Team Names" ) )
218
    if( !open_printer( "", "name", 132, report_html, "Team Names" ) )
219
        return;
219
        return;
220
 
220
 
221
    /*
221
    /*
Line 298... Line 298...
298
 *      Nothing
298
 *      Nothing
299
 *
299
 *
300
 *========================================================================*/
300
 *========================================================================*/
301
void pri_name_index( void )
301
void pri_name_index( void )
302
{
302
{
303
    cur( 0, 5 );
303
    //cur( 0, 5 );
304
    printf( "Team Member information - in name order\n" );
304
    printf( "Team Member information - in name order\n" );
305
    printf( "\nPrinting competitor names\n" );
305
    printf( "\nPrinting competitor names\n" );
306
    flush_out();
306
    //flush_out();
307
    pri_name_index_body();
307
    pri_name_index_body();
308
    printf( "Found %d names\n", sort_num_data );
308
    printf( "Found %d names\n", sort_num_data );
309
    printf( "\nAny key to continue" );
309
    printf( "\nAny key to continue" );
310
    getinp();
310
    getinp();
311
}
311
}
Line 455... Line 455...
455
 *  Returns:
455
 *  Returns:
456
 *      Nothing
456
 *      Nothing
457
 *
457
 *
458
 *========================================================================*/
458
 *========================================================================*/
459
 
459
 
460
void pri_leg(void)
460
//void pri_leg(void)
461
{
461
//{
462
    int         leg = 0;
462
//    int         leg = 0;
463
 
463
 
464
 
464
 
465
    /*
465
//    /*
466
     * This function is used to provide interum print-outs
466
//     * This function is used to provide interum print-outs
467
     * The team data is sorted by time at leg-end and the times printed are
467
//     * The team data is sorted by time at leg-end and the times printed are
468
     * real times at leg end.
468
//     * real times at leg end.
469
     * This operation is designed to be quick - it doesn't update the disk file
469
//     * This operation is designed to be quick - it doesn't update the disk file
470
     * and is not available in an HTML version - yet
470
//     * and is not available in an HTML version - yet
471
     */
471
//     */
472
 
472
 
473
    cur( 0, 5 );
473
//    cur( 0, 5 );
474
    printf( "Leg finishing time report\n" );
474
//    printf( "Leg finishing time report\n" );
475
    while( TRUE )
475
//    while( TRUE )
476
    {
476
//    {
477
        d_field( 0, 7, "Enter leg to print :", D_NUMBER, 1, ( char * ) &leg,
477
//        d_field( 0, 7, "Enter leg to print :", D_NUMBER, 1, ( char * ) &leg,
478
                 TRUE, M_UPDATE );
478
//                 TRUE, M_UPDATE );
479
        if( abort_flag )
479
//        if( abort_flag )
480
            return;
480
//            return;
481
        if( leg <= config.num_legs )
481
//        if( leg <= config.num_legs )
482
            break;
482
//            break;
483
        beep();
483
//        beep();
484
    }
484
//    }
485
    
485
    
486
    pri_leg_body ( leg );
486
//    pri_leg_body ( leg );
487
}
487
//}
488
 
488
 
489
void pri_leg_body(int leg)    
489
void pri_leg_body(int leg)    
490
{
490
{
491
    ty_s_data  *ptr;
491
    ty_s_data  *ptr;
492
    int         i, k;
492
    int         i, k;
493
    /*
493
    /*
494
     * Sort the data in finishing order 
494
     * Sort the data in finishing order 
495
     */
495
     */
496
 
496
 
497
    printf( "\nSorting the data\n" );
497
    printf( "\nSorting the data\n" );
498
    flush_out();
498
    //flush_out();
499
    if( ck_data( leg, C_END ) )
499
    if( ck_data( leg, C_END ) )
500
        return;                                  /* Check data for this leg */
500
        return;                                  /* Check data for this leg */
501
    sort_team_data( leg, S_FIN );                /* Sort the data */
501
    sort_team_data( leg, S_FIN );                /* Sort the data */
502
 
502
 
503
 
503
 
Line 672... Line 672...
672
 *  Returns:
672
 *  Returns:
673
 *      Nothing
673
 *      Nothing
674
 *
674
 *
675
 *========================================================================*/
675
 *========================================================================*/
676
 
676
 
677
void pri_eleg(void)
677
//void pri_eleg(void)
678
{
678
//{
679
    int         leg = 0;
679
//    int         leg = 0;
680
 
680
 
681
 
681
 
682
    /*
682
//    /*
683
     * This function is used to provide interum print-outs
683
//     * This function is used to provide interum print-outs
684
     * The team data is sorted by time at leg-elapsed and the times printed are
684
//     * The team data is sorted by time at leg-elapsed and the times printed are
685
     * real times at leg end.
685
//     * real times at leg end.
686
     * This operation is designed to be quick - it doesn't update the disk file
686
//     * This operation is designed to be quick - it doesn't update the disk file
687
     * and is not available in an HTML version - yet
687
//     * and is not available in an HTML version - yet
688
     */
688
//     */
689
 
689
 
690
    cur( 0, 5 );
690
//    cur( 0, 5 );
691
    printf( "Leg elapsed time report\n" );
691
//    printf( "Leg elapsed time report\n" );
692
    while( TRUE )
692
//    while( TRUE )
693
    {
693
//    {
694
        d_field( 0, 7, "Enter leg to print :", D_NUMBER, 1, ( char * ) &leg,
694
//        d_field( 0, 7, "Enter leg to print :", D_NUMBER, 1, ( char * ) &leg,
695
                 TRUE, M_UPDATE );
695
//                 TRUE, M_UPDATE );
696
        if( abort_flag )
696
//        if( abort_flag )
697
            return;
697
//            return;
698
        if( leg <= config.num_legs )
698
//        if( leg <= config.num_legs )
699
            break;
699
//            break;
700
        beep();
700
//        beep();
701
    }
701
//    }
702
    pri_eleg_body(leg);
702
//    pri_eleg_body(leg);
703
}
703
//}
704
 
704
 
705
  
705
  
706
void pri_eleg_body( int leg)
706
void pri_eleg_body( int leg)
707
{
707
{
708
    ty_s_data  *ptr;
708
    ty_s_data  *ptr;
709
    int         i, k;
709
    int         i, k;
710
 
710
 
711
    /*
711
    /*
712
     * Sort the data in finishing order 
712
     * Sort the data in finishing order
713
     */
713
     */
714
 
714
 
715
    printf( "\nSorting the data\n" );
715
    printf( "\nSorting the data\n" );
716
    flush_out();
716
    //flush_out();
717
    if( ck_data( leg, C_ELAPSED ) )
717
    if( ck_data( leg, C_ELAPSED ) )
718
        return;                                  /* Check data for this leg */
718
        return;                                  /* Check data for this leg */
719
    sort_team_data( leg, S_L );                  /* Sort the data on elapsed time */
719
    sort_team_data( leg, S_L );                  /* Sort the data on elapsed time */
720
 
720
 
721
 
721
 
722
    /*
722
    /*
723
     * Now print the data on the printer 
723
     * Now print the data on the printer
724
     */
724
     */
725
    if( !open_printer( "", tprintf( "le%1.1d", leg ),
725
    if( !open_printer( "", tprintf( "le%1.1d", leg ),
726
                       80,
726
                       80,
727
                       report_html,
727
                       report_html,
728
                       leg ? tprintf( "Elapsed time order for Leg %d.", leg )
728
                       leg ? tprintf( "Elapsed time order for Leg %d.", leg )
Line 731... Line 731...
731
    {
731
    {
732
        return;
732
        return;
733
    }
733
    }
734
 
734
 
735
    /*
735
    /*
736
     * Print out the data 
736
     * Print out the data
737
     */
737
     */
738
    print( "PRELIMINARY RESULTS ONLY\n\n" );
738
    print( "PRELIMINARY RESULTS ONLY\n\n" );
739
 
739
 
740
    print_underline( TRUE );
740
    print_underline( TRUE );
741
    print( "%4s %4s %-8s  ", "Plce", "Team", "Time" );
741
    print( "%4s %4s %-8s  ", "Plce", "Team", "Time" );
Line 784... Line 784...
784
        print( "\n" );
784
        print( "\n" );
785
    }
785
    }
786
    
786
    
787
 
787
 
788
    /*
788
    /*
789
     * Insert the leg statistics 
789
     * Insert the leg statistics
790
     */
790
     */
791
 
791
 
792
    gen_stats();                               /* Generate all stats */
792
    gen_stats();                               /* Generate all stats */
793
    print( "\nLeg statistics\n" );
793
    print( "\nLeg statistics\n" );
794
    print( "Fastest team: %4d time : %s.",
794
    print( "Fastest team: %4d time : %s.",
Line 796... Line 796...
796
    print( " Average time: %s\n", time_a( stats.average[leg][0] ) );
796
    print( " Average time: %s\n", time_a( stats.average[leg][0] ) );
797
 
797
 
798
    close_printer();
798
    close_printer();
799
}
799
}
800
 
800
 
801
/*========================================================================
801
///*========================================================================
802
 *
802
// *
803
 *  Print place information
803
// *  Print place information
804
 *
804
// *
805
 *  Purpose:
805
// *  Purpose:
806
 *      This helper function is called to Print place and elapsed information
806
// *      This helper function is called to Print place and elapsed information
807
 *      in a 20-character field
807
// *      in a 20-character field
808
 *
808
// *
809
 *  Parameters:
809
// *  Parameters:
810
 *      ptr         Address of the place data
810
// *      ptr         Address of the place data
811
 *      leg         Leg to print
811
// *      leg         Leg to print
812
 *      k           Current index into sorted array. Simply
812
// *      k           Current index into sorted array. Simply
813
 *                  used to determine if the entry is valid
813
// *                  used to determine if the entry is valid
814
 *                  or if it should be space-filled
814
// *                  or if it should be space-filled
815
 *
815
// *
816
 *  Returns:
816
// *  Returns:
817
 *      Nothing
817
// *      Nothing
818
 *
818
// *
819
 *========================================================================*/
819
// *========================================================================*/
820
 
820
 
821
void pe_place( ty_s_data * ptr, int leg, unsigned k )
821
void pe_place( ty_s_data * ptr, int leg, unsigned k )
822
{
822
{
823
    if( k < sort_num )
823
    if( k < sort_num )
824
    {
824
    {
Line 932... Line 932...
932
    char        suppress_classes;                /* Boolean. Printout class files too */
932
    char        suppress_classes;                /* Boolean. Printout class files too */
933
    char        *report_title;
933
    char        *report_title;
934
    bool        class_done[MAX_CLASS+1];
934
    bool        class_done[MAX_CLASS+1];
935
    int         lcount;
935
    int         lcount;
936
 
936
 
937
    cur( 0, 5 );
937
    //cur( 0, 5 );
938
    printf( "Generate final result printouts\n" );
938
    printf( "Generate final result printouts\n" );
939
    if( ck_data( -1, C_ELAPSED ) )
939
    if( ck_data( -1, C_ELAPSED ) )
940
        return;
940
        return;
941
                                     /* check data for all legs */
941
                                     /* check data for all legs */
942
 
942
 
Line 945... Line 945...
945
    **  printout. For an HTML report always do the class reports as the two
945
    **  printout. For an HTML report always do the class reports as the two
946
    **  are interlinked
946
    **  are interlinked
947
    */
947
    */
948
    if ( ! report_html  && ! report_all)
948
    if ( ! report_html  && ! report_all)
949
    {
949
    {
950
        suppress_classes = getyes( "Do you want to suppress class printouts" );
950
        suppress_classes = FALSE; //getyes( "Do you want to suppress class printouts" );
951
    }
951
    }
952
    else
952
    else
953
    {
953
    {
954
        suppress_classes = FALSE;
954
        suppress_classes = FALSE;
955
    }
955
    }
Line 1701... Line 1701...
1701
    char        suppress_classes = FALSE;                /* Boolean. Printout class files too */
1701
    char        suppress_classes = FALSE;                /* Boolean. Printout class files too */
1702
    char       *report_title;
1702
    char       *report_title;
1703
 
1703
 
1704
    if ( ! report_all )
1704
    if ( ! report_all )
1705
    {
1705
    {
1706
        cur( 0, 5 );
1706
        //cur( 0, 5 );
1707
        printf( "Generate interim result printouts\n" );
1707
        printf( "Generate interim result printouts\n" );
1708
        ck_data( -1, C_DISQUAL );                    /* Check the data - dummy check */
1708
        ck_data( -1, C_DISQUAL );                    /* Check the data - dummy check */
1709
        suppress_classes = getyes( "Do you want to suppress class printouts" );
1709
        suppress_classes = FALSE; //getyes( "Do you want to suppress class printouts" );
1710
        printf( "\nSorting the data\n" );
1710
        printf( "\nSorting the data\n" );
1711
    }
1711
    }
1712
    do_big_sort();                             /* Sort on every thing */
1712
    do_big_sort();                             /* Sort on every thing */
1713
    gen_stats();                               /* Generate the stats too */
1713
    gen_stats();                               /* Generate the stats too */
1714
 
1714
 
Line 2696... Line 2696...
2696
void display_summary (void)
2696
void display_summary (void)
2697
{
2697
{
2698
 
2698
 
2699
    t_class_summary data;
2699
    t_class_summary data;
2700
    int         i;
2700
    int         i;
2701
    int         line = 2;
2701
    //int         line = 2;
2702
 
2702
 
2703
    cur( 0, line );
2703
    //cur( 0, line );
2704
    printf( "Generating Summary Information" );
2704
    printf( "Generating Summary Information" );
2705
    calc_class_summary( & data );
2705
    calc_class_summary( & data );
2706
 
2706
 
2707
 
2707
 
2708
    /*
2708
    /*
2709
    **  Display summary stats
2709
    **  Display summary stats
2710
    */
2710
    */
2711
 
2711
 
2712
    cur( 0, line );
2712
    //cur( 0, line );
2713
    console_clreol();
2713
    //console_clreol();
2714
    printf( "Summary Information\n\n" );
2714
    printf( "Summary Information\n\n" );
2715
    printf( "%*s : %-7s %-7s%-7s\n", LEN_CLASS_NAME,
2715
    printf( "%*s : %-7s %-7s%-7s\n", LEN_CLASS_NAME,
2716
                                      "Category",
2716
                                      "Category",
2717
                                      "Total",
2717
                                      "Total",
2718
                                      "Disq",
2718
                                      "Disq",
Line 2763... Line 2763...
2763
void pri_summary (void)
2763
void pri_summary (void)
2764
{
2764
{
2765
 
2765
 
2766
    t_class_summary data;
2766
    t_class_summary data;
2767
    int         i;
2767
    int         i;
2768
    int         line = 2;
2768
    //int         line = 2;
2769
 
2769
 
2770
 
2770
 
2771
    if( !open_printer( "", "summary", 132, text, "Summary Information" ) )
2771
    if( !open_printer( "", "summary", 132, text, "Summary Information" ) )
2772
        return;
2772
        return;
2773
    
2773
    
2774
    cur( 0, line );
2774
    //cur( 0, line );
2775
    printf( "Generating Summary Information" );
2775
    printf( "Generating Summary Information" );
2776
    calc_class_summary( & data );
2776
    calc_class_summary( & data );
2777
 
2777
 
2778
 
2778
 
2779
    /*
2779
    /*