Scripts: What are the guidelines for using core.wait()? #3062
Unanswered
jrobparsons
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been learning how to development scripts by studying the scripts that are integrated with Stellarium and the scripts that are in the 'test' folder.
After many of the API calls there is a core.wait().
Example (from constellations_tour.ssc) :
for (i=0; i<constellations.length; i++)
{
objName = constellations[i];
core.selectConstellationByName(objName);
StelMovementMgr.autoZoomIn(6);
core.wait(1);
StelMovementMgr.zoomTo(40,8);
core.wait(1);
ConstellationMgr.setFlagArt(true);
core.wait(10);
ConstellationMgr.setFlagArt(false);
}
Is the purpose of the core.wait() statements to synchronize the running of the script with the completion of the API calls?
In general, are API calls asynchronous operations?
Are there any general guidelines for using core.wait() in scripts?
Should a statement like StelMovementMgr.autoZoomIn(6) be followed by core.wait(1) or core.wait(6)?
Should a statement like StelMovementMgr.zoomTo(40,8); be followed by core.wait(1) or core.wait(8)?
Beta Was this translation helpful? Give feedback.
All reactions