@@ -50,7 +50,7 @@ DRCWidget::DRCWidget(QWidget* parent)
5050 logger_ (nullptr ),
5151 view_(new ObjectTree(this )),
5252 model_(new DRCItemModel(this )),
53- block_ (nullptr ),
53+ chip_ (nullptr ),
5454 categories_(new QComboBox(this )),
5555 load_(new QPushButton(" Load..." , this )),
5656 renderer_(std::make_unique<DRCRenderer>())
@@ -119,7 +119,7 @@ void DRCWidget::setLogger(utl::Logger* logger)
119119
120120void DRCWidget::selectReport ()
121121{
122- if (!block_ ) {
122+ if (!chip_ ) {
123123 logger_->error (utl::GUI, 104 , " No database has been loaded" );
124124 }
125125
@@ -227,17 +227,19 @@ void DRCWidget::doubleClicked(const QModelIndex& index)
227227 showMarker (index, true );
228228}
229229
230- void DRCWidget::setBlock (odb::dbBlock* block )
230+ void DRCWidget::setChip (odb::dbChip* chip )
231231{
232- block_ = block ;
232+ chip_ = chip ;
233233
234- addOwner (block_ );
234+ addOwner (chip_ );
235235 updateMarkerGroups ();
236236}
237237
238238void DRCWidget::showEvent (QShowEvent* event)
239239{
240- addOwner (block_);
240+ if (chip_) {
241+ addOwner (chip_);
242+ }
241243
242244 updateMarkerGroups ();
243245 toggleRenderer (true );
@@ -267,7 +269,7 @@ void DRCWidget::toggleRenderer(bool visible)
267269void DRCWidget::updateModel ()
268270{
269271 const std::string name = categories_->currentText ().toStdString ();
270- odb::dbMarkerCategory* category = block_ ->findMarkerCategory (name.c_str ());
272+ odb::dbMarkerCategory* category = chip_ ->findMarkerCategory (name.c_str ());
271273
272274 model_->removeRows (0 , model_->rowCount ());
273275
@@ -385,13 +387,13 @@ void DRCWidget::loadReport(const QString& filename)
385387odb::dbMarkerCategory* DRCWidget::loadTRReport (const QString& filename)
386388{
387389 const std::string file = filename.toStdString ();
388- return odb::dbMarkerCategory::fromTR (block_ , " DRC" , file);
390+ return odb::dbMarkerCategory::fromTR (chip_ , " DRC" , file);
389391}
390392
391393odb::dbMarkerCategory* DRCWidget::loadJSONReport (const QString& filename)
392394{
393395 const std::string file = filename.toStdString ();
394- const auto categories = odb::dbMarkerCategory::fromJSON (block_ , file);
396+ const auto categories = odb::dbMarkerCategory::fromJSON (chip_ , file);
395397
396398 if (categories.size () > 1 ) {
397399 logger_->warn (utl::GUI,
@@ -414,7 +416,7 @@ void DRCWidget::updateMarkerGroups()
414416
415417void DRCWidget::updateMarkerGroupsWithIgnore (odb::dbMarkerCategory* ignore)
416418{
417- if (block_ == nullptr ) {
419+ if (chip_ == nullptr ) {
418420 return ;
419421 }
420422
@@ -425,7 +427,7 @@ void DRCWidget::updateMarkerGroupsWithIgnore(odb::dbMarkerCategory* ignore)
425427 categories_->clear ();
426428
427429 categories_->addItem (" " );
428- for (auto * category : block_ ->getMarkerCategories ()) {
430+ for (auto * category : chip_ ->getMarkerCategories ()) {
429431 if (ignore == category) {
430432 continue ;
431433 }
@@ -452,7 +454,7 @@ void DRCWidget::inDbMarkerCategoryDestroy(odb::dbMarkerCategory* category)
452454void DRCWidget::inDbMarkerCreate (odb::dbMarker* marker)
453455{
454456 const std::string name = categories_->currentText ().toStdString ();
455- odb::dbMarkerCategory* category = block_ ->findMarkerCategory (name.c_str ());
457+ odb::dbMarkerCategory* category = chip_ ->findMarkerCategory (name.c_str ());
456458
457459 if (marker->getCategory ()->getTopCategory () == category) {
458460 updateModel ();
@@ -462,7 +464,7 @@ void DRCWidget::inDbMarkerCreate(odb::dbMarker* marker)
462464void DRCWidget::inDbMarkerDestroy (odb::dbMarker* marker)
463465{
464466 const std::string name = categories_->currentText ().toStdString ();
465- odb::dbMarkerCategory* category = block_ ->findMarkerCategory (name.c_str ());
467+ odb::dbMarkerCategory* category = chip_ ->findMarkerCategory (name.c_str ());
466468
467469 if (marker->getCategory ()->getTopCategory () == category) {
468470 updateModel ();
0 commit comments