Skip to content

Commit

Permalink
Fully rename test-combi to prodmon
Browse files Browse the repository at this point in the history
  • Loading branch information
narc0tiq committed May 23, 2018
1 parent bf59242 commit 2ba6eab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require("remote")
local events = {}

local function on_entity_built(e)
if e.created_entity.name == "test-combinator" then
if e.created_entity.name == "production-monitor" then
local success, name = combinators.add(e.created_entity)
log(string.format("Remembering combinator named %s", name))

Expand All @@ -22,7 +22,7 @@ events.on_robot_built_entity = on_entity_built

local function on_entity_remove(e)
log(string.format("Event %s", e.name))
if e.entity.name ~= "test-combinator" then return end
if e.entity.name ~= "production-monitor" then return end

local success, name = combinators.name_entity(e.entity)
log(string.format("Got the name \"%s\"", name))
Expand Down Expand Up @@ -79,9 +79,13 @@ local function update_signals(tick)
for title, entity in combinators.each() do
gui.remove_data_rows(title)

for _, s in merged_signals_from(entity, title) do
signals.add_sample(tick, s)
gui.set_data_row(s)
if not entity.valid then
combinators.remove_entity(entity)
else
for _, s in merged_signals_from(entity, title) do
signals.add_sample(tick, s)
gui.set_data_row(s)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion locale/en/locale.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ insufficient-data=Insufficient data...
rate-of-change-per-min=__1__/min

[entity-name]
test-combinator=Prodmon Test Combinator
production-monitor=Production monitor


[mod-setting-name]
Expand Down

0 comments on commit 2ba6eab

Please sign in to comment.