Updates Misc

This commit is contained in:
Frank
2020-04-24 16:03:28 +02:00
parent df512f7a58
commit 7360c51a8f
10 changed files with 1026 additions and 517 deletions

View File

@@ -655,6 +655,28 @@ do -- COORDINATE
return Angle
end
--- Return an intermediate COORDINATE between this an another coordinate.
-- @param #COORDINATE self
-- @param #COORDINATE ToCoordinate The other coordinate.
-- @param #number Fraction The fraction (0,1) where the new coordinate is created. Default 0.5, i.e. in the middle.
-- @return #COORDINATE Coordinate between this and the other coordinate.
function COORDINATE:GetIntermediateCoordinate( ToCoordinate, Fraction )
local f=Fraction or 0.5
-- Get the vector from A to B
local vec=UTILS.VecSubstract(ToCoordinate, self)
-- Scale the vector.
vec.x=f*vec.x
vec.y=f*vec.y
vec.z=f*vec.z
-- Move the vector to start at the end of A.
vec=UTILS.VecAdd(self, vec)
return self:New(vec.x,vec.y,vec.z)
end
--- Return the 2D distance in meters between the target COORDINATE and the COORDINATE.
-- @param #COORDINATE self

View File

@@ -113,18 +113,20 @@ end
-- @param #number dt (Optional) Time step in seconds for checking the queue. Default 0.01 sec.
-- @return #RADIOQUEUE self The RADIOQUEUE object.
function RADIOQUEUE:Start(delay, dt)
-- Delay before start.
self.delay=delay or 1
-- Time interval for queue check.
self.dt=dt or 0.01
-- Debug message.
self:I(self.lid..string.format("Starting RADIOQUEUE %s on Frequency %.2f MHz [modulation=%d] in %.1f seconds (dt=%.3f sec)", self.alias, self.frequency/1000000, self.modulation, delay, dt))
-- Start Scheduler.
if self.schedonce then
self:_CheckRadioQueueDelayed(self.delta)
self:_CheckRadioQueueDelayed(delay)
else
--self.RQid=self.scheduler:Schedule(self, self._CheckRadioQueue, {}, delay, dt)
self.RQid=self.scheduler:Schedule(nil, RADIOQUEUE._CheckRadioQueue, {self}, delay, dt)
end
@@ -279,10 +281,6 @@ end
-- @return #number Duration of the call in seconds.
function RADIOQUEUE:Number2Transmission(number, delay, interval)
if not number then
self:E("ERROR: Number is nil!")
end
--- Split string into characters.
local function _split(str)
local chars={}

File diff suppressed because it is too large Load Diff