mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Updated Scheduler and documentation.
-- Added SCHEDULER.Schedule method. -- Reworked SCHEDULER.New method. -- Renamed Mechanic to Mechanist.
This commit is contained in:
@@ -33,27 +33,20 @@ function PROCESS:New( ProcessName, Task, ProcessUnit )
|
||||
self.Task = Task
|
||||
self.ProcessName = ProcessName
|
||||
|
||||
self.AllowEvents = true
|
||||
self.ProcessScheduler = SCHEDULER:New( self.Fsm, self.NextEvent )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param #PROCESS self
|
||||
function PROCESS:NextEvent( NextEvent, ... )
|
||||
if self.AllowEvents == true then
|
||||
self.ProcessScheduler = SCHEDULER:New( self.Fsm, NextEvent, arg, 1 )
|
||||
end
|
||||
self.ProcessScheduler:Schedule( arg, 1 ) -- This schedules the next event, but only if scheduling is activated.
|
||||
end
|
||||
|
||||
--- @param #PROCESS self
|
||||
function PROCESS:StopEvents( )
|
||||
self:F2()
|
||||
if self.ProcessScheduler then
|
||||
self:E( "Stop" )
|
||||
self.ProcessScheduler:Stop()
|
||||
self.ProcessScheduler = nil
|
||||
self.AllowEvents = false
|
||||
end
|
||||
function PROCESS:StopEvents()
|
||||
self:F( { "Stop Process ", self.ProcessName } )
|
||||
self.ProcessScheduler:Stop()
|
||||
end
|
||||
|
||||
--- Adds a score for the PROCESS to be achieved.
|
||||
|
||||
Reference in New Issue
Block a user