refactor(marker): review-fund — død kodegren i klik-routing, eksplicit kursus-kilde-opslag
This commit is contained in:
@@ -209,7 +209,8 @@ end
|
|||||||
local function sourceCourse(adEnv, field, source)
|
local function sourceCourse(adEnv, field, source)
|
||||||
local saved = coursesOf(field.id)[source]
|
local saved = coursesOf(field.id)[source]
|
||||||
if saved ~= nil then return saved end
|
if saved ~= nil then return saved end
|
||||||
local vehicleId = source == "rake" and field.rakeVehicleId or source == "harvester" and field.harvestVehicleId or field.mowVehicleId
|
local vehicleIds = {mower = field.mowVehicleId, rake = field.rakeVehicleId, harvester = field.harvestVehicleId}
|
||||||
|
local vehicleId = vehicleIds[source]
|
||||||
if vehicleId == nil then return nil end
|
if vehicleId == nil then return nil end
|
||||||
for _, vehicle in ipairs(ADRunsController.getFarmVehicles(adEnv)) do
|
for _, vehicle in ipairs(ADRunsController.getFarmVehicles(adEnv)) do
|
||||||
if ADRunsController.getVehicleId(vehicle) == vehicleId then return ADCpBridge.getCourse(vehicle) end
|
if ADRunsController.getVehicleId(vehicle) == vehicleId then return ADCpBridge.getCourse(vehicle) end
|
||||||
|
|||||||
@@ -389,8 +389,6 @@ function SmartPickupFrame:onClickFieldRow(state, data)
|
|||||||
return
|
return
|
||||||
elseif data.kind == "fieldTarget" then
|
elseif data.kind == "fieldTarget" then
|
||||||
ADFieldJobs.setTarget(id, data.values ~= nil and data.values[state] or "")
|
ADFieldJobs.setTarget(id, data.values ~= nil and data.values[state] or "")
|
||||||
elseif id == nil then
|
|
||||||
return
|
|
||||||
elseif SmartPickupFrame.PLAN_CHOICES[data.kind] ~= nil then
|
elseif SmartPickupFrame.PLAN_CHOICES[data.kind] ~= nil then
|
||||||
local value = data.values ~= nil and data.values[state] or nil
|
local value = data.values ~= nil and data.values[state] or nil
|
||||||
if value ~= nil then ADFieldJobs.setPlan(id, {[SmartPickupFrame.PLAN_CHOICES[data.kind]] = value}) end
|
if value ~= nil then ADFieldJobs.setPlan(id, {[SmartPickupFrame.PLAN_CHOICES[data.kind]] = value}) end
|
||||||
|
|||||||
Reference in New Issue
Block a user