* ./hurricane/src/hurricane:
- New: In Query, adds an accessor to get the current path. - Bug: In NetExternalComponents, every component of an external net was considered as an external one. Now only truly external components are considered. * ./hurricane/src/isobar: - New: StratusScript, dedicated Stratus script laucher. - Bug: In CellWidget, when drawing selecteds Gos, the loop variable was not reset between loops resulting in incomplete display. * ./hurricane/src/isobar: - New: In PyHorizontal & PyVertical, adds mutator methods.
This commit is contained in:
parent
6f7f8fb49a
commit
b90b40f656
|
@ -189,20 +189,21 @@ void Cell::setAbutmentBox(const Box& abutmentBox)
|
|||
void Cell::flattenNets(bool buildRings)
|
||||
// ************************************
|
||||
{
|
||||
UpdateSession::open();
|
||||
UpdateSession::open();
|
||||
|
||||
for_each_occurrence ( occurrence, getHyperNetRootNetOccurrences() ) {
|
||||
HyperNet hyperNet ( occurrence );
|
||||
if ( !occurrence.getPath().isEmpty() ) {
|
||||
forEach ( Occurrence, ioccurrence, getHyperNetRootNetOccurrences() ) {
|
||||
Net* net = static_cast<Net*>((*ioccurrence).getEntity());
|
||||
|
||||
HyperNet hyperNet ( *ioccurrence );
|
||||
if ( not (*ioccurrence).getPath().isEmpty() ) {
|
||||
DeepNet* deepNet = DeepNet::create ( hyperNet );
|
||||
if (deepNet) deepNet->_createRoutingPads ( buildRings );
|
||||
} else {
|
||||
RoutingPad* previousRP = NULL;
|
||||
RoutingPad* currentRP = NULL;
|
||||
Net* net = static_cast<Net*>(occurrence.getEntity());
|
||||
|
||||
for_each_component ( component, net->getComponents() ) {
|
||||
Plug* primaryPlug = dynamic_cast<Plug*>( component );
|
||||
forEach ( Component*, icomponent, net->getComponents() ) {
|
||||
Plug* primaryPlug = dynamic_cast<Plug*>( *icomponent );
|
||||
if ( primaryPlug ) {
|
||||
if ( !primaryPlug->getBodyHook()->getSlaveHooks().isEmpty() ) {
|
||||
cerr << "[ERROR] " << primaryPlug << "\n"
|
||||
|
@ -211,29 +212,26 @@ void Cell::flattenNets(bool buildRings)
|
|||
primaryPlug->getBodyHook()->detach ();
|
||||
}
|
||||
}
|
||||
end_for
|
||||
}
|
||||
|
||||
for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
||||
currentRP = createRoutingPad ( net, plugOccurrence );
|
||||
forEach ( Occurrence, iplugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
||||
currentRP = createRoutingPad ( net, *iplugOccurrence );
|
||||
currentRP->materialize ();
|
||||
if ( buildRings ) {
|
||||
if ( previousRP ) {
|
||||
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||
}
|
||||
Plug* plug = static_cast<Plug*>( plugOccurrence.getEntity() );
|
||||
if ( plugOccurrence.getPath().isEmpty() ) {
|
||||
Plug* plug = static_cast<Plug*>( (*iplugOccurrence).getEntity() );
|
||||
if ( (*iplugOccurrence).getPath().isEmpty() ) {
|
||||
plug->getBodyHook()->attach ( currentRP->getBodyHook() );
|
||||
plug->getBodyHook()->detach ();
|
||||
}
|
||||
previousRP = currentRP;
|
||||
}
|
||||
|
||||
end_for
|
||||
}
|
||||
|
||||
for_each_component ( component, net->getComponents() ) {
|
||||
Pin* pin = dynamic_cast<Pin*>( component );
|
||||
forEach ( Component*, icomponent, net->getComponents() ) {
|
||||
Pin* pin = dynamic_cast<Pin*>( *icomponent );
|
||||
if ( pin ) {
|
||||
currentRP = createRoutingPad ( pin );
|
||||
if ( buildRings ) {
|
||||
|
@ -245,11 +243,8 @@ void Cell::flattenNets(bool buildRings)
|
|||
}
|
||||
previousRP = currentRP;
|
||||
}
|
||||
|
||||
end_for
|
||||
}
|
||||
}
|
||||
end_for
|
||||
}
|
||||
|
||||
UpdateSession::close();
|
||||
|
|
|
@ -356,6 +356,7 @@ bool isHyperNetRootNetOccurrence(Occurrence netoccurrence)
|
|||
{
|
||||
Net* net=dynamic_cast<Net*>(netoccurrence.getEntity());
|
||||
if (!net) return false;
|
||||
if (net->isAutomatic() ) return false;
|
||||
if (!net->isExternal()) return true;
|
||||
if (netoccurrence.getPath().isEmpty()) return true;
|
||||
if (net->isGlobal()) return false;
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Hurricane {
|
|||
Net* net = component->getNet();
|
||||
if (!net->isExternal()) return false;
|
||||
|
||||
return getRelation(net) != NULL;
|
||||
return component->getProperty(_name) != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
|
||||
#include "hurricane/BasicLayer.h"
|
||||
#include "hurricane/Slice.h"
|
||||
|
@ -60,12 +60,12 @@ namespace Hurricane {
|
|||
|
||||
QueryStack::QueryStack ()
|
||||
: vector<QueryState*>()
|
||||
//, _tab(" ")
|
||||
, _topCell(NULL)
|
||||
, _topArea()
|
||||
, _topTransformation()
|
||||
, _startLevel(0)
|
||||
, _stopLevel(UINT_MAX)
|
||||
//, _tab (" ")
|
||||
, _topCell (NULL)
|
||||
, _topArea ()
|
||||
, _topTransformation ()
|
||||
, _startLevel (0)
|
||||
, _stopLevel (std::numeric_limits<unsigned int>::max())
|
||||
{ }
|
||||
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ namespace Hurricane {
|
|||
inline QueryState ( Locator<Instance*>* locator
|
||||
, const Box& area
|
||||
, const Transformation& transformation
|
||||
, const Path& path
|
||||
);
|
||||
QueryState ( const QueryState& );
|
||||
QueryState& operator= ( const QueryState& );
|
||||
|
@ -77,6 +78,7 @@ namespace Hurricane {
|
|||
Locator<Instance*>* _locator;
|
||||
Box _area;
|
||||
Transformation _transformation;
|
||||
Path _path;
|
||||
|
||||
friend class QueryStack;
|
||||
};
|
||||
|
@ -86,19 +88,22 @@ namespace Hurricane {
|
|||
|
||||
|
||||
inline QueryState::QueryState ( Locator<Instance*>* locator )
|
||||
: _locator(locator)
|
||||
, _area()
|
||||
: _locator (locator)
|
||||
, _area ()
|
||||
, _transformation()
|
||||
, _path ()
|
||||
{ }
|
||||
|
||||
|
||||
inline QueryState::QueryState ( Locator<Instance*>* locator
|
||||
, const Box& area
|
||||
, const Transformation& transformation
|
||||
, const Path& path
|
||||
)
|
||||
: _locator(locator)
|
||||
, _area(area)
|
||||
: _locator (locator)
|
||||
, _area (area)
|
||||
, _transformation(transformation)
|
||||
, _path (path)
|
||||
{ }
|
||||
|
||||
|
||||
|
@ -127,6 +132,7 @@ namespace Hurricane {
|
|||
inline Instance* getInstance ();
|
||||
inline const Box& getArea () const;
|
||||
inline const Transformation& getTransformation () const;
|
||||
inline const Path& getPath () const;
|
||||
//inline const Tabulation& getTab () const;
|
||||
// Modifiers.
|
||||
inline void setTopCell ( Cell* cell );
|
||||
|
@ -168,6 +174,7 @@ namespace Hurricane {
|
|||
inline unsigned int QueryStack::getStopLevel () const { return _stopLevel; }
|
||||
inline const Box& QueryStack::getArea () const { return back()->_area; }
|
||||
inline const Transformation& QueryStack::getTransformation () const { return back()->_transformation; }
|
||||
inline const Path& QueryStack::getPath () const { return back()->_path; }
|
||||
//inline const Tabulation& QueryStack::getTab () const { return _tab; }
|
||||
|
||||
|
||||
|
@ -197,7 +204,7 @@ namespace Hurricane {
|
|||
{
|
||||
while ( !empty() ) levelUp();
|
||||
|
||||
push_back ( new QueryState(NULL,_topArea,_topTransformation) );
|
||||
push_back ( new QueryState(NULL,_topArea,_topTransformation,Path()) );
|
||||
//_tab++;
|
||||
|
||||
progress ( true );
|
||||
|
@ -215,6 +222,8 @@ namespace Hurricane {
|
|||
|
||||
instance->getTransformation().getInvert().applyOn ( child->_area );
|
||||
parent->_transformation.applyOn ( child->_transformation );
|
||||
|
||||
child->_path = Path ( parent->_path, instance );
|
||||
}
|
||||
|
||||
|
||||
|
@ -321,6 +330,7 @@ namespace Hurricane {
|
|||
inline const BasicLayer* getBasicLayer () const;
|
||||
inline Cell* getMasterCell ();
|
||||
inline Instance* getInstance ();
|
||||
inline Path getPath () const;
|
||||
//inline const Tabulation& getTab () const;
|
||||
virtual bool hasGoCallback () const;
|
||||
virtual bool hasMarkerCallback () const;
|
||||
|
@ -374,6 +384,7 @@ namespace Hurricane {
|
|||
inline size_t Query::getDepth () const { return _stack.size(); }
|
||||
inline const Box& Query::getArea () const { return _stack.getArea(); }
|
||||
inline const Transformation& Query::getTransformation () const { return _stack.getTransformation(); }
|
||||
inline Path Query::getPath () const { return _stack.getPath(); }
|
||||
inline const BasicLayer* Query::getBasicLayer () const { return _basicLayer; }
|
||||
inline Cell* Query::getMasterCell () { return _stack.getMasterCell(); }
|
||||
inline Instance* Query::getInstance () { return _stack.getInstance(); }
|
||||
|
|
|
@ -48,6 +48,13 @@ extern "C" {
|
|||
// x-------------------------------------------------------------x
|
||||
|
||||
|
||||
DirectGetLongAttribute(PyHorizontal_getY ,getY ,PyHorizontal,Horizontal)
|
||||
DirectGetLongAttribute(PyHorizontal_getDxSource,getDxSource,PyHorizontal,Horizontal)
|
||||
DirectGetLongAttribute(PyHorizontal_getDxTarget,getDxTarget,PyHorizontal,Horizontal)
|
||||
DirectSetLongAttribute(PyHorizontal_setY ,setY ,"Horizontal.setY",PyHorizontal,Horizontal)
|
||||
DirectSetLongAttribute(PyHorizontal_setDxSource,setDxSource,"Horizontal.setDxSource",PyHorizontal,Horizontal)
|
||||
DirectSetLongAttribute(PyHorizontal_setDxTarget,setDxTarget,"Horizontal.setDxTarget",PyHorizontal,Horizontal)
|
||||
|
||||
// Standart destroy (Attribute).
|
||||
DBoDestroyAttribute(PyHorizontal_destroy, PyHorizontal)
|
||||
|
||||
|
@ -56,8 +63,14 @@ extern "C" {
|
|||
// PyHorizontal Attribute Method table.
|
||||
|
||||
PyMethodDef PyHorizontal_Methods[] =
|
||||
{ { "destroy" , (PyCFunction)PyHorizontal_destroy , METH_NOARGS
|
||||
, "destroy associated hurricane object, the python object remains." }
|
||||
{ { "getY" , (PyCFunction)PyHorizontal_getY , METH_NOARGS , "Get the segment Y position." }
|
||||
, { "getDxSource", (PyCFunction)PyHorizontal_getDxSource, METH_NOARGS , "Get the segment source X offset." }
|
||||
, { "getDxTarget", (PyCFunction)PyHorizontal_getDxTarget, METH_NOARGS , "Get the segment target X offset." }
|
||||
, { "setY" , (PyCFunction)PyHorizontal_setY , METH_VARARGS, "Modify the segment Y position." }
|
||||
, { "setDxSource", (PyCFunction)PyHorizontal_setDxSource, METH_VARARGS, "Modify the segment source X offset." }
|
||||
, { "setDxTarget", (PyCFunction)PyHorizontal_setDxTarget, METH_VARARGS, "Modify the segment target X offset." }
|
||||
, { "destroy" , (PyCFunction)PyHorizontal_destroy , METH_NOARGS
|
||||
, "destroy associated hurricane object, the python object remains." }
|
||||
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ extern "C" {
|
|||
// Standard Accessors (Attributes).
|
||||
DirectGetLongAttribute(PySegment_getSourceX,getSourceX,PySegment,Segment)
|
||||
DirectGetLongAttribute(PySegment_getSourceY,getSourceY,PySegment,Segment)
|
||||
DirectGetLongAttribute(PySegment_getWidth ,getWidth, PySegment,Segment)
|
||||
DirectGetLongAttribute(PySegment_getWidth ,getWidth ,PySegment,Segment)
|
||||
DirectSetLongAttribute(PySegment_setWidth ,setWidth ,"Segment.setWidth",PySegment,Segment)
|
||||
|
||||
// Standard Destroy (Attribute).
|
||||
DBoDestroyAttribute(PySegment_destroy, PySegment)
|
||||
|
@ -112,6 +113,7 @@ extern "C" {
|
|||
, { "getSourcePosition" , (PyCFunction)PySegment_getSourcePosition, METH_NOARGS , "Return the Segment source point value." }
|
||||
, { "getTargetPosition" , (PyCFunction)PySegment_getTargetPosition, METH_NOARGS , "Return the Segment target point value." }
|
||||
, { "getWidth" , (PyCFunction)PySegment_getWidth , METH_NOARGS , "Return the segment width." }
|
||||
, { "setWidth" , (PyCFunction)PySegment_setWidth , METH_VARARGS, "Modify the Segment width." }
|
||||
, { "destroy" , (PyCFunction)PySegment_destroy , METH_NOARGS
|
||||
, "Destroy associated hurricane object, the python object remains." }
|
||||
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||
|
|
|
@ -45,6 +45,13 @@ extern "C" {
|
|||
// x-------------------------------------------------------------x
|
||||
|
||||
|
||||
DirectGetLongAttribute(PyVertical_getX ,getX ,PyVertical,Vertical)
|
||||
DirectGetLongAttribute(PyVertical_getDySource,getDySource,PyVertical,Vertical)
|
||||
DirectGetLongAttribute(PyVertical_getDyTarget,getDyTarget,PyVertical,Vertical)
|
||||
DirectSetLongAttribute(PyVertical_setX,setX,"Vertical.setX",PyVertical,Vertical)
|
||||
DirectSetLongAttribute(PyVertical_setDySource,setDySource,"Vertical.setDySource",PyVertical,Vertical)
|
||||
DirectSetLongAttribute(PyVertical_setDyTarget,setDyTarget,"Vertical.setDyTarget",PyVertical,Vertical)
|
||||
|
||||
// Standard destroy (Attribute).
|
||||
DBoDestroyAttribute(PyVertical_destroy, PyVertical)
|
||||
|
||||
|
@ -74,9 +81,15 @@ extern "C" {
|
|||
// PyVertical Attribute Method table.
|
||||
|
||||
PyMethodDef PyVertical_Methods[] =
|
||||
{ { "destroy" , (PyCFunction)PyVertical_destroy , METH_NOARGS
|
||||
, "Destroy associated hurricane object, the python object remains." }
|
||||
, { "translate" , (PyCFunction)PyVertical_translate , METH_VARARGS, "Translates the Vertical segment of dx and dy." }
|
||||
{ { "getX" , (PyCFunction)PyVertical_getX , METH_NOARGS , "Get the segment X position." }
|
||||
, { "getDySource", (PyCFunction)PyVertical_getDySource, METH_NOARGS , "Get the segment source Y offset." }
|
||||
, { "getDyTarget", (PyCFunction)PyVertical_getDyTarget, METH_NOARGS , "Get the segment target Y offset." }
|
||||
, { "setX" , (PyCFunction)PyVertical_setX , METH_VARARGS, "Modify the segment X position." }
|
||||
, { "setDySource", (PyCFunction)PyVertical_setDySource, METH_VARARGS, "Modify the segment source Y offset." }
|
||||
, { "setDyTarget", (PyCFunction)PyVertical_setDyTarget, METH_VARARGS, "Modify the segment target Y offset." }
|
||||
, { "translate" , (PyCFunction)PyVertical_translate , METH_VARARGS, "Translates the Vertical segment of dx and dy." }
|
||||
, { "destroy" , (PyCFunction)PyVertical_destroy , METH_NOARGS
|
||||
, "Destroy associated hurricane object, the python object remains." }
|
||||
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
hurricane/viewer/HierarchyCommand.h
|
||||
hurricane/viewer/SelectorCriterion.h
|
||||
hurricane/viewer/CellWidgets.h
|
||||
hurricane/viewer/StratusScript.h
|
||||
)
|
||||
set ( pyincludes hurricane/viewer/PyCellViewer.h
|
||||
)
|
||||
|
@ -95,6 +96,7 @@
|
|||
DisplayFilterWidget.cpp
|
||||
ControllerWidget.cpp
|
||||
ScriptWidget.cpp
|
||||
StratusScript.cpp
|
||||
StratusWidget.cpp
|
||||
)
|
||||
set ( pycpps PyViewer.cpp
|
||||
|
|
|
@ -1015,8 +1015,8 @@ namespace Hurricane {
|
|||
|
||||
bool CellWidget::SelectorCriterions::add ( const Net* net )
|
||||
{
|
||||
if ( !_cellWidget ) return false;
|
||||
if ( !_cellWidget->isSelected(Occurrence(net)) ) {
|
||||
if ( _cellWidget == NULL ) return false;
|
||||
if ( not _cellWidget->isSelected(Occurrence(net)) ) {
|
||||
_criterions.push_back ( new NetSelectorCriterion(net) );
|
||||
_criterions.back()->doSelection ( _cellWidget );
|
||||
return true;
|
||||
|
@ -1027,7 +1027,7 @@ namespace Hurricane {
|
|||
|
||||
bool CellWidget::SelectorCriterions::add ( Box area )
|
||||
{
|
||||
if ( !_cellWidget ) return false;
|
||||
if ( _cellWidget == NULL ) return false;
|
||||
_criterions.push_back ( new AreaSelectorCriterion(area) );
|
||||
_criterions.back()->doSelection ( _cellWidget );
|
||||
return true;
|
||||
|
@ -1036,8 +1036,8 @@ namespace Hurricane {
|
|||
|
||||
bool CellWidget::SelectorCriterions::remove ( const Net* net )
|
||||
{
|
||||
if ( !_cellWidget ) return false;
|
||||
if ( !_cellWidget->isSelected(Occurrence(net)) ) return false;
|
||||
if ( _cellWidget == NULL ) return false;
|
||||
if ( not _cellWidget->isSelected(Occurrence(net)) ) return false;
|
||||
|
||||
size_t i=0;
|
||||
for ( ; i<_criterions.size() ; i++ )
|
||||
|
@ -1065,7 +1065,7 @@ namespace Hurricane {
|
|||
|
||||
void CellWidget::SelectorCriterions::revalidate ()
|
||||
{
|
||||
if ( !_cellWidget ) return;
|
||||
if ( _cellWidget == NULL ) return;
|
||||
|
||||
size_t i = 0;
|
||||
size_t last = _criterions.size ();
|
||||
|
@ -1524,9 +1524,9 @@ namespace Hurricane {
|
|||
Occurrence occurrence = (*iselector)->getOccurrence();
|
||||
Component* component = dynamic_cast<Component*>(occurrence.getEntity());
|
||||
|
||||
if ( !component ) break;
|
||||
if ( !component->getLayer() ) continue;
|
||||
if ( !component->getLayer()->contains(*basicLayer) ) continue;
|
||||
if ( component == NULL ) continue;
|
||||
if ( not component->getLayer() ) continue;
|
||||
if ( not component->getLayer()->contains(*basicLayer) ) continue;
|
||||
|
||||
Transformation transformation = occurrence.getPath().getTransformation();
|
||||
_drawingQuery.drawGo ( dynamic_cast<Go*>(occurrence.getEntity())
|
||||
|
@ -1540,6 +1540,7 @@ namespace Hurricane {
|
|||
_drawingPlanes.setPen ( Graphics::getPen ("boundaries") );
|
||||
_drawingPlanes.setBrush ( Graphics::getBrush("boundaries") );
|
||||
|
||||
iselector = _selectors.begin();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
Occurrence occurrence = (*iselector)->getOccurrence();
|
||||
Instance* instance = dynamic_cast<Instance*>(occurrence.getEntity());
|
||||
|
@ -1553,22 +1554,25 @@ namespace Hurricane {
|
|||
_drawingPlanes.setPen ( Graphics::getPen ("rubber") );
|
||||
_drawingPlanes.setBrush ( Graphics::getBrush("rubber") );
|
||||
|
||||
iselector = _selectors.begin();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
Occurrence occurrence = (*iselector)->getOccurrence();
|
||||
Rubber* rubber = dynamic_cast<Rubber*>(occurrence.getEntity());
|
||||
|
||||
if ( !rubber ) break;
|
||||
if ( rubber == NULL ) continue;
|
||||
|
||||
Transformation transformation = occurrence.getPath().getTransformation();
|
||||
_drawingQuery.drawRubber ( rubber, redrawBox, transformation );
|
||||
}
|
||||
|
||||
Name extensionName = "";
|
||||
|
||||
iselector = _selectors.begin();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
Occurrence occurrence = (*iselector)->getOccurrence();
|
||||
ExtensionGo* eGo = dynamic_cast<ExtensionGo*>(occurrence.getEntity());
|
||||
|
||||
if ( !eGo ) break;
|
||||
if ( eGo == NULL ) continue;
|
||||
|
||||
Transformation transformation = occurrence.getPath().getTransformation();
|
||||
if ( eGo->getName() != extensionName ) {
|
||||
|
@ -2802,8 +2806,8 @@ namespace Hurricane {
|
|||
Occurrence occurrence ( *component );
|
||||
select ( occurrence );
|
||||
}
|
||||
forEach ( Rubber*, rubber, net->getRubbers() ) {
|
||||
Occurrence occurrence ( *rubber );
|
||||
forEach ( Rubber*, irubber, net->getRubbers() ) {
|
||||
Occurrence occurrence ( *irubber );
|
||||
select ( occurrence );
|
||||
}
|
||||
if ( _state->showSelection() ) _redrawManager.refresh ();
|
||||
|
|
|
@ -66,8 +66,8 @@ namespace Hurricane {
|
|||
|
||||
bool NetSelectorCriterion::isValid ( CellWidget* cw ) const
|
||||
{
|
||||
if ( !cw->getCell() ) return false;
|
||||
if ( !cw->getCell()->getNet(_name) ) return false;
|
||||
if ( cw->getCell() == NULL ) return false;
|
||||
if ( not cw->getCell()->getNet(_name) ) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
|
||||
// -*- 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 |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./StratusScript.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
namespace bfs = boost::filesystem;
|
||||
|
||||
#include "hurricane/Warning.h"
|
||||
#include "hurricane/viewer/StratusScript.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "StratusScript".
|
||||
|
||||
|
||||
StratusScript::StratusScript ( const std::string& scriptName, CellViewer* editor )
|
||||
: _scriptName (scriptName)
|
||||
, _scriptDirectory()
|
||||
, _script (NULL)
|
||||
{
|
||||
bfs::path userStratus = _scriptName;
|
||||
bfs::path userDirectory = userStratus.branch_path();
|
||||
|
||||
if ( not userDirectory.is_complete() )
|
||||
userDirectory = bfs::current_path() / userDirectory;
|
||||
userDirectory.normalize();
|
||||
|
||||
_scriptDirectory = userDirectory.string();
|
||||
Isobar::Script::addPath ( _scriptDirectory );
|
||||
|
||||
_script = Isobar::Script::create ( userStratus.leaf() );
|
||||
_script->setEditor ( editor );
|
||||
}
|
||||
|
||||
|
||||
StratusScript::~StratusScript ()
|
||||
{
|
||||
Isobar::Script::removePath ( _scriptDirectory );
|
||||
_script->destroy ();
|
||||
}
|
||||
|
||||
|
||||
StratusScript* StratusScript::create ( const std::string& scriptName, CellViewer* editor )
|
||||
{
|
||||
return new StratusScript ( scriptName, editor );
|
||||
}
|
||||
|
||||
|
||||
void StratusScript::destroy ()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
bool StratusScript::run ()
|
||||
{
|
||||
return _script->runFunction ( "StratusScript", NULL, Isobar::Script::NoScriptArgs );
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
|
@ -43,6 +43,7 @@ namespace bfs = boost::filesystem;
|
|||
#include <QVBoxLayout>
|
||||
|
||||
#include "hurricane/viewer/Graphics.h"
|
||||
#include "hurricane/viewer/StratusScript.h"
|
||||
#include "hurricane/viewer/StratusWidget.h"
|
||||
#include "hurricane/viewer/CellViewer.h"
|
||||
|
||||
|
@ -95,8 +96,8 @@ namespace Hurricane {
|
|||
setLayout ( vLayout );
|
||||
//setModal ( true );
|
||||
|
||||
connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) );
|
||||
connect ( cancelButton, SIGNAL(clicked()) , this, SLOT(reject()) );
|
||||
connect ( okButton, SIGNAL(clicked()), this, SLOT(accept()) );
|
||||
connect ( cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,6 +116,12 @@ namespace Hurricane {
|
|||
delete dialog;
|
||||
if ( not doRunStratus ) return false;
|
||||
|
||||
dbo_ptr<StratusScript> script
|
||||
= StratusScript::create ( scriptName.toStdString(), qobject_cast<CellViewer*>(parent) );
|
||||
|
||||
bool returnCode = script->run ();
|
||||
|
||||
#if DEPRECATED
|
||||
if ( scriptName.endsWith(".py",Qt::CaseInsensitive) )
|
||||
scriptName.truncate ( scriptName.size()-3 );
|
||||
|
||||
|
@ -133,6 +140,7 @@ namespace Hurricane {
|
|||
bool returnCode = script->runFunction ( "StratusScript", NULL, Isobar::Script::NoScriptArgs );
|
||||
|
||||
Isobar::Script::removePath ( userDirectory.string() );
|
||||
#endif
|
||||
|
||||
return returnCode;
|
||||
}
|
||||
|
|
|
@ -908,7 +908,7 @@ namespace Hurricane {
|
|||
, _queryFilter (~Query::DoTerminalCells)
|
||||
, _startLevel (0)
|
||||
, _stopLevel (99)
|
||||
, _rubberShape (CellWidget::Steiner)
|
||||
, _rubberShape (CellWidget::Barycentric)
|
||||
, _cumulativeSelection(false)
|
||||
, _scaleHistory ()
|
||||
, _ihistory (0)
|
||||
|
|
|
@ -1,23 +1,8 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved
|
||||
//
|
||||
// This file is part of ISOBAR.
|
||||
//
|
||||
// ISOBAR is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// ISOBAR is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the Lesser GNU General Public
|
||||
// License along with ISOBAR. If not, see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
|
@ -31,7 +16,7 @@
|
|||
// | Author : Jean-Paul Chaput |
|
||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./hurricane/isobar/Script.h" |
|
||||
// | C++ Header : "./hurricane/viewer/Script.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | 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 |
|
||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./hurricane/viewer/StratusScript.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#ifndef __VIEWER_STRATUS_SCRIPT__
|
||||
#define __VIEWER_STRATUS_SCRIPT__
|
||||
|
||||
#include "hurricane/viewer/Script.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class StratusScript {
|
||||
public:
|
||||
static StratusScript* create ( const std::string& scriptName, CellViewer* editor=NULL );
|
||||
bool run ();
|
||||
void destroy ();
|
||||
private:
|
||||
std::string _scriptName;
|
||||
std::string _scriptDirectory;
|
||||
Isobar::Script* _script;
|
||||
private:
|
||||
StratusScript ( const std::string& scriptName, CellViewer* editor );
|
||||
~StratusScript ();
|
||||
};
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
#endif // __VIEWER_STRATUS_SCRIPT__
|
Loading…
Reference in New Issue