You can subscribe to this list here.
2003 |
Jan
|
Feb
(71) |
Mar
(296) |
Apr
(77) |
May
(71) |
Jun
(128) |
Jul
(32) |
Aug
(69) |
Sep
(101) |
Oct
(31) |
Nov
(34) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(19) |
Feb
(52) |
Mar
(39) |
Apr
(61) |
May
(114) |
Jun
(57) |
Jul
(127) |
Aug
(134) |
Sep
(33) |
Oct
(51) |
Nov
(15) |
Dec
(21) |
2005 |
Jan
(24) |
Feb
(7) |
Mar
(16) |
Apr
(5) |
May
(50) |
Jun
(2) |
Jul
(8) |
Aug
(1) |
Sep
(4) |
Oct
(6) |
Nov
(43) |
Dec
(16) |
2006 |
Jan
|
Feb
(8) |
Mar
(7) |
Apr
(7) |
May
(26) |
Jun
(14) |
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(24) |
Dec
(2) |
2007 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
(36) |
May
(51) |
Jun
(100) |
Jul
(29) |
Aug
(4) |
Sep
(22) |
Oct
(4) |
Nov
(10) |
Dec
(52) |
2008 |
Jan
(68) |
Feb
(49) |
Mar
(35) |
Apr
(12) |
May
(2) |
Jun
(18) |
Jul
|
Aug
(8) |
Sep
|
Oct
(136) |
Nov
(24) |
Dec
(45) |
2009 |
Jan
(19) |
Feb
(58) |
Mar
(22) |
Apr
(24) |
May
|
Jun
(28) |
Jul
(25) |
Aug
(49) |
Sep
(10) |
Oct
(6) |
Nov
(22) |
Dec
(30) |
2010 |
Jan
(138) |
Feb
(53) |
Mar
(1) |
Apr
(7) |
May
(4) |
Jun
(5) |
Jul
(7) |
Aug
(3) |
Sep
(15) |
Oct
|
Nov
(7) |
Dec
(7) |
2011 |
Jan
(11) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mor...@us...> - 2011-05-11 05:36:55
|
Revision: 3898 http://ecell.svn.sourceforge.net/ecell/?rev=3898&view=rev Author: moriyoshi Date: 2011-05-11 05:36:49 +0000 (Wed, 11 May 2011) Log Message: ----------- Add missing setter. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-02-18 05:14:08 UTC (rev 3897) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-05-11 05:36:49 UTC (rev 3898) @@ -2986,7 +2986,7 @@ return_existing_object() ) ) .add_property( "ID", &Entity::getID, &Entity::setID ) .add_property( "FullID", &Entity::getFullID ) - .add_property( "Name", &Entity::getName ) + .add_property( "Name", &Entity::getName, &Entity::setName ) .def( "__setattr__", &EcsObject___setattr__< Entity > ) .def( "__getattr__", &EcsObject___getattr__< Entity > ) ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-02-18 05:14:15
|
Revision: 3897 http://ecell.svn.sourceforge.net/ecell/?rev=3897&view=rev Author: moriyoshi Date: 2011-02-18 05:14:08 +0000 (Fri, 18 Feb 2011) Log Message: ----------- * Expose simulator object to the expressions in PythonProcess. Modified Paths: -------------- ecell3/trunk/ecell/libecs/Model.hpp ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/libecs/Model.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Model.hpp 2011-02-10 04:23:12 UTC (rev 3896) +++ ecell3/trunk/ecell/libecs/Model.hpp 2011-02-18 05:14:08 UTC (rev 3897) @@ -73,7 +73,7 @@ void setup(); - ~Model(); + virtual ~Model(); /** Initialize the whole model. Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-02-10 04:23:12 UTC (rev 3896) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-02-18 05:14:08 UTC (rev 3897) @@ -2817,6 +2817,11 @@ }; }; +AbstractSimulator* Entity_getModel(Entity const& entity) +{ + return dynamic_cast<AbstractSimulator*>(entity.getModel()); +} + BOOST_PYTHON_MODULE( _ecs ) { DataPointVectorWrapper< DataPoint >::__class_init__(); @@ -2970,6 +2975,12 @@ py::class_< Entity, py::bases<>, Entity, boost::noncopyable > ( "Entity", py::no_init ) // properties + .add_property( "model", + py::make_function( &Entity_getModel, + return_existing_object() ) ) + .add_property( "simulator", + py::make_function( &Entity_getModel, + return_existing_object() ) ) .add_property( "superSystem", py::make_function( &Entity::getSuperSystem, return_existing_object() ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-02-10 04:23:19
|
Revision: 3896 http://ecell.svn.sourceforge.net/ecell/?rev=3896&view=rev Author: moriyoshi Date: 2011-02-10 04:23:12 +0000 (Thu, 10 Feb 2011) Log Message: ----------- * Remove unnecessary semicolons. Modified Paths: -------------- ecell3/trunk/ecell/libecs/EcsObject.hpp Modified: ecell3/trunk/ecell/libecs/EcsObject.hpp =================================================================== --- ecell3/trunk/ecell/libecs/EcsObject.hpp 2011-02-10 04:20:38 UTC (rev 3895) +++ ecell3/trunk/ecell/libecs/EcsObject.hpp 2011-02-10 04:23:12 UTC (rev 3896) @@ -92,8 +92,8 @@ @param CLASSNAME the name of the abstract EcsObject class */ #define LIBECS_DM_OBJECT_ABSTRACT( CLASSNAME )\ - LIBECS_DM_OBJECT_DEF_ABSTRACT( CLASSNAME );\ - LIBECS_DM_EXPOSE_PROPERTYINTERFACE( CLASSNAME );\ + LIBECS_DM_OBJECT_DEF_ABSTRACT( CLASSNAME )\ + LIBECS_DM_EXPOSE_PROPERTYINTERFACE( CLASSNAME )\ LIBECS_DM_INIT_PROP_INTERFACE() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-02-10 04:20:44
|
Revision: 3895 http://ecell.svn.sourceforge.net/ecell/?rev=3895&view=rev Author: moriyoshi Date: 2011-02-10 04:20:38 +0000 (Thu, 10 Feb 2011) Log Message: ----------- * Remove unnecessary consts. Modified Paths: -------------- ecell3/trunk/ecell/libecs/DataPoint.hpp ecell3/trunk/ecell/libecs/DynamicPriorityQueue.hpp ecell3/trunk/ecell/libecs/EventScheduler.hpp ecell3/trunk/ecell/libecs/FullID.hpp ecell3/trunk/ecell/libecs/Logger.cpp ecell3/trunk/ecell/libecs/Logger.hpp ecell3/trunk/ecell/libecs/Util.cpp ecell3/trunk/ecell/libecs/Util.hpp ecell3/trunk/ecell/libecs/Variable.hpp ecell3/trunk/ecell/libecs/VariableReference.hpp ecell3/trunk/ecell/libecs/convertTo.hpp Modified: ecell3/trunk/ecell/libecs/DataPoint.hpp =================================================================== --- ecell3/trunk/ecell/libecs/DataPoint.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/DataPoint.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -83,31 +83,31 @@ } - const Real getTime() const + Real getTime() const { return theTime; } - const Real getValue() const + Real getValue() const { return theValue; } - const Real getAvg() const + Real getAvg() const { return theValue; } - const Real getMin() const + Real getMin() const { return theValue; } - const Real getMax() const + Real getMax() const { return theValue; } @@ -125,13 +125,13 @@ } - static const size_t getElementSize() + static size_t getElementSize() { return sizeof( Real ); } - static const int getElementNumber() + static int getElementNumber() { return 2; } @@ -204,31 +204,31 @@ } - const Real getTime() const + Real getTime() const { return theTime; } - const Real getValue() const + Real getValue() const { return theValue; } - const Real getAvg() const + Real getAvg() const { return theAvg; } - const Real getMin() const + Real getMin() const { return theMin; } - const Real getMax() const + Real getMax() const { return theMax; } @@ -264,13 +264,13 @@ } - static const size_t getElementSize() + static size_t getElementSize() { return sizeof( Real ); } - static const int getElementNumber() + static int getElementNumber() { return 5; } Modified: ecell3/trunk/ecell/libecs/DynamicPriorityQueue.hpp =================================================================== --- ecell3/trunk/ecell/libecs/DynamicPriorityQueue.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/DynamicPriorityQueue.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -106,7 +106,7 @@ this->indexMap.clear(); } - const Index getIndex( const ID id ) const + Index getIndex( ID id ) const { IndexMap::const_iterator i = this->indexMap.find( id ); @@ -118,12 +118,12 @@ return (*i).second; } - const ID getIDByIndex( const Index index ) const + ID getIDByIndex( Index index ) const { return this->idVector[ index ]; } - const ID push( const Index index ) + ID push( Index index ) { const ID id( this->idCounter ); ++this->idCounter; @@ -134,7 +134,7 @@ return id; } - void pop( const Index index ) + void pop( Index index ) { // update the idVector and the indexMap. const ID removedID( this->idVector[ index ] ); @@ -156,7 +156,7 @@ return this->idVector.end(); } - const bool checkConsistency( const Index size ) const + bool checkConsistency( Index size ) const { if( this->idVector.size() != size ) { @@ -294,29 +294,29 @@ ; // do nothing } - const Index getIndex( const ID id ) const + Index getIndex( ID id ) const { return id; } - const ID getIDByIndex( const Index index ) const + ID getIDByIndex( Index index ) const { return index; } - const ID push( const Index index ) + ID push( Index index ) { maxIndex = index + 1; return index; } - void pop( const Index index ) + void pop( Index index ) { BOOST_ASSERT( maxIndex == index + 1 ); maxIndex = index; } - const bool checkConsistency( const Index size ) const + bool checkConsistency( Index size ) const { return true; } @@ -369,12 +369,12 @@ public: DynamicPriorityQueue(); - const bool isEmpty() const + bool isEmpty() const { return this->itemVector.empty(); } - const Index getSize() const + Index getSize() const { return this->itemVector.size(); } @@ -391,12 +391,12 @@ return this->itemVector[ getTopIndex() ]; } - Item& get( const ID id ) + Item& get( ID id ) { return this->itemVector[ this->pol.getIndex( id ) ]; } - Item const& get( const ID id ) const + Item const& get( ID id ) const { return this->itemVector[ this->pol.getIndex( id ) ]; } @@ -411,73 +411,73 @@ popByIndex( getTopIndex() ); } - void pop( const ID id ) + void pop( ID id ) { popByIndex( this->pol.getIndex( id ) ); } void replaceTop( const Item& item ); - void replace( const ID id, const Item& item ); + void replace( ID id, const Item& item ); - inline const ID push( const Item& item ); + inline ID push( const Item& item ); void dump() const; - Item& operator[]( const ID id ) + Item& operator[]( ID id ) { return get( id ); } - Item const& operator[]( const ID id ) const + Item const& operator[]( ID id ) const { return get( id ); } - inline void popByIndex( const Index index ); + inline void popByIndex( Index index ); - Item& getByIndex( const Index index ) + Item& getByIndex( Index index ) { return this->itemVector[ index ]; } - const Index getTopIndex() const + Index getTopIndex() const { return this->heap[0]; } - void move( const Index index ) + void move( Index index ) { const Index pos( this->positionVector[ index ] ); movePos( pos ); } - inline void movePos( const Index pos ); + inline void movePos( Index pos ); void moveTop() { moveDownPos( 0 ); } - void moveUpByIndex( const Index index ) + void moveUpByIndex( Index index ) { const Index position( this->positionVector[ index ] ); moveUpPos( position ); } - void moveUp( const ID id ) + void moveUp( ID id ) { moveUpByIndex( pol.getIndex( id ) ); } - void moveDownByIndex( const Index index ) + void moveDownByIndex( Index index ) { const Index position( this->positionVector[ index ] ); moveDownPos( position ); } - void moveDown( const ID id ) + void moveDown( ID id ) { moveDownByIndex( pol.getIndex( id ) ); } @@ -494,13 +494,13 @@ protected: // self-diagnostic method - const bool checkConsistency() const; + bool checkConsistency() const; private: - inline void moveUpPos( const Index position, const Index start = 0 ); - inline void moveDownPos( const Index position ); + inline void moveUpPos( Index position, Index start = 0 ); + inline void moveDownPos( Index position ); private: @@ -537,7 +537,7 @@ template < typename Item, class IDPolicy > void DynamicPriorityQueue< Item, IDPolicy >:: -movePos( const Index pos ) +movePos( Index pos ) { const Index index( this->heap[ pos ] ); const Item& item( this->itemVector[ index ] ); @@ -569,8 +569,8 @@ } template < typename Item, class IDPolicy > -void DynamicPriorityQueue< Item, IDPolicy >::moveUpPos( const Index position, - const Index start ) +void DynamicPriorityQueue< Item, IDPolicy >::moveUpPos( Index position, + Index start ) { if ( position == 0 ) { @@ -602,7 +602,7 @@ template < typename Item, class IDPolicy > void -DynamicPriorityQueue< Item, IDPolicy >::moveDownPos( const Index position ) +DynamicPriorityQueue< Item, IDPolicy >::moveDownPos( Index position ) { const Index index( this->heap[ position ] ); @@ -634,7 +634,7 @@ template < typename Item, class IDPolicy > -const typename DynamicPriorityQueue< Item, IDPolicy >::ID +typename DynamicPriorityQueue< Item, IDPolicy >::ID DynamicPriorityQueue< Item, IDPolicy >::push( const Item& item ) { const Index index( getSize() ); @@ -655,7 +655,7 @@ template < typename Item, class IDPolicy > -void DynamicPriorityQueue< Item, IDPolicy >::popByIndex( const Index index ) +void DynamicPriorityQueue< Item, IDPolicy >::popByIndex( Index index ) { // 1. pop the item from the itemVector. this->itemVector[ index ] = this->itemVector.back(); @@ -698,7 +698,7 @@ template < typename Item, class IDPolicy > void DynamicPriorityQueue< Item, IDPolicy >:: -replace( const ID id, const Item& item ) +replace( ID id, const Item& item ) { const Index index( this->pol.getIndex( id ) ); this->itemVector[ index ] = item; @@ -725,7 +725,7 @@ template < typename Item, class IDPolicy > -const bool DynamicPriorityQueue< Item, IDPolicy >::checkConsistency() const +bool DynamicPriorityQueue< Item, IDPolicy >::checkConsistency() const { bool result( true ); Modified: ecell3/trunk/ecell/libecs/EventScheduler.hpp =================================================================== --- ecell3/trunk/ecell/libecs/EventScheduler.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/EventScheduler.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -59,7 +59,7 @@ (2) setTime( new scheduled time ). } - const bool isDependentOn( const Event& anEvent ) + bool isDependentOn( const Event& anEvent ) { Return true if this Event must be updated when the given Event (anEvent) fired. Otherwise return false; @@ -83,33 +83,33 @@ } - const Time getTime() const + Time getTime() const { return theTime; } - const bool operator< ( EventBase const& rhs ) const + bool operator< ( EventBase const& rhs ) const { return getTime() < rhs.getTime(); } - const bool operator> ( EventBase const& rhs ) const + bool operator> ( EventBase const& rhs ) const { return getTime() > rhs.getTime(); } - const bool operator>= ( EventBase const& rhs ) const + bool operator>= ( EventBase const& rhs ) const { return !(*this < rhs); } - const bool operator<= ( EventBase const& rhs ) const + bool operator<= ( EventBase const& rhs ) const { return !(*this > rhs); } - const bool operator!= ( EventBase const& rhs ) const + bool operator!= ( EventBase const& rhs ) const { return getTime() != rhs.getTime(); } @@ -162,7 +162,7 @@ } - const EventIndex getSize() const + EventIndex getSize() const { return theEventPriorityQueue.getSize(); } @@ -259,7 +259,7 @@ theEventDependencyMap.clear(); } - const EventID addEvent( Event const& anEvent ) + EventID addEvent( Event const& anEvent ) { return theEventPriorityQueue.push( anEvent ); } Modified: ecell3/trunk/ecell/libecs/FullID.hpp =================================================================== --- ecell3/trunk/ecell/libecs/FullID.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/FullID.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -353,7 +353,7 @@ class FullPN { public: - FullPN( const EntityType type, + FullPN( EntityType type, SystemPath const& systempath, String const& id, String const& propertyname ) @@ -389,7 +389,7 @@ return theFullID; } - const EntityType getEntityType() const + EntityType getEntityType() const { return getFullID().getEntityType(); } Modified: ecell3/trunk/ecell/libecs/Logger.cpp =================================================================== --- ecell3/trunk/ecell/libecs/Logger.cpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/Logger.cpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -132,13 +132,13 @@ } -const Real Logger::getStartTime( void ) const +Real Logger::getStartTime( void ) const { return thePhysicalLogger.front().getTime(); } -const Real Logger::getEndTime( void ) const +Real Logger::getEndTime( void ) const { return thePhysicalLogger.back().getTime(); } Modified: ecell3/trunk/ecell/libecs/Logger.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Logger.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/Logger.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -232,19 +232,19 @@ Returns time of the first element in Logger. */ - const Real getStartTime( void ) const; + Real getStartTime( void ) const; /** Returns time of the last element in Logger */ - const Real getEndTime( void ) const; + Real getEndTime( void ) const; /** Returns size of logger */ - const size_type getSize() const + size_type getSize() const { return thePhysicalLogger.size(); } Modified: ecell3/trunk/ecell/libecs/Util.cpp =================================================================== --- ecell3/trunk/ecell/libecs/Util.cpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/Util.cpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -46,7 +46,7 @@ { #define __STRINGCAST_SPECIALIZATION_DEF( NEW, GIVEN )\ - template<> const NEW stringCast<NEW,GIVEN>( const GIVEN& aValue )\ + template<> NEW stringCast<NEW,GIVEN>( const GIVEN& aValue )\ {\ return boost::lexical_cast<NEW>( aValue );\ } // @@ -67,7 +67,7 @@ // Specialization here for <Real,String> does this job. template< typename T > -const Real stringToFloat( String const& aValue ) +Real stringToFloat( String const& aValue ) { String aCaseless( boost::algorithm::to_lower_copy( aValue ) ); @@ -86,14 +86,14 @@ } template<> -const Real stringCast<Real,String>( String const& aValue ) +Real stringCast<Real,String>( String const& aValue ) { return stringToFloat<Real>( aValue ); } #if !HIGHREAL_IS_REAL template<> -const HighReal stringCast<HighReal,String>( String const& aValue ) +HighReal stringCast<HighReal,String>( String const& aValue ) { return stringToFloat<HighReal>( aValue ); } Modified: ecell3/trunk/ecell/libecs/Util.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Util.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/Util.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -72,7 +72,7 @@ can reduce resulting binary size. */ template< typename NEW, typename GIVEN > -const NEW stringCast( const GIVEN& aValue ) +NEW stringCast( const GIVEN& aValue ) { return boost::lexical_cast<NEW>( aValue ); } @@ -80,13 +80,13 @@ /** @internal */ template< typename GIVEN > -const String stringCast( const GIVEN& aValue ) +String stringCast( const GIVEN& aValue ) { return stringCast<String,GIVEN>( aValue ); } #define __STRINGCAST_SPECIALIZATION_DECL( NEW, GIVEN )\ -template<> LIBECS_API const NEW stringCast<NEW,GIVEN>( const GIVEN& ) +template<> LIBECS_API NEW stringCast<NEW,GIVEN>( const GIVEN& ) __STRINGCAST_SPECIALIZATION_DECL( String, Real ); __STRINGCAST_SPECIALIZATION_DECL( String, HighReal ); @@ -372,7 +372,7 @@ class LexicalCaster: public std::unary_function< GIVEN, NEW > { public: - const NEW operator()( const GIVEN& aValue ) + NEW operator()( const GIVEN& aValue ) { return stringCast<NEW>( aValue ); } Modified: ecell3/trunk/ecell/libecs/Variable.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Variable.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/Variable.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -108,7 +108,7 @@ /** Clear theVelocity by zero. */ - virtual const bool isIntegrationNeeded() const + virtual bool isIntegrationNeeded() const { return ! theInterpolantVector.empty(); } @@ -205,7 +205,7 @@ /** A wrapper to set Fixed property by a bool value. */ - void setFixed( const bool aValue ) + void setFixed( bool aValue ) { theFixed = aValue; } @@ -213,7 +213,7 @@ /** @return true if the Variable is fixed or false if not. */ - const bool isFixed() const + bool isFixed() const { return theFixed; } @@ -321,8 +321,8 @@ virtual void detach(); protected: - const Real calculateDifferenceSum( Real aCurrentTime, - Real anInterval ) const + Real calculateDifferenceSum( Real aCurrentTime, + Real anInterval ) const { Real aVelocitySum( 0.0 ); FOR_ALL( InterpolantVector, theInterpolantVector ) @@ -354,7 +354,7 @@ void clearInterpolantVector(); private: - const Real getSizeOfSuperSystem() const + Real getSizeOfSuperSystem() const { return getSuperSystem()->getSizeVariable()->getValue(); } Modified: ecell3/trunk/ecell/libecs/VariableReference.hpp =================================================================== --- ecell3/trunk/ecell/libecs/VariableReference.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/VariableReference.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -172,12 +172,12 @@ theName = aName; } - const String getName() const + String getName() const { return theName; } - const Integer getSerial() const + Integer getSerial() const { return theSerial; } Modified: ecell3/trunk/ecell/libecs/convertTo.hpp =================================================================== --- ecell3/trunk/ecell/libecs/convertTo.hpp 2011-02-08 10:29:14 UTC (rev 3894) +++ ecell3/trunk/ecell/libecs/convertTo.hpp 2011-02-10 04:20:38 UTC (rev 3895) @@ -48,7 +48,7 @@ class ConvertTo { public: - const ToType operator()( const FromType& aValue ) + ToType operator()( const FromType& aValue ) { // strategy: // (1) if both of ToType and FromType are arithmetic, and @@ -73,7 +73,7 @@ class ConvertTo< ToType, String > { public: - const ToType operator()( String const& aValue ) + ToType operator()( String const& aValue ) { // strategy: // (1) if ToType is arithmetic, use LexicalCaster. @@ -89,7 +89,7 @@ class ConvertTo< ToType, char[_N] > { public: - const ToType operator()( char const* aValue ) + ToType operator()( char const* aValue ) { // strategy: // (1) if ToType is arithmetic, use LexicalCaster. @@ -106,7 +106,7 @@ class ConvertTo< ToType, const char[_N] > { public: - const ToType operator()( char const* aValue ) + ToType operator()( char const* aValue ) { // strategy: // (1) if ToType is arithmetic, use LexicalCaster. @@ -124,7 +124,7 @@ class ConvertTo< ToType, char* > { public: - const ToType operator()( char const* const& aValue ) + ToType operator()( char const* const& aValue ) { // strategy: // (1) if ToType is arithmetic, use LexicalCaster. @@ -142,7 +142,7 @@ class ConvertTo< ToType, char const* > { public: - const ToType operator()( char const* const& aValue ) + ToType operator()( char const* const& aValue ) { // strategy: // (1) if ToType is arithmetic, use LexicalCaster. @@ -161,7 +161,7 @@ class ConvertTo< String, FromType > { public: - const String operator()( const FromType& aValue ) + String operator()( const FromType& aValue ) { // strategy: // (1) if FromType is arithmetic, use LexicalCaster. @@ -179,7 +179,7 @@ class ConvertTo< String, String > { public: - const String operator()( const String& aValue ) + String operator()( const String& aValue ) { return aValue; } @@ -191,7 +191,7 @@ // convertTo template function // template< typename ToType, typename FromType > -inline const ToType convertTo( const FromType& aValue ) +inline ToType convertTo( const FromType& aValue ) { return ConvertTo<ToType,FromType>()( aValue ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-02-08 10:29:21
|
Revision: 3894 http://ecell.svn.sourceforge.net/ecell/?rev=3894&view=rev Author: moriyoshi Date: 2011-02-08 10:29:14 +0000 (Tue, 08 Feb 2011) Log Message: ----------- Oops. Modified Paths: -------------- ecell3/trunk/ecell/frontend/session-monitor/glade/Makefile.am Modified: ecell3/trunk/ecell/frontend/session-monitor/glade/Makefile.am =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/glade/Makefile.am 2011-01-24 12:46:14 UTC (rev 3893) +++ ecell3/trunk/ecell/frontend/session-monitor/glade/Makefile.am 2011-02-08 10:29:14 UTC (rev 3894) @@ -2,7 +2,6 @@ AboutSessionMonitor.glade \ BoardWindow.glade \ EntityListWindow.glade \ - FullPNQueue.glade \ InterfaceWindow.glade \ LoggerWindow.glade \ LoggingPolicy.glade \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-24 12:46:23
|
Revision: 3893 http://ecell.svn.sourceforge.net/ecell/?rev=3893&view=rev Author: moriyoshi Date: 2011-01-24 12:46:14 +0000 (Mon, 24 Jan 2011) Log Message: ----------- * Overhaul. Modified Paths: -------------- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/MainWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoUtil.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/StepperWindow.py ecell3/trunk/ecell/frontend/session-monitor/glade/EntityListWindow.glade ecell3/trunk/ecell/frontend/session-monitor/glade/MainWindow.glade ecell3/trunk/ecell/frontend/session-monitor/glade/StepperWindow.glade ecell3/trunk/ecell/frontend/session-monitor/plugins/BargraphWindow.py ecell3/trunk/ecell/frontend/session-monitor/plugins/PropertyWindow.glade ecell3/trunk/ecell/frontend/session-monitor/plugins/PropertyWindow.py ecell3/trunk/ecell/pyecell/ecell/StepperStub.py Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py 2011-01-20 11:56:01 UTC (rev 3892) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py 2011-01-24 12:46:14 UTC (rev 3893) @@ -884,7 +884,6 @@ def updateListLabels( self ): - self.__updateViewLabel( 'Variable', self['variable_label'],\ self.variableTree ) self.__updateViewLabel( 'Process', self['process_label'],\ @@ -893,15 +892,11 @@ self.systemTree ) def __updateViewLabel( self, type, label, view ): - shownCount = len( view.get_model() ) selectedCount = view.get_selection().count_selected_rows() - labelText = type + ' (' + str( selectedCount ) + '/' + \ - str( shownCount ) + ')' - label.set_text( labelText ) + labelText = '<b>%s</b> (%d / %d)' % (type, selectedCount, shownCount ) + label.set_markup( labelText ) - - def selectProcess( self, selection ): if self.donotHandle: return Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/MainWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/MainWindow.py 2011-01-20 11:56:01 UTC (rev 3892) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/MainWindow.py 2011-01-24 12:46:14 UTC (rev 3893) @@ -57,13 +57,17 @@ import ecell.ui.osogo.MessageWindow as MessageWindow class SimulationButton: - def __init__( self ): + def __init__( self, container ): self.startImage = os.path.join( config.GLADEFILE_PATH, "icon_start.png" ) self.stopImage = os.path.join( config.GLADEFILE_PATH, "icon_stop.png" ) - self.image = gtk.Image() - self.image.set_from_file( self.startImage ) + for widget in container.get_children(): + if isinstance( widget, gtk.Image ): + self.image = widget + elif isinstance( widget, gtk.Label ): + self.label = widget + self.__currentState = 'stop' self.image.show() @@ -75,11 +79,12 @@ def setCurrentState( self, aCurrentState ): self.__currentState = aCurrentState - if ( self.__currentState == 'run' ): self.image.set_from_file( self.stopImage ) + self.label.set_text( 'Stop' ) elif ( self.__currentState == 'stop' ): self.image.set_from_file( self.startImage ) + self.label.set_text( 'Start' ) class LogoAnimation: iconList = ( @@ -194,11 +199,8 @@ # create SimulationButton # ------------------------------------- - self.SimulationButton = SimulationButton() - self['SimulationButton'].add( self.SimulationButton.getCurrentImage() ) - self['SimulationButtonLabel'].set_text('Start') + self.SimulationButton = SimulationButton( self['SimulationButton'] ) - # --------------------------- # create logo button # --------------------------- @@ -341,22 +343,6 @@ """ pass - def __resizeVertically( self, height ): #gets entitylistarea or messagebox height - """__resizeVertically - Return None - """ - - # gets fix components height - menu_height=self['handlebox22'].get_child_requisition()[1] - toolbar_height=self['handlebox19'].get_child_requisition()[1] - - # gets window_width - window_width=self['MainWindow'].get_size()[0] - - # resizes - window_height=menu_height+toolbar_height+height - self['MainWindow'].resize(window_width,window_height) - def __setMenuAndButtonsStatus( self, aDataLoadedStatus ): """sets initial widgets status aDataLoadedStatus -- the status of loading data @@ -652,27 +638,25 @@ if self.theSession.theRunningFlag: # stop simulation temporarily self.theSession.stop() - running_flag = True - # If there is no logger data, exit this program. - if len(self.theSession.getLoggerList()) != 0: - aMessage = 'Are you sure you want to quit?' - aTitle = 'Question' - # Popup confirm window, and check user request - aDialog = ConfirmWindow(1,aMessage,aTitle) + if self.theSession.theSession is not None: + # If there is no logger data, exit this program. + if len(self.theSession.getLoggerList()) != 0: + aMessage = 'Are you sure you want to quit?' + aTitle = 'Question' + # Popup confirm window, and check user request + aDialog = ConfirmWindow(1,aMessage,aTitle) - # ok is pressed - - if aDialog.return_result() != OK_PRESSED: - if running_flag: - self.theSession.run() - return True + # ok is pressed + + if aDialog.return_result() != OK_PRESSED: + if running_flag: + self.theSession.run() + return True self.setStopState() - self.close() - self.theSession.QuitGUI() return True @@ -688,9 +672,7 @@ OsogoWindow.close( self ) def setStartState( self ): - self.SimulationButton.setCurrentState( 'run' ) - self['SimulationButtonLabel'].set_text('Stop') if self.logoMovable: self.logoAnimation.start() @@ -700,7 +682,6 @@ def setStopState( self ): self.SimulationButton.setCurrentState( 'stop' ) - self['SimulationButtonLabel'].set_text('Start') self.logoAnimation.stop() self.setTempTime() @@ -923,10 +904,6 @@ if self.theToolbarVisible: self['toolbar_handlebox'].hide() self.theToolbarVisible = False - - if self.theMessageWindowVisible == False and \ - self.theEntityListWindowVisible == False: - self.__resizeVertically( 0 ) else: self['toolbar_handlebox'].show() self.theToolbarVisible = True @@ -937,10 +914,6 @@ if self.theStatusbarVisible: self['statusbar'].hide() self.theStatusbarVisible = False - - if self.theMessageWindowVisible == False and \ - self.theEntityListWindowVisible == False: - self.__resizeVertically( 0 ) else: self['statusbar'].show() self.theStatusbarVisible = True @@ -1036,16 +1009,9 @@ if anObject.get_active(): self.theMessageWindowVisible = True self.showMessageWindow() - self.__resizeVertically( self.theMessageWindow.getActualSize()[1] ) - # hide else: self.theMessageWindowVisible = False self.hideMessageWindow() - - if self.theEntityListWindowVisible: - self.__resizeVertically( self['entitylistarea'].get_allocation()[3] ) - else: - self.__resizeVertically( 0 ) self.updateButtons() @@ -1053,17 +1019,10 @@ if arg[0].get_active(): self.theEntityListWindowVisible = True self['entitylistarea'].show() - self.__resizeVertically( self['entitylistarea'].get_allocation()[3] ) - else: self.theEntityListWindowVisible = False self['entitylistarea'].hide() - if self.theMessageWindowVisible: - self.__resizeVertically( self.theMessageWindow.getActualSize()[1] ) - else: - self.__resizeVertically( 0 ) - def __displayAbout ( self, *args ): # show about information self.createAboutSessionMonitor() @@ -1124,7 +1083,8 @@ delete this window. Returns True """ - return self.__deleted( *arg ) + pass + #return self.__deleted( *arg ) Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoUtil.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoUtil.py 2011-01-20 11:56:01 UTC (rev 3892) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoUtil.py 2011-01-24 12:46:14 UTC (rev 3893) @@ -47,20 +47,6 @@ SINGLE = 0 MULTIPLE = 1 -# ---------------------------------------------------------------------- -# decodeAttribute -# -# anAttribute : an attribute ( TRUE or FALSE ) -# -# return -> '+' or '-' -# ---------------------------------------------------------------------- -def decodeAttribute(anAttribute): - - if anAttribute: - return '+' - else: - return '-' - # end of decodeAttribute Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/StepperWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/StepperWindow.py 2011-01-20 11:56:01 UTC (rev 3892) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/StepperWindow.py 2011-01-24 12:46:14 UTC (rev 3893) @@ -10,7 +10,7 @@ # # E-Cell System is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; either +# License as published by the Free Software Foundation either # version 2 of the License, or (at your option) any later version. # # E-Cell System is distributed in the hope that it will be useful, @@ -53,468 +53,325 @@ import copy class StepperWindow(OsogoWindow): - """StepperWindow - - displayes all stepper property - - user can change each stepper property - """ + """StepperWindow + - displayes all stepper property + - user can change each stepper property + """ - # ========================================================================== - def __init__( self, aSession ): - """Constructor - aSession --- the reference of session - aSession --- the reference of Session - """ + # ========================================================================== + def __init__( self, aSession ): + """Constructor + aSession --- the reference of session + aSession --- the reference of Session + """ - # calls superclass's constructor - OsogoWindow.__init__( self, aSession, 'StepperWindow.glade' ) + # calls superclass's constructor + OsogoWindow.__init__( self, aSession, 'StepperWindow.glade' ) - self.theSession = aSession + self.theSession = aSession - # ========================================================================== - def openWindow(self): + # ========================================================================== + def openWindow(self): + OsogoWindow.openWindow(self) + # initializes attributes + self.theSelectedStepperID = None # selected stepperID (str) + self.theFirstPropertyIter = {} # key:iter(TreeIter) value:None + self.theSelectedPath = {} # key:aStepperID(str) value:Path + self.thePropertyMap = {} + aListStore = gtk.ListStore( gobject.TYPE_STRING ) + self['stepper_id_list'].set_model( aListStore ) + column=gtk.TreeViewColumn('Stepper',gtk.CellRendererText(),text=0) + self['stepper_id_list'].append_column(column) - OsogoWindow.openWindow(self) + aPropertyModel = gtk.ListStore( + gobject.TYPE_STRING, + gobject.TYPE_STRING, + gobject.TYPE_BOOLEAN, + gobject.TYPE_BOOLEAN ) + self['property_list'].set_model(aPropertyModel) - # initializes attributes - self.theSelectedStepperID = None # selected stepperID (str) - self.theFirstPropertyIter = {} # key:iter(TreeIter) value:None - self.theSelectedPath = {} # key:aStepperID(str) value:Path - self.thePropertyMap = {} + column=gtk.TreeViewColumn( 'Property',gtk.CellRendererText(),\ + text=PROPERTY_INDEX ) + column.set_resizable(True) + self['property_list'].append_column(column) - aListStore = gtk.ListStore( gobject.TYPE_STRING ) - self['stepper_id_list'].set_model( aListStore ) - column=gtk.TreeViewColumn('Stepper',gtk.CellRendererText(),text=0) - self['stepper_id_list'].append_column(column) + renderer = gtk.CellRendererText() + renderer.connect( 'edited', self.__updateProperty ) + column=gtk.TreeViewColumn( 'Value', renderer,\ + text=VALUE_INDEX, editable=SET_INDEX, sensitive=SET_INDEX ) + column.set_resizable(True) + self['property_list'].append_column(column) - aPropertyModel=gtk.ListStore( gobject.TYPE_STRING, - gobject.TYPE_STRING, - gobject.TYPE_STRING, - gobject.TYPE_STRING, - gobject.TYPE_STRING) - self['property_list'].set_model(aPropertyModel) - column=gtk.TreeViewColumn( 'Property',gtk.CellRendererText(),\ - text=PROPERTY_INDEX ) - column.set_resizable(True) - self['property_list'].append_column(column) - column=gtk.TreeViewColumn( 'Value',gtk.CellRendererText(),\ - text=VALUE_INDEX ) - column.set_resizable(True) - self['property_list'].append_column(column) - column=gtk.TreeViewColumn( 'Get',gtk.CellRendererText(),\ - text=GET_INDEX ) - column.set_resizable(True) - self['property_list'].append_column(column) - column=gtk.TreeViewColumn( 'Set',gtk.CellRendererText(),\ - text=SET_INDEX ) - column.set_resizable(True) - self['property_list'].append_column(column) - + column=gtk.TreeViewColumn( 'Get',gtk.CellRendererToggle(),\ + active=GET_INDEX ) + column.set_resizable(True) + self['property_list'].append_column(column) - # adds handlers - self.addHandlers({ \ - 'on_stepper_id_list_select' : self.__selectStepperID, # StepperID list - 'on_property_list_select_row' : self.__selectProperty, # Property list - 'on_update_button_clicked' : self.__updateProperty, # update button - 'on_close_button_clicked' : self.deleted, # close button - }) + column=gtk.TreeViewColumn( 'Set',gtk.CellRendererToggle(),\ + active=SET_INDEX ) + column.set_resizable(True) + self['property_list'].append_column(column) + + # adds handlers + self.addHandlers({ \ + 'on_stepper_id_list_select' : self.__selectStepperID, # StepperID list + 'on_close_button_clicked' : self.deleted, # close button + }) - aModel = self['stepper_id_list'].get_model() - aModel.clear() - aFirstIter = None - #for aValue in self.theStepperIDList: - for aValue in self.theSession.getStepperList(): - anIter = aModel.append() - if aFirstIter == None: - aFirstIter = anIter - aModel.set( anIter, 0, aValue ) + aModel = self['stepper_id_list'].get_model() + aModel.clear() - self[self.__class__.__name__].show_all() + aFirstIter = None + #for aValue in self.theStepperIDList: + for aValue in self.theSession.getStepperList(): + anIter = aModel.append() + if aFirstIter == None: + aFirstIter = anIter + aModel.set( anIter, 0, aValue ) - self['stepper_id_list'].get_selection().select_iter(aFirstIter) - self.__selectStepperID(None) + self[self.__class__.__name__].show_all() - def close( self ): - self.theSelectedPath = {} - OsogoWindow.close(self) + self['stepper_id_list'].get_selection().select_iter(aFirstIter) + self.__selectStepperID(None) + def close( self ): + self.theSelectedPath = {} + OsogoWindow.close(self) - # ========================================================================== - def selectStepperID( self, aStepperID ): - """ selects StepperID on screen and displays its property list - if StepperID exists returns True, else returns False - """ - anIter=self['stepper_id_list'].get_model().get_iter_first() - while True: - if anIter == None: - return False - aTitle = self['stepper_id_list'].get_model().get_value(anIter, 0 ) - if aTitle == aStepperID: - aPath = self['stepper_id_list'].get_model().get_path ( anIter ) - self['stepper_id_list'].set_cursor( aPath, None, False ) - break - anIter=self['stepper_id_list'].get_model().iter_next(anIter) - self.__selectStepperID( None ) - return False - + # ========================================================================== + def selectStepperID( self, aStepperID ): + """ selects StepperID on screen and displays its property list + if StepperID exists returns True, else returns False + """ + anIter=self['stepper_id_list'].get_model().get_iter_first() + while True: + if anIter == None: + return False + aTitle = self['stepper_id_list'].get_model().get_value(anIter, 0 ) + if aTitle == aStepperID: + aPath = self['stepper_id_list'].get_model().get_path ( anIter ) + self['stepper_id_list'].set_cursor( aPath, None, False ) + break + anIter=self['stepper_id_list'].get_model().iter_next(anIter) + self.__selectStepperID( None ) + return False - # ========================================================================== - def __selectStepperID( self, *arg ): - """selects stepper ID - Return None - """ + - # When window is not created, does nothing. - if not self.exists(): - return None + # ========================================================================== + def __selectStepperID( self, *arg ): + """selects stepper ID + Return None + """ - # -------------------------------------------------- - # Creates selected StepperSub - # -------------------------------------------------- - iter = self['stepper_id_list'].get_selection().get_selected()[1] - # aStepperID is selected stepper id - aStepperID = self['stepper_id_list'].get_model().get_value(iter,0) - - # When same StepperID is selected, does nothing - if self.theSelectedStepperID != None and aStepperID == self.theSelectedStepperID: - return None - self.theSelectedStepperID = aStepperID - self.thePropertyMap = {} - # aStepperStub is selected StepperStub of selected stepper - aStepperStub = self.theSession.StepperStub( aStepperID ) + # When window is not created, does nothing. + if not self.exists(): + return None + # -------------------------------------------------- + # Creates selected StepperSub + # -------------------------------------------------- + iter = self['stepper_id_list'].get_selection().get_selected()[1] + # aStepperID is selected stepper id + aStepperID = self['stepper_id_list'].get_model().get_value(iter,0) + + # When same StepperID is selected, does nothing + if self.theSelectedStepperID != None and aStepperID == self.theSelectedStepperID: + return None + self.theSelectedStepperID = aStepperID + self.thePropertyMap = {} + # aStepperStub is selected StepperStub of selected stepper + aStepperStub = self.theSession.createStepperStub( aStepperID ) - - # updates property list - aPropertyModel=self['property_list'].get_model() - aPropertyModel.clear() + # updates property list + aPropertyModel = self['property_list'].get_model() + aPropertyModel.clear() - # creats list of ClassName's row - aList = [ 'ClassName', ] + # creats list of ClassName's row + aList = [ 'ClassName', ] - # value - aClassName = aStepperStub.getClassname( ) - aList.append( str(aClassName) ) - self.thePropertyMap[ 'ClassName'] = str( aClassName ) + # value + aClassName = aStepperStub.getClassname( ) + aList.append( str(aClassName) ) + self.thePropertyMap[ 'ClassName' ] = str( aClassName ) - # gettable and settable - aList.append( decodeAttribute( True ) ) # gettable is '+' - aList.append( decodeAttribute( False ) ) # settable is '-' + # gettable and settable + aList.append( True ) # gettable is '+' + aList.append( False ) # settable is '-' - # sets this list to TreeModel - iter = aPropertyModel.append() - for i in range(0,4): - aPropertyModel.set_value(iter,i,aList[i]) - - self.theFirstPropertyIter[aStepperID] = iter + # sets this list to TreeModel + iter = aPropertyModel.append() + for i in range(0, 4): + aPropertyModel.set_value(iter, i, aList[i]) + + self.theFirstPropertyIter[aStepperID] = iter - # -------------------------------------------------- - # sets all propertys' row other than ClassName - # -------------------------------------------------- - for aProperty in aStepperStub.getPropertyList(): + # -------------------------------------------------- + # sets all propertys' row other than ClassName + # -------------------------------------------------- + for aProperty in aStepperStub.getPropertyList(): - # property - aList = [ aProperty, ] # first element + # property + aList = [ aProperty, ] # first element - # gettable and settable - anAttribute = aStepperStub.getPropertyAttributes( aProperty ) - # value - if anAttribute[GETABLE] == 0: - continue - aValue = aStepperStub.getProperty( aProperty ) - self.thePropertyMap[ aProperty ] = aValue + # gettable and settable + anAttribute = aStepperStub.getPropertyAttributes( aProperty ) + # value + if anAttribute[GETABLE] == 0: + continue + aValue = aStepperStub.getProperty( aProperty ) + self.thePropertyMap[ aProperty ] = aValue - aValueString = str( aValue ) - # second element - aList.append( shortenString( aValueString,\ - MAX_STRING_NUMBER) ) + aValueString = str( aValue ) + # second element + aList.append( shortenString( aValueString,\ + MAX_STRING_NUMBER) ) - aList.append( decodeAttribute(anAttribute[GETABLE]) ) # third element - aList.append( decodeAttribute(anAttribute[SETTABLE]) ) # forth element + aList.append( anAttribute[GETABLE] ) # third element + aList.append( anAttribute[SETTABLE] ) # forth element - # sets this list to TreeModel - iter = aPropertyModel.append( ) - #anIterListElement = [iter] - for i in range(0,4): - aPropertyModel.set_value(iter,i,aList[i]) + # sets this list to TreeModel + iter = aPropertyModel.append() + #anIterListElement = [iter] + for i in range(0,4): + aPropertyModel.set_value(iter, i, aList[i]) - self.update() + self.update() - if self.theSelectedPath.has_key(aStepperID): - aPath = self.theSelectedPath[aStepperID] - self['property_list'].get_selection().select_path(aPath) - else: - aPath = (0,) - self.theSelectedPath[aStepperID] = aPath - self['property_list'].get_selection().select_path(aPath) + if self.theSelectedPath.has_key(aStepperID): + aPath = self.theSelectedPath[aStepperID] + self['property_list'].get_selection().select_path(aPath) + else: + aPath = (0,) + self.theSelectedPath[aStepperID] = aPath + self['property_list'].get_selection().select_path(aPath) - self.__selectProperty() + # ========================================================================== + def selectProperty(self, aPropertyName): + """ selects PropertyName on screen + if PropertyName exists returns True, else returns False + """ + anIter=self['property_list'].get_model().get_iter_first() + while True: + if anIter == None: + return False + aTitle = self['property_list'].get_model().get_value(anIter, PROPERTY_INDEX ) + if aTitle == aPropertyName: + aPath = self['property_list'].get_model().get_path ( anIter ) + self['property_list'].set_cursor( aPath, None, False ) + break + anIter=self['property_list'].get_model().iter_next(anIter) - # ========================================================================== - def selectProperty(self, aPropertyName): - """ selects PropertyName on screen - if PropertyName exists returns True, else returns False - """ - anIter=self['property_list'].get_model().get_iter_first() + return False - while True: - if anIter == None: - return False - aTitle = self['property_list'].get_model().get_value(anIter, PROPERTY_INDEX ) - if aTitle == aPropertyName: - aPath = self['property_list'].get_model().get_path ( anIter ) - self['property_list'].set_cursor( aPath, None, False ) - break - anIter=self['property_list'].get_model().iter_next(anIter) + # ========================================================================== + # ========================================================================== + def __updateProperty( self, renderer, path, aValue, *kwarg ): + """updates property + Return None + """ - self.__selectProperty( None ) - return False + # -------------------------------------------------- + # creates selected StepperSub + # -------------------------------------------------- + iter = self['stepper_id_list'].get_selection().get_selected()[1] + aStepperID = self['stepper_id_list'].get_model().get_value(iter,0) + aStepperStub = self.theSession.createStepperStub( aStepperID ) + # gets selected property row + aPropertyModel = self['property_list'].get_model() + iter = aPropertyModel.get_iter(path) + # ----------------------------------------------------------- + # get a property name from property list + # ----------------------------------------------------------- + aPropertyName = aPropertyModel.get_value( iter, PROPERTY_INDEX ) - # ========================================================================== - def __selectProperty( self, *arg ): - """when a property is selected, calls this method. - updates - Returns None - """ + # converts value type + anOldValue = aStepperStub.getProperty( aPropertyName ) - # If Window is closed, do nothing. - if not self.exists(): - return None + # --------------------------------------------------- + # checks float and int type of inputted value + # does not check str. ( not needed ) + # --------------------------------------------------- + # float + if type(anOldValue) == float: + try: + aValue = float(aValue) + except: + # displays confirm window + anErrorMessage = "Input float value." + aDialog = ConfirmWindow(OK_MODE,"Can't set property!\n" + anErrorMessage,'Error!') + return None - # -------------------------------------------------- - # Creates selected StepperSub - # -------------------------------------------------- - iter_stepper = self['stepper_id_list'].get_selection().get_selected()[1] - aStepperID = self['stepper_id_list'].get_model().get_value(iter_stepper,0) - aStepperStub = self.theSession.createStepperStub( aStepperID ) + # int + if type(anOldValue) == int: + try: + aValue = int(aValue) + except: + # displays confirm window + anErrorMessage = "Input int value." + aDialog = ConfirmWindow(OK_MODE,"Can't set property!\n" + anErrorMessage,'Error!') + return None - # -------------------------------------------------- - # gets selected property name - # -------------------------------------------------- - iter = self['property_list'].get_selection().get_selected()[1] - # When nothing is selected, does nothing. - if iter == None: - return None - aPropertyName = self['property_list'].get_model().get_value( iter, PROPERTY_INDEX ) - self.theSelectedPath[aStepperID]=self['property_list'].get_model().get_path(iter) + # sets new value + try: + aStepperStub.setProperty( aPropertyName, aValue ) + aPropertyModel.set_value( iter, VALUE_INDEX, aValue ) + except: - # -------------------------------------------------- - # sets value to value_entry - # -------------------------------------------------- - aValue = None + # displays error message to MessageWindow + anErrorMessage = '\n'.join( traceback.format_exception( sys.exc_type,sys.exc_value,sys.exc_traceback ) ) + self.theSession.message( anErrorMessage ) - # If selected Property is 'ClassName' - if aPropertyName == 'ClassName': - aValue = aStepperStub.getClassname() + # displays confirm window + anErrorMessage = "See MessageWindow for details." + aDialog = ConfirmWindow(OK_MODE,aMessage,"Can't set property!\n" + anErrorMessage) + return False - # If selected Property is not 'ClassName' - else: - aValue = aStepperStub.getProperty( aPropertyName ) + # when to set property is succeeded, + else: + # refreshs self['property_list'] + self.update() + return True - self['value_entry'].set_text( str( aValue ) ) + # ========================================================================== + def update( self ): + """overwrites superclass's method + updates the value of self['property_list'] + """ - # -------------------------------------------------- - # when the selected property is settable, set sensitive value_entry - # when not, set unsensitive value_entry - # -------------------------------------------------- - if self['property_list'].get_model().get_value( iter, SET_INDEX ) == decodeAttribute( True ): - self['value_entry'].set_sensitive( True ) - self['update_button'].set_sensitive( True ) - else: - self['value_entry'].set_sensitive( False ) - self['update_button'].set_sensitive( False ) + # When this window does not created, does nothing + if not self.exists(): + return None - # ========================================================================== - def updateProperty(self, aValue): - """ overwrites selected Property on screen - """ - if self['value_entry'].get_editable(): - self['value_entry'].set_text ( str( aValue ) ) - self.__updateProperty(None) + # gets stepperID + iter_stepper = self['stepper_id_list'].get_selection().get_selected()[1] + aStepperID = self['stepper_id_list'].get_model().get_value(iter_stepper,0) + aStepperStub = self.theSession.createStepperStub( aStepperID ) - # ========================================================================== - def __updateProperty( self, *arg ): - """updates property - Return None - """ + iter = self.theFirstPropertyIter[aStepperID] - # If Window is closed, do nothing. - if not self.exists(): - return None + # updates all value of self['property_list'] + while( True ): + iter = self['property_list'].get_model().iter_next(iter) + if iter == None: + break + aProperty = self['property_list'].get_model().get_value(iter,0) + if type ( self.thePropertyMap[ aProperty ] ) != type( () ): + if aStepperStub.getPropertyAttributes( aProperty )[GETABLE]: + aValue = str( aStepperStub.getProperty( aProperty ) ) + else: + aValue = '' + self['property_list'].get_model().set_value(iter,1,aValue) - # -------------------------------------------------- - # creates selected StepperSub - # -------------------------------------------------- - iter = self['stepper_id_list'].get_selection().get_selected()[1] - aStepperID = self['stepper_id_list'].get_model().get_value(iter,0) - aStepperStub = self.theSession.createStepperStub( aStepperID ) + # updates text - # gets selected property row - iter = self['property_list'].get_selection().get_selected()[1] - if iter == None: - aMessage = 'Select a property.' - aDialog = ConfirmWindow(OK_MODE,aMessage,'Error!') - self['statusbar'].push(1,'property is not selected.') - return None - - self['statusbar'].pop(1) - - # ----------------------------------------------------------- - # gets a value to update - # ----------------------------------------------------------- - aValue = self['value_entry'].get_text( ) - - # ----------------------------------------------------------- - # get a property name from property list - # ----------------------------------------------------------- - aPropertyName = self['property_list'].get_model().get_value( iter, PROPERTY_INDEX ) - - # When the property value is scalar - if type(aValue) != list and type(aValue) != tuple: - - # converts value type - anOldValue = aStepperStub.getProperty( aPropertyName ) - - # --------------------------------------------------- - # checks float and int type of inputted value - # does not check str. ( not needed ) - # --------------------------------------------------- - # float - if type(anOldValue) == float: - try: - aValue = float(aValue) - except: - # displays confirm window - anErrorMessage = "Input float value." - self['statusbar'].push(1,anErrorMessage) - aDialog = ConfirmWindow(OK_MODE,"Can't set property!\n" + anErrorMessage,'Error!') - return None - - # int - if type(anOldValue) == int: - try: - aValue = int(aValue) - except: - # displays confirm window - anErrorMessage = "Input int value." - self['statusbar'].push(1,anErrorMessage) - aDialog = ConfirmWindow(OK_MODE,"Can't set property!\n" + anErrorMessage,'Error!') - return None - - # sets new value - try: - aStepperStub.setProperty( aPropertyName, aValue ) - except: - - # displays error message to MessageWindow - anErrorMessage = '\n'.join( traceback.format_exception( sys.exc_type,sys.exc_value,sys.exc_traceback ) ) - self.theSession.message( anErrorMessage ) - - # displays confirm window - anErrorMessage = "See MessageWindow for details." - self['statusbar'].push(1,anErrorMessage) - aDialog = ConfirmWindow(OK_MODE,aMessage,"Can't set property!\n" + anErrorMessage) - return None - - # when to set property is succeeded, - else: - - # refreshs self['property_list'] - self.update() - - # displays message to status bar - aMessage = "Property is changed." - self['statusbar'].push(1,aMessage) - - # ------------------------------------ - # When the property value is tuple - # ------------------------------------ - else: - - # ------------------------------------------- - # converts value type - # do not check the type of ecah element. - # ------------------------------------------- - anOldValue = aStepperStub.getProperty( aPropertyName ) - anIndexOfTuple = int(aNumber)-1 - - # ------------------------------------------- - # create tuple to set - # ------------------------------------------- - if anIndexOfTuple == 0: - aNewValue = (aValue,) + aValueTuple[anIndexOfTuple+1:] - elif anIndexOfTuple == len(aValueTuple)-1: - aNewValue = aValueTuple[:anIndexOfTuple] + (aValue,) - else: - aNewValue = aValueTuple[:anIndexOfTuple] + (aValue,) + aValueTuple[anIndexOfTuple+1:] - - - # ------------------------------------------- - # sets new value - # ------------------------------------------- - try: - aStepperStub.setProperty( aPropertyName, aNewValue ) - - except: - - # displays error message to MessageWindow - anErrorMessage = '\n'.join( traceback.format_exception( sys.exc_type,sys.exc_value,sys.exc_traceback ) ) - self.theSession.message( aErroeMessage ) - - # displays confirm window - anErrorMessage = "See MessageWindow for details." - aDialog = ConfirmWindow(OK_MODE,aMessage,"Can't set property!\n" + anErrorMessage) - self['statusbar'].push(1,anErrorMessage) - return None - - - # ========================================================================== - def update( self ): - """overwrites superclass's method - updates the value of self['property_list'] - """ - - # When this window does not created, does nothing - if not self.exists(): - return None - - # clears message on statusbar. - self['statusbar'].pop(1) - - # gets stepperID - iter_stepper = self['stepper_id_list'].get_selection().get_selected()[1] - aStepperID = self['stepper_id_list'].get_model().get_value(iter_stepper,0) - aStepperStub = self.theSession.createStepperStub( aStepperID ) - - iter = self.theFirstPropertyIter[aStepperID] - - # updates all value of self['property_list'] - while( True ): - iter = self['property_list'].get_model().iter_next(iter) - if iter == None: - break - aProperty = self['property_list'].get_model().get_value(iter,0) - if type ( self.thePropertyMap[ aProperty ] ) != type( () ): - if aStepperStub.getPropertyAttributes( aProperty )[GETABLE]: - aValue = str( aStepperStub.getProperty( aProperty ) ) - else: - aValue = '' - self['property_list'].get_model().set_value(iter,1,aValue) - - # updates text - self.__selectProperty() - - -# end of StepperWindow - - - Modified: ecell3/trunk/ecell/frontend/session-monitor/glade/EntityListWindow.glade =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/glade/EntityListWindow.glade 2011-01-20 11:56:01 UTC (rev 3892) +++ ecell3/trunk/ecell/frontend/session-monitor/glade/EntityListWindow.glade 2011-01-24 12:46:14 UTC (rev 3893) @@ -1,630 +1,404 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - +<?xml version="1.0" encoding="UTF-8"?> <glade-interface> -<requires lib="gnome"/> - -<widget class="GtkWindow" id="EntityListWindow"> - <property name="visible">True</property> - <property name="title" translatable="yes">EntityList</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="top_frame"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox96"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkComboBox" id="search_scope"> - <property name="visible">True</property> - <property name="items" translatable="yes">All systems + <!-- interface-requires gtk+ 2.6 --> + <!-- interface-naming-policy toplevel-contextual --> + <widget class="GtkWindow" id="EntityListWindow"> + <property name="visible">True</property> + <property name="title" translatable="yes">EntityList</property> + <child> + <widget class="GtkVBox" id="top_frame"> + <property name="visible">True</property> + <property name="border_width">6</property> + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="bottom_padding">4</property> + <child> + <widget class="GtkHBox" id="hbox96"> + <property name="visible">True</property> + <child> + <widget class="GtkComboBox" id="search_scope"> + <property name="visible">True</property> + <property name="items" translatable="yes">All systems Selected systems</property> - <signal name="changed" handler="on_search_scope_changed" last_modification_time="Thu, 05 Aug 2004 12:04:22 GMT"/> - </widget> - <packing> - <property name="padding">1</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="search_method"> - <property name="visible">True</property> - <property name="items" translatable="yes">ID contains</property> - </widget> - <packing> - <property name="padding">1</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="search_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - <signal name="key_press_event" handler="on_search_entry_key_press_event" last_modification_time="Wed, 21 Jul 2004 04:35:49 GMT"/> - </widget> - <packing> - <property name="padding">1</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="search_button"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="label">gtk-find</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_search_button_clicked" last_modification_time="Wed, 21 Jul 2004 03:42:47 GMT"/> - <accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="clicked"/> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="clear_button"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="label">gtk-clear</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_clear_button_clicked" last_modification_time="Wed, 04 Aug 2004 13:11:36 GMT"/> - <accelerator key="c" modifiers="GDK_CONTROL_MASK" signal="clicked"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVSeparator" id="vseparator1"> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkToolButton" id="backbutton"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="stock_id">gtk-go-back</property> - <property name="visible_horizontal">True</property> - <property name="visible_vertical">True</property> - <property name="is_important">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkToolButton" id="forwardbutton"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="stock_id">gtk-go-forward</property> - <property name="visible_horizontal">True</property> - <property name="visible_vertical">True</property> - <property name="is_important">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHPaned" id="hpaned7"> - <property name="width_request">500</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - - <child> - <widget class="GtkVBox" id="hoge_frame"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkVPaned" id="vpaned2"> - <property name="width_request">300</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - - <child> - <widget class="GtkVBox" id="vbox77"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="_system_tree"> - <property name="width_request">100</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow21"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="system_tree"> - <property name="height_request">120</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">False</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <signal name="button_press_event" handler="on_system_tree_button_press_event" last_modification_time="Tue, 25 Mar 2003 17:37:41 GMT"/> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="system_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">System</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">False</property> - </packing> - </child> - - <child> - <widget class="GtkHPaned" id="hpaned8"> - <property name="width_request">300</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - - <child> - <widget class="GtkFrame" id="frame11"> - <property name="width_request">130</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox75"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow15"> - <property name="width_request">80</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="variable_tree"> - <property name="height_request">200</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_BUTTON_PRESS_MASK</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <signal name="button_press_event" handler="on_variable_tree_button_press_event" last_modification_time="Tue, 20 Jul 2004 09:09:53 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="variable_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Variable</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame12"> - <property name="width_request">130</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox76"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow16"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTreeView" id="process_tree"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="headers_visible">True</property> - <property name="rules_hint">False</property> - <property name="reorderable">False</property> - <property name="enable_search">True</property> - <signal name="button_press_event" handler="on_process_tree_button_press_event" last_modification_time="Tue, 20 Jul 2004 09:10:13 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="process_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Process</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">True</property> - </packing> - </child> - </widget> - <packing> - <property name="shrink">True</property> - <property name="resize">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox91"> - <property name="width_request">300</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox92"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkHBox" id="hbox93"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox94"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox95"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow20"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="vscrollbar_policy">GTK_POLICY_NEVER</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkViewport" id="viewport7"> - <property name="visible">True</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkOptionMenu" id="plugin_optionmenu"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Create new PluginWindow</property> - <property name="can_focus">True</property> - <property name="history">-1</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="view_button"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Create New PluginWindow</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">View Selected</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_view_button_clicked" last_modification_time="Tue, 20 Jul 2004 02:48:22 GMT"/> - <accelerator key="C" modifiers="GDK_MOD1_MASK" signal="clicked"/> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - ... [truncated message content] |
From: <mor...@us...> - 2011-01-20 11:56:11
|
Revision: 3892 http://ecell.svn.sourceforge.net/ecell/?rev=3892&view=rev Author: moriyoshi Date: 2011-01-20 11:56:01 +0000 (Thu, 20 Jan 2011) Log Message: ----------- * Make session monitor reloadable. Modified Paths: -------------- ecell3/trunk/ecell/frontend/model-editor/ecell/ui/model_editor/LayoutEml.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/DataGenerator.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/FullPNQueue.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/InterfaceWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/MainWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoPluginManager.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/OsogoPluginWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/Plot.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/StepperWindow.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/VariableReferenceEditor.py ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/opengui.py ecell3/trunk/ecell/frontend/session-monitor/glade/EntityListWindow.glade ecell3/trunk/ecell/frontend/session-monitor/plugins/BargraphWindow.py ecell3/trunk/ecell/frontend/session-monitor/plugins/DigitalWindow.py ecell3/trunk/ecell/frontend/session-monitor/plugins/PropertyWindow.glade ecell3/trunk/ecell/frontend/session-monitor/plugins/PropertyWindow.py ecell3/trunk/ecell/frontend/session-monitor/plugins/TracerWindow.py ecell3/trunk/ecell/frontend/session-monitor/plugins/VariableWindow.py ecell3/trunk/ecell/pyecell/ecell/EntityStub.py ecell3/trunk/ecell/pyecell/ecell/LoggerStub.py ecell3/trunk/ecell/pyecell/ecell/ObjectStub.py ecell3/trunk/ecell/pyecell/ecell/Session.py ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp ecell3/trunk/ecell/pyecell/ecell/ecs.py ecell3/trunk/ecell/pyecell/ecell/ecssupport.py ecell3/trunk/ecell/pyecell/ecell/eml.py ecell3/trunk/ecell/pyecell/ecell/emparser.py ecell3/trunk/ecell/pyecell/ecell3-session.in Removed Paths: ------------- ecell3/trunk/ecell/frontend/session-monitor/glade/FullPNQueue.glade Modified: ecell3/trunk/ecell/frontend/model-editor/ecell/ui/model_editor/LayoutEml.py =================================================================== --- ecell3/trunk/ecell/frontend/model-editor/ecell/ui/model_editor/LayoutEml.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/model-editor/ecell/ui/model_editor/LayoutEml.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -578,9 +578,8 @@ aFullPN = createFullPN( aFullPNString ) - aPropertyName = aFullPN[3] - aFullID = createFullIDString( convertFullPNToFullID( aFullPN ) ) - anEntityPropertyNode = self.__getEntityPropertyNode( aFullID, aPropertyName ) + aFullID, aPropertyName = convertFullPNToFullID( aFullPN ) + anEntityPropertyNode = self.__getEntityPropertyNode( createFullIDString( aFullID ), aPropertyName ) return self.__createValueList( anEntityPropertyNode ) Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/DataGenerator.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/DataGenerator.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/DataGenerator.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -27,6 +27,7 @@ from random import * from numpy import * +from ecell.ecssupport import * import gtk import gtk.gdk @@ -48,7 +49,7 @@ DP_MAX = 4 DP_MIN = 3 -class DataGenerator: +class DataGenerator( object ): ''' DataGenerator class get new data from the source, Logger or Core, @@ -72,7 +73,7 @@ def hasLogger( self, aFullPNString ): - return aFullPNString in self.__theSession.theSimulator.getLoggerList() + return aFullPNString in self.__theSession.getLoggerList() @@ -83,12 +84,13 @@ dataList = zeros( (0,5), LOGGER_TYPECODE ) xAxis = aDataSeries.getXAxis() fullPNString = aDataSeries.getFullPNString() - currentTime = self.__theSession.theSimulator.getCurrentTime() + aFullID, aPropertyName = convertFullPNToFullID( createFullPN( fullPNString ) ) + currentTime = self.__theSession.getCurrentTime() if xAxis == "Time": if not self.hasLogger( fullPNString ): - currentValue = self.__theSession.theSimulator.getEntityProperty( fullPNString ) + currentValue = self.__theSession.getEntityProperty( fullPNString ) dataList = zeros( (1,5), LOGGER_TYPECODE ) dataList[0][0] = currentTime dataList[0][1] = currentValue @@ -98,14 +100,17 @@ else: dataList = aDataSeries.getAllData() - lastTime = dataList[ len( dataList) -1 ][0] + if len( dataList ) > 0: + lastTime = dataList[ -1 ][ 0 ] + else: + lastTime = 0. dataRange = currentTime - lastTime requiredResolution = dataPointWidth - if (dataRange/ requiredResolution)>100: - requiredResolution = dataRange/100 + if (dataRange / requiredResolution) > 100: + requiredResolution = dataRange / 100 dataList = self.theLoggerAdapter.getData( fullPNString, - lastTime, currentTime,requiredResolution ) + lastTime, currentTime, requiredResolution ) # I havent yet updated the new logger code from CVS, but isn't changed to getDigest? @@ -117,8 +122,8 @@ else: #xaxis is fullpn, so this dataseries is used for phase plotting - x = self.__theSession.theSimulator.getEntityProperty( xAxis ) - y = self.__theSession.theSimulator.getEntityProperty( fullPNString ) + x = self.__theSession.getEntityProperty( xAxis ) + y = self.__theSession.getEntityProperty( fullPNString ) dataList = zeros( (1,5), LOGGER_TYPECODE ) dataList[0][0] = x dataList[0][1] = y @@ -164,36 +169,34 @@ aRandom = Random() if self.hasLogger( fullPNString ) and self.hasLogger( xAxis ): - aSimulator = self.__theSession.theSimulator - yStartTime = aSimulator.getLoggerStartTime( fullPNString ) - yWalker = LoggerWalker( aSimulator, fullPNString ) - xWalker = LoggerWalker( aSimulator, xAxis ) - xSize = aSimulator.getLoggerSize( xAxis ) - + yStartTime = self.theLoggerAdapter.getStartTime( fullPNString ) + xAxisLogger = self.theLoggerAdapter.getLogger( xAxis ) + yWalker = LoggerWalker( self.theLoggerAdapter.getLogger( fullPNString ) ) + xWalker = LoggerWalker( xAxisLogger ) xstartpoint = xWalker.findPrevious( yStartTime ) - if xstartpoint != 1: + if xstartpoint is not -1: writeCache = zeros( ( CACHE_INCREMENT, 5 ) ) writeIndex = 0 readIndex = 0 xPoint = xWalker.getNext() - while xPoint != 1: - if aRandom.randint( 0, xSize ) < HISTORY_SAMPLE: + while xPoint is not 1: + if aRandom.randint( 0, xAxisLogger.getSize() ) < HISTORY_SAMPLE: aTime = xPoint[DP_TIME] yPoint1 = yWalker.findPrevious( aTime ) - if yPoint1 == 1: + if yPoint1 is 1: break newDataPoint = zeros( ( 5 ) ) newDataPoint[DP_TIME] = xPoint[DP_VALUE] if yPoint1[DP_TIME] != aTime: while True: - yPoint2 = yWalker.getNext( ) - if yPoint2 == 1: + yPoint2 = yWalker.getNext() + if yPoint2 is 1: break if yPoint2[DP_TIME] > yPoint1[DP_TIME]: break - if yPoint2 == 1: + if yPoint2 is 1: break # interpolate lowerTime = yPoint1[DP_TIME] @@ -262,48 +265,44 @@ aCachedLogger.update() - def getData( self, fullPNString, start, end, interval ): - if fullPNString not in self.theCachedLoggerDict.keys(): - self.theCachedLoggerDict[ fullPNString ] = CachedLogger( self.theSession, fullPNString ) - ret = self.theCachedLoggerDict[ fullPNString ].getData( start, end, interval ) - return ret + def getData( self, fullPNString, start, end, interval=None ): + return self.getLogger( fullPNString ).getData( start, end, interval ) - def getStartTime( self, fullPNString ): - if fullPNString not in self.theCachedLoggerDict.keys(): - self.theCachedLoggerDict[ fullPNString ] = CachedLogger( self.theSession, fullPNString ) - return self.theCachedLoggerDict[ fullPNString ].getStartTime( ) + return self.getLogger( fullPNString ).getStartTime() def getEndTime( self, fullPNString ): - if fullPNString not in self.theCachedLoggerDict.keys(): - self.theCachedLoggerDict[ fullPNString ] = CachedLogger( self.theSession, fullPNString ) - return self.theCachedLoggerDict[ fullPNString ].getEndTime( ) + return self.getLogger( fullPNString ).getEndTime() def getSize( self, fullPNString ): - if fullPNString not in self.theCachedLoggerDict.keys(): - self.theCachedLoggerDict[ fullPNString ] = CachedLogger( self.theSession, fullPNString ) - return self.theCachedLoggerDict[ fullPNString ].getSize( ) + return getLogger( fullPNString ).getSize() -class CachedLogger: + def getLogger( self, fullPNString ): + aLogger = self.theCachedLoggerDict.get( fullPNString, None ) + if aLogger is None: + aLogger = self.theCachedLoggerDict[ fullPNString ] = CachedLogger( self.theSession, fullPNString ) + return aLogger + +class CachedLogger( object ): def __init__( self, aSession, fullPNString ): - self.theFullPNString = fullPNString - self.theSimulator = aSession.theSimulator - if fullPNString not in self.theSimulator.getLoggerList(): - aSession.createLoggerWithPolicy( fullPNString ) + self.theLoggerStub = aSession.createLoggerStub( fullPNString ) + if fullPNString not in aSession.getLoggerList(): + self.theLoggerStub.setLoggerPolicy( aSession.getLogPolicyParameters() ) + self.theLoggerStub.create() self.theLoggerCacheList = [] self.cachedTill = 0.0 self.update() def update( self ): # calculate how many points should be read - loggerSize = self.theSimulator.getLoggerSize( self.theFullPNString ) - startTime = self.theSimulator.getLoggerStartTime( self.theFullPNString ) - endTime = self.theSimulator.getLoggerEndTime( self.theFullPNString ) + loggerSize = self.theLoggerStub.getSize() + startTime = self.theLoggerStub.getStartTime() + endTime = self.theLoggerStub.getEndTime() if loggerSize == 0: averageDistance = -1 else: @@ -320,19 +319,17 @@ readStart = self.cachedTill if startTime == endTime: + dataPoints = self.theLoggerStub.getData() - dataPoints = self.theSimulator.getLoggerData( self.theFullPNString ) - valueColumn = take( dataPoints , (1, ), 1 ) dataPoints = concatenate( ( dataPoints, valueColumn, valueColumn, valueColumn ) , 1 ) self.theLoggerCacheList[0].addPoints( dataPoints ) else: - while ( readStart < endTime ): - + while readStart < endTime: readEnd = min( readFrame, endTime - readStart ) + readStart - dataPoints = self.theSimulator.getLoggerData( self.theFullPNString, readStart, readEnd ) + dataPoints = self.theLoggerStub.getData( readStart, readEnd ) valueColumn = take( dataPoints , (1, ), 1 ) dataPoints = concatenate( ( dataPoints, valueColumn, valueColumn, valueColumn ) , 1 ) @@ -351,45 +348,41 @@ i += 1 - def getData( self, start, end, interval ): - if interval == 0: - vectorLength = 1 - else: + def getData( self, start, end, interval=None ): + if interval is not None: + if start == end: + return ndarray( shape=( 0, 5 ) ) vectorLength = int( ( end - start ) / interval ) - i = len( self.theLoggerCacheList ) -1 - while i >= 0: - aDistance = self.theLoggerCacheList[i].getAverageDistance() - cacheStart = self.theLoggerCacheList[i].getStartTime() - cacheEnd = self.theLoggerCacheList[i].getEndTime() - if aDistance > 0 and \ - self.theLoggerCacheList[i].getSize() > vectorLength and \ - aDistance <= interval /3 : + i = len( self.theLoggerCacheList ) -1 + while i >= 0: + aDistance = self.theLoggerCacheList[i].getAverageDistance() + cacheStart = self.theLoggerCacheList[i].getStartTime() + cacheEnd = self.theLoggerCacheList[i].getEndTime() + if aDistance > 0 and \ + self.theLoggerCacheList[i].getSize() > vectorLength and \ + aDistance <= interval / 3: # start >= cacheStart and end<= cacheEnd and # return self.theLoggerCacheList[i].getData( start, end, interval ) - a=self.theLoggerCacheList[i].getData( start, end, interval ) - return a - i -= 1 - # use logger + return self.theLoggerCacheList[i].getData( start, end, interval ) + i -= 1 + return array( self.theLoggerStub.getData( start, end, interval ), copy=False) + else: + return array( self.theLoggerStub.getData( start, end ), copy=False ) -# return self.theSimulator.getLoggerData(self.theFullPNString, start, end, interval ) - a=self.theSimulator.getLoggerData(self.theFullPNString, start, end, interval ) - return a - - def getStartTime( self ): - return self.theSimulator.getLoggerStartTime(self.theFullPNString) + return self.theLoggerStub.getStartTime() def getEndTime( self ): - return self.theSimulator.getLoggerEndTime(self.theFullPNString) + return self.theLoggerStub.getEndTime() def getSize( self ): - return self.theSimulator.getLoggerSize(self.theFullPNString) + return self.theLoggerStub.getSize() -class LoggerCache: +class LoggerCache( object ): def __init__( self ): self.theCache = zeros( ( 0, 5 ), LOGGER_TYPECODE ) @@ -453,12 +446,7 @@ def getData( self, start, end, interval ): - - vectorLength = ( end - start ) / interval - - if vectorLength > int( vectorLength ): - vectorLength += 1 - vectorLength = int(vectorLength ) + vectorLength = int( ceil( ( end - start ) / interval ) ) aVector = zeros( ( vectorLength, 5 ), LOGGER_TYPECODE ) timeCounter = start lastPoint = self.theCache[ self.cacheEnd - 1 ] @@ -499,17 +487,15 @@ return 0 -class LoggerWalker: - - def __init__( self, aSimulator, aFullPN): - self.theSimulator = aSimulator - self.theFullPN = aFullPN - self.theStart = aSimulator.getLoggerStartTime( aFullPN ) - self.theEnd = aSimulator.getLoggerEndTime( aFullPN ) - size = aSimulator.getLoggerSize( aFullPN ) +class LoggerWalker( object ): + def __init__( self, aLogger ): + self.theLogger = aLogger + self.theStart = aLogger.getStartTime() + self.theEnd = aLogger.getEndTime() + size = aLogger.getSize() self.theAvgDistance = ( self.theEnd - self.theStart ) / size self.cachedTill = -1 - self.theCache = zeros( ( 0,5 ) ) + self.theCache = zeros( ( 0, 5 ) ) self.index = 0 self.__readCache() @@ -523,8 +509,8 @@ else: readStart = self.cachedTill readEnd = min( self.theAvgDistance * int(READ_CACHE/2), self.theEnd - self.cachedTill ) + readStart - newPoints = self.theSimulator.getLoggerData( self.theFullPN, readStart, readEnd ) - if len( self.theCache) > 0: + newPoints = self.theLogger.getData( readStart, readEnd ) + if len( self.theCache ) > 0: halfIndex = int(len(self.theCache) /2 ) self.index = len( self.theCache ) - halfIndex self.theCache = concatenate( ( self.theCache[ halfIndex: ], newPoints ) ) @@ -562,4 +548,4 @@ # smaller then what logger contains return -1 self.index = nextIndex - return self.getNext( ) + return self.getNext() Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/EntityListWindow.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -88,6 +88,8 @@ self.thePropertyWindow = None self.thePluginInstanceSelection = None + self.theAssociatedSession = None + def openWindow( self ): @@ -100,21 +102,13 @@ # add handers self.addHandlers( { - # system tree - # 'on_system_tree_cursor_changed' :\ - # self.updateSystemSelection,\ - 'on_system_tree_button_press_event' : self.popupMenu,\ - # entity list - # 'on_process_tree_cursor_changed': self.selectProcess,\ - # 'on_variable_tree_cursor_changed':self.selectVariable,\ - - 'on_view_button_clicked': self.createPluginWindow,\ - 'on_variable_tree_button_press_event': self.popupMenu,\ - 'on_process_tree_button_press_event': self.popupMenu,\ + 'on_system_tree_button_press_event' : self.popupMenu, + 'on_view_button_clicked': self.createPluginWindow, + 'on_variable_tree_button_press_event': self.popupMenu, + 'on_process_tree_button_press_event': self.popupMenu, # search - 'on_search_button_clicked': self.pushSearchButton,\ - 'on_search_entry_key_press_event':\ - self.keypressOnSearchEntry,\ + 'on_search_button_clicked': self.pushSearchButton, + 'on_search_entry_key_press_event': self.keypressOnSearchEntry, 'on_clear_button_clicked': self.pushClearButton, 'on_search_scope_changed': self.searchScopeChanged } ) @@ -131,51 +125,36 @@ # initialize components # -------------------------------------------- self.__initializeSystemTree() - self.systemTreeConstructed = False - if self.theSession.theModelWalker != None: - self.reconstructSystemTree() - self.__initializeProcessTree() self.__initializeVariableTree() self.__initializeSelection() self.__initializePluginWindowOptionMenu() - aFullPN = convertFullIDToFullPN( createFullID ( 'System::/' ) ) - self.theQueue = FullPNQueue( self["navigator_area"] , [ aFullPN ] ) - - self.theQueue.registerCallback( self.doSelection ) + self.theQueue = None self.__initializePropertyWindow() self.__initializePopupMenu() - # -------------------------------------------- - # initialize buffer - # -------------------------------------------- self.theSelectedEntityList = [] self.theSelectedPluginInstanceList = [] - # -------------------------------------------- - # initialize Add to Board button - # -------------------------------------------- self.CloseOrder = False self.updateButtons() - - - - - def updateButtons( self ): - if ( self.theSession.theModelWalker != None ): + if self.theSession.theSession is not None: self['search_button'].set_sensitive(True) self['view_button'].set_sensitive(True) self['search_entry'].set_sensitive(True) self['plugin_optionmenu'].set_sensitive(True) - + self['backbutton'].set_sensitive(False) + self['forwardbutton'].set_sensitive(False) else: - self['search_button'].set_sensitive(0) - self['view_button'].set_sensitive(0) - self['search_entry'].set_sensitive(0) - self['plugin_optionmenu'].set_sensitive(0) + self['search_button'].set_sensitive(False) + self['view_button'].set_sensitive(False) + self['search_entry'].set_sensitive(False) + self['plugin_optionmenu'].set_sensitive(False) + self['backbutton'].set_sensitive(False) + self['forwardbutton'].set_sensitive(False) def getQueue( self ): @@ -330,13 +309,9 @@ def __initializePropertyWindow( self ): if self.thePropertyWindow != None: return - self.thePropertyWindow= self.thePluginManager.createInstance( - 'PropertyWindow',\ - [(SYSTEM, '', '/', '')],\ - rootWidget= 'top_frame',\ - parent= self ) - - if ( self.theStatusbar != None ): + self.thePropertyWindow = self.thePluginManager.createInstance( + 'PropertyWindow', [], rootWidget='top_frame', parent=self ) + if self.theStatusbar is not None: self.thePropertyWindow.setStatusBar( self.theStatusbar ) aPropertyWindowTopVBox = self.thePropertyWindow['top_frame'] @@ -470,23 +445,21 @@ Returns None [Note]:creates and adds submenu that includes menus of PluginWindow instances """ - # When right button is pressed + # When left button is pressed if anEvent.type == gtk.gdk._2BUTTON_PRESS: - aSelectedRawFullPNList = self.__getSelectedRawFullPNList() aPluginWindowType = self['plugin_optionmenu'].get_children()[0].get() # When no FullPN is selected, displays error message. if aSelectedRawFullPNList != None: if len( aSelectedRawFullPNList ) == 0: - aMessage = 'No entity is selected.' aDialog = ConfirmWindow(OK_MODE,aMessage,'Error!') self.thePropertyWindow.showMessageOnStatusBar(aMessage) return False #self.theQueue.pushFullPNList( aSelectedRawFullPNList ) - self.thePluginManager.createInstance( aPluginWindowType, self.thePropertyWindow.theFullPNList() ) + self.thePluginManager.createInstance( aPluginWindowType, self.thePropertyWindow.getFullPNList() ) @@ -541,23 +514,18 @@ self.thePopupMenu.popup(None,None,None,anEvent.button,anEvent.time) -# def reset( self ): -# -# self.reconstructSystemTree() -# self.reconstructLists() -# self.update() - - def update( self ): """overwrite superclass's method updates this window and property window Returns None """ - if self.theSession.theModelWalker == None: - return - elif not self.systemTreeConstructed: + if self.theSession.theSession is not self.theAssociatedSession: self.reconstructSystemTree() - + self.theQueue = FullPNQueue( ( self[ "backbutton" ], self[ "forwardbutton" ] ) ) + self.theQueue.registerCallback( self.doSelection ) + self.theQueue.pushFullPNList( [ convertFullIDToFullPN( createFullID ( 'System::/' ) ) ] ) + self.updateButtons() + # updates this window if not self.exists(): return @@ -571,13 +539,11 @@ self.thePluginInstanceSelection.update() self.updateLists() + self.theAssociatedSession = self.theSession.theSession - def constructSystemTree( self, parent, fullID ): - # System tree - newlabel = fullID[ID] systemStore = self.systemTree.get_model() @@ -603,18 +569,17 @@ def reconstructSystemTree( self ): - rootSystemFullID = createFullID( 'System::/' ) - self.constructSystemTree( None, rootSystemFullID ) - self.systemTreeConstructed = True + self.donotHandle = True + self.theSysTreeStore.clear() + self.donotHandle = False + if self.theSession.theSession: + self.constructSystemTree( None, rootSystemFullID ) + self.reconstructLists() - def reconstructLists( self ): selectedSystemList = self.getSelectedSystemList() - - if len( selectedSystemList ) == 0: - return if self.entitySelected: return # Variable list @@ -638,14 +603,13 @@ typeID = ENTITYTYPE_DICT[ type ] fullIDList = [] - for systemFullID in systemList: + if self.theSession.theSession is not None: + for systemFullID in systemList: + systemPath = createSystemPathFromFullID( systemFullID ) - systemPath = createSystemPathFromFullID( systemFullID ) + idList = self.theSession.getEntityList( type, systemPath ) + fullIDList += [ ( typeID, systemPath, id ) for id in idList ] - idList = self.theSession.getEntityList( type, systemPath ) - fullIDList += [ ( typeID, systemPath, id ) for id in idList ] - - entityStore = view.get_model() # clear the store @@ -654,7 +618,7 @@ entityStore.clear() self.donotHandle = donotHandle - # columnList = view.get_columns() + # columnList = view.get_columns() # re-create the list for fullID in fullIDList: @@ -693,21 +657,19 @@ def doSelection( self, aFullPNList ): - if self.theSession.theModelWalker == None: - return self.doSelectSystem( aFullPNList ) self.doSelectProcess( aFullPNList ) self.doSelectVariable( aFullPNList ) def doSelectSystem( self, aFullPNList ): - targetFullIDList = [] if aFullPNList[0][TYPE] != SYSTEM: targetFullIDList += [ createFullIDFromSystemPath( aFullPN[SYSTEMPATH] ) for aFullPN in aFullPNList ] else: for aFullPN in aFullPNList: - targetFullIDList.append( convertFullPNToFullID( aFullPN ) ) + aFullID, _ = convertFullPNToFullID( aFullPN ) + targetFullIDList.append( aFullID ) # if to slow there should be a check whether this is needed in all cases donotHandle = self.donotHandle @@ -719,11 +681,11 @@ #doselection targetPath = createSystemPathFromFullID( targetFullID ) anIter = self.getSysTreeIter( targetPath ) + if anIter is not None: + aPath = self.theSysTreeStore.get_path( anIter ) + self.__expandRow( aPath ) + self.theSysSelection.select_iter( anIter ) - aPath = self.theSysTreeStore.get_path( anIter ) - self.__expandRow( aPath ) - self.theSysSelection.select_iter( anIter ) - self.donotHandle = donotHandle self.reconstructLists() @@ -851,7 +813,7 @@ for systemFullID in systemFullIDList: fullPNList.append( convertFullIDToFullPN( systemFullID ) ) self.donotHandle = True - self.theQueue.pushFullPNList( fullPNList ) + self.theQueue.pushFullPNList( fullPNList ) self.donotHandle = False @@ -889,6 +851,8 @@ This method updates property values shown in the list of Variables and Processes. ''' + if self.theSession.theSession is None: + return self.updateEntityList( 'Process', self.processTree.get_model(),\ self.PROCESS_COLUMN_LIST,\ @@ -939,7 +903,6 @@ def selectProcess( self, selection ): - if self.donotHandle: return self.entitySelected = True @@ -951,7 +914,7 @@ # get selected items selection.selected_foreach(self.process_select_func) - if len(self.theSelectedFullPNList)>0: + if len( self.theSelectedFullPNList ) > 0: self.donotHandle = True self.theQueue.pushFullPNList( self.theSelectedFullPNList ) self.donotHandle = False @@ -973,7 +936,7 @@ # get selected items selection.selected_foreach(self.variable_select_func) - if len(self.theSelectedFullPNList)>0: + if len( self.theSelectedFullPNList ) > 0: self.donotHandle = True self.theQueue.pushFullPNList( self.theSelectedFullPNList ) self.donotHandle = False @@ -1047,7 +1010,7 @@ return False #self.theQueue.pushFullPNList( aSelectedRawFullPNList ) - self.thePluginManager.createInstance( aPluginWindowType, self.thePropertyWindow.theFullPNList() ) + self.thePluginManager.createInstance( aPluginWindowType, self.thePropertyWindow.getFullPNList() ) @@ -1155,42 +1118,8 @@ Return a list of selected FullPNs """ return self.theQueue.getActualFullPNList() - - # this is redundant - self.theSelectedFullPNList = [] - if ( self.theLastSelectedWindow == "None" ): - return None - if ( self.theLastSelectedWindow == "Variable" ): - - selection=self.variableTree.get_selection() - selection.selected_foreach(self.variable_select_func) - - if ( self.theLastSelectedWindow == "Process" ): - - selection=self.processTree.get_selection() - selection.selected_foreach(self.process_select_func) - - if len(self.theSelectedFullPNList) == 0: - selectedSystemList = self.getSelectedSystemList() - for aSystemFullID in selectedSystemList: - self.theSelectedFullPNList.append( convertFullIDToFullPN( aSystemFullID ) ) - - - # If no property is selected on PropertyWindow, - # create plugin Window with default property (aValue) - if len( str(self.thePropertyWindow.getSelectedFullPN()) ) == 0: - return self.theSelectedFullPNList - - # If a property is selected on PropertyWindow, - # create plugin Window with selected property - else: - return [self.thePropertyWindow.getSelectedFullPN()] - - - - def addToBoard( self, *arg ): """add plugin window to board """ @@ -1252,8 +1181,23 @@ # creates Logger using PropertyWindow #self.theQueue.pushFullPNList( aSelectedRawFullPNList ) - self.thePropertyWindow.createLogger() + aLogPolicy = self.theSession.getLogPolicyParameters() + try: + for aFullPN in self.getFullPNList(): + # creates loggerstub and call its create method. + aLoggerStub = self.theSession.createLoggerStub( createFullPNString( aFullPN ) ) + if not aLoggerStub.exists(): + aLoggerStub.setLoggerPolicy( aLogPolicy ) + aLoggerStub.create() + except: + # When to create log is failed, display error message on MessageWindow. + anErrorMessage = traceback.format_exception(sys.exc_type,sys.exc_value,sys.exc_traceback) + self.thePluginManager.printMessage( anErrorMessage ) + return + # updates fandamental windows. + self.thePluginManager.updateFundamentalWindows() + # display message on status bar if len(aSelectedRawFullPNList) == 1: aMessage = 'Logger was created.' Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/FullPNQueue.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/FullPNQueue.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/FullPNQueue.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -30,55 +30,44 @@ import ecell.ui.osogo.Window as Window from ecell.ui.osogo.config import * -class FullPNQueue: - - def __init__( self, anAttachmentPoint, aFullPNList ): +class FullPNQueue( object ): + def __init__( self, anAttachmentPoint, aRawFullPNList=None ): self.backwardQueue = [] self.forwardQueue = [] - self.theRawFullPNList = aFullPNList - aWindow = Window.Window( - os.path.join( GLADEFILE_PATH, self.__class__.__name__ + '.glade'), - "hbox1" - ) - aWindow.openWindow() - aFrame = aWindow['hbox1'] - self.backButton = aWindow['backbutton'] - self.forwardButton = aWindow['forwardbutton'] - anAttachmentPoint.add( aFrame ) - self.backButton.connect( "clicked", self.__goBack ) - self.forwardButton.connect( "clicked", self.__goForward ) + if aRawFullPNList is not None: + self.theRawFullPNList = self.__copyList( aRawFullPNList ) + else: + self.theRawFullPNList = None + self.backButton = anAttachmentPoint[0] + self.forwardButton = anAttachmentPoint[1] + self.thebackbuttonHandle = self.backButton.connect( "clicked", self.__goBack ) + self.theForwardButtonHandle = self.forwardButton.connect( "clicked", self.__goForward ) self.callbackList = [] self.__updateNavigatorButtons() + def __del__( self ): + self.backButton.disconnect( self.theBackButtonHandle ) + self.forwardButton.disconnect( self.theForwardButtonHandle ) + def registerCallback( self, aFunction ): self.callbackList.append( aFunction ) - apply( aFunction, [self.theRawFullPNList] ) - def pushFullPNList( self, aRawFullPNList ): - self.backwardQueue.append( self.__copyList ( self.theRawFullPNList ) ) + aRawFullPNList = self.__copyList( aRawFullPNList ) + if self.theRawFullPNList is not None: + self.backwardQueue.append( self.theRawFullPNList ) + self.theRawFullPNList = aRawFullPNList self.forwardQueue = [] - - self.__applyFullPNList( aRawFullPNList ) + self.applyFullPNList() self.__updateNavigatorButtons() def getActualFullPNList( self ): - return self.__copyList( self.theRawFullPNList ) + return self.theRawFullPNList - def __applyFullPNList( self, aRawFullPNList ): - self.theRawFullPNList = self.__copyList( aRawFullPNList ) + def applyFullPNList( self ): for aFunction in self.callbackList: + apply( aFunction, [ self.theRawFullPNList ] ) - apply( aFunction, [aRawFullPNList] ) - - - def applyFullPNList( self ): - for aFunction in self.callbackList: - - apply( aFunction, [self.theRawFullPNList] ) - - - def __copyList( self, aList ): newList = [] for anItem in aList: @@ -87,39 +76,28 @@ else: newList.append( self.__copyList( anItem ) ) return newList - - def __goBack(self, *args): if len( self.backwardQueue ) == 0: return rawFullPNList = self.backwardQueue.pop() self.forwardQueue.append( self.__copyList( self.theRawFullPNList ) ) - self.__applyFullPNList( rawFullPNList ) + self.theRawFullPNList = rawFullPNList + self.applyFullPNList() self.__updateNavigatorButtons() - def __goForward( self, *args ): if len( self.forwardQueue ) == 0: return rawFullPNList = self.forwardQueue.pop() self.backwardQueue.append( self.__copyList( self.theRawFullPNList ) ) - self.__applyFullPNList( rawFullPNList ) + self.theRawFullPNList = rawFullPNList + self.applyFullPNList() self.__updateNavigatorButtons() - def __updateNavigatorButtons( self ): - if len( self.backwardQueue ) == 0: - backFlag = False - else: - backFlag = True - if len( self.forwardQueue ) == 0: - forFlag = False - else: - forFlag = True - self.forwardButton.set_sensitive( forFlag ) - self.backButton.set_sensitive( backFlag ) - + self.forwardButton.set_sensitive( len( self.forwardQueue ) > 0 ) + self.backButton.set_sensitive( len( self.backwardQueue ) > 0 ) # read buttons fromfile # create from EntityList Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -57,28 +57,23 @@ import ecell.ui.osogo.BoardWindow as BoardWindow import ecell.ui.osogo.LoggingPolicy as LoggingPolicy import ecell.ui.osogo.OsogoPluginManager as OsogoPluginManager +from ecell.ui.osogo.DataGenerator import * -class GtkSessionMonitor(Session): -# -# GtkSessionMonitor class functions -# - # ========================================================================== - def __init__(self, aSimulator = None ): +class GtkSessionMonitor(object): + def __init__(self): """sets up the osogo session, creates Mainwindow and other fundamental windows but doesn't show them""" - #calls superclass - Session.__init__(self, aSimulator ) + self.theSession = None + self.theModelWalker = None + self.theMessageMethod = None + self.theDataGenerator = None - if aSimulator == None: - self.theModelWalker = None - else: - self.theModelWalker = ModelWalker( aSimulator ) self.updateCallbackList = [] # ------------------------------------- # reads defaults from osogo.ini # ------------------------------------- - self.theConfigDB=ConfigParser.ConfigParser() + self.theConfigDB = ConfigParser.ConfigParser() self.theIniFileName = os.path.join( home_dir, '.ecell', 'osogo.ini' ) theDefaultIniFileName = os.path.join( conf_dir, 'osogo.ini' ) @@ -133,31 +128,22 @@ self.theEntityListInstanceMap = {} # ------------------------------------- - # initializes for run method - # ------------------------------------- - self.theSimulator.setEventHandler( lambda: - gtk.events_pending() and gtk.main_iteration() ) - - # ------------------------------------- # creates MainWindow # ------------------------------------- self.theMainWindow = aMainWindow - # ========================================================================== def GUI_interact(self): "hands over controlto the user (gtk.main_loop())" gtk.main() - # ========================================================================== def QuitGUI( self ): """ quits gtk.main_loop() after saving changes """ gtk.main_quit() - # ========================================================================== - def doesExist( self, aWindowName): + def doesExist( self, aWindowName ): """ aWindowName: (str) name of Window returns True if window is opened False if window is not opened @@ -181,15 +167,11 @@ return False - # ========================================================================== def openWindow( self, aWindowName, rootWidget = None, rootWindow = None ): """opens up window and returns aWindowname instance aWindowName --- Window name (str) Returns FundamentalWindow or EntityListWindow list """ - if len(self.theModelName) == 0 and aWindowName != 'MainWindow': - message ( "Model has not yet been loaded. Can't open windows." ) - return None # When the WindowName does not match, create nothing. if self.theFundamentalWindows.has_key( aWindowName ): if rootWidget == None: @@ -204,7 +186,6 @@ message( "No such WindowType (%s) " %aWindowName ) return None - # ========================================================================== def getWindow( self, aWindowName ): """ aWindowName --- Window name (str) @@ -228,7 +209,6 @@ return None - # ========================================================================== def displayWindow( self, aWindowName ): """When the Window is not created, calls its openWidow() method. When already created, move it to the top of desktop. @@ -250,7 +230,6 @@ self.theFundamentalWindows[aWindowName].openWindow() self.theFundamentalWindows[aWindowName].update() - # ========================================================================== def toggleWindow( self, aWindowName, aNewState=None ): aState = self.theFundamentalWindows[aWindowName].exists() if aNewState is None: @@ -264,7 +243,6 @@ if self.theFundamentalWindows['MainWindow'].exists(): self.theFundamentalWindows['MainWindow'].update() - # ========================================================================== def createPluginWindow(self, aType, aFullPNList): """ opens and returns _PluginWindow instance of aType showing aFullPNList returns None if pluginwindow could not have been created """ @@ -274,7 +252,6 @@ return anInstance - # ========================================================================== def createPluginOnBoard(self, aType, aFullPNList): """ creates and adds plugin to pluginwindow and returns plugininstance """ aBoardWindow = self.getWindow('BoardWindow') @@ -284,7 +261,6 @@ return aBoardWindow.addPluginWindows( aType, aFullPNList) - # ========================================================================== def openLogPolicyWindow(self, aLogPolicy, aTitle ="Set log policy" ): """ pops up a modal dialog window with aTitle (str) as its title @@ -298,14 +274,13 @@ aLogPolicyWindow = LoggingPolicy.LoggingPolicy( self, aLogPolicy, aTitle ) return aLogPolicyWindow.return_result() - # ========================================================================== def createEntityListWindow( self, rootWidget = 'EntityListWindow', aStatusBar=None ): """creates and returns an EntityListWindow """ anEntityListWindow = None # when Model is already loaded. - if len(self.theModelName) > 0: + if self.theSession is not None: # creates new EntityListWindow instance anEntityListWindow = EntityListWindow.EntityListWindow( self, rootWidget, aStatusBar ) anEntityListWindow.openWindow() @@ -327,12 +302,10 @@ return anEntityListWindow - # ========================================================================== def registerUpdateCallback( self, aFunction ): self.updateCallbackList.append( aFunction ) - # ========================================================================== def deleteEntityListWindow( self, anEntityListWindow ): """deletes the reference to the instance of EntityListWindow anEntityListWindow --- an instance of EntityListWindow(EntityListWindow) @@ -354,7 +327,6 @@ anEntityListWindow.close() del self.theEntityListInstanceMap[ anEntityListWindow ] - # ========================================================================== def __updateByTimeOut( self, arg ): """when time out, calls updates method() Returns None @@ -373,7 +345,6 @@ self.theTimer = gobject.timeout_add( int(self.theUpdateInterval), self.__updateByTimeOut, 0 ) - # ========================================================================== def __removeTimeOut( self ): """removes time out Returns None @@ -381,7 +352,6 @@ gobject.source_remove( self.theTimer ) - # ========================================================================== def updateWindows( self ): self.theMainWindow.update() self.updateFundamentalWindows() @@ -391,18 +361,15 @@ apply( aFunction ) - # ========================================================================== def setUpdateInterval(self, Secs): "plugins are refreshed every secs seconds" self.theMainWindow.theUpdateInterval = Secs - # ========================================================================== def getUpdateInterval(self ): # "returns the rate by plugins are refreshed " return self.theMainWindow.theUpdateInterval - # ========================================================================== def updateFundamentalWindows( self ): """updates fundamental windows Return None @@ -419,8 +386,6 @@ #update MainWindow self.theMainWindow.update() - - # ========================================================================== def __readIni(self,aPath): """read osogo.ini file an osogo.ini file may be in the given path @@ -454,7 +419,6 @@ anErrorMessage = '\n'.join( traceback.format_exception( sys.exc_type,sys.exc_value,sys.exc_traceback ) ) self.message(anErrorMessage) - # ========================================================================== def getParameter(self, aParameter): """tries to get a parameter from ConfigDB if the param is not present in either osogo or default section @@ -469,7 +433,6 @@ # gets it from default return self.theConfigDB.get('DEFAULT',aParameter) - # ========================================================================== def setParameter(self, aParameter, aValue): """tries to set a parameter in ConfigDB if the param is not present in either osogo or default section @@ -484,7 +447,6 @@ # sets it in default self.theConfigDB.set('DEFAULT',aParameter, str(aValue)) - # ========================================================================== def saveParameters( self ): """tries to save all parameters into a config file in home directory """ @@ -497,23 +459,6 @@ except: self.message("Could not save preferences into file %s.\n Please check permissions for home directory.\n"%self.theIniFileName) - #------------------------------------------------------------------- - def createLoggerWithPolicy( self, fullpn, logpolicy = None ): - """creates logger for fullpn with logpolicy. if logpolicy parameter is not given, gets parameters from - config database - """ - # if logpolicy is None get it from parameters - if logpolicy == None: - logpolicy = self.getLogPolicyParameters() - self.theSimulator.createLogger( fullpn, logpolicy ) - - #------------------------------------------------------------------- - def changeLoggerPolicy( self, fullpn, logpolicy ): - """changes logging policy for a given logger - """ - self.theSimulator.setLoggerPolicy( fullpn, logpolicy ) - - #------------------------------------------------------------------- def getLogPolicyParameters( self ): """ gets logging policy from config database @@ -527,7 +472,6 @@ logPolicy[0]=1 return logPolicy - #------------------------------------------------------------------- def setLogPolicyParameters( self, logPolicy ): """ saves logging policy into config database @@ -538,43 +482,51 @@ self.setParameter( 'available_space' ,logPolicy[3] ) self.saveParameters() + def interact( self, parameters={} ): + self.theSession.interact( parameters ) -#------------------------------------------------------------------------ -#IMPORTANT! -# -#Session methods to be used in interactive scripting shoould be overloaded here -#------------------------------------------------------------------------- + def unload( self ): + if self.theSession is None: + return + self.stop() + self.theSession = None + self.theModelWalker = None + self.theDataGenerator = None + self.updateWindows() - #------------------------------------------------------------------- - def loadScript( self, ecs, parameters={} ): - #self.__readIni( ecs ) - Session.loadScript (self, ecs, parameters ) + def newSession( self ): + self.theSession = Session() + self.theModelWalker = ModelWalker( self.theSession.theSimulator ) + self.theDataGenerator = DataGenerator( self ) + self.theSession.theSimulator.setEventHandler( lambda: + gtk.events_pending() and gtk.main_iteration() ) + self.theSession.setMessageMethod( self.theMessageMethod ) - #------------------------------------------------------------------- - def interact( self, parameters={} ): - Session.interact (self, parameters ) - - #------------------------------------------------------------------- def loadModel( self, aModel ): #self.__readIni( aModel ) + self.unload() + self.newSession() + self.theSession.loadModel( aModel ) - Session.loadModel( self, aModel ) - self.theModelWalker = ModelWalker( self.theSimulator ) - - #------------------------------------------------------------------- def saveModel( self , aModel ): - Session.saveModel( self , aModel ) + if self.theSession is None: + raise Exception( "Model is not loaded" ) + self.theSession.saveModel( self , aModel ) - #------------------------------------------------------------------- def setMessageMethod( self, aMethod ): - Session.setMessageMethod( self, aMethod ) + self.theMessageMethod = aMethod + if self.theSession is not None: + self.theSession.setMessageMethod( aMethod ) - #------------------------------------------------------------------- + def restoreMessageMethod( self ): + if self.theSession is None: + return + self.theSession.restoreMessageMethod() + def message( self, message ): - Session.message( self, message ) + self.theMessageMethod( message ) #self._synchronize() - #------------------------------------------------------------------- def run( self , time = '' ): """ if already running: do nothing @@ -583,6 +535,8 @@ if Mainwindow is not opened create a stop button set up a timeout rutin and Running Flag """ + if self.theSession is None: + raise Exception("Model is not loaded") if self.theRunningFlag == True: return @@ -597,7 +551,7 @@ aCurrentTime = self.getCurrentTime() self.message("%15s"%aCurrentTime + ":Start\n" ) - Session.run( self, time ) + self.theSession.run( time ) self.theRunningFlag = False self.__removeTimeOut() @@ -609,15 +563,15 @@ self.updateWindows() - #------------------------------------------------------------------- def stop( self ): """ stop Simulation, remove timeout, set Running flag to false """ + if self.theSession is None: + raise Exception("Model is not loaded") - try: if self.theRunningFlag == True: - Session.stop( self ) + self.theSession.stop() aCurrentTime = self.getCurrentTime() self.message( ("%15s"%aCurrentTime + ":Stop\n" )) @@ -630,11 +584,13 @@ self.updateWindows() #self._synchronize() - #------------------------------------------------------------------- def step( self, num = None ): """ step according to num, if num is not given, according to set step parameters """ + if self.theSession is None: + raise Exception("Model is not loaded") + if self.theRunningFlag == True: return @@ -649,7 +605,7 @@ self.message( "Step\n" ) self.theTimer = gobject.timeout_add( self.theUpdateInterval, self.__updateByTimeOut, 0 ) - Session.step( self, int( num ) ) + self.theSession.step( int( num ) ) self.theRunningFlag = False self.__removeTimeOut() @@ -660,60 +616,84 @@ self.theRunningFlag = False self.updateWindows() - #self._synchronize() def isRunning(self): return self.theRunningFlag - #------------------------------------------------------------------- def getNextEvent( self ): - return Session.getNextEvent( self ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.getNextEvent() + def getCurrentTime( self ): - return Session.getCurrentTime( self ) + if self.theSession is None: + return float("nan") - #------------------------------------------------------------------- - def setEventChecker( self, event ): - Session.setEventChecker( self, event ) + return self.theSession.getCurrentTime() - #------------------------------------------------------------------- - def setEventHandler( self, event ): - Session.setEventHandler( self, event ) - def getStepperList( self ): - return Session.getStepperList( self ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.getStepperList() + def createStepperStub( self, id ): - return Session.createStepperStub( self, id ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.createStepperStub( id ) + def getEntityList( self, entityType, systemPath ): - return Session.getEntityList( self, entityType, systemPath ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.getEntityList( entityType, systemPath ) + def createEntityStub( self, fullid ): - return Session.createEntityStub( self, fullid ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- - def getLoggerList( self ): - return Session.getLoggerList( self ) + return self.theSession.createEntityStub( fullid ) - #------------------------------------------------------------------- - def createLogger( self, fullpn ): - Session.createLogger( self, fullpn ) -#FIXME #remember refresh Tracer and Loggerwindows!!! + def getEntityProperty( self, fullPN ): + if self.theSession is None: + raise Exception("Model is not loaded") + return self.theSession.getEntityProperty( fullPN ) + def getEntityPropertyAttributes( self, fullPN ): + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.getEntityPropertyAttributes( fullPN ) + + def setEntityProperty( self, fullPN, aValue ): + if self.theSession is None: + raise Exception("Model is not loaded") + + self.theSession.setEntityProperty( fullPN, aValue ) + + def getLoggerList( self ): + if self.theSession is None: + raise Exception("Model is not loaded") + + return self.theSession.getLoggerList() + def createLoggerStub( self, fullpn ): - return Session.createLoggerStub( self, fullpn ) + if self.theSession is None: + raise Exception("Model is not loaded") - #------------------------------------------------------------------- + return self.theSession.createLoggerStub( fullpn ) + def saveLoggerData( self, fullpn=0, aSaveDirectory='./Data', aStartTime=-1, anEndTime=-1, anInterval=-1 ): - Session.saveLoggerData( self, fullpn, aSaveDirectory, aStartTime, anEndTime, anInterval ) + if self.theSession is None: + raise Exception("Model is not loaded") + self.theSession.saveLoggerData( fullpn, aSaveDirectory, aStartTime, anEndTime, anInterval ) + def getDataGenerator( self ): + if self.theSession is None: + raise Exception("Model is not loaded") + return self.theDataGenerator Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/InterfaceWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/InterfaceWindow.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/InterfaceWindow.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -120,7 +120,7 @@ for anInstance in anInstanceList: aTitle = anInstance.getTitle() aClass = anInstance.__class__.__name__ - aFullPN = createFullPNString( anInstance.theFullPN() ) + aFullPN = createFullPNString( anInstance.getFullPN() ) if self.exists(): Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py 2011-01-19 06:38:21 UTC (rev 3891) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py 2011-01-20 11:56:01 UTC (rev 3892) @@ -627,91 +627,3 @@ gtk.Menu.popup(self, pms, pmi, func, button, time) self.show_all() - -# end of PopupMenu - - -# --------------------------------------------------------------- -# Test code -# --------------------------------------------------------------- - - -if __name__ == "__main__": - - class Session: - def __init__( self ): - self.theSimulator = simulator() - def getLoggerList( self ): - #fpnlist = ((VARIABLE, '/CELL/CYTOPLASM', 'ATP', 'Value'), - # (VARIABLE, '/CELL/CYTOPLASM', 'ADP', 'Value'), - # (VARIABLE, '/CELL/CYTOPLASM'... [truncated message content] |
From: <mor...@us...> - 2011-01-19 06:38:27
|
Revision: 3891 http://ecell.svn.sourceforge.net/ecell/?rev=3891&view=rev Author: moriyoshi Date: 2011-01-19 06:38:21 +0000 (Wed, 19 Jan 2011) Log Message: ----------- * Typo. Modified Paths: -------------- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py 2011-01-18 10:37:44 UTC (rev 3890) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/GtkSessionMonitor.py 2011-01-19 06:38:21 UTC (rev 3891) @@ -495,7 +495,7 @@ fp = open( self.theIniFileName, 'w' ) self.theConfigDB.write( fp ) except: - self.message("Couldnot save preferences into file %s.\n Please check permissions for home directory.\n"%self.theIniFileName) + self.message("Could not save preferences into file %s.\n Please check permissions for home directory.\n"%self.theIniFileName) #------------------------------------------------------------------- def createLoggerWithPolicy( self, fullpn, logpolicy = None ): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-18 10:37:50
|
Revision: 3890 http://ecell.svn.sourceforge.net/ecell/?rev=3890&view=rev Author: moriyoshi Date: 2011-01-18 10:37:44 +0000 (Tue, 18 Jan 2011) Log Message: ----------- * Fix the bug that the function signature for the getter of rootSystem cannot be handled properly. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-11 08:26:12 UTC (rev 3889) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-18 10:37:44 UTC (rev 3890) @@ -3030,8 +3030,14 @@ .add_static_property( "DM_SEARCH_PATH_SEPARATOR", &AbstractSimulator::getDMSearchPathSeparator ) .add_property( "rootSystem", - py::make_function( &AbstractSimulator::getRootSystem, + py::make_function( + &AbstractSimulator::getRootSystem, py::return_internal_reference<>() ) ) + .add_property( "rootSystem", + py::make_function( + static_cast< System*( AbstractSimulator::* )() const >( + &AbstractSimulator::getRootSystem ), + py::return_internal_reference<>() ) ) .def( "getClassInfo", &AbstractSimulator::getClassInfo ) // Stepper-related methods This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-11 08:26:22
|
Revision: 3889 http://ecell.svn.sourceforge.net/ecell/?rev=3889&view=rev Author: moriyoshi Date: 2011-01-11 08:26:12 +0000 (Tue, 11 Jan 2011) Log Message: ----------- * More 2.3 compatibility stuff. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/session_manager/Globus4Proxy.py ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py Modified: ecell3/trunk/ecell/pyecell/ecell/session_manager/Globus4Proxy.py =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/session_manager/Globus4Proxy.py 2011-01-09 03:51:36 UTC (rev 3888) +++ ecell3/trunk/ecell/pyecell/ecell/session_manager/Globus4Proxy.py 2011-01-11 08:26:12 UTC (rev 3889) @@ -102,10 +102,11 @@ rft = u'http://www.globus.org/namespaces/2004/10/rft' def __metaclass__( name, base, dic ): - dic[ '__rev__' ] = dict( ( - ( uri, prefix ) - for prefix, uri in dic.iteritems() - if not prefix.startswith( '__' ) ) ) + rev = {} + for prefix, uri in dic.iteritems(): + if not prefix.startswith( '__' ): + rev[uri] = prefix + dic[ '__rev__' ] = rev return type( name, base, dic ) class EPRParser( object ): @@ -562,8 +563,10 @@ for file in self.getExtraFileList(): files.append( os.path.normpath( os.path.join( absJobDirectory, file ) ) ) - job.filesCleanedUp = job.filesStagedIn = ( - 'file://' + file for file in files ) + urlifiedFiles = [] + for file in files: + urlifiedFiles.append( "file://" + file ) + job.filesCleanedUp = job.filesStagedIn = urlifiedFiles job.stdout = os.path.normpath( os.path.join( absJobDirectory, self.getStdoutFileName() ) ) job.stderr = os.path.normpath( Modified: ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py 2011-01-09 03:51:36 UTC (rev 3888) +++ ecell3/trunk/ecell/pyecell/ecell/session_manager/SessionManager.py 2011-01-11 08:26:12 UTC (rev 3889) @@ -559,8 +559,11 @@ Return list : the list of AbstractSessionProxy ''' # initializes a job list - return ( job for job in self.getSessionProxies() \ - if job.getStatus() == stat ) + def generator(): + for job in self.getSessionProxies(): + if job.getStatus() == stat: + yield job + return generator() def removeSessionProxy( self, job ): del self.jobs[ job.getJobID() ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-09 03:51:42
|
Revision: 3888 http://ecell.svn.sourceforge.net/ecell/?rev=3888&view=rev Author: moriyoshi Date: 2011-01-09 03:51:36 +0000 (Sun, 09 Jan 2011) Log Message: ----------- * Compatibility stuff. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-09 03:50:34 UTC (rev 3887) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-09 03:51:36 UTC (rev 3888) @@ -40,7 +40,11 @@ #include <boost/range/size.hpp> #include <boost/range/size_type.hpp> #include <boost/range/const_iterator.hpp> -#include <boost/cast.hpp> +#if BOOST_VERSION >= 103200 // for boost-1.32.0 or later. +# include <boost/numeric/conversion/cast.hpp> +#else // use this instead for boost-1.31 or earlier. +# include <boost/cast.hpp> +#endif #include <boost/format.hpp> #include <boost/format/group.hpp> #include <boost/python.hpp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-09 03:50:40
|
Revision: 3887 http://ecell.svn.sourceforge.net/ecell/?rev=3887&view=rev Author: moriyoshi Date: 2011-01-09 03:50:34 +0000 (Sun, 09 Jan 2011) Log Message: ----------- * Py_VISIT() is available since 2.4. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-09 02:47:45 UTC (rev 3886) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2011-01-09 03:50:34 UTC (rev 3887) @@ -77,6 +77,17 @@ #endif +#if PY_VERSION_HEX < 0x02040000 +#define Py_VISIT(op) \ + do { \ + if (op) { \ + int vret = visit((PyObject *)(op), arg); \ + if (vret) \ + return vret; \ + } \ + } while (0) +#endif + using namespace libecs; namespace py = boost::python; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-09 02:47:52
|
Revision: 3886 http://ecell.svn.sourceforge.net/ecell/?rev=3886&view=rev Author: moriyoshi Date: 2011-01-09 02:47:45 +0000 (Sun, 09 Jan 2011) Log Message: ----------- * better do it in this way for compatibility with older GCC. Modified Paths: -------------- ecell3/trunk/ecell/libecs/Polymorph.hpp Modified: ecell3/trunk/ecell/libecs/Polymorph.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Polymorph.hpp 2011-01-05 12:20:12 UTC (rev 3885) +++ ecell3/trunk/ecell/libecs/Polymorph.hpp 2011-01-09 02:47:45 UTC (rev 3886) @@ -1917,12 +1917,25 @@ return as<PolymorphValue::Tuple const& >(); } +template<> +class ConvertTo< String, Polymorph > +{ +public: + const String operator()( const Polymorph& aValue ) + { + return aValue.as< String >(); + } +}; template< typename Tnew_ > -inline Tnew_ convertTo( const Polymorph& aValue ) +class ConvertTo< Tnew_, Polymorph > { - return aValue.as< Tnew_ >(); -} +public: + const Tnew_ operator()( const Polymorph& aValue ) + { + return aValue.as< Tnew_ >(); + } +}; // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-05 12:20:19
|
Revision: 3885 http://ecell.svn.sourceforge.net/ecell/?rev=3885&view=rev Author: moriyoshi Date: 2011-01-05 12:20:12 +0000 (Wed, 05 Jan 2011) Log Message: ----------- * Fix argument signatures so they match to what the property slot expects. Modified Paths: -------------- ecell3/trunk/ecell/libecs/Process.cpp ecell3/trunk/ecell/libecs/Process.hpp Modified: ecell3/trunk/ecell/libecs/Process.cpp =================================================================== --- ecell3/trunk/ecell/libecs/Process.cpp 2011-01-04 13:21:23 UTC (rev 3884) +++ ecell3/trunk/ecell/libecs/Process.cpp 2011-01-05 12:20:12 UTC (rev 3885) @@ -604,7 +604,7 @@ aVarRef.getVariable()->addValue( aVarRef.getCoefficient() * value ); } -void Process::addValue( Real aValue ) +void Process::addValue( libecs::Param<Real>::type aValue ) { setActivity( aValue ); Modified: ecell3/trunk/ecell/libecs/Process.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Process.hpp 2011-01-04 13:21:23 UTC (rev 3884) +++ ecell3/trunk/ecell/libecs/Process.hpp 2011-01-05 12:20:12 UTC (rev 3885) @@ -384,7 +384,7 @@ @param aValue aReal value to be added. */ - void addValue( Real aValue ); + void addValue( libecs::Param<Real>::type aValue ); /** @@ -396,7 +396,7 @@ @param aVelocity a base velocity to be added. */ - void setFlux( Real aVelocity ) + void setFlux( libecs::Param<Real>::type aVelocity ) { setActivity( aVelocity ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-04 13:21:29
|
Revision: 3884 http://ecell.svn.sourceforge.net/ecell/?rev=3884&view=rev Author: moriyoshi Date: 2011-01-04 13:21:23 +0000 (Tue, 04 Jan 2011) Log Message: ----------- * Update. Modified Paths: -------------- ecell3/trunk/NEWS Modified: ecell3/trunk/NEWS =================================================================== --- ecell3/trunk/NEWS 2011-01-04 13:20:25 UTC (rev 3883) +++ ecell3/trunk/NEWS 2011-01-04 13:21:23 UTC (rev 3884) @@ -1,4 +1,4 @@ -ecell-3.2.2: 29-Dec-2010 +ecell-3.2.2: 5-Jan-2011 * Fixed the bug that some expressions given to ExpressionFluxProcess or ExpressionAssignmentProcess would not be evaluated correctly. @@ -15,7 +15,9 @@ * Fixed ecell._ecs module so that iter(process.variableReferences) works correctly. + * Fixed the bug that logger data could not be saved through LoggerWindow. + ecell-3.2.1: 23-Sep-2010 * Fixed segmentation fault in PythonProcess and PythonFluxProcess. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2011-01-04 13:20:32
|
Revision: 3883 http://ecell.svn.sourceforge.net/ecell/?rev=3883&view=rev Author: moriyoshi Date: 2011-01-04 13:20:25 +0000 (Tue, 04 Jan 2011) Log Message: ----------- Fix a critical bug in LoggerWindow that logger data cannot be saved. Modified Paths: -------------- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py ecell3/trunk/ecell/frontend/session-monitor/glade/LoggerWindow.glade Modified: ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py 2010-12-28 08:40:14 UTC (rev 3882) +++ ecell3/trunk/ecell/frontend/session-monitor/ecell/ui/osogo/LoggerWindow.py 2011-01-04 13:20:25 UTC (rev 3883) @@ -273,7 +273,7 @@ # [1-3] Now binary type is not supported by Logger. # If binary type is selected, exit this method. - aType = self["datatype_combo"].get_text() + aType = self["datatype_combo"].get_active_text() if aType == 'ecd': pass @@ -545,7 +545,7 @@ def getDataFileType (self ): """ returns Data Type of file choosen by the user """ - return self["datatype_combo"].get_text() + return self["datatype_combo"].get_active_text() # ============================================================================== def setDataFileType (self, aDataType ): Modified: ecell3/trunk/ecell/frontend/session-monitor/glade/LoggerWindow.glade =================================================================== --- ecell3/trunk/ecell/frontend/session-monitor/glade/LoggerWindow.glade 2010-12-28 08:40:14 UTC (rev 3882) +++ ecell3/trunk/ecell/frontend/session-monitor/glade/LoggerWindow.glade 2011-01-04 13:20:25 UTC (rev 3883) @@ -117,100 +117,14 @@ </child> <child> - <widget class="GtkCombo" id="datatype_combo"> + <widget class="GtkComboBox" id="datatype_combo"> <property name="visible">True</property> - <property name="value_in_list">False</property> - <property name="allow_empty">False</property> - <property name="case_sensitive">False</property> + <property name="active">0</property> <property name="enable_arrow_keys">True</property> <property name="enable_arrows_always">False</property> - <child> - <widget class="GtkEntry" id="datatype_combo_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">False</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - </child> - - <child> - <widget class="GtkList" id="convertwidget3"> - <property name="visible">True</property> - <property name="selection_mode">GTK_SELECTION_BROWSE</property> - - <child> - <widget class="GtkListItem" id="convertwidget4"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="convertwidget5"> - <property name="visible">True</property> - <property name="label" translatable="yes">ecd</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkListItem" id="convertwidget6"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="convertwidget7"> - <property name="visible">True</property> - <property name="label" translatable="yes">binary</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkListItem" id="convertwidget8"> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="convertwidget9"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> + <property name="items">ecd +binary</property> </widget> <packing> <property name="padding">0</property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-28 08:40:23
|
Revision: 3882 http://ecell.svn.sourceforge.net/ecell/?rev=3882&view=rev Author: moriyoshi Date: 2010-12-28 08:40:14 +0000 (Tue, 28 Dec 2010) Log Message: ----------- * Update samples. Modified Paths: -------------- ecell3/trunk/doc/samples/Drosophila/Drosophila-python.em ecell3/trunk/doc/samples/LTD/LTD.em Modified: ecell3/trunk/doc/samples/Drosophila/Drosophila-python.em =================================================================== --- ecell3/trunk/doc/samples/Drosophila/Drosophila-python.em 2010-12-28 08:37:54 UTC (rev 3881) +++ ecell3/trunk/doc/samples/Drosophila/Drosophila-python.em 2010-12-28 08:40:14 UTC (rev 3882) @@ -61,7 +61,7 @@ { IsContinuous 1; InitializeMethod "vs = 0.76; KI = 1;"; - FireMethod "self.setFlux( (vs*KI) / (KI + (C0.MolarConc * C0.MolarConc * C0.MolarConc) ) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (vs*KI) / (KI + (C0.variable.MolarConc * C0.variable.MolarConc * C0.variable.MolarConc) ) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:M 1 ] [ C0 Variable:.:Pn ]; } @@ -70,7 +70,7 @@ { IsContinuous 1; InitializeMethod "vm = 0.65; Km = 0.5;"; - FireMethod "self.setFlux( (vm * S0.MolarConc) / ( Km + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (vm * S0.variable.MolarConc) / ( Km + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ S0 Variable:.:M -1 ]; } @@ -79,7 +79,7 @@ { IsContinuous 1; InitializeMethod "Ks = 0.38;"; - FireMethod "self.setFlux( (Ks * C0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (Ks * C0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P0 1 ] [ C0 Variable:.:M 0 ]; } @@ -88,7 +88,7 @@ { IsContinuous 1; InitializeMethod "V1 = 3.2; K1 = 2;"; - FireMethod "self.setFlux( ( V1 * S0.MolarConc) / (K1 + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( ( V1 * S0.variable.MolarConc) / (K1 + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P1 1 ] [ S0 Variable:.:P0 -1 ]; } @@ -97,7 +97,7 @@ { IsContinuous 1; InitializeMethod "V2 = 1.58; K2 = 2;"; - FireMethod "self.setFlux( (V2 * S0.MolarConc) / (K2 + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (V2 * S0.variable.MolarConc) / (K2 + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P0 1 ] [ S0 Variable:.:P1 -1 ]; } @@ -106,7 +106,7 @@ { IsContinuous 1; InitializeMethod "V3 = 5; K3 = 2;"; - FireMethod "self.setFlux( ( V3 * S0.MolarConc) / (K3 + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( ( V3 * S0.variable.MolarConc) / (K3 + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P2 1 ] [ S0 Variable:.:P1 -1]; } @@ -115,7 +115,7 @@ { IsContinuous 1; InitializeMethod "V4 = 2.5; K4 = 2;"; - FireMethod "self.setFlux( (V4 * S0.MolarConc) / (K4 + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (V4 * S0.variable.MolarConc) / (K4 + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P1 1 ] [ S0 Variable:.:P2 -1 ]; } @@ -124,7 +124,7 @@ { IsContinuous 1; InitializeMethod "k1 = 1.9;"; - FireMethod "self.setFlux( ( k1 * S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( ( k1 * S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:Pn 1 ] [ S0 Variable:.:P2 -1 ]; } @@ -133,7 +133,7 @@ { IsContinuous 1; InitializeMethod "k2 = 1.3;"; - FireMethod "self.setFlux( (k2 * S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( (k2 * S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ P0 Variable:.:P2 1 ] [ S0 Variable:.:Pn -1 ]; } @@ -142,7 +142,7 @@ { IsContinuous 1; InitializeMethod "vd = 0.95; Kd = 0.2;"; - FireMethod "self.setFlux( ( vd * S0.MolarConc) / (Kd + S0.MolarConc) * self.getSuperSystem().SizeN_A )"; + FireMethod "self.Flux = ( ( vd * S0.variable.MolarConc) / (Kd + S0.variable.MolarConc) * self.superSystem.SizeN_A )"; VariableReferenceList [ S0 Variable:.:P2 -1 ]; } Modified: ecell3/trunk/doc/samples/LTD/LTD.em =================================================================== --- ecell3/trunk/doc/samples/LTD/LTD.em 2010-12-28 08:37:54 UTC (rev 3881) +++ ecell3/trunk/doc/samples/LTD/LTD.em 2010-12-28 08:40:14 UTC (rev 3882) @@ -1072,7 +1072,7 @@ Name PKC_PKC_active; StepperID PASSIVE_1; - FireMethod "P0.Value = R0.Value + R1.Value + R2.Value + R3.Value"; + FireMethod "P0.variable.Value = R0.variable.Value + R1.variable.Value + R2.variable.Value + R3.variable.Value"; VariableReferenceList [ R0 :.:Ca_DAG_PKC 0 ] [ R1 :.:DAG_AA_PKC 0 ] [ R2 :.:AA_PKC 0 ] @@ -1085,7 +1085,7 @@ Name MAPact; StepperID PASSIVE_1; - FireMethod "P0.Value = R0.Value + R1.Value"; + FireMethod "P0.variable.Value = R0.variable.Value + R1.variable.Value"; VariableReferenceList [ R0 :.:MAPK_P 0 ] [ R1 :.:MAPK_PP 0 ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-28 08:38:00
|
Revision: 3881 http://ecell.svn.sourceforge.net/ecell/?rev=3881&view=rev Author: moriyoshi Date: 2010-12-28 08:37:54 +0000 (Tue, 28 Dec 2010) Log Message: ----------- * Make Flux property assignable. Modified Paths: -------------- ecell3/trunk/ecell/dm/PythonProcess.cpp Modified: ecell3/trunk/ecell/dm/PythonProcess.cpp =================================================================== --- ecell3/trunk/ecell/dm/PythonProcess.cpp 2010-12-28 06:26:34 UTC (rev 3880) +++ ecell3/trunk/ecell/dm/PythonProcess.cpp 2010-12-28 08:37:54 UTC (rev 3881) @@ -46,6 +46,7 @@ PROPERTYSLOT_SET_GET( Integer, IsContinuous ); PROPERTYSLOT_SET_GET( Real, StepInterval ); + PROPERTYSLOT_SET( Real, Flux ); PROPERTYSLOT_SET_GET( String, FireMethod ); PROPERTYSLOT_SET_GET( String, InitializeMethod ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-28 06:26:43
|
Revision: 3880 http://ecell.svn.sourceforge.net/ecell/?rev=3880&view=rev Author: moriyoshi Date: 2010-12-28 06:26:34 +0000 (Tue, 28 Dec 2010) Log Message: ----------- * Give 3.2.2 a go. Modified Paths: -------------- ecell3/trunk/NEWS ecell3/trunk/ecell_version.sh Modified: ecell3/trunk/NEWS =================================================================== --- ecell3/trunk/NEWS 2010-12-21 08:52:36 UTC (rev 3879) +++ ecell3/trunk/NEWS 2010-12-28 06:26:34 UTC (rev 3880) @@ -1,6 +1,24 @@ +ecell-3.2.2: 29-Dec-2010 + + * Fixed the bug that some expressions given to ExpressionFluxProcess or + ExpressionAssignmentProcess would not be evaluated correctly. + + * Fixed segmentation fault bug in ExpressionAssignmentProcess. + + * Overhauled libecs::Polymorph. + + * Fixed a bug in ecell.session_manager that SGE backend doesn't work + unless setOwner() is called prior to job dispatch. + + * Fixed compilation error in ecell/libecs/MethodProxy.hpp. + + * Fixed ecell._ecs module so that iter(process.variableReferences) works + correctly. + + ecell-3.2.1: 23-Sep-2010 - * Fix segmentation fault in PythonProcess and PythonFluxProcess. + * Fixed segmentation fault in PythonProcess and PythonFluxProcess. * Removed DifferentialStepper::initializeStepInterval() in favor of virtualized Stepper::setStepInterval(). Modified: ecell3/trunk/ecell_version.sh =================================================================== --- ecell3/trunk/ecell_version.sh 2010-12-21 08:52:36 UTC (rev 3879) +++ ecell3/trunk/ecell_version.sh 2010-12-28 06:26:34 UTC (rev 3880) @@ -1,5 +1,5 @@ ECELL_MAJOR_VERSION=3 ECELL_MINOR_VERSION=2 -ECELL_MICRO_VERSION=1 +ECELL_MICRO_VERSION=2 ECELL_PACKAGE_REVISION= ECELL_VERSION_NUMBER=${ECELL_MAJOR_VERSION}.${ECELL_MINOR_VERSION}.${ECELL_MICRO_VERSION}${ECELL_PACKAGE_REVISION} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-21 08:52:42
|
Revision: 3879 http://ecell.svn.sourceforge.net/ecell/?rev=3879&view=rev Author: moriyoshi Date: 2010-12-21 08:52:36 +0000 (Tue, 21 Dec 2010) Log Message: ----------- * Make the template constructor not interfere with the constructor from strings. Modified Paths: -------------- ecell3/trunk/ecell/libecs/Polymorph.hpp Modified: ecell3/trunk/ecell/libecs/Polymorph.hpp =================================================================== --- ecell3/trunk/ecell/libecs/Polymorph.hpp 2010-12-21 08:29:57 UTC (rev 3878) +++ ecell3/trunk/ecell/libecs/Polymorph.hpp 2010-12-21 08:52:36 UTC (rev 3879) @@ -47,8 +47,13 @@ #include <boost/range/size.hpp> #include <boost/range/const_iterator.hpp> #include <boost/tuple/tuple.hpp> +#include <boost/mpl/or.hpp> #include <boost/mpl/int.hpp> #include <boost/mpl/less.hpp> +#include <boost/utility/enable_if.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/type_traits/is_integral.hpp> +#include <boost/type_traits/is_arithmetic.hpp> #include "libecs/Defs.hpp" #include "libecs/convertTo.hpp" @@ -529,14 +534,18 @@ std::size_t sz = static_cast< std::size_t >( -1 ) ) : theValue( PolymorphValue::create( ptr, sz ) ) { } - explicit Polymorph( Real aValue ) + explicit Polymorph( Real aValue ) : theValue( PolymorphValue::create( aValue ) ) { } - explicit Polymorph( Integer aValue ) + explicit Polymorph( Integer aValue ) : theValue( PolymorphValue::create( aValue ) ) { } template< typename Trange_ > - explicit Polymorph( Trange_ const& aValue ) + explicit Polymorph( Trange_ const& aValue, + typename boost::disable_if< + boost::mpl::or_< + boost::is_arithmetic< Trange_ >, + boost::is_same< Trange_, String > > >::type* = 0) : theValue( PolymorphValue::create( aValue ) ) { } template< typename T0_, typename T1_, typename T2_, typename T3_, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-21 08:30:04
|
Revision: 3878 http://ecell.svn.sourceforge.net/ecell/?rev=3878&view=rev Author: moriyoshi Date: 2010-12-21 08:29:57 +0000 (Tue, 21 Dec 2010) Log Message: ----------- * Fix iter(process.variableReferences) Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp Modified: ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2010-12-21 08:27:55 UTC (rev 3877) +++ ecell3/trunk/ecell/pyecell/ecell/_ecs.cpp 2010-12-21 08:29:57 UTC (rev 3878) @@ -959,9 +959,9 @@ } template< typename Trange_ > - static STLIteratorWrapper* create( Trange_ const& range ) + static PyObject* create( Trange_ const& range ) { - return new STLIteratorWrapper( range ); + return reinterpret_cast< PyObject* >( new STLIteratorWrapper( range ) ); } static void __dealloc__( STLIteratorWrapper* self ) @@ -974,7 +974,7 @@ if ( self->theIdx == self->theEnd ) return NULL; - return py::incref( py::object( *self->theIdx ).ptr() ); + return py::incref( py::object( *( self->theIdx++ ) ).ptr() ); } }; @@ -1269,9 +1269,9 @@ return retval; } - py::object __iter__() + PyObject* __iter__() { - return py::object( STLIteratorWrapper< Process::VariableReferenceVector::const_iterator >( theProc->getVariableReferenceVector() ) ); + return STLIteratorWrapper< Process::VariableReferenceVector::const_iterator >::create( theProc->getVariableReferenceVector() ); } std::string __str__() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-21 08:28:01
|
Revision: 3877 http://ecell.svn.sourceforge.net/ecell/?rev=3877&view=rev Author: moriyoshi Date: 2010-12-21 08:27:55 +0000 (Tue, 21 Dec 2010) Log Message: ----------- * Allow one to specify arbitrary StepInterval for PythonProcess. Modified Paths: -------------- ecell3/trunk/ecell/dm/PythonProcess.cpp Modified: ecell3/trunk/ecell/dm/PythonProcess.cpp =================================================================== --- ecell3/trunk/ecell/dm/PythonProcess.cpp 2010-12-21 08:19:32 UTC (rev 3876) +++ ecell3/trunk/ecell/dm/PythonProcess.cpp 2010-12-21 08:27:55 UTC (rev 3877) @@ -45,6 +45,7 @@ INHERIT_PROPERTIES( Process ); PROPERTYSLOT_SET_GET( Integer, IsContinuous ); + PROPERTYSLOT_SET_GET( Real, StepInterval ); PROPERTYSLOT_SET_GET( String, FireMethod ); PROPERTYSLOT_SET_GET( String, InitializeMethod ); } @@ -75,6 +76,16 @@ theIsContinuous = value; } + virtual Real getStepInterval() const + { + return theStepInterval; + } + + SET_METHOD( Real, StepInterval) + { + theStepInterval = value; + } + SET_METHOD( String, FireMethod ) { theFireMethod = value; @@ -92,7 +103,6 @@ return theFireMethod; } - SET_METHOD( String, InitializeMethod ) { theInitializeMethod = value; @@ -161,6 +171,7 @@ boost::python::handle<> theCompiledInitializeMethod; bool theIsContinuous; + Real theStepInterval; }; LIBECS_DM_INIT( PythonProcess, Process ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-12-21 08:19:39
|
Revision: 3876 http://ecell.svn.sourceforge.net/ecell/?rev=3876&view=rev Author: moriyoshi Date: 2010-12-21 08:19:32 +0000 (Tue, 21 Dec 2010) Log Message: ----------- * Remove unnecessary const. Modified Paths: -------------- ecell3/trunk/ecell/dm/PythonProcessBase.hpp Modified: ecell3/trunk/ecell/dm/PythonProcessBase.hpp =================================================================== --- ecell3/trunk/ecell/dm/PythonProcessBase.hpp 2010-11-25 07:36:14 UTC (rev 3875) +++ ecell3/trunk/ecell/dm/PythonProcessBase.hpp 2010-12-21 08:19:32 UTC (rev 3876) @@ -155,7 +155,7 @@ // extract 'this' Process's methods and attributes boost::python::object aPySelfProcess( - boost::python::ptr( dynamic_cast< libecs::Process* const >( this ) ) ); + boost::python::ptr( dynamic_cast< libecs::Process* >( this ) ) ); theGlobalNamespace[ "self" ] = aPySelfProcess; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-11-25 07:36:21
|
Revision: 3875 http://ecell.svn.sourceforge.net/ecell/?rev=3875&view=rev Author: moriyoshi Date: 2010-11-25 07:36:14 +0000 (Thu, 25 Nov 2010) Log Message: ----------- * Not continuing parsing on error. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/emparser.py Modified: ecell3/trunk/ecell/pyecell/ecell/emparser.py =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/emparser.py 2010-11-12 08:07:38 UTC (rev 3874) +++ ecell3/trunk/ecell/pyecell/ecell/emparser.py 2010-11-25 07:36:14 UTC (rev 3875) @@ -400,8 +400,10 @@ t[0] = None def p_error(t): - print "Syntax error at line %d in %s. " % ( t.lineno, t.value ) - yacc.errok() + if t is None: + print "Syntax error" + else: + print "Syntax error at line %d in %s. " % ( t.lineno, t.value ) # Constract List This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mor...@us...> - 2010-11-12 08:07:50
|
Revision: 3874 http://ecell.svn.sourceforge.net/ecell/?rev=3874&view=rev Author: moriyoshi Date: 2010-11-12 08:07:38 +0000 (Fri, 12 Nov 2010) Log Message: ----------- * Do not specify user name explicitly when the Owner is not set. Modified Paths: -------------- ecell3/trunk/ecell/pyecell/ecell/session_manager/SGEProxy.py Modified: ecell3/trunk/ecell/pyecell/ecell/session_manager/SGEProxy.py =================================================================== --- ecell3/trunk/ecell/pyecell/ecell/session_manager/SGEProxy.py 2010-11-11 16:06:45 UTC (rev 3873) +++ ecell3/trunk/ecell/pyecell/ecell/session_manager/SGEProxy.py 2010-11-12 08:07:38 UTC (rev 3874) @@ -188,10 +188,13 @@ aStatusDict = {} # reads the result of qstat + aCommandLine = [ QSTAT ] + if self.getOwner() is not None: + aCommandLine.extend( [ '-u', self.getOwner() ] ) out = raiseExceptionOnError( RuntimeError, pollForOutputs( - popen2.Popen3( ( QSTAT, '-u', self.getOwner() ), True ) + popen2.Popen3( aCommandLine, True ) ) ).split( "\n" ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |