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