Hi Martin,
It contains the initial step of a restructuring of the interface code, by separating the vessel class methods in a separate module file.
That's nice. I love a clean structure. If you give me a little time, I'll "merge" my changes into the new file-structure...
I've also unified the checks for input parameters. For example, all vessel class functions fail now if they don't provide a valid vessel object (rather than returning nil), and consistently check for input parameter types.
Yeah, a consistent behavior is another thing that Orbiter-Lua beginners might benefit from.
All the documentation in the vessel class file is now inline, and formatted for ldoc (Lua documenting system). The output of compiling the help files can be seen in Orbitersdk\doc\orbiter_lua.chm.
O.K. One little note about the .chm file: If you click on a "basic" type link (e.g. 'string') you are lost in the Lua documentation, with no elements to navigate back. This might get annoying...Since you've already hacked the ldoc code, you might be able to fix this too.
If you want to compile the help files yourself, you have to install ldoc. Note that I had to hack the ldoc code a bit to suppress the output of function parameters in the function list at the top of the help page (which made the list look really ugly).
For general "ldoc syntax verification", I think the "un-hacked" version will be enough, right?
There is a unit testing script for the Lua interface in Scenarios\Tests\unit_test.scn. It's very incomplete so far, but should give an idea of a test format for the interface functions.
Great! I love unit- / regression-tests.
Not sure how to set up more complex tests, but the general "setup - assert - teardown" approach is very well suited for most of the functionality. Let's see if I add some tests, too.
This commit is mainly for the benefit of people working on the Lua interface (that is to say, kuddel :thumbup
, to provide a framework for documentation.
Yeah right, more work for Kuddel ... :lol:
No really: It's better that I can (try to) document the parts directly where I've coded it. Most of the vessel API methods documentation will be a copy of the Orbiter-APIs documentation, except for some needed additional information specific for the Lua interface.
I haven't incorporated kuddel's work on the interface yet, but I am planning to work on that next.
As mentioned above: If you give me a little time, I'll "merge" my changes into the new file-structure. Although possibly not documented, but still more easy to incorporate then.
So to avoid "double work", I would like to merge my work on top of rev. 73 and upload that to the threads first post.
In case you've already started to do that, drop me a quick note.
/Kuddel
---------- Post added at 14:58 ---------- Previous post was at 09:14 ----------
Hi Martin,
it seems that
proc.wait_sysdt() and
proc.wait_simdt() are not (yet) available when I start the "Tests/unit_test" Scenario , right?
The "unit_test" script will not work well without them
I seems that oapi_init.lua is not working as expected anymore...
I get this error:
Script\oapi_init.lua:113: attempt to yield across C-call boundary