Subversion Repositories svn1-original

Rev

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

Rev 246 Rev 250
Line 98... Line 98...
98
#define S_LEC   4                                /* Leg end time per class */
98
#define S_LEC   4                                /* Leg end time per class */
99
#define S_FIN   5                                /* Sort on finish time at given leg */
99
#define S_FIN   5                                /* Sort on finish time at given leg */
100
#define S_TEAM  6                                /* Sort on team order */
100
#define S_TEAM  6                                /* Sort on team order */
101
#define S_CLASS 7                                /* Sort on class/team order */
101
#define S_CLASS 7                                /* Sort on class/team order */
102
#define S_LC_NE 8                                /* Elapsed times per class, with NE sorted by real class */
102
#define S_LC_NE 8                                /* Elapsed times per class, with NE sorted by real class */
-
 
103
#define S_IFIN  9                                /* Sort on elapsed time at given leg */
103
 
104
 
104
/*
105
/*
105
**  Various checking modes
106
**  Various checking modes
106
*/
107
*/
107
#define C_ELAPSED   1                            /* Check elapsed times */
108
#define C_ELAPSED   1                            /* Check elapsed times */
Line 549... Line 550...
549
     * Sort the data in finishing order
550
     * Sort the data in finishing order
550
     */
551
     */
551
 
552
 
552
    if( ck_data( leg, C_ELAPSED ) )
553
    if( ck_data( leg, C_ELAPSED ) )
553
        return;                                  /* Check data for this leg */
554
        return;                                  /* Check data for this leg */
554
    sort_team_data( leg, S_L );                  /* Sort the data on elapsed time */
555
    sort_team_data( leg, S_IFIN );               /* Sort the data on elapsed time */
555
 
556
 
556
 
557
 
557
    /*
558
    /*
558
     * Now print the data on the printer
559
     * Now print the data on the printer
559
     */
560
     */
Line 812... Line 813...
812
        **      - Place within complete field
813
        **      - Place within complete field
813
        **      - Team number - with HTML reference to team file
814
        **      - Team number - with HTML reference to team file
814
        **      - Class
815
        **      - Class
815
        */
816
        */
816
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
817
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
817
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
818
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times || ptr->flags.non_equestrian ) );
818
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
819
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
819
        print( "%4d",  team_buf.numb );
820
        print( "%4d",  team_buf.numb );
820
        if ( report_html == html ) print( "</A>" );
821
        if ( report_html == html ) print( "</A>" );
821
 
822
 
822
        print( " %-*s", 3, team_buf.teamclass == 0 ? "" : config.team_class[team_buf.teamclass - 1].abr );
823
        print( " %-*s", 3, team_buf.teamclass == 0 ? "" : config.team_class[team_buf.teamclass - 1].abr );
Line 838... Line 839...
838
            }
839
            }
839
            else
840
            else
840
            {
841
            {
841
                print( "  %-8s %4.4s %4.4s",
842
                print( "  %-8s %4.4s %4.4s",
842
                    time_a( team_buf.leg[j].elapsed ),
843
                    time_a( team_buf.leg[j].elapsed ),
843
                    pr_place( team_buf.leg[j].l_place, ptr->flags.bad_times ),
844
                    pr_place( team_buf.leg[j].l_place, ptr->flags.bad_times || ptr->flags.non_equestrian ),
844
                    pr_place( team_buf.leg[j].le_place,ptr->flags.bad_times )
845
                    pr_place( team_buf.leg[j].le_place,ptr->flags.bad_times || ptr->flags.non_equestrian )
845
                  );
846
                  );
846
            }
847
            }
847
        }
848
        }
848
 
849
 
849
       /*
850
       /*
Line 853... Line 854...
853
        */
854
        */
854
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
855
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
855
        print( "  %-8s ", time_a( ptr->lege[0] ) );
856
        print( "  %-8s ", time_a( ptr->lege[0] ) );
856
        
857
        
857
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.teamclass - 1].abr ,"html")), team_buf.numb );
858
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">",url_encode(p_filename(filebase, config.team_class[team_buf.teamclass - 1].abr ,"html")), team_buf.numb );
858
        print( "%-4.4s", pr_place_ne( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
859
        print( "%-4.4s", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
859
        if ( report_html == html ) print( "</A>" );
860
        if ( report_html == html ) print( "</A>" );
860
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
861
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
861
        lcount++;
862
        lcount++;
862
        print( "\n" );
863
        print( "\n" );
863
    }
864
    }
Line 876... Line 877...
876
    memset ( class_done, 0, sizeof(class_done));
877
    memset ( class_done, 0, sizeof(class_done));
877
 
878
 
878
 
879
 
879
    for( ptr = sort_data, i = 0; i < sort_num; i++, ptr++ )
880
    for( ptr = sort_data, i = 0; i < sort_num; i++, ptr++ )
880
    {
881
    {
-
 
882
        int flags = 0;
-
 
883
 
881
        /*
884
        /*
882
        **  Detect a change in the "class"
885
        **  Detect a change in the "class"
883
        **  All data is within the one array of data
886
        **  All data is within the one array of data
884
        **  Use the in-memory class as this MAY differ from that stored
887
        **  Use the in-memory class as this MAY differ from that stored
885
        **  The non-equestrian class does this.
888
        **  The non-equestrian class does this.
Line 908... Line 911...
908
 
911
 
909
        /*
912
        /*
910
        **  Now read in the team record
913
        **  Now read in the team record
911
        */
914
        */
912
        g_record( ptr->team, &team_buf );
915
        g_record( ptr->team, &team_buf );
-
 
916
        flags = ptr->flags.bad_times;
-
 
917
        if ( ptr->teamclass != config.nonequestrian_class )
-
 
918
        {
-
 
919
            flags |= ptr->flags.non_equestrian;
-
 
920
        }
913
 
921
 
914
        /*
922
        /*
915
        **  If printing an HTML report then we need to mark
923
        **  If printing an HTML report then we need to mark
916
        **  the entry with a reference so that we can link to it
924
        **  the entry with a reference so that we can link to it
917
        */
925
        */
Line 924... Line 932...
924
        **      - Team number - with HTML reference to team file
932
        **      - Team number - with HTML reference to team file
925
        **      - Class
933
        **      - Class
926
        */
934
        */
927
 
935
 
928
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
936
        if ( report_html == printed && lcount %5 == 4 ) print_underline( TRUE );
929
        print( "%4.4s ", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
937
        print( "%4.4s ", pr_place( team_buf.leg[0].lc_place, flags ) );
930
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
938
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "name" ,"html")), team_buf.numb );
931
        print( "%4d",  team_buf.numb );
939
        print( "%4d",  team_buf.numb );
932
        if ( report_html == html ) print( "</A>" );
940
        if ( report_html == html ) print( "</A>" );
933
        print( " %-*s", 3, team_buf.teamclass == 0 ? "" : config.team_class[team_buf.teamclass - 1].abr );
941
        print( " %-*s", 3, team_buf.teamclass == 0 ? "" : config.team_class[team_buf.teamclass - 1].abr );
934
 
942
 
Line 942... Line 950...
942
                print( "  %-8s %4.4s %4.4s", "-- NE --", "NE","NE");
950
                print( "  %-8s %4.4s %4.4s", "-- NE --", "NE","NE");
943
            }
951
            }
944
            else
952
            else
945
            {
953
            {
946
                print( "  %-8s %4.4s %4.4s", time_a( team_buf.leg[j].elapsed ),
954
                print( "  %-8s %4.4s %4.4s", time_a( team_buf.leg[j].elapsed ),
947
                       pr_place( team_buf.leg[j].lc_place,  ptr->flags.bad_times ),
955
                       pr_place( team_buf.leg[j].lc_place,  flags ),
948
                       pr_place( team_buf.leg[j].lec_place, ptr->flags.bad_times ) );
956
                       pr_place( team_buf.leg[j].lec_place, flags ) );
949
            }
957
            }
950
        }
958
        }
951
 
959
 
952
        /*
960
        /*
953
        **  Print the trailer
961
        **  Print the trailer
Line 956... Line 964...
956
        */
964
        */
957
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
965
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
958
        print( "  %-8s ", time_a( ptr->lege[0] ) );
966
        print( "  %-8s ", time_a( ptr->lege[0] ) );
959
 
967
 
960
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
968
        if ( report_html == html ) print( "<A HREF=\"%s#Team_%04d\">", url_encode(p_filename(filebase, "finish" ,"html")), team_buf.numb );
961
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times || (ptr->teamclass == config.nonequestrian_class)));
969
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, flags || (ptr->teamclass == config.nonequestrian_class)));
962
        if ( report_html == html ) print( "</A>" );
970
        if ( report_html == html ) print( "</A>" );
963
 
971
 
964
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
972
        if ( report_html == printed && lcount %5 == 4 ) print_underline( FALSE );
965
        lcount++;
973
        lcount++;
966
        print( "\n" );
974
        print( "\n" );
Line 1906... Line 1914...
1906
    csv_print( "%s", "Total Team Age");
1914
    csv_print( "%s", "Total Team Age");
1907
    csv_print( "%s", "Flag:valid Team");
1915
    csv_print( "%s", "Flag:valid Team");
1908
    csv_print( "%s", "Flag:bad_times" );
1916
    csv_print( "%s", "Flag:bad_times" );
1909
    csv_print( "%s", "Flag:disqualified" );
1917
    csv_print( "%s", "Flag:disqualified" );
1910
    csv_print( "%s", "Flag:non_equestrian" );
1918
    csv_print( "%s", "Flag:non_equestrian" );
-
 
1919
    csv_print( "%s", "Flag:vet_check" );
1911
    csv_print("\n");
1920
    csv_print("\n");
1912
 
1921
 
1913
 
1922
 
1914
    for( i = config.min_team; i <= config.max_team; i++ )
1923
    for( i = config.min_team; i <= config.max_team; i++ )
1915
    {
1924
    {
Line 1985... Line 1994...
1985
            csv_print( "%d", age_sum );
1994
            csv_print( "%d", age_sum );
1986
            csv_print( "%d", team_buf.flags.valid );
1995
            csv_print( "%d", team_buf.flags.valid );
1987
            csv_print( "%d", team_buf.flags.bad_times );
1996
            csv_print( "%d", team_buf.flags.bad_times );
1988
            csv_print( "%d", team_buf.flags.disqualified );
1997
            csv_print( "%d", team_buf.flags.disqualified );
1989
            csv_print( "%d", team_buf.flags.non_equestrian );
1998
            csv_print( "%d", team_buf.flags.non_equestrian );
-
 
1999
            csv_print( "%d", team_buf.flags.vet_check );
1990
 
2000
 
1991
//How about class placings
2001
//How about class placings
1992
 
2002
 
1993
 
2003
 
1994
            csv_print( "\n" );
2004
            csv_print( "\n" );
Line 2402... Line 2412...
2402
 
2412
 
2403
}
2413
}
2404
 
2414
 
2405
/*========================================================================
2415
/*========================================================================
2406
 *
2416
 *
2407
 *  Return place data
-
 
2408
 *
-
 
2409
 *  Purpose:
-
 
2410
 *      This function is called to Return place data
-
 
2411
 *
-
 
2412
 *      This routine is called to fill a print team_buffer - to allow for
-
 
2413
 *      multiple calls to this function ( before the data is used ) a number
-
 
2414
 *      of static team_buffers are maintained
-
 
2415
 *
-
 
2416
 *  Parameters:
-
 
2417
 *      num         place - if not bad_times
-
 
2418
 *      disq        Disqualified flag
-
 
2419
 *      ne          Non Equestrian Flag
-
 
2420
 *
-
 
2421
 *  Returns:
-
 
2422
 *      This function returns a pointer to the character string for the
-
 
2423
 *      number or a pointer to a bad_times string.
-
 
2424
 *
-
 
2425
 *========================================================================*/
-
 
2426
 
-
 
2427
const char *pr_place_ne( int num, int disq, int ne )
-
 
2428
{
-
 
2429
    static char store[2][5];                     /* 2 stores for 4 digit numbers */
-
 
2430
    static int  i = 0;                           /* Current index into store */
-
 
2431
    static const char *dis = "U";
-
 
2432
 
-
 
2433
    if( disq && ! ne )
-
 
2434
         return ( dis );
-
 
2435
 
-
 
2436
    if( ++i >= 2 )
-
 
2437
        i = 0;                                   /* Select next entry */
-
 
2438
    sprintf( store[i], "%4d", num );
-
 
2439
    return ( store[i] );
-
 
2440
 
-
 
2441
}
-
 
2442
 
-
 
2443
/*========================================================================
-
 
2444
 *
-
 
2445
 *  Check data for bad times
2417
 *  Check data for bad times
2446
 *
2418
 *
2447
 *  Purpose:
2419
 *  Purpose:
2448
 *      This function is called to Check data for bad times
2420
 *      This function is called to Check data for bad times
2449
 *      Scan the sort data structure and locate entries that have incorrect
2421
 *      Scan the sort data structure and locate entries that have incorrect
Line 2484... Line 2456...
2484
            t = ptr->lege;
2456
            t = ptr->lege;
2485
        else
2457
        else
2486
            t = ptr->leg;
2458
            t = ptr->leg;
2487
 
2459
 
2488
 
2460
 
2489
        if ( leg >= 0 )
-
 
2490
        {
-
 
2491
            ptr->flags.bad_times = (ptr->flags.disqualified && ! ptr->flags.non_equestrian );
2461
        ptr->flags.bad_times = ptr->flags.disqualified;
2492
        }
-
 
2493
        else
-
 
2494
        {
-
 
2495
            ptr->flags.bad_times = ptr->flags.disqualified /*|| ptr->flags.non_equestrian */;
-
 
2496
        }
-
 
2497
 
-
 
2498
        if( ! ptr->flags.bad_times )
2462
        if( ! ptr->flags.bad_times )
2499
        {
2463
        {
2500
            if( leg <= 0 )
2464
            if( leg <= 0 )
2501
            {
2465
            {
2502
                for( k = 0; k <= config.num_legs; k++ )
2466
                for( k = 0; k <= config.num_legs; k++ )
Line 2847... Line 2811...
2847
     * This simply the index into the array of data - after its been
2811
     * This simply the index into the array of data - after its been
2848
     * sorted.
2812
     * sorted.
2849
     */
2813
     */
2850
    ptr = sort_data;
2814
    ptr = sort_data;
2851
    for( j = 1; j <= sort_num; j++, ptr++ )
2815
    for( j = 1; j <= sort_num; j++, ptr++ )
-
 
2816
    {
2852
        ptr->place = j;
2817
        ptr->place = j;
-
 
2818
    }
2853
 
2819
 
2854
}
2820
}
2855
 
2821
 
2856
/*========================================================================
2822
/*========================================================================
2857
 *
2823
 *
Line 2864... Line 2830...
2864
 *      a       - 1st record
2830
 *      a       - 1st record
2865
 *      b       - 2nd record
2831
 *      b       - 2nd record
2866
 *
2832
 *
2867
 *  Returns:
2833
 *  Returns:
2868
 *      value to qsort
2834
 *      value to qsort
-
 
2835
 *      Return negative if 'a' is less than 'b',
-
 
2836
 *             zero if 'a' == 'b'
-
 
2837
 *             positive if 'a' > 'b'
2869
 *
2838
 *
2870
 *========================================================================*/
2839
 *========================================================================*/
2871
 
2840
 
2872
int sort_comp( const void * aa, const void * bb )
2841
int sort_comp( const void * aa, const void * bb )
2873
{
2842
{
Line 2903... Line 2872...
2903
    */
2872
    */
2904
    if( sort_mode == S_LEC || sort_mode == S_LC || sort_mode == S_LC_NE )   /* Sort within a class */
2873
    if( sort_mode == S_LEC || sort_mode == S_LC || sort_mode == S_LC_NE )   /* Sort within a class */
2905
        if( a->teamclass != b->teamclass )
2874
        if( a->teamclass != b->teamclass )
2906
            return ( a->teamclass - b->teamclass );
2875
            return ( a->teamclass - b->teamclass );
2907
 
2876
 
2908
#if 1
-
 
2909
    /*
2877
    /*
2910
    **  Always put the nonequestrian_class at the end
2878
    **  Always put the nonequestrian_class at the end
2911
    **  Simplifies the creation of ordered lists as these
2879
    **  Simplifies the creation of ordered lists as these
2912
    **  Entries are not present in the main body
2880
    **  Entries are not present in the main body
2913
    */
2881
    */
2914
    if ( a->teamclass == config.nonequestrian_class ||  b->teamclass == config.nonequestrian_class )
2882
    if ( a->teamclass == config.nonequestrian_class ||  b->teamclass == config.nonequestrian_class )
2915
    {
2883
    {
2916
        if ( a->teamclass == config.nonequestrian_class &&  b->teamclass == config.nonequestrian_class )
2884
        if ( a->teamclass == config.nonequestrian_class &&  b->teamclass == config.nonequestrian_class )
2917
        {
2885
        {
-
 
2886
            /*
-
 
2887
            **  Both are non equestrian
-
 
2888
            **      S_LC_NE - Elapsed times per class, with NE sorted by real class
-
 
2889
            **                Only used in awards
-
 
2890
            */
2918
            if (sort_mode == S_LC_NE )
2891
            if (sort_mode == S_LC_NE )
2919
            {
2892
            {
2920
                if ( a->real_teamclass != b->real_teamclass )
2893
                if ( a->real_teamclass != b->real_teamclass )
2921
                {
2894
                {
2922
                    return ( a->real_teamclass - b->real_teamclass );
2895
                    return ( a->real_teamclass - b->real_teamclass );
2923
                }
2896
                }
2924
            }
2897
            }
2925
        }
2898
        }
2926
        else
2899
        else
2927
        {
2900
        {
-
 
2901
            /*
-
 
2902
            **  Only one in non-equestrian
-
 
2903
            **  Place Non-equestrian AFTER equestrian
-
 
2904
            */
2928
            return ( a->teamclass == config.nonequestrian_class ? 1 : -1 );
2905
            return ( a->teamclass == config.nonequestrian_class ? 1 : -1 );
2929
        }
2906
        }
2930
 
2907
 
2931
    }
2908
    }
2932
#endif
-
 
2933
 
2909
 
2934
    /*
2910
    /*
2935
    **  Now we need to examine the times as we have sorted
2911
    **  Now we need to examine the times as we have sorted
2936
    **  on every thing else.
2912
    **  on every thing else.
2937
    **
2913
    **
Line 2941... Line 2917...
2941
    **  team number
2917
    **  team number
2942
    **
2918
    **
2943
    **  If not sorting within a class (ie Overall), then Non_Equestrian
2919
    **  If not sorting within a class (ie Overall), then Non_Equestrian
2944
    **  is better than a bad time. Places NE before disqualified
2920
    **  is better than a bad time. Places NE before disqualified
2945
    **
2921
    **
2946
    **
-
 
2947
    **  Note: NE also have bad_times set
-
 
2948
    */
2922
    */
2949
#if 1
-
 
2950
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
2923
    if( a->flags.bad_times || b->flags.bad_times || a->flags.non_equestrian || b->flags.non_equestrian)  /* Valid data has precedence */
2951
    {
2924
    {
2952
        if( a->flags.bad_times && b->flags.bad_times )
2925
        if( a->flags.bad_times && b->flags.bad_times )
2953
        {
2926
        {
2954
            if( a->flags.non_equestrian || b->flags.non_equestrian )
-
 
2955
            {
-
 
2956
                if( a->flags.non_equestrian && b->flags.non_equestrian )
-
 
2957
                {
-
 
2958
                    /*
-
 
2959
                    **  Both are non equestrian
-
 
2960
                    **  Let the time sort operate ...
-
 
2961
                    */
-
 
2962
                    //return ( a->team - b->team );
-
 
2963
                }
-
 
2964
                else
-
 
2965
                {
-
 
2966
                    /* One is equestrian */
-
 
2967
                    /* Good times better than NE */
-
 
2968
                    return ( a->flags.non_equestrian ? -1 : 1 );
-
 
2969
                }
-
 
2970
            }
-
 
2971
            else
-
 
2972
            {
-
 
2973
                /* Neither is equestrian */
-
 
2974
                return ( a->team - b->team );
-
 
2975
            }
-
 
2976
        }
-
 
2977
        else
-
 
2978
            return ( a->flags.bad_times ? 1 : -1 );
-
 
2979
    }
-
 
2980
#else
-
 
2981
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
-
 
2982
    {
-
 
2983
        if( a->flags.bad_times && b->flags.bad_times )
-
 
2984
            return ( a->team - b->team );
2927
            return ( a->team - b->team );
-
 
2928
        }
-
 
2929
        else if( a->flags.bad_times || b->flags.bad_times )
2985
        else
2930
        {
2986
            return ( a->flags.bad_times ? 1 : -1 );
2931
            return ( a->flags.bad_times ? 1 : -1 );
2987
    }
2932
        }
2988
 
-
 
2989
    /*
-
 
2990
    **  Not sorting within a class ie: Overall
-
 
2991
    **  Non-Equestrian is at the end, so that it doesn't get counted in the
-
 
2992
    **  finishing order
-
 
2993
    */
-
 
2994
    if( sort_mode == S_LE || sort_mode == S_L )     /* Sort NOT within a class */
2933
        if( sort_mode != S_FIN && sort_mode != S_IFIN )
2995
    {
-
 
2996
        if( a->flags.non_equestrian || b->flags.non_equestrian )
-
 
2997
        {
2934
        {
2998
            if( a->flags.non_equestrian && b->flags.non_equestrian )
2935
            if( a->flags.non_equestrian && b->flags.non_equestrian )
-
 
2936
            {
-
 
2937
                /*
-
 
2938
                **  Both are non equestrian
-
 
2939
                **  Let the time sort operate ...
-
 
2940
                */
2999
                return ( a->team - b->team );
2941
                //return ( a->team - b->team );
-
 
2942
            }
3000
            else
2943
            else
-
 
2944
            {
-
 
2945
                /* One is equestrian */
-
 
2946
                /* Good times better than NE */
3001
                return ( a->flags.non_equestrian ? 1 : -1 );
2947
                return ( a->flags.non_equestrian ? 1 : -1 );
-
 
2948
            }
3002
        }
2949
        }
3003
    }
2950
    }
3004
#endif
-
 
3005
 
2951
 
3006
    /*
2952
    /*
3007
    **  Before we sort on times we must determine which time to
2953
    **  Before we sort on times we must determine which time to
3008
    **  use. Finish time, Leg end times, Leg Elapsed times.
2954
    **  use. Finish time, Leg end times, Leg Elapsed times.
3009
    */
2955
    */
Line 3063... Line 3009...
3063
      **    Sort on Elapsed times
3009
      **    Sort on Elapsed times
3064
      */
3010
      */
3065
      case S_LC_NE:
3011
      case S_LC_NE:
3066
      case S_LC:
3012
      case S_LC:
3067
      case S_L:
3013
      case S_L:
-
 
3014
      case S_IFIN:
3068
        ta = a->lege[sort_leg];
3015
        ta = a->lege[sort_leg];
3069
        tb = b->lege[sort_leg];
3016
        tb = b->lege[sort_leg];
3070
        break;
3017
        break;
3071
 
3018
 
3072
      /*
3019
      /*
Line 3218... Line 3165...
3218
                ptr->start = team_buf.leg[0].start;
3165
                ptr->start = team_buf.leg[0].start;
3219
                ptr->teamclass = team_buf.teamclass;
3166
                ptr->teamclass = team_buf.teamclass;
3220
                ptr->real_teamclass = team_buf.teamclass;
3167
                ptr->real_teamclass = team_buf.teamclass;
3221
 
3168
 
3222
                ptr->flags = team_buf.flags;
3169
                ptr->flags = team_buf.flags;
3223
                if (ptr->flags.non_equestrian)
3170
//                if (ptr->flags.non_equestrian)
3224
                    ptr->flags.disqualified = true;
3171
//                    ptr->flags.disqualified = true;
3225
                if (ptr->flags.vet_check)
3172
                if (ptr->flags.vet_check)
3226
                    ptr->flags.disqualified = true;
3173
                    ptr->flags.disqualified = true;
-
 
3174
 
3227
                ptr++;
3175
                ptr++;
3228
                sort_num++;
3176
                sort_num++;
3229
 
3177
 
-
 
3178
 
3230
                /*
3179
                /*
3231
                **  If non-equestrian support is enabled then
3180
                **  If non-equestrian support is enabled then
3232
                **  duplicate and modify data for the non-equestrian teams
3181
                **  duplicate and modify data for the non-equestrian teams
3233
                **      - Change the class
3182
                **      - Change the class
3234
                **      - Modify the leg time
3183
                **      - Modify the leg time
Line 3259... Line 3208...
3259
 
3208
 
3260
                    last->start = ptr->start = team_buf.leg[0].start;
3209
                    last->start = ptr->start = team_buf.leg[0].start;
3261
                    ptr->teamclass = config.nonequestrian_class;
3210
                    ptr->teamclass = config.nonequestrian_class;
3262
                    ptr->real_teamclass = team_buf.teamclass;
3211
                    ptr->real_teamclass = team_buf.teamclass;
3263
                    ptr->flags = team_buf.flags;
3212
                    ptr->flags = team_buf.flags;
3264
                    ptr->flags.disqualified = false;
3213
//                    ptr->flags.disqualified = false;
3265
 
-
 
3266
 
3214
 
3267
                    ptr++;
3215
                    ptr++;
3268
                    sort_num++;
3216
                    sort_num++;
3269
                }
3217
                }
3270
#endif
3218
#endif
Line 3317... Line 3265...
3317
        **  of the data can be trusted.
3265
        **  of the data can be trusted.
3318
        **
3266
        **
3319
        **  If the team has been disqualified, then don't use any
3267
        **  If the team has been disqualified, then don't use any
3320
        **  of the data.
3268
        **  of the data.
3321
        */
3269
        */
3322
        if( ptr->flags.bad_times || ptr->flags.disqualified )
3270
        if( ptr->flags.bad_times || ptr->flags.disqualified  )
3323
            continue;
3271
            continue;
3324
 
3272
 
-
 
3273
        /*
-
 
3274
        **  Ignore non-Equestrian, unless we are processing the psuedo NE class
-
 
3275
        */
-
 
3276
        if ( ptr->teamclass != config.nonequestrian_class && ptr->flags.non_equestrian)
-
 
3277
            continue;
-
 
3278
 
-
 
3279
 
3325
        for( j = 0; j <= config.num_legs; j++ )
3280
        for( j = 0; j <= config.num_legs; j++ )
3326
        {
3281
        {
3327
            if( ptr->lege[j] <= 0 )              /* Ignore bad data */
3282
            if( ptr->lege[j] <= 0 )              /* Ignore bad data */
3328
                continue;
3283
                continue;
3329
 
3284