Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
* src/live-f1.h (EventType): Qualifying has changed to event
Browse files Browse the repository at this point in the history
type 3 this year.
* src/packet.h (QualifyingAtomType): Also has its own headers and
doesn't just reuse the practice ones; seems to be three columns
for the period times, and the usual three sector columns.
* src/display.c (clear_board): Write different headers out.
(_update_cell): Handle the new qualy table format.
(TextColour): Add new "eliminated" colour used after people have
been knocked out of qualifying, otherwise we end up leaking into
our own colours.
(open_display): Define eliminated colour.
  • Loading branch information
keybuk committed Mar 11, 2006
1 parent ae5ba45 commit cb68fdc
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 6 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
2006-03-11 Scott James Remnant <scott@netsplit.com>

* src/live-f1.h (EventType): Qualifying has changed to event
type 3 this year.
* src/packet.h (QualifyingAtomType): Also has its own headers and
doesn't just reuse the practice ones; seems to be three columns
for the period times, and the usual three sector columns.
* src/display.c (clear_board): Write different headers out.
(_update_cell): Handle the new qualy table format.
(TextColour): Add new "eliminated" colour used after people have
been knocked out of qualifying, otherwise we end up leaking into
our own colours.
(open_display): Define eliminated colour.

* src/cfgfile.c: Include unistd.h for definition of close().

2006-03-07 Scott James Remnant <scott@netsplit.com>
Expand Down
69 changes: 67 additions & 2 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef enum {
COLOUR_RECORD,
COLOUR_DATA,
COLOUR_OLD,
COLOUR_ELIMINATED,
COLOUR_POPUP,
COLOUR_GREEN_FLAG,
COLOUR_YELLOW_FLAG,
Expand Down Expand Up @@ -104,6 +105,7 @@ open_display (void)
attrs[COLOUR_RECORD] = A_STANDOUT | A_BOLD;
attrs[COLOUR_DATA] = A_NORMAL;
attrs[COLOUR_OLD] = A_DIM;
attrs[COLOUR_ELIMINATED] = A_DIM;
attrs[COLOUR_POPUP] = A_REVERSE;
attrs[COLOUR_GREEN_FLAG] = A_NORMAL;
attrs[COLOUR_YELLOW_FLAG] = A_BOLD;
Expand All @@ -116,6 +118,7 @@ open_display (void)
init_pair (COLOUR_RECORD, COLOR_MAGENTA, COLOR_BLACK);
init_pair (COLOUR_DATA, COLOR_CYAN, COLOR_BLACK);
init_pair (COLOUR_OLD, COLOR_YELLOW, COLOR_BLACK);
init_pair (COLOUR_ELIMINATED, COLOR_BLACK, COLOR_BLACK);
init_pair (COLOUR_POPUP, COLOR_WHITE, COLOR_BLUE);
init_pair (COLOUR_GREEN_FLAG, COLOR_GREEN, COLOR_BLACK);
init_pair (COLOUR_YELLOW_FLAG, COLOR_YELLOW, COLOR_BLACK);
Expand All @@ -128,6 +131,7 @@ open_display (void)
attrs[COLOUR_RECORD] = COLOR_PAIR (COLOUR_RECORD);
attrs[COLOUR_DATA] = COLOR_PAIR (COLOUR_DATA);
attrs[COLOUR_OLD] = COLOR_PAIR (COLOUR_OLD);
attrs[COLOUR_ELIMINATED] = COLOR_PAIR (COLOUR_ELIMINATED) | A_BOLD;
attrs[COLOUR_POPUP] = COLOR_PAIR (COLOUR_POPUP) | A_BOLD;
attrs[COLOUR_GREEN_FLAG] = COLOR_PAIR (COLOUR_GREEN_FLAG);
attrs[COLOUR_YELLOW_FLAG] = COLOR_PAIR (COLOUR_YELLOW_FLAG);
Expand Down Expand Up @@ -189,12 +193,18 @@ clear_board (CurrentState *state)
_("Sector 3"), _("Ps"));
break;
case PRACTICE_EVENT:
case QUALIFYING_EVENT:
mvwprintw (boardwin, 0, 0,
"%2s %2s %-14s %-8s %6s %5s %5s %5s %-4s",
_("P"), _(""), _("Name"), _("Best"), _("Gap"),
_("Sec 1"), _("Sec 2"), _("Sec 3"), _("Laps"));
break;
case QUALIFYING_EVENT:
mvwprintw (boardwin, 0, 0,
"%2s %2s %-14s %-8s %-8s %-8s %5s %5s %5s %-2s",
_("P"), _(""), _("Name"), _("Period 1"),
_("Pediod 2"), _("Period 3"), _("Sec 1"),
_("Sec 2"), _("Sec 3"), _("Ls"));
break;
}

for (i = 1; i <= state->num_cars; i++) {
Expand Down Expand Up @@ -312,7 +322,6 @@ _update_cell (CurrentState *state,
}
break;
case PRACTICE_EVENT:
case QUALIFYING_EVENT:
switch ((PracticeAtomType) type) {
case PRACTICE_POSITION:
x = 0;
Expand Down Expand Up @@ -363,6 +372,62 @@ _update_cell (CurrentState *state,
return;
}
break;
case QUALIFYING_EVENT:
switch ((QualifyingAtomType) type) {
case QUALIFYING_POSITION:
x = 0;
sz = 2;
align = 1;
break;
case QUALIFYING_NUMBER:
x = 3;
sz = 2;
align = 1;
break;
case QUALIFYING_DRIVER:
x = 6;
sz = 14;
align = -1;
break;
case QUALIFYING_PERIOD_1:
x = 21;
sz = 8;
align = 1;
break;
case QUALIFYING_PERIOD_2:
x = 30;
sz = 8;
align = 1;
break;
case QUALIFYING_PERIOD_3:
x = 39;
sz = 8;
align = 1;
break;
case QUALIFYING_SECTOR_1:
x = 48;
sz = 5;
align = 1;
break;
case QUALIFYING_SECTOR_2:
x = 54;
sz = 5;
align = 1;
break;
case QUALIFYING_SECTOR_3:
x = 60;
sz = 5;
align = 1;
break;
case QUALIFYING_LAPS:
x = 66;
sz = 2;
align = 1;
break;
default:
return;
}
break;
default:
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/live-f1.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* live-f1
*
* Copyright © 2005 Scott James Remnant <scott@netsplit.com>.
* Copyright © 2006 Scott James Remnant <scott@netsplit.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -43,7 +43,7 @@
typedef enum {
RACE_EVENT = 1,
PRACTICE_EVENT = 2,
QUALIFYING_EVENT = 4
QUALIFYING_EVENT = 3
} EventType;

/**
Expand Down
23 changes: 21 additions & 2 deletions src/packet.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* live-f1
*
* Copyright © 2005 Scott James Remnant <scott@netsplit.com>.
* Copyright © 2006 Scott James Remnant <scott@netsplit.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -59,7 +59,7 @@ typedef enum {
/**
* PracticeAtomType:
*
* Known types of data atoms for cars during a practice or qualifying event.
* Known types of data atoms for cars during a practice event.
**/
typedef enum {
PRACTICE_POSITION = 1,
Expand All @@ -75,6 +75,25 @@ typedef enum {
LAST_PRACTICE
} PracticeAtomType;

/**
* QualifyingAtomType:
*
* Known types of data atoms for cars during a qualifying event.
**/
typedef enum {
QUALIFYING_POSITION = 1,
QUALIFYING_NUMBER,
QUALIFYING_DRIVER,
QUALIFYING_PERIOD_1,
QUALIFYING_PERIOD_2,
QUALIFYING_PERIOD_3,
QUALIFYING_SECTOR_1,
QUALIFYING_SECTOR_2,
QUALIFYING_SECTOR_3,
QUALIFYING_LAPS,
LAST_QUALIFYING
} QualifyingAtomType;


/**
* SystemPacketType:
Expand Down

0 comments on commit cb68fdc

Please sign in to comment.