feat: kæden planlægger hø og ensilage — græs med produkt, mangel/afvisning pr. vare (v1.62.29)
This commit is contained in:
@@ -57,12 +57,13 @@ function ADChainRun.switchFields(data, actions)
|
||||
local field = fieldById(data.fields, action.fieldId)
|
||||
-- brugerens egen målafgrøde røres aldrig (dobbelttjek oven i ADCropPlan)
|
||||
if action.mode == "auto" and field ~= nil and field.targetSource ~= "user" then
|
||||
local ok, err = pcall(ADFieldJobs.setTarget, action.fieldId, action.to, "chain")
|
||||
local ok, err = pcall(ADFieldJobs.setTarget, action.fieldId, action.to, "chain", action.product)
|
||||
if ok then
|
||||
switched = switched + 1
|
||||
ADChain.switchCount = ADChain.switchCount + 1
|
||||
local text = string.format("F%s: %s -> %s (%.1f ha) til %s", tostring(action.fieldId), tostring(action.from),
|
||||
tostring(action.to), action.hectares or 0, tostring(action.reason))
|
||||
local text = string.format("F%s: %s -> %s%s (%.1f ha) til %s", tostring(action.fieldId), tostring(action.from),
|
||||
tostring(action.to), action.product ~= nil and (" (" .. tostring(action.product) .. ")") or "", action.hectares or 0,
|
||||
tostring(action.reason))
|
||||
log("%s", text)
|
||||
pcall(ADFieldJobs.notify, text, false)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user