yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00886
[svn] r1633 - in trunk: extra gui/py gui/qt3
Author: eudoxos
Date: 2009-01-23 23:18:54 +0100 (Fri, 23 Jan 2009)
New Revision: 1633
Modified:
trunk/extra/Brefcom.cpp
trunk/extra/Brefcom.hpp
trunk/gui/py/PythonUI_rc.py
trunk/gui/qt3/GLSimulationPlayerViewer.cpp
Log:
1. Unbreak bad type (list) for sys.argv[0], broken recently
2. Color bodies by residual strength rather than damage parameter (smoother)
3. Make player messages (maybe) better formatted
Modified: trunk/extra/Brefcom.cpp
===================================================================
--- trunk/extra/Brefcom.cpp 2009-01-23 09:05:03 UTC (rev 1632)
+++ trunk/extra/Brefcom.cpp 2009-01-23 22:18:54 UTC (rev 1633)
@@ -266,7 +266,7 @@
if(!BC || !BC->isCohesive) continue;
const body_id_t id1=I->getId1(), id2=I->getId2();
bodyDamage[id1].first++; bodyDamage[id2].first++;
- bodyDamage[id1].second+=BC->omega; bodyDamage[id2].second+=BC->omega;
+ bodyDamage[id1].second+=(1-BC->relResidualStrength); bodyDamage[id2].second+=(1-BC->relResidualStrength);
maxOmega=max(maxOmega,BC->omega);
}
FOREACH(shared_ptr<Body> B, *rootBody->bodies){
Modified: trunk/extra/Brefcom.hpp
===================================================================
--- trunk/extra/Brefcom.hpp 2009-01-23 09:05:03 UTC (rev 1632)
+++ trunk/extra/Brefcom.hpp 2009-01-23 22:18:54 UTC (rev 1633)
@@ -136,7 +136,7 @@
int numBrokenCohesive;
//! number of contacts with this body
int numContacts;
- //! average damage including already deleted contacts
+ //! average damage including already deleted contacts (it is really not damage, but 1-relResidualStrength now)
Real normDmg;
BrefcomPhysParams(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.) {createIndex();};
REGISTER_ATTRIBUTES(BodyMacroParameters, (epsVolumetric) (numBrokenCohesive) (numContacts) (normDmg) );
Modified: trunk/gui/py/PythonUI_rc.py
===================================================================
--- trunk/gui/py/PythonUI_rc.py 2009-01-23 09:05:03 UTC (rev 1632)
+++ trunk/gui/py/PythonUI_rc.py 2009-01-23 22:18:54 UTC (rev 1633)
@@ -59,7 +59,7 @@
import time;
while True: time.sleep(1)
else:
- sys.argv[0]=['<embedded python interpreter>']
+ sys.argv[0]='<embedded python interpreter>'
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed(banner=r"""__ __ ____ ____ _
\ \ / /_ _| _ \ ___ / ___|___ _ __ ___ ___ | | ___
Modified: trunk/gui/qt3/GLSimulationPlayerViewer.cpp
===================================================================
--- trunk/gui/qt3/GLSimulationPlayerViewer.cpp 2009-01-23 09:05:03 UTC (rev 1632)
+++ trunk/gui/qt3/GLSimulationPlayerViewer.cpp 2009-01-23 22:18:54 UTC (rev 1633)
@@ -11,6 +11,8 @@
#include<unistd.h>
#include<fstream>
#include<string>
+#include<sstream>
+#include<iomanip>
#include<boost/lexical_cast.hpp>
#include<boost/filesystem/operations.hpp>
#include<boost/filesystem/convenience.hpp>
@@ -67,7 +69,10 @@
long framesToGo=xyzNames.size()-frameNumber;
if(elapsedFrames>0 && framesToGo>0){
long ETA_s=((now-lastCheckPointTime).total_milliseconds()/elapsedFrames)*(framesToGo)/1000;
- simPlayer->pushMessage(lexical_cast<string>(framesToGo)+" frames to go, ETA "+lexical_cast<string>(ETA_s/3600)+":"+lexical_cast<string>((ETA_s%3600)/60)+":"+lexical_cast<string>(ETA_s%60));
+ ostringstream oss;
+ oss<<framesToGo<<" frames to go, ETA "<<ETA_s/3600<<":"<<setw(2)<<setfill('0')<<((ETA_s%3600)/60)<<":"<<setw(2)<<setfill('0')<<ETA_s%60;
+ simPlayer->pushMessage(oss.str());
+ // simPlayer->pushMessage(lexical_cast<string>(framesToGo)+" frames to go, ETA "+lexical_cast<string>(ETA_s/3600)+":"+lexical_cast<string>((ETA_s%3600)/60)+":"+lexical_cast<string>(ETA_s%60));
}
lastCheckPointTime=now;
lastCheckPointFrame=frameNumber;