Subversion Repositories svn1-original

Rev

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

Rev 172 Rev 174
Line 55... Line 55...
55
#include    <alloc.h>
55
#include    <alloc.h>
56
#endif
56
#endif
57
#include    "consts.h"
57
#include    "consts.h"
58
#include    "structs.h"
58
#include    "structs.h"
59
#include    "proto.h"
59
#include    "proto.h"
-
 
60
#include    "mainwindow.h"
60
 
61
 
61
void pri_awards_html(void);
62
void pri_awards_html(void);
62
void pri_awards(void);
63
void pri_awards(void);
63
void pri_master_index(void);
64
void pri_master_index(void);
64
char *placing ( int place );
65
char *placing ( int place );
Line 207... Line 208...
207
 *========================================================================*/
208
 *========================================================================*/
208
 
209
 
209
void pri_team(void)
210
void pri_team(void)
210
{
211
{
211
    int         i, k;
212
    int         i, k;
-
 
213
    team_type   team_buf;
212
 
214
 
213
    //cur( 0, 5 );
215
    //cur( 0, 5 );
214
    printf( "Team information - in team order\n" );
216
    printf( "Team information - in team order\n" );
215
    printf( "\nPrinting team names\n" );
217
    printf( "\nPrinting team names\n" );
216
    //flush_out();
218
    //flush_out();
Line 296... Line 298...
296
 *
298
 *
297
 *  Returns:
299
 *  Returns:
298
 *      Nothing
300
 *      Nothing
299
 *
301
 *
300
 *========================================================================*/
302
 *========================================================================*/
301
void pri_name_index( void )
303
//void pri_name_index( void )
302
{
304
//{
303
    //cur( 0, 5 );
305
//    //cur( 0, 5 );
304
    printf( "Team Member information - in name order\n" );
306
//    printf( "Team Member information - in name order\n" );
305
    printf( "\nPrinting competitor names\n" );
307
//    printf( "\nPrinting competitor names\n" );
306
    //flush_out();
308
//    //flush_out();
307
    pri_name_index_body();
309
//    pri_name_index_body();
308
    printf( "Found %d names\n", sort_num_data );
310
//    printf( "Found %d names\n", sort_num_data );
309
    printf( "\nAny key to continue" );
311
//    printf( "\nAny key to continue" );
310
    getinp();
312
//    getinp();
311
}
313
//}
312
 
314
 
313
/*========================================================================
315
/*========================================================================
314
 *
316
 *
315
 *  Print in name order
317
 *  Print in name order
316
 *
318
 *
Line 327... Line 329...
327
 *
329
 *
328
 *========================================================================*/
330
 *========================================================================*/
329
void pri_name_index_body( void )
331
void pri_name_index_body( void )
330
{
332
{
331
    ty_s_namedata *ptr;
333
    ty_s_namedata *ptr;
-
 
334
    team_type   team_buf;
332
    unsigned    num;
335
    unsigned    num;
333
    int i;
336
    int i;
334
    unsigned int k;
337
    unsigned int k;
335
    int num_names;
338
    int num_names;
336
 
339
 
Line 343... Line 346...
343
 
346
 
344
    sort_name_data = ( ty_s_namedata * ) calloc ( num , sizeof( ty_s_namedata ) );
347
    sort_name_data = ( ty_s_namedata * ) calloc ( num , sizeof( ty_s_namedata ) );
345
 
348
 
346
    if( sort_name_data == 0 )
349
    if( sort_name_data == 0 )
347
    {
350
    {
348
        printf( "\n\nError in allocating memory\n" );
351
        MainWindow::showMessage("Error in allocating memory");
349
        sleep( 5 );
-
 
350
        return;
352
        return;
351
    }
353
    }
352
 
354
 
353
    /*
355
    /*
354
    **  Read all teams an extract name information
356
    **  Read all teams an extract name information
Line 925... Line 927...
925
 *========================================================================*/
927
 *========================================================================*/
926
 
928
 
927
void pri_final(void)
929
void pri_final(void)
928
{
930
{
929
    ty_s_data  *ptr;
931
    ty_s_data  *ptr;
-
 
932
    team_type   team_buf;
930
    unsigned    i;
933
    unsigned    i;
931
    int         j, last_class;
934
    int         j, last_class;
932
    char        suppress_classes;                /* Boolean. Printout class files too */
935
    char        suppress_classes;                /* Boolean. Printout class files too */
933
    char        *report_title;
936
    char        *report_title;
934
    bool        class_done[MAX_CLASS+1];
937
    bool        class_done[MAX_CLASS+1];
Line 1284... Line 1287...
1284
    int i;
1287
    int i;
1285
    int k;
1288
    int k;
1286
    int windex;
1289
    int windex;
1287
    int winmax;
1290
    int winmax;
1288
    ty_s_data  *ptr;
1291
    ty_s_data  *ptr;
-
 
1292
    team_type   team_buf;
1289
    int         last_class;
1293
    int         last_class;
1290
    char    solid_line[100];
1294
    char    solid_line[100];
1291
 
1295
 
1292
    /*
1296
    /*
1293
    **  Calculate Summary information
1297
    **  Calculate Summary information
Line 1655... Line 1659...
1655
    }
1659
    }
1656
#endif
1660
#endif
1657
    print( "<tr><td>\n" );
1661
    print( "<tr><td>\n" );
1658
 
1662
 
1659
    print( "\n" );
1663
    print( "\n" );
1660
    for ( leg = 1; leg <= config.num_legs; leg ++ )
1664
    for ( int leg = 1; leg <= config.num_legs; leg ++ )
1661
    {
1665
    {
1662
        pri_master_index_entry( tprintf("lg%1.1d", leg), tprintf("Leg End Results for: %d", leg) );    
1666
        pri_master_index_entry( tprintf("lg%1.1d", leg), tprintf("Leg End Results for: %d", leg) );    
1663
    }
1667
    }
1664
 
1668
 
1665
    print( "<tr><td>\n" );
1669
    print( "<tr><td>\n" );
1666
    print( "\n" );
1670
    print( "\n" );
1667
    
1671
    
1668
    for ( leg = 1; leg <= config.num_legs; leg ++ )
1672
    for ( int leg = 1; leg <= config.num_legs; leg ++ )
1669
    {
1673
    {
1670
        pri_master_index_entry( tprintf("le%1.1d", leg), tprintf("Leg Elapsed Time Results for: %d", leg) );
1674
        pri_master_index_entry( tprintf("le%1.1d", leg), tprintf("Leg Elapsed Time Results for: %d", leg) );
1671
    }    
1675
    }    
1672
        
1676
        
1673
    
1677
    
Line 1694... Line 1698...
1694
 *========================================================================*/
1698
 *========================================================================*/
1695
 
1699
 
1696
void pri_interim(void)
1700
void pri_interim(void)
1697
{
1701
{
1698
    ty_s_data  *ptr;
1702
    ty_s_data  *ptr;
-
 
1703
    team_type   team_buf;
1699
    unsigned    i;
1704
    unsigned    i;
1700
    int         j, last_class;
1705
    int         j, last_class;
1701
    char        suppress_classes = FALSE;                /* Boolean. Printout class files too */
1706
    char        suppress_classes = FALSE;                /* Boolean. Printout class files too */
1702
    char       *report_title;
1707
    char       *report_title;
1703
 
1708
 
Line 1854... Line 1859...
1854
void pri_csv_data ( void )
1859
void pri_csv_data ( void )
1855
{
1860
{
1856
    int i;
1861
    int i;
1857
    int j;
1862
    int j;
1858
    int age_sum;
1863
    int age_sum;
-
 
1864
    team_type   team_buf;
1859
 
1865
 
1860
    /*
1866
    /*
1861
    **  Sort on every thing
1867
    **  Sort on every thing
1862
    **  Then generate all the stats too
1868
    **  Then generate all the stats too
1863
    */
1869
    */
Line 2636... Line 2642...
2636
 *========================================================================*/
2642
 *========================================================================*/
2637
 
2643
 
2638
void calc_class_summary( t_class_summary * ptr )
2644
void calc_class_summary( t_class_summary * ptr )
2639
{
2645
{
2640
    int i;
2646
    int i;
-
 
2647
    team_type   team_buf;
2641
 
2648
 
2642
    /*
2649
    /*
2643
    **  Reset the data
2650
    **  Reset the data
2644
    */
2651
    */
2645
    memset ( ptr, 0, sizeof (*ptr ));
2652
    memset ( ptr, 0, sizeof (*ptr ));
Line 2810... Line 2817...
2810
                                      data.total.total,
2817
                                      data.total.total,
2811
                                      data.total.disqualified,
2818
                                      data.total.disqualified,
2812
                                      data.total.non_equestrian );
2819
                                      data.total.non_equestrian );
2813
 
2820
 
2814
    close_printer();
2821
    close_printer();
2815
    if ( !report_all )
2822
//    if ( !report_all )
2816
    {
2823
//    {
2817
        printf( "\nAny key to continue " );
2824
//        printf( "\nAny key to continue " );
2818
        getinp();
2825
//        getinp();
2819
    }
2826
//    }
2820
}
2827
}
2821
 
2828
 
2822
 
2829
 
2823
 
2830
 
2824
/*========================================================================
2831
/*========================================================================
Line 2841... Line 2848...
2841
{
2848
{
2842
    int         i, k;                            /* Looooopy things */
2849
    int         i, k;                            /* Looooopy things */
2843
    unsigned    j;
2850
    unsigned    j;
2844
    ty_s_data  *ptr;                             /* Pointer to sort data */
2851
    ty_s_data  *ptr;                             /* Pointer to sort data */
2845
    int         teamclass;                           /* Current class */
2852
    int         teamclass;                           /* Current class */
-
 
2853
    team_type   team_buf;
2846
 
2854
 
2847
//    printf( "Sorting it ALL out" );
2855
//    printf( "Sorting it ALL out" );
2848
//    flush_out();
2856
//    flush_out();
2849
 
2857
 
2850
    for( i = 0; i <= config.num_legs; i++ )
2858
    for( i = 0; i <= config.num_legs; i++ )
Line 3263... Line 3271...
3263
 
3271
 
3264
    ty_s_data  *ptr;                             /* pointer to sort data type */
3272
    ty_s_data  *ptr;                             /* pointer to sort data type */
3265
    ty_s_data  *last;
3273
    ty_s_data  *last;
3266
    int         j;
3274
    int         j;
3267
    unsigned    num;
3275
    unsigned    num;
-
 
3276
    team_type   team_buf;
3268
 
3277
 
3269
    //printf( "Loading team information - This will not hurt" );
3278
    //printf( "Loading team information - This will not hurt" );
3270
    //flush_out();
3279
    //flush_out();
3271
 
3280
 
3272
    /*
3281
    /*
Line 3297... Line 3306...
3297
    sort_data = ( ty_s_data * ) calloc ( num , sizeof( ty_s_data ) );
3306
    sort_data = ( ty_s_data * ) calloc ( num , sizeof( ty_s_data ) );
3298
    sort_aux = ( ty_s_aux * ) calloc( num + 1, sizeof( ty_s_aux ) );
3307
    sort_aux = ( ty_s_aux * ) calloc( num + 1, sizeof( ty_s_aux ) );
3299
 
3308
 
3300
    if( sort_data == 0 || sort_aux == 0 )
3309
    if( sort_data == 0 || sort_aux == 0 )
3301
    {
3310
    {
3302
        printf( "Error in allocating memory" );
3311
        MainWindow::showMessage("Error in allocating memory");
3303
        sleep( 5 );
-
 
3304
        return ( FALSE );
3312
        return ( FALSE );
3305
    }
3313
    }
3306
 
3314
 
3307
    /*
3315
    /*
3308
    **  Load data into the memory based data structure
3316
    **  Load data into the memory based data structure
Line 3310... Line 3318...
3310
    **  Load essential data
3318
    **  Load essential data
3311
    **      Team Number, class and flags
3319
    **      Team Number, class and flags
3312
    **      Leg end and elapsed times
3320
    **      Leg end and elapsed times
3313
    */
3321
    */
3314
    ptr = sort_data;
3322
    ptr = sort_data;
3315
    for( team = config.min_team; team <= config.max_team; team++ )
3323
    for( int team = config.min_team; team <= config.max_team; team++ )
3316
    {
3324
    {
3317
        if( valid_field( team ) )
3325
        if( valid_field( team ) )
3318
        {
3326
        {
3319
            g_record( team, &team_buf );
3327
            g_record( team, &team_buf );
3320
            if( team_buf.flags.valid )
3328
            if( team_buf.flags.valid )