fix: markflåden 'brug alle' kan udelukke enkelte maskiner med fluebenet (v1.62.32)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user