Object reference in variable
-
Hi All,
I am not sure whether this has been asked or not, but I couldn't seem to find anything nor could I manage to make it work. I wanted to pre-"extract" the part of the object model, namely a heater and an extruder associated with a given tool, to later do some queries on it with less clutter.
var tool = 0 ;--- FIXME! - these assume one heater and one extruder per tool var toolExtruder = move.extruders[tools[var.tool].extruders[0]] var toolHeater = heat.heaters[tools[var.tool].heaters[0]] ;--- These are not working: echo var.toolHeater.current echo var.toolExtruder.position
If I enter
global toolExtruder = move.extruders[tools[0].extruders[0]]
in the console, then I enterecho global.toolExtruder
then it shows that this is an{object}
. So I assume that the variable assignment has worked. I feel that it should work somehow, but I failed to figure out how to reference its members. Tried with using all kinds of parenthesis, without any luck.Is this possible with some syntax?
-
@Mogatek I confirm that this is not possible at present. Please raise an issue at https://github.com/Duet3D/RepRapFirmware/issues.