Various scripting problems

Bug #500192 reported by Dual Don
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Unassigned

Bug Description

This is an extract from a Stellarium 0.10.2 script that I am writing that will have an observer flying in an airplane.
This is not critical because there is a work around.
I would gladly send you an email with attached DEMO script that shows the errors, but I don't know how to do so.

<email address hidden>
========
///This script will not run when a ZERO is placed in front of any Longitude value
/// that is to say, the script will not be accepted
///This script will not run when a ZERO is placed in front of Latitude value
/// 0.5 will not work, .5 and 360.5 will work correctly
///0119 and 020 will not work, 119, 1119 and 20 works correctly

core.setObserverLocation(119., 20., 10., 0., "loc2");

///The location name, up to 24 characters at least, will be replaced properly by
///the next location name for the first six times (in this script). The last
///location is displayed correctly after the script stops.
///However-- Once the observer altitude is changed from ZERO the name changes
/// are added as "-> new name" repeatedly.
///The names are displayed correctly only when the observer altitude is ZERO.
///The displayed value of the observer altitude is not updated at any time.

Revision history for this message
Dual Don (aba11076) wrote :

This is the missing Demo of errors. I missed seeing the browse button on my original submission.
Dual Don

Revision history for this message
Fabien Chéreau (xalioth) wrote :

Hi Dual,
For the trailing 0 in number problem, I think it's normal that numbers like 012, or 05.3 are not allowed. Numbers like 0.0 work fine.
I just fixed a bug preventing altitude to be properly set.
For the -> concatenation bug, I also fixed it. It happened when you request going to a location while the previous movement was not yet finished.
Thanks!
Fabien

Changed in stellarium:
importance: Undecided → Medium
status: New → Fix Committed
milestone: none → 0.10.5
summary: - no leading zero allowed in Lats & Longs
+ Various scripting problems
Revision history for this message
Dual Don (aba11076) wrote : Re: [Bug 500192] Re: no leading zero allowed in Lats & Longs

>>For the trailing 0 in number problem, I think it's normal that numbers like 012, or 05.3 are not allowed. Numbers like 0.0 work fine.
Good day et bonjour Fabien,
I guess that airplane and naval navigational notation is not used by landbased astronomers at a fixed location.
The use of preceding zero's is used to distinguish between latitude and longitude values that could be mistaken as being the same.
Longitude is always listed as a three digit number and Latitude is always listed as a two digit number.
For example, 090, 045 and 005 are always longitude whereas 90, 45 and 05 are always lattitude. In addition, navigational notation always puts latitude before longitude, which appears to be the opposite of astronomical practice.
It took a l o n g time to debug my script which initially used leading zero's. (:>)
I can live with Stellarium script requirements.

Thanks for fixing the other bugs I reported.

Another question with regard scripting, unrelated to the my previous submission. It is not a bug, so you can ignore the following.
I would like to be able to put in a large series of sequential pairs of numbers (300, 45; 310, 40; etc.) as an array of values, then be able to extract array values and use them (long and lat) in my script. I would take two numbers out at the same time using index number references like i and i+1, where i is incremented.
I have an interesting project wherein I fly several airplanes - one per script - by inputting lat and long (l&l) and time for many locations. The time for each location in the sequence is the same for all the scripts, only the lat and long change. At present I have to manually input each of about a hundred locations (l&l) in its own line of script, for every script.
I would like to be able to extract data from an array, which I can create automatically.
I have been studying C++ and JavaScript, but I have been unable to find anything about extracting data from an array that might be applicable to Stellarium 0.10.2 scripts.
If you can make any suggestions, please reply, otherwise ignore this message.
Thank you
John

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

Stellarium's new script engine is based on the Qt script engine, which uses ECMAScript:
http://en.wikipedia.org/wiki/ECMAScript
It seems that a number beginning with a 0 is interpreted as an octal number. I don't know if there's a workaround.

Revision history for this message
Dual Don (aba11076) wrote : Re: [Bug 500192] can be closed

>Stellarium's new script engine is based on the Qt script engine, which uses
>ECMAScript: It seems that a number beginning with a 0 is interpreted as an
>octal number. I don't know if there's a workaround.

Good day Bogdan,
Thank you for the information re "leading zero's". I can live with the
present situation now that I know of it.
You can close the Bug500192 report.

Thanks again.
John

Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.