fix: markflåden 'brug alle' kan udelukke enkelte maskiner med fluebenet (v1.62.32)

This commit is contained in:
2026-10-05 18:41:06 +02:00
parent defbf136f4
commit be2630457f
9 changed files with 34 additions and 13 deletions
+10 -1
View File
@@ -77,6 +77,11 @@ function ADFieldStorage.save(state)
xmlFile:setString(string.format("%s.fleet.vehicle(%d)#id", ADFieldStorage.ROOT, vehicleIndex), vehicleId)
vehicleIndex = vehicleIndex + 1
end
local excludedIndex = 0
for vehicleId in pairs(state.excluded or {}) do
xmlFile:setString(string.format("%s.excluded.vehicle(%d)#id", ADFieldStorage.ROOT, excludedIndex), vehicleId)
excludedIndex = excludedIndex + 1
end
local manualIndex = 0
for vehicleId in pairs(state.manual or {}) do
xmlFile:setString(string.format("%s.manual.vehicle(%d)#id", ADFieldStorage.ROOT, manualIndex), vehicleId)
@@ -93,7 +98,7 @@ function ADFieldStorage.save(state)
end
function ADFieldStorage.load()
local result = {fields = {}, fleet = {}, fleetMode = "all", courseRecords = {}, manual = {}, paused = false}
local result = {fields = {}, fleet = {}, excluded = {}, fleetMode = "all", courseRecords = {}, manual = {}, paused = false}
local path = ADFieldStorage.getPath()
if path == nil or not fileExists(path) then return result end
local xmlFile = XMLFile.load("ADSmartPickupFields", path)
@@ -111,6 +116,10 @@ function ADFieldStorage.load()
local id = xmlFile:getString(key .. "#id")
if id ~= nil and id ~= "" then result.fleet[id] = true end
end)
xmlFile:iterate(ADFieldStorage.ROOT .. ".excluded.vehicle", function(_, key)
local id = xmlFile:getString(key .. "#id")
if id ~= nil and id ~= "" then result.excluded[id] = true end
end)
xmlFile:iterate(ADFieldStorage.ROOT .. ".manual.vehicle", function(_, key)
local id = xmlFile:getString(key .. "#id")
if id ~= nil and id ~= "" then result.manual[id] = true end