def get_panel_ref2(self): ### click on get2 button on dialpad index=int(self.content.ids["cur_panel"].text) x,y,z = excellon.get_panel_reference_2(self.project_data['Panel'], index-1) if x==-1 and y==-1 and z==-1: x=self.project_data['Setup']['TravelX'] y=self.project_data['Setup']['TravelY'] z=self.project_data['Setup']['TravelZ'] self.content.ids["cur_X"].text = format(x,".2f") self.content.ids["cur_Y"].text = format(y,".2f") self.content.ids["cur_Z"].text = format(z,".2f") # go xyz printer gcode=robotcontrol.go_xyz(self.project_data,x,y,z) self.queue_printer_command(gcode)
def get_panel_ref2(self): ### click on get2 button on dialpad index = int(self.content.ids["cur_panel"].text) x, y = inspection.get_panel_reference_2(self.project_data["Panel"], index - 1) if x == -1 and y == -1: x = self.project_data["Setup"]["TravelX"] y = self.project_data["Setup"]["TravelY"] z = self.project_data["Setup"]["TravelZ"] self.content.ids["cur_X"].text = format(x, ".2f") self.content.ids["cur_Y"].text = format(y, ".2f") self.content.ids["cur_Z"].text = format(z, ".2f") # set body and mask ref = inspection.get_reference_2(self.project_data["InspectionPath"]) self.set_part_overlay(ref) self.capture_video_inspectionpart = ref # go xyz printer gcode = robotcontrol.go_xyz(self.project_data, x, y, z) self.queue_printer_command(gcode)
def control_XYZ(self, axis, value): ### click any button on dialpad, calculate new position index = int(self.content.ids["cur_panel"].text) x = float(self.content.ids["cur_X"].text) y = float(self.content.ids["cur_Y"].text) z = float(self.content.ids["cur_Z"].text) if axis == "X": x += float(value) elif axis == "Y": y += float(value) # TODO cleanup dialpad # elif axis == "Z": # z += float(value) elif axis == "HomeXY": x = self.project_data["Setup"]["TravelX"] y = self.project_data["Setup"]["TravelY"] elif axis == "HomeZ": z = self.project_data["Setup"]["TravelZ"] index = max(1, index) index = min(self.project_data["Setup"]["MaxPanel"], index) x = max(self.project_data["Setup"]["MinX"], x) x = min(self.project_data["Setup"]["MaxX"], x) y = max(self.project_data["Setup"]["MinY"], y) y = min(self.project_data["Setup"]["MaxY"], y) z = max(self.project_data["Setup"]["MinZ"], z) z = min(self.project_data["Setup"]["MaxZ"], z) self.content.ids["cur_panel"].text = str(index) self.content.ids["cur_X"].text = format(x, ".2f") self.content.ids["cur_Y"].text = format(y, ".2f") self.content.ids["cur_Z"].text = format(z, ".2f") # go xyz printer gcode = robotcontrol.go_xyz(self.project_data, x, y, z) self.queue_printer_command(gcode)
firstprofile = excellon.get_soldering_profile(solderingprofile, 0) if firstprofile == solderingprofile['SolderingProfile'][0]: print("ok sodering profile") else: print("nok soldering profile") # make array out of gcode garray = robotcontrol.make_array("1\n2\n3\n") if len(garray) == 3: print("ok gcode array") else: print("nok gcode array") # create g-code for home #go_xyz(prjdata, x,y,z) gcode = robotcontrol.go_xyz(prjdata, 1, 2, 3) if "G1 X1 Y2 Z3" in gcode: print("ok go xyz") else: print("nok goxyz", gcode) #go_home(prjdata) gcode = robotcontrol.go_home(prjdata) if "G28" in gcode and "G90" in gcode: print("ok home") else: print("nok home", gcode) gcode = robotcontrol.strip_comment("G28; this is a comment") if gcode == "G28": print("ok strip")