feat(marker): fanen Marker for alle markarter — plan, maskiner pr. trin, aflæsningsvogne, efter høst, såning, pleje, jordtilstand, nye roller i markflåden
This commit is contained in:
+16
-10
@@ -17,20 +17,26 @@ local infos = {
|
||||
}
|
||||
local fields = {[109] = ADFieldModel.newField(109), [12] = ADFieldModel.newField(12)}
|
||||
|
||||
-- V1: kun slåafgrøder, sorteret efter nummer
|
||||
local rows = V.rows(infos, fields, false)
|
||||
check("V1 to rækker", #rows, 2)
|
||||
-- V1: alle marker (etape 2: også høst og bare), sorteret efter nummer
|
||||
local rows = V.rows(infos, fields)
|
||||
check("V1 tre rækker", #rows, 3)
|
||||
check("V1 sorteret", rows[1].info.id, 12)
|
||||
check("V1 model med", rows[2].field.id, 109)
|
||||
-- V2: vis alle tager resten med; mangler model -> ny standardmark
|
||||
local all = V.rows(infos, fields, true)
|
||||
check("V2 tre rækker", #all, 3)
|
||||
check("V2 standardmodel", all[2].field.stage, "idle")
|
||||
check("V2 skjulte", V.hiddenCount(infos, false), 1)
|
||||
check("V2 vis alle skjuler intet", V.hiddenCount(infos, true), 0)
|
||||
check("V1 model med", rows[3].field.id, 109)
|
||||
-- V2: mangler model -> ny standardmark
|
||||
check("V2 standardmodel", rows[2].field.stage, "idle")
|
||||
-- V3: status — manglende markør vinder over trin
|
||||
check("V3 mangler markør", V.statusKey(fields[12], infos[2]), "spu_field_noMarker")
|
||||
check("V3 trin", V.statusKey(fields[109], infos[1]), "spu_field_stage_idle")
|
||||
|
||||
-- V4: planens tekstnøgler pr. markart
|
||||
check("V4 ensilage", V.planKey({product = "auto"}, "mowable"), "spu_field_plan_silage")
|
||||
check("V4 hø", V.planKey({product = "hay"}, "mowable"), "spu_field_plan_hay")
|
||||
check("V4 høst", V.planKey({product = "auto"}, "harvest"), "spu_field_plan_harvest")
|
||||
check("V4 bar mark", V.planKey({product = "auto"}, "bare"), "spu_field_plan_prep")
|
||||
-- V5: jordtilstand som korte tekstdele
|
||||
local parts = V.soilParts({lime = 0.2, fert = 1, fertMax = 2, weed = 3, needs = {lime = true, plow = true}})
|
||||
check("V5 dele", table.concat(parts, ","), "lime,plow,fert,weed")
|
||||
check("V5 intet", #V.soilParts({lime = 2, fert = 2, fertMax = 2, weed = 0, needs = {}}), 0)
|
||||
|
||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||
os.exit(failures == 0 and 0 or 1)
|
||||
|
||||
Reference in New Issue
Block a user