From 1cf8b4ecd92f49dfbbe0472e02d4e5bc8841fe2f Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sat, 27 Jun 2009 01:36:39 +0000 Subject: [PATCH] * Removing glade (pure gtk-builder) * Actions * List stores * Offline mode --- Makefile.am | 3 +- data/Makefile.am | 7 +- data/{about.glade => about.ui} | 33 +-- data/main.glade | 368 -------------------------- data/main.ui | 346 +++++++++++++++++++++++++ src/Makefile.am | 2 +- src/aweather-gui.c | 94 ++++--- src/aweather-gui.h | 1 + src/aweather-view.c | 17 +- src/aweather-view.h | 11 +- src/data.c | 17 +- src/location.c | 456 ++++++++++++++++----------------- src/main.c | 17 +- src/plugin-radar.c | 100 +++++--- src/plugin-ridge.c | 10 +- 15 files changed, 763 insertions(+), 719 deletions(-) rename data/{about.glade => about.ui} (97%) delete mode 100644 data/main.glade create mode 100644 data/main.ui diff --git a/Makefile.am b/Makefile.am index 47470fb..c784619 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,5 +4,4 @@ MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.h.in gtk-doc.make configure depcomp install-sh Makefile.in missing test: all - ./src/aweather -d 7 - + (cd src && make test) diff --git a/data/Makefile.am b/data/Makefile.am index b0e77d7..48ba9b0 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,10 +1,5 @@ gtkbuilderdir = $(datadir)/aweather/ -dist_gtkbuilder_DATA = main.xml about.xml +dist_gtkbuilder_DATA = main.ui about.ui -.glade.xml: - gtk-builder-convert $< $@ - -clean-local: - rm -f *.xml maintainer-clean-local: rm -f Makefile.in diff --git a/data/about.glade b/data/about.ui similarity index 97% rename from data/about.glade rename to data/about.ui index 1d249ce..fdc50fc 100644 --- a/data/about.glade +++ b/data/about.ui @@ -1,17 +1,17 @@ - - - - - + + + + + 5 About AWeather False - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG + center-on-parent + dialog False AWeather 0.1 - Copyright ©2008-2008 Andy Spencer + Copyright ©2008-2008 Andy Spencer A semi-advanced weather viewer http://lug.rose-hulman.edu/wiki/AWeather GNU GENERAL PUBLIC LICENSE @@ -262,20 +262,21 @@ The hypothetical commands `show w' and `show c' should show the appropriate part True - + True 2 - + True - GTK_BUTTONBOX_END - + end + False - GTK_PACK_END + end + 0 - + - - + + diff --git a/data/main.glade b/data/main.glade deleted file mode 100644 index 2fa73b4..0000000 --- a/data/main.glade +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - True - - - True - - - True - _File - True - - - True - - - True - gtk-new - True - True - - - - - True - gtk-open - True - True - - - - - True - gtk-save - True - True - - - - - True - gtk-save-as - True - True - - - - - True - - - - - True - gtk-quit - True - True - - - - - - - - - - True - _Edit - True - - - True - - - True - gtk-cut - True - True - - - - - True - gtk-copy - True - True - - - - - True - gtk-paste - True - True - - - - - True - gtk-delete - True - True - - - - - - - - - True - _View - True - - - True - - - True - gtk-zoom-in - True - True - - - - - - True - gtk-zoom-out - True - True - - - - - - True - menuitem5 - True - - - - - True - gtk-refresh - True - True - - - - - - - - - - True - _Help - True - - - True - - - True - gtk-about - True - True - - - - - - - - - - False - - - - - True - GTK_TOOLBAR_ICONS - - - True - gtk-zoom-in - - - - True - - - - - True - gtk-zoom-out - - - - True - - - - - True - - - True - - - - - True - True - gtk-refresh - - - - True - - - - - False - 1 - - - - - True - True - - - True - - - 600 - 550 - True - True - True - True - True - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - - - - - - - - True - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - - - - - - - - True - <b>Site</b> - True - - - label_item - - - - - False - - - - - True - 0 - GTK_SHADOW_NONE - - - True - 12 - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - - - True - True - False - - - - - - - - - - True - <b>Time</b> - True - - - label_item - - - - - 1 - - - - - False - 1 - - - - - True - False - - - - - True - True - GTK_POS_BOTTOM - - - False - False - - - - - 2 - - - - - - diff --git a/data/main.ui b/data/main.ui new file mode 100644 index 0000000..46126e5 --- /dev/null +++ b/data/main.ui @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + True + + + True + + + True + _File + True + + + True + + + True + Work offline + offline + True + + + + + True + + + + + True + quit + True + True + True + + + + + + + + + True + _View + True + + + True + + + True + zoomin + True + True + True + + + + + True + zoomout + True + True + True + + + + + True + + + + + True + refresh + True + True + True + + + + + + + + + True + _Help + True + + + True + + + True + about + True + True + True + + + + + + + + + + False + 0 + + + + + True + icons + + + True + zoomin + True + + + False + True + + + + + True + zoomout + True + + + False + True + + + + + True + + + False + True + + + + + True + refresh + True + True + + + False + True + + + + + False + 1 + + + + + True + True + + + True + True + + + 600 + 550 + True + True + True + True + True + True + True + GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + + + + + + True + False + + + + + True + 5 + + + True + True + True + True + + + True + sites + True + + + + + 0 + + + + + + + True + <b>Site</b> + True + + + + + False + 0 + + + + + True + True + True + + + True + True + never + automatic + in + + + True + True + times + False + + + + + + + + True + <b>Time</b> + True + + + + + 1 + + + + + False + True + + + + + True + False + + + + + True + True + bottom + + + False + False + + + + + 2 + + + + + + + Offline + + + + Quit + gtk-quit + + + + Zoom In + gtk-zoom-in + + + + Zoom Out + gtk-zoom-out + + + + Refresh + gtk-refresh + + + + About + gtk-about + + + diff --git a/src/Makefile.am b/src/Makefile.am index 645fbed..f1f9329 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,7 @@ MAINTAINERCLEANFILES = Makefile.in glib-genmarshal --prefix=aweather_cclosure_marshal --header $< > $@ test: all - ./aweather -d 7 + ./aweather -o -d 7 -s KLSX gdb: all gdb ./aweather diff --git a/src/aweather-gui.c b/src/aweather-gui.c index 2e44b91..771ff20 100644 --- a/src/aweather-gui.c +++ b/src/aweather-gui.c @@ -88,10 +88,6 @@ static void aweather_gui_class_init(AWeatherGuiClass *klass) /************* * Callbacks * *************/ -void on_quit(GtkMenuItem *menu, AWeatherGui *gui) -{ - gtk_widget_destroy(GTK_WIDGET(gui)); -} gboolean on_drawing_button_press(GtkWidget *widget, GdkEventButton *event, AWeatherGui *gui) { g_debug("AWeatherGui: on_drawing_button_press - Grabbing focus"); @@ -137,24 +133,51 @@ gboolean on_gui_key_press(GtkWidget *widget, GdkEventKey *event, AWeatherGui *gu return FALSE; } -void on_refresh(GtkToolButton *button, AWeatherGui *gui) +void on_quit(GtkMenuItem *menu, AWeatherGui *gui) +{ + gtk_widget_destroy(GTK_WIDGET(gui)); +} + +void on_offline(GtkToggleAction *action, AWeatherGui *gui) { AWeatherView *view = aweather_gui_get_view(gui); - aweather_view_refresh(view); + aweather_view_set_offline(view, + gtk_toggle_action_get_active(action)); } -void on_zoomin(GtkToolButton *button, AWeatherGui *gui) +void on_zoomin(GtkAction *action, AWeatherGui *gui) { AWeatherView *view = aweather_gui_get_view(gui); aweather_view_zoom(view, 3./4); } -void on_zoomout(GtkToolButton *button, AWeatherGui *gui) +void on_zoomout(GtkAction *action, AWeatherGui *gui) { AWeatherView *view = aweather_gui_get_view(gui); aweather_view_zoom(view, 4./3); } +void on_refresh(GtkAction *action, AWeatherGui *gui) +{ + AWeatherView *view = aweather_gui_get_view(gui); + aweather_view_refresh(view); +} + +void on_about(GtkAction *action, AWeatherGui *gui) +{ + // TODO: use gtk_widget_hide_on_delete() + GError *error = NULL; + GtkBuilder *builder = gtk_builder_new(); + if (!gtk_builder_add_from_file(builder, DATADIR "/aweather/about.ui", &error)) + g_error("Failed to create gtk builder: %s", error->message); + gtk_builder_connect_signals(builder, NULL); + GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window")); + gtk_window_set_transient_for(GTK_WINDOW(window), + GTK_WINDOW(aweather_gui_get_widget(gui, "window"))); + gtk_widget_show_all(window); + g_object_unref(builder); +} + void on_time_changed(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *column, AWeatherGui *gui) { @@ -260,21 +283,6 @@ gboolean on_expose(GtkWidget *da, GdkEventExpose *event, AWeatherGui *gui) return FALSE; } -void on_about(GtkMenuItem *item, AWeatherGui *gui) -{ - // TODO: use gtk_widget_hide_on_delete() - GError *error = NULL; - GtkBuilder *builder = gtk_builder_new(); - if (!gtk_builder_add_from_file(builder, DATADIR "/aweather/about.xml", &error)) - g_error("Failed to create gtk builder: %s", error->message); - gtk_builder_connect_signals(builder, NULL); - GtkWidget *window = GTK_WIDGET(gtk_builder_get_object(builder, "window")); - gtk_window_set_transient_for(GTK_WINDOW(window), - GTK_WINDOW(aweather_gui_get_widget(gui, "window"))); - gtk_widget_show_all(window); - g_object_unref(builder); -} - void on_location_changed(AWeatherView *view, gdouble x, gdouble y, gdouble z, AWeatherGui *gui) { @@ -285,9 +293,9 @@ void on_location_changed(AWeatherView *view, } /* TODO: replace the code in these with `gtk_tree_model_find' utility */ -static void update_time_widget(AWeatherView *view, char *time, AWeatherGui *gui) +static void update_time_widget(AWeatherView *view, const char *time, AWeatherGui *gui) { - g_debug("AWeatherGui: update_time_widget"); + g_debug("AWeatherGui: update_time_widget - time=%s", time); GtkTreeView *tview = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time")); GtkTreeModel *model = GTK_TREE_MODEL(gtk_tree_view_get_model(tview)); for (int i = 0; i < gtk_tree_model_iter_n_children(model, NULL); i++) { @@ -322,6 +330,8 @@ static void update_site_widget(AWeatherView *view, char *site, AWeatherGui *gui) gtk_tree_model_iter_nth_child(model, &iter2, &iter1, i); char *text; gtk_tree_model_get(model, &iter2, 1, &text, -1); + if (text == NULL) + continue; if (g_str_equal(text, site)) { g_signal_handlers_block_by_func(combo, G_CALLBACK(on_site_changed), gui); @@ -349,7 +359,7 @@ static void combo_sensitive(GtkCellLayout *cell_layout, GtkCellRenderer *cell, static void site_setup(AWeatherGui *gui) { GtkTreeIter state, city; - GtkTreeStore *store = gtk_tree_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + GtkTreeStore *store = GTK_TREE_STORE(aweather_gui_get_object(gui, "sites")); for (int i = 0; cities[i].label; i++) { if (cities[i].type == LOCATION_STATE) { gtk_tree_store_append(store, &state, NULL); @@ -362,15 +372,10 @@ static void site_setup(AWeatherGui *gui) } } - GtkWidget *combo = aweather_gui_get_widget(gui, "site"); - GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "text", 0, NULL); - gtk_combo_box_set_model(GTK_COMBO_BOX(combo), GTK_TREE_MODEL(store)); - gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo), renderer, - combo_sensitive, NULL, NULL); - g_object_unref(renderer); - g_object_unref(store); + GtkWidget *combo = aweather_gui_get_widget(gui, "site"); + GObject *renderer = aweather_gui_get_object(gui, "site_rend"); + gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo), + GTK_CELL_RENDERER(renderer), combo_sensitive, NULL, NULL); AWeatherView *aview = aweather_gui_get_view(gui); g_signal_connect(aview, "site-changed", G_CALLBACK(update_site_widget), gui); @@ -378,14 +383,13 @@ static void site_setup(AWeatherGui *gui) static void time_setup(AWeatherGui *gui) { - GtkTreeView *tview = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time")); - GtkTreeModel *store = GTK_TREE_MODEL(gtk_list_store_new(1, G_TYPE_STRING)); - gtk_tree_view_set_model(tview, store); - - GtkCellRenderer *rend = gtk_cell_renderer_text_new(); - GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes( + GtkTreeView *tview = GTK_TREE_VIEW(aweather_gui_get_widget(gui, "time")); + GtkCellRenderer *rend = gtk_cell_renderer_text_new(); + GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes( "Time", rend, "text", 0, NULL); + gtk_tree_view_append_column(tview, col); + g_object_set(rend, "size-points", 8.0, NULL); AWeatherView *aview = aweather_gui_get_view(gui); g_signal_connect(aview, "time-changed", G_CALLBACK(update_time_widget), gui); @@ -424,7 +428,7 @@ AWeatherGui *aweather_gui_new() self->view = aweather_view_new(); self->builder = gtk_builder_new(); - if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.xml", &error)) + if (!gtk_builder_add_from_file(self->builder, DATADIR "/aweather/main.ui", &error)) g_error("Failed to create gtk builder: %s", error->message); gtk_builder_connect_signals(self->builder, self); g_signal_connect(self, "key-press-event", G_CALLBACK(on_gui_key_press), self); @@ -458,6 +462,12 @@ GtkWidget *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name) g_error("Failed to get widget `%s'", name); return GTK_WIDGET(widget); } +GObject *aweather_gui_get_object(AWeatherGui *gui, const gchar *name) +{ + g_debug("AWeatherGui: get_widget - name=%s", name); + g_assert(AWEATHER_IS_GUI(gui)); + return gtk_builder_get_object(gui->builder, name); +} void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin) { g_debug("AWeatherGui: register_plugin"); diff --git a/src/aweather-gui.h b/src/aweather-gui.h index af5e4a8..27383b2 100644 --- a/src/aweather-gui.h +++ b/src/aweather-gui.h @@ -55,6 +55,7 @@ GType aweather_gui_get_type(void); AWeatherGui *aweather_gui_new(); AWeatherView *aweather_gui_get_view(AWeatherGui *gui); GtkWidget *aweather_gui_get_widget(AWeatherGui *gui, const gchar *name); +GObject *aweather_gui_get_object(AWeatherGui *gui, const gchar *name); void aweather_gui_register_plugin(AWeatherGui *gui, AWeatherPlugin *plugin); void aweather_gui_gl_redraw(AWeatherGui *gui); void aweather_gui_gl_begin(AWeatherGui *gui); diff --git a/src/aweather-view.c b/src/aweather-view.c index 96f9fed..919d8f9 100644 --- a/src/aweather-view.c +++ b/src/aweather-view.c @@ -45,6 +45,7 @@ static void aweather_view_init(AWeatherView *self) g_debug("AWeatherView: init"); /* Default values */ self->time = g_strdup(""); + self->offline = FALSE; self->site = g_strdup(""); } static void aweather_view_dispose(GObject *gobject) @@ -110,7 +111,7 @@ static void aweather_view_class_init(AWeatherViewClass *klass) 0, NULL, NULL, - g_cclosure_marshal_VOID__INT, + g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); @@ -200,6 +201,20 @@ gchar *aweather_view_get_time(AWeatherView *view) return view->time; } +void aweather_view_set_offline(AWeatherView *view, gboolean offline) +{ + g_assert(AWEATHER_IS_VIEW(view)); + g_debug("AWeatherView: set_offline - %d", offline); + view->offline = offline; +} + +gboolean aweather_view_get_offline(AWeatherView *view) +{ + g_assert(AWEATHER_IS_VIEW(view)); + g_debug("AWeatherView: get_offline - %d", view->offline); + return view->offline; +} + void aweather_view_get_location(AWeatherView *view, gdouble *x, gdouble *y, gdouble *z) { g_assert(AWEATHER_IS_VIEW(view)); diff --git a/src/aweather-view.h b/src/aweather-view.h index 9051d88..08d6444 100644 --- a/src/aweather-view.h +++ b/src/aweather-view.h @@ -35,9 +35,10 @@ struct _AWeatherView { GObject parent_instance; /* instance members */ - gchar *time; - gchar *site; - gdouble location[3]; + gchar *time; + gboolean offline; + gchar *site; + gdouble location[3]; }; struct _AWeatherViewClass { @@ -50,9 +51,13 @@ GType aweather_view_get_type(void); /* Methods */ AWeatherView *aweather_view_new(); + void aweather_view_set_time(AWeatherView *view, const gchar *time); gchar *aweather_view_get_time(AWeatherView *view); +void aweather_view_set_offline(AWeatherView *view, gboolean offline); +gboolean aweather_view_get_offline(AWeatherView *view); + void aweather_view_get_location(AWeatherView *view, gdouble *x, gdouble *y, gdouble *z); void aweather_view_set_location(AWeatherView *view, gdouble x, gdouble y, gdouble z); void aweather_view_pan (AWeatherView *view, gdouble x, gdouble y, gdouble z); diff --git a/src/data.c b/src/data.c index 4b97516..0b6293d 100644 --- a/src/data.c +++ b/src/data.c @@ -47,12 +47,10 @@ static void cache_file_cb(SoupSession *session, SoupMessage *message, gpointer _ gchar *uri = soup_uri_to_string(soup_message_get_uri(message), FALSE); g_debug("data: cache_file_cb"); - if (!SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) { - g_warning("data: cache_file_cb - error copying file, status=%d\n" - "\tsrc=%s\n" - "\tdst=%s", - message->status_code, uri, info->local); - } else { + if (message->status_code == 416) { + /* Range unsatisfiable, file already complete */ + info->callback(info->local, FALSE, info->user_data); + } else if (SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) { gint wrote = fwrite(message->response_body->data, 1, message->response_body->length, info->fp); g_debug("data: status=%u wrote=%d/%lld", @@ -60,6 +58,11 @@ static void cache_file_cb(SoupSession *session, SoupMessage *message, gpointer _ wrote, message->response_body->length); fclose(info->fp); info->callback(info->local, TRUE, info->user_data); + } else { + g_warning("data: cache_file_cb - error copying file, status=%d\n" + "\tsrc=%s\n" + "\tdst=%s", + message->status_code, uri, info->local); } g_free(uri); g_free(info->local); @@ -78,6 +81,8 @@ static void do_cache(gchar *uri, gchar *local, gboolean truncate, gchar *reason, info->user_data = user_data; info->local = local; + /* TODO: move this to callback so we don't end up with 0 byte files + * Then change back to check for valid file after download */ if (truncate) info->fp = fopen_p(local, "w"); else info->fp = fopen_p(local, "a"); long bytes = ftell(info->fp); diff --git a/src/location.c b/src/location.c index 8d25adb..7d8ebe5 100644 --- a/src/location.c +++ b/src/location.c @@ -21,233 +21,233 @@ #include "location.h" city_t cities[] = { - {LOCATION_STATE, NULL, "Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BMX", "Birmingham", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MXX", "E. Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EOX", "Fort Rucker", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MOB", "Mobile", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HTX", "Nrn. Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Alaska", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ABC", "Bethel", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ACG", "Biorka Is.", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "APD", "Fairbanks", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AHG", "Kenai", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AKC", "King Salmon", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AIH", "Middleton Is.", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AEC", "Nome", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "APD", "Pedro Dome", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ACG", "Sitka", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Arizona", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FSX", "Flagstaff", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "IWA", "Phoenix", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EMX", "Tucson", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "YUX", "Yuma", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Arkansas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LZK", "Little Rock", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SRX", "W. Ark./Ft. Smith", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "California", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BBX", "Beale AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EYX", "Edwards AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BHX", "Eureka", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HNX", "Hanford", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "VTX", "Los Angeles", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DAX", "Sacramento", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "NKX", "San Diego", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MUX", "San Francisco", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HNX", "San Joaquin Vly.", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SOX", "Santa Ana Mtns", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "VBX", "Vandenberg AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Colorado", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FTG", "Denver/Boulder", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GJX", "Grand Junction", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "PUX", "Pueblo", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Delaware", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DOX", "Dover AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Florida", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EVX", "Eglin AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "JAX", "Jacksonville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BYX", "Key West", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MLB", "Melbourne", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AMX", "Miami", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EVX", "NW Florida", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TLH", "Tallahassee", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TBW", "Tampa Bay Area", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Georgia", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FFC", "Atlanta", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "VAX", "Moody AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FFC", "Peachtree City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "JGX", "Robins AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Guam", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GUA", "Andersen AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Hawaii", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HKI", "Kauai", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HKM", "Kohala", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HMO", "Molokai", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HWA", "South Shore", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Idaho", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CBX", "Boise", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SFX", "Pocatello", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Illinois", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ILX", "Central IL", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LOT", "Chicago", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Indiana", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "VWX", "Evansville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "IND", "Indianapolis", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "IWX", "Nrn. Indiana", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Iowa", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DMX", "Des Moines", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DVN", "Quad Cities", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Kansas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DDC", "Dodge City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GLD", "Goodland", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TWX", "Topeka", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ICT", "Wichita", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Kentucky", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HPX", "Fort Cambell", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "JKL", "Jackson", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LVX", "Louisville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "PAH", "Paducah", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Louisiana", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "POE", "Fort Polk", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LCH", "Lake Charles", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LIX", "New Orleans", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SHV", "Shreveport", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Maine", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CBW", "Caribou", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GYX", "Portland", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Maryland", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LWX", "Baltimore", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Massachusetts", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BOX", "Boston", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Michigan", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DTX", "Detroit", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "APX", "Gaylord", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GRR", "Grand Rapids", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MQT", "Marquette", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Minnesota", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DLH", "Duluth", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MPX", "Minneapolis", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Mississippi", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GWX", "Columbus AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DGX", "Jackson/Brandon", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Missouri", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EAX", "Kansas City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SGF", "Springfield", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LSX", "St. Louis", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Montana", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BLX", "Billings", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GGW", "Glasgow", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TFX", "Great Falls", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MSX", "Missoula", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Nebraska", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "UEX", "Hastings", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LNX", "North Platte", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "OAX", "Omaha", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Nevada", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LRX", "Elko", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ESX", "Las Vegas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RGX", "Reno", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "New Jersey", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DIX", "Mt. Holly", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "New Mexico", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ABX", "Albuquerque", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FDX", "Cannon AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HDX", "Holloman AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "New York", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ENX", "Albany", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BGM", "Binghamton", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BUF", "Buffalo", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TYX", "Montague", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "OKX", "New York City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "OKX", "Upton", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "North Carolina", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RAX", "Durham", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MHX", "Morehead City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RAX", "Raleigh", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LTX", "Wilmington", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "North Dakota", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BIS", "Bismarck", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MVX", "Grand Forks", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MBX", "Minot AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Ohio", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ILN", "Cincinnati", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CLE", "Cleveland", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ILN", "Dayton", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ILN", "Wilmington", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Oklahoma", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FDR", "Frederick", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "TLX", "Oklahoma City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "INX", "Tulsa", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "VNX", "Vance AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Oregon", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MAX", "Medford", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "PDT", "Pendleton", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RTX", "Portland", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Pennsylvania", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DIX", "Philadelphia", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "PBZ", "Pittsburgh", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CCX", "State College", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Puerto Rico", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "JUA", "Puerto Rico/V.I.", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "South Carolina", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CLX", "Charleston", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CAE", "Columbia", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GSP", "Greenville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GSP", "Spartanburg", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GSP", "Greer", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "South Dakota", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ABR", "Aberdeen", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "UDX", "Rapid City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FSD", "Sioux falls", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Tennessee", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MRX", "Knoxville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "NQA", "Memphis", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MRX", "Morristown", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "OHX", "Nashville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MRX", "Tri Cities", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Texas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AMA", "Amarillo", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EWX", "Austin", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "BRO", "Brownsville", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GRK", "Central Texas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CRP", "Corpus Christi", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FWS", "Dallas", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DYX", "Dyess AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EPZ", "El Paso", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FWS", "Fort Worth", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HGX", "Galveston", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "HGX", "Houston", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "DFX", "Laughlin AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LBB", "Lubbock", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MAF", "Midland/Odessa", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "SJT", "San Angelo", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "EWX", "San Antonio", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Utah", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ICX", "Cedar City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MTX", "Salt Lake City", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Vermont", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CXX", "Burlington", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Virginia", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FCX", "Blacksburg", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AKQ", "Norfolk", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AKQ", "Richmond", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "FCX", "Roanoke", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LWX", "Sterling", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "AKQ", "Wakefield", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Washington", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ATX", "Seattle", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "OTX", "Spokane", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ATX", "Tacoma", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Washington DC", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "LWX", "Washington", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "West Virginia", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RLX", "Charleston", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Wisconsin", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "GRB", "Green Bay", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "ARX", "La Crosse", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "MKX", "Milwaukee", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_STATE, NULL, "Wyoming", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "CYS", "Cheyenne", {0, 0, 0, 0, 0, 0, 0, 0}}, - {LOCATION_CITY, "RIW", "Riverton", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBMX", "Birmingham", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMXX", "E. Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEOX", "Fort Rucker", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMOB", "Mobile", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHTX", "Nrn. Alabama", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Alaska", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KABC", "Bethel", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KACG", "Biorka Is.", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAPD", "Fairbanks", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAHG", "Kenai", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAKC", "King Salmon", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAIH", "Middleton Is.", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAEC", "Nome", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAPD", "Pedro Dome", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KACG", "Sitka", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Arizona", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFSX", "Flagstaff", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KIWA", "Phoenix", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEMX", "Tucson", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KYUX", "Yuma", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Arkansas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLZK", "Little Rock", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSRX", "W. Ark./Ft. Smith", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "California", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBBX", "Beale AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEYX", "Edwards AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBHX", "Eureka", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHNX", "Hanford", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KVTX", "Los Angeles", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDAX", "Sacramento", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KNKX", "San Diego", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMUX", "San Francisco", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHNX", "San Joaquin Vly.", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSOX", "Santa Ana Mtns", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KVBX", "Vandenberg AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Colorado", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFTG", "Denver/Boulder", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGJX", "Grand Junction", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KPUX", "Pueblo", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Delaware", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDOX", "Dover AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Florida", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEVX", "Eglin AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KJAX", "Jacksonville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBYX", "Key West", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMLB", "Melbourne", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAMX", "Miami", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEVX", "NW Florida", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTLH", "Tallahassee", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTBW", "Tampa Bay Area", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Georgia", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFFC", "Atlanta", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KVAX", "Moody AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFFC", "Peachtree City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KJGX", "Robins AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Guam", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGUA", "Andersen AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Hawaii", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHKI", "Kauai", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHKM", "Kohala", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHMO", "Molokai", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHWA", "South Shore", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Idaho", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCBX", "Boise", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSFX", "Pocatello", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Illinois", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KILX", "Central IL", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLOT", "Chicago", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Indiana", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KVWX", "Evansville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KIND", "Indianapolis", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KIWX", "Nrn. Indiana", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Iowa", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDMX", "Des Moines", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDVN", "Quad Cities", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Kansas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDDC", "Dodge City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGLD", "Goodland", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTWX", "Topeka", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KICT", "Wichita", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Kentucky", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHPX", "Fort Cambell", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KJKL", "Jackson", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLVX", "Louisville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KPAH", "Paducah", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Louisiana", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KPOE", "Fort Polk", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLCH", "Lake Charles", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLIX", "New Orleans", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSHV", "Shreveport", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Maine", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCBW", "Caribou", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGYX", "Portland", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Maryland", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLWX", "Baltimore", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Massachusetts", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBOX", "Boston", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Michigan", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDTX", "Detroit", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAPX", "Gaylord", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGRR", "Grand Rapids", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMQT", "Marquette", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Minnesota", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDLH", "Duluth", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMPX", "Minneapolis", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Mississippi", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGWX", "Columbus AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDGX", "Jackson/Brandon", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Missouri", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEAX", "Kansas City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSGF", "Springfield", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLSX", "St. Louis", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Montana", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBLX", "Billings", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGGW", "Glasgow", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTFX", "Great Falls", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMSX", "Missoula", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Nebraska", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KUEX", "Hastings", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLNX", "North Platte", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KOAX", "Omaha", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Nevada", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLRX", "Elko", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KESX", "Las Vegas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRGX", "Reno", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "New Jersey", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDIX", "Mt. Holly", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "New Mexico", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KABX", "Albuquerque", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFDX", "Cannon AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHDX", "Holloman AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "New York", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KENX", "Albany", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBGM", "Binghamton", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBUF", "Buffalo", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTYX", "Montague", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KOKX", "New York City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KOKX", "Upton", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "North Carolina", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRAX", "Durham", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMHX", "Morehead City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRAX", "Raleigh", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLTX", "Wilmington", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "North Dakota", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBIS", "Bismarck", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMVX", "Grand Forks", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMBX", "Minot AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Ohio", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KILN", "Cincinnati", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCLE", "Cleveland", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KILN", "Dayton", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KILN", "Wilmington", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Oklahoma", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFDR", "Frederick", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KTLX", "Oklahoma City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KINX", "Tulsa", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KVNX", "Vance AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Oregon", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMAX", "Medford", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KPDT", "Pendleton", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRTX", "Portland", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Pennsylvania", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDIX", "Philadelphia", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KPBZ", "Pittsburgh", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCCX", "State College", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Puerto Rico", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KJUA", "Puerto Rico/V.I.", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "South Carolina", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCLX", "Charleston", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCAE", "Columbia", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGSP", "Greenville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGSP", "Spartanburg", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGSP", "Greer", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "South Dakota", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KABR", "Aberdeen", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KUDX", "Rapid City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFSD", "Sioux falls", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Tennessee", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMRX", "Knoxville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KNQA", "Memphis", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMRX", "Morristown", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KOHX", "Nashville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMRX", "Tri Cities", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Texas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAMA", "Amarillo", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEWX", "Austin", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KBRO", "Brownsville", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGRK", "Central Texas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCRP", "Corpus Christi", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFWS", "Dallas", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDYX", "Dyess AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEPZ", "El Paso", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFWS", "Fort Worth", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHGX", "Galveston", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KHGX", "Houston", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KDFX", "Laughlin AFB", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLBB", "Lubbock", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMAF", "Midland/Odessa", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KSJT", "San Angelo", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KEWX", "San Antonio", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Utah", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KICX", "Cedar City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMTX", "Salt Lake City", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Vermont", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCXX", "Burlington", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Virginia", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFCX", "Blacksburg", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAKQ", "Norfolk", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAKQ", "Richmond", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KFCX", "Roanoke", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLWX", "Sterling", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KAKQ", "Wakefield", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Washington", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KATX", "Seattle", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KOTX", "Spokane", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KATX", "Tacoma", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Washington DC", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KLWX", "Washington", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "West Virginia", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRLX", "Charleston", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Wisconsin", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KGRB", "Green Bay", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KARX", "La Crosse", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KMKX", "Milwaukee", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_STATE, NULL, "Wyoming", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KCYS", "Cheyenne", {0, 0, 0, 0, 0, 0, 0, 0}}, + {LOCATION_CITY, "KRIW", "Riverton", {0, 0, 0, 0, 0, 0, 0, 0}}, {0, NULL, NULL, {0, 0, 0, 0, 0, 0, 0, 0}}, }; diff --git a/src/main.c b/src/main.c index 5466283..67df7a6 100644 --- a/src/main.c +++ b/src/main.c @@ -46,14 +46,16 @@ static gboolean on_map(AWeatherGui *gui, GdkEvent *event, gchar *site) int main(int argc, char *argv[]) { /* Arguments */ - gint opt_debug = 6; - gchar *opt_site = "IND"; - gboolean opt_auto = FALSE; + gint opt_debug = 6; + gchar *opt_site = "KIND"; + gboolean opt_auto = FALSE; + gboolean opt_offline = FALSE; GOptionEntry entries[] = { - //long short flg type location description arg desc - {"debug", 'd', 0, G_OPTION_ARG_INT, &opt_debug, "Change default log level", "[1-7]"}, - {"site", 's', 0, G_OPTION_ARG_STRING, &opt_site, "Set initial site", NULL}, - {"auto", 'a', 0, G_OPTION_ARG_NONE, &opt_auto, "Auto update radar (todo)", NULL}, + //long short flg type location description arg desc + {"debug", 'd', 0, G_OPTION_ARG_INT, &opt_debug, "Change default log level", "[1-7]"}, + {"site", 's', 0, G_OPTION_ARG_STRING, &opt_site, "Set initial site", NULL}, + {"offline", 'o', 0, G_OPTION_ARG_NONE, &opt_offline, "Run in offline mode", NULL}, + {"auto", 'a', 0, G_OPTION_ARG_NONE, &opt_auto, "Auto update radar (todo)", NULL}, {NULL} }; @@ -76,6 +78,7 @@ int main(int argc, char *argv[]) /* Set up AWeather */ AWeatherGui *gui = aweather_gui_new(); AWeatherView *view = aweather_gui_get_view(gui); + aweather_view_set_offline(view, opt_offline); g_signal_connect(gui, "map-event", G_CALLBACK(on_map), opt_site); /* Load plugins */ diff --git a/src/plugin-radar.c b/src/plugin-radar.c index 30f5816..e5e56b6 100644 --- a/src/plugin-radar.c +++ b/src/plugin-radar.c @@ -250,44 +250,69 @@ static void load_radar(AWeatherRadar *self, gchar *radar_file) load_radar_gui(self, radar); } -static void update_times(AWeatherRadar *self, char *site, char **last_time) +static void update_times(AWeatherRadar *self, AWeatherView *view, char *site, char **last_time) { - char *list_uri = g_strdup_printf( - "http://mesonet.agron.iastate.edu/data/nexrd2/raw/K%s/dir.list", - site); - GFile *list = g_file_new_for_uri(list_uri); - g_free(list_uri); - - gchar *data; - gsize length; - GError *error = NULL; - g_file_load_contents(list, NULL, &data, &length, NULL, &error); - g_object_unref(list); - if (error) { - g_warning("Error loading list for %s: %s", site, error->message); - g_error_free(error); - return; + GList *times = NULL; + if (aweather_view_get_offline(view)) { + gchar *path = g_build_filename(g_get_user_cache_dir(), PACKAGE, "nexrd2", "raw", site, NULL); + GDir *dir = g_dir_open(path, 0, NULL); + if (dir) { + const gchar *name; + while ((name = g_dir_read_name(dir))) { + times = g_list_prepend(times, g_strdup(name)); + } + g_dir_close(dir); + } + g_free(path); + } else { + gchar *data; + gsize length; + GError *error = NULL; + + char *list_uri = g_strdup_printf("http://mesonet.agron.iastate.edu/data/nexrd2/raw/%s/dir.list", site); + GFile *list = g_file_new_for_uri(list_uri); + g_file_load_contents(list, NULL, &data, &length, NULL, &error); + if (error) { + g_warning("Error loading list for %s: %s", site, error->message); + g_error_free(error); + } else { + gchar **lines = g_strsplit(data, "\n", -1); + for (int i = 0; lines[i] && lines[i][0]; i++) { + char **parts = g_strsplit(lines[i], " ", 2); + times = g_list_prepend(times, parts[1]); + g_strfreev(parts); + } + g_strfreev(lines); + g_free(data); + } + + g_free(list_uri); + g_object_unref(list); } - gchar **lines = g_strsplit(data, "\n", -1); + + GRegex *regex = g_regex_new("^[A-Z]{4}_([0-9]{8}_[0-9]{4})$", 0, 0, NULL); // KLSX_20090622_2113 + GMatchInfo *info; + GtkTreeView *tview = GTK_TREE_VIEW(aweather_gui_get_widget(self->gui, "time")); GtkListStore *lstore = GTK_LIST_STORE(gtk_tree_view_get_model(tview)); gtk_list_store_clear(lstore); GtkTreeIter iter; - for (int i = 0; lines[i] && lines[i][0]; i++) { - // format: `841907 KABR_20090510_0159' - //g_message("\tadding %p [%s]", lines[i], lines[i]); - char **parts = g_strsplit(lines[i], " ", 2); - char *time = parts[1]+5; - gtk_list_store_insert(lstore, &iter, 0); - gtk_list_store_set(lstore, &iter, 0, time, -1); - g_strfreev(parts); + times = g_list_reverse(times); + for (GList *cur = times; cur; cur = cur->next) { + g_message("trying time %s", (gchar*)cur->data); + if (g_regex_match(regex, cur->data, 0, &info)) { + gchar *time = g_match_info_fetch(info, 1); + g_message("adding time %s", (gchar*)cur->data); + gtk_list_store_insert(lstore, &iter, 0); + gtk_list_store_set(lstore, &iter, 0, time, -1); + if (last_time) + *last_time = time; + } } - if (last_time) - gtk_tree_model_get(GTK_TREE_MODEL(lstore), &iter, 0, last_time, -1); - - g_free(data); - g_strfreev(lines); + g_regex_unref(regex); + g_list_foreach(times, (GFunc)g_free, NULL); + g_list_free(times); } /***************** @@ -356,14 +381,14 @@ static void on_sweep_clicked(GtkRadioButton *button, gpointer _self) load_sweep (self, g_object_get_data(G_OBJECT(button), "sweep")); } -static void on_time_changed(AWeatherView *view, char *time, gpointer _self) +static void on_time_changed(AWeatherView *view, const char *time, gpointer _self) { AWeatherRadar *self = AWEATHER_RADAR(_self); - g_debug("AWeatherRadar: on_time_changed - setting time"); + g_debug("AWeatherRadar: on_time_changed - setting time=%s", time); // format: http://mesonet.agron.iastate.edu/data/nexrd2/raw/KABR/KABR_20090510_0323 char *site = aweather_view_get_site(view); char *base = "http://mesonet.agron.iastate.edu/data/"; - char *path = g_strdup_printf("nexrd2/raw/K%s/K%s_%s", site, site, time); + char *path = g_strdup_printf("nexrd2/raw/%s/%s_%s", site, site, time); /* Clear out children */ GtkWidget *child = gtk_bin_get_child(GTK_BIN(self->config_body)); @@ -379,7 +404,10 @@ static void on_time_changed(AWeatherView *view, char *time, gpointer _self) aweather_gui_gl_redraw(self->gui); /* Start loading the new radar */ - cache_file(base, path, AWEATHER_UPDATE, cached_cb, self); + if (aweather_view_get_offline(view)) + cache_file(base, path, AWEATHER_ONCE, cached_cb, self); + else + cache_file(base, path, AWEATHER_UPDATE, cached_cb, self); g_free(path); } @@ -388,7 +416,7 @@ static void on_site_changed(AWeatherView *view, char *site, gpointer _self) AWeatherRadar *self = AWEATHER_RADAR(_self); g_debug("AWeatherRadar: on_site_changed - Loading wsr88d list for %s", site); char *time = NULL; - update_times(self, site, &time); + update_times(self, view, site, &time); aweather_view_set_time(view, time); g_free(time); @@ -399,7 +427,7 @@ static void on_refresh(AWeatherView *view, gpointer _self) AWeatherRadar *self = AWEATHER_RADAR(_self); char *site = aweather_view_get_site(view); char *time = NULL; - update_times(self, site, &time); + update_times(self, view, site, &time); aweather_view_set_time(view, time); g_free(time); } diff --git a/src/plugin-ridge.c b/src/plugin-ridge.c index 388ee74..8dcdac5 100644 --- a/src/plugin-ridge.c +++ b/src/plugin-ridge.c @@ -113,9 +113,12 @@ void load_texture(AWeatherRidge *self, layer_t *layer, gchar *filename) aweather_gui_gl_begin(self->gui); /* Load image */ - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - if (!pixbuf) + GError *error = NULL; + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, &error); + if (!pixbuf || error) { g_warning("Failed to load texture: %s", filename); + return; + } guchar *pixels = gdk_pixbuf_get_pixels(pixbuf); int width = gdk_pixbuf_get_width(pixbuf); int height = gdk_pixbuf_get_height(pixbuf); @@ -170,11 +173,12 @@ static void on_site_changed(AWeatherView *view, gchar *site, AWeatherRidge *self g_debug("AWeatherRidge: on_site_changed - site=%s", site); for (int i = 0; i < LAYER_COUNT; i++) { gchar *base = "http://radar.weather.gov/ridge/"; - gchar *path = g_strdup_printf(layers[i].fmt, site); + gchar *path = g_strdup_printf(layers[i].fmt, site+1); cached_t *udata = g_malloc(sizeof(cached_t)); udata->self = self; udata->layer = &layers[i]; cache_file(base, path, AWEATHER_ONCE, cached_cb, udata); + //cache_file(base, path, AWEATHER_UPDATE, cached_cb, udata); g_free(path); } } -- 2.41.0