mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Pogress
- Still a problem, getting obscolete calls after a garbage collect where i should not get them ...
This commit is contained in:
@@ -58,18 +58,7 @@ function SCHEDULER:New( TimeEventObject, TimeEventFunction, TimeEventFunctionArg
|
||||
local self = BASE:Inherit( self, BASE:New() )
|
||||
self:F2( { StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds } )
|
||||
|
||||
self.TimeEventObject = TimeEventObject
|
||||
self.TimeEventFunction = TimeEventFunction
|
||||
self.TimeEventFunctionArguments = TimeEventFunctionArguments
|
||||
self.StartSeconds = StartSeconds
|
||||
self.Repeat = false
|
||||
self.RepeatSecondsInterval = RepeatSecondsInterval or 0
|
||||
self.RandomizationFactor = RandomizationFactor or 0
|
||||
self.StopSeconds = StopSeconds
|
||||
|
||||
self.StartTime = timer.getTime()
|
||||
|
||||
_TIMERDISPATCHER:AddSchedule( self )
|
||||
self:Schedule( TimeEventObject, TimeEventFunction, TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds )
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -119,6 +108,8 @@ function SCHEDULER:Start()
|
||||
timer.removeFunction( self.ScheduleID )
|
||||
end
|
||||
self:T( { self.StartSeconds } )
|
||||
_TIMERDISPATCHER:AddSchedule( self )
|
||||
|
||||
self.ScheduleID = timer.scheduleFunction( self._Scheduler, self, timer.getTime() + self.StartSeconds + .001 )
|
||||
end
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ function TIMER:AddSchedule( Scheduler, ScheduleFunction, ScheduleArguments, Star
|
||||
local StartTime = CurrentTime + Start
|
||||
|
||||
if Status and (( Result == nil ) or ( Result and Result ~= false ) ) then
|
||||
if Repeat ~= 0 and ( not Stop ) or ( Stop and CurrentTime <= StartTime + Stop ) then
|
||||
if Repeat ~= 0 and ( Stop == 0 ) or ( Stop ~= 0 and CurrentTime <= StartTime + Stop ) then
|
||||
local ScheduleTime =
|
||||
CurrentTime +
|
||||
Repeat +
|
||||
|
||||
Reference in New Issue
Block a user