Lua Edu Tools beta version

Discuss Celestia's features, adaptations and Addons for use in educational environments
Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Lua Edu Tools beta version

Post #1by Vincent » 02.11.2006, 14:52

Hi,

The 'Lua Edu Tools' is an addon for Celestia 1.5 that provides :
- A Graphical Interface that simplifies access to the main commands in order to quickly allow the use of Celestia in complete autonomy.
- New features that are not available (yet) in the official distribution: compass, InfoText/Image, distance markers, etc...

You can download the latest beta version of the Lua Edu Tools from:
> http://vincent.gian.club.fr/celestia/Lua_Edu_Tools.zip
1- Unzip and paste the lua_edu_tools' folder in the 'extras' folder.
2- Paste the 'luahookinit.lua' file directly in your Celestia base folder.
3- Add the following line to your celestia.cfg file :

Code: Select all

Configuration
{
LuaHook "luahookinit.lua" # <-- Line to add
...


Important : The Lua Edu Tools require Celestia 1.5.
You can find pre-compiled packages of Celestia 1.5pre5 there:
> Windows : http://celestiaproject.net/forum/viewtopic.php?t=11807
> Mac OS-X : http://www.stevenbinder.net/
Last edited by Vincent on 16.02.2008, 18:33, edited 36 times in total.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 3 months
Location: Seattle, Washington, USA

Post #2by chris » 02.11.2006, 16:18

Is the Lua hook patch ready to be committed to CVS yet?

--Chris

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #3by Vincent » 02.11.2006, 16:44

chris wrote:Is the Lua hook patch ready to be committed to CVS yet?

--Chris


I've made some minor changes to Hank's original patch to add a few functions that I needed for the text layout. I'm waiting for Hank to confirm that the changes are OK. This version compiles fine under Windows and Mac OS-X (tested by ElChristou).

I've also sent the final patch to Christophe to test it under Linux. Christophe had to make a few changes to allow the patched version to compile under Linux. Now, everything seems to be OK.

We might just wait for Hank to confirm that the final version of the Lua hook patch is ready to be committed to CVS.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #4by Vincent » 02.11.2006, 20:58

Just a few more points for users who want to customize the tools :

- If you want to add your own Information Text and Images, just edit the 'infos/infoImage.lua' and 'infos/infoText.lua files'.
Then place your image files in the 'images' folder.

- If you want to contribute to the localization of the lua edu tools, just create your own 'locale/language/language.lua' and 'locale/language/infoText_language.lua' files.
You can use the 'locale/fr/fr.lua' and 'locale/fr/infoText_fr.lua' files as examples.
Then, please send me your translated files so that I can include them in the standard pack.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Jedi
Posts: 13
Joined: 02.11.2006
With us: 17 years 6 months
Location: Tucson, Arizona USA

Post #5by Jedi » 02.11.2006, 23:41

Love what you did with the Lua Hooks. It's something that makes working with Celestia easier.

I noticed that you used some functions from a script written by Harald Schmidt. One thing that I liked about it was the Azimuth and the Elevation. I was wondering if you were going to include this in a future version.

I was playing around with it, and found it was quite easy to incorporate that into the function.

Image

Keep up the excellent work Vincent.[/img]

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #6by Vincent » 03.11.2006, 09:46

Jedi wrote:Love what you did with the Lua Hooks. It's something that makes working with Celestia easier.

I noticed that you used some functions from a script written by Harald Schmidt. One thing that I liked about it was the Azimuth and the Elevation. I was wondering if you were going to include this in a future version.

I was playing around with it, and found it was quite easy to incorporate that into the function.

Keep up the excellent work Vincent.

Hi Jedi,

I'm happy to see that the Lua Edu Tools are easily customizable.
That is one important point Hank and I have kept in mind all along the building phase.

It is of course possible to incorporate the Azimuth and Elevation values, as you suggested.
However, since they not only refer to the observer but also to the selected object,
I'd prefer to place them in the selection Information Text, just next to the Ra and Dec values,
as you can see on the shot above. And that would also avoid making the compass too obtrusive.

Then, we could rename the button in the ToolBox from "Ra-Dec" to "Measure", or "Measures"...
The french word "Mesures" seems to be quite well adapted. Native English users' might suggest a better name for that Button...

Thanks for your support Jedi, and of course, "May the force be with us !" :wink:

Image
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 3 months

Post #7by ElChristou » 03.11.2006, 18:25

IMHO, the compass and the time box deserve to be integrated in the official code right now!!
Image

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #8by Vincent » 04.11.2006, 11:42

I've made a major update to the Lua Edu Tools.
You can download version 1.2 here :
> http://vincent.gian.club.fr/celestia/Ce ... du_1.2.zip
You just need to replace the previous 'edu_test' folder with the new one (located in the 'extras' folder).

Here are the changes from the previous version :
- Added 'Azimuth' and 'Elevation' values, as suggested by Jedi.
- Allowed the 'Distance to Earth' to be expressed in different units (km > AU > ly). Actually, the 'Distance to Earth' represents the distance from an object to the surface of the Earth. That's particularly useful, e.g., to have an approximation (Earth is not a sphere) of the altitude of a satellite...
- Added the possibility to activate/unactivate the display of the timerate slider by clicking on the "Rate : ..... x" string (or its translation).
- Improved the code of the compass by displaying an uneven number of characters so that the main direction can be centered on the compass window. From the dev's point of view, I have also improved the compass lua code to make it more elegant and easily understood.
- Fixed a bug with the compass when the Milky Way was selected.

The link in my first post has been updated too.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 7 months
Location: Saitama, Japan

Post #9by Sui Ota » 05.11.2006, 11:43

Oh, this is great work!!! :D
It is convenient for using as planetarium!

I tried this under Windows XP SP2 and Mac OS X 10.4.8 PPC...
And I noticed several things.

Bugs...?:
1.
Using 2 or more characters(also using a 2 byte character) for the direction name of the compass, appearance of the direction bahaves strangely, espesially between "E" and "S". (with editing "locale")

2.
Using 2 byte character for the direction, a garble appears at the edge of compass when the character is on far right or far left. I think this is caused by reading only 1 byte of the 2 byte character.

3.
(Mac OS X) The localization did not work; English was shown.

4.
When window size is small, the size of "No image available." box is inappropriate(too small).

Small proposal:
5.
Vincent wrote:It is of course possible to incorporate the Azimuth and Elevation values, as you suggested.
However, since they not only refer to the observer but also to the selected object,
I'd prefer to place them in the selection Information Text, just next to the Ra and Dec values,
as you can see on the shot above. And that would also avoid making the compass too obtrusive.

But it is useless except in case of selecting reference object because the values are relative from "far" selected star(as observation from a very very tall tower...). It will be useful if the values show direction and altitude in the reference object's sky.

6.
The azimuth and elevetion of current viewpoint relative to reference object is also useful. This should be belonged to Compass, like Jedi shown. (In current version, this is achieved by selecting reference object, but...)

7.
On displaying boxes at the first time after launch or resizing windows, the process of structing the boxes is visible for a moment. (But this is no choice...?)

8.
The order of date, month and year depends on the locale, so it will be useful if it can be changed by editing files in locale folder.
-Suι

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 3 months

Post #10by ElChristou » 05.11.2006, 12:06

Sui Ota wrote:
3.
(Mac OS X) The localization did not work; English was shown.


Hello Sui, sorry I'm responsible for this, the version of the app I send to Vincent only have English and French lproj...

You can always open the bundle of a previous version (1.4.2) and copy/paste the japanese lproj in the bundle of this test version.
Image

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 7 months
Location: Saitama, Japan

Post #11by Sui Ota » 05.11.2006, 12:30

ElChristou wrote:
Sui Ota wrote:3.
(Mac OS X) The localization did not work; English was shown.

Hello Sui, sorry I'm responsible for this, the version of the app I send to Vincent only have English and French lproj...

You can always open the bundle of a previous version (1.4.2) and copy/paste the japanese lproj in the bundle of this test version.


I've already copied ja.lproj into the app, but messages related to Luahook is not translated...:(
-Suι

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #12by Vincent » 05.11.2006, 14:09

Sui Ota,

Thanks for this very comprehensive feedback/bug report.
Then, as for the different points you've raised...

1.
Using 2 or more characters(also using a 2 byte character) for the direction name of the compass, appearance of the direction bahaves strangely, espesially between "E" and "S". (with editing "locale")
The number of characters in the compass string (tools/compassBox.lua) has to remain constant.
So, only one single character can be used for each of the 4 cardinal points.
Could you precise why you need to use 2 or more characters ?
I could try to adapt the code to this special case if this is really a priority...

2.
Using 2 byte character for the direction, a garble appears at the edge of compass when the character is on far right or far left. I think this is caused by reading only 1 byte of the 2 byte character.
I'm able to reproduce the bug using accentuated characters that are also encoded with 2 bytes in UTF-8 format.
In fact, the string.len(s) lua function reads the 2 bytes character as two different 1 byte characters...
I'll have a look at the Lua String Library Tutorial to see if the problem can be solved easily...

3.
(Mac OS X) The localization did not work; English was shown.
ElChristou can confirm the problem, which only appears under Mac OS-X.
Strangely, the os.setlocale(nil, "collate") lua function doesn't return the local 'collate' category, but the local 'numeric' category,
even when the second argument is not 'numeric'. I've posted a bug report on the Lua website forum...
For now, Mac users can add this line to their locale.lua file, where LANGUAGE is the 2 characters string of the required
language, in lower case (fr, jp, ...) :

Code: Select all

local col = os.setlocale(nil, "collate");
lang = string.lower(string.sub(col, 1, 2));
lang = LANGUAGE -- <-- Line to add
...


4.
When window size is small, the size of "No image available." box is inappropriate(too small).
Problem solved ! The Celestia_edu_1.2.zip file has been updated.

6.
The azimuth and elevetion of current viewpoint relative to reference object is also useful. This should be belonged to Compass, like Jedi shown. (In current version, this is achieved by selecting reference object, but...)
This is a really valid point. Azimuth and Elevation could refer to the reference/source object, as I did for Longitude and Latitude...
But I'd like to have other user's opinion here about whether or not we should add another string to the compass box...

7.
On displaying boxes at the first time after launch or resizing windows, the process of structing the boxes is visible for a moment. (But this is no choice...?)
Yes, this happens for a fraction of a second, and only during the first display...
That may come from the time needed by the Lua Hook to be interprated by the Celestia Core...
Hank may confirm and possibly do something here... Even if this doesn't appear to be really annoying, does it ?

8.
The order of date, month and year depends on the locale, so it will be useful if it can be changed by editing files in locale folder.

That's in my todo list :wink: ... I was first thinking about adding a setting window, as I did for the setting of the Time Zone...
But your idea of adding a line to the LANGUAGE.lua locale file is great !

Thanks again Sui Ota.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #13by Vincent » 05.11.2006, 17:33

OK,

I've been thinking about Jedi's and Sui Ota's suggestion to display the Azimuth and Elevation values from the
reference/source object, and so to include them into the compass box... And I think I found a good compromize :

- Case n?°1 : When the observer is in 'navigation mode', the compass Box displays the [planetarium mode]
button along with the Longitude and Latitude string, so that the user can easily set the values of Long and Lat
and then switch to planetarium mode. In that case, the Azimuth and Elevation values are not displayed...
Image


- Case n?°2 : When the observer is in 'planetarium mode', the compass Box displays the compass, along with
the Azimuth and Elevation values relative to the source planet. In that case, the Longitude and Latitude values
are not used anymore, and so, they're not displayed...
Image

I think this is a good compromize to keep the compass box unobtrusive...
But it would be helpful to have some other opinion(s) about that...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Jedi
Posts: 13
Joined: 02.11.2006
With us: 17 years 6 months
Location: Tucson, Arizona USA

Post #14by Jedi » 05.11.2006, 18:48

Thanks for all the work that you have done on this issue. I still believe this is a great add-on that enhances the Celestia program. I have two comments I would like to address.

1. The idea of changing the "Lat - Long" measurements to "Azimuth - Elevation" is a great. However, when in Planetarium mode, the object you may want to view could be below the horizon.

Image

You can move along the surface of the object by using a right click to move to a position where the object is now above the horizon. Now the position on the object is unknown.

Image

Another idea is to create a box inside the compass box. When it is clicked it will change the "Lat - Long" to "Azimuth - Elevation" back and forth. This way all the information can be present and still leave the compass box unobtrusive. Right now I am experimenting with this idea.

2. I noticed that in the time box you can bring up a box to change your time zone.

Image

When you click the time box at the top to make the time disappear, the time zone box remains.

Image

This should be easy to correct.

Thanks again for all of the work. I hope that they will encorporate this in the official release of Celestia 1.5.0 edition.

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #15by Vincent » 05.11.2006, 20:51

Jedi wrote:Another idea is to create a box inside the compass box. When it is clicked it will change the "Lat - Long" to "Azimuth - Elevation" back and forth. This way all the information can be present and still leave the compass box unobtrusive. Right now I am experimenting with this idea.
That's another nice solution, to which I can see 2 inconveniences, though :

- I'm trying to keep the colors as coherent as possible. Thus, the Longitude-Lattitude / Azimuth-Elevation string
should be written in pale blue, like in all other active boxes. The problem is that the pale blue color would make the string
too discrete, whereas it is an important element of the compass box...

- I also want to keep the general use of the tools very simple and instinctive. And above all, I wouldn't want the user
to need a tutorial... That's why I've opted for an automatic switch between Long-Lat and Az-Elev...

We could also use both your solution and mine : an automatic switch to Az-Elev, with the possibility to switch back to Long-Lat with a click...
Let's wait a bit and see what other users suggest...

When you click the time box at the top to make the time disappear, the time zone box remains.

Problem solved.

Thanks again Jedi for your very constructive feedback.
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 3 months
Location: Seattle, Washington, USA

Post #16by chris » 06.11.2006, 00:37

ElChristou wrote:IMHO, the compass and the time box deserve to be integrated in the official code right now!!


The Lua hooks will be checked in as soon as Hank and Vincent are ready to commit them. I also think that it would be a good idea to have the Lua tools checked into the main CVS tree--Vincent, do you agree?

--Chris

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 3 months

Post #17by ElChristou » 06.11.2006, 01:12

chris wrote:
ElChristou wrote:IMHO, the compass and the time box deserve to be integrated in the official code right now!!

The Lua hooks will be checked in as soon as Hank and Vincent are ready to commit them. I also think that it would be a good idea to have the Lua tools checked into the main CVS tree--Vincent, do you agree?

--Chris


Ok, that's an option of course; what I really mean is those two functions IMO could be integrated in c++ with perhaps a better control on fonts; actually Lua seems a bit limited to achieve a perfect graphical integration of those functions...
Image

Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Post #18by Vincent » 06.11.2006, 11:28

chris wrote:The Lua hooks will be checked in as soon as Hank and Vincent are ready to commit them.
I've sent a new email to Hank.
But since the current patch was tested successfully on Windows, Linux and Mac OS-X systems, maybe we can commit it already. Then, Hank will make some changes if needed.

chris wrote:I also think that it would be a good idea to have the Lua tools checked into the main CVS tree--Vincent, do you agree?

Chris, I do agree with you on checking the lua edu tools into the CVS.
Then, does that mean they will be part of the release package ? In that case, we should also agree about the standard set of Information Text and Images to provide. Just for information, the current size of the lua tool folder is about 800 Ko...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Ramón
Posts: 14
Joined: 22.04.2003
With us: 21 years

Post #19by Ramón » 06.11.2006, 14:32

Hello Vincent, this is Ramon from Mexico.
Great job on the Celestia EDU.
I just got one question for now: this version of Celestia EDU doesn't have the sound patch? I've already instaled and check out the files and I can't see nothing related with sound.

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 3 months
Location: Seattle, Washington, USA

Post #20by chris » 06.11.2006, 16:54

Vincent wrote:
chris wrote:I also think that it would be a good idea to have the Lua tools checked into the main CVS tree--Vincent, do you agree?
Chris, I do agree with you on checking the lua edu tools into the CVS.
Then, does that mean they will be part of the release package ? In that case, we should also agree about the standard set of Information Text and Images to provide. Just for information, the current size of the lua tool folder is about 800 Ko...


I don't think that they should go into the release version just yet. As you mentioned, there are a lot of decisions still to be made about text and images, and probably a lot of other things. But, I think that it will be easiest to continue development of them if they're in CVS.

--Chris


Return to “Celestia in Education”