mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-07-26 08:08:11 +00:00
FC FG
This commit is contained in:
@@ -183,7 +183,7 @@ function FLIGHTCONTROL:New(airbasename)
|
||||
self:AddTransition("*", "Status", "*") -- Update status.
|
||||
|
||||
-- Debug trace.
|
||||
if true then
|
||||
if false then
|
||||
self.Debug=true
|
||||
BASE:TraceOnOff(true)
|
||||
BASE:TraceClass(self.ClassName)
|
||||
@@ -279,7 +279,7 @@ function FLIGHTCONTROL:onafterStart()
|
||||
self:HandleEvent(EVENTS.Crash)
|
||||
|
||||
self.atcradio=RADIOQUEUE:New(self.atcfreq or 305, nil, string.format("FC %s", self.airbasename))
|
||||
self.atcradio:Start(1, 0.01)
|
||||
self.atcradio:Start(1, 0.1)
|
||||
|
||||
-- Init status updates.
|
||||
self:__Status(-1)
|
||||
|
||||
@@ -285,6 +285,7 @@ function FLIGHTGROUP:New(groupname)
|
||||
-- Add FSM transitions.
|
||||
-- From State --> Event --> To State
|
||||
self:AddTransition("Stopped", "Start", "Running") -- Start FSM.
|
||||
self:AddTransition("*", "Stop", "Stopped") -- Stop FSM.
|
||||
|
||||
self:AddTransition("*", "FlightStatus", "*") -- FLIGHTGROUP status update.
|
||||
self:AddTransition("*", "QueueUpdate", "*") -- Update task queue.
|
||||
@@ -368,8 +369,7 @@ function FLIGHTGROUP:New(groupname)
|
||||
|
||||
|
||||
-- Debug trace.
|
||||
if false then
|
||||
self.Debug=false
|
||||
if true then
|
||||
BASE:TraceOnOff(true)
|
||||
BASE:TraceClass(self.ClassName)
|
||||
BASE:TraceLevel(1)
|
||||
@@ -707,7 +707,8 @@ function FLIGHTGROUP:onafterStart(From, Event, To)
|
||||
|
||||
-- Trigger spawned event for all elements.
|
||||
for _,element in pairs(self.elements) do
|
||||
self:ElementSpawned(element)
|
||||
-- Add a little delay or the OnAfterSpawned function is not even initialized and will not be called.
|
||||
self:__ElementSpawned(0.1, element)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1443,6 +1444,9 @@ function FLIGHTGROUP:onafterFlightDead(From, Event, To)
|
||||
self.flightcontrol:_RemoveFlight(self)
|
||||
self.flightcontrol=nil
|
||||
end
|
||||
|
||||
-- Stop
|
||||
self:__Stop(0.5)
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user