Skip to content

Commit 9c7928a

Browse files
authored
Merge pull request #8509 from gadfort/fix-gui-sta
gui: guard update button when sta is not available
2 parents f31d727 + b6b1b2c commit 9c7928a

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/gui/src/timingWidget.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ TimingWidget::TimingWidget(QWidget* parent)
7171
controls_layout->insertStretch(2);
7272
control_frame->setLayout(controls_layout);
7373
layout->addWidget(control_frame);
74+
update_button_->setEnabled(false);
7475

7576
// top half
7677
delay_widget_->addTab(setup_timing_table_view_, "Setup");
@@ -632,6 +633,8 @@ void TimingWidget::highlightPathStage(TimingPathDetailModel* model,
632633

633634
void TimingWidget::populatePaths()
634635
{
636+
update_button_->setEnabled(false);
637+
635638
clearPathDetails();
636639

637640
const auto from = settings_->getFromPins();
@@ -640,6 +643,8 @@ void TimingWidget::populatePaths()
640643
const sta::ClockSet* clks = settings_->getClocks();
641644

642645
populateAndSortModels(from, thru, to, "" /* path group name */, clks);
646+
647+
update_button_->setEnabled(true);
643648
}
644649

645650
void TimingWidget::populateAndSortModels(
@@ -649,10 +654,20 @@ void TimingWidget::populateAndSortModels(
649654
const std::string& path_group_name,
650655
const sta::ClockSet* clks)
651656
{
652-
setup_timing_paths_model_->populateModel(
653-
from, thru, to, path_group_name, clks);
654-
hold_timing_paths_model_->populateModel(
655-
from, thru, to, path_group_name, clks);
657+
try {
658+
setup_timing_paths_model_->populateModel(
659+
from, thru, to, path_group_name, clks);
660+
hold_timing_paths_model_->populateModel(
661+
from, thru, to, path_group_name, clks);
662+
} catch (const std::runtime_error& error) {
663+
setup_timing_paths_model_->resetModel();
664+
hold_timing_paths_model_->resetModel();
665+
666+
QApplication::restoreOverrideCursor();
667+
668+
QMessageBox::critical(this, error.what(), "Failed to populate timing.");
669+
return;
670+
}
656671

657672
// honor selected sort
658673
auto setup_header = setup_timing_table_view_->horizontalHeader();
@@ -797,6 +812,7 @@ void TimingWidget::toggleRenderer(bool visible)
797812
void TimingWidget::setBlock(odb::dbBlock* block)
798813
{
799814
dbchange_listener_->addOwner(block);
815+
update_button_->setEnabled(true);
800816
}
801817

802818
void TimingWidget::showSettings()

0 commit comments

Comments
 (0)