Hi,
I am trying to understand how the "visited" layers count number is calculated under "Model Info" section of "GCode Viewer" tab. I searched documentation and these forums, but was not able to find the description.
I usually upload gcode files (I don't use Cura plugin) and I see that "printed" value shows the actual number of layers that will be printed while "visited" layer number is always slightly higher. Here is an example:
Layer count: 33 printed, 37 visited
Just to make it clear - this is not causing any troubles; I am asking only because I am curious.
Thanks Gina! Naming-wise it makes perfect sense, but I cannot understand how Visited value is calculated.
I am attaching a sample gcode file (the smallest I have). It shows 3 printed layers and 7 visited. My understanding is that the value should be calculated based on the commands in gcode that contain Z. Attached file has 9 appearances of Z, 2 of which are comments. Here is the entire list of the commands with Z:
The 1st layer height is 0.3mm. Other two layers 0.2mm. If we take 0.3 as layer height and 5.7 as the highest point, Visited value should be 5.7 / 0.3 = 19. How are we getting 7 ?
It's not layer height, it's Z positions that are used here:
Z5 (no extrusion)
Z0 (no extrusion)
Z5 (no extrusion, shouldn't be counted again, apparently is, bug)
Z0.300 (extrusion)
Z0.500 (extrusion)
Z0.700 (extrusion)
Z5.700 (no extrusion)
Seems to get confused by the 5-0-5 switch up there though which makes it count Z5 twice. This aside, we have 3 z-heights on which extrusion happens ("printed") and 6 (7 due to the aforementioned hiccup) which are visited (print head is moved there, irrelevant whether extrusion happens or not). Hence 3 printed, 7 visited.
The GCODE viewer doesn't know your layer height. It can guess it (and it does), but it's irrelevant for the actual layers that are visited. Those are expressed in the Z coordinates actually contained in the GCODE and are the distinct values there (well, it tries to ignore z-hops).
I think I got it now. Visited shows the number of lines in gcode that contain Z. Comments with Z are not counted. I checked several other gcode files and tried to predict Visited number based on above assumption. Got it right every single time.
I agree with BerndJM - the label is misleading. I'd either move this value to a separate line, which could be called Stats (or Moves) and show total numbers of X, Y and Z moves, or would get rid of it completely.
Thank to you both! I will mark this topic as resolved.
Hi Gina,
I just watched your latest video blog where you mentioned this issue and saw couple of posts here complaining that the line is gone. I agree, removing entire line is probably not a good idea. It'd be nice to see the total number of layers (whatever was called "Printed"). I think you could remove "visited" portion of the string. In my opinion it does not add any value. Also, I'd change the label from "Printed" to "Total" or to "To be printed".
Hi, could I just add my voice to those asking for the total layer count being returned to the gcode viewer page please.
I never understood the 'visited' value or used it but I did find the total layer count extremely useful just so you could see how many layers were left to print. Even if the layer info section just reported:
I discovered even better existing solution. Plugin DisplayLayerProgress displays the current processing layer and the percentage on printer LCD and in top Navigation Bar. Here is the link: DisplayLayerProgress
The only issue I had with this plugin - I tried to hide "printer display on Desktop" box by deselecting corresponding checkbox in plugin settings, but it still did not go away. The only way to get rid of it is setting it's width to 0%.
I upgraded plugin, reset plugin configuration and switched off the "printer display on Desktop" option. The box did not go away until I restarted Octoprint. Not sure if this is "by-design" or not. The same happened when I tried to revert this setting.
From user's perspective the preferred behavior would be to switch all options on and off "on-the-fly". If this is not possible by some reason, would be nice to have notification message asking to restart Octoprint to activate the changes.