Skip to content

Fixed Bug where VPR UI was not changing when switching mode #2129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 20 additions & 25 deletions vpr/src/draw/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,16 @@ static void default_setup(ezgl::application* app) {
search_setup(app);
}

// Initial Setup functions run default setup if they are a new window. Then, they will run
// the specific hiding/showing functions that separate them from the other init. setup functions

/* function below intializes the interface window with a set of buttons and links
* signals to corresponding functions for situation where the window is opened from
* NO_PICTURE_to_PLACEMENT */
static void initial_setup_NO_PICTURE_to_PLACEMENT(ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;

//Configuring visible buttons
default_setup(app);

//THIS WILL BE CHANGED SOON IGNORE
load_block_names(app);
if (is_new_window)
default_setup(app);

//Hiding unused functionality
hide_widget("RoutingMenuButton", app);
Expand All @@ -311,9 +308,10 @@ static void initial_setup_NO_PICTURE_to_PLACEMENT(ezgl::application* app,
static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path(
ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;
default_setup(app);
if (is_new_window)
default_setup(app);

//Showing given functionality
crit_path_button_setup(app);

//Hiding unused routing menu
Expand All @@ -325,11 +323,10 @@ static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path(
* PLACEMENT_to_ROUTING */
static void initial_setup_PLACEMENT_to_ROUTING(ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;
default_setup(app);
routing_button_setup(app);
if (is_new_window)
default_setup(app);

routing_button_setup(app);
hide_crit_path_button(app);
}

Expand All @@ -338,9 +335,8 @@ static void initial_setup_PLACEMENT_to_ROUTING(ezgl::application* app,
* ROUTING_to_PLACEMENT */
static void initial_setup_ROUTING_to_PLACEMENT(ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;
default_setup(app);
if (is_new_window)
default_setup(app);

//Hiding unused functionality
hide_widget("RoutingMenuButton", app);
Expand All @@ -352,9 +348,9 @@ static void initial_setup_ROUTING_to_PLACEMENT(ezgl::application* app,
* NO_PICTURE_to_ROUTING */
static void initial_setup_NO_PICTURE_to_ROUTING(ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;
default_setup(app);
if (is_new_window)
default_setup(app);

routing_button_setup(app);
hide_crit_path_button(app);
}
Expand All @@ -365,9 +361,9 @@ static void initial_setup_NO_PICTURE_to_ROUTING(ezgl::application* app,
static void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path(
ezgl::application* app,
bool is_new_window) {
if (!is_new_window)
return;
default_setup(app);
if (is_new_window)
default_setup(app);

routing_button_setup(app);
crit_path_button_setup(app);
}
Expand All @@ -379,7 +375,6 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
/* Updates the screen if the user has requested graphics. The priority *
* value controls whether or not the Proceed button must be clicked to *
* continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */

t_draw_state* draw_state = get_draw_state_vars();

if (!draw_state->show_graphics)
Expand Down
7 changes: 7 additions & 0 deletions vpr/src/draw/ui_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ void routing_button_setup(ezgl::application* app) {
//Toggle Router Util
GtkComboBoxText* toggle_router_util = GTK_COMBO_BOX_TEXT(app->get_object("ToggleRoutingUtil"));
g_signal_connect(toggle_router_util, "changed", G_CALLBACK(toggle_router_util_cbk), app);
show_widget("RoutingMenuButton", app);
}

/**
Expand All @@ -168,6 +169,7 @@ void search_setup(ezgl::application* app) {
void crit_path_button_setup(ezgl::application* app) {
GtkComboBoxText* toggle_crit_path = GTK_COMBO_BOX_TEXT(app->get_object("ToggleCritPath"));
g_signal_connect(toggle_crit_path, "changed", G_CALLBACK(toggle_crit_path_cbk), app);
show_widget("ToggleCritPath", app);
}

/**
Expand All @@ -191,6 +193,11 @@ void hide_widget(std::string widgetName, ezgl::application* app) {
gtk_widget_hide(widget);
}

void show_widget(std::string widgetName, ezgl::application* app) {
GtkWidget* widget = GTK_WIDGET(app->get_object(widgetName.c_str()));
gtk_widget_show(widget);
}

/**
* @brief loads atom and cluster lvl names into gtk list store item used for completion
*
Expand Down