mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 13:46:08 +00:00
Updates
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
--
|
--
|
||||||
-- 1.1) Add or remove objects from the FSM
|
-- 1.1) Add or remove objects from the FSM
|
||||||
-- --------------------------------------------
|
-- --------------------------------------------
|
||||||
-- @module StateMachine
|
-- @module Fsm
|
||||||
-- @author FlightControl
|
-- @author FlightControl
|
||||||
|
|
||||||
|
|
||||||
@@ -346,23 +346,23 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- STATEMACHINE_CONTROLLABLE class
|
--- FSM_CONTROLLABLE class
|
||||||
-- @type STATEMACHINE_CONTROLLABLE
|
-- @type FSM_CONTROLLABLE
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
-- @field Wrapper.Controllable#CONTROLLABLE Controllable
|
||||||
-- @extends Fsm.Fsm#FSM
|
-- @extends Fsm.Fsm#FSM
|
||||||
STATEMACHINE_CONTROLLABLE = {
|
FSM_CONTROLLABLE = {
|
||||||
ClassName = "STATEMACHINE_CONTROLLABLE",
|
ClassName = "FSM_CONTROLLABLE",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Creates a new STATEMACHINE_CONTROLLABLE object.
|
--- Creates a new FSM_CONTROLLABLE object.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #FSM_CONTROLLABLE self
|
||||||
-- @param #table FSMT Finite State Machine Table
|
-- @param #table FSMT Finite State Machine Table
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable (optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||||
-- @return #STATEMACHINE_CONTROLLABLE
|
-- @return #FSM_CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
function FSM_CONTROLLABLE:New( FSMT, Controllable )
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- Inherits from BASE
|
||||||
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
local self = BASE:Inherit( self, FSM:New( FSMT ) ) -- Fsm.Fsm#FSM_CONTROLLABLE
|
||||||
|
|
||||||
if Controllable then
|
if Controllable then
|
||||||
self:SetControllable( Controllable )
|
self:SetControllable( Controllable )
|
||||||
@@ -371,23 +371,23 @@ function STATEMACHINE_CONTROLLABLE:New( FSMT, Controllable )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
--- Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #FSM_CONTROLLABLE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE FSMControllable
|
-- @param Wrapper.Controllable#CONTROLLABLE FSMControllable
|
||||||
-- @return #STATEMACHINE_CONTROLLABLE
|
-- @return #FSM_CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
|
function FSM_CONTROLLABLE:SetControllable( FSMControllable )
|
||||||
self:F( FSMControllable )
|
self:F( FSMControllable )
|
||||||
self.Controllable = FSMControllable
|
self.Controllable = FSMControllable
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
|
--- Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.
|
||||||
-- @param #STATEMACHINE_CONTROLLABLE self
|
-- @param #FSM_CONTROLLABLE self
|
||||||
-- @return Wrapper.Controllable#CONTROLLABLE
|
-- @return Wrapper.Controllable#CONTROLLABLE
|
||||||
function STATEMACHINE_CONTROLLABLE:GetControllable()
|
function FSM_CONTROLLABLE:GetControllable()
|
||||||
return self.Controllable
|
return self.Controllable
|
||||||
end
|
end
|
||||||
|
|
||||||
function STATEMACHINE_CONTROLLABLE:_call_handler( handler, params )
|
function FSM_CONTROLLABLE:_call_handler( handler, params )
|
||||||
|
|
||||||
local ErrorHandler = function( errmsg )
|
local ErrorHandler = function( errmsg )
|
||||||
|
|
||||||
@@ -409,7 +409,7 @@ end
|
|||||||
--- FSM_PROCESS class
|
--- FSM_PROCESS class
|
||||||
-- @type FSM_PROCESS
|
-- @type FSM_PROCESS
|
||||||
-- @field Tasking.Task#TASK_BASE Task
|
-- @field Tasking.Task#TASK_BASE Task
|
||||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||||
FSM_PROCESS = {
|
FSM_PROCESS = {
|
||||||
ClassName = "FSM_PROCESS",
|
ClassName = "FSM_PROCESS",
|
||||||
}
|
}
|
||||||
@@ -419,7 +419,7 @@ FSM_PROCESS = {
|
|||||||
-- @return #FSM_PROCESS
|
-- @return #FSM_PROCESS
|
||||||
function FSM_PROCESS:New( FsmT, Controllable, Task )
|
function FSM_PROCESS:New( FsmT, Controllable, Task )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FsmT ) ) -- Fsm.Fsm#FSM_PROCESS
|
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FsmT ) ) -- Fsm.Fsm#FSM_PROCESS
|
||||||
|
|
||||||
self:Assign( Controllable, Task )
|
self:Assign( Controllable, Task )
|
||||||
self.ClassName = FsmT._Name
|
self.ClassName = FsmT._Name
|
||||||
@@ -566,7 +566,7 @@ FSM_TASK = {
|
|||||||
-- @return #FSM_TASK
|
-- @return #FSM_TASK
|
||||||
function FSM_TASK:New( FSMT )
|
function FSM_TASK:New( FSMT )
|
||||||
|
|
||||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) ) -- Fsm.Fsm#FSM_TASK
|
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FSMT ) ) -- Fsm.Fsm#FSM_TASK
|
||||||
|
|
||||||
self["onstatechange"] = self.OnStateChange
|
self["onstatechange"] = self.OnStateChange
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
-- @field Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
-- @field Dcs.DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
|
||||||
-- @field Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
-- @field Dcs.DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
|
||||||
-- @field Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
-- @field Dcs.DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
|
||||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||||
PATROLZONE = {
|
PATROLZONE = {
|
||||||
ClassName = "PATROLZONE",
|
ClassName = "PATROLZONE",
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ function PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude,
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Inherits from BASE
|
-- Inherits from BASE
|
||||||
local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT ) )
|
local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( FSMT ) )
|
||||||
|
|
||||||
self.PatrolZone = PatrolZone
|
self.PatrolZone = PatrolZone
|
||||||
self.PatrolFloorAltitude = PatrolFloorAltitude
|
self.PatrolFloorAltitude = PatrolFloorAltitude
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
-- @field Wrapper.Group#GROUP ProcessGroup
|
-- @field Wrapper.Group#GROUP ProcessGroup
|
||||||
-- @field Core.Menu#MENU_GROUP MissionMenu
|
-- @field Core.Menu#MENU_GROUP MissionMenu
|
||||||
-- @field #string ProcessName
|
-- @field #string ProcessName
|
||||||
-- @extends Fsm.Fsm#STATEMACHINE_CONTROLLABLE
|
-- @extends Fsm.Fsm#FSM_CONTROLLABLE
|
||||||
PROCESS = {
|
PROCESS = {
|
||||||
ClassName = "PROCESS",
|
ClassName = "PROCESS",
|
||||||
NextEvent = nil,
|
NextEvent = nil,
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
-- * @{#TASK_BASE.AssignToGroup}():Assign a task to a group (of players).
|
-- * @{#TASK_BASE.AssignToGroup}():Assign a task to a group (of players).
|
||||||
-- * @{#TASK_BASE.AddProcess}():Add a @{Process} to a task.
|
-- * @{#TASK_BASE.AddProcess}():Add a @{Process} to a task.
|
||||||
-- * @{#TASK_BASE.RemoveProcesses}():Remove a running @{Process} from a running task.
|
-- * @{#TASK_BASE.RemoveProcesses}():Remove a running @{Process} from a running task.
|
||||||
-- * @{#TASK_BASE.SetStateMachine}():Set a @{StateMachine} to a task.
|
-- * @{#TASK_BASE.SetStateMachine}():Set a @{Fsm} to a task.
|
||||||
-- * @{#TASK_BASE.RemoveStateMachine}():Remove @{StateMachine} from a task.
|
-- * @{#TASK_BASE.RemoveStateMachine}():Remove @{Fsm} from a task.
|
||||||
-- * @{#TASK_BASE.HasStateMachine}():Enquire if the task has a @{StateMachine}
|
-- * @{#TASK_BASE.HasStateMachine}():Enquire if the task has a @{Fsm}
|
||||||
-- * @{#TASK_BASE.AssignToUnit}(): Assign a task to a unit. (Needs to be implemented in the derived classes from @{#TASK_BASE}.
|
-- * @{#TASK_BASE.AssignToUnit}(): Assign a task to a unit. (Needs to be implemented in the derived classes from @{#TASK_BASE}.
|
||||||
-- * @{#TASK_BASE.UnAssignFromUnit}(): Unassign the task from a unit.
|
-- * @{#TASK_BASE.UnAssignFromUnit}(): Unassign the task from a unit.
|
||||||
--
|
--
|
||||||
|
|||||||
Reference in New Issue
Block a user