Graph Logs


Adds a sensor for recording and displaying signals data.

Content
23 days ago
2.0
261
Circuit network

g Bug: virtual signals are not supported

23 days ago
(updated 23 days ago)

I have tried this mod with all categories present in the base game and in Space Age. Trying to log a virtual signal causes this crash:

Error while running event timeseries_fixfor110::on_gui_opened (ID 100)
Unknown sprite "virtual/signal-0"
stack traceback:
[C]: in function 'add'
timeseries_fixfor110/control.lua:235: in function 'render_interval'
timeseries_fixfor110/control.lua:651: in function <timeseries_fixfor110/control.lua:570>

I have a fix for it though. I hope you'll publish it soon as a mod that I am currently working on will very likely need your mod as a dependency. If you won't publish it yourself - I'll publish a temporary fix myself and will be happy to remove (deprecate) my fix as soon as you update your mod. Many thanks for your work!

Here is the complete fix (could have been a one-liner, but it doesn't look overly great as a single line):

diff --git a/control.lua b/control.lua
index 694a642..f20708b 100644
--- a/control.lua
+++ b/control.lua
@@ -230,7 +230,9 @@ local function render_interval (interval, force_render)
                     format_number_suffix (signal_min), format_number_suffix (signal_max), 
                     format_number_suffix (summary.min), format_number_suffix (summary.max))

-                table.add ({ type = "sprite", name = "sprite" .. i, sprite = signal_name, tooltip = tooltip })
+                local sprite_name = signal_name
+                sprite_name = sprite_name:gsub("virtual/", "virtual-signal/")
+                table.add ({ type = "sprite", name = "sprite" .. i, sprite = sprite_name, tooltip = tooltip })
                 local bar = table.add ({ type = "progressbar", name = "bar" .. i, value = ratio, tooltip = tooltip })
                 bar.style.color = signal_colors[signal_name]
                 bar.style.natural_width = 150
23 days ago
(updated 23 days ago)

Hi, is this really the only change needed? For showing the correct sprite?
I haven't touched Factorio since the release of this mod, so I'm considering how reliable is that solution.

P.S. Well it seems that there is an issue, I jumped from 2.0.33 to 2.0.66 (latest) version and it seems the plotted lines are dark, one needs night vision to see them as before. Something has changed.

23 days ago

For me this change was enough. I just tested it again, after your request. Applying these 3 lines are enough to get rid of the crash. I do not know if this fix is also required in a different place - but your mod has the table.add only around these lines. Here is how it looks afterwards: ... Ah, apparently the mod portal doesn't allow posting images. Well, then, you'll have to take my word for it or try it yourself.

BTW, I'm on the 2.0.66 and I do not observe the behaviour you describe. For me the lines are OK.

23 days ago

Okay, I have added a new version with your fix. Crossing fingers here, you can check it out.
I added and something to fix the daylight dependent brightness of the plot lines. It won't fix old installations though - I had to add some logic for on updating, but frankly this took enough time already for now.

New response