Subversion Repositories svn1-original

Rev

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

Rev 46 Rev 47
Line 988... Line 988...
988
        **  Print the basics
988
        **  Print the basics
989
        **      - Place within complete field
989
        **      - Place within complete field
990
        **      - Team number - with HTML reference to team file
990
        **      - Team number - with HTML reference to team file
991
        **      - Class
991
        **      - Class
992
        */
992
        */
993
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
993
        print( "%4.4s ", pr_place_ne( team_buf.leg[0].l_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
994
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
994
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
995
        print( "%4d",  team_buf.numb );
995
        print( "%4d",  team_buf.numb );
996
        if ( report_html ) print( "</A>" );
996
        if ( report_html ) print( "</A>" );
997
 
997
 
998
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
998
        print( " %-*s", 3, team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
Line 1014... Line 1014...
1014
            }
1014
            }
1015
            else
1015
            else
1016
            {
1016
            {
1017
                print( "  %-8s %4.4s %4.4s",
1017
                print( "  %-8s %4.4s %4.4s",
1018
                    time_a( team_buf.leg[j].elapsed ),
1018
                    time_a( team_buf.leg[j].elapsed ),
1019
                    pr_place( team_buf.leg[j].l_place, ptr->flags.bad_times ),
1019
                    pr_place_ne( team_buf.leg[j].l_place, ptr->flags.bad_times, ptr->flags.non_equestrian ),
1020
                    pr_place( team_buf.leg[j].le_place,ptr->flags.bad_times )
1020
                    pr_place_ne( team_buf.leg[j].le_place,ptr->flags.bad_times, ptr->flags.non_equestrian )
1021
                  );
1021
                  );
1022
            }
1022
            }
1023
        }
1023
        }
1024
 
1024
 
1025
       /*
1025
       /*
Line 1027... Line 1027...
1027
        **      - Total time
1027
        **      - Total time
1028
        **      - Category place - with reference to category file
1028
        **      - Category place - with reference to category file
1029
        */
1029
        */
1030
        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
1030
        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
1031
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html"), team_buf.numb );
1031
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html"), team_buf.numb );
1032
        print( "%-4.4s", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
1032
        print( "%-4.4s", pr_place_ne( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
1033
        if ( report_html ) print( "</A>" );
1033
        if ( report_html ) print( "</A>" );
1034
 
1034
 
1035
        print( "\n" );
1035
        print( "\n" );
1036
    }
1036
    }
1037
 
1037
 
Line 2110... Line 2110...
2110
 
2110
 
2111
}
2111
}
2112
 
2112
 
2113
/*========================================================================
2113
/*========================================================================
2114
 *
2114
 *
-
 
2115
 *  Return place data
-
 
2116
 *
-
 
2117
 *  Purpose:
-
 
2118
 *      This function is called to Return place data
-
 
2119
 *
-
 
2120
 *      This routine is called to fill a print team_buffer - to allow for
-
 
2121
 *      multiple calls to this function ( before the data is used ) a number
-
 
2122
 *      of static team_buffers are maintained
-
 
2123
 *
-
 
2124
 *  Parameters:
-
 
2125
 *      num         place - if not bad_times
-
 
2126
 *      disq        Disqualified flag
-
 
2127
 *
-
 
2128
 *  Returns:
-
 
2129
 *      This function returns a pointer to the character string for the
-
 
2130
 *      number or a pointer to a bad_times string.
-
 
2131
 *
-
 
2132
 *========================================================================*/
-
 
2133
 
-
 
2134
char *pr_place_ne( int num, int disq, int ne )
-
 
2135
{
-
 
2136
    static char store[2][5];                     /* 2 stores for 4 digit numbers */
-
 
2137
    static int  i = 0;                           /* Current index into store */
-
 
2138
    static char *dis = "U";
-
 
2139
    static char *nes = "NE";
-
 
2140
 
-
 
2141
    if ( ne )
-
 
2142
        return ( nes );
-
 
2143
    
-
 
2144
    if( disq )
-
 
2145
        return ( dis );
-
 
2146
 
-
 
2147
    i++;
-
 
2148
    if( i >= 2 )
-
 
2149
        i = 0;                                   /* Select next entry */
-
 
2150
    sprintf( store[i], "%4d", num );
-
 
2151
    return ( store[i] );
-
 
2152
 
-
 
2153
}
-
 
2154
 
-
 
2155
/*========================================================================
-
 
2156
 *
2115
 *  Check data for bad times
2157
 *  Check data for bad times
2116
 *
2158
 *
2117
 *  Purpose:
2159
 *  Purpose:
2118
 *      This function is called to Check data for bad times
2160
 *      This function is called to Check data for bad times
2119
 *      Scan the sort data structure and locate entries that have incorrect
2161
 *      Scan the sort data structure and locate entries that have incorrect
Line 2665... Line 2707...
2665
    **
2707
    **
2666
    **  If one of the teams has bad_times, then that team is placed
2708
    **  If one of the teams has bad_times, then that team is placed
2667
    **  lower in the sorting order. If both teams have bad times
2709
    **  lower in the sorting order. If both teams have bad times
2668
    **  then sort on team number. ie: Unplaced teams are sorted on
2710
    **  then sort on team number. ie: Unplaced teams are sorted on
2669
    **  team number
2711
    **  team number
-
 
2712
    **
-
 
2713
    **  If not sorting within a class (ie Overall), then Non_Equestrian
-
 
2714
    **  is better than a bad time. Places NE before disqualified
-
 
2715
    **
-
 
2716
    **
-
 
2717
    **  Note: NE also have bad_times set
2670
    */
2718
    */
-
 
2719
 
2671
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
2720
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
2672
    {
2721
    {
-
 
2722
        if( sort_mode == S_LE || sort_mode == S_L ) /* Sort NOT within a class */
-
 
2723
        {
-
 
2724
            if( a->flags.non_equestrian || b->flags.non_equestrian )
-
 
2725
            {
-
 
2726
                if( a->flags.non_equestrian && b->flags.non_equestrian )
-
 
2727
                {
-
 
2728
                    /*
-
 
2729
                    **  Can't do much better in the overall report
-
 
2730
                    **  Need different information to sort NE entries
-
 
2731
                    */
-
 
2732
                    return ( a->team - b->team );
-
 
2733
                }
-
 
2734
                else
-
 
2735
                {
-
 
2736
                    /* Good times better than NE */
-
 
2737
                    return ( a->flags.bad_times ? 1 : -1 );
-
 
2738
                }
-
 
2739
            }
-
 
2740
        }
-
 
2741
        
-
 
2742
 
2673
        if( a->flags.bad_times && b->flags.bad_times )
2743
        if( a->flags.bad_times && b->flags.bad_times )
2674
            return ( a->team - b->team );
2744
            return ( a->team - b->team );
2675
        else
2745
        else
2676
            return ( a->flags.bad_times ? 1 : -1 );
2746
            return ( a->flags.bad_times ? 1 : -1 );
2677
    }
2747
    }
2678
 
2748
 
2679
    /*
-
 
2680
    **  Not sorting within a class ie: Overall
-
 
2681
    **  Non-Equestrian is at the end, so that it doesn't get counted in the
-
 
2682
    **  finishing order
-
 
2683
    */
-
 
2684
    if( sort_mode == S_LE || sort_mode == S_L )     /* Sort NOT within a class */
-
 
2685
    {
-
 
2686
        if( a->flags.non_equestrian || b->flags.non_equestrian )
-
 
2687
        {
-
 
2688
            if( a->flags.non_equestrian && b->flags.non_equestrian )
-
 
2689
                return ( a->team - b->team );
-
 
2690
            else
-
 
2691
                return ( a->flags.non_equestrian ? 1 : -1 );
-
 
2692
        }
-
 
2693
    }
-
 
2694
 
-
 
2695
 
2749
 
2696
    /*
2750
    /*
2697
    **  Before we sort on times we must determine which time to
2751
    **  Before we sort on times we must determine which time to
2698
    **  use. Finish time, Leg end times, Leg Elapsed times.
2752
    **  use. Finish time, Leg end times, Leg Elapsed times.
2699
    */
2753
    */