* All Tools:

- New: Added FreeBSD/Ubuntu patches from Otacilio De Araujo
       (<otaciliodearaujo@gmail.com>).

  * ./hurricane:
    - Change: In CellViewer, one unificated method to lauch Python
        scripts whatever they are Stratus or not.
    - Change: In ScriptWidget, the function lauched is now
        "ScriptMain()".
    - New: In PyCellViewer, add the refresh method.
This commit is contained in:
Jean-Paul Chaput 2012-12-03 08:26:28 +00:00
parent 7026761a2b
commit 1334caad6d
10 changed files with 37 additions and 19 deletions

View File

@ -23,6 +23,7 @@
find_package(PythonLibs REQUIRED) find_package(PythonLibs REQUIRED)
find_package(PythonSitePackages REQUIRED) find_package(PythonSitePackages REQUIRED)
find_package(VLSISAPD REQUIRED) find_package(VLSISAPD REQUIRED)
find_package(Libexecinfo REQUIRED)
if(BUILD_DOC) if(BUILD_DOC)
find_package(Doxygen) find_package(Doxygen)
endif(BUILD_DOC) endif(BUILD_DOC)

View File

@ -76,7 +76,7 @@ namespace Hurricane {
size_t depth = backtrace ( rawStack, _stackSize ); size_t depth = backtrace ( rawStack, _stackSize );
char** symbols = backtrace_symbols ( rawStack, depth ); char** symbols = backtrace_symbols ( rawStack, depth );
#ifdef __linux__ #if (defined __linux__ || defined __FreeBSD__)
boost::regex re ( "([^/]+)\\(([^+]+)\\+" ); boost::regex re ( "([^/]+)\\(([^+]+)\\+" );
boost::cmatch match; boost::cmatch match;
@ -116,7 +116,7 @@ namespace Hurricane {
} }
} }
# else # else
_stack.push_back ( "Backtrace only supported under Linux & OSX." ); _stack.push_back ( "Backtrace only supported under FreeBSD, Linux and OSX." );
# endif # endif
#endif #endif
} }

View File

@ -95,6 +95,7 @@
#include "hurricane/isobar/PyOccurrenceCollection.h" #include "hurricane/isobar/PyOccurrenceCollection.h"
#include "hurricane/isobar/PyTechnology.h" #include "hurricane/isobar/PyTechnology.h"
#include "hurricane/NetExternalComponents.h" #include "hurricane/NetExternalComponents.h"
#include <stddef.h>
namespace Isobar { namespace Isobar {

View File

@ -41,7 +41,7 @@
#include "hurricane/viewer/MousePositionWidget.h" #include "hurricane/viewer/MousePositionWidget.h"
#include "hurricane/viewer/ControllerWidget.h" #include "hurricane/viewer/ControllerWidget.h"
#include "hurricane/viewer/ScriptWidget.h" #include "hurricane/viewer/ScriptWidget.h"
#include "hurricane/viewer/StratusWidget.h" //#include "hurricane/viewer/StratusWidget.h"
#include "hurricane/viewer/GotoWidget.h" #include "hurricane/viewer/GotoWidget.h"
#include "hurricane/viewer/SelectCommand.h" #include "hurricane/viewer/SelectCommand.h"
@ -212,17 +212,17 @@ namespace Hurricane {
_controllerAction->setIcon ( QIcon(":/images/swiss-knife.png") ); _controllerAction->setIcon ( QIcon(":/images/swiss-knife.png") );
_controllerAction->setShortcut ( QKeySequence(tr("CTRL+I")) ); _controllerAction->setShortcut ( QKeySequence(tr("CTRL+I")) );
_scriptAction = new QAction ( tr("Script"), this ); _scriptAction = new QAction ( tr("Python Script"), this );
_scriptAction->setObjectName ( "viewer.menuBar.tools.script" ); _scriptAction->setObjectName ( "viewer.menuBar.tools.script" );
_scriptAction->setStatusTip ( tr("Run Python Script") ); _scriptAction->setStatusTip ( tr("Run Python Script. Must provide a ScripMain(cell) function") );
_scriptAction->setIcon ( QIcon(":/images/python-logo-v3.png") ); _scriptAction->setIcon ( QIcon(":/images/python-logo-v3.png") );
_scriptAction->setShortcut ( QKeySequence(tr("SHIFT+P,SHIFT+P")) ); _scriptAction->setShortcut ( QKeySequence(tr("SHIFT+P,SHIFT+S")) );
_stratusAction = new QAction ( tr("Stratus"), this ); //_stratusAction = new QAction ( tr("Stratus"), this );
_stratusAction->setObjectName ( "viewer.menuBar.tools.stratusScript" ); //_stratusAction->setObjectName ( "viewer.menuBar.tools.stratusScript" );
_stratusAction->setStatusTip ( tr("Run Stratus Script") ); //_stratusAction->setStatusTip ( tr("Run Stratus Script") );
_stratusAction->setIcon ( QIcon(":/images/stratus-cloud.png") ); //_stratusAction->setIcon ( QIcon(":/images/stratus-cloud.png") );
_stratusAction->setShortcut ( QKeySequence(tr("SHIFT+P,SHIFT+S")) ); //_stratusAction->setShortcut ( QKeySequence(tr("SHIFT+P,SHIFT+S")) );
} }
@ -266,7 +266,7 @@ namespace Hurricane {
_toolsMenu->setObjectName ( "viewer.menuBar.tools" ); _toolsMenu->setObjectName ( "viewer.menuBar.tools" );
_toolsMenu->addAction ( _controllerAction ); _toolsMenu->addAction ( _controllerAction );
_toolsMenu->addAction ( _scriptAction ); _toolsMenu->addAction ( _scriptAction );
_toolsMenu->addAction ( _stratusAction ); //_toolsMenu->addAction ( _stratusAction );
} }
@ -325,7 +325,7 @@ namespace Hurricane {
connect ( _clearRulersAction , SIGNAL(triggered()) , _cellWidget, SLOT(clearRulers()) ); connect ( _clearRulersAction , SIGNAL(triggered()) , _cellWidget, SLOT(clearRulers()) );
connect ( _controllerAction , SIGNAL(triggered()) , _controller, SLOT(toggleShow()) ); connect ( _controllerAction , SIGNAL(triggered()) , _controller, SLOT(toggleShow()) );
connect ( _scriptAction , SIGNAL(triggered()) , this , SLOT(runScript()) ); connect ( _scriptAction , SIGNAL(triggered()) , this , SLOT(runScript()) );
connect ( _stratusAction , SIGNAL(triggered()) , this , SLOT(runStratusScript()) ); //connect ( _stratusAction , SIGNAL(triggered()) , this , SLOT(runStratusScript()) );
connect ( _gotoAction , SIGNAL(triggered()) , this , SLOT(doGoto()) ); connect ( _gotoAction , SIGNAL(triggered()) , this , SLOT(doGoto()) );
connect ( _cellWidget , SIGNAL(dbuModeChanged(unsigned int,DbU::UnitPower)) connect ( _cellWidget , SIGNAL(dbuModeChanged(unsigned int,DbU::UnitPower))
@ -594,8 +594,8 @@ namespace Hurricane {
{ ScriptWidget::runScript ( this, getCell() ); } { ScriptWidget::runScript ( this, getCell() ); }
void CellViewer::runStratusScript () //void CellViewer::runStratusScript ()
{ StratusWidget::runScript ( this ); } //{ StratusWidget::runScript ( this ); }
string CellViewer::_getString () const string CellViewer::_getString () const

View File

@ -1974,7 +1974,7 @@ namespace Hurricane {
{ {
Point center = _visibleArea.getCenter(); Point center = _visibleArea.getCenter();
cerr << "center: " << center << " + scale:" << scale << endl; //cerr << "center: " << center << " + scale:" << scale << endl;
return Box ( (DbU::Unit)( center.getX() - width () / (scale*2) ) return Box ( (DbU::Unit)( center.getX() - width () / (scale*2) )
, (DbU::Unit)( center.getY() - height() / (scale*2) ) , (DbU::Unit)( center.getY() - height() / (scale*2) )

View File

@ -153,6 +153,19 @@ extern "C" {
} }
static PyObject* PyCellViewer_refresh ( PyCellViewer* self )
{
trace << "PyCellViewer_refresh()" << endl;
HTRY
METHOD_HEAD("CellViewer.refresh()")
cw->getCellWidget()->refresh();
HCATCH
Py_RETURN_NONE;
}
// --------------------------------------------------------------- // ---------------------------------------------------------------
// PyCellViewer Attribute Method table. // PyCellViewer Attribute Method table.
@ -168,6 +181,8 @@ extern "C" {
, { "setLayerVisible" , (PyCFunction)PyCellViewer_setLayerVisible , METH_VARARGS , { "setLayerVisible" , (PyCFunction)PyCellViewer_setLayerVisible , METH_VARARGS
, "Sets the visibility state of the layer <name>." } , "Sets the visibility state of the layer <name>." }
, { "fit" , (PyCFunction)PyCellViewer_fit , METH_NOARGS , { "fit" , (PyCFunction)PyCellViewer_fit , METH_NOARGS
, "Triggers a full redraw of the visible area." }
, { "refresh" , (PyCFunction)PyCellViewer_refresh , METH_NOARGS
, "Fit the contents to the viewer's visible area." } , "Fit the contents to the viewer's visible area." }
, { "destroy" , (PyCFunction)PyCellViewer_destroy , METH_NOARGS , { "destroy" , (PyCFunction)PyCellViewer_destroy , METH_NOARGS
, "Destroy the associated hurricane object. The python object remains." } , "Destroy the associated hurricane object. The python object remains." }

View File

@ -131,7 +131,7 @@ namespace Hurricane {
dbo_ptr<Isobar::Script> script = Isobar::Script::create(userScript.leaf()); dbo_ptr<Isobar::Script> script = Isobar::Script::create(userScript.leaf());
script->setEditor ( qobject_cast<CellViewer*>(parent) ); script->setEditor ( qobject_cast<CellViewer*>(parent) );
bool returnCode = script->runFunction ( "__hurricane_main__", cell ); bool returnCode = script->runFunction ( "ScriptMain", cell );
Isobar::Script::removePath ( userDirectory.string() ); Isobar::Script::removePath ( userDirectory.string() );

View File

@ -227,6 +227,7 @@ namespace Hurricane {
{ {
if ( event->key() == Qt::Key_N ) { if ( event->key() == Qt::Key_N ) {
event->accept(); event->accept();
cerr << "_selectMode:" << _selectMode << endl;
_selectMode = (++_selectMode) % 3; _selectMode = (++_selectMode) % 3;
} }
} }

View File

@ -91,7 +91,7 @@ namespace Hurricane {
void raiseToolInterrupt (); void raiseToolInterrupt ();
void clearToolInterrupt (); void clearToolInterrupt ();
void runScript (); void runScript ();
void runStratusScript (); //void runStratusScript ();
signals: signals:
void showSelectionToggled ( bool ); void showSelectionToggled ( bool );
void stateChanged ( shared_ptr<CellWidget::State>& ); void stateChanged ( shared_ptr<CellWidget::State>& );

View File

@ -1,4 +1,4 @@
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane ) include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane )
add_executable ( htest HTest.cpp ) add_executable ( htest HTest.cpp )
target_link_libraries ( htest hurricane ${Boost_LIBRARIES} ) target_link_libraries ( htest hurricane ${Boost_LIBRARIES} ${LIBEXECINFO_LIBRARIES} )