Debugging & testing

This commit is contained in:
Matthias Koefferlein 2023-04-19 01:22:46 +02:00
parent 3361802a20
commit 56fbba60c1
1 changed files with 144 additions and 107 deletions

View File

@ -844,8 +844,40 @@ OASISReader::do_read (db::Layout &layout)
db::PropertiesRepository &rep = layout.properties_repository (); db::PropertiesRepository &rep = layout.properties_repository ();
// exchange the properties in the repository: first locate all // exchange properties in layout_properties
// property sets that are affected db::PropertiesRepository::properties_set new_set;
for (db::PropertiesRepository::properties_set::const_iterator s = layout_properties.begin (); s != layout_properties.end (); ++s) {
if (s->first == pf->second && is_s_gds_property) {
// S_GDS_PROPERTY translation
if (!s->second.is_list () || s->second.get_list ().size () != 2) {
error (tl::to_string (tr ("S_GDS_PROPERTY must have a value list with exactly two elements")));
}
new_set.insert (std::make_pair (rep.prop_name_id (s->second.get_list () [0]), s->second.get_list () [1]));
} else if (s->first == pf->second && is_klayout_context_property) {
// feed context strings from klayout context property
if (s->second.is_list ()) {
for (auto l = s->second.begin (); l != s->second.end (); ++l) {
context_properties.push_back (*l);
}
} else {
context_properties.push_back (s->second);
}
} else {
new_set.insert (*s);
}
}
new_set.swap (layout_properties);
// exchange the properties in the repository
// first locate all property sets that are affected
std::vector <db::properties_id_type> pids; std::vector <db::properties_id_type> pids;
for (db::PropertiesRepository::iterator p = rep.begin (); p != rep.end (); ++p) { for (db::PropertiesRepository::iterator p = rep.begin (); p != rep.end (); ++p) {
if (p->second.find (pf->second) != p->second.end ()) { if (p->second.find (pf->second) != p->second.end ()) {
@ -871,6 +903,7 @@ OASISReader::do_read (db::Layout &layout)
} else if (s->first == pf->second && is_klayout_context_property) { } else if (s->first == pf->second && is_klayout_context_property) {
if (*pid == layout.prop_id ()) {
// feed context strings from klayout context property // feed context strings from klayout context property
if (s->second.is_list ()) { if (s->second.is_list ()) {
for (auto l = s->second.begin (); l != s->second.end (); ++l) { for (auto l = s->second.begin (); l != s->second.end (); ++l) {
@ -879,6 +912,10 @@ OASISReader::do_read (db::Layout &layout)
} else { } else {
context_properties.push_back (s->second); context_properties.push_back (s->second);
} }
} else {
// TODO: should update that in cells (in case we encounter forward-referenced context properties
// for cells)
}
} else { } else {
new_set.insert (*s); new_set.insert (*s);