Fix ThrottleInit (2)
This commit is contained in:
31
main.lua
31
main.lua
@@ -133,6 +133,8 @@ Throttles = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ThrottleInit()
|
function ThrottleInit()
|
||||||
|
Throttles = {}
|
||||||
|
|
||||||
local sides = {
|
local sides = {
|
||||||
"top",
|
"top",
|
||||||
"bottom",
|
"bottom",
|
||||||
@@ -734,35 +736,6 @@ function collectSensorData()
|
|||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
|
||||||
function Main()
|
|
||||||
Init()
|
|
||||||
|
|
||||||
while true do
|
|
||||||
local sensorData = collectSensorData()
|
|
||||||
|
|
||||||
-- Update monitor displays
|
|
||||||
if Config.Monitors.InstrumentPanelMonitor then
|
|
||||||
displayInstrumentPanel(Config.Monitors.InstrumentPanelMonitor, sensorData)
|
|
||||||
end
|
|
||||||
|
|
||||||
if Config.Monitors.AutopilotControlMonitor then
|
|
||||||
displayAutopilotControls(Config.Monitors.AutopilotControlMonitor, sensorData)
|
|
||||||
end
|
|
||||||
|
|
||||||
local unindexedThrusters = checkIfThrusterIsIndexed()
|
|
||||||
if unindexedThrusters ~= nil then
|
|
||||||
partiallyUpdateThrusters(unindexedThrusters)
|
|
||||||
end
|
|
||||||
|
|
||||||
PollSensors()
|
|
||||||
UpdateGlobalThrust()
|
|
||||||
UpdateStabilization()
|
|
||||||
|
|
||||||
-- Add a small delay to avoid overloading the system
|
|
||||||
os.sleep(0.1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function displayAutopilotControls(monitor)
|
function displayAutopilotControls(monitor)
|
||||||
if not monitor or not monitor.peripheral then return end
|
if not monitor or not monitor.peripheral then return end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user