StelScriptMgr.cpp   StelScriptMgr.cpp 
skipping to change at line 106 skipping to change at line 106
engine.globalObject().setProperty("core", objectValue); engine.globalObject().setProperty("core", objectValue);
engine.evaluate("function mywait__(sleepDurationSec) {" engine.evaluate("function mywait__(sleepDurationSec) {"
"if (sleepDurationSec<0) return;" "if (sleepDurationSec<0) return;"
"var date = new Date();" "var date = new Date();"
"var curDate = null;" "var curDate = null;"
"do {curDate = new Date();}" "do {curDate = new Date();}"
" while(curDate-date < sleepDurat ionSec*1000/scriptRateReadOnly);}"); " while(curDate-date < sleepDurat ionSec*1000/scriptRateReadOnly);}");
engine.evaluate("core['wait'] = mywait__;"); engine.evaluate("core['wait'] = mywait__;");
//! Waits until a specified simulation date/time. This function
//! will take into account the rate (and direction) in which simulat
ion
//! time is passing. e.g. if a future date is specified and the
//! time is moving backwards, the function will return immediately.
//! If the time rate is 0, the function will not wait. This is to
//! prevent infinite wait time.
//! @param dt the date string to use
//! @param spec "local" or "utc"
engine.evaluate("function mywaitFor__(dt, spec) {if (!spec) spec=\"u tc\";" engine.evaluate("function mywaitFor__(dt, spec) {if (!spec) spec=\"u tc\";"
" var JD = core.jdFromDateString(dt, spec);" " var JD = core.jdFromDateString(dt, spec);"
" var timeSpeed = core.getTimeRate();" " var timeSpeed = core.getTimeRate();"
" if (timeSpeed == 0.) {core.debug(\"waitFor called with no ti me passing - would be infinite. not waiting!\"); return;}" " if (timeSpeed == 0.) {core.debug(\"waitFor called with no ti me passing - would be infinite. not waiting!\"); return;}"
" if (timeSpeed > 0) {core.wait((JD-core.getJDay())*timeSpeed) ;}" " if (timeSpeed > 0) {core.wait((JD-core.getJDay())*timeSpeed) ;}"
" else {core.wait((core.getJDay()-JD)*timeSpeed);}}"); " else {core.wait((core.getJDay()-JD)*timeSpeed);}}");
engine.evaluate("core['waitFor'] = mywaitFor__;"); engine.evaluate("core['waitFor'] = mywaitFor__;");
// Add other classes which we want to be directly accessible from sc ripts // Add other classes which we want to be directly accessible from sc ripts
if(StelSkyLayerMgr* smgr = GETSTELMODULE(StelSkyLayerMgr)) if(StelSkyLayerMgr* smgr = GETSTELMODULE(StelSkyLayerMgr))
 End of changes. 1 change blocks. 
9 lines changed or deleted 0 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/