* ./nimbus,
./metis, ./mauka, ./katabatic, ./kite : - Change: switch toward the XML configuration system. Suppress the need of a default static configuration (now built on demand from the XML database). In Mauka and Kite, suppress the ConfigurationWidget, wich are obsoleted by the generic XML configuration widget.
This commit is contained in:
parent
4b39e1ed6a
commit
05095032a2
|
@ -2,9 +2,10 @@
|
||||||
include ( ${QT_USE_FILE} )
|
include ( ${QT_USE_FILE} )
|
||||||
|
|
||||||
include_directories ( ${KITE_SOURCE_DIR}/src
|
include_directories ( ${KITE_SOURCE_DIR}/src
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
${HURRICANE_INCLUDE_DIR}
|
|
||||||
${CORIOLIS_INCLUDE_DIR}
|
${CORIOLIS_INCLUDE_DIR}
|
||||||
|
${HURRICANE_INCLUDE_DIR}
|
||||||
|
${CONFIGURATION_INCLUDE_DIR}
|
||||||
|
${Boost_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
set ( includes kite/TrackSegmentCost.h
|
set ( includes kite/TrackSegmentCost.h
|
||||||
kite/TrackCost.h
|
kite/TrackCost.h
|
||||||
|
@ -30,11 +31,8 @@
|
||||||
kite/Configuration.h
|
kite/Configuration.h
|
||||||
kite/KiteEngine.h
|
kite/KiteEngine.h
|
||||||
kite/GraphicKiteEngine.h
|
kite/GraphicKiteEngine.h
|
||||||
kite/ConfigurationWidget.h
|
|
||||||
)
|
|
||||||
set ( mocIncludes kite/GraphicKiteEngine.h
|
|
||||||
kite/ConfigurationWidget.h
|
|
||||||
)
|
)
|
||||||
|
set ( mocIncludes kite/GraphicKiteEngine.h )
|
||||||
set ( cpps TrackSegmentCost.cpp
|
set ( cpps TrackSegmentCost.cpp
|
||||||
TrackCost.cpp
|
TrackCost.cpp
|
||||||
DataNegociate.cpp
|
DataNegociate.cpp
|
||||||
|
@ -63,7 +61,6 @@
|
||||||
Configuration.cpp
|
Configuration.cpp
|
||||||
KiteEngine.cpp
|
KiteEngine.cpp
|
||||||
GraphicKiteEngine.cpp
|
GraphicKiteEngine.cpp
|
||||||
ConfigurationWidget.cpp
|
|
||||||
)
|
)
|
||||||
set ( kitecpps KiteMain.cpp )
|
set ( kitecpps KiteMain.cpp )
|
||||||
qt4_wrap_cpp ( mocCpps ${mocIncludes} )
|
qt4_wrap_cpp ( mocCpps ${mocIncludes} )
|
||||||
|
@ -90,6 +87,7 @@
|
||||||
${HURRICANE_GRAPHICAL_LIBRARIES}
|
${HURRICANE_GRAPHICAL_LIBRARIES}
|
||||||
${CIF_LIBRARY}
|
${CIF_LIBRARY}
|
||||||
${AGDS_LIBRARY}
|
${AGDS_LIBRARY}
|
||||||
|
${CONFIGURATION_LIBRARY}
|
||||||
${QT_LIBRARIES}
|
${QT_LIBRARIES}
|
||||||
${LEFDEF_LIBRARIES}
|
${LEFDEF_LIBRARIES}
|
||||||
${OA_LIBRARIES}
|
${OA_LIBRARIES}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "vlsisapd/configuration/Configuration.h"
|
||||||
#include "hurricane/Cell.h"
|
#include "hurricane/Cell.h"
|
||||||
#include "crlcore/Utilities.h"
|
#include "crlcore/Utilities.h"
|
||||||
#include "kite/Configuration.h"
|
#include "kite/Configuration.h"
|
||||||
|
@ -49,33 +50,21 @@ namespace Kite {
|
||||||
// Class : "Kite::Configuration".
|
// Class : "Kite::Configuration".
|
||||||
|
|
||||||
|
|
||||||
Configuration* Configuration::_default = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
Configuration* Configuration::getDefault ()
|
|
||||||
{
|
|
||||||
if ( _default == NULL ) {
|
|
||||||
_default = new Configuration ( Katabatic::Configuration::getDefault() );
|
|
||||||
}
|
|
||||||
return _default;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Configuration::Configuration ( Katabatic::Configuration* base )
|
Configuration::Configuration ( Katabatic::Configuration* base )
|
||||||
: Katabatic::Configuration()
|
: Katabatic::Configuration()
|
||||||
, _base (base)
|
, _base (base)
|
||||||
, _postEventCb ()
|
, _postEventCb ()
|
||||||
, _edgeCapacityPercent(0.80)
|
, _edgeCapacityPercent(Cfg::getParamPercentage("kite.edgeCapacity", 80.0)->asDouble())
|
||||||
, _expandStep (0.99)
|
, _expandStep (Cfg::getParamPercentage("kite.expandStep" ,100.0)->asDouble())
|
||||||
, _ripupLimits ()
|
, _ripupLimits ()
|
||||||
, _ripupCost (3)
|
, _ripupCost (Cfg::getParamPercentage("kite.ripupCost" , 3)->asInt())
|
||||||
, _eventsLimit (4000000)
|
, _eventsLimit (Cfg::getParamPercentage("kite.eventsLimit" ,4000000)->asInt())
|
||||||
{
|
{
|
||||||
_ripupLimits[BorderRipupLimit] = 26;
|
_ripupLimits[BorderRipupLimit] = Cfg::getParamPercentage("kite.borderRipupLimit" ,26)->asInt();
|
||||||
_ripupLimits[StrapRipupLimit] = 16;
|
_ripupLimits[StrapRipupLimit] = Cfg::getParamPercentage("kite.strapRipupLimit" ,16)->asInt();
|
||||||
_ripupLimits[LocalRipupLimit] = 7;
|
_ripupLimits[LocalRipupLimit] = Cfg::getParamPercentage("kite.localRipupLimit" , 7)->asInt();
|
||||||
_ripupLimits[GlobalRipupLimit] = 5;
|
_ripupLimits[GlobalRipupLimit] = Cfg::getParamPercentage("kite.globalRipupLimit" , 5)->asInt();
|
||||||
_ripupLimits[LongGlobalRipupLimit] = 5;
|
_ripupLimits[LongGlobalRipupLimit] = Cfg::getParamPercentage("kite.longGlobalRipupLimit" , 5)->asInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,409 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul Chaput |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./ConfigurationWidget.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QFrame>
|
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QLineEdit>
|
|
||||||
#include <QIntValidator>
|
|
||||||
#include <QDoubleValidator>
|
|
||||||
|
|
||||||
#include "hurricane/viewer/Graphics.h"
|
|
||||||
#include "kite/Configuration.h"
|
|
||||||
#include "kite/ConfigurationWidget.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
using Hurricane::Graphics;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Kite::ConfigurationWidget".
|
|
||||||
|
|
||||||
|
|
||||||
ConfigurationWidget::ConfigurationWidget ( QWidget* parent )
|
|
||||||
: QWidget(parent)
|
|
||||||
, _configuration (NULL)
|
|
||||||
, _saturateRatioEdit (new QLineEdit())
|
|
||||||
, _globalThresholdEdit (new QLineEdit())
|
|
||||||
, _edgeCapacityEdit (new QLineEdit())
|
|
||||||
, _expandStepEdit (new QLineEdit())
|
|
||||||
, _eventsLimitEdit (new QLineEdit())
|
|
||||||
, _ripupCostSb (new QSpinBox())
|
|
||||||
, _borderRipupLimitSb (new QSpinBox())
|
|
||||||
, _strapRipupLimitSb (new QSpinBox())
|
|
||||||
, _localRipupLimitSb (new QSpinBox())
|
|
||||||
, _globalRipupLimitSb (new QSpinBox())
|
|
||||||
, _longGlobalRipupLimitSb(new QSpinBox())
|
|
||||||
{
|
|
||||||
setAttribute ( Qt::WA_QuitOnClose, false );
|
|
||||||
|
|
||||||
QVBoxLayout* vLayout = new QVBoxLayout ();
|
|
||||||
QGridLayout* gLayout = new QGridLayout ();
|
|
||||||
|
|
||||||
QLabel* label = new QLabel();
|
|
||||||
label->setFont ( Graphics::getNormalFont(true) );
|
|
||||||
label->setText ( "Katabatic - Routing Database" );
|
|
||||||
gLayout->addWidget ( label, 0, 0, 1, 4, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Saturate Ratio (%)" );
|
|
||||||
_saturateRatioEdit->setValidator ( new QDoubleValidator(this) );
|
|
||||||
_saturateRatioEdit->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , 1, 0, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _saturateRatioEdit, 1, 1, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
_globalThresholdEdit->setValidator ( new QIntValidator(this) );
|
|
||||||
_globalThresholdEdit->setEnabled ( false );
|
|
||||||
label->setText ( "Global Length Threshold" );
|
|
||||||
gLayout->addWidget ( label , 2, 0, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _globalThresholdEdit, 2, 1, Qt::AlignLeft );
|
|
||||||
|
|
||||||
const int kiteRow = 3;
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setFont ( Graphics::getNormalFont(true) );
|
|
||||||
label->setText ( "Kite - Detailed Router" );
|
|
||||||
|
|
||||||
QFrame* separator = new QFrame ();
|
|
||||||
separator->setFrameShape ( QFrame::HLine );
|
|
||||||
separator->setFrameShadow ( QFrame::Sunken );
|
|
||||||
|
|
||||||
gLayout->addWidget ( separator, kiteRow+0, 0, 1, 4 );
|
|
||||||
gLayout->addWidget ( label , kiteRow+1, 0, 1, 4, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Edge Capacity (%)" );
|
|
||||||
_edgeCapacityEdit->setValidator ( new QDoubleValidator(this) );
|
|
||||||
_edgeCapacityEdit->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+2, 0, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _edgeCapacityEdit, kiteRow+2, 1, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Expand Step (%)" );
|
|
||||||
_expandStepEdit->setValidator ( new QDoubleValidator(this) );
|
|
||||||
_expandStepEdit->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+3, 0, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _expandStepEdit, kiteRow+3, 1, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
_eventsLimitEdit->setValidator ( new QIntValidator(this) );
|
|
||||||
_eventsLimitEdit->setEnabled ( false );
|
|
||||||
label->setText ( "Events Limit" );
|
|
||||||
gLayout->addWidget ( label , kiteRow+4, 0, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _eventsLimitEdit, kiteRow+4, 1, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Ripup Cost" );
|
|
||||||
_ripupCostSb->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+2, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _ripupCostSb, kiteRow+2, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setFont ( Graphics::getNormalFont(true) );
|
|
||||||
label->setText ( "Ripup Limit" );
|
|
||||||
gLayout->addWidget ( label, kiteRow+3, 2, Qt::AlignLeft );
|
|
||||||
|
|
||||||
QSizePolicy spinBoxPolicy (QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Borders" );
|
|
||||||
_borderRipupLimitSb->setEnabled ( false );
|
|
||||||
//_borderRipupLimitSb->setSizePolicy ( spinBoxPolicy );
|
|
||||||
gLayout->addWidget ( label , kiteRow+4, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _borderRipupLimitSb, kiteRow+4, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Straps" );
|
|
||||||
_strapRipupLimitSb->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+5, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _strapRipupLimitSb, kiteRow+5, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Locals" );
|
|
||||||
_localRipupLimitSb->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+6, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _localRipupLimitSb, kiteRow+6, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Globals" );
|
|
||||||
_globalRipupLimitSb->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+7, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _globalRipupLimitSb, kiteRow+7, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
label = new QLabel();
|
|
||||||
label->setText ( "Long Globals" );
|
|
||||||
_longGlobalRipupLimitSb->setEnabled ( false );
|
|
||||||
gLayout->addWidget ( label , kiteRow+8, 2, Qt::AlignRight );
|
|
||||||
gLayout->addWidget ( _longGlobalRipupLimitSb, kiteRow+8, 3, Qt::AlignLeft );
|
|
||||||
|
|
||||||
separator = new QFrame ();
|
|
||||||
separator->setFrameShape ( QFrame::HLine );
|
|
||||||
separator->setFrameShadow ( QFrame::Sunken );
|
|
||||||
gLayout->addWidget ( separator, kiteRow+9, 0, 1, 4 );
|
|
||||||
|
|
||||||
vLayout->addLayout ( gLayout );
|
|
||||||
|
|
||||||
QHBoxLayout* hLayout = new QHBoxLayout ();
|
|
||||||
hLayout->addStretch ();
|
|
||||||
|
|
||||||
QPushButton* apply = new QPushButton ();
|
|
||||||
apply->setText ( tr("Apply") );
|
|
||||||
hLayout->addWidget ( apply );
|
|
||||||
hLayout->addStretch ();
|
|
||||||
|
|
||||||
vLayout->addLayout ( hLayout );
|
|
||||||
vLayout->addStretch ();
|
|
||||||
|
|
||||||
setLayout ( vLayout );
|
|
||||||
|
|
||||||
connect ( apply, SIGNAL(clicked()), this, SLOT(_applySettings()) );
|
|
||||||
// connect ( _saturateRatioEdit , SIGNAL(returnPressed()) , this, SLOT(_updateSaturateRatio()) );
|
|
||||||
// connect ( _globalThresholdEdit , SIGNAL(returnPressed()) , this, SLOT(_updateGlobalThreshold()) );
|
|
||||||
// connect ( _edgeCapacityEdit , SIGNAL(returnPressed()) , this, SLOT(_updateEdgeCapacity()) );
|
|
||||||
// connect ( _expandStepEdit , SIGNAL(returnPressed()) , this, SLOT(_updateExpandStep()) );
|
|
||||||
// connect ( _eventsLimitEdit , SIGNAL(returnPressed()) , this, SLOT(_updateEventsLimit()) );
|
|
||||||
// connect ( _ripupCostSb , SIGNAL(valueChanged(int)), this, SLOT(_updateRipupCost(int)) );
|
|
||||||
// connect ( _borderRipupLimitSb , SIGNAL(valueChanged(int)), this, SLOT(_updateBorderRipupLimit(int)) );
|
|
||||||
// connect ( _strapRipupLimitSb , SIGNAL(valueChanged(int)), this, SLOT(_updateStrapRipupLimit(int)) );
|
|
||||||
// connect ( _localRipupLimitSb , SIGNAL(valueChanged(int)), this, SLOT(_updateLocalRipupLimit(int)) );
|
|
||||||
// connect ( _globalRipupLimitSb , SIGNAL(valueChanged(int)), this, SLOT(_updateGlobalRipupLimit(int)) );
|
|
||||||
// connect ( _longGlobalRipupLimitSb, SIGNAL(valueChanged(int)), this, SLOT(_updateLongGlobalRipupLimit(int)) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::setConfiguration ( Configuration* config )
|
|
||||||
{
|
|
||||||
if ( config != NULL ) {
|
|
||||||
_saturateRatioEdit ->setText ( QString("%1").arg(config->getSaturateRatio()) );
|
|
||||||
_globalThresholdEdit->setText ( QString("%1").arg((long)DbU::getLambda(config->getGlobalThreshold())) );
|
|
||||||
|
|
||||||
_edgeCapacityEdit->setText ( QString("%1").arg(config->getEdgeCapacityPercent()) );
|
|
||||||
_expandStepEdit ->setText ( QString("%1").arg(config->getExpandStep()) );
|
|
||||||
_eventsLimitEdit ->setText ( QString("%1").arg(config->getEventsLimit()) );
|
|
||||||
|
|
||||||
_ripupCostSb ->setValue ( config->getRipupCost() );
|
|
||||||
_borderRipupLimitSb ->setValue ( config->getRipupLimit(Configuration::BorderRipupLimit) );
|
|
||||||
_strapRipupLimitSb ->setValue ( config->getRipupLimit(Configuration::StrapRipupLimit) );
|
|
||||||
_localRipupLimitSb ->setValue ( config->getRipupLimit(Configuration::LocalRipupLimit) );
|
|
||||||
_globalRipupLimitSb ->setValue ( config->getRipupLimit(Configuration::GlobalRipupLimit) );
|
|
||||||
_longGlobalRipupLimitSb->setValue ( config->getRipupLimit(Configuration::LongGlobalRipupLimit) );
|
|
||||||
|
|
||||||
_saturateRatioEdit ->setEnabled ( true );
|
|
||||||
_globalThresholdEdit ->setEnabled ( true );
|
|
||||||
_edgeCapacityEdit ->setEnabled ( true );
|
|
||||||
_expandStepEdit ->setEnabled ( true );
|
|
||||||
_eventsLimitEdit ->setEnabled ( true );
|
|
||||||
_ripupCostSb ->setEnabled ( true );
|
|
||||||
_borderRipupLimitSb ->setEnabled ( true );
|
|
||||||
_strapRipupLimitSb ->setEnabled ( true );
|
|
||||||
_localRipupLimitSb ->setEnabled ( true );
|
|
||||||
_globalRipupLimitSb ->setEnabled ( true );
|
|
||||||
_longGlobalRipupLimitSb->setEnabled ( true );
|
|
||||||
} else {
|
|
||||||
_saturateRatioEdit ->setEnabled ( false );
|
|
||||||
_globalThresholdEdit ->setEnabled ( false );
|
|
||||||
_edgeCapacityEdit ->setEnabled ( false );
|
|
||||||
_expandStepEdit ->setEnabled ( false );
|
|
||||||
_eventsLimitEdit ->setEnabled ( false );
|
|
||||||
_ripupCostSb ->setEnabled ( false );
|
|
||||||
_borderRipupLimitSb ->setEnabled ( false );
|
|
||||||
_strapRipupLimitSb ->setEnabled ( false );
|
|
||||||
_localRipupLimitSb ->setEnabled ( false );
|
|
||||||
_globalRipupLimitSb ->setEnabled ( false );
|
|
||||||
_longGlobalRipupLimitSb->setEnabled ( false );
|
|
||||||
}
|
|
||||||
_configuration = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_applySettings ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
_updateSaturateRatio ();
|
|
||||||
_updateGlobalThreshold ();
|
|
||||||
_updateEdgeCapacity ();
|
|
||||||
_updateExpandStep ();
|
|
||||||
_updateEventsLimit ();
|
|
||||||
_updateRipupCost (_ripupCostSb ->value());
|
|
||||||
_updateBorderRipupLimit (_borderRipupLimitSb ->value());
|
|
||||||
_updateStrapRipupLimit (_strapRipupLimitSb ->value());
|
|
||||||
_updateLocalRipupLimit (_localRipupLimitSb ->value());
|
|
||||||
_updateGlobalRipupLimit (_globalRipupLimitSb ->value());
|
|
||||||
_updateLongGlobalRipupLimit(_longGlobalRipupLimitSb->value());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateSaturateRatio ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
float ratio = _saturateRatioEdit->displayText().toFloat ( &success );
|
|
||||||
if ( not success or (ratio >= 1.0) or (ratio < 0.0) ) {
|
|
||||||
_saturateRatioEdit->setText ( QString("%1").arg(_configuration->getSaturateRatio()) );
|
|
||||||
} else {
|
|
||||||
_configuration->setSaturateRatio ( ratio );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateGlobalThreshold ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
DbU::Unit length = DbU::lambda ( _globalThresholdEdit->displayText().toDouble(&success) );
|
|
||||||
if ( not success or (length < 0) ) {
|
|
||||||
_globalThresholdEdit->setText ( QString("%1").arg((long)DbU::getLambda(_configuration->getGlobalThreshold())) );
|
|
||||||
} else {
|
|
||||||
_configuration->setGlobalThreshold ( length );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateEdgeCapacity ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
float ratio = _edgeCapacityEdit->displayText().toFloat ( &success );
|
|
||||||
if ( not success or (ratio >= 1.0) or (ratio < 0.0) ) {
|
|
||||||
_edgeCapacityEdit->setText ( QString("%1").arg(_configuration->getEdgeCapacityPercent()) );
|
|
||||||
} else {
|
|
||||||
_configuration->setEdgeCapacityPercent ( ratio );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateExpandStep ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
float ratio = _expandStepEdit->displayText().toFloat ( &success );
|
|
||||||
if ( not success or (ratio >= 1.0) or (ratio < 0.0) ) {
|
|
||||||
_expandStepEdit->setText ( QString("%1").arg(_configuration->getExpandStep()) );
|
|
||||||
} else {
|
|
||||||
_configuration->setExpandStep ( ratio );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateEventsLimit ()
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
long limit = _eventsLimitEdit->displayText().toLong ( &success );
|
|
||||||
if ( not success or (limit < 0) ) {
|
|
||||||
_eventsLimitEdit->setText ( QString("%1").arg(_configuration->getEventsLimit()) );
|
|
||||||
} else {
|
|
||||||
_configuration->setEventsLimit ( (unsigned long)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateRipupCost ( int cost )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
//std::cerr << "_vptr:" << (void*)(*((int*)_configuration)) << std::endl;
|
|
||||||
if ( cost < 0 ) {
|
|
||||||
_ripupCostSb->setValue ( (int)_configuration->getRipupCost() );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupCost ( (unsigned int)cost );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateBorderRipupLimit ( int limit )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
if ( limit < 0 ) {
|
|
||||||
_borderRipupLimitSb->setValue ( (int)_configuration->getRipupLimit(Configuration::BorderRipupLimit) );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupLimit ( Configuration::BorderRipupLimit, (unsigned int)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateStrapRipupLimit ( int limit )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
if ( limit < 0 ) {
|
|
||||||
_strapRipupLimitSb->setValue ( (int)_configuration->getRipupLimit(Configuration::StrapRipupLimit) );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupLimit ( Configuration::StrapRipupLimit, (unsigned int)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateLocalRipupLimit ( int limit )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
if ( limit < 0 ) {
|
|
||||||
_localRipupLimitSb->setValue ( (int)_configuration->getRipupLimit(Configuration::LocalRipupLimit) );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupLimit ( Configuration::LocalRipupLimit, (unsigned int)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateGlobalRipupLimit ( int limit )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
if ( limit < 0 ) {
|
|
||||||
_globalRipupLimitSb->setValue ( (int)_configuration->getRipupLimit(Configuration::GlobalRipupLimit) );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupLimit ( Configuration::GlobalRipupLimit, (unsigned int)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConfigurationWidget::_updateLongGlobalRipupLimit ( int limit )
|
|
||||||
{
|
|
||||||
if ( _configuration == NULL ) return;
|
|
||||||
|
|
||||||
if ( limit < 0 ) {
|
|
||||||
_longGlobalRipupLimitSb->setValue ( (int)_configuration->getRipupLimit(Configuration::LongGlobalRipupLimit) );
|
|
||||||
} else {
|
|
||||||
_configuration->setRipupLimit ( Configuration::LongGlobalRipupLimit, (unsigned int)limit );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include <katabatic/GCell.h>
|
#include <katabatic/GCell.h>
|
||||||
#include <knik/KnikEngine.h>
|
#include <knik/KnikEngine.h>
|
||||||
#include <kite/GraphicKiteEngine.h>
|
#include <kite/GraphicKiteEngine.h>
|
||||||
#include <kite/ConfigurationWidget.h>
|
//#include <kite/ConfigurationWidget.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
@ -331,16 +331,16 @@ namespace Kite {
|
||||||
connect ( this, SIGNAL(cellPreModificated ()), _viewer->getCellWidget(), SLOT(cellPreModificate ()) );
|
connect ( this, SIGNAL(cellPreModificated ()), _viewer->getCellWidget(), SLOT(cellPreModificate ()) );
|
||||||
connect ( this, SIGNAL(cellPostModificated()), _viewer->getCellWidget(), SLOT(cellPostModificate()) );
|
connect ( this, SIGNAL(cellPostModificated()), _viewer->getCellWidget(), SLOT(cellPostModificate()) );
|
||||||
|
|
||||||
ControllerWidget* controller = _viewer->getControllerWidget();
|
// ControllerWidget* controller = _viewer->getControllerWidget();
|
||||||
ConfigurationWidget* setting = controller->getSettings()
|
// ConfigurationWidget* setting = controller->getSettings()
|
||||||
->findChild<ConfigurationWidget*>("controller.tabSettings.setting.kite");
|
// ->findChild<ConfigurationWidget*>("controller.tabSettings.setting.kite");
|
||||||
|
|
||||||
if ( setting == NULL ) {
|
// if ( setting == NULL ) {
|
||||||
setting = new ConfigurationWidget ();
|
// setting = new ConfigurationWidget ();
|
||||||
setting->setObjectName ( "controller.tabSettings.setting.kite" );
|
// setting->setObjectName ( "controller.tabSettings.setting.kite" );
|
||||||
setting->setConfiguration ( Configuration::getDefault() );
|
// setting->setConfiguration ( Configuration::getDefault() );
|
||||||
controller->addSetting ( setting, "Kite" );
|
// controller->addSetting ( setting, "Kite" );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ namespace Kite {
|
||||||
: KatabaticEngine (cell)
|
: KatabaticEngine (cell)
|
||||||
, _knik (NULL)
|
, _knik (NULL)
|
||||||
, _obstacleNet (NULL)
|
, _obstacleNet (NULL)
|
||||||
, _configuration (Configuration::getDefault()->clone(this))
|
, _configuration (new Configuration(getKatabaticConfiguration()))
|
||||||
, _routingPlanes ()
|
, _routingPlanes ()
|
||||||
, _kiteGrid (NULL)
|
, _kiteGrid (NULL)
|
||||||
, _negociateWindow (NULL)
|
, _negociateWindow (NULL)
|
||||||
|
|
|
@ -161,7 +161,7 @@ int main ( int argc, char *argv[] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Kite::Configuration::getDefault()->setEdgeCapacityPercent ( edgeCapacity );
|
//Kite::Configuration::getDefault()->setEdgeCapacityPercent ( edgeCapacity );
|
||||||
|
|
||||||
cell->flattenNets ( not arguments.count("global") );
|
cell->flattenNets ( not arguments.count("global") );
|
||||||
|
|
||||||
|
|
|
@ -59,12 +59,11 @@ namespace Kite {
|
||||||
, LongGlobalRipupLimit=4
|
, LongGlobalRipupLimit=4
|
||||||
, RipupLimitsTableSize=5
|
, RipupLimitsTableSize=5
|
||||||
};
|
};
|
||||||
public:
|
|
||||||
static Configuration* getDefault ();
|
|
||||||
public:
|
public:
|
||||||
// Constructor & Destructor.
|
// Constructor & Destructor.
|
||||||
virtual Configuration* clone () const;
|
virtual Configuration* clone () const;
|
||||||
virtual Configuration* clone ( KiteEngine* kite ) const;
|
virtual Configuration* clone ( KiteEngine* kite ) const;
|
||||||
|
Configuration ( Katabatic::Configuration* );
|
||||||
~Configuration ();
|
~Configuration ();
|
||||||
// Decorateds.
|
// Decorateds.
|
||||||
virtual bool isGMetal ( const Layer* ) const;
|
virtual bool isGMetal ( const Layer* ) const;
|
||||||
|
@ -99,12 +98,7 @@ namespace Kite {
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
virtual string _getString () const;
|
virtual string _getString () const;
|
||||||
virtual string _getTypeName () const;
|
virtual string _getTypeName () const;
|
||||||
|
|
||||||
protected:
|
|
||||||
Configuration ( Katabatic::Configuration* );
|
|
||||||
private:
|
private:
|
||||||
// Static Attributes.
|
|
||||||
static Configuration* _default;
|
|
||||||
// Attributes.
|
// Attributes.
|
||||||
Katabatic::Configuration* _base;
|
Katabatic::Configuration* _base;
|
||||||
PostEventCb_t _postEventCb;
|
PostEventCb_t _postEventCb;
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul Chaput |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Header : "./ConfigurationWidget.h" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CONFIGURATION_WIDGET__
|
|
||||||
#define __CONFIGURATION_WIDGET__
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
class QLineEdit;
|
|
||||||
class QSpinBox;
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
class Configuration;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Kite::ConfigurationWidget".
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationWidget : public QWidget {
|
|
||||||
Q_OBJECT;
|
|
||||||
public:
|
|
||||||
ConfigurationWidget ( QWidget* parent=NULL );
|
|
||||||
public slots:
|
|
||||||
void setConfiguration ( Configuration* );
|
|
||||||
void _applySettings ();
|
|
||||||
void _updateSaturateRatio ();
|
|
||||||
void _updateGlobalThreshold ();
|
|
||||||
void _updateEdgeCapacity ();
|
|
||||||
void _updateExpandStep ();
|
|
||||||
void _updateEventsLimit ();
|
|
||||||
void _updateRipupCost (int);
|
|
||||||
void _updateBorderRipupLimit (int);
|
|
||||||
void _updateStrapRipupLimit (int);
|
|
||||||
void _updateLocalRipupLimit (int);
|
|
||||||
void _updateGlobalRipupLimit (int);
|
|
||||||
void _updateLongGlobalRipupLimit(int);
|
|
||||||
private:
|
|
||||||
Configuration* _configuration;
|
|
||||||
QLineEdit* _saturateRatioEdit;
|
|
||||||
QLineEdit* _globalThresholdEdit;
|
|
||||||
QLineEdit* _edgeCapacityEdit;
|
|
||||||
QLineEdit* _expandStepEdit;
|
|
||||||
QLineEdit* _eventsLimitEdit;
|
|
||||||
QSpinBox* _ripupCostSb;
|
|
||||||
QSpinBox* _borderRipupLimitSb;
|
|
||||||
QSpinBox* _strapRipupLimitSb;
|
|
||||||
QSpinBox* _localRipupLimitSb;
|
|
||||||
QSpinBox* _globalRipupLimitSb;
|
|
||||||
QSpinBox* _longGlobalRipupLimitSb;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __CONFIGURATION_WIDGET__
|
|
Loading…
Reference in New Issue