2008-07-10 04:22:36 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
2015-07-25 04:55:42 -05:00
|
|
|
// This file is part of the Coriolis Software.
|
2016-01-20 17:41:19 -06:00
|
|
|
// Copyright (c) UPMC 2008-2016, All Rights Reserved
|
2008-07-10 04:22:36 -05:00
|
|
|
//
|
2015-07-25 04:55:42 -05:00
|
|
|
// +-----------------------------------------------------------------+
|
2008-07-10 04:22:36 -05:00
|
|
|
// | H U R R I C A N E |
|
|
|
|
// | V L S I B a c k e n d D a t a - B a s e |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
2015-07-25 04:55:42 -05:00
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
2008-07-10 04:22:36 -05:00
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./NetInformations.cpp" |
|
2015-07-25 04:55:42 -05:00
|
|
|
// +-----------------------------------------------------------------+
|
2008-07-10 04:22:36 -05:00
|
|
|
|
|
|
|
|
2015-07-25 04:55:42 -05:00
|
|
|
#include <QObject>
|
|
|
|
#include "hurricane/Name.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/viewer/NetInformations.h"
|
2008-07-10 04:22:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
namespace Hurricane {
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "NetInformations"
|
|
|
|
|
|
|
|
|
|
|
|
int NetInformations::getColumnCount ()
|
|
|
|
{ return 1; }
|
|
|
|
|
|
|
|
|
|
|
|
QVariant NetInformations::getColumnName ( int column )
|
|
|
|
{
|
|
|
|
switch ( column ) {
|
|
|
|
case 0: return QVariant(QObject::tr("Net"));
|
|
|
|
}
|
|
|
|
return QVariant(QObject::tr("Column Out of Bound"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QVariant NetInformations::getColumn ( int column )
|
|
|
|
{
|
|
|
|
switch ( column ) {
|
|
|
|
case 0: return QVariant(getString(getName()).c_str());
|
|
|
|
}
|
|
|
|
return QVariant(QObject::tr("Column Out of Bound"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NetInformations::NetInformations ( const Net* net )
|
|
|
|
: _net(net)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
NetInformations::~NetInformations ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "SimpleNetInformations"
|
|
|
|
|
|
|
|
|
|
|
|
int SimpleNetInformations::getColumnCount ()
|
2015-07-25 04:55:42 -05:00
|
|
|
{ return 3; }
|
2008-07-10 04:22:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
QVariant SimpleNetInformations::getColumnName ( int column )
|
|
|
|
{
|
|
|
|
switch ( column ) {
|
|
|
|
case 0: return QVariant(QObject::tr("Net"));
|
|
|
|
case 1: return QVariant(QObject::tr("Plugs"));
|
2015-07-25 04:55:42 -05:00
|
|
|
case 2: return QVariant(QObject::tr("RoutingPads"));
|
2008-07-10 04:22:36 -05:00
|
|
|
}
|
|
|
|
return QVariant(QObject::tr("Column Out of Bound"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QVariant SimpleNetInformations::getColumn ( int column )
|
|
|
|
{
|
|
|
|
switch ( column ) {
|
2015-07-25 04:55:42 -05:00
|
|
|
case 0: return _netName;
|
|
|
|
case 1: return (unsigned int)_plugsCount;
|
|
|
|
case 2:
|
|
|
|
if (_net->isGlobal()) {
|
|
|
|
if (not _rpsCount) return "N/A (global)";
|
|
|
|
string s = getString(_rpsCount) + " (global)";
|
|
|
|
return s.c_str();
|
|
|
|
}
|
|
|
|
return (unsigned int)_rpsCount;
|
2008-07-10 04:22:36 -05:00
|
|
|
}
|
|
|
|
return QVariant(QObject::tr("Column Out of Bound"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SimpleNetInformations::SimpleNetInformations ( const Net* net )
|
|
|
|
: NetInformations(net)
|
2015-07-25 04:55:42 -05:00
|
|
|
, _netName (getString(getName()).c_str())
|
2010-03-09 08:19:23 -06:00
|
|
|
, _plugsCount (_net->getPlugs().getSize())
|
2015-07-25 04:55:42 -05:00
|
|
|
, _rpsCount (_net->getRoutingPads().getSize())
|
2008-07-10 04:22:36 -05:00
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
SimpleNetInformations::~SimpleNetInformations ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "AbstractNetInformationsVector"
|
|
|
|
|
|
|
|
|
|
|
|
AbstractNetInformationsVector::~AbstractNetInformationsVector ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
} // End of Hurricane namespace.
|