def save_pcb_in_panel(self, txt_port): # set array of panels excludepanels = txt_port.split(",") panel = [] for p in range(inspection.get_num_panel(self.project_data["Panel"])): if str(p + 1) in excludepanels: panel.append(p) self.paneldisselection = panel self.dismiss_popup()
def set_num_panel(self): num = inspection.get_num_panel(self.project_data["Panel"]) content = EditPopup(save=self.save_panel_num, cancel=self.dismiss_popup) content.ids["btn_connect"].text = "Save" content.ids["text_port"].text = str(num) self._popup = Popup(title="Select panel num", content=content, size_hint=(0.5, 0.4)) self._popup.open() self.project_data["CADMode"] = "None"
def start_inspection(self): ### toolbar start soldering button # prepare panel panel = [] for p in range(inspection.get_num_panel(self.project_data["Panel"])): if p not in self.paneldisselection: panel.append(p) # print # print("panel", panel) gcode = robotcontrol.panel_inspection(self.project_data, panel) self.queue_printer_command(gcode)
def set_panel_ref1(self): ### click set1 button on dialpad index = int(self.content.ids["cur_panel"].text) index = min(index, inspection.get_num_panel(self.project_data["Panel"])) index = max(index, 1) x = float(self.content.ids["cur_X"].text) y = float(self.content.ids["cur_Y"].text) z = float(self.content.ids["cur_Z"].text) inspection.set_panel_reference_1(self.project_data["Panel"], index - 1, x, y)
def select_pcb_in_panel(self): num = inspection.get_num_panel(self.project_data["Panel"]) content = EditPopup(save=self.save_pcb_in_panel, cancel=self.dismiss_popup) content.ids["btn_connect"].text = "Save" content.ids["text_port"].text = "" self._popup = Popup( title='Select Panels to exclude from Soldering example "1,2"', content=content, size_hint=(0.5, 0.4), ) self._popup.open() self.project_data["CADMode"] = "None"
# marker bounding box xb, yb, rotb, shapeb = inspection.get_bounding_box(partsdefinition, 0, "Body", 0, 0, 0, 0) xm, ym, rotm, shapem = inspection.get_bounding_box(partsdefinition, 0, "Mask", 0, 0, 0, 0) if [xb, yb, rotb] == [0.0, 1.1, 0.0] and [xm, ym, rotm] == [1.5, 0.0, 0.0]: print("ok body and mask") else: print("not body and mask", xb, yb, rotb, xm, ym, rotm) # panel panel = [] inspection.set_num_panel(panel, 5) num = inspection.get_num_panel(panel) if num == 5: print("ok num panel") else: print("nok num panel", num) # teachin coordinates ref1x = 51.8160 ref1y = 51.8160 inspection.set_panel_reference_1(panel, 0, ref1x + 10, ref1y + 10) x1, y1 = inspection.get_panel_reference_1(panel, 0) if x1 == ref1x + 10 and y1 == ref1y + 10: print("ok panel ref 1") else: print("nok panel ref 1", x1, y1, z1)