mirror of https://github.com/KLayout/klayout.git
WIP: enabling schematic view of netlist - needs debugging
This commit is contained in:
parent
de026fac86
commit
51b521f2b7
|
|
@ -2377,6 +2377,19 @@ CircuitDeviceTerminalItemData::search_text ()
|
||||||
// ----------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------
|
||||||
// NetlistBrowserModel implementation
|
// NetlistBrowserModel implementation
|
||||||
|
|
||||||
|
NetlistBrowserModel::NetlistBrowserModel (QWidget *parent, db::Netlist *netlist, NetColorizer *colorizer)
|
||||||
|
: QAbstractItemModel (parent), mp_l2ndb (0), mp_lvsdb (0), mp_colorizer (colorizer)
|
||||||
|
{
|
||||||
|
mp_root.reset (new RootItemData ());
|
||||||
|
mp_indexer.reset (new SingleIndexedNetlistModel (netlist));
|
||||||
|
mp_colorizer->colors_changed.add (this, &NetlistBrowserModel::colors_changed);
|
||||||
|
|
||||||
|
m_object_column = 0;
|
||||||
|
m_status_column = -1;
|
||||||
|
m_first_column = 2;
|
||||||
|
m_second_column = -1;
|
||||||
|
}
|
||||||
|
|
||||||
NetlistBrowserModel::NetlistBrowserModel (QWidget *parent, db::LayoutToNetlist *l2ndb, NetColorizer *colorizer)
|
NetlistBrowserModel::NetlistBrowserModel (QWidget *parent, db::LayoutToNetlist *l2ndb, NetColorizer *colorizer)
|
||||||
: QAbstractItemModel (parent), mp_l2ndb (l2ndb), mp_lvsdb (0), mp_colorizer (colorizer)
|
: QAbstractItemModel (parent), mp_l2ndb (l2ndb), mp_lvsdb (0), mp_colorizer (colorizer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,7 @@ class LAYUI_PUBLIC NetlistBrowserModel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
NetlistBrowserModel (QWidget *parent, db::Netlist *netlist, NetColorizer *colorizer);
|
||||||
NetlistBrowserModel (QWidget *parent, db::LayoutToNetlist *l2ndb, NetColorizer *colorizer);
|
NetlistBrowserModel (QWidget *parent, db::LayoutToNetlist *l2ndb, NetColorizer *colorizer);
|
||||||
NetlistBrowserModel (QWidget *parent, db::LayoutVsSchematic *lvsdb, NetColorizer *colorizer);
|
NetlistBrowserModel (QWidget *parent, db::LayoutVsSchematic *lvsdb, NetColorizer *colorizer);
|
||||||
~NetlistBrowserModel ();
|
~NetlistBrowserModel ();
|
||||||
|
|
|
||||||
|
|
@ -216,9 +216,6 @@ NetlistBrowserPage::NetlistBrowserPage (QWidget * /*parent*/)
|
||||||
connect (forward, SIGNAL (clicked ()), this, SLOT (navigate_forward ()));
|
connect (forward, SIGNAL (clicked ()), this, SLOT (navigate_forward ()));
|
||||||
connect (backward, SIGNAL (clicked ()), this, SLOT (navigate_back ()));
|
connect (backward, SIGNAL (clicked ()), this, SLOT (navigate_back ()));
|
||||||
|
|
||||||
// @@@ connect (show_netlist, SIGNAL (clicked ()), this, SLOT (mode_changed ()));
|
|
||||||
// @@@ connect (show_xref, SIGNAL (clicked ()), this, SLOT (mode_changed ()));
|
|
||||||
|
|
||||||
connect (actionExportAll, SIGNAL (triggered ()), this, SLOT (export_all ()));
|
connect (actionExportAll, SIGNAL (triggered ()), this, SLOT (export_all ()));
|
||||||
connect (actionExportSelected, SIGNAL (triggered ()), this, SLOT (export_selected ()));
|
connect (actionExportSelected, SIGNAL (triggered ()), this, SLOT (export_selected ()));
|
||||||
|
|
||||||
|
|
@ -489,16 +486,25 @@ NetlistBrowserPage::select_path (const lay::NetlistObjectsPath &path)
|
||||||
NetlistBrowserModel *model;
|
NetlistBrowserModel *model;
|
||||||
|
|
||||||
model = dynamic_cast<NetlistBrowserModel *> (nl_directory_tree->model ());
|
model = dynamic_cast<NetlistBrowserModel *> (nl_directory_tree->model ());
|
||||||
tl_assert (model != 0);
|
if (model) {
|
||||||
nl_directory_tree->setCurrentIndex (model->index_from_path (path));
|
nl_directory_tree->setCurrentIndex (model->index_from_path (path));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TODO: to support path selection in schematic, we had to translate the netlist circuits
|
||||||
|
into reference circuits first using the xref translation (if available)
|
||||||
|
This does not work:
|
||||||
|
|
||||||
model = dynamic_cast<NetlistBrowserModel *> (sch_directory_tree->model ());
|
model = dynamic_cast<NetlistBrowserModel *> (sch_directory_tree->model ());
|
||||||
tl_assert (model != 0);
|
if (model) {
|
||||||
sch_directory_tree->setCurrentIndex (model->index_from_path (path));
|
sch_directory_tree->setCurrentIndex (model->index_from_path (path));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
model = dynamic_cast<NetlistBrowserModel *> (xref_directory_tree->model ());
|
model = dynamic_cast<NetlistBrowserModel *> (xref_directory_tree->model ());
|
||||||
tl_assert (model != 0);
|
if (model) {
|
||||||
xref_directory_tree->setCurrentIndex (model->index_from_path (path));
|
xref_directory_tree->setCurrentIndex (model->index_from_path (path));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -821,12 +827,6 @@ NetlistBrowserPage::info_button_pressed ()
|
||||||
mp_info_dialog->show ();
|
mp_info_dialog->show ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
NetlistBrowserPage::mode_changed ()
|
|
||||||
{
|
|
||||||
// @@@ setup_trees ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static QModelIndex find_next (QTreeView *view, QAbstractItemModel *model, const QRegExp &to_find, const QModelIndex &from)
|
static QModelIndex find_next (QTreeView *view, QAbstractItemModel *model, const QRegExp &to_find, const QModelIndex &from)
|
||||||
{
|
{
|
||||||
QModelIndex index = from;
|
QModelIndex index = from;
|
||||||
|
|
@ -1094,8 +1094,7 @@ NetlistBrowserPage::setup_trees ()
|
||||||
if (lvsdb) {
|
if (lvsdb) {
|
||||||
|
|
||||||
// NOTE: with the tree as the parent, the tree will take over ownership of the model
|
// NOTE: with the tree as the parent, the tree will take over ownership of the model
|
||||||
// @@@ should be schematic
|
NetlistBrowserModel *new_model = new NetlistBrowserModel (sch_directory_tree, lvsdb->reference_netlist (), &m_colorizer);
|
||||||
NetlistBrowserModel *new_model = new NetlistBrowserModel (sch_directory_tree, l2ndb, &m_colorizer);
|
|
||||||
|
|
||||||
set_tree_model (sch_directory_tree, new_model);
|
set_tree_model (sch_directory_tree, new_model);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,6 @@ private slots:
|
||||||
void xref_selection_changed ();
|
void xref_selection_changed ();
|
||||||
void browse_color_for_net ();
|
void browse_color_for_net ();
|
||||||
void select_color_for_net ();
|
void select_color_for_net ();
|
||||||
void mode_changed ();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter (QObject *watched, QEvent *event);
|
bool eventFilter (QObject *watched, QEvent *event);
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,15 @@ static std::string search_string_from_names (const std::pair<const Obj *, const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NetlistBrowserTreeModel::NetlistBrowserTreeModel (QWidget *parent, db::Netlist *netlist)
|
||||||
|
: QAbstractItemModel (parent), mp_l2ndb (0), mp_lvsdb (0)
|
||||||
|
{
|
||||||
|
mp_indexer.reset (new SingleIndexedNetlistModel (netlist));
|
||||||
|
|
||||||
|
m_object_column = 0;
|
||||||
|
m_status_column = -1;
|
||||||
|
}
|
||||||
|
|
||||||
NetlistBrowserTreeModel::NetlistBrowserTreeModel (QWidget *parent, db::LayoutToNetlist *l2ndb)
|
NetlistBrowserTreeModel::NetlistBrowserTreeModel (QWidget *parent, db::LayoutToNetlist *l2ndb)
|
||||||
: QAbstractItemModel (parent), mp_l2ndb (l2ndb), mp_lvsdb (0)
|
: QAbstractItemModel (parent), mp_l2ndb (l2ndb), mp_lvsdb (0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ class LAYUI_PUBLIC NetlistBrowserTreeModel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
NetlistBrowserTreeModel (QWidget *parent, db::Netlist *netlist);
|
||||||
NetlistBrowserTreeModel (QWidget *parent, db::LayoutToNetlist *l2ndb);
|
NetlistBrowserTreeModel (QWidget *parent, db::LayoutToNetlist *l2ndb);
|
||||||
NetlistBrowserTreeModel (QWidget *parent, db::LayoutVsSchematic *lvsdb);
|
NetlistBrowserTreeModel (QWidget *parent, db::LayoutVsSchematic *lvsdb);
|
||||||
~NetlistBrowserTreeModel ();
|
~NetlistBrowserTreeModel ();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue