Python Script launcher extended to accomodate Chams.
* New: In VLSISAPD, in Configuration, add a new priority level UserFile to distinguish between the system configuration files and the user's configuration files (which take precedence). * New: In Hurricane, in Script (Python), improve the API to be able to support Chams (and remove the duplicate capability from it). Add separate functions to perform the initialize/run(s)/finalize cycle step by step. * Change: In CRL Core, rename real technology <hcmos9> to <hcmos9gp>, it's offcial name from CMP/ST. This is the 130nm. Move the reading of the symbolic & real technologies names from coriolisInit.py to helpers.__init__.py, to be shared with chamsInit.py. To avoid a clash of names inside of helpers, the two variables of techno.py are renamed "symbolicTechnology" and "realTechnology". Move python init system from crlcore/src/crlcore to crlcore/python. * New: In CRL Core, In Utilities, add site-packages/pharos to the PYTHONPATH. * Change: In Kite, move python init system from kite/src/init to kite/python.
This commit is contained in:
parent
c65a79b47c
commit
a7c4e8b02e
|
@ -32,6 +32,7 @@
|
||||||
find_package(Libexecinfo REQUIRED)
|
find_package(Libexecinfo REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(python)
|
||||||
add_subdirectory(etc)
|
add_subdirectory(etc)
|
||||||
add_subdirectory(cmake_modules)
|
add_subdirectory(cmake_modules)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
install ( DIRECTORY vsc200 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( DIRECTORY vsc200 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
install ( DIRECTORY scmos_deep_018 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( DIRECTORY scmos_deep_018 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
install ( DIRECTORY scn6m_deep_09 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( DIRECTORY scn6m_deep_09 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
install ( DIRECTORY hcmos9 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( DIRECTORY hcmos9gp DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
|
|
||||||
install ( FILES environment.alliance.xml DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( FILES environment.alliance.xml DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
install ( FILES technology.symbolic.xml DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
install ( FILES technology.symbolic.xml DESTINATION ${SYS_CONF_DIR}/coriolis2 )
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# -*- Mode:Python -*-
|
# -*- Mode:Python -*-
|
||||||
|
|
||||||
symbolicTechno = 'cmos'
|
symbolicTechno = 'cmos'
|
||||||
realTechno = 'hcmos9'
|
realTechno = 'hcmos9gp'
|
||||||
|
|
|
@ -86,40 +86,17 @@ def coriolisConfigure():
|
||||||
|
|
||||||
Cfg.Configuration.pushDefaultPriority ( Cfg.Parameter.Priority.ConfigurationFile )
|
Cfg.Configuration.pushDefaultPriority ( Cfg.Parameter.Priority.ConfigurationFile )
|
||||||
|
|
||||||
technoFiles = [ helpers.sysConfDir+'/techno.conf' ]
|
confFiles = [ (helpers.symbolicDir+'/alliance.conf', SystemFile|AllianceHelper)
|
||||||
if os.getenv('HOME'):
|
, (helpers.symbolicDir+'/patterns.conf', SystemFile|PatternsHelper)
|
||||||
technoFiles += [ os.getenv('HOME')+'/.coriolis2/techno.py' ]
|
, (helpers.symbolicDir+'/display.conf' , SystemFile|DisplayHelper)
|
||||||
technoFiles += [ os.getcwd()+'/.coriolis2/techno.py' ]
|
, (helpers.symbolicDir+'/misc.conf' , SystemFile|ConfigurationHelper)
|
||||||
|
, (helpers.symbolicDir+'/hMetis.conf' , SystemFile|ConfigurationHelper)
|
||||||
technoFiles.reverse()
|
, (helpers.symbolicDir+'/nimbus.conf' , SystemFile|ConfigurationHelper)
|
||||||
for technoFile in technoFiles:
|
, (helpers.symbolicDir+'/mauka.conf' , SystemFile|ConfigurationHelper)
|
||||||
if os.path.isfile(technoFile):
|
, (helpers.symbolicDir+'/etesian.conf' , SystemFile|ConfigurationHelper)
|
||||||
print ' - Loading \"%s\".' % helpers.truncPath(technoFile)
|
, (helpers.symbolicDir+'/kite.conf' , SystemFile|ConfigurationHelper)
|
||||||
execfile(technoFile,moduleGlobals)
|
, (helpers.symbolicDir+'/stratus1.conf', SystemFile|ConfigurationHelper)
|
||||||
break
|
, (helpers.symbolicDir+'/plugins.conf' , SystemFile|ConfigurationHelper)
|
||||||
if moduleGlobals.has_key('symbolicTechno'):
|
|
||||||
helpers.symbolicTechno = symbolicTechno
|
|
||||||
helpers.symbolicDir = os.path.join( helpers.sysConfDir, symbolicTechno )
|
|
||||||
else:
|
|
||||||
print '[ERROR] The symbolic technology name is not set. Using <cmos>.'
|
|
||||||
if moduleGlobals.has_key('realTechno'):
|
|
||||||
helpers.realTechno = realTechno
|
|
||||||
helpers.realDir = os.path.join( helpers.sysConfDir, realTechno )
|
|
||||||
else:
|
|
||||||
print '[ERROR] The real technology name is not set. Using <hcmos9>.'
|
|
||||||
|
|
||||||
|
|
||||||
confFiles = [ (helpers.sysConfDir+'/'+symbolicTechno+'/alliance.conf', SystemFile|AllianceHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/patterns.conf', SystemFile|PatternsHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/display.conf' , SystemFile|DisplayHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/misc.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/hMetis.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/nimbus.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/mauka.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/etesian.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/kite.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/stratus1.conf', SystemFile|ConfigurationHelper)
|
|
||||||
, (helpers.sysConfDir+'/'+symbolicTechno+'/plugins.conf' , SystemFile|ConfigurationHelper)
|
|
||||||
]
|
]
|
||||||
if os.getenv('HOME'):
|
if os.getenv('HOME'):
|
||||||
confFiles += [ (os.getenv('HOME')+'/.coriolis2/settings.py', 0) ]
|
confFiles += [ (os.getenv('HOME')+'/.coriolis2/settings.py', 0) ]
|
||||||
|
@ -136,6 +113,8 @@ def coriolisConfigure():
|
||||||
Configuration.loadCompatXml()
|
Configuration.loadCompatXml()
|
||||||
|
|
||||||
for confFile, confFlags in confFiles:
|
for confFile, confFlags in confFiles:
|
||||||
|
if confFile.endswith('settings.py'):
|
||||||
|
Cfg.Configuration.pushDefaultPriority ( Cfg.Parameter.Priority.UserFile )
|
||||||
try:
|
try:
|
||||||
if not os.path.isfile(confFile):
|
if not os.path.isfile(confFile):
|
||||||
if confFlags & SystemFile:
|
if confFlags & SystemFile:
|
||||||
|
@ -166,6 +145,9 @@ def coriolisConfigure():
|
||||||
print ' <%s>' % confFile
|
print ' <%s>' % confFile
|
||||||
print ' Trying to continue anyway...'
|
print ' Trying to continue anyway...'
|
||||||
|
|
||||||
|
if confFile.endswith('settings.py'):
|
||||||
|
Cfg.Configuration.popDefaultPriority ()
|
||||||
|
|
||||||
Cfg.Configuration.popDefaultPriority ()
|
Cfg.Configuration.popDefaultPriority ()
|
||||||
|
|
||||||
#sys.stdout.write(CRL.AllianceFramework.get().getEnvironment().getPrint())
|
#sys.stdout.write(CRL.AllianceFramework.get().getEnvironment().getPrint())
|
|
@ -33,6 +33,7 @@ realTechno = 'hcmos9'
|
||||||
realDir = None
|
realDir = None
|
||||||
tab = None
|
tab = None
|
||||||
_trace = None
|
_trace = None
|
||||||
|
moduleGlobals = globals()
|
||||||
|
|
||||||
|
|
||||||
def stype ( o ): return str(type(o)).split("'")[1]
|
def stype ( o ): return str(type(o)).split("'")[1]
|
||||||
|
@ -245,6 +246,37 @@ def setTraceLevel ( level ):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def initTechno ( quiet ):
|
||||||
|
global realDir
|
||||||
|
global realTechno
|
||||||
|
global symbolicDir
|
||||||
|
global symbolicTechno
|
||||||
|
|
||||||
|
technoFiles = [ sysConfDir+'/techno.conf' ]
|
||||||
|
if os.getenv('HOME'):
|
||||||
|
technoFiles += [ os.getenv('HOME')+'/.coriolis2/techno.py' ]
|
||||||
|
technoFiles += [ os.getcwd()+'/.coriolis2/techno.py' ]
|
||||||
|
|
||||||
|
technoFiles.reverse()
|
||||||
|
for technoFile in technoFiles:
|
||||||
|
if os.path.isfile(technoFile):
|
||||||
|
if not quiet: print ' - Loading \"%s\".' % truncPath(technoFile)
|
||||||
|
execfile(technoFile,moduleGlobals)
|
||||||
|
break
|
||||||
|
if moduleGlobals.has_key('symbolicTechnology'):
|
||||||
|
symbolicTechno = symbolicTechnology
|
||||||
|
else:
|
||||||
|
print '[ERROR] The symbolic technology name is not set. Using <cmos>.'
|
||||||
|
if moduleGlobals.has_key('realTechnology'):
|
||||||
|
realTechno = realTechnology
|
||||||
|
else:
|
||||||
|
print '[ERROR] The real technology name is not set. Using <hcmos9gp>.'
|
||||||
|
|
||||||
|
symbolicDir = os.path.join( sysConfDir, symbolicTechno )
|
||||||
|
realDir = os.path.join( sysConfDir, realTechno )
|
||||||
|
if not quiet: print ' - Technologies: %s+%s.' % (symbolicTechno,realTechno)
|
||||||
|
|
||||||
|
|
||||||
def staticInitialization ( quiet=False ):
|
def staticInitialization ( quiet=False ):
|
||||||
global sysConfDir
|
global sysConfDir
|
||||||
global symbolicDir
|
global symbolicDir
|
||||||
|
@ -263,7 +295,7 @@ def staticInitialization ( quiet=False ):
|
||||||
for path in sys.path:
|
for path in sys.path:
|
||||||
if reSysConfDir.match(path):
|
if reSysConfDir.match(path):
|
||||||
sysConfDir = path
|
sysConfDir = path
|
||||||
if not quiet: print ' - <%s>' % sysConfDir
|
#if not quiet: print ' - <%s>' % sysConfDir
|
||||||
break
|
break
|
||||||
|
|
||||||
if not sysConfDir:
|
if not sysConfDir:
|
||||||
|
@ -277,6 +309,5 @@ def staticInitialization ( quiet=False ):
|
||||||
, 'The path is something ending by <.../etc/coriolis2>.'] )
|
, 'The path is something ending by <.../etc/coriolis2>.'] )
|
||||||
|
|
||||||
if not quiet: print ' - <%s>' % sysConfDir
|
if not quiet: print ' - <%s>' % sysConfDir
|
||||||
symbolicDir = os.path.join( sysConfDir, symbolicTechno )
|
initTechno( quiet )
|
||||||
realDir = os.path.join( sysConfDir, realTechno )
|
|
||||||
return
|
return
|
|
@ -1,5 +1,4 @@
|
||||||
add_subdirectory(ccore)
|
add_subdirectory(ccore)
|
||||||
add_subdirectory(pyCRL)
|
add_subdirectory(pyCRL)
|
||||||
add_subdirectory(crlcore)
|
|
||||||
add_subdirectory(cyclop)
|
add_subdirectory(cyclop)
|
||||||
add_subdirectory(x2y)
|
add_subdirectory(x2y)
|
||||||
|
|
|
@ -310,12 +310,14 @@ namespace CRL {
|
||||||
Utilities::Path crlcoreDir = pythonSitePackages / "crlcore";
|
Utilities::Path crlcoreDir = pythonSitePackages / "crlcore";
|
||||||
Utilities::Path stratusDir = pythonSitePackages / "stratus";
|
Utilities::Path stratusDir = pythonSitePackages / "stratus";
|
||||||
Utilities::Path cumulusDir = pythonSitePackages / "cumulus";
|
Utilities::Path cumulusDir = pythonSitePackages / "cumulus";
|
||||||
|
Utilities::Path pharosDir = pythonSitePackages / "pharos";
|
||||||
|
|
||||||
Isobar::Script::addPath ( sysConfDir.string() );
|
Isobar::Script::addPath ( sysConfDir.string() );
|
||||||
Isobar::Script::addPath ( pythonSitePackages.string() );
|
Isobar::Script::addPath ( pythonSitePackages.string() );
|
||||||
Isobar::Script::addPath ( crlcoreDir.string() );
|
Isobar::Script::addPath ( crlcoreDir.string() );
|
||||||
Isobar::Script::addPath ( stratusDir.string() );
|
Isobar::Script::addPath ( stratusDir.string() );
|
||||||
Isobar::Script::addPath ( cumulusDir.string() );
|
Isobar::Script::addPath ( cumulusDir.string() );
|
||||||
|
Isobar::Script::addPath ( pharosDir.string() );
|
||||||
|
|
||||||
// Triggers Configuration singleton creation.
|
// Triggers Configuration singleton creation.
|
||||||
Cfg::Configuration::get ();
|
Cfg::Configuration::get ();
|
||||||
|
@ -475,12 +477,12 @@ namespace CRL {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delayed printing, as we known only now whether VerboseLevel1 is requested.
|
// Delayed printing, as we known only now whether VerboseLevel1 is requested.
|
||||||
if ( cmess1.enabled() ) {
|
//if ( cmess1.enabled() ) {
|
||||||
cmess1 << " o Reading Configuration. " << endl;
|
// cmess1 << " o Reading Configuration. " << endl;
|
||||||
if (systemConfFound) cmess1 << " - <" << systemConfFile.string() << ">." << endl;
|
// if (systemConfFound) cmess1 << " - <" << systemConfFile.string() << ">." << endl;
|
||||||
if (homeConfFound) cmess1 << " - <" << homeConfFile.string() << ">." << endl;
|
// if (homeConfFound) cmess1 << " - <" << homeConfFile.string() << ">." << endl;
|
||||||
if (dotConfFound) cmess1 << " - <" << dotConfFile.string() << ">." << endl;
|
// if (dotConfFound) cmess1 << " - <" << dotConfFile.string() << ">." << endl;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2010-2014, All Rights Reserved
|
// Copyright (c) UPMC 2010-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2010-2012, All Rights Reserved
|
// Copyright (c) UPMC 2010-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
|
@ -21,10 +20,7 @@
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// +-----------------------------------------------------------------+
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | H U R R I C A N E |
|
// | 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 |
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
// | |
|
// | |
|
||||||
|
@ -32,10 +28,7 @@
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Module : "./DbU.cpp" |
|
// | C++ Module : "./DbU.cpp" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
|
@ -21,10 +20,7 @@
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
// $Id$
|
// +-----------------------------------------------------------------+
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | H U R R I C A N E |
|
// | 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 |
|
// | V L S I B a c k e n d D a t a - B a s e |
|
||||||
// | |
|
// | |
|
||||||
|
@ -32,14 +28,11 @@
|
||||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./hurricane/DbU.h" |
|
// | C++ Header : "./hurricane/DbU.h" |
|
||||||
// | *************************************************************** |
|
// +-----------------------------------------------------------------+
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __HURRICANE_DBU__
|
#ifndef HURRICANE_DBU_H
|
||||||
#define __HURRICANE_DBU__
|
#define HURRICANE_DBU_H
|
||||||
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -150,13 +143,13 @@ namespace Hurricane {
|
||||||
// New converter naming scheme.
|
// New converter naming scheme.
|
||||||
inline DbU::Unit DbU::fromDb ( long value ) { return value; }
|
inline DbU::Unit DbU::fromDb ( long value ) { return value; }
|
||||||
inline DbU::Unit DbU::fromGrid ( double value ) { return (long)rint( value/_resolution ); }
|
inline DbU::Unit DbU::fromGrid ( double value ) { return (long)rint( value/_resolution ); }
|
||||||
inline DbU::Unit DbU::fromLambda ( double value ) { return grid(value*_gridsPerLambda); }
|
inline DbU::Unit DbU::fromLambda ( double value ) { return fromGrid(value*_gridsPerLambda); }
|
||||||
inline DbU::Unit DbU::fromPhysical ( double value, UnitPower p ) { return grid((value*getUnitPower(p))/_physicalsPerGrid); }
|
inline DbU::Unit DbU::fromPhysical ( double value, UnitPower p ) { return fromGrid((value*getUnitPower(p))/_physicalsPerGrid); }
|
||||||
inline long DbU::toDb ( DbU::Unit u ) { return u; }
|
inline long DbU::toDb ( DbU::Unit u ) { return u; }
|
||||||
inline double DbU::toGrid ( DbU::Unit u ) { return _resolution*(double)u; }
|
inline double DbU::toGrid ( DbU::Unit u ) { return _resolution*(double)u; }
|
||||||
inline double DbU::toGrid ( double u ) { return _resolution*u; }
|
inline double DbU::toGrid ( double u ) { return _resolution*u; }
|
||||||
inline double DbU::toLambda ( DbU::Unit u ) { return getGrid(u)/_gridsPerLambda; }
|
inline double DbU::toLambda ( DbU::Unit u ) { return toGrid(u)/_gridsPerLambda; }
|
||||||
inline double DbU::toLambda ( double u ) { return getGrid(u)/_gridsPerLambda; }
|
inline double DbU::toLambda ( double u ) { return toGrid(u)/_gridsPerLambda; }
|
||||||
inline double DbU::toPhysical ( DbU::Unit u, UnitPower p ) { return (_physicalsPerGrid*_resolution*(double)u)/getUnitPower(p); }
|
inline double DbU::toPhysical ( DbU::Unit u, UnitPower p ) { return (_physicalsPerGrid*_resolution*(double)u)/getUnitPower(p); }
|
||||||
inline double DbU::toPhysical ( double u, UnitPower p ) { return (_physicalsPerGrid*_resolution*u)/getUnitPower(p); }
|
inline double DbU::toPhysical ( double u, UnitPower p ) { return (_physicalsPerGrid*_resolution*u)/getUnitPower(p); }
|
||||||
|
|
||||||
|
@ -181,4 +174,4 @@ namespace Hurricane {
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
||||||
|
|
||||||
#endif // __HURRICANE_DBU__
|
#endif // HURRICANE_DBU_H
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved
|
// Copyright (c) UPMC 2008-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
|
|
|
@ -23,15 +23,6 @@
|
||||||
#include "hurricane/viewer/Script.h"
|
#include "hurricane/viewer/Script.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
const char* __editorKw = "__editor";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // End of anonymous namespace.
|
|
||||||
|
|
||||||
|
|
||||||
namespace Isobar {
|
namespace Isobar {
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
@ -63,7 +54,9 @@ namespace Isobar {
|
||||||
|
|
||||||
|
|
||||||
Script::Script ( const string& name )
|
Script::Script ( const string& name )
|
||||||
: _moduleName (name)
|
: _initModuleNames()
|
||||||
|
, _initModules ()
|
||||||
|
, _moduleName (name)
|
||||||
, _sysModule (NULL)
|
, _sysModule (NULL)
|
||||||
, _hurricaneModule(NULL)
|
, _hurricaneModule(NULL)
|
||||||
, _userModule (NULL)
|
, _userModule (NULL)
|
||||||
|
@ -71,9 +64,6 @@ namespace Isobar {
|
||||||
, _pyArgs (NULL)
|
, _pyArgs (NULL)
|
||||||
, _pyKw (NULL)
|
, _pyKw (NULL)
|
||||||
, _pyResult (NULL)
|
, _pyResult (NULL)
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
, _cellViewer (NULL)
|
|
||||||
#endif
|
|
||||||
, _globalState (NULL)
|
, _globalState (NULL)
|
||||||
, _subInterpreter (NULL)
|
, _subInterpreter (NULL)
|
||||||
, _flags (0)
|
, _flags (0)
|
||||||
|
@ -81,10 +71,7 @@ namespace Isobar {
|
||||||
|
|
||||||
|
|
||||||
Script::~Script ()
|
Script::~Script ()
|
||||||
{
|
{ finalize(); }
|
||||||
_finalize();
|
|
||||||
//Py_Finalize ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Script* Script::create ( const std::string& name )
|
Script* Script::create ( const std::string& name )
|
||||||
|
@ -100,45 +87,49 @@ namespace Isobar {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if THIS_IS_DISABLED
|
void Script::setUserModuleName ( const std::string& name )
|
||||||
void Script::setEditor ( CellViewer* viewer )
|
{
|
||||||
{ _cellViewer = viewer; }
|
finalize();
|
||||||
#endif
|
_moduleName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Script::addInitModuleName ( std::string name )
|
||||||
|
{
|
||||||
|
for ( auto moduleName : _initModuleNames ) {
|
||||||
|
if (name == moduleName) return false;
|
||||||
|
}
|
||||||
|
_initModuleNames.push_back( name );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyObject* Script::getFunction ( std::string function )
|
||||||
|
{
|
||||||
|
if (not _userModule) return NULL;
|
||||||
|
|
||||||
|
PyObject* pyFunction = PyObject_GetAttrString( _userModule, const_cast<char*>(function.c_str()) );
|
||||||
|
if ( (pyFunction == NULL) or not PyCallable_Check(pyFunction) )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return pyFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Script::runFunction ( const std::string& function, Cell* cell, unsigned int flags )
|
bool Script::runFunction ( const std::string& function, Cell* cell, unsigned int flags )
|
||||||
{
|
{
|
||||||
bool returnCode = true;
|
bool returnCode = true;
|
||||||
|
|
||||||
_initialize();
|
initialize();
|
||||||
|
|
||||||
_userModule = PyImport_ImportModule( const_cast<char*>(_moduleName.c_str()) );
|
|
||||||
|
|
||||||
if (_userModule == NULL) {
|
|
||||||
if (PyErr_Occurred()) {
|
|
||||||
PyErr_Print();
|
|
||||||
}
|
|
||||||
_finalize();
|
|
||||||
throw Error( "Cannot load python module: %s",_moduleName.c_str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
_setEditor();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_pyFunction = PyObject_GetAttrString( _userModule, const_cast<char*>(function.c_str()) );
|
_pyFunction = PyObject_GetAttrString( _userModule, const_cast<char*>(function.c_str()) );
|
||||||
if ( (_pyFunction == NULL) or not PyCallable_Check(_pyFunction) ) {
|
if ( (_pyFunction == NULL) or not PyCallable_Check(_pyFunction) ) {
|
||||||
_finalize();
|
finalize();
|
||||||
throw Error( "Python module %s doesn't contains any %s function."
|
throw Error( "Python module %s doesn't contains any %s function."
|
||||||
, _moduleName.c_str(),function.c_str());
|
, _moduleName.c_str(),function.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
_pyArgs = PyTuple_New( 0 );
|
_pyArgs = PyTuple_New( 0 );
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
if (cell != NULL) addKwArgument( "cell" , (PyObject*)PyCell_Link(cell) );
|
|
||||||
if (_cellViewer != NULL) addKwArgument( "editor", (PyObject*)PyCellViewer_Link(_cellViewer) );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_pyResult = PyObject_Call( _pyFunction, _pyArgs, _pyKw );
|
_pyResult = PyObject_Call( _pyFunction, _pyArgs, _pyKw );
|
||||||
_pyArgs = NULL;
|
_pyArgs = NULL;
|
||||||
_pyKw = NULL;
|
_pyKw = NULL;
|
||||||
|
@ -152,22 +143,48 @@ namespace Isobar {
|
||||||
returnCode = false;
|
returnCode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_finalize();
|
finalize();
|
||||||
|
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Script::_importSys ()
|
PyObject* Script::callFunction ( const std::string& function, PyObject* pyArgs )
|
||||||
{
|
{
|
||||||
if ( not Py_IsInitialized() )
|
if (_userModule == NULL) {
|
||||||
throw Error ( "Script::_importSys(): Called before Py_Initialize()." );
|
if (PyErr_Occurred()) PyErr_Print();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
_sysModule = _importModule ( "sys" );
|
_pyFunction = PyObject_GetAttrString( _userModule, const_cast<char*>(function.c_str()) );
|
||||||
|
if ( (_pyFunction == NULL) or not PyCallable_Check(_pyFunction) ) {
|
||||||
|
cerr << Error( "Python module %s doesn't contains any %s function."
|
||||||
|
, _moduleName.c_str(),function.c_str()) << endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
_pyResult = PyObject_Call( _pyFunction, pyArgs, NULL );
|
||||||
|
|
||||||
|
if (_pyResult == NULL) {
|
||||||
|
cerr << "Something has gone slightly wrong" << endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PyErr_Occurred()) PyErr_Print();
|
||||||
|
|
||||||
|
return _pyResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyObject* Script::_importSys ( unsigned int flags )
|
||||||
|
{
|
||||||
|
_sysModule = _importModule( "sys", flags );
|
||||||
|
|
||||||
PyObject* path = PyObject_GetAttrString( _sysModule, "path" );
|
PyObject* path = PyObject_GetAttrString( _sysModule, "path" );
|
||||||
if ( path == NULL )
|
if (path == NULL) {
|
||||||
|
if (flags & NoThrow) return NULL;
|
||||||
throw Error("Script::_importSys(): No \"sys.path\" attribute.");
|
throw Error("Script::_importSys(): No \"sys.path\" attribute.");
|
||||||
|
}
|
||||||
|
|
||||||
vector<string>::iterator ipath = _pathes.begin();
|
vector<string>::iterator ipath = _pathes.begin();
|
||||||
|
|
||||||
|
@ -175,39 +192,35 @@ namespace Isobar {
|
||||||
PyObject* element = PyString_FromString( const_cast<char*>((*ipath).c_str()) );
|
PyObject* element = PyString_FromString( const_cast<char*>((*ipath).c_str()) );
|
||||||
PyList_Insert( path, 0, element );
|
PyList_Insert( path, 0, element );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return _sysModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Script::_importHurricane ()
|
PyObject* Script::_importModule ( const string& moduleName, unsigned int flags )
|
||||||
{
|
{
|
||||||
if ( not Py_IsInitialized() )
|
if (not Py_IsInitialized()) {
|
||||||
throw Error ( "Script::_importHurricane(): Called before Py_Initialize()." );
|
if (flags & NoThrow) return NULL;
|
||||||
|
|
||||||
_hurricaneModule = PyImport_ImportModule ( "Hurricane" );
|
|
||||||
if ( _hurricaneModule == NULL )
|
|
||||||
throw Error("Script::_importModule(): No Hurricane module.");
|
|
||||||
|
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
PyModule_AddObject ( _hurricaneModule, const_cast<char*>(__editorKw), Py_None );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PyObject* Script::_importModule ( const string& moduleName )
|
|
||||||
{
|
|
||||||
if ( not Py_IsInitialized() )
|
|
||||||
throw Error( "Script::_importModule(): Called before Py_Initialize() while importing <%s>."
|
throw Error( "Script::_importModule(): Called before Py_Initialize() while importing <%s>."
|
||||||
, moduleName.c_str() );
|
, moduleName.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
PyObject* module = PyImport_ImportModule( const_cast<char*>(moduleName.c_str()) );
|
PyObject* module = PyImport_ImportModule( const_cast<char*>(moduleName.c_str()) );
|
||||||
if ( module == NULL )
|
if (module == NULL) {
|
||||||
throw Error("Script::_importModule(): No <%s> module.",moduleName.c_str());
|
if (PyErr_Occurred()) {
|
||||||
|
PyErr_Print();
|
||||||
|
}
|
||||||
|
if (flags & NoThrow) return NULL;
|
||||||
|
|
||||||
|
throw Error( "Script::_importModule(): Unable to load module <%s>.",moduleName.c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Script::_initialize ()
|
bool Script::initialize ( unsigned int flags )
|
||||||
{
|
{
|
||||||
if (Py_IsInitialized()) {
|
if (Py_IsInitialized()) {
|
||||||
// Python is already running. Launch a sub-interpreter.
|
// Python is already running. Launch a sub-interpreter.
|
||||||
|
@ -216,13 +229,27 @@ namespace Isobar {
|
||||||
} else
|
} else
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
|
||||||
|
if (not Py_IsInitialized()) {
|
||||||
|
if (flags & NoThrow) return false;
|
||||||
|
|
||||||
|
throw Error( "Script::initialize(): Unable to initialize the Python interpreter (<%s>)."
|
||||||
|
, _moduleName.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
_flags |= Initialized;
|
_flags |= Initialized;
|
||||||
_importSys ();
|
_importSys ( flags );
|
||||||
_importHurricane();
|
|
||||||
|
for ( auto moduleName : _initModuleNames )
|
||||||
|
_initModules.push_back( _importModule(moduleName,flags) );
|
||||||
|
|
||||||
|
_importHurricane( flags );
|
||||||
|
_importUser ( flags );
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Script::_finalize ()
|
void Script::finalize ()
|
||||||
{
|
{
|
||||||
if (not Py_IsInitialized()) return;
|
if (not Py_IsInitialized()) return;
|
||||||
if (not (_flags & Initialized)) return;
|
if (not (_flags & Initialized)) return;
|
||||||
|
@ -240,6 +267,14 @@ namespace Isobar {
|
||||||
if ( _pyArgs != NULL ) { Py_DECREF ( _pyArgs ); }
|
if ( _pyArgs != NULL ) { Py_DECREF ( _pyArgs ); }
|
||||||
if ( _pyFunction != NULL ) { Py_DECREF ( _pyFunction ); }
|
if ( _pyFunction != NULL ) { Py_DECREF ( _pyFunction ); }
|
||||||
|
|
||||||
|
for ( size_t i=0 ; i<_initModules.size() ; ++i ) {
|
||||||
|
if (_initModules[i]) {
|
||||||
|
Py_DECREF( _initModules[i] );
|
||||||
|
_initModules[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_initModules.clear();
|
||||||
|
|
||||||
Py_Finalize ();
|
Py_Finalize ();
|
||||||
|
|
||||||
_userModule = NULL;
|
_userModule = NULL;
|
||||||
|
@ -252,25 +287,6 @@ namespace Isobar {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
void Script::_setEditor ()
|
|
||||||
{
|
|
||||||
if ( _userModule == NULL ) return;
|
|
||||||
|
|
||||||
PyObject* dictionary = PyModule_GetDict ( _userModule );
|
|
||||||
|
|
||||||
if ( _cellViewer != NULL ) {
|
|
||||||
PyCellViewer* pyCellViewer = PyObject_NEW ( PyCellViewer, &PyTypeCellViewer );
|
|
||||||
pyCellViewer->_object = _cellViewer;
|
|
||||||
|
|
||||||
PyDict_SetItemString ( dictionary, __editorKw, (PyObject*)pyCellViewer );
|
|
||||||
} else {
|
|
||||||
PyDict_SetItemString ( dictionary, __editorKw, Py_None );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void Script::addKwArgument ( const char* key, PyObject* object )
|
void Script::addKwArgument ( const char* key, PyObject* object )
|
||||||
{
|
{
|
||||||
if (_pyKw == NULL) _pyKw = PyDict_New();
|
if (_pyKw == NULL) _pyKw = PyDict_New();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved
|
// Copyright (c) UPMC 2008-2014, All Rights Reserved
|
||||||
//
|
//
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
// | C O R I O L I S |
|
// | C O R I O L I S |
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
struct _object;
|
||||||
|
typedef _object PyObject;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
class Cell;
|
class Cell;
|
||||||
class CellViewer;
|
class CellViewer;
|
||||||
|
@ -30,22 +35,32 @@ namespace Isobar {
|
||||||
|
|
||||||
class Script {
|
class Script {
|
||||||
public:
|
public:
|
||||||
enum Flags { NoScriptArgs=0x1, Initialized=0x10 };
|
enum Flags { NoFlags = 0x0000
|
||||||
|
, NoScriptArgs = 0x0001
|
||||||
|
, Initialized = 0x0002
|
||||||
|
, NoThrow = 0x0004
|
||||||
|
};
|
||||||
public:
|
public:
|
||||||
static void addPath ( const std::string& path );
|
static void addPath ( const std::string& path );
|
||||||
static void removePath ( const std::string& path );
|
static void removePath ( const std::string& path );
|
||||||
static Script* create ( const std::string& name );
|
static Script* create ( const std::string& name="" );
|
||||||
void destroy ();
|
void destroy ();
|
||||||
|
inline std::string getUserModuleName () const;
|
||||||
inline PyObject* getSysModule ();
|
inline PyObject* getSysModule ();
|
||||||
inline PyObject* getHurricaneModule ();
|
inline PyObject* getHurricaneModule ();
|
||||||
inline PyObject* getUserModule ();
|
inline PyObject* getUserModule ();
|
||||||
#if THIS_IS_DISABLED
|
bool addInitModuleName ( std::string );
|
||||||
void setEditor ( Hurricane::CellViewer* );
|
void setUserModuleName ( const std::string& );
|
||||||
#endif
|
PyObject* getFunction ( std::string function );
|
||||||
bool runFunction ( const std::string& function, Hurricane::Cell* cell, unsigned int flags=0 );
|
bool runFunction ( const std::string& function, Hurricane::Cell* cell, unsigned int flags=0 );
|
||||||
|
PyObject* callFunction ( const std::string& function, PyObject* pyArgs );
|
||||||
void addKwArgument ( const char* key, PyObject* object );
|
void addKwArgument ( const char* key, PyObject* object );
|
||||||
|
bool initialize ( unsigned int flags=NoFlags );
|
||||||
|
void finalize ();
|
||||||
protected:
|
protected:
|
||||||
static std::vector<std::string> _pathes;
|
static std::vector<std::string> _pathes;
|
||||||
|
std::vector<std::string> _initModuleNames;
|
||||||
|
std::vector<PyObject*> _initModules;
|
||||||
std::string _moduleName;
|
std::string _moduleName;
|
||||||
PyObject* _sysModule;
|
PyObject* _sysModule;
|
||||||
PyObject* _hurricaneModule;
|
PyObject* _hurricaneModule;
|
||||||
|
@ -54,9 +69,6 @@ namespace Isobar {
|
||||||
PyObject* _pyArgs;
|
PyObject* _pyArgs;
|
||||||
PyObject* _pyKw;
|
PyObject* _pyKw;
|
||||||
PyObject* _pyResult;
|
PyObject* _pyResult;
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
Hurricane::CellViewer* _cellViewer;
|
|
||||||
#endif
|
|
||||||
PyThreadState* _globalState;
|
PyThreadState* _globalState;
|
||||||
PyThreadState* _subInterpreter;
|
PyThreadState* _subInterpreter;
|
||||||
long _flags;
|
long _flags;
|
||||||
|
@ -65,22 +77,25 @@ namespace Isobar {
|
||||||
~Script ();
|
~Script ();
|
||||||
Script ( const Script& );
|
Script ( const Script& );
|
||||||
Script& operator= ( const Script& );
|
Script& operator= ( const Script& );
|
||||||
void _importSys ();
|
PyObject* _importSys ( unsigned int flags );
|
||||||
void _importHurricane ();
|
inline PyObject* _importHurricane ( unsigned int flags );
|
||||||
PyObject* _importModule ( const std::string& );
|
inline PyObject* _importUser ( unsigned int flags );
|
||||||
void _initialize ();
|
PyObject* _importModule ( const std::string&, unsigned int flags );
|
||||||
void _finalize ();
|
|
||||||
#if THIS_IS_DISABLED
|
|
||||||
void _setEditor ();
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Inline Methods.
|
// Inline Methods.
|
||||||
|
inline std::string Script::getUserModuleName () const { return _moduleName; }
|
||||||
inline PyObject* Script::getSysModule () { return _sysModule; }
|
inline PyObject* Script::getSysModule () { return _sysModule; }
|
||||||
inline PyObject* Script::getHurricaneModule () { return _hurricaneModule; }
|
inline PyObject* Script::getHurricaneModule () { return _hurricaneModule; }
|
||||||
inline PyObject* Script::getUserModule () { return _userModule; }
|
inline PyObject* Script::getUserModule () { return _userModule; }
|
||||||
|
|
||||||
|
inline PyObject* Script::_importHurricane ( unsigned int flags )
|
||||||
|
{ return _hurricaneModule = _importModule("Hurricane",flags); }
|
||||||
|
|
||||||
|
inline PyObject* Script::_importUser ( unsigned int flags )
|
||||||
|
{ return _userModule = _importModule(_moduleName,flags); }
|
||||||
|
|
||||||
|
|
||||||
} // End of Isobar namespace.
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
endif(CHECK_DETERMINISM)
|
endif(CHECK_DETERMINISM)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(python)
|
||||||
add_subdirectory(cmake_modules)
|
add_subdirectory(cmake_modules)
|
||||||
|
|
||||||
if(BUILD_DOC)
|
if(BUILD_DOC)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
|
||||||
|
install ( FILES kiteInit.py DESTINATION ${PYTHON_SITE_PACKAGES}/kite )
|
|
@ -115,7 +115,5 @@
|
||||||
install ( FILES ${includes}
|
install ( FILES ${includes}
|
||||||
${mocIncludes}
|
${mocIncludes}
|
||||||
${pyIncludes} DESTINATION include/coriolis2/kite )
|
${pyIncludes} DESTINATION include/coriolis2/kite )
|
||||||
install ( FILES init/kiteInit.py
|
|
||||||
DESTINATION ${PYTHON_SITE_PACKAGES}/kite )
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,7 @@ namespace Cfg {
|
||||||
.value("UseDefault" ,Parameter::UseDefault)
|
.value("UseDefault" ,Parameter::UseDefault)
|
||||||
.value("ApplicationBuiltin",Parameter::ApplicationBuiltin)
|
.value("ApplicationBuiltin",Parameter::ApplicationBuiltin)
|
||||||
.value("ConfigurationFile" ,Parameter::ConfigurationFile)
|
.value("ConfigurationFile" ,Parameter::ConfigurationFile)
|
||||||
|
.value("UserFile" ,Parameter::UserFile)
|
||||||
.value("CommandLine" ,Parameter::CommandLine)
|
.value("CommandLine" ,Parameter::CommandLine)
|
||||||
.value("Interactive" ,Parameter::Interactive)
|
.value("Interactive" ,Parameter::Interactive)
|
||||||
;
|
;
|
||||||
|
|
|
@ -51,8 +51,9 @@ namespace Cfg {
|
||||||
enum Priority { UseDefault = 0
|
enum Priority { UseDefault = 0
|
||||||
, ApplicationBuiltin = 1
|
, ApplicationBuiltin = 1
|
||||||
, ConfigurationFile = 2
|
, ConfigurationFile = 2
|
||||||
, CommandLine = 3
|
, UserFile = 3
|
||||||
, Interactive = 4
|
, CommandLine = 4
|
||||||
|
, Interactive = 5
|
||||||
};
|
};
|
||||||
typedef boost::function< void(Parameter*) > ParameterChangedCb_t;
|
typedef boost::function< void(Parameter*) > ParameterChangedCb_t;
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue