Author: eudoxos
Date: 2009-01-24 06:46:31 +0100 (Sat, 24 Jan 2009)
New Revision: 1636

Modified:
   trunk/extra/Brefcom.hpp
   trunk/gui/qt3/GLSimulationPlayerViewer.cpp
   trunk/scripts/simple-scene-player.py
Log:
1. Make BrefcomDamageColorizer run at 0th iteration as well
2. Make player set stopAtIter to last iteration in db so that percentage is 
displayed in the output.


Modified: trunk/extra/Brefcom.hpp
===================================================================
--- trunk/extra/Brefcom.hpp     2009-01-24 00:25:04 UTC (rev 1635)
+++ trunk/extra/Brefcom.hpp     2009-01-24 05:46:31 UTC (rev 1636)
@@ -237,7 +237,7 @@
        public:
                //! maximum damage over all contacts
                Real maxOmega;
-               BrefcomDamageColorizer(){maxOmega=0;}
+               BrefcomDamageColorizer(){maxOmega=0; /* run at the very 
beginning */ initRun=true;}
                virtual void action(MetaBody*);
        REGISTER_ATTRIBUTES(PeriodicEngine,(maxOmega));
        REGISTER_CLASS_AND_BASE(BrefcomDamageColorizer,PeriodicEngine);

Modified: trunk/gui/qt3/GLSimulationPlayerViewer.cpp
===================================================================
--- trunk/gui/qt3/GLSimulationPlayerViewer.cpp  2009-01-24 00:25:04 UTC (rev 
1635)
+++ trunk/gui/qt3/GLSimulationPlayerViewer.cpp  2009-01-24 05:46:31 UTC (rev 
1636)
@@ -164,13 +164,16 @@
                simPlayer->pushMessage("Simulation loaded.");
                istringstream xmlStream(xml); 
Omega::instance().loadSimulationFromStream(xmlStream);
                {
-                       sqlite3x::sqlite3_command cmd(*con,"select bodyTable 
from 'records' ORDER BY iter;");
+                       sqlite3x::sqlite3_command cmd(*con,"select 
bodyTable,iter from 'records' ORDER BY iter;");
                        sqlite3x::sqlite3_cursor reader=cmd.executecursor();
                        assert(reader.colcount()==1);
+                       long maxIter=0
                        while(reader.step()){
                                xyzNames.push_back(reader.getstring(0)); // 
first column
                                LOG_DEBUG("Added table "<<reader.getstring(0));
+                               maxIter=reader.getint(1);
                        }
+                       Omega::instance().getRootBody()->stopAtIter=maxIter;
                }
        }
        /* Filters */

Modified: trunk/scripts/simple-scene-player.py
===================================================================
--- trunk/scripts/simple-scene-player.py        2009-01-24 00:25:04 UTC (rev 
1635)
+++ trunk/scripts/simple-scene-player.py        2009-01-24 05:46:31 UTC (rev 
1636)
@@ -21,7 +21,7 @@
        
MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('SimpleElasticRelationships')]),
        StandAloneEngine('ElasticContactLaw'),
        DeusExMachina('GravityEngine',{'gravity':[0,0,-9.81]}),
-       DeusExMachina('NewtonsDampedLaw',{'damping':0.2})
+       DeusExMachina('NewtonsDampedLaw',{'damping':0.2}),
        ###
        ### NOTE this extra engine.
        ###


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to