Subversion Repositories svn1-original

Rev

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

Rev 351 Rev 352
Line 18... Line 18...
18
*       pri_final               - Print final results
18
*       pri_final               - Print final results
19
*       pri_interim             - Print interim results
19
*       pri_interim             - Print interim results
20
*       print_class_header      - Print a class header
20
*       print_class_header      - Print a class header
21
*       print_class_stats       - Generate the class stats
21
*       print_class_stats       - Generate the class stats
22
*       print_legend            - Print the legend
22
*       print_legend            - Print the legend
23
*       pi_place                - Return place data
23
*       pi_place                - Return place data (Interim processing)
24
*       pr_place                - Return place data
24
*       pr_place                - Return place data
-
 
25
*       pn_place                - Return place data with NE indication
25
*       ck_data                 - Check data for bad times
26
*       ck_data                 - Check data for bad times
26
*       srt_place               - Update placing information
27
*       srt_place               - Update placing information
27
*       do_big_sort             - Main sort routine for final data
28
*       do_big_sort             - Main sort routine for final data
28
*       sort                    - Sort in memory buffer
29
*       sort                    - Sort in memory buffer
29
*       sort_comp               - qsort comparison function
30
*       sort_comp               - qsort comparison function
Line 552... Line 553...
552
    /*
553
    /*
553
     * Sort the data in finishing order
554
     * Sort the data in finishing order
554
     */
555
     */
555
 
556
 
556
    if( ck_data( leg, C_ELAPSED ) )
557
    if( ck_data( leg, C_ELAPSED ) )
557
        return;                                  /* Check data for this leg */
558
        return;                                     /* Check data for this leg */
558
    sort_team_data( leg, S_IFIN, true );               /* Sort the data on elapsed time */
559
    sort_team_data( leg, S_IFIN, true );            /* Sort the data on elapsed time */
559
 
560
 
560
 
561
 
561
    /*
562
    /*
562
     * Now print the data on the printer
563
     * Now print the data on the printer
563
     */
564
     */
Line 641... Line 642...
641
// *
642
// *
642
// *  Print place information
643
// *  Print place information
643
// *
644
// *
644
// *  Purpose:
645
// *  Purpose:
645
// *      This helper function is called to Print place and elapsed information
646
// *      This helper function is called to Print place and elapsed information
646
// *      in a 20-character field
647
// *      in a 20-character field: Place:Team:ElapsedTime
647
// *
648
// *
648
// *  Parameters:
649
// *  Parameters:
649
// *      ptr         Address of the place data
650
// *      ptr         Address of the place data
650
// *      leg         Leg to print
651
// *      leg         Leg to print
651
// *      k           Current index into sorted array. Simply
652
// *      k           Current index into sorted array. Simply
Line 830... Line 831...
830
        **  Print the basics (Finishing order)
831
        **  Print the basics (Finishing order)
831
        **      - Place within complete field
832
        **      - Place within complete field
832
        **      - Team number - with HTML reference to team file
833
        **      - Team number - with HTML reference to team file
833
        **      - Class
834
        **      - Class
834
        */
835
        */
835
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
836
        if ( report_html == printed && lcount % 5 == 4 ) print_underline( TRUE );
836
        print( "%4.4s ", pn_place( team_buf.leg[0].l_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
837
        print( "%4.4s ", pn_place( team_buf.leg[0].l_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
837
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
838
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
838
        print( "%4d",  team_buf.numb );
839
        print( "%4d",  team_buf.numb );
839
        if ( report_html == html ) print( "</A>" );
840
        if ( report_html == html ) print( "</A>" );
840
 
841
 
Line 2172... Line 2173...
2172
    csv_print( "%s", "Flag:valid Team");
2173
    csv_print( "%s", "Flag:valid Team");
2173
    csv_print( "%s", "Flag:bad_times" );
2174
    csv_print( "%s", "Flag:bad_times" );
2174
    csv_print( "%s", "Flag:disqualified" );
2175
    csv_print( "%s", "Flag:disqualified" );
2175
    csv_print( "%s", "Flag:non_equestrian" );
2176
    csv_print( "%s", "Flag:non_equestrian" );
2176
    csv_print( "%s", "Flag:vet_check" );
2177
    csv_print( "%s", "Flag:vet_check" );
-
 
2178
 
-
 
2179
    // Not available as the data is only in-memory
-
 
2180
    // csv_print( "%s", "Flag:notInFastest" );
-
 
2181
    // csv_print( "%s", "Flag:notInSort" );
-
 
2182
 
2177
    csv_print("\n");
2183
    csv_print("\n");
2178
 
2184
 
2179
 
2185
 
2180
    for( i = config.min_team; i <= config.max_team; i++ )
2186
    for( i = config.min_team; i <= config.max_team; i++ )
2181
    {
2187
    {
Line 2252... Line 2258...
2252
            csv_print( "%d", team_buf.flags.valid );
2258
            csv_print( "%d", team_buf.flags.valid );
2253
            csv_print( "%d", team_buf.flags.bad_times );
2259
            csv_print( "%d", team_buf.flags.bad_times );
2254
            csv_print( "%d", team_buf.flags.disqualified );
2260
            csv_print( "%d", team_buf.flags.disqualified );
2255
            csv_print( "%d", team_buf.flags.non_equestrian );
2261
            csv_print( "%d", team_buf.flags.non_equestrian );
2256
            csv_print( "%d", team_buf.flags.vet_check );
2262
            csv_print( "%d", team_buf.flags.vet_check );
-
 
2263
            // Not available as the data is only in-memory
-
 
2264
            // csv_print( "%d", team_buf.flags.notInFastest );
-
 
2265
            // csv_print( "%d", team_buf.flags.notInSort );
2257
 
2266
 
2258
//How about class placings
2267
//How about class placings
2259
 
2268
 
2260
 
2269
 
2261
            csv_print( "\n" );
2270
            csv_print( "\n" );
Line 2624... Line 2633...
2624
 
2633
 
2625
const char       *pi_place( int num, int disq, time_t time )
2634
const char       *pi_place( int num, int disq, time_t time )
2626
{
2635
{
2627
    static char store[2][5];                     /* 2 stores for 4 digit numbers */
2636
    static char store[2][5];                     /* 2 stores for 4 digit numbers */
2628
    static int  i = 0;                           /* Current index into store */
2637
    static int  i = 0;                           /* Current index into store */
2629
    static const char *dis = "D";                      /* Disqualified */
2638
    static const char *dis = "D";                /* Disqualified */
2630
    static const char *non = "-";                      /* Invalid time */
2639
    static const char *non = "-";                /* Invalid time */
2631
 
2640
 
2632
    if( disq )                                   /* Disqualified team */
2641
    if( disq )                                   /* Disqualified team */
2633
        return ( dis );
2642
        return ( dis );
2634
    if( time <= 0 )                              /* Unknown time */
2643
    if( time <= 0 )                              /* Unknown time */
2635
        return ( non );
2644
        return ( non );
Line 3624... Line 3633...
3624
                ptr->teamclass = team_buf.teamclass;
3633
                ptr->teamclass = team_buf.teamclass;
3625
                ptr->real_teamclass = team_buf.teamclass;
3634
                ptr->real_teamclass = team_buf.teamclass;
3626
 
3635
 
3627
                ptr->flags = team_buf.flags;
3636
                ptr->flags = team_buf.flags;
3628
 
3637
 
-
 
3638
                // Add a few flags to simplify processing
-
 
3639
                //  Vetted out teams to be included inthe fastest calcs - except for Equestian Leg
-
 
3640
                //  Bodgey teams are not sorted by place - only after all places and then by team number
-
 
3641
                ptr->flags.notInSort = 0;
-
 
3642
                ptr->flags.notInFastest = 0;
-
 
3643
 
-
 
3644
                if ( ptr->flags.bad_times || ptr->flags.disqualified || !ptr->flags.valid) {
-
 
3645
                    ptr->flags.notInSort = 1;
-
 
3646
                    ptr->flags.notInFastest = 1;
-
 
3647
                }
-
 
3648
 
-
 
3649
                if (ptr->flags.vet_check) {
-
 
3650
                    ptr->flags.notInSort = 1;
-
 
3651
                }
-
 
3652
 
3629
//                if (ptr->flags.non_equestrian)
3653
//                if (ptr->flags.non_equestrian)
3630
//                    ptr->flags.disqualified = true;
3654
//                    ptr->flags.disqualified = true;
3631
//                if (ptr->flags.vet_check)
3655
                if (ptr->flags.vet_check)
3632
//                    ptr->flags.disqualified = true;
3656
                    ptr->flags.disqualified = true;
3633
 
3657
 
3634
                ptr++;
3658
                ptr++;
3635
                sort_num++;
3659
                sort_num++;
3636
 
3660
 
3637
 
3661
 
Line 3725... Line 3749...
3725
        **  of the data can be trusted.
3749
        **  of the data can be trusted.
3726
        **
3750
        **
3727
        **  If the team has been disqualified, then don't use any
3751
        **  If the team has been disqualified, then don't use any
3728
        **  of the data.
3752
        **  of the data.
3729
        */
3753
        */
3730
        if( ptr->flags.bad_times || ptr->flags.disqualified  )
3754
        if (ptr->flags.notInFastest) {
3731
            continue;
3755
            continue;
-
 
3756
        }
-
 
3757
 
-
 
3758
        //if( ptr->flags.bad_times || ptr->flags.disqualified  )
-
 
3759
        //    continue;
3732
 
3760
 
3733
        /*
3761
        /*
3734
        **  Ignore non-Equestrian, unless we are processing the psuedo NE class
3762
        **  Ignore non-Equestrian, unless we are processing the psuedo NE class
-
 
3763
        **  2021: Now allow NE to be considered in the fastest stats
3735
        */
3764
        */
3736
        if ( ptr->teamclass != config.nonequestrian_class && ptr->flags.non_equestrian)
3765
        //if ( ptr->teamclass != config.nonequestrian_class && ptr->flags.non_equestrian)
3737
            continue;
3766
        //    continue;
3738
 
3767
 
3739
 
3768
 
3740
        for( j = 0; j <= config.num_legs; j++ )
3769
        for( j = 0; j <= config.num_legs; j++ )
3741
        {
3770
        {
3742
            if( ptr->lege[j] <= 0 )              /* Ignore bad data */
3771
            if( ptr->lege[j] <= 0 )              /* Ignore bad data */
3743
                continue;
3772
                continue;
3744
 
3773
 
3745
            /*
3774
            /*
3746
            ** If this is the Equestrian Leg and the team has been vetted out, then this team cannot
3775
            ** If this is the Equestrian Leg and the team has been vetted out, then this team cannot
3747
            ** be included into the stats for this leg
3776
            ** be included into the stats for this leg
-
 
3777
            **
-
 
3778
            ** If team has been vetted out then don't consider in fastest overall
3748
            */
3779
            */
3749
            if ( ptr->flags.vet_check && (j == config.equestrian_leg || j== 0)) {
3780
            if ( ptr->flags.vet_check && (j == config.equestrian_leg || j== 0)) {
3750
                continue;
3781
                continue;
3751
            }
3782
            }
3752
 
3783
 
-
 
3784
            /* If this is the Equestrian Leg and the team is a Non-Equestrian Team, then don't include
-
 
3785
            ** it into the stats.
-
 
3786
            **
-
 
3787
            ** If this is a NE team then don't consider it to be fastest overall
-
 
3788
            */
-
 
3789
            if ( ptr->teamclass != config.nonequestrian_class && ptr->flags.non_equestrian &&  (j == config.equestrian_leg || j== 0)) {
-
 
3790
                continue;
-
 
3791
            }
3753
 
3792
 
3754
            /*
3793
            /*
3755
            **  Determine fastest team : overall
3794
            **  Determine fastest team : overall
3756
            **  Ignore the non-equestrian data as this is in the list twice
3795
            **  Ignore the non-equestrian data as this is in the list twice
3757
            */
3796
            */