- static final Font label_font = new Font("Dialog", Font.PLAIN, 22);
- static final Font value_font = new Font("Monospaced", Font.PLAIN, 22);
- static final Font status_font = new Font("SansSerif", Font.BOLD, 24);
-
- static final int text_width = 16;
-
- static void initialize_map()
- {
- string_to_state.put("startup", ao_flight_startup);
- string_to_state.put("idle", ao_flight_idle);
- string_to_state.put("pad", ao_flight_pad);
- string_to_state.put("boost", ao_flight_boost);
- string_to_state.put("fast", ao_flight_fast);
- string_to_state.put("coast", ao_flight_coast);
- string_to_state.put("drogue", ao_flight_drogue);
- string_to_state.put("main", ao_flight_main);
- string_to_state.put("landed", ao_flight_landed);
- string_to_state.put("invalid", ao_flight_invalid);
- map_initialized = true;
- }
-
- static String[] state_to_string = {
- "startup",
- "idle",
- "pad",
- "boost",
- "fast",
- "coast",
- "drogue",
- "main",
- "landed",
- "invalid",
- };
-
- static public int state(String state) {
- if (!map_initialized)
- initialize_map();
- if (string_to_state.containsKey(state))
- return string_to_state.get(state);
- return ao_flight_invalid;
- }
-
- static public String state_name(int state) {
- if (state < 0 || state_to_string.length <= state)
- return "invalid";
- return state_to_string[state];
- }
-
- static final int AO_GPS_VALID = (1 << 4);
- static final int AO_GPS_RUNNING = (1 << 5);
- static final int AO_GPS_DATE_VALID = (1 << 6);
- static final int AO_GPS_NUM_SAT_SHIFT = 0;
- static final int AO_GPS_NUM_SAT_MASK = 0xf;
-
- static boolean isspace(int c) {
- switch (c) {
- case ' ':
- case '\t':
- return true;
+ static Font label_font;
+ static Font value_font;
+ static Font status_font;
+ static Font table_label_font;
+ static Font table_value_font;
+
+ final static int font_size_small = 1;
+ final static int font_size_medium = 2;
+ final static int font_size_large = 3;
+
+ static void set_fonts(int size) {
+ int brief_size;
+ int table_size;
+ int status_size;
+
+ switch (size) {
+ case font_size_small:
+ brief_size = 16;
+ status_size = 18;
+ table_size = 11;
+ break;
+ default:
+ case font_size_medium:
+ brief_size = 22;
+ status_size = 24;
+ table_size = 14;
+ break;
+ case font_size_large:
+ brief_size = 26;
+ status_size = 30;
+ table_size = 17;
+ break;