From 5e73b0f5f8312cf26decc5eb5067b1e904263f80 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 9 Oct 2022 23:23:47 +0200 Subject: [PATCH] WIP: multi-selection properties on instances --- src/edt/edt/edtInstPropertiesPage.cc | 40 ++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/edt/edt/edtInstPropertiesPage.cc b/src/edt/edt/edtInstPropertiesPage.cc index 9cbf7d4d2..5721acfbb 100644 --- a/src/edt/edt/edtInstPropertiesPage.cc +++ b/src/edt/edt/edtInstPropertiesPage.cc @@ -242,13 +242,49 @@ InstPropertiesPage::select_entries (const std::vector &entries) std::string InstPropertiesPage::description (size_t entry) const { - return m_selection_ptrs [entry]->back ().inst_ptr.to_string (); // @@@ + std::string d; + + edt::Service::obj_iterator pos = m_selection_ptrs [entry]; + if (! pos->is_cell_inst ()) { + return d; + } + + const lay::CellView &cv = mp_service->view ()->cellview (pos->cv_index ()); + double dbu = cv->layout ().dbu (); + + db::Layout *def_layout = &cv->layout (); + db::cell_index_type def_cell_index = pos->back ().inst_ptr.cell_index (); + std::pair dl = def_layout->defining_library (def_cell_index); + if (dl.first) { + def_layout = &dl.first->layout (); + def_cell_index = dl.second; + } + + std::pair pci = def_layout->is_pcell_instance (def_cell_index); + if (pci.first && def_layout->pcell_declaration (pci.second)) { + d += def_layout->pcell_header (pci.second)->get_name (); + } else { + d += def_layout->cell_name (def_cell_index); + } + + db::ICplxTrans t (pos->back ().inst_ptr.complex_trans ()); + db::DCplxTrans dt = db::CplxTrans (dbu) * t * db::CplxTrans (dbu).inverted (); + + db::Vector rowv, columnv; + unsigned long rows, columns; + if (pos->back ().inst_ptr.is_regular_array (rowv, columnv, rows, columns)) { + d += tl::sprintf ("(%s; array %dx%d)", dt.to_string (true), rows, columns); + } else { + d += tl::sprintf ("(%s)", dt.to_string (true)); + } + + return d; } std::string InstPropertiesPage::description () const { - return "Instances"; // @@@ + return tl::to_string (tr ("Instances")); } void