Subversion Repositories svn1

Rev

Rev 383 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 383 Rev 384
Line 57... Line 57...
57
 *  Returns:
57
 *  Returns:
58
 *      Nothing
58
 *      Nothing
59
 *
59
 *
60
 *========================================================================*/
60
 *========================================================================*/
61
 
61
 
62
void tm_lgs1(int leg, time_t starttime, time_t delta, bool report_it, bool clear_it)
62
void tm_lgs1(int leg, maraTime_t starttime, maraTime_t delta, bool report_it, bool clear_it)
63
{
63
{
64
    t_legs     *data;                            /* Address of table */
64
    t_legs     *data;                            /* Address of table */
65
    t_legs     *dptr;                            /* Moving pointer */
65
    t_legs     *dptr;                            /* Moving pointer */
66
    int         num_records;                     /* Number of records in array */
66
    int         num_records;                     /* Number of records in array */
67
    int         i;
67
    int         i;
Line 152... Line 152...
152
 *  Returns:
152
 *  Returns:
153
 *      Nothing
153
 *      Nothing
154
 *
154
 *
155
 *========================================================================*/
155
 *========================================================================*/
156
 
156
 
157
void tm_lgs(int leg, time_t delta, bool report_it, bool clear_it)
157
void tm_lgs(int leg, maraTime_t delta, bool report_it, bool clear_it)
158
{
158
{
159
    team_type   team_buf;
159
    team_type   team_buf;
160
    int team = config.min_team;                      /* Team we are working with */
160
    int team = config.min_team;                      /* Team we are working with */
161
    while( team <= config.max_team )
161
    while( team <= config.max_team )
162
    {
162
    {
Line 167... Line 167...
167
            {
167
            {
168
                team_buf.leg[leg].start = team_buf.leg[leg - 1].end + delta;
168
                team_buf.leg[leg].start = team_buf.leg[leg - 1].end + delta;
169
                team_buf.leg[leg].manual = TRUE;
169
                team_buf.leg[leg].manual = TRUE;
170
            }
170
            }
171
            else
171
            else
172
                team_buf.leg[leg].start = ( time_t ) - 1;
172
                team_buf.leg[leg].start = ( maraTime_t ) - 1;
173
 
173
 
174
            set_times( &team_buf );
174
            set_times( &team_buf );
175
            test_times( &team_buf, 0 );
175
            test_times( &team_buf, 0 );
176
            put_team_record( team, &team_buf );
176
            put_team_record( team, &team_buf );
177
        }
177
        }
Line 211... Line 211...
211
            ( void ) g_record( team, &team_buf );
211
            ( void ) g_record( team, &team_buf );
212
            if( team_buf.teamclass > 0 && team_buf.teamclass <= config.num_class )
212
            if( team_buf.teamclass > 0 && team_buf.teamclass <= config.num_class )
213
                team_buf.leg[0].start =
213
                team_buf.leg[0].start =
214
                    config.team_class[team_buf.teamclass - 1].start;
214
                    config.team_class[team_buf.teamclass - 1].start;
215
            else
215
            else
216
                team_buf.leg[0].start = ( time_t ) - 1;
216
                team_buf.leg[0].start = ( maraTime_t ) - 1;
217
            team_buf.leg[1].manual = 0;
217
            team_buf.leg[1].manual = 0;
218
            team_buf.leg[1].start = team_buf.leg[0].start;
218
            team_buf.leg[1].start = team_buf.leg[0].start;
219
            team_buf.leg[0].l_place = 0;
219
            team_buf.leg[0].l_place = 0;
220
            team_buf.leg[0].le_place = 0;
220
            team_buf.leg[0].le_place = 0;
221
            team_buf.leg[0].lec_place = 0;
221
            team_buf.leg[0].lec_place = 0;
Line 243... Line 243...
243
 *  Returns:
243
 *  Returns:
244
 *      Nothing
244
 *      Nothing
245
 *
245
 *
246
 *========================================================================*/
246
 *========================================================================*/
247
 
247
 
248
void tm_fixedstart(int leg, time_t starttime, bool report_it, bool clear_it)
248
void tm_fixedstart(int leg, maraTime_t starttime, bool report_it, bool clear_it)
249
{
249
{
250
    team_type   team_buf;
250
    team_type   team_buf;
251
    int team = config.min_team;                      /* Team we are working with */
251
    int team = config.min_team;                      /* Team we are working with */
252
    while( team <= config.max_team )
252
    while( team <= config.max_team )
253
    {
253
    {
Line 258... Line 258...
258
            {
258
            {
259
                team_buf.leg[leg].start = starttime;
259
                team_buf.leg[leg].start = starttime;
260
                team_buf.leg[leg].manual = TRUE;
260
                team_buf.leg[leg].manual = TRUE;
261
            }
261
            }
262
            else
262
            else
263
                team_buf.leg[leg].start = ( time_t ) - 1;
263
                team_buf.leg[leg].start = ( maraTime_t ) - 1;
264
 
264
 
265
            set_times( &team_buf );
265
            set_times( &team_buf );
266
            test_times( &team_buf, 0 );
266
            test_times( &team_buf, 0 );
267
            put_team_record( team, &team_buf );
267
            put_team_record( team, &team_buf );
268
        }
268
        }
Line 290... Line 290...
290
 *  Returns:
290
 *  Returns:
291
 *      Nothing
291
 *      Nothing
292
 *
292
 *
293
 *========================================================================*/
293
 *========================================================================*/
294
 
294
 
295
void tm_staggered(int leg, time_t starttime, time_t delta, bool report_it, bool clear_it )
295
void tm_staggered(int leg, maraTime_t starttime, maraTime_t delta, bool report_it, bool clear_it )
296
{
296
{
297
    team_type   team_buf;
297
    team_type   team_buf;
298
    int team = config.min_team;                      /* Team we are working with */
298
    int team = config.min_team;                      /* Team we are working with */
299
    while( team <= config.max_team )
299
    while( team <= config.max_team )
300
    {
300
    {
Line 306... Line 306...
306
                team_buf.leg[leg].start = starttime;
306
                team_buf.leg[leg].start = starttime;
307
                starttime += delta;
307
                starttime += delta;
308
                team_buf.leg[leg].manual = TRUE;
308
                team_buf.leg[leg].manual = TRUE;
309
            }
309
            }
310
            else
310
            else
311
                team_buf.leg[leg].start = ( time_t ) - 1;
311
                team_buf.leg[leg].start = ( maraTime_t ) - 1;
312
 
312
 
313
            set_times( &team_buf );
313
            set_times( &team_buf );
314
            test_times( &team_buf, 0 );
314
            test_times( &team_buf, 0 );
315
            put_team_record( team, &team_buf );
315
            put_team_record( team, &team_buf );
316
        }
316
        }
Line 357... Line 357...
357
    {
357
    {
358
        if( valid_field( team ) )
358
        if( valid_field( team ) )
359
        {
359
        {
360
            g_record( team, &team_buf );
360
            g_record( team, &team_buf );
361
            team_buf.leg[leg].manual = manual;
361
            team_buf.leg[leg].manual = manual;
362
            team_buf.leg[leg].start = ( time_t ) -1;
362
            team_buf.leg[leg].start = ( maraTime_t ) -1;
363
            
363
            
364
            set_times( &team_buf );
364
            set_times( &team_buf );
365
            test_times( &team_buf, 0 );
365
            test_times( &team_buf, 0 );
366
            put_team_record( team, &team_buf );
366
            put_team_record( team, &team_buf );
367
        }
367
        }
Line 398... Line 398...
398
        {
398
        {
399
            ( void ) g_record( team, &team_buf );
399
            ( void ) g_record( team, &team_buf );
400
            for( i = 0; i <= MAX_LEGS; i++ )
400
            for( i = 0; i <= MAX_LEGS; i++ )
401
            {
401
            {
402
                team_buf.leg[i].start = team_buf.leg[i].end =
402
                team_buf.leg[i].start = team_buf.leg[i].end =
403
                    team_buf.leg[i].elapsed = ( time_t ) - 1;
403
                    team_buf.leg[i].elapsed = ( maraTime_t ) - 1;
404
                team_buf.leg[i].l_place = 0;
404
                team_buf.leg[i].l_place = 0;
405
                team_buf.leg[i].le_place = 0;
405
                team_buf.leg[i].le_place = 0;
406
                team_buf.leg[i].lec_place = 0;
406
                team_buf.leg[i].lec_place = 0;
407
                team_buf.leg[i].lc_place = 0;
407
                team_buf.leg[i].lc_place = 0;
408
                team_buf.leg[i].manual = FALSE;
408
                team_buf.leg[i].manual = FALSE;
409
            }
409
            }
410
            if( team_buf.teamclass > 0 && team_buf.teamclass <= config.num_class )
410
            if( team_buf.teamclass > 0 && team_buf.teamclass <= config.num_class )
411
                team_buf.leg[0].start =
411
                team_buf.leg[0].start =
412
                    config.team_class[team_buf.teamclass - 1].start;
412
                    config.team_class[team_buf.teamclass - 1].start;
413
            else
413
            else
414
                team_buf.leg[0].start = ( time_t ) - 1;
414
                team_buf.leg[0].start = ( maraTime_t ) - 1;
415
 
415
 
416
            team_buf.leg[1].start = team_buf.leg[0].start;
416
            team_buf.leg[1].start = team_buf.leg[0].start;
417
            team_buf.flags.disqualified = FALSE;
417
            team_buf.flags.disqualified = FALSE;
418
            team_buf.flags.non_equestrian = FALSE;
418
            team_buf.flags.non_equestrian = FALSE;
419
            put_team_record( team, &team_buf );
419
            put_team_record( team, &team_buf );
Line 741... Line 741...
741
 *
741
 *
742
 *========================================================================*/
742
 *========================================================================*/
743
 
743
 
744
void ls_timer( t_legs * ptr, int num, bool suppress )
744
void ls_timer( t_legs * ptr, int num, bool suppress )
745
{
745
{
746
    time_t      time;
746
    maraTime_t      time;
747
    time_t      delta;
747
    maraTime_t      delta;
748
    bool        flags;
748
    bool        flags;
749
 
749
 
750
    if ( suppress )
750
    if ( suppress )
751
    {
751
    {
752
        print( "%-8s   %-5s", "","");
752
        print( "%-8s   %-5s", "","");
753
        print( "   %-8s", "");
753
        print( "   %-8s", "");
754
        return;
754
        return;
755
    }
755
    }
756
 
756
 
757
    if( num == 0 )
757
    if( num == 0 )
758
        delta = ( time_t ) - 1;
758
        delta = ( maraTime_t ) - 1;
759
    else
759
    else
760
        delta = ptr[0].start - ptr[-1].start;
760
        delta = ptr[0].start - ptr[-1].start;
761
 
761
 
762
    time = ptr->start;
762
    time = ptr->start;
763
    flags =  ptr->flags.disqualified;
763
    flags =  ptr->flags.disqualified;
764
    if(flags)
764
    if(flags)
765
        time = ( time_t ) - 1;
765
        time = ( maraTime_t ) - 1;
766
 
766
 
767
    print( "%-8s   %-5d", time_fa( time, flags ), ptr->numb );
767
    print( "%-8s   %-5d", time_fa( time, flags ), ptr->numb );
768
    print( "   %-8s", time_fa( delta, TRUE ) );
768
    print( "   %-8s", time_fa( delta, TRUE ) );
769
}
769
}
770
 
770
 
Line 786... Line 786...
786
 *
786
 *
787
 *========================================================================*/
787
 *========================================================================*/
788
 
788
 
789
void ls_timer_short( t_legs * ptr, int num, bool suppress )
789
void ls_timer_short( t_legs * ptr, int num, bool suppress )
790
{
790
{
791
    time_t      time;
791
    maraTime_t      time;
792
    bool        flags;
792
    bool        flags;
793
 
793
 
794
    if ( suppress )
794
    if ( suppress )
795
    {
795
    {
796
        print( "%-8s   %-5s", "","");
796
        print( "%-8s   %-5s", "","");
Line 798... Line 798...
798
    }
798
    }
799
 
799
 
800
    time = ptr->start;
800
    time = ptr->start;
801
    flags =  ptr->flags.disqualified;
801
    flags =  ptr->flags.disqualified;
802
    if(flags)
802
    if(flags)
803
        time = ( time_t ) - 1;
803
        time = ( maraTime_t ) - 1;
804
 
804
 
805
    print( "%-8s   %-5d", time_fa( time, flags ), ptr->numb );
805
    print( "%-8s   %-5d", time_fa( time, flags ), ptr->numb );
806
}
806
}
807
 
807
 
808
 
808
 
Line 825... Line 825...
825
 *========================================================================*/
825
 *========================================================================*/
826
 
826
 
827
void ls_team( int *last, t_legs * data )
827
void ls_team( int *last, t_legs * data )
828
{
828
{
829
    t_legs     *min;
829
    t_legs     *min;
830
    time_t      time;
830
    maraTime_t      time;
831
    bool        flags;
831
    bool        flags;
832
 
832
 
833
    for( min = 0; data->numb; data++ )
833
    for( min = 0; data->numb; data++ )
834
    {
834
    {
835
        if( data->numb > *last && ( min == 0 || data->numb < min->numb ) )
835
        if( data->numb > *last && ( min == 0 || data->numb < min->numb ) )
Line 838... Line 838...
838
    *last = min->numb;                           /* Save current team as done */
838
    *last = min->numb;                           /* Save current team as done */
839
 
839
 
840
    time = min->start;
840
    time = min->start;
841
    flags =  min->flags.disqualified;
841
    flags =  min->flags.disqualified;
842
    if( flags )
842
    if( flags )
843
        time = ( time_t ) - 1;
843
        time = ( maraTime_t ) - 1;
844
    print( "%-5d   %-8s", min->numb, time_fa( time, flags ) );
844
    print( "%-5d   %-8s", min->numb, time_fa( time, flags ) );
845
}
845
}
846
 
846
 
847
/*========================================================================
847
/*========================================================================
848
 *
848
 *
Line 862... Line 862...
862
 *
862
 *
863
 *========================================================================*/
863
 *========================================================================*/
864
 
864
 
865
void ls_team_short( t_legs * ptr, int num, bool suppress )
865
void ls_team_short( t_legs * ptr, int num, bool suppress )
866
{
866
{
867
    time_t      time;
867
    maraTime_t      time;
868
    bool        flags;
868
    bool        flags;
869
 
869
 
870
    if ( suppress )
870
    if ( suppress )
871
    {
871
    {
872
        print( "%-5s   %-8s", "","");
872
        print( "%-5s   %-8s", "","");
Line 874... Line 874...
874
    }
874
    }
875
 
875
 
876
    time = ptr->start;
876
    time = ptr->start;
877
    flags =  ptr->flags.disqualified;
877
    flags =  ptr->flags.disqualified;
878
    if(flags)
878
    if(flags)
879
        time = ( time_t ) - 1;
879
        time = ( maraTime_t ) - 1;
880
 
880
 
881
    print( "%-5d   %-8s", ptr->numb, time_fa( time, flags ) );
881
    print( "%-5d   %-8s", ptr->numb, time_fa( time, flags ) );
882
}
882
}
883
 
883
 
884
 
884