mirror of https://github.com/KLayout/klayout.git
Merge pull request #328 from KLayout/library-browser
Library Browser updates
This commit is contained in:
commit
4ccb7386eb
|
|
@ -692,6 +692,12 @@ public:
|
|||
|
||||
typedef std::pair<std::vector<Transition>, std::pair<size_t, const db::Net *> > edge_type;
|
||||
|
||||
static void swap_edges (edge_type &e1, edge_type &e2)
|
||||
{
|
||||
e1.first.swap (e2.first);
|
||||
std::swap (e1.second, e2.second);
|
||||
}
|
||||
|
||||
struct EdgeToEdgeOnlyCompare
|
||||
{
|
||||
bool operator() (const edge_type &a, const std::vector<Transition> &b) const
|
||||
|
|
@ -1149,17 +1155,22 @@ NetGraphNode::expand_subcircuit_nodes (NetGraph *graph)
|
|||
|
||||
std::list<edge_type> sc_edges;
|
||||
|
||||
for (size_t i = 0; i < m_edges.size (); ) {
|
||||
if (m_edges [i].second.second == 0) {
|
||||
size_t ii = 0;
|
||||
for (size_t i = 0; i < m_edges.size (); ++i) {
|
||||
if (ii != i) {
|
||||
swap_edges (m_edges [ii], m_edges [i]);
|
||||
}
|
||||
if (m_edges [ii].second.second == 0) {
|
||||
// subcircuit pin
|
||||
sc_edges.push_back (m_edges [i]);
|
||||
m_edges.erase (m_edges.begin () + i);
|
||||
sc_edges.push_back (m_edges [ii]);
|
||||
} else {
|
||||
n2entry.insert (std::make_pair (m_edges [i].second.second, i));
|
||||
++i;
|
||||
n2entry.insert (std::make_pair (m_edges [ii].second.second, ii));
|
||||
++ii;
|
||||
}
|
||||
}
|
||||
|
||||
m_edges.erase (m_edges.begin () + ii, m_edges.end ());
|
||||
|
||||
for (std::list<edge_type>::const_iterator e = sc_edges.begin (); e != sc_edges.end (); ++e) {
|
||||
|
||||
const db::SubCircuit *sc = 0;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instantiation Path</string>
|
||||
<string>PCell Parameters</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
|
|
|
|||
|
|
@ -6,14 +6,48 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>568</width>
|
||||
<height>353</height>
|
||||
<width>604</width>
|
||||
<height>498</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="3">
|
||||
<widget class="QToolButton" name="browse_pb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="desc_le"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="name_le">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
|
|
@ -21,9 +55,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="base_path_le"/>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="4">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
@ -40,135 +71,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="3">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<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="QLineEdit" name="dbu_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="4">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>27</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="4">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Base path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="4">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QToolButton" name="browse_pb">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<spacer>
|
||||
<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="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="name_le">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>(Use the rename button to change this)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="desc_le"/>
|
||||
</item>
|
||||
<item row="9" column="1" colspan="3">
|
||||
<widget class="QGroupBox" name="lyp_grp">
|
||||
<property name="title">
|
||||
|
|
@ -223,10 +125,10 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>The default database unit is used as database unit for freshly created layouts</string>
|
||||
<string>Base path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -252,6 +154,127 @@ unit</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="4">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="4">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>(Use the rename button to change this)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>The default database unit is used as database unit for freshly created layouts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="3">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<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="QLineEdit" name="dbu_le">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" colspan="2">
|
||||
<spacer>
|
||||
<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="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="base_path_le"/>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="libs_lbl">
|
||||
<property name="text">
|
||||
<string>Technology
|
||||
specific
|
||||
libraries</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="4">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="11" column="1" rowspan="2" colspan="3">
|
||||
<widget class="QListWidget" name="libs_lw">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
|||
|
|
@ -2414,7 +2414,6 @@ MainWindow::cm_undo ()
|
|||
(*vp)->cancel ();
|
||||
}
|
||||
m_manager.undo ();
|
||||
current_view ()->update_content ();
|
||||
}
|
||||
|
||||
END_PROTECTED
|
||||
|
|
@ -2431,7 +2430,6 @@ MainWindow::cm_redo ()
|
|||
(*vp)->cancel ();
|
||||
}
|
||||
m_manager.redo ();
|
||||
current_view ()->update_content ();
|
||||
}
|
||||
|
||||
END_PROTECTED
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
#include "tlStream.h"
|
||||
#include "tlClassRegistry.h"
|
||||
#include "dbStream.h"
|
||||
#include "dbLibraryManager.h"
|
||||
#include "dbLibrary.h"
|
||||
|
||||
#include "ui_TechSetupDialog.h"
|
||||
#include "ui_TechMacrosPage.h"
|
||||
|
|
@ -51,6 +53,7 @@
|
|||
#include <QHeaderView>
|
||||
#include <QFileDialog>
|
||||
#include <QScrollArea>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fstream>
|
||||
|
|
@ -114,6 +117,38 @@ TechBaseEditorPage::setup ()
|
|||
mp_ui->lyp_grp->setChecked (! lyp.empty ());
|
||||
mp_ui->lyp_le->setText (tl::to_qstring (lyp));
|
||||
mp_ui->add_other_layers_cbx->setChecked (tech ()->add_other_layers ());
|
||||
|
||||
mp_ui->libs_lw->clear ();
|
||||
|
||||
if (! tech ()->name ().empty ()) {
|
||||
|
||||
mp_ui->libs_lbl->setEnabled (true);
|
||||
mp_ui->libs_lw->setEnabled (true);
|
||||
|
||||
std::vector<std::string> libs;
|
||||
|
||||
for (db::LibraryManager::iterator l = db::LibraryManager::instance ().begin (); l != db::LibraryManager::instance ().end (); ++l) {
|
||||
const db::Library *lib = db::LibraryManager::instance ().lib (l->second);
|
||||
if (lib->get_technology () == tech ()->name ()) {
|
||||
std::string text = lib->get_name ();
|
||||
if (! lib->get_description ().empty ()) {
|
||||
text += " - " + lib->get_description ();
|
||||
}
|
||||
libs.push_back (text);
|
||||
}
|
||||
}
|
||||
|
||||
std::sort (libs.begin (), libs.end ());
|
||||
|
||||
for (std::vector<std::string>::const_iterator l = libs.begin (); l != libs.end (); ++l) {
|
||||
mp_ui->libs_lw->addItem (new QListWidgetItem (tl::to_qstring (*l)));
|
||||
}
|
||||
|
||||
} else {
|
||||
mp_ui->libs_lbl->setEnabled (false);
|
||||
mp_ui->libs_lw->setEnabled (false);
|
||||
mp_ui->libs_lw->addItem (tr ("The default technology can't have libraries"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1706,9 +1706,12 @@ LayoutView::insert_layer_list (unsigned index, const LayerPropertiesList &props)
|
|||
|
||||
m_current_layer_list = index;
|
||||
current_layer_list_changed_event (index);
|
||||
|
||||
layer_list_inserted_event (index);
|
||||
|
||||
redraw ();
|
||||
|
||||
dm_prop_changed ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1750,6 +1753,7 @@ LayoutView::delete_layer_list (unsigned index)
|
|||
}
|
||||
|
||||
layer_list_deleted_event (index);
|
||||
dm_prop_changed ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1986,6 +1990,7 @@ LayoutView::insert_layer (unsigned int index, const LayerPropertiesConstIterator
|
|||
if (index == current_layer_list ()) {
|
||||
layer_list_changed_event (2);
|
||||
redraw ();
|
||||
dm_prop_changed ();
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -2013,6 +2018,7 @@ LayoutView::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter
|
|||
if (index == current_layer_list ()) {
|
||||
layer_list_changed_event (2);
|
||||
redraw ();
|
||||
dm_prop_changed ();
|
||||
}
|
||||
|
||||
// invalidate the iterator so it can be used to refer to the next element
|
||||
|
|
|
|||
|
|
@ -588,10 +588,6 @@ LibrariesView::do_update_content (int lib_index)
|
|||
m_force_close [i] = true;
|
||||
}
|
||||
|
||||
if (m_needs_update [i]) {
|
||||
mp_cell_lists [i]->doItemsLayout (); // triggers a redraw
|
||||
}
|
||||
|
||||
m_libraries [i].reset (libraries [i]);
|
||||
|
||||
}
|
||||
|
|
@ -715,6 +711,8 @@ LibrariesView::do_update_content (int lib_index)
|
|||
|
||||
m_needs_update [i] = false;
|
||||
|
||||
mp_cell_lists [i]->doItemsLayout (); // triggers a redraw -> the model might need this
|
||||
|
||||
}
|
||||
|
||||
mp_cell_list_headers [i]->setVisible (split_mode && m_libraries.size () > 1);
|
||||
|
|
@ -795,6 +793,10 @@ LibrariesView::display_string (int n) const
|
|||
if (! lib->get_description ().empty ()) {
|
||||
text += " - " + lib->get_description ();
|
||||
}
|
||||
if (! lib->get_technology ().empty ()) {
|
||||
text += " ";
|
||||
text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (lib->get_technology ())));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue