def _get(self, key, typ, default): if typ in ("float", "mm"): return IniFile.get_float(self.name, key, default) elif typ == "int": return IniFile.get_int(self.name, key, default) elif typ == "bool": return IniFile.get_int(self.name, key, default) else: return IniFile.get_str(self.name, key, default)
def populate_tooltable(): """Popultae tooltable list for use with CAM Buttons It reuse the existing EndMill data saved in inifile""" n_tools = IniFile.get_int("EndMill", "n", 0) for idx in range(0, n_tools): t_index = IniFile.get_int("EndMill", "number.{}".format(idx), 0) t_dia = IniFile.get_float("EndMill", "diameter.{}".format(idx), 0) #print("Tool number: {} diameter: {}".format(t_index, t_dia)) OCV.tooltable.append((t_index, t_dia)) print(OCV.tooltable)
def __init__(self, master, app): CNCRibbon.ButtonGroup.__init__(self, master, "User", app) self.grid3rows() b_num = IniFile.get_int("Buttons", "n", 6) for idx in range(1, b_num): but = Utils.UserButton(self.frame, OCV.APP, idx, anchor=Tk.W, background=OCV.COLOR_BACKGROUND) col, row = divmod(idx - 1, 3) but.grid(row=row, column=col, sticky=Tk.NSEW) self.addWidget(but)
def load_sender_config(self): self.controllerSet(IniFile.get_str("Connection", "controller")) Pendant.port = IniFile.get_int("Connection", "pendantport", Pendant.port) GCode.LOOP_MERGE = IniFile.get_bool("File", "dxfloopmerge") IniFile.loadHistory()