mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#AWACS - added FSM transitions for VID Success and Failure
This commit is contained in:
parent
73f393c542
commit
0ab6a10ec4
@ -17,7 +17,7 @@
|
|||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- ### Author: **applevangelist**
|
-- ### Author: **applevangelist**
|
||||||
-- @date Last Update Jan 2025
|
-- @date Last Update July 2025
|
||||||
-- @module Ops.AWACS
|
-- @module Ops.AWACS
|
||||||
-- @image OPS_AWACS.jpg
|
-- @image OPS_AWACS.jpg
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ do
|
|||||||
-- @field #AWACS
|
-- @field #AWACS
|
||||||
AWACS = {
|
AWACS = {
|
||||||
ClassName = "AWACS", -- #string
|
ClassName = "AWACS", -- #string
|
||||||
version = "0.2.71", -- #string
|
version = "0.2.72", -- #string
|
||||||
lid = "", -- #string
|
lid = "", -- #string
|
||||||
coalition = coalition.side.BLUE, -- #number
|
coalition = coalition.side.BLUE, -- #number
|
||||||
coalitiontxt = "blue", -- #string
|
coalitiontxt = "blue", -- #string
|
||||||
@ -1242,6 +1242,8 @@ function AWACS:New(Name,AirWing,Coalition,AirbaseName,AwacsOrbit,OpsZone,Station
|
|||||||
self:AddTransition("*", "Intercept", "*")
|
self:AddTransition("*", "Intercept", "*")
|
||||||
self:AddTransition("*", "InterceptSuccess", "*")
|
self:AddTransition("*", "InterceptSuccess", "*")
|
||||||
self:AddTransition("*", "InterceptFailure", "*")
|
self:AddTransition("*", "InterceptFailure", "*")
|
||||||
|
self:AddTransition("*", "VIDSuccess", "*")
|
||||||
|
self:AddTransition("*", "VIDFailure", "*")
|
||||||
self:AddTransition("*", "Stop", "Stopped") -- Stop FSM.
|
self:AddTransition("*", "Stop", "Stopped") -- Stop FSM.
|
||||||
|
|
||||||
|
|
||||||
@ -1365,19 +1367,39 @@ function AWACS:New(Name,AirWing,Coalition,AirbaseName,AwacsOrbit,OpsZone,Station
|
|||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
|
|
||||||
--- On After "InterceptSuccess" event. Intercept successful.
|
--- On After "InterceptSuccess" event. Intercept successful.
|
||||||
-- @function [parent=#AWACS] OnAfterIntercept
|
-- @function [parent=#AWACS] OnAfterInterceptSuccess
|
||||||
-- @param #AWACS self
|
-- @param #AWACS self
|
||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
|
|
||||||
--- On After "InterceptFailure" event. Intercept failure.
|
--- On After "InterceptFailure" event. Intercept failure.
|
||||||
-- @function [parent=#AWACS] OnAfterIntercept
|
-- @function [parent=#AWACS] OnAfterInterceptFailure
|
||||||
-- @param #AWACS self
|
-- @param #AWACS self
|
||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
|
|
||||||
|
--- On After "VIDSuccess" event. Intercept successful.
|
||||||
|
-- @function [parent=#AWACS] OnAfterVIDSuccess
|
||||||
|
-- @param #AWACS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #number GID Managed group ID (Player)
|
||||||
|
-- @param Wrapper.Group#GROUP Group (Player) Group done the VID
|
||||||
|
-- @param #AWACS.ManagedContact Contact The contact that was VID'd
|
||||||
|
|
||||||
|
--- On After "VIDFailure" event. Intercept failure.
|
||||||
|
-- @function [parent=#AWACS] OnAfterVIDFailure
|
||||||
|
-- @param #AWACS self
|
||||||
|
-- @param #string From From state.
|
||||||
|
-- @param #string Event Event.
|
||||||
|
-- @param #string To To state.
|
||||||
|
-- @param #number GID Managed group ID (Player)
|
||||||
|
-- @param Wrapper.Group#GROUP Group (Player) Group done the VID
|
||||||
|
-- @param #AWACS.ManagedContact Contact The contact that was VID'd
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -3263,12 +3285,14 @@ function AWACS:_VID(Group,Declaration)
|
|||||||
local vidpos = self.gettext:GetEntry("VIDPOS",self.locale)
|
local vidpos = self.gettext:GetEntry("VIDPOS",self.locale)
|
||||||
text = string.format(vidpos,Callsign,self.callsigntxt, Declaration)
|
text = string.format(vidpos,Callsign,self.callsigntxt, Declaration)
|
||||||
self:T(text)
|
self:T(text)
|
||||||
|
self:__VIDSuccess(3,GID,group,cluster)
|
||||||
else
|
else
|
||||||
-- too far away
|
-- too far away
|
||||||
self:T("Contact VID not close enough")
|
self:T("Contact VID not close enough")
|
||||||
local vidneg = self.gettext:GetEntry("VIDNEG",self.locale)
|
local vidneg = self.gettext:GetEntry("VIDNEG",self.locale)
|
||||||
text = string.format(vidneg,Callsign,self.callsigntxt)
|
text = string.format(vidneg,Callsign,self.callsigntxt)
|
||||||
self:T(text)
|
self:T(text)
|
||||||
|
self:__VIDFailure(3,GID,group,cluster)
|
||||||
end
|
end
|
||||||
self:_NewRadioEntry(text,text,GID,Outcome,true,true,false,true)
|
self:_NewRadioEntry(text,text,GID,Outcome,true,true,false,true)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user