Sorry for cryptic message - I am away from home for work.
I did not know that QtPlasmac was patched to show a grid in P view - those plasma guys are very crafty!
I also didn't realize QtDragon had no builtin way to show grids
(I assume your gcode graphics widget is called gcodegraphics in designer)
To get XYZ grids to show you must set a grid size:
self.w.gcodegraphics.grid_size = 1
setting the grid color is possible (Red,green,blue):
self.w.gcodegraphics.colors = (1.0, 1.0, 1.0)
add those to bottom of init_widgets() function.
to get grid in perspective too require patching.
Code:
def new_draw_grid(self):
if self.w.gcodegraphics.get_view() == 3:
rotation = math.radians(STATUS.stat.rotation_xy % 90)
# permutation = lambda x_y_z2: (x_y_z2[0], x_y_z2[1], x_y_z2[2]) # XY Z
def permutation(x_y_z2):
return x_y_z2[0], x_y_z2[1], x_y_z2[2] # XY Z
# inverse_permutation = lambda x_y_z3: (x_y_z3[0], x_y_z3[1], x_y_z3[2]) # XY Z
def inverse_permutation(x_y_z3):
return x_y_z3[0], x_y_z3[1], x_y_z3[2] # XY Z
self.w.gcodegraphics.draw_grid_permuted(rotation, permutation, inverse_permutation)
else:
self.old_draw_grid()
add to bottom of init_widgets() function:
Code:
# patched gcodegraphics functions
self.old_draw_grid = self.w.gcodegraphics.draw_grid
self.w.gcodegraphics.draw_grid = self.new_draw_grid
I think I should modify the underlaying code so the patching is not necessary - on the todo list.