Netlist browser: warning if not all shapes are highlighted.

This commit is contained in:
Matthias Koefferlein 2019-04-28 19:40:55 +02:00
parent d68c61394a
commit c4b5c648b7
2 changed files with 33 additions and 12 deletions

View File

@ -113,11 +113,17 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Netlist</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="lay::DecoratedLineEdit" name="find_text">
@ -235,13 +241,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="info_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="info_button">
<property name="toolTip">
@ -259,6 +258,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="info_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -193,10 +193,12 @@ static inline void *make_id (size_t i1)
return reinterpret_cast<void *> (i1);
}
/* not used yet:
static inline void *make_id (size_t i1, size_t n1, size_t i2)
{
return reinterpret_cast<void *> (i1 + n1 * i2);
}
*/
static inline void *make_id (size_t i1, size_t n1, size_t i2, size_t n2, size_t i3)
{
@ -2195,6 +2197,7 @@ NetlistBrowserPage::update_highlights ()
}
clear_markers ();
info_label->setText (QString ());
if (! mp_database.get () || ! mp_view) {
return;
@ -2209,6 +2212,7 @@ NetlistBrowserPage::update_highlights ()
std::vector<db::DCplxTrans> tv = mp_view->cv_transform_variants (m_cv_index);
size_t n_markers = 0;
bool not_all_shapes_are_shown = false;
for (std::vector<const db::Net *>::const_iterator net = m_current_nets.begin (); net != m_current_nets.end (); ++net) {
@ -2227,7 +2231,12 @@ NetlistBrowserPage::update_highlights ()
// @@@ TODO: how to get the original layer?
db::recursive_cluster_shape_iterator<db::PolygonRef> shapes (mp_database->net_clusters (), *layer, cell_index, cluster_id);
while (! shapes.at_end () && n_markers < m_max_shape_count) {
while (! shapes.at_end ()) {
if (n_markers == m_max_shape_count) {
not_all_shapes_are_shown = true;
break;
}
mp_markers.push_back (new lay::Marker (mp_view, m_cv_index));
mp_markers.back ()->set (*shapes, shapes.trans (), tv);
@ -2276,6 +2285,12 @@ NetlistBrowserPage::update_highlights ()
}
}
if (not_all_shapes_are_shown) {
info_label->setText (tl::to_qstring ("<html><p style=\"color:red; font-weight: bold\">" +
tl::to_string (QObject::tr ("Not all shapes are highlighted")) +
"</p></html>"));
}
}
void