From e148898d4cb58db7d31a47fdbfc40d19c58f0864 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 18 Aug 2019 23:56:00 +0200 Subject: [PATCH] Fixed an issue with drawing canvas and undo When a "create instance" operation with a library cell was undone the following issue could be seen: as the library cell might create new layers in the target layout, these needed to be undone when the operation was reverted. But then the canvas bit planes got messed up because the "LayoutView::set_view_ops" call was missing. Now this happens inside the manipulation functions for deleting and inserting layers. This should also reduce the necessity to call LayoutView::update_content explicitly. --- src/lay/lay/TechBaseEditorPage.ui | 297 ++++++++++++---------- src/lay/lay/layMainWindow.cc | 2 - src/lay/lay/layTechSetupDialog.cc | 35 +++ src/laybasic/laybasic/layLayoutView.cc | 6 + src/laybasic/laybasic/layLibrariesView.cc | 4 + 5 files changed, 205 insertions(+), 139 deletions(-) diff --git a/src/lay/lay/TechBaseEditorPage.ui b/src/lay/lay/TechBaseEditorPage.ui index 99267f779..059659437 100644 --- a/src/lay/lay/TechBaseEditorPage.ui +++ b/src/lay/lay/TechBaseEditorPage.ui @@ -6,14 +6,48 @@ 0 0 - 568 - 353 + 604 + 498 Form + + + + ... + + + + + + + + + + Name + + + + + + + false + + + + + + + The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported. + + + true + + + @@ -21,9 +55,6 @@ - - - @@ -40,135 +71,6 @@ - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - µm - - - - - - - - - - Qt::Vertical - - - - 0 - 27 - - - - - - - - Qt::Horizontal - - - - - - - The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported. - - - true - - - - - - - Base path - - - - - - - Qt::Horizontal - - - - - - - ... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Name - - - - - - - false - - - - - - - (Use the rename button to change this) - - - - - - @@ -223,10 +125,10 @@ - - + + - The default database unit is used as database unit for freshly created layouts + Base path @@ -252,6 +154,127 @@ unit + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + + + (Use the rename button to change this) + + + + + + + The default database unit is used as database unit for freshly created layouts + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + µm + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Technology +specific +libraries + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QAbstractItemView::NoSelection + + + diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 67475dff5..3ae39ec3d 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -2414,7 +2414,6 @@ MainWindow::cm_undo () (*vp)->cancel (); } m_manager.undo (); - current_view ()->update_content (); } END_PROTECTED @@ -2431,7 +2430,6 @@ MainWindow::cm_redo () (*vp)->cancel (); } m_manager.redo (); - current_view ()->update_content (); } END_PROTECTED diff --git a/src/lay/lay/layTechSetupDialog.cc b/src/lay/lay/layTechSetupDialog.cc index 89454c5d1..0e881fd0b 100644 --- a/src/lay/lay/layTechSetupDialog.cc +++ b/src/lay/lay/layTechSetupDialog.cc @@ -37,6 +37,8 @@ #include "tlStream.h" #include "tlClassRegistry.h" #include "dbStream.h" +#include "dbLibraryManager.h" +#include "dbLibrary.h" #include "ui_TechSetupDialog.h" #include "ui_TechMacrosPage.h" @@ -51,6 +53,7 @@ #include #include #include +#include #include #include @@ -114,6 +117,38 @@ TechBaseEditorPage::setup () mp_ui->lyp_grp->setChecked (! lyp.empty ()); mp_ui->lyp_le->setText (tl::to_qstring (lyp)); mp_ui->add_other_layers_cbx->setChecked (tech ()->add_other_layers ()); + + mp_ui->libs_lw->clear (); + + if (! tech ()->name ().empty ()) { + + mp_ui->libs_lbl->setEnabled (true); + mp_ui->libs_lw->setEnabled (true); + + std::vector libs; + + for (db::LibraryManager::iterator l = db::LibraryManager::instance ().begin (); l != db::LibraryManager::instance ().end (); ++l) { + const db::Library *lib = db::LibraryManager::instance ().lib (l->second); + if (lib->get_technology () == tech ()->name ()) { + std::string text = lib->get_name (); + if (! lib->get_description ().empty ()) { + text += " - " + lib->get_description (); + } + libs.push_back (text); + } + } + + std::sort (libs.begin (), libs.end ()); + + for (std::vector::const_iterator l = libs.begin (); l != libs.end (); ++l) { + mp_ui->libs_lw->addItem (new QListWidgetItem (tl::to_qstring (*l))); + } + + } else { + mp_ui->libs_lbl->setEnabled (false); + mp_ui->libs_lw->setEnabled (false); + mp_ui->libs_lw->addItem (tr ("The default technology can't have libraries")); + } } void diff --git a/src/laybasic/laybasic/layLayoutView.cc b/src/laybasic/laybasic/layLayoutView.cc index 3930c678c..3249333e9 100644 --- a/src/laybasic/laybasic/layLayoutView.cc +++ b/src/laybasic/laybasic/layLayoutView.cc @@ -1706,9 +1706,12 @@ LayoutView::insert_layer_list (unsigned index, const LayerPropertiesList &props) m_current_layer_list = index; current_layer_list_changed_event (index); + layer_list_inserted_event (index); redraw (); + + dm_prop_changed (); } void @@ -1750,6 +1753,7 @@ LayoutView::delete_layer_list (unsigned index) } layer_list_deleted_event (index); + dm_prop_changed (); } void @@ -1986,6 +1990,7 @@ LayoutView::insert_layer (unsigned int index, const LayerPropertiesConstIterator if (index == current_layer_list ()) { layer_list_changed_event (2); redraw (); + dm_prop_changed (); } return ret; @@ -2013,6 +2018,7 @@ LayoutView::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter if (index == current_layer_list ()) { layer_list_changed_event (2); redraw (); + dm_prop_changed (); } // invalidate the iterator so it can be used to refer to the next element diff --git a/src/laybasic/laybasic/layLibrariesView.cc b/src/laybasic/laybasic/layLibrariesView.cc index d0bc69894..7acf3d6cd 100644 --- a/src/laybasic/laybasic/layLibrariesView.cc +++ b/src/laybasic/laybasic/layLibrariesView.cc @@ -795,6 +795,10 @@ LibrariesView::display_string (int n) const if (! lib->get_description ().empty ()) { text += " - " + lib->get_description (); } + if (! lib->get_technology ().empty ()) { + text += " "; + text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (lib->get_technology ()))); + } return text; }