From f6c5062c71e9ca157b5f57c0442e9964f5b542e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?=
See Source#select for a description of that function.
+Using the global version does not create a new source, but
+modifies the default source.
+
+
+# Selects only B cell instances below the top cell
+select("-", "+B*")
+l1 = input(1, 0)
+
Usage:
This method will construct a new source object with the given cell filters -applied. +applied. Note that there is a global version of "select" which does not +create a new source, but acts on the default source. +
Cell filters will enable or disable cells plus their subtree. Cells can be switched on and off, which makes the hierarchy traversal stop or begin delivering shapes at the given cell. The arguments of @@ -345,8 +347,8 @@ To disable the TOP cell but enabled a hypothetical cell B below the top cell, us code:
-layout_with_selection = source.select("-TOP", "+B")
-l1 = source.input(1, 0)
+source_with_selection = source.select("-TOP", "+B")
+l1 = source_with_selection.input(1, 0)
...
@@ -362,8 +364,8 @@ The following code will just select "B" without its children, because in the first "-*" selection, all cells including the children of "B" are disabled:
-layout_with_selection = source.select("-*", "+B")
-l1 = source.input(1, 0)
+source_with_selection = source.select("-*", "+B")
+l1 = source_with_selection.input(1, 0)
...
@@ -371,8 +373,8 @@ The short form "-" will disable the top cell. This code is identical to the firs and will start with a disabled top cell regardless of its name:
-layout_with_selection = source.select("-", "+B")
-l1 = source.input(1, 0)
+source_with_selection = source.select("-", "+B")
+l1 = source_with_selection.input(1, 0)
...
diff --git a/src/layui/layui/layDialogs.cc b/src/layui/layui/layDialogs.cc
index 5128640d3..2a19ef4fa 100644
--- a/src/layui/layui/layDialogs.cc
+++ b/src/layui/layui/layDialogs.cc
@@ -98,7 +98,7 @@ LayerSourceDialog::exec_dialog (std::string &s)
// NewLayoutPropertiesDialog implementation
NewLayoutPropertiesDialog::NewLayoutPropertiesDialog (QWidget *parent)
- : QDialog (parent)
+ : QDialog (parent), m_default_dbu (0.0)
{
setObjectName (QString::fromUtf8 ("new_layout_properties_dialog"));
@@ -117,14 +117,20 @@ NewLayoutPropertiesDialog::~NewLayoutPropertiesDialog ()
void
NewLayoutPropertiesDialog::tech_changed ()
{
- double dbu = 0.001;
+ double dbu = 0.0;
int technology_index = mp_ui->tech_cbx->currentIndex ();
if (technology_index >= 0 && technology_index < (int) db::Technologies::instance ()->technologies ()) {
dbu = db::Technologies::instance ()->begin () [technology_index].dbu ();
}
+ m_default_dbu = dbu;
+
#if QT_VERSION >= 0x40700
- mp_ui->dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
+ if (dbu > 1e-10) {
+ mp_ui->dbu_le->setPlaceholderText (tl::to_qstring (tl::to_string (dbu)));
+ } else {
+ mp_ui->dbu_le->setPlaceholderText (QString ());
+ }
#endif
}
@@ -142,6 +148,8 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
}
+ tech_changed ();
+
mp_ui->window_le->setText (tl::to_qstring (tl::to_string (size)));
if (dbu > 1e-10) {
mp_ui->dbu_le->setText (tl::to_qstring (tl::to_string (dbu)));
@@ -174,7 +182,7 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
if (! mp_ui->dbu_le->text ().isEmpty ()) {
tl::from_string_ext (tl::to_string (mp_ui->dbu_le->text ()), dbu);
} else {
- dbu = 0.0;
+ dbu = m_default_dbu;
}
cell_name = tl::to_string (mp_ui->topcell_le->text ());
diff --git a/src/layui/layui/layDialogs.h b/src/layui/layui/layDialogs.h
index b78de3731..cf752d5b9 100644
--- a/src/layui/layui/layDialogs.h
+++ b/src/layui/layui/layDialogs.h
@@ -338,6 +338,7 @@ private:
virtual void accept ();
Ui::NewLayoutPropertiesDialog *mp_ui;
+ double m_default_dbu;
};
/**