mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update Airboss.lua
This commit is contained in:
parent
e6e0cf5977
commit
71c7e15fc3
@ -1476,7 +1476,9 @@ AIRBOSS.Difficulty={
|
|||||||
-- @field #number Vel Total velocity in m/s.
|
-- @field #number Vel Total velocity in m/s.
|
||||||
-- @field #number Vy Vertical velocity in m/s.
|
-- @field #number Vy Vertical velocity in m/s.
|
||||||
-- @field #number Gamma Relative heading player to carrier's runway. 0=parallel, +-90=perpendicular.
|
-- @field #number Gamma Relative heading player to carrier's runway. 0=parallel, +-90=perpendicular.
|
||||||
-- @field #string Grade LSO grade details.
|
-- @field #string Grade LSO grade.
|
||||||
|
-- @field #number GradePoints LSO grade points
|
||||||
|
-- @field #string GradeDetail LSO grade details.
|
||||||
-- @field #string FlyThrough Fly through up "/" or fly through down "\\".
|
-- @field #string FlyThrough Fly through up "/" or fly through down "\\".
|
||||||
|
|
||||||
--- LSO grade data.
|
--- LSO grade data.
|
||||||
@ -1826,7 +1828,7 @@ function AIRBOSS:New(carriername, alias)
|
|||||||
|
|
||||||
-- Debug trace.
|
-- Debug trace.
|
||||||
if false then
|
if false then
|
||||||
--self.Debug=true
|
self.Debug=true
|
||||||
BASE:TraceOnOff(true)
|
BASE:TraceOnOff(true)
|
||||||
BASE:TraceClass(self.ClassName)
|
BASE:TraceClass(self.ClassName)
|
||||||
BASE:TraceLevel(1)
|
BASE:TraceLevel(1)
|
||||||
@ -2548,8 +2550,12 @@ end
|
|||||||
-- @param #string path (Optional) Path where to save the trap sheets.
|
-- @param #string path (Optional) Path where to save the trap sheets.
|
||||||
-- @return #AIRBOSS self
|
-- @return #AIRBOSS self
|
||||||
function AIRBOSS:SetTrapSheet(path)
|
function AIRBOSS:SetTrapSheet(path)
|
||||||
self.trapsheet=true
|
if io then
|
||||||
self.trappath=path
|
self.trapsheet=true
|
||||||
|
self.trappath=path
|
||||||
|
else
|
||||||
|
self:E(self.lid.."ERROR: io is not desanitized. Cannot save trap sheet.")
|
||||||
|
end
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -6806,8 +6812,14 @@ end
|
|||||||
-- @param Wrapper.Unit#UNIT unit The aircraft unit that was recovered.
|
-- @param Wrapper.Unit#UNIT unit The aircraft unit that was recovered.
|
||||||
-- @return #AIRBOSS.FlightGroup Flight group of element.
|
-- @return #AIRBOSS.FlightGroup Flight group of element.
|
||||||
function AIRBOSS:_RecoveredElement(unit)
|
function AIRBOSS:_RecoveredElement(unit)
|
||||||
local element, idx, flight=self:_GetFlightElement(unit:GetName()) --#AIRBOSS.FlightElement
|
|
||||||
element.recovered=true
|
-- Get element of flight.
|
||||||
|
local element, idx, flight=self:_GetFlightElement(unit:GetName()) --#AIRBOSS.FlightElement
|
||||||
|
|
||||||
|
-- Nil check. Could be if a helo landed or something else we dont know!
|
||||||
|
if element then
|
||||||
|
element.recovered=true
|
||||||
|
end
|
||||||
|
|
||||||
return flight
|
return flight
|
||||||
end
|
end
|
||||||
@ -8622,7 +8634,10 @@ function AIRBOSS:_GetGrooveData(playerData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Velocity vector.
|
-- Velocity vector.
|
||||||
local vel=playerData.unit:GetVelocityVec3()
|
local vel=playerData.unit:GetVelocityVec3()
|
||||||
|
|
||||||
|
-- Grade, points, details
|
||||||
|
local Gg,Gp,Gd=self:_LSOgrade(playerData)
|
||||||
|
|
||||||
-- Gather pilot data.
|
-- Gather pilot data.
|
||||||
local groovedata={} --#AIRBOSS.GrooveData
|
local groovedata={} --#AIRBOSS.GrooveData
|
||||||
@ -8641,7 +8656,9 @@ function AIRBOSS:_GetGrooveData(playerData)
|
|||||||
groovedata.Vel=UTILS.VecNorm(vel)
|
groovedata.Vel=UTILS.VecNorm(vel)
|
||||||
groovedata.Vy=vel.y
|
groovedata.Vy=vel.y
|
||||||
groovedata.Gamma=self:_GetRelativeHeading(playerData.unit, true)
|
groovedata.Gamma=self:_GetRelativeHeading(playerData.unit, true)
|
||||||
groovedata.Grade=select(3, self:_LSOgrade(playerData))
|
groovedata.Grade=Gg
|
||||||
|
groovedata.GradePoints=Gp
|
||||||
|
groovedata.GradeDetail=Gd
|
||||||
|
|
||||||
return groovedata
|
return groovedata
|
||||||
end
|
end
|
||||||
@ -12138,7 +12155,7 @@ function AIRBOSS:CarrierDetour(coord, speed, uturn, uspeed)
|
|||||||
local wp={}
|
local wp={}
|
||||||
|
|
||||||
-- Pos1 is a bit into.
|
-- Pos1 is a bit into.
|
||||||
local pos1=pos0:Translate(500, pos0:HeadingTo(coord))
|
local pos1=pos0:Translate(500, pos0:HeadingTo(coord)):Translate(500, self:GetHeading())
|
||||||
|
|
||||||
-- Create from/to waypoints.
|
-- Create from/to waypoints.
|
||||||
table.insert(wp, pos0:WaypointGround(cspeedkmh))
|
table.insert(wp, pos0:WaypointGround(cspeedkmh))
|
||||||
@ -12161,6 +12178,7 @@ function AIRBOSS:CarrierDetour(coord, speed, uturn, uspeed)
|
|||||||
|
|
||||||
-- Debug mark.
|
-- Debug mark.
|
||||||
if self.Debug then
|
if self.Debug then
|
||||||
|
pos1:MarkToAll("Detour Pos1")
|
||||||
coord:MarkToAll("Detour Point")
|
coord:MarkToAll("Detour Point")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -12199,7 +12217,7 @@ function AIRBOSS:CarrierTurnIntoWind(time, vdeck, uturn)
|
|||||||
local intowind=self:GetHeadingIntoWind(false)
|
local intowind=self:GetHeadingIntoWind(false)
|
||||||
|
|
||||||
-- Translate current position.
|
-- Translate current position.
|
||||||
local pos1=self:GetCoordinate():Translate(dist, intowind)
|
local pos1=self:GetCoordinate():Translate(dist, intowind):Translate(500, self:GetHeading())
|
||||||
|
|
||||||
-- Debug mark.
|
-- Debug mark.
|
||||||
if self.Debug then
|
if self.Debug then
|
||||||
@ -15975,7 +15993,7 @@ function AIRBOSS:_SaveTrapSheet(playerData, grade)
|
|||||||
self:I(self.lid..text)
|
self:I(self.lid..text)
|
||||||
|
|
||||||
-- Header line
|
-- Header line
|
||||||
local data="#Time,Rho,X,Z,Alt,AoA,GSE,LUE,Vtot,Vy,Gamma,Pitch,Roll,Yaw,Step\n"
|
local data="#Time,Rho,X,Z,Alt,AoA,GSE,LUE,Vtot,Vy,Gamma,Pitch,Roll,Yaw,Step,Grade,Points,Details\n"
|
||||||
|
|
||||||
local g0=playerData.trapsheet[1] --#AIRBOSS.GrooveData
|
local g0=playerData.trapsheet[1] --#AIRBOSS.GrooveData
|
||||||
local T0=g0.Time
|
local T0=g0.Time
|
||||||
@ -15996,9 +16014,12 @@ function AIRBOSS:_SaveTrapSheet(playerData, grade)
|
|||||||
local k=groove.Pitch
|
local k=groove.Pitch
|
||||||
local l=groove.Roll
|
local l=groove.Roll
|
||||||
local m=groove.Yaw
|
local m=groove.Yaw
|
||||||
local n=groove.Step
|
local n=self:_GS(groove.Step, -1)
|
||||||
-- t a b c d e f g h i j k l m n o
|
local o=groove.Grade
|
||||||
data=data..string.format("%.2f,%.3f,%.1f,%.1f,%.1f,%.2f,%.2f,%.2f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%s,%s\n",t,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
|
local p=groove.GradePoints
|
||||||
|
local q=groove.GradeDetail
|
||||||
|
-- t a b c d e f g h i j k l m n o p q
|
||||||
|
data=data..string.format("%.2f,%.3f,%.1f,%.1f,%.1f,%.2f,%.2f,%.2f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%s,%s,%.1f,%s\n",t,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Save file.
|
-- Save file.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user