Small improvement to the NetlistWidget (more fields).
This commit is contained in:
parent
96e6c9dd06
commit
abee13d669
|
@ -772,15 +772,23 @@ void Net::_preDestroy()
|
||||||
cdebug_tabw(18,-1);
|
cdebug_tabw(18,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Net::_getFlagsAsString() const
|
||||||
|
// **********************************
|
||||||
|
{
|
||||||
|
string ds;
|
||||||
|
ds += ((isDeepNet() ) ? "d" : "-");
|
||||||
|
ds += ((_isExternal ) ? "e" : "-");
|
||||||
|
ds += ((_isGlobal ) ? "g" : "-");
|
||||||
|
ds += ((_isAutomatic) ? "a" : "-");
|
||||||
|
return ds;
|
||||||
|
}
|
||||||
|
|
||||||
string Net::_getString() const
|
string Net::_getString() const
|
||||||
// ***************************
|
// ***************************
|
||||||
{
|
{
|
||||||
string bs = Inherit::_getString();
|
string bs = Inherit::_getString();
|
||||||
string ds = "\"" + getString(_name) + "\" ";
|
string ds = "\"" + getString(_name) + "\" ";
|
||||||
ds += ((isDeepNet() ) ? "d" : "-");
|
ds += _getFlagsAsString();
|
||||||
ds += ((_isExternal ) ? "e" : "-");
|
|
||||||
ds += ((_isGlobal ) ? "g" : "-");
|
|
||||||
ds += ((_isAutomatic) ? "a" : "-");
|
|
||||||
ds += " ";
|
ds += " ";
|
||||||
ds += getString(_type ) + " ";
|
ds += getString(_type ) + " ";
|
||||||
ds += getString(_direction);
|
ds += getString(_direction);
|
||||||
|
|
|
@ -251,6 +251,7 @@ class Net : public Entity {
|
||||||
public: virtual void _toJsonSignature(JsonWriter*) const;
|
public: virtual void _toJsonSignature(JsonWriter*) const;
|
||||||
public: virtual void _toJsonCollections(JsonWriter*) const;
|
public: virtual void _toJsonCollections(JsonWriter*) const;
|
||||||
public: virtual string _getTypeName() const {return _TName("Net");};
|
public: virtual string _getTypeName() const {return _TName("Net");};
|
||||||
|
public: string _getFlagsAsString() const;
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
public: virtual Record* _getRecord() const;
|
public: virtual Record* _getRecord() const;
|
||||||
public: NetMainName& _getMainName() { return _mainName; }
|
public: NetMainName& _getMainName() { return _mainName; }
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
int SimpleNetInformations::getColumnCount ()
|
int SimpleNetInformations::getColumnCount ()
|
||||||
{ return 3; }
|
{ return 6; }
|
||||||
|
|
||||||
|
|
||||||
QVariant SimpleNetInformations::getColumnName ( int column )
|
QVariant SimpleNetInformations::getColumnName ( int column )
|
||||||
|
@ -71,7 +71,10 @@ namespace Hurricane {
|
||||||
switch ( column ) {
|
switch ( column ) {
|
||||||
case 0: return QVariant(QObject::tr("Net"));
|
case 0: return QVariant(QObject::tr("Net"));
|
||||||
case 1: return QVariant(QObject::tr("Plugs"));
|
case 1: return QVariant(QObject::tr("Plugs"));
|
||||||
case 2: return QVariant(QObject::tr("RoutingPads"));
|
case 2: return QVariant(QObject::tr("RPs"));
|
||||||
|
case 3: return QVariant(QObject::tr("Flags"));
|
||||||
|
case 4: return QVariant(QObject::tr("Type"));
|
||||||
|
case 5: return QVariant(QObject::tr("Direction"));
|
||||||
}
|
}
|
||||||
return QVariant(QObject::tr("Column Out of Bound"));
|
return QVariant(QObject::tr("Column Out of Bound"));
|
||||||
}
|
}
|
||||||
|
@ -84,11 +87,15 @@ namespace Hurricane {
|
||||||
case 1: return (unsigned int)_plugsCount;
|
case 1: return (unsigned int)_plugsCount;
|
||||||
case 2:
|
case 2:
|
||||||
if (_net->isGlobal()) {
|
if (_net->isGlobal()) {
|
||||||
if (not _rpsCount) return "N/A (global)";
|
if (not _rpsCount) return "N/A";
|
||||||
string s = getString(_rpsCount) + " (global)";
|
string s = getString(_rpsCount);
|
||||||
return s.c_str();
|
return s.c_str();
|
||||||
}
|
}
|
||||||
return (unsigned int)_rpsCount;
|
return (unsigned int)_rpsCount;
|
||||||
|
case 3: return QString::fromStdString( getString( _net->_getFlagsAsString() ));
|
||||||
|
case 4: return QString::fromStdString( getString( _net->getType() ));
|
||||||
|
case 5: return QString::fromStdString( getString( _net->getDirection() ));
|
||||||
|
|
||||||
}
|
}
|
||||||
return QVariant(QObject::tr("Column Out of Bound"));
|
return QVariant(QObject::tr("Column Out of Bound"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
QHeaderView* horizontalHeader = _view->horizontalHeader();
|
QHeaderView* horizontalHeader = _view->horizontalHeader();
|
||||||
horizontalHeader->setDefaultAlignment ( Qt::AlignHCenter );
|
horizontalHeader->setDefaultAlignment ( Qt::AlignHCenter );
|
||||||
horizontalHeader->setMinimumSectionSize( (Graphics::isHighDpi()) ? 300 : 150 );
|
horizontalHeader->setMinimumSectionSize( (Graphics::isHighDpi()) ? 150 : 75 );
|
||||||
horizontalHeader->setStretchLastSection( true );
|
horizontalHeader->setStretchLastSection( true );
|
||||||
|
|
||||||
QHeaderView* verticalHeader = _view->verticalHeader();
|
QHeaderView* verticalHeader = _view->verticalHeader();
|
||||||
|
@ -151,24 +151,18 @@ namespace Hurricane {
|
||||||
_forceReselect = false;
|
_forceReselect = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedNetSet::iterator remove;
|
SelectedNetSet::iterator isel = _selecteds.begin ();
|
||||||
SelectedNetSet::iterator isel = _selecteds.begin ();
|
|
||||||
while ( isel != _selecteds.end() ) {
|
while ( isel != _selecteds.end() ) {
|
||||||
switch ( isel->getAccesses() ) {
|
SelectedNetSet::iterator remove = isel++;
|
||||||
case 1: break;
|
if ( remove->getAccesses() == 0 ) {
|
||||||
case 64:
|
emit netUnselected ( Occurrence(remove->getNet()) );
|
||||||
emit netSelected ( Occurrence(isel->getNet()) );
|
_selecteds.erase ( remove );
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
emit netUnselected ( Occurrence(isel->getNet()) );
|
|
||||||
remove = isel;
|
|
||||||
++isel;
|
|
||||||
_selecteds.erase ( remove );
|
|
||||||
continue;
|
|
||||||
default:
|
|
||||||
cerr << Bug("NetlistWidget::updateSelecteds(): invalid code %d"
|
|
||||||
,isel->getAccesses()) << endl;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
isel = _selecteds.begin ();
|
||||||
|
while ( isel != _selecteds.end() ) {
|
||||||
|
if ( isel->getAccesses() == 64 )
|
||||||
|
emit netSelected ( Occurrence(isel->getNet()) );
|
||||||
++isel;
|
++isel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace Tramontana {
|
||||||
|
|
||||||
QHeaderView* horizontalHeader = _view->horizontalHeader();
|
QHeaderView* horizontalHeader = _view->horizontalHeader();
|
||||||
horizontalHeader->setDefaultAlignment ( Qt::AlignHCenter );
|
horizontalHeader->setDefaultAlignment ( Qt::AlignHCenter );
|
||||||
horizontalHeader->setMinimumSectionSize( (Graphics::isHighDpi()) ? 300 : 150 );
|
horizontalHeader->setMinimumSectionSize( (Graphics::isHighDpi()) ? 150 : 75 );
|
||||||
horizontalHeader->setStretchLastSection( true );
|
horizontalHeader->setStretchLastSection( true );
|
||||||
|
|
||||||
QHeaderView* verticalHeader = _view->verticalHeader();
|
QHeaderView* verticalHeader = _view->verticalHeader();
|
||||||
|
|
Loading…
Reference in New Issue