fix(gui): marktabellens status er kort (trin + kort årsag, fx 'Gødskning: bredde ukendt'); hele forklaringen står i markens detaljer; kortere hint (v1.30.2.0)

This commit is contained in:
2026-09-26 19:01:58 +02:00
parent 61e85e1402
commit 780b6a0daa
4 changed files with 48 additions and 5 deletions
+23 -2
View File
@@ -53,11 +53,32 @@ function SmartPickupFrame:soilText(info)
return table.concat(texts, ", ")
end
function SmartPickupFrame:fieldStatusText(field, info)
-- Kort årsag til tabellens statuskolonne ("bredde ukendt" i stedet for hele forklaringen, som står i
-- markens detaljer). Fritekst-årsager (fx "… er tom for X") forkortes til "se detaljer".
function SmartPickupFrame:fieldReasonShort(reason)
if type(reason) ~= "table" then return nil end
if reason.text ~= nil then return self.i18n:getText("spu_field_reasonShort_text") end
local shortKey = reason.key ~= nil and string.gsub(reason.key, "^spu_field_reason_", "spu_field_reasonShort_") or nil
if shortKey ~= nil then
local okHas, has = pcall(function() return self.i18n.hasText == nil or self.i18n:hasText(shortKey) end)
if okHas and has then return self.i18n:getText(shortKey) end
end
return self:fieldReasonText(reason)
end
-- short = tabellens korte udgave (trin + kort årsag); ellers hele teksten (markens detaljer).
function SmartPickupFrame:fieldStatusText(field, info, short)
local text = self.i18n:getText(ADFieldView.statusKey(field, info))
if info.markerId == nil then
return string.format(text, info.id)
end
if short then
if (field.stage == "idle" or field.stage == "ready") and info.kind ~= "bare" and info.readyRatio ~= nil then
text = string.format("%s %d %%", text, math.floor((info.readyRatio or 0) * 100 + 0.5))
end
local reason = self:fieldReasonShort(field.reason)
return reason ~= nil and (text .. ": " .. reason) or text
end
if (field.stage == "idle" or field.stage == "ready") and info.kind ~= "bare" and info.readyRatio ~= nil then
text = string.format("%s %d %%", text, math.floor((info.readyRatio or 0) * 100 + 0.5))
end
@@ -113,7 +134,7 @@ function SmartPickupFrame:fieldCells(row)
return {
name, crop, self:fieldPlanText(field, info),
self.i18n:getText(field.plan.mode == "auto" and "spu_field_mode_auto" or "spu_field_mode_manual"),
self:fieldStatusText(field, info),
self:fieldStatusText(field, info, true),
ADFlowView.joinCounted(names, ", ", "-"),
}
end
+12 -1
View File
@@ -51,6 +51,17 @@
<text name="spu_field_stage_collecting" text="Samles op"/>
<text name="spu_field_stage_done" text="Færdig"/>
<text name="spu_field_reason_noRig" text="ingen %s med flueben i markflåden"/>
<text name="spu_field_reasonShort_noRig" text="ingen maskine"/>
<text name="spu_field_reasonShort_allBusy" text="venter på maskine"/>
<text name="spu_field_reasonShort_tooWide" text="for bred"/>
<text name="spu_field_reasonShort_widthUnknown" text="bredde ukendt"/>
<text name="spu_field_reasonShort_tooNarrow" text="for smal"/>
<text name="spu_field_reasonShort_cannotDo" text="ingen kan"/>
<text name="spu_field_reasonShort_noSowFruit" text="vælg afgrøde"/>
<text name="spu_field_reasonShort_notEnough" text="for få ledige"/>
<text name="spu_field_reasonShort_notPlantable" text="ikke såtid nu"/>
<text name="spu_field_reasonShort_rain" text="venter på tørvejr"/>
<text name="spu_field_reasonShort_text" text="se detaljer"/>
<text name="spu_field_reason_allBusy" text="venter på ledig %s"/>
<text name="spu_field_reason_tooWide" text="%s for bred: %.1f m &gt; %.0f m (Courseplay)"/>
<text name="spu_field_reason_widthUnknown" text="%s: arbejdsbredde %.1f m kan ikke være rigtig — sæt bredden i Courseplay (sendes ikke ud)"/>
@@ -66,7 +77,7 @@
<text name="spu_field_mode_manual" text="Manuel"/>
<text name="spu_field_notMowable" text="ikke græs/kløver"/>
<text name="spu_field_scanning" text="Marker indlæses ... (én mark pr. sekund)"/>
<text name="spu_field_hint" text="Klik på en mark for at vælge den. Sæt flueben ved maskinerne i markflåden nederst."/>
<text name="spu_field_hint" text="Klik på en mark for detaljer, plan og faste maskiner."/>
<text name="spu_field_showAll" text="Vis alle marker (%d skjult)"/>
<text name="spu_col_field" text="Mark"/>
<text name="spu_col_crop" text="Afgrøde"/>
+12 -1
View File
@@ -51,6 +51,17 @@
<text name="spu_field_stage_collecting" text="Collecting"/>
<text name="spu_field_stage_done" text="Done"/>
<text name="spu_field_reason_noRig" text="no %s ticked in the field fleet"/>
<text name="spu_field_reasonShort_noRig" text="no machine"/>
<text name="spu_field_reasonShort_allBusy" text="waiting for machine"/>
<text name="spu_field_reasonShort_tooWide" text="too wide"/>
<text name="spu_field_reasonShort_widthUnknown" text="width unknown"/>
<text name="spu_field_reasonShort_tooNarrow" text="too narrow"/>
<text name="spu_field_reasonShort_cannotDo" text="none can do it"/>
<text name="spu_field_reasonShort_noSowFruit" text="choose crop"/>
<text name="spu_field_reasonShort_notEnough" text="too few free"/>
<text name="spu_field_reasonShort_notPlantable" text="not sowing time"/>
<text name="spu_field_reasonShort_rain" text="waiting for dry weather"/>
<text name="spu_field_reasonShort_text" text="see details"/>
<text name="spu_field_reason_allBusy" text="waiting for a free %s"/>
<text name="spu_field_reason_tooWide" text="%s too wide: %.1f m &gt; %.0f m (Courseplay)"/>
<text name="spu_field_reason_widthUnknown" text="%s: work width %.1f m cannot be right — set the width in Courseplay (not sent out)"/>
@@ -66,7 +77,7 @@
<text name="spu_field_mode_manual" text="Manual"/>
<text name="spu_field_notMowable" text="not grass/clover"/>
<text name="spu_field_scanning" text="Loading fields ... (one field per second)"/>
<text name="spu_field_hint" text="Click a field to select it. Tick the machines in the field fleet at the bottom."/>
<text name="spu_field_hint" text="Click a field for details, plan and dedicated machines."/>
<text name="spu_field_showAll" text="Show all fields (%d hidden)"/>
<text name="spu_col_field" text="Field"/>
<text name="spu_col_crop" text="Crop"/>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.30.1.0</version>
<version>1.30.2.0</version>
<title>
<en>AD Smart Pickup</en>
</title>