Skip to content

Commit 17cc491

Browse files
Merge pull request #3337 from w0lek/issue#3336_ipa_fix
update taskresolver to handle latest critical path UI layout
2 parents 34beda1 + 67fa772 commit 17cc491

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

vpr/src/server/taskresolver.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#include "globals.h"
77
#include "pathhelper.h"
88
#include "telegramoptions.h"
9-
#include "gtkcomboboxhelper.h"
9+
#include <gtk/gtk.h>
10+
1011

1112
#include <ezgl/application.hpp>
1213

@@ -134,14 +135,24 @@ void TaskResolver::process_draw_critical_path_task(ezgl::application* app, const
134135
server_ctx.crit_path_element_indexes = std::move(path_elements);
135136
server_ctx.draw_crit_path_contour = draw_path_contour;
136137

137-
// update gtk UI
138-
GtkComboBox* toggle_crit_path = GTK_COMBO_BOX(app->get_object("ToggleCritPath"));
139-
gint high_light_mode_index = get_item_index_by_text(toggle_crit_path, high_light_mode.c_str());
140-
if (high_light_mode_index != -1) {
141-
gtk_combo_box_set_active(toggle_crit_path, high_light_mode_index);
138+
// get GTK widgets
139+
GtkSwitch* crit_path_switch = GTK_SWITCH(app->get_object("ToggleCritPath"));
140+
GtkToggleButton* crit_path_flylines_button = GTK_TOGGLE_BUTTON(app->get_object("ToggleCritPathFlylines"));
141+
GtkToggleButton* crit_path_routing_button = GTK_TOGGLE_BUTTON(app->get_object("ToggleCritPathRouting"));
142+
GtkToggleButton* crit_path_delays_button = GTK_TOGGLE_BUTTON(app->get_object("ToggleCritPathDelays"));
143+
144+
if (crit_path_switch && crit_path_flylines_button && crit_path_routing_button && crit_path_delays_button) {
145+
bool draw_flylines = (high_light_mode.find("flylines") != std::string::npos);
146+
bool draw_routing = (high_light_mode.find("routing") != std::string::npos);
147+
bool draw_delays = (high_light_mode.find("delays") != std::string::npos);
148+
149+
gtk_switch_set_active(crit_path_switch, TRUE);
150+
gtk_toggle_button_set_active(crit_path_flylines_button, draw_flylines);
151+
gtk_toggle_button_set_active(crit_path_routing_button, draw_routing);
152+
gtk_toggle_button_set_active(crit_path_delays_button, draw_delays);
142153
task->set_success();
143154
} else {
144-
std::string msg{"cannot find ToggleCritPath qcombobox index for item " + high_light_mode};
155+
std::string msg{"Cannot find critical path widgets. Was the UI layout changed?"};
145156
VTR_LOG_ERROR(msg.c_str());
146157
task->set_fail(msg);
147158
}

0 commit comments

Comments
 (0)