NasalTimerObject tweaks.
This commit is contained in:
parent
60bec150aa
commit
6f80df0b8d
1 changed files with 7 additions and 1 deletions
|
@ -105,6 +105,8 @@ public:
|
||||||
_sys->gcRelease(_gcSelf);
|
_sys->gcRelease(_gcSelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isRunning() const { return _isRunning; }
|
||||||
|
|
||||||
void stop()
|
void stop()
|
||||||
{
|
{
|
||||||
if (_isRunning) {
|
if (_isRunning) {
|
||||||
|
@ -139,6 +141,9 @@ public:
|
||||||
{
|
{
|
||||||
naRef *args = NULL;
|
naRef *args = NULL;
|
||||||
_sys->callMethod(_func, _self, 0, args, naNil() /* locals */);
|
_sys->callMethod(_func, _self, 0, args, naNil() /* locals */);
|
||||||
|
if (_singleShot) {
|
||||||
|
_isRunning = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSingleShot(bool aSingleShot)
|
void setSingleShot(bool aSingleShot)
|
||||||
|
@ -783,7 +788,8 @@ void FGNasalSys::init()
|
||||||
.method("start", &TimerObj::start)
|
.method("start", &TimerObj::start)
|
||||||
.method("stop", &TimerObj::stop)
|
.method("stop", &TimerObj::stop)
|
||||||
.method("restart", &TimerObj::restart)
|
.method("restart", &TimerObj::restart)
|
||||||
.member("singleShot", &TimerObj::isSingleShot, &TimerObj::setSingleShot);
|
.member("singleShot", &TimerObj::isSingleShot, &TimerObj::setSingleShot)
|
||||||
|
.member("isRunning", &TimerObj::isRunning);
|
||||||
|
|
||||||
// Now load the various source files in the Nasal directory
|
// Now load the various source files in the Nasal directory
|
||||||
simgear::Dir nasalDir(SGPath(globals->get_fg_root(), "Nasal"));
|
simgear::Dir nasalDir(SGPath(globals->get_fg_root(), "Nasal"));
|
||||||
|
|
Loading…
Reference in a new issue