mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-24 03:55:27 +00:00
Ops
This commit is contained in:
@@ -395,8 +395,8 @@ function AIRWING:AddMission(Mission)
|
||||
table.insert(self.missionqueue, Mission)
|
||||
|
||||
-- Info text.
|
||||
local text=string.format("Added %s mission %s. Starting at %s. Stopping at %s",
|
||||
tostring(Mission.type), tostring(Mission.name), UTILS.SecondsToClock(Mission.Tstart, true), Mission.Tstop and UTILS.SecondsToClock(Mission.Tstop, true) or "INF")
|
||||
local text=string.format("Added mission %s (type=%s). Starting at %s. Stopping at %s",
|
||||
tostring(Mission.name), tostring(Mission.type), UTILS.SecondsToClock(Mission.Tstart, true), Mission.Tstop and UTILS.SecondsToClock(Mission.Tstop, true) or "INF")
|
||||
self:I(self.lid..text)
|
||||
|
||||
return self
|
||||
|
||||
@@ -1081,20 +1081,25 @@ function AUFTRAG:onafterStatus(From, Event, To)
|
||||
|
||||
local targetname=self:GetTargetName() or "unknown"
|
||||
|
||||
local airwing=self.airwing and self.airwing.alias or "N/A"
|
||||
local commander=self.wingcommander and tosting(self.wingcommander.coalition) or "N/A"
|
||||
|
||||
-- Info message.
|
||||
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))
|
||||
self:I(self.lid..string.format("Status %s: Target=%s, T=%s-%s, assets=%d, flights=%d, targets=%d, wing=%s, commander=%s", self.status, targetname, Cstart, Cstop, #self.assets, Nflights, Ntargets, airwing, commander))
|
||||
|
||||
-- Check for error.
|
||||
if fsmstate~=self.status then
|
||||
self:E(self.lid..string.format("ERROR: FSM state %s != %s mission status!", fsmstate, self.status))
|
||||
end
|
||||
|
||||
local text="Flight data:"
|
||||
for groupname,_flightdata in pairs(self.flightdata) do
|
||||
local flightdata=_flightdata --#AUFTRAG.FlightData
|
||||
text=text..string.format("\n- %s: status mission=%s flightgroup=%s", groupname, flightdata.status, flightdata.flightgroup and flightdata.flightgroup:GetState() or "N/A")
|
||||
if #self.flightdata>0 then
|
||||
local text="Flight data:"
|
||||
for groupname,_flightdata in pairs(self.flightdata) do
|
||||
local flightdata=_flightdata --#AUFTRAG.FlightData
|
||||
text=text..string.format("\n- %s: status mission=%s flightgroup=%s", groupname, flightdata.status, flightdata.flightgroup and flightdata.flightgroup:GetState() or "N/A")
|
||||
end
|
||||
self:I(self.lid..text)
|
||||
end
|
||||
self:I(self.lid..text)
|
||||
|
||||
-- Check if mission is OVER (done or cancelled).
|
||||
if self:IsOver() then
|
||||
@@ -1469,11 +1474,15 @@ function AUFTRAG:onafterCancel(From, Event, To)
|
||||
|
||||
if self.airwing then
|
||||
|
||||
env.info(string.format("FF calling MissionCancel() for airwing %s", self.airwing.alias))
|
||||
|
||||
-- Airwing will cancel all flight missions and remove queued request from warehouse queue.
|
||||
self.airwing:MissionCancel(self)
|
||||
|
||||
else
|
||||
|
||||
env.info(string.format("FF no airwing. cancelling flihgts"))
|
||||
|
||||
for _,_flightdata in pairs(self.flightdata) do
|
||||
local flightdata=_flightdata --#AUFTRAG.FlightData
|
||||
flightdata.flightgroup:MissionCancel(self)
|
||||
|
||||
@@ -437,8 +437,8 @@ UTILS.tostringLL = function( lat, lon, acc, DMS)
|
||||
end
|
||||
|
||||
-- 024� 23' 12"N or 024� 23' 12.03"N
|
||||
return string.format('%03d°', latDeg) .. ' ' .. string.format('%02d', latMin) .. '\' ' .. string.format(secFrmtStr, latSec) .. '"' .. latHemi .. ' '
|
||||
.. string.format('%03d°', lonDeg) .. ' ' .. string.format('%02d', lonMin) .. '\' ' .. string.format(secFrmtStr, lonSec) .. '"' .. lonHemi
|
||||
return string.format('%03d°', latDeg)..string.format('%02d', latMin)..'\''..string.format(secFrmtStr, latSec)..'"'..latHemi..' '
|
||||
.. string.format('%03d°', lonDeg)..string.format('%02d', lonMin)..'\''..string.format(secFrmtStr, lonSec)..'"'..lonHemi
|
||||
|
||||
else -- degrees, decimal minutes.
|
||||
latMin = UTILS.Round(latMin, acc)
|
||||
|
||||
Reference in New Issue
Block a user