feat(lagre): faner pr. bygningstype (Fabrikker/Siloer/Stalde/Palleskure), kolonner tilpasset rækkebredden, statistik tæller kun kørende produktioner × tidsjustering (v1.16.0.0)
This commit is contained in:
@@ -632,10 +632,29 @@ local function addRate(rates, fillType, field, liters)
|
|||||||
rates[fillType][field] = rates[fillType][field] + liters
|
rates[fillType][field] = rates[fillType][field] + liters
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Statistik: kun produktioner der kører NU. "Ønsket" (tændt eller mangler input) bruges til reserve og
|
||||||
|
-- forsyning, men ville her tælle stillestående fabrikker med fuld hastighed — fx fermenteringssiloer
|
||||||
|
-- med 200.000 cyklusser i timen gav hundreder af millioner liter pr. døgn.
|
||||||
|
local function isProductionRunning(productionPoint, production)
|
||||||
|
local status = ProductionPoint ~= nil and ProductionPoint.PROD_STATUS ~= nil and ProductionPoint.PROD_STATUS.RUNNING or nil
|
||||||
|
if status ~= nil and production.status ~= nil then
|
||||||
|
return production.status == status
|
||||||
|
end
|
||||||
|
return isProductionWanted(productionPoint, production)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Spillets rater gælder pr. måned (én 24-timers dag pr. måned); faktisk pr. døgn = rate × timeAdjustment
|
||||||
|
-- (1 / dage pr. periode).
|
||||||
|
local function getTimeAdjustment()
|
||||||
|
local environment = g_currentMission ~= nil and g_currentMission.environment or nil
|
||||||
|
local value = environment ~= nil and tonumber(environment.timeAdjustment) or nil
|
||||||
|
return value ~= nil and value > 0 and value or 1
|
||||||
|
end
|
||||||
|
|
||||||
local function addFactoryRates(rates, placeable)
|
local function addFactoryRates(rates, placeable)
|
||||||
local productionPoint = getProductionPoint(placeable)
|
local productionPoint = getProductionPoint(placeable)
|
||||||
for _, production in ipairs(productionPoint ~= nil and productionPoint.productions or {}) do
|
for _, production in ipairs(productionPoint ~= nil and productionPoint.productions or {}) do
|
||||||
if isProductionWanted(productionPoint, production) then
|
if isProductionRunning(productionPoint, production) then
|
||||||
local perDay = (production.cyclesPerMinute or ((production.cyclesPerHour or 0) / 60)) * 1440
|
local perDay = (production.cyclesPerMinute or ((production.cyclesPerHour or 0) / 60)) * 1440
|
||||||
for _, input in ipairs(production.inputs or {}) do addRate(rates, input.type, "consumption", (input.amount or 0) * perDay) end
|
for _, input in ipairs(production.inputs or {}) do addRate(rates, input.type, "consumption", (input.amount or 0) * perDay) end
|
||||||
for _, output in ipairs(production.outputs or {}) do addRate(rates, output.type, "production", (output.amount or 0) * perDay) end
|
for _, output in ipairs(production.outputs or {}) do addRate(rates, output.type, "production", (output.amount or 0) * perDay) end
|
||||||
@@ -732,6 +751,10 @@ function ADSources.getFarmRates(adEnv, farmId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local adjustment = getTimeAdjustment()
|
||||||
|
for _, rate in pairs(rates) do
|
||||||
|
rate.consumption, rate.production = rate.consumption * adjustment, rate.production * adjustment
|
||||||
|
end
|
||||||
return rates
|
return rates
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -90,3 +90,12 @@ function ADStorageStats.rateText(consumption, production, format)
|
|||||||
if (production or 0) > 0 then table.insert(parts, "+" .. format(production)) end
|
if (production or 0) > 0 then table.insert(parts, "+" .. format(production)) end
|
||||||
return #parts > 0 and table.concat(parts, " ") or "-"
|
return #parts > 0 and table.concat(parts, " ") or "-"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Bygninger af én type (fanerne Fabrikker/Siloer/Stalde/Palleskure); rækkefølgen bevares.
|
||||||
|
function ADStorageStats.filterKind(inventory, kind)
|
||||||
|
local result = {}
|
||||||
|
for _, entry in ipairs(inventory or {}) do
|
||||||
|
if entry.kind == kind then table.insert(result, entry) end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|||||||
@@ -10,8 +10,14 @@ SmartPickupFrame.REFRESH_INTERVAL_MS = 1000
|
|||||||
SmartPickupFrame.STATUS_OVERRIDE_TICKS = 6
|
SmartPickupFrame.STATUS_OVERRIDE_TICKS = 6
|
||||||
SmartPickupFrame.LOG_PREFIX = "ADSmartPickup: "
|
SmartPickupFrame.LOG_PREFIX = "ADSmartPickup: "
|
||||||
SmartPickupFrame.STATE_OFF, SmartPickupFrame.STATE_ON = 1, 2
|
SmartPickupFrame.STATE_OFF, SmartPickupFrame.STATE_ON = 1, 2
|
||||||
SmartPickupFrame.TAB_FLOWS, SmartPickupFrame.TAB_STORAGE = 1, 2
|
SmartPickupFrame.TAB_FLOWS = 1
|
||||||
SmartPickupFrame.TAB_NAMES = {"spu_tab_flows", "spu_tab_storage"}
|
-- Lagerfaner: én pr. bygningstype (indeks -> kind i ADSources.getFarmInventory)
|
||||||
|
SmartPickupFrame.TAB_NAMES = {"spu_tab_flows", "spu_tab_factories", "spu_tab_silos", "spu_tab_barns", "spu_tab_sheds"}
|
||||||
|
SmartPickupFrame.TAB_KINDS = {[2] = "factory", [3] = "silo", [4] = "husbandry", [5] = "objectStorage"}
|
||||||
|
|
||||||
|
function SmartPickupFrame.getTabKind(tab)
|
||||||
|
return SmartPickupFrame.TAB_KINDS[tab]
|
||||||
|
end
|
||||||
SmartPickupFrame.POLICIES = {"off", "store", "sell", "sellElseStore"}
|
SmartPickupFrame.POLICIES = {"off", "store", "sell", "sellElseStore"}
|
||||||
-- Afvisningsgrunde der handler om VOGNEN (ikke run'ets opsætning): traktoren kan ikke vælges.
|
-- Afvisningsgrunde der handler om VOGNEN (ikke run'ets opsætning): traktoren kan ikke vælges.
|
||||||
SmartPickupFrame.VEHICLE_BLOCKING_REASONS = {noTrailer = true, cannotCarry = true, needsAutoload = true}
|
SmartPickupFrame.VEHICLE_BLOCKING_REASONS = {noTrailer = true, cannotCarry = true, needsAutoload = true}
|
||||||
@@ -349,7 +355,7 @@ function SmartPickupFrame:rebuild()
|
|||||||
self:clearRows()
|
self:clearRows()
|
||||||
local run = self:getRun()
|
local run = self:getRun()
|
||||||
self:setStaticRowsVisible(self.currentTab, run)
|
self:setStaticRowsVisible(self.currentTab, run)
|
||||||
if self.currentTab == SmartPickupFrame.TAB_STORAGE then
|
if SmartPickupFrame.getTabKind(self.currentTab) ~= nil then
|
||||||
if adEnv ~= nil then
|
if adEnv ~= nil then
|
||||||
self:fillStorageRows(adEnv)
|
self:fillStorageRows(adEnv)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -74,20 +74,19 @@
|
|||||||
</Bitmap>
|
</Bitmap>
|
||||||
<!-- Lagre: statistik-tabel (vare · i bygningen · værdi nu · ved toppris · gården · rækker til · forbrug/prod.) -->
|
<!-- Lagre: statistik-tabel (vare · i bygningen · værdi nu · ved toppris · gården · rækker til · forbrug/prod.) -->
|
||||||
<Bitmap profile="fs25_multiTextOptionContainer" id="statPrefab">
|
<Bitmap profile="fs25_multiTextOptionContainer" id="statPrefab">
|
||||||
<Text profile="spuCellBold" name="c1" position="25px 0px" size="220px 40px"/>
|
<Text profile="spuCellBold" name="c1" position="20px 0px" size="145px 40px"/>
|
||||||
<Text profile="spuCell" name="c2" position="245px 0px" size="190px 40px"/>
|
<Text profile="spuCell" name="c2" position="165px 0px" size="135px 40px"/>
|
||||||
<Text profile="spuCell" name="c3" position="435px 0px" size="140px 40px"/>
|
<Text profile="spuCell" name="c3" position="300px 0px" size="200px 40px"/>
|
||||||
<Text profile="spuCell" name="c4" position="575px 0px" size="140px 40px"/>
|
<Text profile="spuCell" name="c4" position="400px 0px" size="100px 40px"/>
|
||||||
<Text profile="spuCell" name="c5" position="715px 0px" size="110px 40px"/>
|
<Text profile="spuCell" name="c5" position="500px 0px" size="70px 40px"/>
|
||||||
<Text profile="spuCell" name="c6" position="825px 0px" size="110px 40px"/>
|
<Text profile="spuCell" name="c6" position="570px 0px" size="85px 40px"/>
|
||||||
<Text profile="spuCell" name="c7" position="935px 0px" size="170px 40px"/>
|
<Text profile="spuCell" name="c7" position="655px 0px" size="155px 40px"/>
|
||||||
</Bitmap>
|
</Bitmap>
|
||||||
<!-- Lagre: gårdens beholdning som gitter (bygning · 3 varer pr. række) -->
|
<!-- Lagre: gårdens beholdning som gitter (bygning · 2 varer pr. række). Rækken er ~815 px bred. -->
|
||||||
<Bitmap profile="fs25_multiTextOptionContainer" id="gridPrefab">
|
<Bitmap profile="fs25_multiTextOptionContainer" id="gridPrefab">
|
||||||
<Text profile="spuCellBold" name="c1" position="25px 0px" size="300px 40px"/>
|
<Text profile="spuCellBold" name="c1" position="20px 0px" size="270px 40px"/>
|
||||||
<Text profile="spuCell" name="c2" position="330px 0px" size="255px 40px"/>
|
<Text profile="spuCell" name="c2" position="290px 0px" size="260px 40px"/>
|
||||||
<Text profile="spuCell" name="c3" position="585px 0px" size="255px 40px"/>
|
<Text profile="spuCell" name="c3" position="550px 0px" size="260px 40px"/>
|
||||||
<Text profile="spuCell" name="c4" position="840px 0px" size="255px 40px"/>
|
|
||||||
</Bitmap>
|
</Bitmap>
|
||||||
<!-- udkørsel: én række pr. vare med politik Fra/Lager/Salg/Salg, ellers lager -->
|
<!-- udkørsel: én række pr. vare med politik Fra/Lager/Salg/Salg, ellers lager -->
|
||||||
<Bitmap profile="fs25_multiTextOptionContainer" id="productPrefab">
|
<Bitmap profile="fs25_multiTextOptionContainer" id="productPrefab">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
-- Kun bygninger med indhold vises; teksterne opdateres hvert sekund uden genopbygning.
|
-- Kun bygninger med indhold vises; teksterne opdateres hvert sekund uden genopbygning.
|
||||||
-- Funktionerne lægges på SmartPickupFrame (indlæses efter SmartPickupFrame.lua).
|
-- Funktionerne lægges på SmartPickupFrame (indlæses efter SmartPickupFrame.lua).
|
||||||
|
|
||||||
SmartPickupFrame.GRID_CELLS = 3
|
SmartPickupFrame.GRID_CELLS = 2
|
||||||
|
|
||||||
-- Én celle i gitteret: "*Ensilage 1.7M/20.0M" eller "Kurve 12 paller" (* = fabrikkens output).
|
-- Én celle i gitteret: "*Ensilage 1.7M/20.0M" eller "Kurve 12 paller" (* = fabrikkens output).
|
||||||
function SmartPickupFrame:describeInventoryItem(item)
|
function SmartPickupFrame:describeInventoryItem(item)
|
||||||
@@ -16,14 +16,13 @@ function SmartPickupFrame:describeInventoryItem(item)
|
|||||||
return string.format("%s%s %s", item.isOutput and "*" or "", tostring(item.title), amount)
|
return string.format("%s%s %s", item.isOutput and "*" or "", tostring(item.title), amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Gitterlinjer for en bygning: {{navn, celle, celle, celle}, {"", celle, ...}, ...}.
|
-- Gitterlinjer for en bygning: {{navn, celle, celle}, {"", celle, ...}, ...} (fanen giver typen).
|
||||||
function SmartPickupFrame:inventoryLines(entry)
|
function SmartPickupFrame:inventoryLines(entry)
|
||||||
local cells = {}
|
local cells = {}
|
||||||
for _, item in ipairs(entry.entries) do table.insert(cells, self:describeInventoryItem(item)) end
|
for _, item in ipairs(entry.entries) do table.insert(cells, self:describeInventoryItem(item)) end
|
||||||
local kindText = self.i18n:getText("spu_source_kind_" .. tostring(entry.kind))
|
|
||||||
local lines = {}
|
local lines = {}
|
||||||
for index, chunk in ipairs(ADStorageStats.chunk(cells, SmartPickupFrame.GRID_CELLS)) do
|
for index, chunk in ipairs(ADStorageStats.chunk(cells, SmartPickupFrame.GRID_CELLS)) do
|
||||||
local line = {index == 1 and string.format("%s (%s)", tostring(entry.name), kindText) or ""}
|
local line = {index == 1 and tostring(entry.name) or ""}
|
||||||
for cell = 1, SmartPickupFrame.GRID_CELLS do line[cell + 1] = chunk[cell] or "" end
|
for cell = 1, SmartPickupFrame.GRID_CELLS do line[cell + 1] = chunk[cell] or "" end
|
||||||
table.insert(lines, line)
|
table.insert(lines, line)
|
||||||
end
|
end
|
||||||
@@ -119,12 +118,13 @@ function SmartPickupFrame:storageLabels(inventory)
|
|||||||
return labels
|
return labels
|
||||||
end
|
end
|
||||||
|
|
||||||
function SmartPickupFrame:fillStorageDetail(adEnv, inventory)
|
function SmartPickupFrame:fillStorageDetail(adEnv, inventory, fullInventory)
|
||||||
self.storageDetailRows = {}
|
self.storageDetailRows = {}
|
||||||
if #inventory == 0 then
|
if #inventory == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.storageIndex = math.max(1, math.min(self.storageIndex or 1, #inventory))
|
self.storageIndexByTab = self.storageIndexByTab or {}
|
||||||
|
self.storageIndex = math.max(1, math.min(self.storageIndexByTab[self.currentTab] or 1, #inventory))
|
||||||
local row = self:addRow(self.productPrefab, {kind = "storageBuilding"})
|
local row = self:addRow(self.productPrefab, {kind = "storageBuilding"})
|
||||||
local option = row:getDescendantByName("option")
|
local option = row:getDescendantByName("option")
|
||||||
option:setTexts(self:storageLabels(inventory))
|
option:setTexts(self:storageLabels(inventory))
|
||||||
@@ -136,7 +136,7 @@ function SmartPickupFrame:fillStorageDetail(adEnv, inventory)
|
|||||||
local tooltipText = self.i18n:getText("spu_storage_select_tooltip")
|
local tooltipText = self.i18n:getText("spu_storage_select_tooltip")
|
||||||
if tooltip ~= nil then tooltip:setText(tooltipText) end
|
if tooltip ~= nil then tooltip:setText(tooltipText) end
|
||||||
option.toolTipText = tooltipText
|
option.toolTipText = tooltipText
|
||||||
local stats = self:computeBuildingStats(adEnv, entry, inventory)
|
local stats = self:computeBuildingStats(adEnv, entry, fullInventory)
|
||||||
self:addCellRow(self.statPrefab, self:statHeader())
|
self:addCellRow(self.statPrefab, self:statHeader())
|
||||||
for _, stat in ipairs(stats) do
|
for _, stat in ipairs(stats) do
|
||||||
table.insert(self.storageDetailRows, self:addCellRow(self.statPrefab, self:statCells(stat)))
|
table.insert(self.storageDetailRows, self:addCellRow(self.statPrefab, self:statCells(stat)))
|
||||||
@@ -144,7 +144,7 @@ function SmartPickupFrame:fillStorageDetail(adEnv, inventory)
|
|||||||
table.insert(self.storageDetailRows, self:addCellRow(self.statPrefab, self:statTotalCells(stats)))
|
table.insert(self.storageDetailRows, self:addCellRow(self.statPrefab, self:statTotalCells(stats)))
|
||||||
end
|
end
|
||||||
|
|
||||||
function SmartPickupFrame:refreshStorageDetail(adEnv, inventory)
|
function SmartPickupFrame:refreshStorageDetail(adEnv, inventory, fullInventory)
|
||||||
local entry = nil
|
local entry = nil
|
||||||
for _, candidate in ipairs(inventory) do
|
for _, candidate in ipairs(inventory) do
|
||||||
if candidate.placeable == self.storageDetailPlaceable then entry = candidate end
|
if candidate.placeable == self.storageDetailPlaceable then entry = candidate end
|
||||||
@@ -152,7 +152,7 @@ function SmartPickupFrame:refreshStorageDetail(adEnv, inventory)
|
|||||||
if entry == nil or #(self.storageDetailRows or {}) ~= #entry.entries + 1 then
|
if entry == nil or #(self.storageDetailRows or {}) ~= #entry.entries + 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local stats = self:computeBuildingStats(adEnv, entry, inventory)
|
local stats = self:computeBuildingStats(adEnv, entry, fullInventory)
|
||||||
for index, stat in ipairs(stats) do
|
for index, stat in ipairs(stats) do
|
||||||
SmartPickupFrame.setCells(self.storageDetailRows[index], self:statCells(stat))
|
SmartPickupFrame.setCells(self.storageDetailRows[index], self:statCells(stat))
|
||||||
end
|
end
|
||||||
@@ -160,15 +160,17 @@ function SmartPickupFrame:refreshStorageDetail(adEnv, inventory)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SmartPickupFrame:onClickStorageBuilding(state)
|
function SmartPickupFrame:onClickStorageBuilding(state)
|
||||||
self.storageIndex = state
|
self.storageIndexByTab = self.storageIndexByTab or {}
|
||||||
|
self.storageIndexByTab[self.currentTab] = state
|
||||||
self:requestRebuild()
|
self:requestRebuild()
|
||||||
end
|
end
|
||||||
|
|
||||||
function SmartPickupFrame:fillStorageRows(adEnv)
|
function SmartPickupFrame:fillStorageRows(adEnv)
|
||||||
self.storageRows = {}
|
self.storageRows = {}
|
||||||
local inventory = self:getInventory(adEnv)
|
local fullInventory = self:getInventory(adEnv)
|
||||||
self:fillStorageDetail(adEnv, inventory)
|
local inventory = ADStorageStats.filterKind(fullInventory, SmartPickupFrame.getTabKind(self.currentTab))
|
||||||
self:addTextRow(self.i18n:getText("spu_section_storage"))
|
self:fillStorageDetail(adEnv, inventory, fullInventory)
|
||||||
|
self:addTextRow(self.i18n:getText("spu_section_storage_" .. tostring(SmartPickupFrame.getTabKind(self.currentTab))))
|
||||||
for _, entry in ipairs(inventory) do
|
for _, entry in ipairs(inventory) do
|
||||||
local rows = {}
|
local rows = {}
|
||||||
for _, line in ipairs(self:inventoryLines(entry)) do
|
for _, line in ipairs(self:inventoryLines(entry)) do
|
||||||
@@ -182,15 +184,17 @@ function SmartPickupFrame:fillStorageRows(adEnv)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SmartPickupFrame:refreshStorageRows(adEnv)
|
function SmartPickupFrame:refreshStorageRows(adEnv)
|
||||||
if self.currentTab ~= SmartPickupFrame.TAB_STORAGE or #(self.storageRows or {}) == 0 then
|
local kind = SmartPickupFrame.getTabKind(self.currentTab)
|
||||||
|
if kind == nil or #(self.storageRows or {}) == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local inventory = self:getInventory(adEnv)
|
local fullInventory = self:getInventory(adEnv)
|
||||||
|
local inventory = ADStorageStats.filterKind(fullInventory, kind)
|
||||||
local byPlaceable = {}
|
local byPlaceable = {}
|
||||||
for _, entry in ipairs(inventory) do
|
for _, entry in ipairs(inventory) do
|
||||||
byPlaceable[entry.placeable] = entry
|
byPlaceable[entry.placeable] = entry
|
||||||
end
|
end
|
||||||
pcall(self.refreshStorageDetail, self, adEnv, inventory)
|
pcall(self.refreshStorageDetail, self, adEnv, inventory, fullInventory)
|
||||||
for _, row in ipairs(self.storageRows) do
|
for _, row in ipairs(self.storageRows) do
|
||||||
local entry = byPlaceable[row.placeable]
|
local entry = byPlaceable[row.placeable]
|
||||||
local lines = entry ~= nil and self:inventoryLines(entry) or nil
|
local lines = entry ~= nil and self:inventoryLines(entry) or nil
|
||||||
|
|||||||
@@ -134,6 +134,14 @@
|
|||||||
<text name="spu_stat_use" text="forbrug %s/døgn"/>
|
<text name="spu_stat_use" text="forbrug %s/døgn"/>
|
||||||
<text name="spu_stat_prod" text="prod. %s/døgn"/>
|
<text name="spu_stat_prod" text="prod. %s/døgn"/>
|
||||||
<text name="spu_stat_total" text="Bygningen i alt"/>
|
<text name="spu_stat_total" text="Bygningen i alt"/>
|
||||||
|
<text name="spu_tab_factories" text="Fabrikker"/>
|
||||||
|
<text name="spu_tab_silos" text="Siloer"/>
|
||||||
|
<text name="spu_tab_barns" text="Stalde"/>
|
||||||
|
<text name="spu_tab_sheds" text="Palleskure"/>
|
||||||
|
<text name="spu_section_storage_factory" text="— Alle fabrikker (* = fabrikkens output) —"/>
|
||||||
|
<text name="spu_section_storage_silo" text="— Alle siloer —"/>
|
||||||
|
<text name="spu_section_storage_husbandry" text="— Alle stalde —"/>
|
||||||
|
<text name="spu_section_storage_objectStorage" text="— Alle palleskure —"/>
|
||||||
<text name="spu_col_item" text="Vare"/>
|
<text name="spu_col_item" text="Vare"/>
|
||||||
<text name="spu_col_here" text="I bygningen"/>
|
<text name="spu_col_here" text="I bygningen"/>
|
||||||
<text name="spu_col_now" text="Værdi nu"/>
|
<text name="spu_col_now" text="Værdi nu"/>
|
||||||
|
|||||||
@@ -134,6 +134,14 @@
|
|||||||
<text name="spu_stat_use" text="use %s/day"/>
|
<text name="spu_stat_use" text="use %s/day"/>
|
||||||
<text name="spu_stat_prod" text="prod. %s/day"/>
|
<text name="spu_stat_prod" text="prod. %s/day"/>
|
||||||
<text name="spu_stat_total" text="Building total"/>
|
<text name="spu_stat_total" text="Building total"/>
|
||||||
|
<text name="spu_tab_factories" text="Factories"/>
|
||||||
|
<text name="spu_tab_silos" text="Silos"/>
|
||||||
|
<text name="spu_tab_barns" text="Barns"/>
|
||||||
|
<text name="spu_tab_sheds" text="Pallet sheds"/>
|
||||||
|
<text name="spu_section_storage_factory" text="— All factories (* = production output) —"/>
|
||||||
|
<text name="spu_section_storage_silo" text="— All silos —"/>
|
||||||
|
<text name="spu_section_storage_husbandry" text="— All barns —"/>
|
||||||
|
<text name="spu_section_storage_objectStorage" text="— All pallet sheds —"/>
|
||||||
<text name="spu_col_item" text="Item"/>
|
<text name="spu_col_item" text="Item"/>
|
||||||
<text name="spu_col_here" text="In building"/>
|
<text name="spu_col_here" text="In building"/>
|
||||||
<text name="spu_col_now" text="Value now"/>
|
<text name="spu_col_now" text="Value now"/>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<modDesc descVersion="107">
|
<modDesc descVersion="107">
|
||||||
<author>masterdraco</author>
|
<author>masterdraco</author>
|
||||||
<version>1.15.2.0</version>
|
<version>1.16.0.0</version>
|
||||||
<title>
|
<title>
|
||||||
<en>AD Smart Pickup</en>
|
<en>AD Smart Pickup</en>
|
||||||
</title>
|
</title>
|
||||||
|
|||||||
+16
-11
@@ -1,6 +1,6 @@
|
|||||||
# AD Smart Pickup — brugermanual
|
# AD Smart Pickup — brugermanual
|
||||||
|
|
||||||
Version 1.15.2 · Farming Simulator 25 · tillæg til AutoDrive
|
Version 1.16.0 · Farming Simulator 25 · tillæg til AutoDrive
|
||||||
|
|
||||||
*English version: [USER_MANUAL.md](USER_MANUAL.md)*
|
*English version: [USER_MANUAL.md](USER_MANUAL.md)*
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ Moden kan to ting:
|
|||||||
6. [Udkørsel: tøm, lagr og sælg](#6-udkørsel-tøm-lagr-og-sælg)
|
6. [Udkørsel: tøm, lagr og sælg](#6-udkørsel-tøm-lagr-og-sælg)
|
||||||
7. [Traktorer og vogne](#7-traktorer-og-vogne)
|
7. [Traktorer og vogne](#7-traktorer-og-vogne)
|
||||||
8. [Start, stop og gemning](#8-start-stop-og-gemning)
|
8. [Start, stop og gemning](#8-start-stop-og-gemning)
|
||||||
9. [Fanen Lagre: beholdning og statistik](#9-fanen-lagre-beholdning-og-statistik)
|
9. [Lagerfanerne: beholdning og statistik](#9-lagerfanerne-beholdning-og-statistik)
|
||||||
10. [Opskrifter](#10-opskrifter)
|
10. [Opskrifter](#10-opskrifter)
|
||||||
11. [Fejlfinding](#11-fejlfinding)
|
11. [Fejlfinding](#11-fejlfinding)
|
||||||
12. [Ordliste](#12-ordliste)
|
12. [Ordliste](#12-ordliste)
|
||||||
@@ -113,12 +113,15 @@ som er 25 m som standard. Står siloerne tættere, kan nabosiloen få læsset. S
|
|||||||
|
|
||||||
## 4. Menuen Smart Pickup
|
## 4. Menuen Smart Pickup
|
||||||
|
|
||||||
Tryk **ESC** og vælg fanen **Smart Pickup**. Fanen har to underfaner:
|
Tryk **ESC** og vælg fanen **Smart Pickup**. Fanen har fem underfaner:
|
||||||
|
|
||||||
| Fane | Indhold |
|
| Fane | Indhold |
|
||||||
|---|---|
|
|---|---|
|
||||||
| **Flows** | Tavlen med alle flows, redigering af det valgte flow og Wait-puljerne |
|
| **Flows** | Tavlen med alle flows, redigering af det valgte flow og Wait-puljerne |
|
||||||
| **Lagre** | Gårdens beholdning pr. bygning med værdi og statistik |
|
| **Fabrikker** | Beholdning og statistik for gårdens fabrikker |
|
||||||
|
| **Siloer** | Beholdning og statistik for gårdens siloer |
|
||||||
|
| **Stalde** | Beholdning og statistik for gårdens stalde |
|
||||||
|
| **Palleskure** | Beholdning og statistik for gårdens objektlagre |
|
||||||
|
|
||||||
### Flow-tavlen
|
### Flow-tavlen
|
||||||
|
|
||||||
@@ -393,9 +396,10 @@ Flows fra ældre versioner indlæses automatisk. Gamle markørvalg oversættes t
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 9. Fanen Lagre: beholdning og statistik
|
## 9. Lagerfanerne: beholdning og statistik
|
||||||
|
|
||||||
Fanen **Lagre** viser gårdens beholdning og statistik pr. bygning. Tallene opdateres hvert sekund.
|
Fanerne **Fabrikker**, **Siloer**, **Stalde** og **Palleskure** viser hver én bygningstype. De er
|
||||||
|
bygget ens. Tallene opdateres hvert sekund, og hver fane husker, hvilken bygning du sidst valgte.
|
||||||
|
|
||||||
### Statistik for en bygning
|
### Statistik for en bygning
|
||||||
|
|
||||||
@@ -413,21 +417,22 @@ kolonneoverskrifter øverst:
|
|||||||
| **I bygningen** | Mængde og kapacitet i den valgte bygning samt fyldningsgrad |
|
| **I bygningen** | Mængde og kapacitet i den valgte bygning samt fyldningsgrad |
|
||||||
| **Værdi nu** | Værdien ved den bedste pris lige nu, blandt alle salgssteder på kortet |
|
| **Værdi nu** | Værdien ved den bedste pris lige nu, blandt alle salgssteder på kortet |
|
||||||
| **Ved toppris** | Værdien, hvis du sælger ved årets højeste pris |
|
| **Ved toppris** | Værdien, hvis du sælger ved årets højeste pris |
|
||||||
| **Gården** | Gårdens samlede beholdning af varen i alle bygninger |
|
| **Gården** | Gårdens samlede beholdning af varen i alle bygninger, også dem på de andre faner |
|
||||||
| **Rækker til** | Hvor mange døgn gårdens beholdning holder ved det nuværende forbrug |
|
| **Rækker til** | Hvor mange døgn gårdens beholdning holder ved det nuværende forbrug |
|
||||||
| **Forbrug/prod. døgn** | Forbrug pr. døgn med minus og produktion pr. døgn med plus |
|
| **Forbrug/prod. døgn** | Forbrug pr. døgn med minus og produktion pr. døgn med plus |
|
||||||
|
|
||||||
Nederst står **Bygningen i alt** med bygningens samlede værdi nu og ved toppris.
|
Nederst står **Bygningen i alt** med bygningens samlede værdi nu og ved toppris.
|
||||||
|
|
||||||
### Gårdens beholdning
|
### Oversigt over fanens bygninger
|
||||||
|
|
||||||
Under statistikken står alle bygninger med indhold som et gitter. Bygningens navn står til venstre,
|
Under statistikken står fanens bygninger med indhold som et gitter. Bygningens navn står til venstre,
|
||||||
og varerne står med op til tre pr. række. Fabrikkens outputs er markeret med `*`, og palleskure
|
og varerne står med op til to pr. række. Fabrikkens outputs er markeret med `*`, og palleskure
|
||||||
viser antal paller.
|
viser antal paller.
|
||||||
|
|
||||||
**Hvad tælles med**
|
**Hvad tælles med**
|
||||||
|
|
||||||
- **Fabrikker:** ønskede produktioners forbrug og produktion.
|
- **Fabrikker:** forbrug og produktion for de produktioner, der kører lige nu. Fabrikker, der står
|
||||||
|
stille eller mangler input, tæller ikke med.
|
||||||
- **Stalde, forbrug:** foder, halm og vand. Vand tælles ikke, når stalden har automatisk vand.
|
- **Stalde, forbrug:** foder, halm og vand. Vand tælles ikke, når stalden har automatisk vand.
|
||||||
Foderforbruget fordeles på de fodertyper, der ligger i truget.
|
Foderforbruget fordeles på de fodertyper, der ligger i truget.
|
||||||
- **Stalde, produktion:** hvert dyrs produktion efter alder gange antal dyr. Det dækker mælk,
|
- **Stalde, produktion:** hvert dyrs produktion efter alder gange antal dyr. Det dækker mælk,
|
||||||
|
|||||||
+16
-12
@@ -1,6 +1,6 @@
|
|||||||
# AD Smart Pickup — user manual
|
# AD Smart Pickup — user manual
|
||||||
|
|
||||||
Version 1.15.2 · Farming Simulator 25 · add-on for AutoDrive
|
Version 1.16.0 · Farming Simulator 25 · add-on for AutoDrive
|
||||||
|
|
||||||
*Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*
|
*Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ The mod does two things:
|
|||||||
6. [Delivery: empty, store and sell](#6-delivery-empty-store-and-sell)
|
6. [Delivery: empty, store and sell](#6-delivery-empty-store-and-sell)
|
||||||
7. [Tractors and trailers](#7-tractors-and-trailers)
|
7. [Tractors and trailers](#7-tractors-and-trailers)
|
||||||
8. [Start, stop and saving](#8-start-stop-and-saving)
|
8. [Start, stop and saving](#8-start-stop-and-saving)
|
||||||
9. [The Storage tab: inventory and statistics](#9-the-storage-tab-inventory-and-statistics)
|
9. [The storage tabs: inventory and statistics](#9-the-storage-tabs-inventory-and-statistics)
|
||||||
10. [Recipes](#10-recipes)
|
10. [Recipes](#10-recipes)
|
||||||
11. [Troubleshooting](#11-troubleshooting)
|
11. [Troubleshooting](#11-troubleshooting)
|
||||||
12. [Glossary](#12-glossary)
|
12. [Glossary](#12-glossary)
|
||||||
@@ -115,12 +115,15 @@ storage target with a neighbouring trigger.
|
|||||||
|
|
||||||
## 4. The Smart Pickup menu
|
## 4. The Smart Pickup menu
|
||||||
|
|
||||||
Press **ESC** and open the **Smart Pickup** tab. It has two sub-tabs:
|
Press **ESC** and open the **Smart Pickup** tab. It has five sub-tabs:
|
||||||
|
|
||||||
| Tab | Contents |
|
| Tab | Contents |
|
||||||
|---|---|
|
|---|---|
|
||||||
| **Flows** | The board with all flows, editing of the selected flow and the Wait pools |
|
| **Flows** | The board with all flows, editing of the selected flow and the Wait pools |
|
||||||
| **Storage** | The farm's inventory per building with value and statistics |
|
| **Factories** | Inventory and statistics for the farm's factories |
|
||||||
|
| **Silos** | Inventory and statistics for the farm's silos |
|
||||||
|
| **Barns** | Inventory and statistics for the farm's barns |
|
||||||
|
| **Pallet sheds** | Inventory and statistics for the farm's object storages |
|
||||||
|
|
||||||
### The flow board
|
### The flow board
|
||||||
|
|
||||||
@@ -397,10 +400,10 @@ Flows from older versions load automatically. Old marker choices are translated
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 9. The Storage tab: inventory and statistics
|
## 9. The storage tabs: inventory and statistics
|
||||||
|
|
||||||
The **Storage** tab shows the farm's inventory and statistics per building. Figures update every
|
The **Factories**, **Silos**, **Barns** and **Pallet sheds** tabs each show one type of building.
|
||||||
second.
|
They work the same way. Figures update every second, and each tab remembers the building you picked last.
|
||||||
|
|
||||||
### Statistics for a building
|
### Statistics for a building
|
||||||
|
|
||||||
@@ -418,21 +421,22 @@ one row per good:
|
|||||||
| **In building** | Amount and capacity in the selected building, plus fill level |
|
| **In building** | Amount and capacity in the selected building, plus fill level |
|
||||||
| **Value now** | The value at the best price right now, across all selling points on the map |
|
| **Value now** | The value at the best price right now, across all selling points on the map |
|
||||||
| **At top price** | The value if you sell at the year's highest price |
|
| **At top price** | The value if you sell at the year's highest price |
|
||||||
| **Farm** | The farm's total amount of the good across all buildings |
|
| **Farm** | The farm's total amount of the good across all buildings, including those on the other tabs |
|
||||||
| **Lasts** | How many days the farm's stock lasts at the current use |
|
| **Lasts** | How many days the farm's stock lasts at the current use |
|
||||||
| **Use/prod. per day** | Daily use with a minus sign and daily production with a plus sign |
|
| **Use/prod. per day** | Daily use with a minus sign and daily production with a plus sign |
|
||||||
|
|
||||||
At the bottom, **Building total** shows the building's total value now and at top price.
|
At the bottom, **Building total** shows the building's total value now and at top price.
|
||||||
|
|
||||||
### Farm inventory
|
### Overview of the tab's buildings
|
||||||
|
|
||||||
Below the statistics, all buildings with contents are shown as a grid. The building name is on the
|
Below the statistics, the tab's buildings with contents are shown as a grid. The building name is on
|
||||||
left, with up to three goods per row. Factory outputs are marked with `*`, and pallet sheds show the
|
the left, with up to two goods per row. Factory outputs are marked with `*`, and pallet sheds show the
|
||||||
number of pallets.
|
number of pallets.
|
||||||
|
|
||||||
**What is counted**
|
**What is counted**
|
||||||
|
|
||||||
- **Factories:** use and production of the wanted productions.
|
- **Factories:** use and production of the productions that are running right now. Factories that
|
||||||
|
are idle or missing inputs are not counted.
|
||||||
- **Barns, use:** feed, straw and water. Water is not counted when the barn has automatic water.
|
- **Barns, use:** feed, straw and water. Water is not counted when the barn has automatic water.
|
||||||
Feed use is split across the feed types in the trough.
|
Feed use is split across the feed types in the trough.
|
||||||
- **Barns, production:** each animal's output by age times the number of animals. This covers milk,
|
- **Barns, production:** each animal's output by age times the number of animals. This covers milk,
|
||||||
|
|||||||
@@ -443,5 +443,19 @@ check("S19b æg 100 høns × 30", rates3[EGG] and rates3[EGG].production, 3000)
|
|||||||
check("S19b gødning via navn", rates3[MANURE_FT] and rates3[MANURE_FT].production, 1000)
|
check("S19b gødning via navn", rates3[MANURE_FT] and rates3[MANURE_FT].production, 1000)
|
||||||
check("S19b mælk uændret", rates3[MILK].production, 3600)
|
check("S19b mælk uændret", rates3[MILK].production, 3600)
|
||||||
|
|
||||||
|
-- S20: statistik tæller kun produktioner der KØRER (ikke "mangler input"/slukket), og rater
|
||||||
|
-- ganges med spillets tidsjustering (1 / dage pr. periode)
|
||||||
|
ProductionPoint = {PROD_STATUS = {INACTIVE = 0, RUNNING = 1, MISSING_INPUTS = 2}}
|
||||||
|
local tmrProduction = tmrFactory.spec_productionPoint.productionPoint.productions[1]
|
||||||
|
tmrProduction.status = ProductionPoint.PROD_STATUS.MISSING_INPUTS
|
||||||
|
local idle = ADSources.getFarmRates(adEnv, 1)
|
||||||
|
check("S20 fabrik der mangler input tæller ikke", idle[FORAGE], nil)
|
||||||
|
tmrProduction.status = ProductionPoint.PROD_STATUS.RUNNING
|
||||||
|
g_currentMission.environment = {timeAdjustment = 0.5}
|
||||||
|
local running = ADSources.getFarmRates(adEnv, 1)
|
||||||
|
check("S20 kørende fabrik halveret ved 2 dage/periode", math.floor(running[FORAGE].production + 0.5), 576000)
|
||||||
|
check("S20 stald halveret", running[STRAW].consumption, 6000)
|
||||||
|
g_currentMission.environment, ProductionPoint = nil, nil
|
||||||
|
|
||||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||||
os.exit(failures == 0 and 0 or 1)
|
os.exit(failures == 0 and 0 or 1)
|
||||||
|
|||||||
@@ -56,5 +56,12 @@ check("ST7 kun prod", S.rateText(0, 3600, fmt), "+3.6k")
|
|||||||
check("ST7 kun forbrug", S.rateText(2000, 0, fmt), "-2.0k")
|
check("ST7 kun forbrug", S.rateText(2000, 0, fmt), "-2.0k")
|
||||||
check("ST7 intet", S.rateText(0, 0, fmt), "-")
|
check("ST7 intet", S.rateText(0, 0, fmt), "-")
|
||||||
|
|
||||||
|
-- ST8: fane pr. bygningstype — filtrér inventar på kind, rækkefølgen bevares
|
||||||
|
local inv = {{kind = "silo", name = "A"}, {kind = "factory", name = "B"}, {kind = "silo", name = "C"}}
|
||||||
|
local silos = S.filterKind(inv, "silo")
|
||||||
|
check("ST8 to siloer", #silos, 2)
|
||||||
|
check("ST8 rækkefølge", silos[2].name, "C")
|
||||||
|
check("ST8 ingen stalde", #S.filterKind(inv, "husbandry"), 0)
|
||||||
|
|
||||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||||
os.exit(failures == 0 and 0 or 1)
|
os.exit(failures == 0 and 0 or 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user