Skip to content

Commit

Permalink
More consistent behavior of Marker Browser / Scan Shapes
Browse files Browse the repository at this point in the history
* Scan Shapes Hierarchical will scan from current cell, not all cells
* Marker browser shows markers propertly also in descended mode
* Marker database description of shown in selection box
  • Loading branch information
Matthias Koefferlein committed Dec 3, 2023
1 parent ebb35b1 commit 7b4a5c3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
38 changes: 30 additions & 8 deletions src/layui/layui/rdbMarkerBrowserDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,13 @@ MarkerBrowserDialog::rdbs_changed ()

for (unsigned int i = 0; i < view ()->num_rdbs (); ++i) {
const rdb::Database *rdb = view ()->get_rdb (i);
mp_ui->rdb_cb->addItem (tl::to_qstring (rdb->name ()));
std::string text = rdb->name ();
if (! rdb->description ().empty ()) {
text += " (";
text += rdb->description ();
text += ")";
}
mp_ui->rdb_cb->addItem (tl::to_qstring (text));
if (rdb->name () == m_rdb_name) {
rdb_index = i;
}
Expand Down Expand Up @@ -761,23 +767,35 @@ MarkerBrowserDialog::scan_layer ()

std::string desc;
for (std::vector<lay::LayerPropertiesConstIterator>::const_iterator l = layers.begin (); l != layers.end (); ++l) {
if (!(*l)->has_children () && (*l)->cellview_index () >= 0 && layout.is_valid_layer ((*l)->layer_index ())) {
if (!(*l)->has_children () && (*l)->cellview_index () == cv_index && layout.is_valid_layer ((*l)->layer_index ())) {
if (! desc.empty ()) {
desc += ", ";
}
desc += layout.get_properties ((*l)->layer_index ()).to_string ();
}
}
rdb->set_description ("Shapes of layer(s) " + desc);
desc = tl::to_string (tr ("Hierarchical shapes of layer(s) ")) + desc;
desc += " ";
desc += tl::to_string (tr ("from cell "));
desc += cv->layout ().cell_name (cv.cell_index ());
rdb->set_description (desc);

std::set<db::cell_index_type> called_cells;
called_cells.insert (cv.cell_index ());
cv->layout ().cell (cv.cell_index ()).collect_called_cells (called_cells);

for (std::vector<lay::LayerPropertiesConstIterator>::const_iterator l = layers.begin (); l != layers.end (); ++l) {

if (!(*l)->has_children () && (*l)->cellview_index () >= 0 && layout.is_valid_layer ((*l)->layer_index ())) {
if (!(*l)->has_children () && (*l)->cellview_index () == cv_index && layout.is_valid_layer ((*l)->layer_index ())) {

rdb::Category *cat = rdb->create_category (layout.get_properties ((*l)->layer_index ()).to_string ());
rdb::Category *cat = rdb->create_category (layout.get_properties ((*l)->layer_index ()).to_string ());

for (db::Layout::const_iterator cid = layout.begin (); cid != layout.end (); ++cid) {

if (called_cells.find (cid->cell_index ()) == called_cells.end ()) {
continue;
}

const db::Cell &cell = *cid;
if (cell.shapes ((*l)->layer_index ()).size () > 0) {

Expand Down Expand Up @@ -855,18 +873,22 @@ MarkerBrowserDialog::scan_layer_flat ()

std::string desc;
for (std::vector<lay::LayerPropertiesConstIterator>::const_iterator l = layers.begin (); l != layers.end (); ++l) {
if (!(*l)->has_children () && (*l)->cellview_index () >= 0 && layout.is_valid_layer ((*l)->layer_index ())) {
if (!(*l)->has_children () && (*l)->cellview_index () == cv_index && layout.is_valid_layer ((*l)->layer_index ())) {
if (! desc.empty ()) {
desc += ", ";
}
desc += layout.get_properties ((*l)->layer_index ()).to_string ();
}
}
rdb->set_description ("Shapes of layer(s) " + desc);
desc = tl::to_string (tr ("Flat shapes of layer(s) ")) + desc;
desc += " ";
desc += tl::to_string (tr ("from cell "));
desc += cv->layout ().cell_name (cv.cell_index ());
rdb->set_description (desc);

for (std::vector<lay::LayerPropertiesConstIterator>::const_iterator l = layers.begin (); l != layers.end (); ++l) {

if (!(*l)->has_children () && (*l)->cellview_index () >= 0 && layout.is_valid_layer ((*l)->layer_index ())) {
if (!(*l)->has_children () && (*l)->cellview_index () == cv_index && layout.is_valid_layer ((*l)->layer_index ())) {

rdb::Category *cat = rdb->create_category (layout.get_properties ((*l)->layer_index ()).to_string ());

Expand Down
6 changes: 3 additions & 3 deletions src/layui/layui/rdbMarkerBrowserPage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ MarkerBrowserPage::do_update_markers ()

lay::CellView cv = mp_view->cellview (m_cv_index);
if (! current_cell && cv.is_valid ()) {
current_cell = mp_database->cell_by_qname (cv->layout ().cell_name (cv.cell_index ()));
current_cell = mp_database->cell_by_qname (cv->layout ().cell_name (cv.ctx_cell_index ()));
}

std::vector<db::DCplxTrans> tv = mp_view->cv_transform_variants (m_cv_index);
Expand Down Expand Up @@ -2182,7 +2182,7 @@ MarkerBrowserPage::do_update_markers ()
// If we could not find a transformation in the RDB, try to find one in the layout DB:
std::pair<bool, db::cell_index_type> cc = cv->layout ().cell_by_name (c->name ().c_str ());
if (cc.first) {
std::pair <bool, db::ICplxTrans> ic = db::find_layout_context (cv->layout (), cc.second, cv.cell_index ());
std::pair <bool, db::ICplxTrans> ic = db::find_layout_context (cv->layout (), cc.second, cv.ctx_cell_index ());
if (ic.first) {
context.first = true;
context.second = db::DCplxTrans (cv->layout ().dbu ()) * db::DCplxTrans (ic.second) * db::DCplxTrans (1.0 / cv->layout ().dbu ());
Expand All @@ -2197,7 +2197,7 @@ MarkerBrowserPage::do_update_markers ()
context = std::pair <bool, db::DCplxTrans> (true, db::DCplxTrans ());
} else if (! current_cell) {
m_error_text = tl::sprintf (tl::to_string (QObject::tr ("Current layout cell '%s' not found in marker database and no path found from marker's cell '%s' to current cell in the layout database.")),
cv->layout ().cell_name (cv.cell_index ()), c->name ());
cv->layout ().cell_name (cv.ctx_cell_index ()), c->name ());
} else {
m_error_text = tl::sprintf (tl::to_string (QObject::tr ("No example instantiation given in marker database for marker's cell '%s' to current cell '%s' and no such path in the layout database either.")),
c->name (), current_cell->name ());
Expand Down

0 comments on commit 7b4a5c3

Please sign in to comment.