This commit is contained in:
Frank
2020-03-28 20:47:49 +01:00
parent c0a9d51f98
commit 4ae4f76ce0
4 changed files with 45 additions and 6 deletions
+25 -1
View File
@@ -1078,9 +1078,11 @@ function AUFTRAG:onafterStatus(From, Event, To)
-- Mission start stop time.
local Cstart=UTILS.SecondsToClock(self.Tstart, true)
local Cstop=self.Tstop and UTILS.SecondsToClock(self.Tstop, true) or "INF"
local targetname=self:GetTargetName() or "unknown"
-- Info message.
self:I(self.lid..string.format("Status \"%s\": T=%s-%s assets=%d, flights=%d, targets=%d", self.status, Cstart, Cstop, #self.assets, Nflights, Ntargets))
self:I(self.lid..string.format("Status %s: Target=%s, T=%s-%s, assets=%d, flights=%d, targets=%d", targetname, self.status, Cstart, Cstop, #self.assets, Nflights, Ntargets))
-- Check for error.
if fsmstate~=self.status then
@@ -1698,6 +1700,28 @@ function AUFTRAG:GetTargetCoordinate()
return nil
end
--- Get coordinate of target.
-- @param #AUFTRAG self
-- @return #string
function AUFTRAG:GetTargetName()
if self.engageTarget then
if self.engageTarget.Type==AUFTRAG.TargetType.COORDINATE then
local coord=self.engageTarget.Target --Core.Point#COORDINATE
return coord:ToStringLLDMS()
else
return self.engageTarget.Target:GetName()
end
elseif self.orbitCoord then
return self.orbitCoord:ToStringLLDMS()
elseif self.escortGroup then
return self.escortGroup:GetName()
end
return nil
end
--- Get distance to target.
-- @param #AUFTRAG self
-- @param Core.Point#COORDINATE FromCoord The coordinate from which the distance is measured.
+7 -2
View File
@@ -895,14 +895,19 @@ end
-- @param #FLIGHTGROUP self
-- @return #string Group name.
function FLIGHTGROUP:GetName()
return self.group:GetName()
return self.groupname
end
--- Get current coordinate of the group.
-- @param #FLIGHTGROUP self
-- @return Core.Point#COORDINATE The coordinate (of the first unit) of the group.
function FLIGHTGROUP:GetCoordinate()
return self.group:GetCoordinate()
if self:IsAlive() then
return self.group:GetCoordinate()
else
self:E(self.lid.."WARNING: Group is not alive. Cannot get coordinate!")
end
return nil
end
--- Get waypoint.
@@ -313,6 +313,10 @@ function INTEL:onafterStatus(From, Event, To)
local contact=_contact --#INTEL.DetectedItem
local dT=timer.getAbsTime()-contact.Tdetected
text=text..string.format("\n- %s (%s): %s, units=%d, T=%d sec", contact.categoryname, contact.attribute, contact.groupname, contact.group:CountAliveUnits(), dT)
if contact.mission then
local mission=contact.mission --Ops.Auftrag#AUFTRAG
text=text..string.format(" mission name=%s type=%s target=%s", mission.name, mission.type, mission:GetTargetName() or "unkown")
end
end
self:I(self.lid..text)
end
+9 -3
View File
@@ -248,19 +248,25 @@ end
--- Set call sign.
-- @param #SQUADRON self
-- @param #string Callsign
-- @param #number Callsign Callsign from CALLSIGN.Aircraft, e.g. "Chevy" for CALLSIGN.Aircraft.CHEVY.
-- @param #number Index Callsign index, Chevy-**1**.
-- @return #SQUADRON self
function SQUADRON:SetCallsign(Callsign, Index)
self.callsignName=Callsign
self.callsignIndex=Index
return self
end
--- Set modex.
-- @param #SQUADRON self
-- @param #string Modex
-- @param #number Modex A number like 100.
-- @param #string Prefix A prefix string, which is put before the `Modex` number.
-- @param #string Suffix A suffix string, which is put after the `Modex` number.
-- @return #SQUADRON self
function SQUADRON:SetModex(Modex)
function SQUADRON:SetModex(Modex, Prefix, Suffix)
self.modex=Modex
self.modexPrefix=Prefix
self.modexSuffix=Suffix
return self
end