feat(marker): redskaber over 50 m bruges, CP-kursus begrænses til 50 m (v1.61.5.0)
This commit is contained in:
@@ -380,13 +380,18 @@ ADFieldModel.MIN_WORK_WIDTH = 1.5
|
||||
-- roller uden eget kursus (følger høsteren / samler baller): ingen arbejdsbredde
|
||||
ADFieldModel.NO_WIDTH_ROLES = {unloader = true, baleCollector = true}
|
||||
|
||||
-- Bredden kurset laves med: højst CP's maksimum.
|
||||
function ADFieldModel.effectiveWidth(width)
|
||||
if width == nil then return nil end
|
||||
return math.min(width, ADFieldModel.CP_MAX_WIDTH)
|
||||
end
|
||||
|
||||
function ADFieldModel.checkWidth(role, width, requiredWidth)
|
||||
if width < ADFieldModel.MIN_WORK_WIDTH and not ADFieldModel.NO_WIDTH_ROLES[role] then
|
||||
return false, "widthUnknown", {width}
|
||||
end
|
||||
if width > ADFieldModel.CP_MAX_WIDTH + ADFieldModel.WIDTH_TOLERANCE then
|
||||
return false, "tooWide", {width, ADFieldModel.CP_MAX_WIDTH}
|
||||
end
|
||||
-- bredere end CP's 50 m (Unrealistic kan sættes til 120 m): bruges; kurset begrænses til 50 m (brugerønske 30/9)
|
||||
width = ADFieldModel.effectiveWidth(width)
|
||||
if role ~= "mower" and requiredWidth ~= nil and width + ADFieldModel.WIDTH_TOLERANCE < requiredWidth then
|
||||
return false, "tooNarrow", {width, requiredWidth}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user