mirror of https://github.com/KLayout/klayout.git
Fixed tests.
This commit is contained in:
parent
f9fa3d3aa3
commit
62ed7b9def
|
|
@ -30,6 +30,8 @@
|
|||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
#include <QTreeView>
|
||||
#include <QUrl>
|
||||
#include <QUrlQuery>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
@ -2402,8 +2404,6 @@ CircuitDeviceTerminalItemData::status (NetlistBrowserModel *model)
|
|||
// ----------------------------------------------------------------------------------
|
||||
// NetlistBrowserModel implementation
|
||||
|
||||
static void *no_id = reinterpret_cast<void *> (-1);
|
||||
|
||||
NetlistBrowserModel::NetlistBrowserModel (QWidget *parent, db::LayoutToNetlist *l2ndb, NetColorizer *colorizer)
|
||||
: QAbstractItemModel (parent), mp_l2ndb (l2ndb), mp_lvsdb (0), mp_colorizer (colorizer)
|
||||
{
|
||||
|
|
@ -2436,7 +2436,7 @@ NetlistBrowserModel::~NetlistBrowserModel ()
|
|||
}
|
||||
|
||||
RootItemData *
|
||||
NetlistBrowserModel::root ()
|
||||
NetlistBrowserModel::root () const
|
||||
{
|
||||
return dynamic_cast<RootItemData *> (mp_root.get ());
|
||||
}
|
||||
|
|
@ -2493,18 +2493,56 @@ NetlistBrowserModel::data (const QModelIndex &index, int role) const
|
|||
return QVariant ();
|
||||
}
|
||||
|
||||
// @@@
|
||||
static QString build_url (void *id, const std::string &tag, const std::string &title)
|
||||
QModelIndex
|
||||
NetlistBrowserModel::index_from_url (const QString &a)
|
||||
{
|
||||
if (id == no_id) {
|
||||
QUrl url (a);
|
||||
|
||||
std::string ids;
|
||||
#if QT_VERSION >= 0x050000
|
||||
ids = tl::to_string (QUrlQuery (url.query ()).queryItemValue (QString::fromUtf8 ("path")));
|
||||
#else
|
||||
ids = tl::to_string (url.queryItemValue (QString::fromUtf8 ("path")));
|
||||
#endif
|
||||
|
||||
QModelIndex idx;
|
||||
|
||||
tl::Extractor ex (ids.c_str ());
|
||||
while (! ex.at_end ()) {
|
||||
int n = 0;
|
||||
if (! ex.try_read (n)) {
|
||||
break;
|
||||
}
|
||||
idx = index (n, 0, idx);
|
||||
ex.test (",");
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
QString
|
||||
NetlistBrowserModel::build_url (const QModelIndex &index, const std::string &title) const
|
||||
{
|
||||
if (! index.isValid ()) {
|
||||
// no link
|
||||
return tl::to_qstring (tl::escaped_to_html (title));
|
||||
}
|
||||
|
||||
std::string s = std::string ("<a href='int:");
|
||||
s += tag;
|
||||
s += "?id=";
|
||||
s += tl::to_string (reinterpret_cast<size_t> (id));
|
||||
QModelIndex i = index;
|
||||
|
||||
std::string pstr;
|
||||
while (i.isValid ()) {
|
||||
if (pstr.empty ()) {
|
||||
pstr = tl::to_string (i.row ());
|
||||
} else {
|
||||
pstr = tl::to_string (i.row ()) + "," + pstr;
|
||||
}
|
||||
i = parent (i);
|
||||
}
|
||||
|
||||
std::string s = std::string ("<a href='int:netlist");
|
||||
s += "?path=";
|
||||
s += pstr;
|
||||
s += "'>";
|
||||
|
||||
s += tl::escaped_to_html (title);
|
||||
|
|
@ -2517,189 +2555,99 @@ static QString build_url (void *id, const std::string &tag, const std::string &t
|
|||
QString
|
||||
NetlistBrowserModel::make_link_to (const std::pair<const db::Net *, const db::Net *> &nets, int column) const
|
||||
{
|
||||
#if 0 // @@@
|
||||
if ((! nets.first || column == m_second_column) && (! nets.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
|
||||
IndexedNetlistModel::circuit_pair circuits = mp_indexer->parent_of (nets);
|
||||
void *id = no_id;
|
||||
// NOTE: the nets may not be a valid net pair. In this case, circuits is (0, 0) and
|
||||
// no link is generated
|
||||
if (circuits.first || circuits.second) {
|
||||
id = make_id_circuit_net (mp_indexer->circuit_index (circuits), mp_indexer->net_index (nets));
|
||||
}
|
||||
QModelIndex idx = index_from_net (nets);
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return build_url (id, "net", str_from_expanded_name (nets.first));
|
||||
return build_url (idx, str_from_expanded_name (nets.first));
|
||||
} else if (column == m_second_column) {
|
||||
return build_url (id, "net", str_from_expanded_name (nets.second));
|
||||
return build_url (idx, str_from_expanded_name (nets.second));
|
||||
} else {
|
||||
return build_url (id, "net", str_from_expanded_names (nets, mp_indexer->is_single ()));
|
||||
return build_url (idx, str_from_expanded_names (nets, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
if ((! nets.first || column == m_second_column) && (! nets.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (nets.first));
|
||||
} else if (column == m_second_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (nets.second));
|
||||
} else {
|
||||
return tl::to_qstring (str_from_expanded_names (nets, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString
|
||||
NetlistBrowserModel::make_link_to (const std::pair<const db::Device *, const db::Device *> &devices, int column) const
|
||||
{
|
||||
#if 0
|
||||
if ((! devices.first || column == m_second_column) && (! devices.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
QModelIndex idx;
|
||||
|
||||
IndexedNetlistModel::circuit_pair circuits = mp_indexer->parent_of (devices);
|
||||
void *id = no_id;
|
||||
// NOTE: the devices may not be a valid device pair. In this case, circuits is (0, 0) and
|
||||
// no link is generated
|
||||
if (circuits.first || circuits.second) {
|
||||
id = make_id_circuit_device (mp_indexer->circuit_index (circuits), mp_indexer->device_index (devices));
|
||||
}
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return build_url (id, "device", str_from_expanded_name (devices.first));
|
||||
} else if (column == m_second_column) {
|
||||
return build_url (id, "device", str_from_expanded_name (devices.second));
|
||||
} else {
|
||||
return build_url (id, "device", str_from_expanded_names (devices, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
if ((! devices.first || column == m_second_column) && (! devices.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (devices.first));
|
||||
return build_url (idx, str_from_expanded_name (devices.first));
|
||||
} else if (column == m_second_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (devices.second));
|
||||
return build_url (idx, str_from_expanded_name (devices.second));
|
||||
} else {
|
||||
return tl::to_qstring (str_from_expanded_names (devices, mp_indexer->is_single ()));
|
||||
return build_url (idx, str_from_expanded_names (devices, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString
|
||||
NetlistBrowserModel::make_link_to (const std::pair<const db::Pin *, const db::Pin *> &pins, const std::pair<const db::Circuit *, const db::Circuit *> & /*circuits*/, int column) const
|
||||
{
|
||||
#if 0
|
||||
if ((! pins.first || column == m_second_column) && (! pins.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
void *id = make_id_circuit_pin (mp_indexer->circuit_index (circuits), mp_indexer->pin_index (pins, circuits));
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return build_url (id, "pin", str_from_expanded_name (pins.first));
|
||||
} else if (column == m_second_column) {
|
||||
return build_url (id, "pin", str_from_expanded_name (pins.second));
|
||||
} else {
|
||||
return build_url (id, "pin", str_from_expanded_names (pins, mp_indexer->is_single ()));
|
||||
}
|
||||
}
|
||||
#else
|
||||
QModelIndex idx;
|
||||
|
||||
if ((! pins.first || column == m_second_column) && (! pins.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (pins.first));
|
||||
return build_url (idx, str_from_expanded_name (pins.first));
|
||||
} else if (column == m_second_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (pins.second));
|
||||
return build_url (idx, str_from_expanded_name (pins.second));
|
||||
} else {
|
||||
return tl::to_qstring (str_from_expanded_names (pins, mp_indexer->is_single ()));
|
||||
return build_url (idx, str_from_expanded_names (pins, mp_indexer->is_single ()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString
|
||||
NetlistBrowserModel::make_link_to (const std::pair<const db::Circuit *, const db::Circuit *> &circuits, int column) const
|
||||
{
|
||||
#if 0
|
||||
if ((! circuits.first || column == m_second_column) && (! circuits.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
void *id = make_id_circuit (mp_indexer->circuit_index (circuits));
|
||||
|
||||
QModelIndex idx = index_from_circuit (circuits);
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return build_url (id, "circuit", str_from_name (circuits.first));
|
||||
return build_url (idx, str_from_name (circuits.first));
|
||||
} else if (column == m_second_column) {
|
||||
return build_url (id, "circuit", str_from_name (circuits.second));
|
||||
return build_url (idx, str_from_name (circuits.second));
|
||||
} else {
|
||||
return build_url (id, "circuit", str_from_names (circuits, mp_indexer->is_single ()));
|
||||
return build_url (idx, str_from_names (circuits, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
if ((! circuits.first || column == m_second_column) && (! circuits.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return tl::to_qstring (str_from_name (circuits.first));
|
||||
} else if (column == m_second_column) {
|
||||
return tl::to_qstring (str_from_name (circuits.second));
|
||||
} else {
|
||||
return tl::to_qstring (str_from_names (circuits, mp_indexer->is_single ()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QString
|
||||
NetlistBrowserModel::make_link_to (const std::pair<const db::SubCircuit *, const db::SubCircuit *> &subcircuits, int column) const
|
||||
{
|
||||
#if 0
|
||||
if ((! subcircuits.first || column == m_second_column) && (! subcircuits.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
QModelIndex idx;
|
||||
|
||||
IndexedNetlistModel::circuit_pair circuits = mp_indexer->parent_of (subcircuits);
|
||||
void *id = no_id;
|
||||
// NOTE: the subcircuits may not be a valid subcircuit pair. In this case, circuits is (0, 0) and
|
||||
// no link is generated
|
||||
if (circuits.first || circuits.second) {
|
||||
id = make_id_circuit_subcircuit (mp_indexer->circuit_index (circuits), mp_indexer->subcircuit_index (subcircuits));
|
||||
}
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return build_url (id, "subcircuit", str_from_expanded_name (subcircuits.first));
|
||||
} else if (column == m_second_column) {
|
||||
return build_url (id, "subcircuit", str_from_expanded_name (subcircuits.second));
|
||||
} else {
|
||||
return build_url (id, "subcircuit", str_from_expanded_names (subcircuits, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
if ((! subcircuits.first || column == m_second_column) && (! subcircuits.second || column == m_first_column)) {
|
||||
return QString ();
|
||||
} else {
|
||||
|
||||
if (mp_indexer->is_single () || column == m_first_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (subcircuits.first));
|
||||
return build_url (idx, str_from_expanded_name (subcircuits.first));
|
||||
} else if (column == m_second_column) {
|
||||
return tl::to_qstring (str_from_expanded_name (subcircuits.second));
|
||||
return build_url (idx, str_from_expanded_name (subcircuits.second));
|
||||
} else {
|
||||
return tl::to_qstring (str_from_expanded_names (subcircuits, mp_indexer->is_single ()));
|
||||
return build_url (idx, str_from_expanded_names (subcircuits, mp_indexer->is_single ()));
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -2883,12 +2831,12 @@ NetlistBrowserModel::colors_changed ()
|
|||
}
|
||||
|
||||
QModelIndex
|
||||
NetlistBrowserModel::index_from_net (const std::pair<const db::Net *, const db::Net *> &nets)
|
||||
NetlistBrowserModel::index_from_net (const std::pair<const db::Net *, const db::Net *> &nets) const
|
||||
{
|
||||
IndexedNetlistModel::circuit_pair circuits (nets.first ? nets.first->circuit () : 0, nets.second ? nets.second->circuit () : 0);
|
||||
CircuitItemData *ci = root ()->circuit_item (this, circuits);
|
||||
CircuitItemData *ci = root ()->circuit_item (const_cast<NetlistBrowserModel *> (this), circuits);
|
||||
if (ci) {
|
||||
CircuitNetItemData *ni = ci->circuit_net_item (this, nets);
|
||||
CircuitNetItemData *ni = ci->circuit_net_item (const_cast<NetlistBrowserModel *> (this), nets);
|
||||
if (ni) {
|
||||
return createIndex (int (ni->index ()), 0, (void *) ni);
|
||||
}
|
||||
|
|
@ -2898,15 +2846,15 @@ NetlistBrowserModel::index_from_net (const std::pair<const db::Net *, const db::
|
|||
}
|
||||
|
||||
QModelIndex
|
||||
NetlistBrowserModel::index_from_net (const db::Net *net)
|
||||
NetlistBrowserModel::index_from_net (const db::Net *net) const
|
||||
{
|
||||
return index_from_net (std::make_pair (net, mp_indexer->second_net_for (net)));
|
||||
}
|
||||
|
||||
QModelIndex
|
||||
NetlistBrowserModel::index_from_circuit (const std::pair<const db::Circuit *, const db::Circuit *> &circuits)
|
||||
NetlistBrowserModel::index_from_circuit (const std::pair<const db::Circuit *, const db::Circuit *> &circuits) const
|
||||
{
|
||||
CircuitItemData *ci = root ()->circuit_item (this, circuits);
|
||||
CircuitItemData *ci = root ()->circuit_item (const_cast<NetlistBrowserModel *> (this), circuits);
|
||||
if (ci) {
|
||||
return createIndex (int (ci->index ()), 0, (void *) ci);
|
||||
}
|
||||
|
|
@ -2915,13 +2863,13 @@ NetlistBrowserModel::index_from_circuit (const std::pair<const db::Circuit *, co
|
|||
}
|
||||
|
||||
QModelIndex
|
||||
NetlistBrowserModel::index_from_circuit (const db::Circuit *net)
|
||||
NetlistBrowserModel::index_from_circuit (const db::Circuit *net) const
|
||||
{
|
||||
return index_from_circuit (std::make_pair (net, mp_indexer->second_circuit_for (net)));
|
||||
}
|
||||
|
||||
std::pair<const db::Circuit *, const db::Circuit *>
|
||||
NetlistBrowserModel::circuit_from_index (const QModelIndex &index)
|
||||
NetlistBrowserModel::circuit_from_index (const QModelIndex &index) const
|
||||
{
|
||||
NetlistModelItemData *d = (NetlistModelItemData *) (index.internalPointer ());
|
||||
if (! d) {
|
||||
|
|
@ -2932,7 +2880,7 @@ NetlistBrowserModel::circuit_from_index (const QModelIndex &index)
|
|||
}
|
||||
|
||||
std::pair<const db::Net *, const db::Net *>
|
||||
NetlistBrowserModel::net_from_index (const QModelIndex &index)
|
||||
NetlistBrowserModel::net_from_index (const QModelIndex &index) const
|
||||
{
|
||||
NetlistModelItemData *d = (NetlistModelItemData *) (index.internalPointer ());
|
||||
if (! d) {
|
||||
|
|
@ -2943,7 +2891,7 @@ NetlistBrowserModel::net_from_index (const QModelIndex &index)
|
|||
}
|
||||
|
||||
std::pair<const db::Device *, const db::Device *>
|
||||
NetlistBrowserModel::device_from_index (const QModelIndex &index)
|
||||
NetlistBrowserModel::device_from_index (const QModelIndex &index) const
|
||||
{
|
||||
NetlistModelItemData *d = (NetlistModelItemData *) (index.internalPointer ());
|
||||
if (! d) {
|
||||
|
|
@ -2954,7 +2902,7 @@ NetlistBrowserModel::device_from_index (const QModelIndex &index)
|
|||
}
|
||||
|
||||
std::pair<const db::SubCircuit *, const db::SubCircuit *>
|
||||
NetlistBrowserModel::subcircuit_from_index (const QModelIndex &index)
|
||||
NetlistBrowserModel::subcircuit_from_index (const QModelIndex &index) const
|
||||
{
|
||||
NetlistModelItemData *d = (NetlistModelItemData *) (index.internalPointer ());
|
||||
if (! d) {
|
||||
|
|
|
|||
|
|
@ -229,16 +229,16 @@ public:
|
|||
return mp_indexer.get ();
|
||||
}
|
||||
|
||||
std::pair<const db::Net *, const db::Net *> net_from_index (const QModelIndex &index);
|
||||
QModelIndex index_from_net (const std::pair<const db::Net *, const db::Net *> &net);
|
||||
QModelIndex index_from_net (const db::Net *net);
|
||||
std::pair<const db::Circuit *, const db::Circuit *> circuit_from_index (const QModelIndex &index);
|
||||
QModelIndex index_from_circuit (const std::pair<const db::Circuit *, const db::Circuit *> &circuit);
|
||||
QModelIndex index_from_circuit (const db::Circuit *circuit);
|
||||
std::pair<const db::Net *, const db::Net *> net_from_index (const QModelIndex &index) const;
|
||||
QModelIndex index_from_net (const std::pair<const db::Net *, const db::Net *> &net) const;
|
||||
QModelIndex index_from_net (const db::Net *net) const;
|
||||
std::pair<const db::Circuit *, const db::Circuit *> circuit_from_index (const QModelIndex &index) const;
|
||||
QModelIndex index_from_circuit (const std::pair<const db::Circuit *, const db::Circuit *> &circuit) const;
|
||||
QModelIndex index_from_circuit (const db::Circuit *circuit) const;
|
||||
|
||||
std::pair<const db::SubCircuit *, const db::SubCircuit *> subcircuit_from_index (const QModelIndex &index);
|
||||
std::pair<const db::SubCircuit *, const db::SubCircuit *> subcircuit_from_index (const QModelIndex &index) const;
|
||||
|
||||
std::pair<const db::Device *, const db::Device *> device_from_index (const QModelIndex &index);
|
||||
std::pair<const db::Device *, const db::Device *> device_from_index (const QModelIndex &index) const;
|
||||
|
||||
void set_item_visibility (QTreeView *view, bool show_all, bool with_warnings);
|
||||
|
||||
|
|
@ -253,6 +253,8 @@ public:
|
|||
QIcon icon_for_nets (const std::pair<const db::Net *, const db::Net *> &net) const;
|
||||
QIcon icon_for_connection (const std::pair<const db::Net *, const db::Net *> &net) const;
|
||||
|
||||
QModelIndex index_from_url (const QString &url);
|
||||
|
||||
private slots:
|
||||
void colors_changed ();
|
||||
|
||||
|
|
@ -265,6 +267,7 @@ private:
|
|||
QString search_text (const QModelIndex &index) const;
|
||||
db::NetlistCrossReference::Status status (const QModelIndex &index) const;
|
||||
QIcon icon (const QModelIndex &index) const;
|
||||
QString build_url (const QModelIndex &index, const std::string &title) const;
|
||||
|
||||
std::pair<const db::Netlist *, const db::Netlist *> netlists () const
|
||||
{
|
||||
|
|
@ -285,7 +288,7 @@ private:
|
|||
int m_second_column;
|
||||
std::auto_ptr<NetlistModelItemData> mp_root;
|
||||
|
||||
RootItemData *root ();
|
||||
RootItemData *root () const;
|
||||
};
|
||||
|
||||
} // namespace lay
|
||||
|
|
|
|||
|
|
@ -307,21 +307,10 @@ NetlistBrowserPage::layer_list_changed (int)
|
|||
void
|
||||
NetlistBrowserPage::anchor_clicked (const QString &a)
|
||||
{
|
||||
QUrl url (a);
|
||||
|
||||
QString ids;
|
||||
#if QT_VERSION >= 0x050000
|
||||
ids = QUrlQuery (url.query ()).queryItemValue (QString::fromUtf8 ("id"));
|
||||
#else
|
||||
ids = url.queryItemValue (QString::fromUtf8 ("id"));
|
||||
#endif
|
||||
|
||||
if (ids.isEmpty ()) {
|
||||
return;
|
||||
NetlistBrowserModel *netlist_model = dynamic_cast<NetlistBrowserModel *> (directory_tree->model ());
|
||||
if (netlist_model) {
|
||||
navigate_to (netlist_model->index_from_url (a), true);
|
||||
}
|
||||
|
||||
void *id = reinterpret_cast<void *> (ids.toULongLong ());
|
||||
navigate_to (id, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -356,8 +345,7 @@ NetlistBrowserPage::current_index_changed (const QModelIndex &index)
|
|||
return;
|
||||
}
|
||||
|
||||
void *id = index.internalPointer ();
|
||||
add_to_history (id, true);
|
||||
add_to_history (index, true);
|
||||
|
||||
std::pair<const db::Circuit *, const db::Circuit *> circuits = netlist_model->circuit_from_index (index);
|
||||
QModelIndex circuit_index = tree_model->index_from_circuits (circuits);
|
||||
|
|
@ -519,16 +507,8 @@ NetlistBrowserPage::select_color_for_net ()
|
|||
}
|
||||
|
||||
void
|
||||
NetlistBrowserPage::navigate_to (void *id, bool fwd)
|
||||
NetlistBrowserPage::navigate_to (const QModelIndex &index, bool fwd)
|
||||
{
|
||||
#if 0 // @@@
|
||||
NetlistBrowserTreeModel *tree_model = dynamic_cast<NetlistBrowserTreeModel *> (hierarchy_tree->model ());
|
||||
NetlistBrowserModel *netlist_model = dynamic_cast<NetlistBrowserModel *> (directory_tree->model ());
|
||||
if (! tree_model || ! netlist_model) {
|
||||
return;
|
||||
}
|
||||
|
||||
QModelIndex index = netlist_model->index_from_id (id, 0);
|
||||
if (! index.isValid ()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -538,36 +518,43 @@ NetlistBrowserPage::navigate_to (void *id, bool fwd)
|
|||
|
||||
directory_tree->setCurrentIndex (index);
|
||||
|
||||
NetlistBrowserTreeModel *tree_model = dynamic_cast<NetlistBrowserTreeModel *> (hierarchy_tree->model ());
|
||||
NetlistBrowserModel *netlist_model = dynamic_cast<NetlistBrowserModel *> (directory_tree->model ());
|
||||
if (! tree_model || ! netlist_model) {
|
||||
return;
|
||||
}
|
||||
|
||||
// @@@ with path!
|
||||
std::pair<const db::Circuit *, const db::Circuit *> circuits = netlist_model->circuit_from_index (index);
|
||||
QModelIndex circuit_index = tree_model->index_from_circuits (circuits);
|
||||
hierarchy_tree->setCurrentIndex (circuit_index);
|
||||
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
m_signals_enabled = true;
|
||||
|
||||
add_to_history (id, fwd);
|
||||
add_to_history (index, fwd);
|
||||
|
||||
selection_changed ();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
NetlistBrowserPage::add_to_history (void *id, bool fwd)
|
||||
NetlistBrowserPage::add_to_history (const QModelIndex &index, bool fwd)
|
||||
{
|
||||
if (! fwd) {
|
||||
if (m_history_ptr > 1) {
|
||||
--m_history_ptr;
|
||||
m_history [m_history_ptr - 1] = id;
|
||||
m_history [m_history_ptr - 1] = index;
|
||||
}
|
||||
} else if (m_history_ptr >= m_history.size ()) {
|
||||
m_history.push_back (id);
|
||||
m_history.push_back (index);
|
||||
m_history_ptr = m_history.size ();
|
||||
} else {
|
||||
if (m_history [m_history_ptr] != id) {
|
||||
if (m_history [m_history_ptr] != index) {
|
||||
m_history.erase (m_history.begin () + m_history_ptr + 1, m_history.end ());
|
||||
}
|
||||
m_history [m_history_ptr] = id;
|
||||
m_history [m_history_ptr] = index;
|
||||
++m_history_ptr;
|
||||
}
|
||||
|
||||
|
|
@ -733,7 +720,7 @@ NetlistBrowserPage::find_button_pressed ()
|
|||
|
||||
QModelIndex next = find_next (directory_tree, directory_tree->model (), re, directory_tree->currentIndex ());
|
||||
if (next.isValid ()) {
|
||||
navigate_to (next.internalPointer ());
|
||||
navigate_to (next);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ private:
|
|||
unsigned int m_cv_index;
|
||||
lay::Dispatcher *mp_plugin_root;
|
||||
tl::weak_ptr<db::LayoutToNetlist> mp_database;
|
||||
std::vector<void *> m_history;
|
||||
std::vector<QModelIndex> m_history;
|
||||
size_t m_history_ptr;
|
||||
bool m_signals_enabled;
|
||||
std::vector <lay::Marker *> mp_markers;
|
||||
|
|
@ -244,8 +244,8 @@ private:
|
|||
db::ContextCache m_cell_context_cache;
|
||||
|
||||
void setup_trees ();
|
||||
void add_to_history (void *id, bool fwd);
|
||||
void navigate_to (void *id, bool forward = true);
|
||||
void add_to_history (const QModelIndex &index, bool fwd);
|
||||
void navigate_to (const QModelIndex &index, bool forward = true);
|
||||
void adjust_view ();
|
||||
void clear_markers ();
|
||||
void highlight (const std::vector<const db::Net *> &nets, const std::vector<const db::Device *> &devices, const std::vector<const db::SubCircuit *> &subcircuits, const std::vector<const db::Circuit *> &circuits);
|
||||
|
|
|
|||
|
|
@ -108,9 +108,9 @@ TEST (1)
|
|||
// Subcircuits
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_subcircuits), Qt::UserRole).toString ()), "INV2|$1");
|
||||
EXPECT_EQ (model->parent (model->index (0, 0, sn_subcircuits)) == model->parent (model->index (0, 3, sn_subcircuits)), true);
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_subcircuits), Qt::DisplayRole).toString ()), "<a href='int:circuit?id=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_subcircuits), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, sn_subcircuits), Qt::DisplayRole).toString ()), "$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (9, 0, sn_subcircuits), Qt::DisplayRole).toString ()), "<a href='int:circuit?id=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (9, 0, sn_subcircuits), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (9, 2, sn_subcircuits), Qt::DisplayRole).toString ()), "$10");
|
||||
// Devices
|
||||
|
||||
|
|
@ -135,10 +135,10 @@ TEST (1)
|
|||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2NOutIndex), Qt::UserRole).toString ()), "D|PMOS|$2");
|
||||
EXPECT_EQ (model->parent (model->index (0, 0, inv2NOutIndex)) == model->parent (model->index (0, 3, inv2NOutIndex)), true);
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2NOutIndex), Qt::DisplayRole).toString ()), "D / PMOS [L=0.25, W=0.95, AS=0.26125, AD=0.49875, PS=1.5, PD=2.95]");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2NOutIndex), Qt::DisplayRole).toString ()), "<a href='int:device?id=24'>$2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2NOutIndex), Qt::DisplayRole).toString ()), "$2");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2NOutIndex), Qt::DisplayRole).toString ()), "D / NMOS [L=0.25, W=0.95, AS=0.26125, AD=0.49875, PS=1.5, PD=2.95]");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2NOutIndex), Qt::DisplayRole).toString ()), "<a href='int:device?id=56'>$4</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, inv2NOutIndex), Qt::DisplayRole).toString ()), "<a href='int:pin?id=18'>OUT</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2NOutIndex), Qt::DisplayRole).toString ()), "$4");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, inv2NOutIndex), Qt::DisplayRole).toString ()), "OUT");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 2, inv2NOutIndex), Qt::DisplayRole).toString ()), "");
|
||||
EXPECT_EQ (model->parent (model->index (2, 0, inv2NOutIndex)) == model->parent (model->index (2, 3, inv2NOutIndex)), true);
|
||||
|
||||
|
|
@ -174,10 +174,10 @@ TEST (1)
|
|||
EXPECT_EQ (model->rowCount (ringoFbIndex), 2);
|
||||
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbIndex), Qt::UserRole).toString ()), "IN|INV2|$2");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbIndex), Qt::DisplayRole).toString ()), "<a href='int:pin?id=2'>IN</a> / <a href='int:circuit?id=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, ringoFbIndex), Qt::DisplayRole).toString ()), "<a href='int:subcircuit?id=23'>$2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, ringoFbIndex), Qt::DisplayRole).toString ()), "<a href='int:pin?id=34'>$1</a> / <a href='int:circuit?id=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, ringoFbIndex), Qt::DisplayRole).toString ()), "<a href='int:subcircuit?id=7'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbIndex), Qt::DisplayRole).toString ()), "IN / <a href='int:netlist?path=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, ringoFbIndex), Qt::DisplayRole).toString ()), "$2");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, ringoFbIndex), Qt::DisplayRole).toString ()), "$1 / <a href='int:netlist?path=0'>INV2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, ringoFbIndex), Qt::DisplayRole).toString ()), "$1");
|
||||
|
||||
QModelIndex ringoFbSubcircuit2Index = model->index (0, 0, ringoFbIndex);
|
||||
EXPECT_EQ (model->parent (ringoFbSubcircuit2Index) == ringoFbIndex, true);
|
||||
|
|
@ -185,16 +185,16 @@ TEST (1)
|
|||
EXPECT_EQ (model->rowCount (ringoFbSubcircuit2Index), 5);
|
||||
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbSubcircuit2Index), Qt::UserRole).toString ()), "IN|FB");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=2'>IN</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=5'>FB</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=34'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "IN (already seen)");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,0,0'>FB</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "$1 (already seen)");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=18'>OUT</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=53'>$4</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (3, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=50'>$3</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (3, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=37'>VSS</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (4, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=66'>$4</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (4, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=21'>VDD</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "OUT");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,0,3'>$4</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (3, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "$3");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (3, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,0,2'>VSS</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (4, 0, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "$4");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (4, 2, ringoFbSubcircuit2Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,0,1'>VDD</a>");
|
||||
|
||||
QModelIndex ringoFbSubcircuit2InPinIndex = model->index (1, 0, ringoFbSubcircuit2Index);
|
||||
EXPECT_EQ (model->parent (ringoFbSubcircuit2InPinIndex) == ringoFbSubcircuit2Index, true);
|
||||
|
|
@ -209,7 +209,7 @@ TEST (1)
|
|||
EXPECT_EQ (model->rowCount (ringoSubcircuit1Index), 5);
|
||||
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, ringoSubcircuit1Index), Qt::UserRole).toString ()), "OUT");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, ringoSubcircuit1Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=18'>OUT</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 0, ringoSubcircuit1Index), Qt::DisplayRole).toString ()), "OUT");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (2, 2, ringoSubcircuit1Index), Qt::DisplayRole).toString ()), "");
|
||||
|
||||
QModelIndex ringoSubcircuit1OutPinIndex = model->index (2, 0, ringoSubcircuit1Index);
|
||||
|
|
@ -287,7 +287,7 @@ TEST (2)
|
|||
// INV2, pin 0 has one net node
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2Pin0Index), Qt::UserRole).toString ()), "$1|1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2Pin0Index), Qt::DisplayRole).toString ()), "$1 ⇔ 1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2Pin0Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=9'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2Pin0Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,1,0'>$1</a>");
|
||||
std::pair<const db::Net *, const db::Net *> nets = model->net_from_index (model->index (0, 0, inv2Pin0Index));
|
||||
EXPECT_EQ (nets.first != 0, true);
|
||||
if (nets.first != 0) {
|
||||
|
|
@ -297,7 +297,7 @@ TEST (2)
|
|||
if (nets.second != 0) {
|
||||
EXPECT_EQ (nets.second->expanded_name (), "1");
|
||||
}
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2Pin0Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=9'>1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2Pin0Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,1,0'>1</a>");
|
||||
|
||||
// first of nets in INV2 circuit
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, sn_nets), Qt::UserRole).toString ()), "$1|1");
|
||||
|
|
@ -314,8 +314,8 @@ TEST (2)
|
|||
// INV2, net 1 has one pin and one terminal at BULK
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2Net0Index), Qt::UserRole).toString ()), "B|B|PMOS|PMOS|$1|$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2Net0Index), Qt::DisplayRole).toString ()), "B / PMOS [L=0.25, W=3.5]");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2Net0Index), Qt::DisplayRole).toString ()), "<a href='int:device?id=17'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2Net0Index), Qt::DisplayRole).toString ()), "<a href='int:device?id=17'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2Net0Index), Qt::DisplayRole).toString ()), "$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2Net0Index), Qt::DisplayRole).toString ()), "$1");
|
||||
|
||||
// This terminal connects to a device with four other terminals ..
|
||||
QModelIndex inv2Net0TerminalIndex = model->index (0, 0, inv2Net0Index);
|
||||
|
|
@ -325,14 +325,14 @@ TEST (2)
|
|||
// .. whose second terminal is gate
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2Net0TerminalIndex), Qt::UserRole).toString ()), "G|G|IN|2");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2Net0TerminalIndex), Qt::DisplayRole).toString ()), "G");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2Net0TerminalIndex), Qt::DisplayRole).toString ()), "<a href='int:net?id=73'>IN</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2Net0TerminalIndex), Qt::DisplayRole).toString ()), "<a href='int:net?id=73'>2</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2Net0TerminalIndex), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,1,2'>IN</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2Net0TerminalIndex), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=1,1,2'>2</a>");
|
||||
|
||||
// The Pin
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2Net0Index), Qt::UserRole).toString ()), "");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2Net0Index), Qt::DisplayRole).toString ()), "");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2Net0Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=5'>$0</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2Net0Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=5'>$0</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2Net0Index), Qt::DisplayRole).toString ()), "$0");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2Net0Index), Qt::DisplayRole).toString ()), "$0");
|
||||
|
||||
// This pin does not have children
|
||||
QModelIndex inv2Net0PinIndex = model->index (1, 0, inv2Net0Index);
|
||||
|
|
@ -396,7 +396,7 @@ TEST (2)
|
|||
// The pin
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0Index), Qt::UserRole).toString ()), "");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0Index), Qt::DisplayRole).toString ()), "");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2PairNet0Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=38'>$3</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2PairNet0Index), Qt::DisplayRole).toString ()), "$3");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2PairNet0Index), Qt::DisplayRole).toString ()), "");
|
||||
|
||||
// This pin does not have children
|
||||
|
|
@ -407,8 +407,8 @@ TEST (2)
|
|||
|
||||
// The first subcircuit
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::UserRole).toString ()), "OUT|INV2|$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=101'>OUT ⇔ -</a> / <a href='int:circuit?id=1'>INV2 ⇔ -</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2PairNet0Index), Qt::DisplayRole).toString ()), "<a href='int:subcircuit?id=46'>$1</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 0, inv2PairNet0Index), Qt::DisplayRole).toString ()), "OUT ⇔ - / <a href='int:netlist?path=1'>INV2 ⇔ -</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 2, inv2PairNet0Index), Qt::DisplayRole).toString ()), "$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (1, 3, inv2PairNet0Index), Qt::DisplayRole).toString ()), "");
|
||||
|
||||
// This subcircuit has 6 other pins
|
||||
|
|
@ -417,8 +417,8 @@ TEST (2)
|
|||
EXPECT_EQ (model->rowCount (inv2PairNet0SubCircuit0Index), 6);
|
||||
EXPECT_EQ (model->parent (inv2PairNet0SubCircuit0Index) == inv2PairNet0Index, true);
|
||||
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0SubCircuit0Index), Qt::UserRole).toString ()), "$1");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0SubCircuit0Index), Qt::DisplayRole).toString ()), "<a href='int:pin?id=5'>$0</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2PairNet0SubCircuit0Index), Qt::DisplayRole).toString ()), "<a href='int:net?id=170'>$7</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0SubCircuit0Index), Qt::UserRole).toString ()), "$7");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 0, inv2PairNet0SubCircuit0Index), Qt::DisplayRole).toString ()), "$0 ⇔ -");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 2, inv2PairNet0SubCircuit0Index), Qt::DisplayRole).toString ()), "<a href='int:netlist?path=2,1,5'>$7</a>");
|
||||
EXPECT_EQ (tl::to_string (model->data (model->index (0, 3, inv2PairNet0SubCircuit0Index), Qt::DisplayRole).toString ()), "");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue