Subversion Repositories svn1

Rev

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

Rev 127 Rev 130
Line 44... Line 44...
44
menu_table  leg_menu[] = {
44
menu_table  leg_menu[] = {
45
    { '1', "Set start time from category", leg_start },
45
    { '1', "Set start time from category", leg_start },
46
    { '2', "Clear all leg times", leg_ini },
46
    { '2', "Clear all leg times", leg_ini },
47
    { '3', "Reset team information", tm_init },
47
    { '3', "Reset team information", tm_init },
48
    { '4', "Generate dummy team names", tm_gen },
48
    { '4', "Generate dummy team names", tm_gen },
49
    { '5', "Set calculated leg start", tm_lgs },
49
    //{ '5', "Set calculated leg start", tm_lgs },
50
    { '6', "Set ordered incremental leg start", tm_lgs1 },
50
    { '6', "Set ordered incremental leg start", tm_lgs1 },
51
    { '7', "Set staggered start time", tm_staggered },
51
    { '7', "Set staggered start time", tm_staggered },
52
    { '8', "Set fixed start time", tm_fixedstart },
52
    { '8', "Set fixed start time", tm_fixedstart },
53
    { '9', "Clear single leg start times", tm_clearleg },
53
    { '9', "Clear single leg start times", tm_clearleg },
54
    { 'q', "Return to main menu", 0 },
54
    { 'q', "Return to main menu", 0 },
Line 243... Line 243...
243
 *  Returns:
243
 *  Returns:
244
 *      Nothing
244
 *      Nothing
245
 *
245
 *
246
 *========================================================================*/
246
 *========================================================================*/
247
 
247
 
248
void tm_lgs(void)
248
void tm_lgs(int leg, time_t delta, bool report_it, bool clear_it)
249
{
249
{
250
    time_t      delta;                           /* The time delta */
-
 
251
    int         report_it = FALSE;               /* Report the operation */
-
 
252
    int         clear_it = FALSE;
-
 
253
    int         line = 5;                        /* Current line */
-
 
254
 
-
 
255
    cur( 0, line );
-
 
256
    while( TRUE )
-
 
257
    {
-
 
258
        leg = 0;
-
 
259
        d_field( 0, line, "Enter leg to set start time :", D_NUMBER, 1,
-
 
260
                 ( char * ) &leg, TRUE, M_UPDATE );
-
 
261
        if( leg == 0 )
-
 
262
            return;                              /* Null leg - just exit */
-
 
263
        if( leg <= config.num_legs )             /* Valid leg number - Exit loop */
-
 
264
            break;
-
 
265
        beep();                                  /* Make a noise and wait for valid number */
-
 
266
    }
-
 
267
 
-
 
268
 
-
 
269
    cur( 0, ++line );
-
 
270
    printf ( "Setting start times for all valid teams from %-d to %-d for leg %d\n",
-
 
271
                config.min_team, config.max_team, leg );
-
 
272
    delta = 0;
-
 
273
    line++;
-
 
274
    do
-
 
275
    {
-
 
276
        d_time( 0, line, "Enter the time difference : ", &delta, TRUE );
-
 
277
 
-
 
278
        if( abort_flag )
-
 
279
            return;
-
 
280
 
-
 
281
        if( delta < 0 )
-
 
282
            beep();
-
 
283
 
-
 
284
    } while( delta < 0 );
-
 
285
 
250
 
286
    line++;
-
 
287
    report_it = getyes( "\nGenerate leg start report" );
-
 
288
    if( abort_flag )
-
 
289
        return;
-
 
290
 
-
 
291
    line++;
-
 
292
    clear_it = getyes("Invalidate the leg start times" );
-
 
293
    if( abort_flag )
-
 
294
        return;
-
 
295
 
-
 
296
    line++;
-
 
297
    team = config.min_team;                      /* Team we are working with */
251
    team = config.min_team;                      /* Team we are working with */
298
    while( team <= config.max_team )
252
    while( team <= config.max_team )
299
    {
253
    {
300
        if( valid_field( team ) )
254
        if( valid_field( team ) )
301
        {
255
        {
Line 313... Line 267...
313
            put_team_record( team, &team_buf );
267
            put_team_record( team, &team_buf );
314
        }
268
        }
315
 
269
 
316
        if( team % 10 == 0 )
270
        if( team % 10 == 0 )
317
        {
271
        {
318
            cur( 0, line );
-
 
-
 
272
 
319
            printf( "Upto team %d", team );
273
            printf( "Upto team %d", team );
320
            flush_out();
274
            flush_out();
321
        }
275
        }
322
        team++;
276
        team++;
323
    }
277
    }
324
 
278
 
325
    if( report_it )
279
    if( report_it )
326
        legs_start_report(++line);
280
        legs_start_report(0);
327
 
281
 
328
    if ( clear_it )
282
    if ( clear_it )
329
        tm_clearleg_specified( leg, TRUE, ++line );
283
        tm_clearleg_specified( leg, TRUE, 0 );
330
}
284
}
331
 
285
 
332
/*========================================================================
286
/*========================================================================
333
 *
287
 *
334
 *  Set up the leg start times
288
 *  Set up the leg start times