mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 05:36:02 +00:00
Ops
This commit is contained in:
@@ -1079,8 +1079,10 @@ function AUFTRAG:onafterStatus(From, Event, To)
|
|||||||
local Cstart=UTILS.SecondsToClock(self.Tstart, true)
|
local Cstart=UTILS.SecondsToClock(self.Tstart, true)
|
||||||
local Cstop=self.Tstop and UTILS.SecondsToClock(self.Tstop, true) or "INF"
|
local Cstop=self.Tstop and UTILS.SecondsToClock(self.Tstop, true) or "INF"
|
||||||
|
|
||||||
|
local targetname=self:GetTargetName() or "unknown"
|
||||||
|
|
||||||
-- Info message.
|
-- 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.
|
-- Check for error.
|
||||||
if fsmstate~=self.status then
|
if fsmstate~=self.status then
|
||||||
@@ -1698,6 +1700,28 @@ function AUFTRAG:GetTargetCoordinate()
|
|||||||
return nil
|
return nil
|
||||||
end
|
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.
|
--- Get distance to target.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE FromCoord The coordinate from which the distance is measured.
|
-- @param Core.Point#COORDINATE FromCoord The coordinate from which the distance is measured.
|
||||||
|
|||||||
@@ -895,14 +895,19 @@ end
|
|||||||
-- @param #FLIGHTGROUP self
|
-- @param #FLIGHTGROUP self
|
||||||
-- @return #string Group name.
|
-- @return #string Group name.
|
||||||
function FLIGHTGROUP:GetName()
|
function FLIGHTGROUP:GetName()
|
||||||
return self.group:GetName()
|
return self.groupname
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get current coordinate of the group.
|
--- Get current coordinate of the group.
|
||||||
-- @param #FLIGHTGROUP self
|
-- @param #FLIGHTGROUP self
|
||||||
-- @return Core.Point#COORDINATE The coordinate (of the first unit) of the group.
|
-- @return Core.Point#COORDINATE The coordinate (of the first unit) of the group.
|
||||||
function FLIGHTGROUP:GetCoordinate()
|
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
|
end
|
||||||
|
|
||||||
--- Get waypoint.
|
--- Get waypoint.
|
||||||
|
|||||||
@@ -313,6 +313,10 @@ function INTEL:onafterStatus(From, Event, To)
|
|||||||
local contact=_contact --#INTEL.DetectedItem
|
local contact=_contact --#INTEL.DetectedItem
|
||||||
local dT=timer.getAbsTime()-contact.Tdetected
|
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)
|
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
|
end
|
||||||
self:I(self.lid..text)
|
self:I(self.lid..text)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -248,19 +248,25 @@ end
|
|||||||
|
|
||||||
--- Set call sign.
|
--- Set call sign.
|
||||||
-- @param #SQUADRON self
|
-- @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
|
-- @return #SQUADRON self
|
||||||
function SQUADRON:SetCallsign(Callsign, Index)
|
function SQUADRON:SetCallsign(Callsign, Index)
|
||||||
self.callsignName=Callsign
|
self.callsignName=Callsign
|
||||||
|
self.callsignIndex=Index
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set modex.
|
--- Set modex.
|
||||||
-- @param #SQUADRON self
|
-- @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
|
-- @return #SQUADRON self
|
||||||
function SQUADRON:SetModex(Modex)
|
function SQUADRON:SetModex(Modex, Prefix, Suffix)
|
||||||
self.modex=Modex
|
self.modex=Modex
|
||||||
|
self.modexPrefix=Prefix
|
||||||
|
self.modexSuffix=Suffix
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user