fix ThrottleInit (1)
This commit is contained in:
55
main.lua
55
main.lua
@@ -117,6 +117,21 @@ Config.Autopilot = {
|
|||||||
AutopilotDesiredHeading = nil
|
AutopilotDesiredHeading = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Throttles = {
|
||||||
|
ForeThrottle = {
|
||||||
|
name = nil,
|
||||||
|
side = nil
|
||||||
|
},
|
||||||
|
AftThrottle = {
|
||||||
|
name = nil,
|
||||||
|
side = nil
|
||||||
|
},
|
||||||
|
DownThrottle = {
|
||||||
|
name = nil,
|
||||||
|
side = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function ThrottleInit()
|
function ThrottleInit()
|
||||||
local sides = {
|
local sides = {
|
||||||
"top",
|
"top",
|
||||||
@@ -171,6 +186,46 @@ function ThrottleInit()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print("\nIdentifying aft throttle")
|
||||||
|
print("\nPlease change the input signal for the throttle")
|
||||||
|
|
||||||
|
local initialStates = getRelayStates()
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local currentStates = getRelayStates()
|
||||||
|
|
||||||
|
for pname, currentState in pairs(currentStates) do
|
||||||
|
local initialState = initialStates[pname]
|
||||||
|
for k, v in pairs(currentState) do
|
||||||
|
if initialState[k] ~= v then
|
||||||
|
Throttles.AftThrottleThrottle.name = pname
|
||||||
|
Throttles.AftThrottle.side = k
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
print("\nIdentifying down throttle")
|
||||||
|
print("\nPlease change the input signal for the throttle")
|
||||||
|
|
||||||
|
local initialStates = getRelayStates()
|
||||||
|
|
||||||
|
while true do
|
||||||
|
local currentStates = getRelayStates()
|
||||||
|
|
||||||
|
for pname, currentState in pairs(currentStates) do
|
||||||
|
local initialState = initialStates[pname]
|
||||||
|
for k, v in pairs(currentState) do
|
||||||
|
if initialState[k] ~= v then
|
||||||
|
Throttles.DownThrottle.name = pname
|
||||||
|
Throttles.DownThrottle.side = k
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function PropellerInit()
|
function PropellerInit()
|
||||||
|
|||||||
Reference in New Issue
Block a user