WIP: some refinement

This commit is contained in:
Matthias Koefferlein 2020-08-08 23:04:44 +02:00
parent 4254221e6e
commit 452aafe8ae
7 changed files with 961 additions and 668 deletions

View File

@ -6,10 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>500</width> <width>400</width>
<height>417</height> <height>446</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
@ -18,390 +24,440 @@
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QScrollArea" name="scrollArea">
<property name="title"> <property name="frameShape">
<string>Snapping</string> <enum>QFrame::NoFrame</enum>
</property> </property>
<layout class="QGridLayout"> <property name="frameShadow">
<property name="leftMargin"> <enum>QFrame::Plain</enum>
<number>9</number> </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>446</height>
</rect>
</property> </property>
<property name="topMargin"> <layout class="QVBoxLayout" name="verticalLayout">
<number>9</number> <property name="spacing">
</property> <number>2</number>
<property name="rightMargin"> </property>
<number>9</number> <property name="leftMargin">
</property> <number>4</number>
<property name="bottomMargin"> </property>
<number>9</number> <property name="topMargin">
</property> <number>4</number>
<property name="spacing"> </property>
<number>6</number> <property name="rightMargin">
</property> <number>4</number>
<item row="0" column="4"> </property>
<spacer> <property name="bottomMargin">
<property name="orientation"> <number>4</number>
<enum>Qt::Horizontal</enum> </property>
</property> <item>
<property name="sizeHint" stdset="0"> <widget class="QGroupBox" name="groupBox">
<size> <property name="title">
<width>148</width> <string>Snapping</string>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="edit_grid_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Enter the grid in micron. Can be anisotropic (&quot;gx,gy&quot;)</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Grid</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Objects </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="grid_cb">
<item>
<property name="text">
<string>No grid</string>
</property> </property>
</item> <layout class="QGridLayout" name="_5">
<item> <property name="leftMargin">
<property name="text"> <number>4</number>
<string>Global grid</string> </property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Grid</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="grid_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<item>
<property name="text">
<string>No grid</string>
</property>
</item>
<item>
<property name="text">
<string>Global grid</string>
</property>
</item>
<item>
<property name="text">
<string>Other grid ...</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QCheckBox" name="snap_objects_cbx">
<property name="text">
<string>Snap to other objects</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Objects </string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>148</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="edit_grid_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Enter the grid in micron. Can be anisotropic (&quot;gx,gy&quot;)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Angle Constraints</string>
</property> </property>
</item> <layout class="QGridLayout" name="_2">
<item> <property name="leftMargin">
<property name="text"> <number>4</number>
<string>Other grid ...</string> </property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Movements </string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Connections </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="conn_angle_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<item>
<property name="text">
<string>Any Angle</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal</string>
</property>
</item>
<item>
<property name="text">
<string>Manhattan</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="move_angle_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<item>
<property name="text">
<string>Any Direction</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal</string>
</property>
</item>
<item>
<property name="text">
<string>Manhattan</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>257</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Hierarchical Features</string>
</property> </property>
</item> <layout class="QGridLayout" name="_3">
</widget> <property name="leftMargin">
</item> <number>4</number>
<item row="1" column="1" colspan="4"> </property>
<widget class="QCheckBox" name="snap_objects_cbx"> <property name="topMargin">
<property name="text"> <number>4</number>
<string>Snap to other objects</string> </property>
</property> <property name="rightMargin">
</widget> <number>4</number>
</item> </property>
</layout> <property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Copy mode</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Shallow select</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="hier_copy_mode_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<item>
<property name="text">
<string>Shallow mode (instance only)</string>
</property>
</item>
<item>
<property name="text">
<string>Deep mode (instance and cell)</string>
</property>
</item>
<item>
<property name="text">
<string>Ask</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="3">
<widget class="QCheckBox" name="hier_sel_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select top level objects only</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Instance Display</string>
</property>
<layout class="QHBoxLayout" name="_4">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QCheckBox" name="show_shapes_cbx">
<property name="text">
<string>Show shapes while moving (max.</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="max_shapes_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string> shapes)</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>121</width>
<height>70</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Angle Constraints</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Movements </string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Connections </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="conn_angle_cb">
<item>
<property name="text">
<string>Any Angle</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal</string>
</property>
</item>
<item>
<property name="text">
<string>Manhattan</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="move_angle_cb">
<item>
<property name="text">
<string>Any Direction</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal</string>
</property>
</item>
<item>
<property name="text">
<string>Manhattan</string>
</property>
</item>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>257</width>
<height>41</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Hierarchical Features</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Copy mode</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Shallow select</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="hier_copy_mode_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
<item>
<property name="text">
<string>Shallow mode (instance only)</string>
</property>
</item>
<item>
<property name="text">
<string>Deep mode (instance and cell)</string>
</property>
</item>
<item>
<property name="text">
<string>Ask</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" colspan="3">
<widget class="QCheckBox" name="hier_sel_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select top level objects only</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Instance Display</string>
</property>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QCheckBox" name="show_shapes_cbx">
<property name="text">
<string>Show shapes when moving (max.</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="max_shapes_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>shapes)</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>121</width>
<height>51</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>grid_cb</tabstop>
<tabstop>edit_grid_le</tabstop>
<tabstop>snap_objects_cbx</tabstop>
<tabstop>conn_angle_cb</tabstop>
<tabstop>move_angle_cb</tabstop>
<tabstop>hier_sel_cbx</tabstop>
<tabstop>show_shapes_cbx</tabstop>
<tabstop>max_shapes_le</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -6,10 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>680</width> <width>358</width>
<height>574</height> <height>496</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
@ -18,163 +24,215 @@
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="QScrollArea" name="scrollArea">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Plain</enum>
</property> </property>
<layout class="QHBoxLayout"> <property name="widgetResizable">
<property name="spacing"> <bool>true</bool>
<number>6</number> </property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>358</width>
<height>496</height>
</rect>
</property> </property>
<property name="leftMargin"> <layout class="QGridLayout" name="gridLayout_2">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cell </string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="cell_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="browse_pb">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string> Library </string>
</property>
</widget>
</item>
<item>
<widget class="lay::LibrarySelectionComboBox" name="lib_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>522</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QTabWidget" name="param_tab_widget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Geometry</string>
</attribute>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin"> <property name="leftMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>4</number>
</property> </property>
<item> <property name="spacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Library</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="lay::LibrarySelectionComboBox" name="lib_cbx">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cell </string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="browse_pb">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<normaloff>:/find.png</normaloff>:/find.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="cell_le">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="place_origin_cb">
<property name="text">
<string>Place origin of cell</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Rotation / Scaling</string> <string>Rotation / Scaling</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="_2">
<property name="leftMargin"> <property name="leftMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="spacing"> <property name="horizontalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="scale_le"> <widget class="QLineEdit" name="scale_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -194,14 +252,14 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Scaling factor (magnification)</string> <string>Scaling factor</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="angle_le"> <widget class="QLineEdit" name="angle_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -229,10 +287,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2">
<widget class="QLabel" name="label_17">
<property name="text">
<string>(magnification)</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="5" column="0">
<widget class="QGroupBox" name="array_grp"> <widget class="QGroupBox" name="array_grp">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -246,33 +311,36 @@
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="_3">
<property name="leftMargin"> <property name="leftMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>4</number>
</property> </property>
<property name="spacing"> <property name="horizontalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="text"> <property name="text">
<string> Column vector (x,y)</string> <string> Column step</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
<widget class="QLineEdit" name="column_x_le"> <widget class="QLineEdit" name="column_x_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -292,7 +360,7 @@
<item row="2" column="4"> <item row="2" column="4">
<widget class="QLineEdit" name="column_y_le"> <widget class="QLineEdit" name="column_y_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -312,7 +380,7 @@
<item row="1" column="4"> <item row="1" column="4">
<widget class="QLineEdit" name="row_y_le"> <widget class="QLineEdit" name="row_y_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -332,7 +400,7 @@
<item row="1" column="2"> <item row="1" column="2">
<widget class="QLineEdit" name="row_x_le"> <widget class="QLineEdit" name="row_x_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -352,14 +420,14 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
<string> Row vector (x,y)</string> <string> Row step</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string> Rows/Columns</string> <string>Dimension</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -368,12 +436,15 @@
<property name="text"> <property name="text">
<string>columns =</string> <string>columns =</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="4">
<widget class="QLineEdit" name="columns_le"> <widget class="QLineEdit" name="columns_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -385,74 +456,89 @@
<property name="text"> <property name="text">
<string>rows = </string> <string>rows = </string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLineEdit" name="rows_le"> <widget class="QLineEdit" name="rows_le">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="5"> <item row="4" column="0" colspan="5">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>Warning: although row and column vectors can be arbitrary combination, <string>Warning: although row and column vectors can be arbitrary combination, some design systems only accept orthogonal (rectangular) arrays.</string>
some design systems only accept orthogonal (rectangular) arrays.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="6" column="0">
<spacer> <spacer name="spacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>120</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="pcell_tab">
<attribute name="title">
<string>PCell</string>
</attribute>
</widget>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="place_origin_cb">
<property name="text">
<string>Place origin of cell</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
@ -462,22 +548,8 @@ some design systems only accept orthogonal (rectangular) arrays.</string>
<header>layWidgets.h</header> <header>layWidgets.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <resources>
<tabstop>cell_le</tabstop> <include location="../../lay/lay/layResources.qrc"/>
<tabstop>browse_pb</tabstop> </resources>
<tabstop>lib_cbx</tabstop>
<tabstop>param_tab_widget</tabstop>
<tabstop>scale_le</tabstop>
<tabstop>angle_le</tabstop>
<tabstop>mirror_cbx</tabstop>
<tabstop>rows_le</tabstop>
<tabstop>columns_le</tabstop>
<tabstop>row_x_le</tabstop>
<tabstop>row_y_le</tabstop>
<tabstop>column_x_le</tabstop>
<tabstop>column_y_le</tabstop>
<tabstop>place_origin_cb</tabstop>
</tabstops>
<resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditorOptionsInstPCellParam</class>
<widget class="QWidget" name="EditorOptionsInstPCellParam">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>358</width>
<height>481</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -43,7 +43,8 @@ FORMS = \
RoundCornerOptionsDialog.ui \ RoundCornerOptionsDialog.ui \
TextPropertiesPage.ui \ TextPropertiesPage.ui \
PCellParametersDialog.ui \ PCellParametersDialog.ui \
DistributeOptionsDialog.ui DistributeOptionsDialog.ui \
EditorOptionsInstPCellParam.ui
SOURCES = \ SOURCES = \
edtConfig.cc \ edtConfig.cc \

View File

@ -38,6 +38,7 @@
#include "ui_EditorOptionsPath.h" #include "ui_EditorOptionsPath.h"
#include "ui_EditorOptionsText.h" #include "ui_EditorOptionsText.h"
#include "ui_EditorOptionsInst.h" #include "ui_EditorOptionsInst.h"
#include "ui_EditorOptionsInstPCellParam.h"
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -160,18 +161,23 @@ EditorOptionsPages::activate_page (edt::EditorOptionsPage *page)
void void
EditorOptionsPages::update (edt::EditorOptionsPage *page) EditorOptionsPages::update (edt::EditorOptionsPage *page)
{ {
std::sort (m_pages.begin (), m_pages.end (), EOPCompareOp ()); std::vector <edt::EditorOptionsPage *> sorted_pages = m_pages;
std::sort (sorted_pages.begin (), sorted_pages.end (), EOPCompareOp ());
if (! page && m_pages.size () > 0) {
page = m_pages.back ();
}
while (mp_pages->count () > 0) { while (mp_pages->count () > 0) {
mp_pages->removeTab (0); mp_pages->removeTab (0);
} }
int index = -1; int index = -1;
for (std::vector <edt::EditorOptionsPage *>::iterator p = m_pages.begin (); p != m_pages.end (); ++p) { for (std::vector <edt::EditorOptionsPage *>::iterator p = sorted_pages.begin (); p != sorted_pages.end (); ++p) {
if ((*p)->active ()) { if ((*p)->active ()) {
mp_pages->addTab ((*p)->q_frame (), tl::to_qstring ((*p)->title ()));
if ((*p) == page) { if ((*p) == page) {
index = int (std::distance (m_pages.begin (), p)); index = mp_pages->count ();
} }
mp_pages->addTab ((*p)->q_frame (), tl::to_qstring ((*p)->title ()));
} else { } else {
(*p)->q_frame ()->setParent (0); (*p)->q_frame ()->setParent (0);
} }
@ -522,7 +528,7 @@ EditorOptionsPath::setup (lay::Plugin *root)
// EditorOptionsInst implementation // EditorOptionsInst implementation
EditorOptionsInst::EditorOptionsInst (lay::Dispatcher *root) EditorOptionsInst::EditorOptionsInst (lay::Dispatcher *root)
: QWidget (), EditorOptionsPage (), mp_root (root), mp_pcell_parameters (0) : QWidget (), EditorOptionsPage (), mp_root (root)
{ {
mp_ui = new Ui::EditorOptionsInst (); mp_ui = new Ui::EditorOptionsInst ();
mp_ui->setupUi (this); mp_ui->setupUi (this);
@ -532,10 +538,6 @@ EditorOptionsInst::EditorOptionsInst (lay::Dispatcher *root)
connect (mp_ui->lib_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (library_changed (int))); connect (mp_ui->lib_cbx, SIGNAL (currentIndexChanged (int)), this, SLOT (library_changed (int)));
connect (mp_ui->cell_le, SIGNAL (textChanged (const QString &)), this, SLOT (cell_name_changed (const QString &))); connect (mp_ui->cell_le, SIGNAL (textChanged (const QString &)), this, SLOT (cell_name_changed (const QString &)));
QHBoxLayout *layout = new QHBoxLayout (mp_ui->pcell_tab);
layout->setMargin (0);
mp_ui->pcell_tab->setLayout (layout);
m_cv_index = -1; m_cv_index = -1;
} }
@ -554,17 +556,51 @@ EditorOptionsInst::title () const
void void
EditorOptionsInst::library_changed (int) EditorOptionsInst::library_changed (int)
{ {
update_cell_edits ();
/* @@@
BEGIN_PROTECTED BEGIN_PROTECTED
update_pcell_parameters (); update_pcell_parameters ();
END_PROTECTED END_PROTECTED
@@@*/
} }
void void
EditorOptionsInst::cell_name_changed (const QString &) EditorOptionsInst::cell_name_changed (const QString &)
{ {
update_cell_edits ();
/* @@@
BEGIN_PROTECTED BEGIN_PROTECTED
update_pcell_parameters (); update_pcell_parameters ();
END_PROTECTED END_PROTECTED
@@@*/
}
void
EditorOptionsInst::update_cell_edits ()
{
db::Layout *layout = 0;
// find the layout the cell has to be looked up: that is either the layout of the current instance or
// the library selected
if (mp_ui->lib_cbx->current_library ()) {
layout = &mp_ui->lib_cbx->current_library ()->layout ();
} else {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
}
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ());
std::pair<bool, db::cell_index_type> cc = layout->cell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ());
// by the way, update the foreground color of the cell edit box as well (red, if not valid)
QPalette pl = mp_ui->cell_le->palette ();
if (! pc.first && ! cc.first) {
pl.setColor (QPalette::Text, Qt::red);
pl.setColor (QPalette::Base, QColor (Qt::red).lighter (180));
} else {
pl.setColor (QPalette::Text, palette ().color (QPalette::Text));
pl.setColor (QPalette::Base, palette ().color (QPalette::Base));
}
mp_ui->cell_le->setPalette (pl);
} }
void void
@ -608,7 +644,7 @@ BEGIN_PROTECTED
} else if (layout->is_valid_cell_index (form.selected_cell_index ())) { } else if (layout->is_valid_cell_index (form.selected_cell_index ())) {
mp_ui->cell_le->setText (tl::to_qstring (layout->cell_name (form.selected_cell_index ()))); mp_ui->cell_le->setText (tl::to_qstring (layout->cell_name (form.selected_cell_index ())));
} }
update_pcell_parameters (); // @@@@update_pcell_parameters ();
} }
} }
@ -641,28 +677,6 @@ EditorOptionsInst::apply (lay::Plugin *root)
root->config_set (cfg_edit_inst_lib_name, std::string ()); root->config_set (cfg_edit_inst_lib_name, std::string ());
} }
// pcell parameters
std::string param;
db::Layout *layout = 0;
if (mp_ui->lib_cbx->current_library ()) {
layout = &mp_ui->lib_cbx->current_library ()->layout ();
} else if (m_cv_index >= 0 && lay::LayoutView::current () && lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
}
if (layout && mp_pcell_parameters) {
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ());
if (pc.first) {
const db::PCellDeclaration *pc_decl = layout->pcell_declaration (pc.second);
if (pc_decl) {
param = pcell_parameters_to_string (pc_decl->named_parameters (mp_pcell_parameters->get_parameters ()));
}
}
}
root->config_set (cfg_edit_inst_pcell_parameters, param);
// rotation, scaling // rotation, scaling
double angle = 0.0; double angle = 0.0;
tl::from_string (tl::to_string (mp_ui->angle_le->text ()), angle); tl::from_string (tl::to_string (mp_ui->angle_le->text ()), angle);
@ -724,61 +738,6 @@ EditorOptionsInst::setup (lay::Plugin *root)
root->config_get (cfg_edit_inst_lib_name, l); root->config_get (cfg_edit_inst_lib_name, l);
mp_ui->lib_cbx->set_current_library (db::LibraryManager::instance ().lib_ptr_by_name (l)); mp_ui->lib_cbx->set_current_library (db::LibraryManager::instance ().lib_ptr_by_name (l));
// pcell parameters
std::string param;
root->config_get (cfg_edit_inst_pcell_parameters, param);
db::Layout *layout = 0;
if (mp_ui->lib_cbx->current_library ()) {
layout = &mp_ui->lib_cbx->current_library ()->layout ();
} else if (m_cv_index >= 0 && lay::LayoutView::current () && lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
}
std::vector<tl::Variant> pv;
if (layout && mp_pcell_parameters) {
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ());
if (pc.first) {
const db::PCellDeclaration *pc_decl = layout->pcell_declaration (pc.second);
if (pc_decl) {
std::map<std::string, tl::Variant> parameters;
try {
tl::Extractor ex (param.c_str ());
ex.test ("!"); // used to flag PCells
while (! ex.at_end ()) {
std::string n;
ex.read_word_or_quoted (n);
ex.test (":");
ex.read (parameters.insert (std::make_pair (n, tl::Variant ())).first->second);
ex.test (";");
}
} catch (...) { }
const std::vector<db::PCellParameterDeclaration> &pcp = pc_decl->parameter_declarations ();
for (std::vector<db::PCellParameterDeclaration>::const_iterator pd = pcp.begin (); pd != pcp.end (); ++pd) {
std::map<std::string, tl::Variant>::const_iterator p = parameters.find (pd->get_name ());
if (p != parameters.end ()) {
pv.push_back (p->second);
} else {
pv.push_back (pd->get_default ());
}
}
}
}
}
try {
update_pcell_parameters (pv);
} catch (...) { }
// rotation, scaling // rotation, scaling
double angle = 0.0; double angle = 0.0;
root->config_get (cfg_edit_inst_angle, angle); root->config_get (cfg_edit_inst_angle, angle);
@ -819,43 +778,172 @@ EditorOptionsInst::setup (lay::Plugin *root)
mp_ui->place_origin_cb->setChecked (place_origin); mp_ui->place_origin_cb->setChecked (place_origin);
} }
void // ------------------------------------------------------------------
EditorOptionsInst::update_pcell_parameters () // EditorOptionsInstPCellParam implementation
EditorOptionsInstPCellParam::EditorOptionsInstPCellParam (lay::Dispatcher *root)
: QWidget (), EditorOptionsPage (), mp_root (root), mp_pcell_parameters (0)
{
mp_ui = new Ui::EditorOptionsInstPCellParam ();
mp_ui->setupUi (this);
}
EditorOptionsInstPCellParam::~EditorOptionsInstPCellParam ()
{
delete mp_ui;
mp_ui = 0;
}
std::string
EditorOptionsInstPCellParam::title () const
{
return tl::to_string (QObject::tr ("PCell"));
}
/* @@@
void
EditorOptionsInstPCellParam::library_changed (int)
{
BEGIN_PROTECTED
update_pcell_parameters ();
END_PROTECTED
}
void
EditorOptionsInstPCellParam::cell_name_changed (const QString &)
{
BEGIN_PROTECTED
update_pcell_parameters ();
END_PROTECTED
}
*/
void
EditorOptionsInstPCellParam::apply (lay::Plugin *root)
{
// pcell parameters
std::string param;
db::Layout *layout = 0;
db::Library *lib = db::LibraryManager::instance ().lib_ptr_by_name (m_lib_name);
if (lib) {
layout = &lib->layout ();
} else if (m_cv_index >= 0 && lay::LayoutView::current () && lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
}
if (layout && mp_pcell_parameters) {
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (m_cell_name).c_str ());
if (pc.first) {
const db::PCellDeclaration *pc_decl = layout->pcell_declaration (pc.second);
if (pc_decl) {
param = pcell_parameters_to_string (pc_decl->named_parameters (mp_pcell_parameters->get_parameters ()));
}
}
}
root->config_set (cfg_edit_inst_pcell_parameters, param);
}
void
EditorOptionsInstPCellParam::setup (lay::Plugin *root)
{
m_cv_index = -1;
if (lay::LayoutView::current ()) {
m_cv_index = lay::LayoutView::current ()->active_cellview_index ();
}
// cell name
root->config_get (cfg_edit_inst_cell_name, m_cell_name);
// library
root->config_get (cfg_edit_inst_lib_name, m_lib_name);
db::Library *lib = db::LibraryManager::instance ().lib_ptr_by_name (m_lib_name);
// pcell parameters
std::string param;
root->config_get (cfg_edit_inst_pcell_parameters, param);
db::Layout *layout = 0;
if (lib) {
layout = &lib->layout ();
} else if (m_cv_index >= 0 && lay::LayoutView::current () && lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
}
std::vector<tl::Variant> pv;
if (layout && mp_pcell_parameters) {
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (m_cell_name).c_str ());
if (pc.first) {
const db::PCellDeclaration *pc_decl = layout->pcell_declaration (pc.second);
if (pc_decl) {
std::map<std::string, tl::Variant> parameters;
try {
tl::Extractor ex (param.c_str ());
ex.test ("!"); // used to flag PCells
while (! ex.at_end ()) {
std::string n;
ex.read_word_or_quoted (n);
ex.test (":");
ex.read (parameters.insert (std::make_pair (n, tl::Variant ())).first->second);
ex.test (";");
}
} catch (...) { }
const std::vector<db::PCellParameterDeclaration> &pcp = pc_decl->parameter_declarations ();
for (std::vector<db::PCellParameterDeclaration>::const_iterator pd = pcp.begin (); pd != pcp.end (); ++pd) {
std::map<std::string, tl::Variant>::const_iterator p = parameters.find (pd->get_name ());
if (p != parameters.end ()) {
pv.push_back (p->second);
} else {
pv.push_back (pd->get_default ());
}
}
}
}
}
try {
update_pcell_parameters (pv);
} catch (...) { }
}
void
EditorOptionsInstPCellParam::update_pcell_parameters ()
{ {
update_pcell_parameters (std::vector <tl::Variant> ()); update_pcell_parameters (std::vector <tl::Variant> ());
} }
void void
EditorOptionsInst::update_pcell_parameters (const std::vector <tl::Variant> &parameters) EditorOptionsInstPCellParam::update_pcell_parameters (const std::vector <tl::Variant> &parameters)
{ {
db::Layout *layout = 0; db::Layout *layout = 0;
/* @@@
if (m_cv_index < 0 || !lay::LayoutView::current () || !lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) { if (m_cv_index < 0 || !lay::LayoutView::current () || !lay::LayoutView::current ()->cellview (m_cv_index).is_valid ()) {
mp_ui->param_tab_widget->setTabEnabled (1, false); mp_ui->param_tab_widget->setTabEnabled (1, false);
return; return;
} }
@@@*/
// find the layout the cell has to be looked up: that is either the layout of the current instance or // find the layout the cell has to be looked up: that is either the layout of the current instance or
// the library selected // the library selected
if (mp_ui->lib_cbx->current_library ()) { db::Library *lib = db::LibraryManager::instance ().lib_ptr_by_name (m_lib_name);
layout = &mp_ui->lib_cbx->current_library ()->layout (); if (lib) {
layout = &lib->layout ();
} else { } else {
layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout (); layout = &lay::LayoutView::current ()->cellview (m_cv_index)->layout ();
} }
std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ()); std::pair<bool, db::pcell_id_type> pc = layout->pcell_by_name (tl::to_string (m_cell_name).c_str ());
std::pair<bool, db::cell_index_type> cc = layout->cell_by_name (tl::to_string (mp_ui->cell_le->text ()).c_str ());
// by the way, update the foreground color of the cell edit box as well (red, if not valid)
QPalette pl = mp_ui->cell_le->palette ();
if (! pc.first && ! cc.first) {
pl.setColor (QPalette::Text, Qt::red);
pl.setColor (QPalette::Base, QColor (Qt::red).lighter (180));
} else {
pl.setColor (QPalette::Text, palette ().color (QPalette::Text));
pl.setColor (QPalette::Base, palette ().color (QPalette::Base));
}
mp_ui->cell_le->setPalette (pl);
PCellParametersPage::State pcp_state; PCellParametersPage::State pcp_state;
@ -870,15 +958,15 @@ EditorOptionsInst::update_pcell_parameters (const std::vector <tl::Variant> &par
if (pc.first && layout->pcell_declaration (pc.second)) { if (pc.first && layout->pcell_declaration (pc.second)) {
mp_ui->param_tab_widget->setTabEnabled (1, true); // @@@mp_ui->param_tab_widget->setTabEnabled (1, true);
lay::LayoutView *view = lay::LayoutView::current (); lay::LayoutView *view = lay::LayoutView::current ();
mp_pcell_parameters = new PCellParametersPage (mp_ui->pcell_tab, &view->cellview (m_cv_index)->layout (), view, m_cv_index, layout->pcell_declaration (pc.second), parameters); mp_pcell_parameters = new PCellParametersPage (this, &view->cellview (m_cv_index)->layout (), view, m_cv_index, layout->pcell_declaration (pc.second), parameters);
mp_ui->pcell_tab->layout ()->addWidget (mp_pcell_parameters); this->layout ()->addWidget (mp_pcell_parameters);
mp_pcell_parameters->set_state (pcp_state); mp_pcell_parameters->set_state (pcp_state);
} else { } else {
mp_ui->param_tab_widget->setTabEnabled (1, false); // @@@mp_ui->param_tab_widget->setTabEnabled (1, false);
} }
} }

View File

@ -41,6 +41,7 @@ namespace Ui
class EditorOptionsPath; class EditorOptionsPath;
class EditorOptionsText; class EditorOptionsText;
class EditorOptionsInst; class EditorOptionsInst;
class EditorOptionsInstPCellParam;
} }
namespace lay namespace lay
@ -181,7 +182,7 @@ public:
virtual QWidget *q_frame () { return this; } virtual QWidget *q_frame () { return this; }
virtual std::string title () const; virtual std::string title () const;
virtual int order () const { return 20; } virtual int order () const { return 30; }
void apply (lay::Plugin *root); void apply (lay::Plugin *root);
void setup (lay::Plugin *root); void setup (lay::Plugin *root);
@ -217,6 +218,7 @@ public slots:
void update_pcell_parameters (); void update_pcell_parameters ();
void library_changed (int index); void library_changed (int index);
void cell_name_changed (const QString &s); void cell_name_changed (const QString &s);
void update_cell_edits ();
private: private:
Ui::EditorOptionsInst *mp_ui; Ui::EditorOptionsInst *mp_ui;
@ -227,6 +229,38 @@ private:
void update_pcell_parameters (const std::vector <tl::Variant> &parameters); void update_pcell_parameters (const std::vector <tl::Variant> &parameters);
}; };
/**
* @brief The instance properties page (PCell parameters)
*/
class EditorOptionsInstPCellParam
: public QWidget, public EditorOptionsPage
{
Q_OBJECT
public:
EditorOptionsInstPCellParam (lay::Dispatcher *root);
~EditorOptionsInstPCellParam ();
virtual QWidget *q_frame () { return this; }
virtual std::string title () const;
virtual int order () const { return 21; }
void apply (lay::Plugin *root);
void setup (lay::Plugin *root);
public slots:
void update_pcell_parameters ();
private:
Ui::EditorOptionsInstPCellParam *mp_ui;
lay::Dispatcher *mp_root;
edt::PCellParametersPage *mp_pcell_parameters;
int m_cv_index;
std::string m_lib_name, m_cell_name;
void update_pcell_parameters (const std::vector <tl::Variant> &parameters);
};
} }
#endif #endif

View File

@ -88,6 +88,7 @@ void get_inst_options (std::vector < std::pair<std::string, std::string> > &opti
static static
void get_inst_editor_options_pages (std::vector<edt::EditorOptionsPage *> &ret, lay::Dispatcher *root) void get_inst_editor_options_pages (std::vector<edt::EditorOptionsPage *> &ret, lay::Dispatcher *root)
{ {
ret.push_back (new EditorOptionsInstPCellParam (root));
ret.push_back (new EditorOptionsInst (root)); ret.push_back (new EditorOptionsInst (root));
} }
@ -402,9 +403,11 @@ activate_service (lay::LayoutView *view, const lay::PluginDeclaration *pd, bool
return; return;
} }
// @@@ TODO: this is very inefficient as each "activate" will regenerate the tabs
for (std::vector<edt::EditorOptionsPage *>::const_iterator op = eo_pages->pages ().begin (); op != eo_pages->pages ().end (); ++op) { for (std::vector<edt::EditorOptionsPage *>::const_iterator op = eo_pages->pages ().begin (); op != eo_pages->pages ().end (); ++op) {
(*op)->activate (((*op)->plugin_declaration () == pd || ! (*op)->plugin_declaration ()) && active); (*op)->activate (((*op)->plugin_declaration () == pd || ! (*op)->plugin_declaration ()) && active);
} }
} }
void void