diff --git a/cirkuix.py b/cirkuix.py index 62bac4a9..c6914116 100644 --- a/cirkuix.py +++ b/cirkuix.py @@ -9,6 +9,7 @@ from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCan #from matplotlib.backends.backend_cairo import FigureCanvasCairo as FigureCanvas from camlib import * +import sys ######################################## @@ -189,7 +190,7 @@ class CirkuixGerber(CirkuixObj, Gerber): "mergepolys": True, "multicolored": False, "solid": False, - "isotooldia": 0.4/25.4, + "isotooldia": 0.4 / 25.4, "cutoutmargin": 0.2, "cutoutgapsize": 0.15, "gaps": "tb", @@ -320,7 +321,7 @@ class CirkuixExcellon(CirkuixObj, Excellon): box.set_orientation(Gtk.Orientation(1)) win.add(box) for tool in self.tools: - self.tool_cbs[tool] = Gtk.CheckButton(label=tool+": "+self.tools[tool]) + self.tool_cbs[tool] = Gtk.CheckButton(label=tool + ": " + self.tools[tool]) box.pack_start(self.tool_cbs[tool], False, False, 1) button = Gtk.Button(label="Accept") box.pack_start(button, False, False, 1) @@ -338,15 +339,16 @@ class CirkuixExcellon(CirkuixObj, Excellon): button.connect("activate", on_accept) button.connect("clicked", on_accept) - # def parse_lines(self, elines): - # Excellon.parse_lines(self, elines) - # self.options["units"] = self.units + # def parse_lines(self, elines): + # Excellon.parse_lines(self, elines) + # self.options["units"] = self.units class CirkuixCNCjob(CirkuixObj, CNCjob): """ Represents G-Code. """ + def __init__(self, name, units="in", kind="generic", z_move=0.1, feedrate=3.0, z_cut=-0.002, tooldia=0.0): CNCjob.__init__(self, units=units, kind=kind, z_move=z_move, @@ -359,7 +361,7 @@ class CirkuixCNCjob(CirkuixObj, CNCjob): "plot": True, "solid": False, "multicolored": False, - "tooldia": 0.4/25.4 # 0.4mm in inches + "tooldia": 0.4 / 25.4 # 0.4mm in inches }) self.form_kinds.update({ @@ -396,7 +398,7 @@ class CirkuixGeometry(CirkuixObj, Geometry): "cutz": -0.002, "travelz": 0.1, "feedrate": 5.0, - "cnctooldia": 0.4/25.4, + "cnctooldia": 0.4 / 25.4, "painttooldia": 0.0625, "paintoverlap": 0.15, "paintmargin": 0.01 @@ -415,9 +417,6 @@ class CirkuixGeometry(CirkuixObj, Geometry): "paintmargin": "entry_eval" }) - # def convert_units(self, units): - # factor = Geometry.convert_units(self, units) - def scale(self, factor): if type(self.solid_geometry) == list: self.solid_geometry = [affinity.scale(g, factor, factor, origin=(0, 0)) @@ -488,6 +487,7 @@ class App: def __init__(self): """ Starts the application and the Gtk.main(). + @return: app @rtype: App """ @@ -509,42 +509,76 @@ class App: self.progress_bar.set_show_text(True) self.units_label = self.builder.get_object("label_units") + # White (transparent) background on the "Options" tab. + self.builder.get_object("vp_options").override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(1, 1, 1, 1)) + + # Combo box to choose between project and application options. + self.combo_options = self.builder.get_object("combo_options") + self.combo_options.set_active(1) + ## Event handling ## self.builder.connect_signals(self) - + ## Make plot area ## self.figure = None self.axes = None self.canvas = None self.setup_plot() - - self.setup_component_viewer() + + self.setup_project_list() self.setup_component_editor() - + ## DATA ## self.setup_obj_classes() self.stuff = {} # CirkuixObj's by name self.mouse = None # Mouse coordinates over plot - + # What is selected by the user. It is # a key if self.stuff self.selected_item_name = None + # Used to inhibit the on_options_update callback when + # the options are being changed by the program and not the user. + self.options_update_ignore = False + self.defaults = { "units": "in" } # Application defaults self.options = {} # Project options + self.form_kinds = { + "units": "radio" + } + + self.radios = {"units": {"rb_inch": "IN", "rb_mm": "MM"}, + "gerber_gaps": {"rb_app_2tb": "tb", "rb_app_2lr": "lr", "rb_app_4": "4"}} + self.radios_inv = {"units": {"IN": "rb_inch", "MM": "rb_mm"}, + "gerber_gaps": {"tb": "rb_app_2tb", "lr": "rb_app_2lr", "4": "rb_app_4"}} + + # self.combos = [] + + # Options for each kind of CirkuixObj. + # Example: 'gerber_plot': 'cb'. The widget name would be: 'cb_app_gerber_plot' + for CirkuixClass in [CirkuixExcellon, CirkuixGeometry, CirkuixGerber, CirkuixCNCjob]: + obj = CirkuixClass("no_name") + for option in obj.form_kinds: + self.form_kinds[obj.kind + "_" + option] = obj.form_kinds[option] + # if obj.form_kinds[option] == "radio": + # self.radios.update({obj.kind + "_" + option: obj.radios[option]}) + # self.radios_inv.update({obj.kind + "_" + option: obj.radios_inv[option]}) + self.plot_click_subscribers = {} # Initialization self.load_defaults() - self.options.update(self.defaults) + self.options.update(self.defaults) # Copy app defaults to project options + self.options2form() # Populate the app defaults form self.units_label.set_text("[" + self.options["units"] + "]") # For debugging only def someThreadFunc(self): print "Hello World!" + t = threading.Thread(target=someThreadFunc, args=(self,)) t.start() @@ -553,14 +587,16 @@ class App: ######################################## self.window.set_default_size(900, 600) self.window.show_all() - + def setup_plot(self): """ - Sets up the main plotting area by creating a matplotlib + Sets up the main plotting area by creating a Matplotlib figure in self.canvas, adding axes and configuring them. These axes should not be ploted on and are just there to display the axes ticks and grid. - @return: None + + :return: None + :rtype: None """ self.figure = Figure(dpi=50) @@ -571,7 +607,7 @@ class App: #self.axes.plot(t,s) self.axes.grid(True) self.figure.patch.set_visible(False) - + self.canvas = FigureCanvas(self.figure) # a Gtk.DrawingArea self.canvas.set_hexpand(1) self.canvas.set_vexpand(1) @@ -583,36 +619,43 @@ class App: self.canvas.mpl_connect('key_press_event', self.on_key_over_plot) #self.canvas.mpl_connect('scroll_event', self.on_scroll_over_plot) self.canvas.connect("configure-event", self.on_canvas_configure) - + self.grid.attach(self.canvas, 0, 0, 600, 400) def setup_obj_classes(self): + """ + Sets up application specifics on the CirkuixObj class. + + :return: None + """ CirkuixObj.app = self - def setup_component_viewer(self): + def setup_project_list(self): """ Sets up list or Tree where whatever has been loaded or created is displayed. - @return: None + + :return: None """ self.store = Gtk.ListStore(str) self.tree = Gtk.TreeView(self.store) #self.list = Gtk.ListBox() self.tree.connect("row_activated", self.on_row_activated) - self.tree_select = self.tree.get_selection() + self.tree_select = self.tree.get_selection() self.signal_id = self.tree_select.connect("changed", self.on_tree_selection_changed) renderer = Gtk.CellRendererText() column = Gtk.TreeViewColumn("Title", renderer, text=0) self.tree.append_column(column) self.builder.get_object("box_project").pack_start(self.tree, False, False, 1) - + def setup_component_editor(self): """ Initial configuration of the component editor. Creates a page titled "Selection" on the notebook on the left side of the main window. - @return: None + + :return: None """ box_selected = self.builder.get_object("box_selected") @@ -633,36 +676,43 @@ class App: def info(self, text): """ Show text on the status bar. - @return: None - """ + :param text: Text to display. + :type text: str + :return: None + """ self.info_label.set_text(text) def zoom(self, factor, center=None): """ Zooms the plot by factor around a given center point. Takes care of re-drawing. - @return: None + + :param factor: Number by which to scale the plot. + :type factor: float + :param center: Coordinates [x, y] of the point around which to scale the plot. + :type center: list + :return: None """ xmin, xmax = self.axes.get_xlim() ymin, ymax = self.axes.get_ylim() - width = xmax-xmin - height = ymax-ymin + width = xmax - xmin + height = ymax - ymin if center is None: - center = [(xmin+xmax)/2.0, (ymin+ymax)/2.0] + center = [(xmin + xmax) / 2.0, (ymin + ymax) / 2.0] # For keeping the point at the pointer location - relx = (xmax-center[0])/width - rely = (ymax-center[1])/height + relx = (xmax - center[0]) / width + rely = (ymax - center[1]) / height - new_width = width/factor - new_height = height/factor + new_width = width / factor + new_height = height / factor - xmin = center[0]-new_width*(1-relx) - xmax = center[0]+new_width*relx - ymin = center[1]-new_height*(1-rely) - ymax = center[1]+new_height*rely + xmin = center[0] - new_width * (1 - relx) + xmax = center[0] + new_width * relx + ymin = center[1] - new_height * (1 - rely) + ymax = center[1] + new_height * rely for name in self.stuff: self.stuff[name].axes.set_xlim((xmin, xmax)) @@ -676,7 +726,8 @@ class App: """ Clears and re-populates the list of objects in currently in the project. - @return: None + + :return: None """ print "build_list(): clearing" self.tree_select.unselect_all() @@ -689,9 +740,12 @@ class App: def get_radio_value(self, radio_set): """ - Returns the radio_set[key] if the radiobutton + Returns the radio_set[key] of the radiobutton whose name is key is active. - @return: radio_set[key] + + :param radio_set: A dictionary containing widget_name: value pairs. + :type radio_set: dict + :return: radio_set[key] """ for name in radio_set: @@ -701,7 +755,8 @@ class App: def plot_all(self): """ Re-generates all plots from all objects. - @return: None + + :return: None """ self.clear_plots() self.set_progress_bar(0.1, "Re-plotting...") @@ -709,7 +764,7 @@ class App: def thread_func(app_obj): percentage = 0.1 try: - delta = 0.9/len(self.stuff) + delta = 0.9 / len(self.stuff) except ZeroDivisionError: GLib.timeout_add(300, lambda: app_obj.set_progress_bar(0.0, "")) return @@ -726,11 +781,12 @@ class App: t = threading.Thread(target=thread_func, args=(self,)) t.daemon = True t.start() - + def clear_plots(self): """ Clears self.axes and self.figure. - @return: None + + :return: None """ # TODO: Create a setup_axes method that gets called here and in setup_plot? @@ -745,8 +801,10 @@ class App: """ Runs eval() on the on the text entry of name 'widget_name' and returns the results. - @param widget_name: Name of Gtk.Entry - @return: Depends on contents of the entry text. + + :param widget_name: Name of Gtk.Entry + :type widget_name: str + :return: Depends on contents of the entry text. """ value = self.builder.get_object(widget_name).get_text() @@ -756,9 +814,11 @@ class App: """ Marks a given object as selected in the list ob objects in the GUI. This selection will in turn trigger - self.on_tree_selection_changed(). - @param name: Name of the object. - @return: None + ``self.on_tree_selection_changed()``. + + :param name: Name of the object. + :type name: str + :return: None """ iter = self.store.get_iter_first() @@ -814,6 +874,12 @@ class App: GLib.idle_add(lambda: self.info("Converting units to " + self.options["units"] + ".")) obj.convert_units(self.options["units"]) + # Set default options from self.options + for option in self.options: + if option.find(kind + "_") == 0: + oname = option[len(kind)+1:] + obj.options[oname] = self.options[option] + # Add to our records self.stuff[name] = obj @@ -834,6 +900,15 @@ class App: return obj def set_progress_bar(self, percentage, text=""): + """ + Sets the application's progress bar to a given fraction and text. + + :param percentage: The fraction (0.0-1.0) of the progress. + :type percentage: float + :param text: Text to display on the progress bar. + :type text: str + :return: + """ self.progress_bar.set_text(text) self.progress_bar.set_fraction(percentage) return False @@ -844,8 +919,9 @@ class App: def get_current(self): """ Returns the currently selected CirkuixObj in the application. - @return: Currently selected CirkuixObj in the application. - @rtype: CirkuixObj + + :return: Currently selected CirkuixObj in the application. + :rtype: CirkuixObj or None """ try: return self.stuff[self.selected_item_name] @@ -853,26 +929,41 @@ class App: return None def adjust_axes(self, xmin, ymin, xmax, ymax): + """ + Adjusts axes of all plots while maintaining the use of the whole canvas + and an aspect ratio to 1:1 between x and y axes. The parameters are an original + request that will be modified to fit these restrictions. + + :param xmin: Requested minimum value for the X axis. + :type xmin: float + :param ymin: Requested minimum value for the Y axis. + :type ymin: float + :param xmax: Requested maximum value for the X axis. + :type xmax: float + :param ymax: Requested maximum value for the Y axis. + :type ymax: float + :return: None + """ m_x = 15 # pixels m_y = 25 # pixels - width = xmax-xmin - height = ymax-ymin - r = width/height + width = xmax - xmin + height = ymax - ymin + r = width / height Fw, Fh = self.canvas.get_width_height() - Fr = float(Fw)/Fh - x_ratio = float(m_x)/Fw - y_ratio = float(m_y)/Fh + Fr = float(Fw) / Fh + x_ratio = float(m_x) / Fw + y_ratio = float(m_y) / Fh if r > Fr: - ycenter = (ymin+ymax)/2.0 - newheight = height*r/Fr - ymin = ycenter-newheight/2.0 - ymax = ycenter+newheight/2.0 + ycenter = (ymin + ymax) / 2.0 + newheight = height * r / Fr + ymin = ycenter - newheight / 2.0 + ymax = ycenter + newheight / 2.0 else: - xcenter = (xmax+ymin)/2.0 - newwidth = width*Fr/r - xmin = xcenter-newwidth/2.0 - xmax = xcenter+newwidth/2.0 + xcenter = (xmax + ymin) / 2.0 + newwidth = width * Fr / r + xmin = xcenter - newwidth / 2.0 + xmax = xcenter + newwidth / 2.0 for name in self.stuff: if self.stuff[name].axes is None: @@ -880,15 +971,21 @@ class App: self.stuff[name].axes.set_xlim((xmin, xmax)) self.stuff[name].axes.set_ylim((ymin, ymax)) self.stuff[name].axes.set_position([x_ratio, y_ratio, - 1-2*x_ratio, 1-2*y_ratio]) + 1 - 2 * x_ratio, 1 - 2 * y_ratio]) self.axes.set_xlim((xmin, xmax)) self.axes.set_ylim((ymin, ymax)) self.axes.set_position([x_ratio, y_ratio, - 1-2*x_ratio, 1-2*y_ratio]) + 1 - 2 * x_ratio, 1 - 2 * y_ratio]) self.canvas.queue_draw() def load_defaults(self): + """ + Loads the aplication's default settings from defaults.json into + ``self.defaults``. + + :return: None + """ try: f = open("defaults.json") options = f.read() @@ -900,22 +997,295 @@ class App: try: defaults = json.loads(options) except: + e = sys.exc_info()[0] + print e self.info("ERROR: Failed to parse defaults file.") return self.defaults.update(defaults) + def read_form(self): + """ + Reads the options form into self.defaults/self.options. + + :return: None + :rtype: None + """ + combo_sel = self.combo_options.get_active() + options_set = [self.options, self.defaults][combo_sel] + for option in options_set: + self.read_form_item(option, options_set) + + def read_form_item(self, name, dest): + """ + Reads the value of a form item in the defaults/options form and + saves it to the corresponding dictionary. + + :param name: Name of the form item. A key in ``self.defaults`` or + ``self.options``. + :type name: str + :param dest: Dictionary to which to save the value. + :type dest: dict + :return: None + """ + fkind = self.form_kinds[name] + fname = fkind + "_" + "app" + "_" + name + + if fkind == 'entry_text': + dest[name] = self.builder.get_object(fname).get_text() + return + if fkind == 'entry_eval': + dest[name] = self.get_eval(fname) + return + if fkind == 'cb': + dest[name] = self.builder.get_object(fname).get_active() + return + if fkind == 'radio': + dest[name] = self.get_radio_value(self.radios[name]) + return + print "Unknown kind of form item:", fkind + + def options2form(self): + """ + Sets the 'Project Options' or 'Application Defaults' form with values from + ``self.options``or ``self.defaults``. + :return : None + :rtype : None + """ + + # Set the on-change callback to do nothing while we do the changes. + self.options_update_ignore = True + + combo_sel = self.combo_options.get_active() + options_set = [self.options, self.defaults][combo_sel] + for option in options_set: + self.set_form_item(option, options_set[option]) + + self.options_update_ignore = False + + def set_form_item(self, name, value): + """ + Sets a form item 'name' in the GUI with the given 'value'. The syntax of + form names in the GUI is _app_, where kind is one of: rb (radio button), + cb (check button), entry_eval or entry_text (entry), combo (combo box). name is + whatever name it's been given. For self.defaults, name is a key in the dictionary. + + :param name: Name of the form field. + :type name: str + :param value: The value to set the form field to. + :type value: Depends on field kind. + :return: None + """ + if name not in self.form_kinds: + print "WARNING: Tried to set unknown option/form item:", name + return + fkind = self.form_kinds[name] + fname = fkind + "_" + "app" + "_" + name + if fkind == 'entry_eval' or fkind == 'entry_text': + try: + self.builder.get_object(fname).set_text(str(value)) + except: + print "ERROR: Failed to set value of %s to %s" % (fname, str(value)) + return + if fkind == 'cb': + try: + self.builder.get_object(fname).set_active(value) + except: + print "ERROR: Failed to set value of %s to %s" % (fname, str(value)) + return + if fkind == 'radio': + try: + self.builder.get_object(self.radios_inv[name][value]).set_active(True) + except: + print "ERROR: Failed to set value of %s to %s" % (fname, str(value)) + return + print "Unknown kind of form item:", fkind + ######################################## ## EVENT HANDLERS ## ######################################## + def on_options_app2project(self, param): + """ + Callback for Options->Transfer Options->App=>Project. Copies options + from application defaults to project defaults. + + :param param: Ignored. + :return: None + """ + self.options.update(self.defaults) + self.options2form() # Update UI + + def on_options_project2app(self, param): + """ + Callback for Options->Transfer Options->Project=>App. Copies options + from project defaults to application defaults. + + :param param: Ignored. + :return: None + """ + self.defaults.update(self.options) + self.options2form() # Update UI + + def on_options_project2object(self, param): + """ + Callback for Options->Transfer Options->Project=>Object. Copies options + from project defaults to the currently selected object. + + :param param: Ignored. + :return: None + """ + obj = self.get_current() + if obj is None: + print "WARNING: No object selected." + return + for option in self.options: + if option.find(obj.kind + "_") == 0: + oname = option[len(obj.kind)+1:] + obj.options[oname] = self.options[option] + obj.to_form() # Update UI + + def on_options_object2project(self, param): + """ + Callback for Options->Transfer Options->Object=>Project. Copies options + from the currently selected object to project defaults. + + :param param: Ignored. + :return: None + """ + obj = self.get_current() + if obj is None: + print "WARNING: No object selected." + return + obj.read_form() + for option in obj.options: + if option in ['name']: # TODO: Handle this better... + continue + self.options[obj.kind + "_" + option] = obj.options[option] + self.options2form() # Update UI + + def on_options_object2app(self, param): + """ + Callback for Options->Transfer Options->Object=>App. Copies options + from the currently selected object to application defaults. + + :param param: Ignored. + :return: None + """ + obj = self.get_current() + if obj is None: + print "WARNING: No object selected." + return + obj.read_form() + for option in obj.options: + if option in ['name']: # TODO: Handle this better... + continue + self.defaults[obj.kind + "_" + option] = obj.options[option] + self.options2form() # Update UI + + def on_options_app2object(self, param): + """ + Callback for Options->Transfer Options->App=>Object. Copies options + from application defaults to the currently selected object. + + :param param: Ignored. + :return: None + """ + obj = self.get_current() + if obj is None: + print "WARNING: No object selected." + return + for option in self.defaults: + if option.find(obj.kind + "_") == 0: + oname = option[len(obj.kind)+1:] + obj.options[oname] = self.defaults[option] + obj.to_form() # Update UI + + def on_file_savedefaults(self, param): + """ + Callback for menu item File->Save Defaults. Saves application default options + (``self.defaults``) to defaults.json. + + :param param: Ignored. + :return: None + """ + try: + f = open("defaults.json") + options = f.read() + f.close() + except: + self.info("ERROR: Could not load defaults file.") + return + + try: + defaults = json.loads(options) + except: + e = sys.exc_info()[0] + print e + self.info("ERROR: Failed to parse defaults file.") + return + + assert isinstance(defaults, dict) + defaults.update(self.defaults) + + try: + f = open("defaults.json", "w") + json.dump(defaults, f) + f.close() + except: + self.info("ERROR: Failed to write defaults to file.") + return + + self.info("Defaults saved.") + + def on_options_combo_change(self, widget): + """ + Called when the combo box to choose between application defaults and + project option changes value. The corresponding variables are + copied to the UI. + + :param widget: The widget from which this was called. Ignore. + :return: None + """ + combo_sel = self.combo_options.get_active() + print "Options --> ", combo_sel + self.options2form() + + def on_options_update(self, widget): + """ + Called whenever a value in the options/defaults form changes. + All values are updated. Can be inhibited by setting ``self.options_update_ignore = True``, + which may be necessary when updating the UI from code and not by the user. + + :param widget: The widget from which this was called. Ignore. + :return: None + """ + if self.options_update_ignore: + return + self.read_form() def on_scale_object(self, widget): + """ + Callback for request to change an objects geometry scale. The object + is re-scaled and replotted. + + :param widget: Ignored. + :return: None + """ obj = self.get_current() + assert isinstance(obj, CirkuixObj) factor = self.get_eval("entry_eval_" + obj.kind + "_scalefactor") obj.scale(factor) obj.to_form() self.on_update_plot(None) def on_canvas_configure(self, widget, event): + """ + Called whenever the canvas changes size. The axes are updated such + as to use the whole canvas. + + :param widget: Ignored. + :param event: Ignored. + :return: None + """ print "on_canvas_configure()" xmin, xmax = self.axes.get_xlim() @@ -923,9 +1293,26 @@ class App: self.adjust_axes(xmin, ymin, xmax, ymax) def on_row_activated(self, widget, path, col): + """ + Callback for selection activation (Enter or double-click) on the Project list. + Switches the notebook page to the object properties form. Calls + ``self.notebook.set_current_page(1)``. + + :param widget: Ignored. + :param path: Ignored. + :param col: Ignored. + :return: None + """ self.notebook.set_current_page(1) def on_generate_gerber_bounding_box(self, widget): + """ + Callback for request from the Gerber form to generate a bounding box for the + geometry in the object. Creates a CirkuixGeometry with the bounding box. + + :param widget: Ignored. + :return: None + """ gerber = self.get_current() gerber.read_form() name = self.selected_item_name + "_bbox" @@ -942,9 +1329,10 @@ class App: def on_update_plot(self, widget): """ Callback for button on form for all kinds of objects. - Re-plot the current object only. - @param widget: The widget from which this was called. - @return: None + Re-plots the current object only. + + :param widget: The widget from which this was called. + :return: None """ print "Re-plotting" @@ -968,8 +1356,9 @@ class App: """ Callback for button active/click on Excellon form to create a CNC Job for the Excellon file. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ job_name = self.selected_item_name + "_cnc" @@ -1015,14 +1404,23 @@ class App: """ Callback for button on Excellon form to open up a window for selecting tools. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ excellon = self.get_current() assert isinstance(excellon, CirkuixExcellon) excellon.show_tool_chooser() def on_entry_eval_activate(self, widget): + """ + Called when an entry is activated (eg. by hitting enter) if + set to do so. Its text is eval()'d and set to the returned value. + The current object is updated. + + :param widget: + :return: + """ self.on_eval_update(widget) obj = self.get_current() assert isinstance(obj, CirkuixObj) @@ -1033,8 +1431,9 @@ class App: Callback for button on Gerber form to create a geometry object with polygons covering the area without copper or negative of the Gerber. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ name = self.selected_item_name + "_noncopper" @@ -1054,8 +1453,9 @@ class App: """ Callback for button on Gerber form to create geometry with lines for cutting off the board. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ name = self.selected_item_name + "_cutout" @@ -1072,18 +1472,18 @@ class App: midx = 0.5 * (minx + maxx) midy = 0.5 * (miny + maxy) hgap = 0.5 * gap_size - pts = [[midx-hgap, maxy], + pts = [[midx - hgap, maxy], [minx, maxy], - [minx, midy+hgap], - [minx, midy-hgap], + [minx, midy + hgap], + [minx, midy - hgap], [minx, miny], - [midx-hgap, miny], - [midx+hgap, miny], + [midx - hgap, miny], + [midx + hgap, miny], [maxx, miny], - [maxx, midy-hgap], - [maxx, midy+hgap], + [maxx, midy - hgap], + [maxx, midy + hgap], [maxx, maxy], - [midx+hgap, maxy]] + [midx + hgap, maxy]] cases = {"tb": [[pts[0], pts[1], pts[4], pts[5]], [pts[6], pts[7], pts[10], pts[11]]], "lr": [[pts[9], pts[10], pts[1], pts[2]], @@ -1103,8 +1503,9 @@ class App: Modifies the content of a Gtk.Entry by running eval() on its contents and puting it back as a string. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ # TODO: error handling here widget.set_text(str(eval(widget.get_text()))) @@ -1112,8 +1513,9 @@ class App: def on_generate_isolation(self, widget): """ Callback for button on Gerber form to create isolation routing geometry. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ print "Generating Isolation Geometry:" iso_name = self.selected_item_name + "_iso" @@ -1122,7 +1524,7 @@ class App: # TODO: Object must be updated on form change and the options # TODO: read from the object. tooldia = app_obj.get_eval("entry_eval_gerber_isotooldia") - geo_obj.solid_geometry = self.get_current().isolation_geometry(tooldia/2.0) + geo_obj.solid_geometry = self.get_current().isolation_geometry(tooldia / 2.0) # TODO: Do something if this is None. Offer changing name? self.new_object("geometry", iso_name, iso_init) @@ -1130,8 +1532,9 @@ class App: def on_generate_cncjob(self, widget): """ Callback for button on geometry form to generate CNC job. - @param widget: The widget from which this was called. - @return: None + + :param widget: The widget from which this was called. + :return: None """ print "Generating CNC job" job_name = self.selected_item_name + "_cnc" @@ -1178,6 +1581,9 @@ class App: after the click. Finds the polygon containing the clicked point and runs clear_poly() on it, resulting in a new CirkuixGeometry object. + + :param widget: The widget from which this was called. + :return: None """ self.info("Click inside the desired polygon.") geo = self.get_current() @@ -1205,19 +1611,27 @@ class App: self.plot_click_subscribers["generate_paintarea"] = doit def on_cncjob_exportgcode(self, widget): + """ + Called from button on CNCjob form to save the G-Code from the object. + + :param widget: The widget from which this was called. + :return: None + """ def on_success(self, filename): cncjob = self.get_current() f = open(filename, 'w') f.write(cncjob.gcode) f.close() print "Saved to:", filename + self.file_chooser_save_action(on_success) def on_delete(self, widget): """ Delete the currently selected CirkuixObj. - @param widget: The widget from which this was called. - @return: + + :param widget: The widget from which this was called. + :return: None """ print "on_delete():", self.selected_item_name @@ -1230,17 +1644,32 @@ class App: # Update UI self.build_list() # Update the items list - + def on_replot(self, widget): + """ + Callback for toolbar button. Re-plots all objects. + + :param widget: The widget from which this was called. + :return: None + """ self.plot_all() - + def on_clear_plots(self, widget): + """ + Callback for toolbar button. Clears all plots. + + :param widget: The widget from which this was called. + :return: None + """ self.clear_plots() - + def on_activate_name(self, entry): """ Hitting 'Enter' after changing the name of an item updates the item dictionary and re-builds the item list. + + :param entry: The widget from which this was called. + :return: None """ # Disconnect event listener @@ -1256,15 +1685,16 @@ class App: # Reconnect event listener self.signal_id = self.tree.get_selection().connect( - "changed", self.on_tree_selection_changed) + "changed", self.on_tree_selection_changed) def on_tree_selection_changed(self, selection): """ Callback for selection change in the project list. This changes the currently selected CirkuixObj. - @param selection: Selection associated to the project tree or list - @type selection: Gtk.TreeSelection - @return: None + + :param selection: Selection associated to the project tree or list + :type selection: Gtk.TreeSelection + :return: None """ print "on_tree_selection_change(): ", model, treeiter = selection.get_selected() @@ -1284,6 +1714,13 @@ class App: self.setup_component_editor() def on_file_new(self, param): + """ + Callback for menu item File->New. Returns the application to its + startup state. + + :param param: Whatever is passed by the event. Ignore. + :return: None + """ # Remove everythong from memory # Clear plot self.clear_plots() @@ -1301,24 +1738,43 @@ class App: #print "File->New not implemented yet." def on_filequit(self, param): + """ + Callback for menu item File->Quit. Closes the application. + + :param param: Whatever is passed by the event. Ignore. + :return: None + """ print "quit from menu" self.window.destroy() Gtk.main_quit() - + def on_closewindow(self, param): + """ + Callback for closing the main window. + + :param param: Whatever is passed by the event. Ignore. + :return: None + """ print "quit from X" self.window.destroy() Gtk.main_quit() - + def file_chooser_action(self, on_success): """ Opens the file chooser and runs on_success on a separate thread upon completion of valid file choice. + + :param on_success: A function to run upon completion of a valid file + selection. Takes 2 parameters: The app instance and the filename. + Note that it is run on a separate thread, therefore it must take the + appropriate precautions when accessing shared resources. + :type on_success: func + :return: None """ dialog = Gtk.FileChooserDialog("Please choose a file", self.window, - Gtk.FileChooserAction.OPEN, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) + Gtk.FileChooserAction.OPEN, + (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK)) response = dialog.run() if response == Gtk.ResponseType.OK: filename = dialog.get_filename() @@ -1329,17 +1785,21 @@ class App: #on_success(self, filename) elif response == Gtk.ResponseType.CANCEL: print("Cancel clicked") - dialog.destroy() - + dialog.destroy() + def file_chooser_save_action(self, on_success): """ - Opens the file chooser and runs on_success - upon completion of valid file choice. + Opens the file chooser and runs on_success upon completion of valid file choice. + + :param on_success: A function to run upon selection of a filename. Takes 2 + parameters: The instance of the application (App) and the chosen filename. This + gets run immediately in the same thread. + :return: None """ dialog = Gtk.FileChooserDialog("Save file", self.window, - Gtk.FileChooserAction.SAVE, - (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_SAVE, Gtk.ResponseType.OK)) + Gtk.FileChooserAction.SAVE, + (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_SAVE, Gtk.ResponseType.OK)) dialog.set_current_name("Untitled") response = dialog.run() if response == Gtk.ResponseType.OK: @@ -1349,9 +1809,16 @@ class App: elif response == Gtk.ResponseType.CANCEL: print("Cancel clicked") dialog.destroy() - - def on_fileopengerber(self, param): + def on_fileopengerber(self, param): + """ + Callback for menu item File->Open Gerber. Defines a function that is then passed + to ``self.file_chooser_action()``. It requests the creation of a CirkuixGerber object + and updates the progress bar throughout the process. + + :param param: Ignore + :return: None + """ # IMPORTANT: on_success will run on a separate thread. Use # GLib.idle_add(function, **kwargs) to launch actions that will # updata the GUI. @@ -1372,9 +1839,16 @@ class App: # on_success gets run on a separate thread self.file_chooser_action(on_success) - - def on_fileopenexcellon(self, param): + def on_fileopenexcellon(self, param): + """ + Callback for menu item File->Open Excellon. Defines a function that is then passed + to ``self.file_chooser_action()``. It requests the creation of a CirkuixExcellon object + and updates the progress bar throughout the process. + + :param param: Ignore + :return: None + """ # IMPORTANT: on_success will run on a separate thread. Use # GLib.idle_add(function, **kwargs) to launch actions that will # updata the GUI. @@ -1395,9 +1869,16 @@ class App: # on_success gets run on a separate thread self.file_chooser_action(on_success) - - def on_fileopengcode(self, param): + def on_fileopengcode(self, param): + """ + Callback for menu item File->Open G-Code. Defines a function that is then passed + to ``self.file_chooser_action()``. It requests the creation of a CirkuixCNCjob object + and updates the progress bar throughout the process. + + :param param: Ignore + :return: None + """ # IMPORTANT: on_success will run on a separate thread. Use # GLib.idle_add(function, **kwargs) to launch actions that will # updata the GUI. @@ -1430,44 +1911,82 @@ class App: # on_success gets run on a separate thread self.file_chooser_action(on_success) - + def on_mouse_move_over_plot(self, event): - try: # May fail in case mouse not within axes - self.position_label.set_label("X: %.4f Y: %.4f"%( - event.xdata, event.ydata)) + """ + Callback for the mouse motion event over the plot. This event is generated + by the Matplotlib backend and has been registered in ``self.__init__()``. + For details, see: http://matplotlib.org/users/event_handling.html + + :param event: Contains information about the event. + :return: None + """ + try: # May fail in case mouse not within axes + self.position_label.set_label("X: %.4f Y: %.4f" % ( + event.xdata, event.ydata)) self.mouse = [event.xdata, event.ydata] except: self.position_label.set_label("") self.mouse = None - + def on_click_over_plot(self, event): + """ + Callback for the mouse click event over the plot. This event is generated + by the Matplotlib backend and has been registered in ``self.__init__()``. + For details, see: http://matplotlib.org/users/event_handling.html + + :param event: + :return: + """ # For key presses self.canvas.grab_focus() try: - print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%( - event.button, event.x, event.y, event.xdata, event.ydata) + print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f' % ( + event.button, event.x, event.y, event.xdata, event.ydata) for subscriber in self.plot_click_subscribers: self.plot_click_subscribers[subscriber](event) except Exception, e: print "Outside plot!" - + def on_zoom_in(self, event): + """ + Callback for zoom-in request. This can be either from the corresponding + toolbar button or the '3' key when the canvas is focused. Calls ``self.zoom()``. + + :param event: Ignored. + :return: None + """ self.zoom(1.5) return - + def on_zoom_out(self, event): - self.zoom(1/1.5) - + """ + Callback for zoom-out request. This can be either from the corresponding + toolbar button or the '2' key when the canvas is focused. Calls ``self.zoom()``. + + :param event: Ignored. + :return: None + """ + self.zoom(1 / 1.5) + def on_zoom_fit(self, event): + """ + Callback for zoom-out request. This can be either from the corresponding + toolbar button or the '1' key when the canvas is focused. Calls ``self.adjust_axes()`` + with axes limits from the geometry bounds of all objects. + + :param event: Ignored. + :return: None + """ xmin, ymin, xmax, ymax = get_bounds(self.stuff) - width = xmax-xmin - height = ymax-ymin - xmin -= 0.05*width - xmax += 0.05*width - ymin -= 0.05*height - ymax += 0.05*height + width = xmax - xmin + height = ymax - ymin + xmin -= 0.05 * width + xmax += 0.05 * width + ymin -= 0.05 * height + ymax += 0.05 * height self.adjust_axes(xmin, ymin, xmax, ymax) # def on_scroll_over_plot(self, event): @@ -1480,21 +1999,37 @@ class App: # # def on_window_scroll(self, event): # print "Scroll" - + def on_key_over_plot(self, event): + """ + Callback for the key pressed event when the canvas is focused. Keyboard + shortcuts are handled here. So far, these are the shortcuts: + + ========== ============================================ + Key Action + ========== ============================================ + '1' Zoom-fit. Fits the axes limits to the data. + '2' Zoom-out. + '3' Zoom-in. + ========== ============================================ + + :param event: Ignored. + :return: None + """ print 'you pressed', event.key, event.xdata, event.ydata - + if event.key == '1': # 1 self.on_zoom_fit(None) return - + if event.key == '2': # 2 - self.zoom(1/1.5, self.mouse) + self.zoom(1 / 1.5, self.mouse) return - + if event.key == '3': # 3 self.zoom(1.5, self.mouse) return + app = App() Gtk.main() diff --git a/cirkuix.ui b/cirkuix.ui index 6f4e4238..cd2651a2 100644 --- a/cirkuix.ui +++ b/cirkuix.ui @@ -16,6 +16,16 @@ False gtk-open + + True + False + gtk-save + + + True + False + gtk-jump-to + False @@ -2036,6 +2046,23 @@ False + + + Save defaults + True + False + Saves the application's default options to file. + image4 + False + + + + + + True + False + + gtk-quit @@ -2077,8 +2104,95 @@ True False - _Tools + _Options True + + + True + False + + + Transfer options + True + False + image5 + False + + + True + False + + + True + False + Make the application's default options +equal to the current project's default options. + Project => App + True + + + + + + True + False + Make the project's options equal to the +application's default options. + App => Project + True + + + + + + True + False + Make the current object's +options be project defaults. + Object => Project + True + + + + + + True + False + Make the current object's +options be application defaults. + Object => App + True + + + + + + True + False + Set the current object's options +to project defaults. + Project => Object + True + + + + + + True + False + Set the current object's options +to application defaults. + App => Object + True + + + + + + + + + @@ -2274,108 +2388,1259 @@ + 400 True False True True vertical - + True - False - vertical + True + True + never + in - - True - False - 5 - 3 - PROJECT - - - - - - False - True - 0 - - - - + True False - - - - - - - - - - - - - - - - - - - - - - - - - + + True + False + 5 + 5 + 5 + True + vertical + + + True + False + 10 + 10 + 5 + 10 + 0 + 1 + + PROJECT OPTIONS + APPLICATION DEFAULTS + + + + + False + True + 0 + + + + + + + + + + + True + False + 5 + + + True + False + 1 + Units: + + + False + True + 0 + + + + + True + False + 8 + + + inch + True + True + False + 0 + True + True + + + False + True + 0 + + + + + mm + True + True + False + 0 + True + rb_inch + + + False + True + 1 + + + + + False + True + 1 + + + + + False + True + 3 + + + + + True + False + 3 + Gerber Object + + + + + + False + True + 4 + + + + + True + False + 5 + 0 + 3 + Plot Options: + + + + + + False + True + 5 + + + + + Plot + True + True + False + 0 + True + True + + + + False + True + 6 + + + + + Merge Polygons + True + True + False + 0 + True + True + + + + False + True + 7 + + + + + Solid + True + True + False + 0 + True + + + + False + True + 8 + + + + + Multi-colored + True + True + False + 0 + True + + + + False + True + 9 + + + + + True + False + 5 + 0 + 3 + Isolation Routing: + + + + + + False + True + 10 + + + + + True + False + 3 + 2 + + + True + False + 1 + 3 + Tool diam: + + + 0 + 0 + 1 + 1 + + + + + True + True + 2 + 2 + + 16 + True + + + + 1 + 0 + 1 + 1 + + + + + False + True + 11 + + + + + True + False + 5 + 0 + 3 + Board cutout: + + + + + + False + True + 12 + + + + + True + False + 3 + + + True + False + 1 + Margin: + + + 0 + 0 + 1 + 1 + + + + + True + True + + 12 + True + + + + 1 + 0 + 1 + 1 + + + + + True + True + + 12 + True + + + + 1 + 1 + 1 + 1 + + + + + True + False + 1 + Gap size: + + + 0 + 1 + 1 + 1 + + + + + True + False + 1 + Gaps: + + + 0 + 2 + 1 + 1 + + + + + True + False + + + 2 (T/B) + True + True + False + 8 + 0 + True + + + + False + True + 0 + + + + + 2 (L/R) + True + True + False + 8 + 0 + True + True + rb_app_2tb + + + + False + True + 1 + + + + + 4 + True + True + False + 0 + True + rb_app_2tb + + + False + True + 2 + + + + + 1 + 2 + 1 + 1 + + + + + False + True + 13 + + + + + True + False + 5 + 0 + 3 + Non-copper regions: + + + + + + False + True + 14 + + + + + True + False + 4 + 4 + 1 + + + True + False + 1 + Boundary margin: + + + False + True + 0 + + + + + True + True + + 14 + True + + + + False + True + 1 + + + + + False + True + 15 + + + + + True + False + 5 + 0 + 3 + Bounding box: + + + + + + False + True + 16 + + + + + True + False + 4 + 4 + 1 + + + True + False + 1 + Boundary margin: + + + False + True + 0 + + + + + True + True + + 14 + True + + + + False + True + 1 + + + + + False + True + 17 + + + + + Rounded corners + True + True + False + 0 + True + + + + False + True + 18 + + + + + True + False + 3 + Excellon Object + + + + + + False + True + 19 + + + + + True + False + 0 + 3 + Plot Options: + + + + + + False + True + 20 + + + + + Plot + True + True + False + 0 + True + True + + + + False + True + 21 + + + + + Solid + True + True + False + 0 + True + + + + False + True + 22 + + + + + Multi-colored + True + True + False + 0 + True + + + + False + True + 23 + + + + + True + False + 5 + 0 + 3 + Create CNC Job: + + + + + + False + True + 24 + + + + + True + False + 2 + 4 + + + True + True + + True + + + + 1 + 0 + 1 + 1 + + + + + True + True + + True + + + + 1 + 1 + 1 + 1 + + + + + True + True + + True + + + + 1 + 2 + 1 + 1 + + + + + True + False + 1 + Drill Z: + + + 0 + 0 + 1 + 1 + + + + + True + False + 1 + Travel Z: + + + 0 + 1 + 1 + 1 + + + + + True + False + 1 + Feed rate: + + + 0 + 2 + 1 + 1 + + + + + False + True + 25 + + + + + True + False + 3 + Geometry Object + + + + + + False + True + 26 + + + + + True + False + 0 + 3 + Plot Options: + + + + + + False + True + 27 + + + + + Plot + True + True + False + 0 + True + True + + + + False + True + 28 + + + + + Solid + True + True + False + 0 + True + + + + False + True + 29 + + + + + Multi-colored + True + True + False + 0 + True + + + + False + True + 30 + + + + + True + False + 5 + 0 + 3 + Create CNC Job: + + + + + + False + True + 31 + + + + + True + False + 2 + 4 + + + True + True + + True + + + + 1 + 0 + 1 + 1 + + + + + True + True + + True + + + + 1 + 1 + 1 + 1 + + + + + True + True + + True + + + + 1 + 2 + 1 + 1 + + + + + True + False + 1 + Cut Z: + + + 0 + 0 + 1 + 1 + + + + + True + False + 1 + Travel Z: + + + 0 + 1 + 1 + 1 + + + + + True + False + 1 + Feed rate: + + + 0 + 2 + 1 + 1 + + + + + True + False + 1 + Tool diam: + + + 0 + 3 + 1 + 1 + + + + + True + True + + True + + + + 1 + 3 + 1 + 1 + + + + + False + True + 32 + + + + + True + False + 5 + 0 + 3 + Paint Area: + + + + + + False + True + 33 + + + + + True + False + 2 + 5 + + + True + False + 1 + Tool diam: + + + 0 + 0 + 1 + 1 + + + + + True + True + + True + + + + 1 + 0 + 1 + 1 + + + + + True + False + 1 + Overlap: + + + 0 + 1 + 1 + 1 + + + + + True + True + + True + + + + 1 + 1 + 1 + 1 + + + + + True + False + 1 + Margin: + + + 0 + 2 + 1 + 1 + + + + + True + True + + True + + + + 1 + 2 + 1 + 1 + + + + + False + True + 34 + + + + + True + False + 3 + CNC Job Object + + + + + + False + True + 35 + + + + + Plot + True + True + False + 0 + True + True + + + + False + True + 36 + + + + + Solid + True + True + False + 0 + True + + + + False + True + 37 + + + + + Multi-colored + True + True + False + 0 + True + + + + False + True + 38 + + + + + True + False + 3 + 3 + 3 + + + True + False + 1 + Tool diam: + + + False + True + 0 + + + + + True + True + + True + + + + False + True + 1 + + + + + False + True + 39 + + + + + + + + + - - False - True - 1 - - - - - True - False - 5 - 3 - APLICATION - - - - - - False - True - 2 - - - - - - - - - - - - - - - - - - - - - - diff --git a/defaults.json b/defaults.json index 651d7ce4..bcc117a8 100644 --- a/defaults.json +++ b/defaults.json @@ -1,3 +1 @@ -{ -"units": "in" -} \ No newline at end of file +{"cncjob_multicolored": false, "geometry_paintoverlap": 0.15, "geometry_plot": true, "cncjob_solid": false, "gerber_isotooldia": 0.16, "gerber_plot": true, "gerber_mergepolys": true, "gerber_cutoutgapsize": 0.15, "geometry_feedrate": 5.0, "units": "IN", "excellon_travelz": 0.1, "gerber_multicolored": false, "gerber_solid": false, "excellon_plot": true, "excellon_feedrate": 5.0, "cncjob_tooldia": 0.16, "geometry_travelz": 0.1, "gerber_cutoutmargin": 0.2, "excellon_solid": false, "geometry_paintmargin": 0.01, "geometry_cutz": -0.002, "gerber_noncoppermargin": 0.0, "gerber_gaps": "4", "excellon_multicolored": false, "gerber_bboxmargin": 0.0, "cncjob_plot": true, "excellon_drillz": -0.1, "gerber_bboxrounded": false, "geometry_multicolored": false, "geometry_cnctooldia": 0.16, "geometry_solid": false, "geometry_painttooldia": 0.0625} \ No newline at end of file diff --git a/doc/build/.doctrees/environment.pickle b/doc/build/.doctrees/environment.pickle index 14c24053..7ef2d2a0 100644 Binary files a/doc/build/.doctrees/environment.pickle and b/doc/build/.doctrees/environment.pickle differ diff --git a/doc/build/.doctrees/index.doctree b/doc/build/.doctrees/index.doctree index b7289c22..77e7772e 100644 Binary files a/doc/build/.doctrees/index.doctree and b/doc/build/.doctrees/index.doctree differ diff --git a/doc/build/genindex.html b/doc/build/genindex.html index ae859bc1..9adc9189 100644 --- a/doc/build/genindex.html +++ b/doc/build/genindex.html @@ -124,6 +124,7 @@ | F | G | I + | L | N | O | P @@ -136,6 +137,10 @@
+
adjust_axes() (cirkuix.App method) +
+ +
aperture_parse() (cirkuix.Gerber method)
@@ -338,6 +343,16 @@
+

L

+ + +
+ +
load_defaults() (cirkuix.App method) +
+ +
+

N

- +
@@ -356,10 +371,34 @@ +
on_canvas_configure() (cirkuix.App method) +
+ + +
on_clear_plots() (cirkuix.App method) +
+ + +
on_click_over_plot() (cirkuix.App method) +
+ + +
on_closewindow() (cirkuix.App method) +
+ + +
on_cncjob_exportgcode() (cirkuix.App method) +
+ +
on_delete() (cirkuix.App method)
+
on_entry_eval_activate() (cirkuix.App method) +
+ +
on_eval_update() (cirkuix.App method)
@@ -368,6 +407,30 @@ +
on_file_new() (cirkuix.App method) +
+ + +
on_file_savedefaults() (cirkuix.App method) +
+ + +
on_fileopenexcellon() (cirkuix.App method) +
+ + +
on_fileopengcode() (cirkuix.App method) +
+ + +
on_fileopengerber() (cirkuix.App method) +
+ + +
on_filequit() (cirkuix.App method) +
+ +
on_generate_cncjob() (cirkuix.App method)
@@ -375,8 +438,10 @@
on_generate_excellon_cncjob() (cirkuix.App method)
-
+ +
on_generate_gerber_bounding_box() (cirkuix.App method) +
+
on_generate_isolation() (cirkuix.App method)
@@ -385,6 +450,8 @@
on_generate_paintarea() (cirkuix.App method)
+
on_gerber_generate_cutout() (cirkuix.App method)
@@ -394,6 +461,58 @@ +
on_key_over_plot() (cirkuix.App method) +
+ + +
on_mouse_move_over_plot() (cirkuix.App method) +
+ + +
on_options_app2object() (cirkuix.App method) +
+ + +
on_options_app2project() (cirkuix.App method) +
+ + +
on_options_combo_change() (cirkuix.App method) +
+ + +
on_options_object2app() (cirkuix.App method) +
+ + +
on_options_object2project() (cirkuix.App method) +
+ + +
on_options_project2app() (cirkuix.App method) +
+ + +
on_options_project2object() (cirkuix.App method) +
+ + +
on_options_update() (cirkuix.App method) +
+ + +
on_replot() (cirkuix.App method) +
+ + +
on_row_activated() (cirkuix.App method) +
+ + +
on_scale_object() (cirkuix.App method) +
+ +
on_tree_selection_changed() (cirkuix.App method)
@@ -401,6 +520,22 @@
on_update_plot() (cirkuix.App method)
+ +
on_zoom_fit() (cirkuix.App method) +
+ + +
on_zoom_in() (cirkuix.App method) +
+ + +
on_zoom_out() (cirkuix.App method) +
+ + +
options2form() (cirkuix.App method) +
+
@@ -456,7 +591,19 @@ + @@ -488,10 +635,18 @@ +
set_form_item() (cirkuix.App method) +
+ +
set_list_selection() (cirkuix.App method)
+
set_progress_bar() (cirkuix.App method) +
+ +
setup_axes() (cirkuix.CirkuixObj method)
@@ -502,7 +657,7 @@ -
setup_component_viewer() (cirkuix.App method) +
setup_obj_classes() (cirkuix.App method)
@@ -510,6 +665,10 @@ +
setup_project_list() (cirkuix.App method) +
+ +
size() (cirkuix.Geometry method)
diff --git a/doc/build/index.html b/doc/build/index.html index c8a38d69..a554a2b2 100644 --- a/doc/build/index.html +++ b/doc/build/index.html @@ -124,19 +124,58 @@
class cirkuix.App

The main application class. The constructor starts the GUI.

+
+
+adjust_axes(xmin, ymin, xmax, ymax)
+

Adjusts axes of all plots while maintaining the use of the whole canvas +and an aspect ratio to 1:1 between x and y axes. The parameters are an original +request that will be modified to fit these restrictions.

+
-
read_form() (cirkuix.CirkuixObj method) +
read_form() (cirkuix.App method) +
+ +
+ +
(cirkuix.CirkuixObj method) +
+ +
+
+ +
read_form_item() (cirkuix.App method)
+++ + + + + + +
Parameters:
    +
  • xmin (float) – Requested minimum value for the X axis.
  • +
  • ymin (float) – Requested minimum value for the Y axis.
  • +
  • xmax (float) – Requested maximum value for the X axis.
  • +
  • ymax (float) – Requested maximum value for the Y axis.
  • +
+
Returns:

None

+
+ +
build_list()

Clears and re-populates the list of objects in currently -in the project. -@return: None

+in the project.

+ +++ + + + +
Returns:None
clear_plots()
-

Clears self.axes and self.figure. -@return: None

+

Clears self.axes and self.figure.

+ +++ + + + +
Returns:None
@@ -144,45 +183,118 @@ in the project. file_chooser_action(on_success)

Opens the file chooser and runs on_success on a separate thread upon completion of valid file choice.

+ +++ + + + + + +
Parameters:on_success (func) – A function to run upon completion of a valid file +selection. Takes 2 parameters: The app instance and the filename. +Note that it is run on a separate thread, therefore it must take the +appropriate precautions when accessing shared resources.
Returns:None
file_chooser_save_action(on_success)
-

Opens the file chooser and runs on_success -upon completion of valid file choice.

+

Opens the file chooser and runs on_success upon completion of valid file choice.

+ +++ + + + + + +
Parameters:on_success – A function to run upon selection of a filename. Takes 2 +parameters: The instance of the application (App) and the chosen filename. This +gets run immediately in the same thread.
Returns:None
get_current()
-

Returns the currently selected CirkuixObj in the application. -@return: Currently selected CirkuixObj in the application. -@rtype: CirkuixObj

+

Returns the currently selected CirkuixObj in the application.

+ +++ + + + + + +
Returns:Currently selected CirkuixObj in the application.
Return type:CirkuixObj or None
get_eval(widget_name)

Runs eval() on the on the text entry of name ‘widget_name’ -and returns the results. -@param widget_name: Name of Gtk.Entry -@return: Depends on contents of the entry text.

+and returns the results.

+ +++ + + + + + +
Parameters:widget_name (str) – Name of Gtk.Entry
Returns:Depends on contents of the entry text.
get_radio_value(radio_set)
-

Returns the radio_set[key] if the radiobutton -whose name is key is active. -@return: radio_set[key]

+

Returns the radio_set[key] of the radiobutton +whose name is key is active.

+ +++ + + + + + +
Parameters:radio_set (dict) – A dictionary containing widget_name: value pairs.
Returns:radio_set[key]
info(text)
-

Show text on the status bar. -@return: None

+

Show text on the status bar.

+ +++ + + + + + +
Parameters:text (str) – Text to display.
Returns:None
+
+ +
+
+load_defaults()
+

Loads the aplication’s default settings from defaults.json into +self.defaults.

+ +++ + + + +
Returns:None
@@ -219,14 +331,138 @@ called with 2 parameters: the new object and the App instance. on_activate_name(entry)

Hitting ‘Enter’ after changing the name of an item updates the item dictionary and re-builds the item list.

+ +++ + + + + + +
Parameters:entry – The widget from which this was called.
Returns:None
+
+ +
+
+on_canvas_configure(widget, event)
+

Called whenever the canvas changes size. The axes are updated such +as to use the whole canvas.

+ +++ + + + + + +
Parameters:
    +
  • widget – Ignored.
  • +
  • event – Ignored.
  • +
+
Returns:

None

+
+
+ +
+
+on_clear_plots(widget)
+

Callback for toolbar button. Clears all plots.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_click_over_plot(event)
+

Callback for the mouse click event over the plot. This event is generated +by the Matplotlib backend and has been registered in self.__init__(). +For details, see: http://matplotlib.org/users/event_handling.html

+ +++ + + + + + +
Parameters:event
Returns:
+
+ +
+
+on_closewindow(param)
+

Callback for closing the main window.

+ +++ + + + + + +
Parameters:param – Whatever is passed by the event. Ignore.
Returns:None
+
+ +
+
+on_cncjob_exportgcode(widget)
+

Called from button on CNCjob form to save the G-Code from the object.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
on_delete(widget)
-

Delete the currently selected CirkuixObj. -@param widget: The widget from which this was called. -@return:

+

Delete the currently selected CirkuixObj.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_entry_eval_activate(widget)
+

Called when an entry is activated (eg. by hitting enter) if +set to do so. Its text is eval()’d and set to the returned value. +The current object is updated.

+ +++ + + + + + +
Parameters:widget
Returns:
@@ -234,43 +470,204 @@ updates the item dictionary and re-builds the item list.

on_eval_update(widget)

Modifies the content of a Gtk.Entry by running eval() on its contents and puting it back as a -string. -@param widget: The widget from which this was called. -@return: None

+string.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
on_excellon_tool_choose(widget)

Callback for button on Excellon form to open up a window for -selecting tools. -@param widget: The widget from which this was called. -@return: None

+selecting tools.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_file_new(param)
+

Callback for menu item File->New. Returns the application to its +startup state.

+ +++ + + + + + +
Parameters:param – Whatever is passed by the event. Ignore.
Returns:None
+
+ +
+
+on_file_savedefaults(param)
+

Callback for menu item File->Save Defaults. Saves application default options +(self.defaults) to defaults.json.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_fileopenexcellon(param)
+

Callback for menu item File->Open Excellon. Defines a function that is then passed +to self.file_chooser_action(). It requests the creation of a CirkuixExcellon object +and updates the progress bar throughout the process.

+ +++ + + + + + +
Parameters:param – Ignore
Returns:None
+
+ +
+
+on_fileopengcode(param)
+

Callback for menu item File->Open G-Code. Defines a function that is then passed +to self.file_chooser_action(). It requests the creation of a CirkuixCNCjob object +and updates the progress bar throughout the process.

+ +++ + + + + + +
Parameters:param – Ignore
Returns:None
+
+ +
+
+on_fileopengerber(param)
+

Callback for menu item File->Open Gerber. Defines a function that is then passed +to self.file_chooser_action(). It requests the creation of a CirkuixGerber object +and updates the progress bar throughout the process.

+ +++ + + + + + +
Parameters:param – Ignore
Returns:None
+
+ +
+
+on_filequit(param)
+

Callback for menu item File->Quit. Closes the application.

+ +++ + + + + + +
Parameters:param – Whatever is passed by the event. Ignore.
Returns:None
on_generate_cncjob(widget)
-

Callback for button on geometry form to generate CNC job. -@param widget: The widget from which this was called. -@return: None

+

Callback for button on geometry form to generate CNC job.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
on_generate_excellon_cncjob(widget)

Callback for button active/click on Excellon form to -create a CNC Job for the Excellon file. -@param widget: The widget from which this was called. -@return: None

+create a CNC Job for the Excellon file.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_generate_gerber_bounding_box(widget)
+

Callback for request from the Gerber form to generate a bounding box for the +geometry in the object. Creates a CirkuixGeometry with the bounding box.

+ +++ + + + + + +
Parameters:widget – Ignored.
Returns:None
on_generate_isolation(widget)
-

Callback for button on Gerber form to create isolation routing geometry. -@param widget: The widget from which this was called. -@return: None

+

Callback for button on Gerber form to create isolation routing geometry.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
@@ -281,15 +678,33 @@ Subscribes to the “Click on plot” event and continues after the click. Finds the polygon containing the clicked point and runs clear_poly() on it, resulting in a new CirkuixGeometry object.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
on_gerber_generate_cutout(widget)

Callback for button on Gerber form to create geometry with lines -for cutting off the board. -@param widget: The widget from which this was called. -@return: None

+for cutting off the board.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
@@ -297,35 +712,441 @@ for cutting off the board. on_gerber_generate_noncopper(widget)

Callback for button on Gerber form to create a geometry object with polygons covering the area without copper or negative of the -Gerber. -@param widget: The widget from which this was called. -@return: None

+Gerber.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_key_over_plot(event)
+

Callback for the key pressed event when the canvas is focused. Keyboard +shortcuts are handled here. So far, these are the shortcuts:

+ ++++ + + + + + + + + + + + + + + + + +
KeyAction
‘1’Zoom-fit. Fits the axes limits to the data.
‘2’Zoom-out.
‘3’Zoom-in.
+ +++ + + + + + +
Parameters:event – Ignored.
Returns:None
+
+ +
+
+on_mouse_move_over_plot(event)
+

Callback for the mouse motion event over the plot. This event is generated +by the Matplotlib backend and has been registered in self.__init__(). +For details, see: http://matplotlib.org/users/event_handling.html

+ +++ + + + + + +
Parameters:event – Contains information about the event.
Returns:None
+
+ +
+
+on_options_app2object(param)
+

Callback for Options->Transfer Options->App=>Object. Copies options +from application defaults to the currently selected object.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_app2project(param)
+

Callback for Options->Transfer Options->App=>Project. Copies options +from application defaults to project defaults.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_combo_change(widget)
+

Called when the combo box to choose between application defaults and +project option changes value. The corresponding variables are +copied to the UI.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called. Ignore.
Returns:None
+
+ +
+
+on_options_object2app(param)
+

Callback for Options->Transfer Options->Object=>App. Copies options +from the currently selected object to application defaults.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_object2project(param)
+

Callback for Options->Transfer Options->Object=>Project. Copies options +from the currently selected object to project defaults.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_project2app(param)
+

Callback for Options->Transfer Options->Project=>App. Copies options +from project defaults to application defaults.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_project2object(param)
+

Callback for Options->Transfer Options->Project=>Object. Copies options +from project defaults to the currently selected object.

+ +++ + + + + + +
Parameters:param – Ignored.
Returns:None
+
+ +
+
+on_options_update(widget)
+

Called whenever a value in the options/defaults form changes. +All values are updated. Can be inhibited by setting self.options_update_ignore = True, +which may be necessary when updating the UI from code and not by the user.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called. Ignore.
Returns:None
+
+ +
+
+on_replot(widget)
+

Callback for toolbar button. Re-plots all objects.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_row_activated(widget, path, col)
+

Callback for selection activation (Enter or double-click) on the Project list. +Switches the notebook page to the object properties form. Calls +self.notebook.set_current_page(1).

+ +++ + + + + + +
Parameters:
    +
  • widget – Ignored.
  • +
  • path – Ignored.
  • +
  • col – Ignored.
  • +
+
Returns:

None

+
+
+ +
+
+on_scale_object(widget)
+

Callback for request to change an objects geometry scale. The object +is re-scaled and replotted.

+ +++ + + + + + +
Parameters:widget – Ignored.
Returns:None
on_tree_selection_changed(selection)

Callback for selection change in the project list. This changes -the currently selected CirkuixObj. -@param selection: Selection associated to the project tree or list -@type selection: Gtk.TreeSelection -@return: None

+the currently selected CirkuixObj.

+ +++ + + + + + +
Parameters:selection (Gtk.TreeSelection) – Selection associated to the project tree or list
Returns:None
on_update_plot(widget)

Callback for button on form for all kinds of objects. -Re-plot the current object only. -@param widget: The widget from which this was called. -@return: None

+Re-plots the current object only.

+ +++ + + + + + +
Parameters:widget – The widget from which this was called.
Returns:None
+
+ +
+
+on_zoom_fit(event)
+

Callback for zoom-out request. This can be either from the corresponding +toolbar button or the ‘1’ key when the canvas is focused. Calls self.adjust_axes() +with axes limits from the geometry bounds of all objects.

+ +++ + + + + + +
Parameters:event – Ignored.
Returns:None
+
+ +
+
+on_zoom_in(event)
+

Callback for zoom-in request. This can be either from the corresponding +toolbar button or the ‘3’ key when the canvas is focused. Calls self.zoom().

+ +++ + + + + + +
Parameters:event – Ignored.
Returns:None
+
+ +
+
+on_zoom_out(event)
+

Callback for zoom-out request. This can be either from the corresponding +toolbar button or the ‘2’ key when the canvas is focused. Calls self.zoom().

+ +++ + + + + + +
Parameters:event – Ignored.
Returns:None
+
+ +
+
+options2form()
+

Sets the ‘Project Options’ or ‘Application Defaults’ form with values from +self.options``or ``self.defaults. +:return : None +:rtype : None

plot_all()
-

Re-generates all plots from all objects. -@return: None

+

Re-generates all plots from all objects.

+ +++ + + + +
Returns:None
+
+ +
+
+read_form()
+

Reads the options form into self.defaults/self.options.

+ +++ + + + + + +
Returns:None
Return type:None
+
+ +
+
+read_form_item(name, dest)
+

Reads the value of a form item in the defaults/options form and +saves it to the corresponding dictionary.

+ +++ + + + + + +
Parameters:
    +
  • name (str) – Name of the form item. A key in self.defaults or +self.options.
  • +
  • dest (dict) – Dictionary to which to save the value.
  • +
+
Returns:

None

+
+
+ +
+
+set_form_item(name, value)
+

Sets a form item ‘name’ in the GUI with the given ‘value’. The syntax of +form names in the GUI is <kind>_app_<name>, where kind is one of: rb (radio button), +cb (check button), entry_eval or entry_text (entry), combo (combo box). name is +whatever name it’s been given. For self.defaults, name is a key in the dictionary.

+ +++ + + + + + +
Parameters:
    +
  • name (str) – Name of the form field.
  • +
  • value (Depends on field kind.) – The value to set the form field to.
  • +
+
Returns:

None

+
@@ -333,9 +1154,38 @@ Re-plot the current object only. set_list_selection(name)

Marks a given object as selected in the list ob objects in the GUI. This selection will in turn trigger -self.on_tree_selection_changed(). -@param name: Name of the object. -@return: None

+self.on_tree_selection_changed().

+ +++ + + + + + +
Parameters:name (str) – Name of the object.
Returns:None
+
+ +
+
+set_progress_bar(percentage, text='')
+

Sets the application’s progress bar to a given fraction and text.

+ +++ + + + + + +
Parameters:
    +
  • percentage (float) – The fraction (0.0-1.0) of the progress.
  • +
  • text (str) – Text to display on the progress bar.
  • +
+
Returns:

+
@@ -343,34 +1193,85 @@ self.on_tree_selection_changed(). setup_component_editor()

Initial configuration of the component editor. Creates a page titled “Selection” on the notebook on the left -side of the main window. -@return: None

+side of the main window.

+ +++ + + + +
Returns:None
-
-setup_component_viewer()
-

Sets up list or Tree where whatever has been loaded or created is -displayed. -@return: None

+
+setup_obj_classes()
+

Sets up application specifics on the CirkuixObj class.

+ +++ + + + +
Returns:None
setup_plot()
-

Sets up the main plotting area by creating a matplotlib +

Sets up the main plotting area by creating a Matplotlib figure in self.canvas, adding axes and configuring them. These axes should not be ploted on and are just there to -display the axes ticks and grid. -@return: None

+display the axes ticks and grid.

+ +++ + + + + + +
Returns:None
Return type:None
+
+ +
+
+setup_project_list()
+

Sets up list or Tree where whatever has been loaded or created is +displayed.

+ +++ + + + +
Returns:None
zoom(factor, center=None)

Zooms the plot by factor around a given -center point. Takes care of re-drawing. -@return: None

+center point. Takes care of re-drawing.

+ +++ + + + + + +
Parameters:
    +
  • factor (float) – Number by which to scale the plot.
  • +
  • center (list) – Coordinates [x, y] of the point around which to scale the plot.
  • +
+
Returns:

None

+
diff --git a/doc/build/objects.inv b/doc/build/objects.inv index 9f7e2e1d..c1eb0d9b 100644 Binary files a/doc/build/objects.inv and b/doc/build/objects.inv differ diff --git a/doc/build/searchindex.js b/doc/build/searchindex.js index 598ff589..5ce68b9d 100644 --- a/doc/build/searchindex.js +++ b/doc/build/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:42,terms:{represent:0,all:0,code:0,cirkuixgerb:0,follow:0,whose:0,get_ev:0,flash:0,gerber:0,buffer_path:0,plot_al:0,digit:0,everi:0,string:0,"5e6cff":0,obround:0,untouch:0,gui:0,list:0,item:0,specal:0,get_radio_valu:0,create_geometri:0,natur:0,dimens:0,zero:0,further:0,click:0,append:0,index:0,neg:0,current:0,delet:0,version:0,"new":0,method:0,can:0,widget:0,cirkuixobj:0,gener:0,onli:0,matplotlib:0,depend:0,becom:0,modifi:0,valu:0,box:0,convert:0,chang:0,on_activate_nam:0,diamet:0,app:0,filenam:0,ymin:0,unit:0,plot:0,from:0,describ:0,chooser:0,setup_component_editor:0,call:0,type:0,more:0,on_delet:0,on_gerber_generate_cutout:0,parse_fil:0,must:0,none:0,work:0,gtext:0,whatev:0,drill:0,z_move:0,overrid:0,polygon2gcod:0,give:0,process:0,stroke:0,xmin:0,serial:0,z_cut:0,alwai:0,surfac:0,fix_region:0,circular:0,parse_lin:0,after:0,befor:0,notebook:0,associ:0,element:0,callback:0,enter:0,travel:0,elin:0,comma:0,on_excellon_tool_choos:0,paramet:0,fix:0,gtk:0,set_list_select:0,window:0,main:[],alter:0,them:0,"float":0,"return":0,thei:0,handl:0,rectangl:0,f0e24d:0,build_list:0,choic:0,name:0,separ:0,solid_geometri:0,each:0,found:0,updat:0,button:0,read_form:0,b5ab3a:0,continu:0,cirkuixcncjob:0,event:0,on_tree_selection_chang:0,on_eval_upd:0,generate_from_excellon_by_tool:0,content:0,geom:0,clear_polygon:0,linear:0,insid:0,loc:0,given:0,base:0,dictionari:0,care:0,generate_from_geometri:0,thread:0,turn:0,plane:0,geometri:0,treeselect:0,onto:0,copper:0,arrai:0,file_chooser_act:0,done:0,overwrit:0,thick:0,open:0,size:0,differ:0,width:0,interact:0,attach:0,option:0,tool:0,specifi:0,get_empty_area:0,generate_from_excellon:0,part:0,pars:0,number:0,kind:0,tree:0,project:0,str:0,build_ui:0,initi:0,ani:0,do_flash:0,have:0,need:0,rout:0,note:0,also:0,build:0,which:0,interior:0,on_success:0,singl:0,buffer:0,object:0,pair:0,alpha:0,segment:0,"class":0,don:0,clear:0,later:0,cover:0,axi:0,thicken:0,show:0,text:[0,1],apertur:0,find:0,new_object:0,slow:0,ratio:0,configur:0,activ:0,should:0,dict:0,factor:0,hit:0,bar:0,xmax:0,contain:0,where:0,dpi:0,set:0,"4650bd":0,result:0,contour:0,statu:0,extend:0,boundari:0,figur:0,attribut:0,accord:0,kei:0,complement:0,isol:0,job:0,entir:0,popul:0,feedrat:0,rtype:0,region:0,instanc:0,whole:0,obj_dict:0,load:0,cncjob:0,point:0,color:0,height:0,path:0,respect:0,convert_unit:0,addition:0,been:0,mark:0,compon:0,json:0,trigger:0,subscrib:0,radio_set:0,gcode:0,search:0,coordin:0,present:0,properti:[],rectangular:0,defin:0,setup_ax:0,margin:0,howev:[],non:0,exterior:0,around:0,format:0,descend:0,complet:0,widget_nam:0,upon:0,user:0,canva:0,typic:[],appropri:0,off:0,center:0,cirkuixexcellon:0,entri:0,knd:[],well:0,without:0,thi:[],on_generate_paintarea:0,self:0,left:0,distanc:0,identifi:0,just:0,isolation_geometri:0,rest:0,shape:0,aspect:0,linestr:0,speed:0,yet:0,cut:0,param:0,add:0,valid:0,board:0,modul:0,pre_pars:0,take:0,applic:0,gcode_pars:0,transpar:0,read:0,grid:0,background:0,bit:[],on_gerber_generate_noncopp:0,specif:0,zoom:0,integ:0,exobj:0,page:0,clear_plot:0,on_generate_isol:0,some:1,back:0,setup_component_view:0,radiobutton:0,"export":0,plot2:0,on_generate_excellon_cncjob:0,scale:0,definit:0,overlap:0,on_update_plot:0,attac:[],flash_geometri:0,cnc:0,machin:0,run:0,plote:0,offset:0,actual:0,file_chooser_save_act:0,on_generate_cncjob:0,side:0,constructor:0,setup_plot:0,within:0,bound:0,excellon:0,pute:0,accordingli:0,ymax:0,area:0,support:0,fast:0,start:0,clear_poli:0,get_curr:0,editor:0,fraction:0,select:0,"function":0,creation:0,form:0,cirkuixgeometri:0,line:0,"true":0,info:0,made:0,"default":0,displai:0,tooldia:0,record:0,buffered_path:0,creat:0,request:[],dure:0,parser:0,aperture_pars:0,repres:0,"char":[],exist:0,file:[],tick:0,polygon:0,titl:0,invalid:0,other:0,gline:0,deseri:0,draw:0,initil:[],eval:0,geometr:0},objtypes:{"0":"py:module","1":"py:method","2":"py:class","3":"py:attribute"},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"],"3":["py","attribute","Python attribute"]},filenames:["index","camlib"],titles:["Welcome to Cirkuix’s documentation!","This is the main file for camlib"],objects:{"":{cirkuix:[0,0,0,"-"]},"cirkuix.Gerber":{digits:[0,3,1,""],aperture_parse:[0,1,1,""],scale:[0,1,1,""],parse_lines:[0,1,1,""],create_geometry:[0,1,1,""],fix_regions:[0,1,1,""],fraction:[0,3,1,""],parse_file:[0,1,1,""],do_flashes:[0,1,1,""]},"cirkuix.CNCjob":{plot:[0,1,1,""],scale:[0,1,1,""],polygon2gcode:[0,1,1,""],generate_from_excellon_by_tool:[0,1,1,""],pre_parse:[0,1,1,""],generate_from_excellon:[0,1,1,""],gcode_parse:[0,1,1,""],generate_from_geometry:[0,1,1,""],plot2:[0,1,1,""]},"cirkuix.App":{setup_plot:[0,1,1,""],file_chooser_action:[0,1,1,""],on_delete:[0,1,1,""],get_current:[0,1,1,""],clear_plots:[0,1,1,""],plot_all:[0,1,1,""],setup_component_viewer:[0,1,1,""],on_generate_isolation:[0,1,1,""],on_gerber_generate_noncopper:[0,1,1,""],new_object:[0,1,1,""],on_activate_name:[0,1,1,""],on_generate_excellon_cncjob:[0,1,1,""],on_update_plot:[0,1,1,""],get_eval:[0,1,1,""],setup_component_editor:[0,1,1,""],on_gerber_generate_cutout:[0,1,1,""],on_eval_update:[0,1,1,""],build_list:[0,1,1,""],info:[0,1,1,""],file_chooser_save_action:[0,1,1,""],on_excellon_tool_choose:[0,1,1,""],on_generate_cncjob:[0,1,1,""],zoom:[0,1,1,""],on_generate_paintarea:[0,1,1,""],get_radio_value:[0,1,1,""],on_tree_selection_changed:[0,1,1,""],set_list_selection:[0,1,1,""]},cirkuix:{CNCjob:[0,2,1,""],CirkuixGeometry:[0,2,1,""],CirkuixExcellon:[0,2,1,""],Geometry:[0,2,1,""],CirkuixGerber:[0,2,1,""],App:[0,2,1,""],Gerber:[0,2,1,""],CirkuixObj:[0,2,1,""],CirkuixCNCjob:[0,2,1,""],Excellon:[0,2,1,""]},"cirkuix.Excellon":{parse_lines:[0,1,1,""],scale:[0,1,1,""]},"cirkuix.Geometry":{convert_units:[0,1,1,""],scale:[0,1,1,""],bounds:[0,1,1,""],get_empty_area:[0,1,1,""],isolation_geometry:[0,1,1,""],clear_polygon:[0,1,1,""],size:[0,1,1,""]},"cirkuix.CirkuixObj":{read_form:[0,1,1,""],plot:[0,1,1,""],deserialize:[0,1,1,""],build_ui:[0,1,1,""],serialize:[0,1,1,""],setup_axes:[0,1,1,""]}},titleterms:{document:0,welcom:0,thi:1,indic:0,cirkuix:0,camlib:1,file:1,tabl:0,main:1}}) \ No newline at end of file +Search.setIndex({envversion:42,terms:{represent:0,all:0,code:0,replot:0,focus:0,cirkuixgerb:0,follow:0,on_key_over_plot:0,whose:0,get_ev:0,on_options_upd:0,flash:0,gerber:0,flash_geometri:0,text:[0,1],plot_al:0,set_current_pag:0,digit:0,everi:0,string:0,far:0,mous:0,"5e6cff":0,obround:0,untouch:0,gui:0,list:0,item:0,adjust:0,specal:0,get_radio_valu:0,create_geometri:0,natur:0,dimens:0,zero:0,pass:0,further:0,click:0,append:0,index:0,neg:0,current:0,delet:0,version:0,"new":0,method:0,whatev:0,widget:0,cirkuixobj:0,gener:0,new_object:0,matplotlib:0,adjust_ax:0,path:0,becom:0,modifi:0,valu:0,box:0,convert:0,action:0,chang:0,on_activate_nam:0,on_options_object2app:0,diamet:0,app:0,on_fileopengerb:0,filenam:0,ymin:0,unit:0,plot:0,from:0,describ:0,doubl:0,chooser:0,setup_component_editor:0,call:0,type:0,more:0,on_delet:0,factor:0,on_gerber_generate_cutout:0,parse_fil:0,must:0,none:0,work:0,gtext:0,can:0,drill:0,z_move:0,overrid:0,polygon2gcod:0,give:0,process:0,share:0,stroke:0,minimum:0,xmin:0,serial:0,z_cut:0,alwai:0,surfac:0,fix_region:0,updat:0,b5ab3a:0,resourc:0,after:0,befor:0,plane:0,mai:0,setup_obj_class:0,data:0,onto:0,correspond:0,element:0,inform:0,"switch":0,maintain:0,enter:0,on_replot:0,travel:0,elin:0,comma:0,keyboard:0,on_excellon_tool_choos:0,paramet:0,fit:0,chosen:0,fix:0,gtk:0,set_list_select:0,window:0,on_options_app2object:0,main:[],alter:0,non:0,within:0,"return":0,thei:0,handl:0,rectangl:0,f0e24d:0,build_list:0,choic:0,name:0,separ:0,solid_geometri:0,each:0,found:0,circular:0,button:0,read_form:0,parse_lin:0,on_closewindow:0,continu:0,cirkuixcncjob:0,event:0,out:0,on_tree_selection_chang:0,on_eval_upd:0,generate_from_excellon_by_tool:0,content:0,geom:0,clear_polygon:0,linear:0,insid:0,precaut:0,given:0,base:0,dictionari:0,org:0,care:0,generate_from_geometri:0,thread:0,motion:0,turn:0,notebook:0,geometri:0,treeselect:0,entry_text:0,user:0,origin:0,copper:0,on_zoom_in:0,arrai:0,file_chooser_act:0,restrict:0,done:0,fast:0,thick:0,open:0,size:0,differ:0,start:0,associ:0,interact:0,attach:0,option:0,tool:0,copi:0,specifi:0,get_empty_area:0,generate_from_excellon:0,part:0,pars:0,number:0,kind:0,whenev:0,tree:0,entry_ev:0,project:0,str:0,entri:0,ani:0,do_flash:0,have:0,need:0,callback:0,rout:0,note:0,also:0,on_options_object2project:0,build:0,which:0,event_handl:0,interior:0,on_success:0,singl:0,buffer:0,object:0,pair:0,alpha:0,segment:0,"class":0,don:0,clear:0,later:0,cover:0,on_mouse_move_over_plot:0,axi:0,thicken:0,show:0,on_click_over_plot:0,apertur:0,syntax:0,radio:0,find:0,on_scale_object:0,load_default:0,slow:0,ratio:0,menu:0,configur:0,activ:0,state:0,should:0,dict:0,combo:0,over:0,on_options_combo_chang:0,hit:0,get:0,made:0,bar:0,xmax:0,contain:0,where:0,dpi:0,set:0,startup:0,on_cncjob_exportgcod:0,displai:0,"4650bd":0,see:0,result:0,close:0,contour:0,statu:0,kei:0,boundari:0,figur:0,between:0,progress:0,attribut:0,accord:0,extend:0,complement:0,isol:0,job:0,entir:0,here:0,popul:0,feedrat:0,rtype:0,region:0,setup_project_list:0,instanc:0,whole:0,col:0,obj_dict:0,load:0,cncjob:0,point:0,color:0,height:0,param:0,respect:0,throughout:0,backend:0,quit:0,creat:0,addition:0,been:0,mark:0,compon:0,json:0,trigger:0,toolbar:0,subscrib:0,immedi:0,radio_set:0,gcode:0,search:0,on_file_savedefault:0,coordin:0,on_options_project2object:0,func:0,present:0,inhibit:0,therefor:0,properti:0,rectangular:0,defin:0,"while":0,setup_ax:0,margin:0,howev:[],them:0,exterior:0,on_fileopengcod:0,"__init__":0,gcode_pars:0,transpar:0,same:0,read:0,html:0,descend:0,complet:0,http:0,widget_nam:0,upon:0,pute:0,initi:0,canva:0,typic:[],appropri:0,off:0,center:0,cirkuixexcellon:0,build_ui:0,knd:[],well:0,"_app_":0,without:0,on_file_new:0,thi:[],choos:0,on_generate_paintarea:0,self:0,left:0,distanc:0,identifi:0,just:0,isolation_geometri:0,"true":0,rest:0,shape:0,aspect:0,linestr:0,speed:0,yet:0,cut:0,shortcut:0,add:0,other:0,board:0,save:0,modul:0,pre_pars:0,take:0,applic:0,around:0,format:0,dest:0,grid:0,background:0,press:0,bit:[],on_gerber_generate_noncopp:0,specif:0,zoom:0,integ:0,necessari:0,either:0,exobj:0,on_clear_plot:0,page:0,depend:0,clear_plot:0,on_generate_isol:0,some:1,back:0,percentag:0,on_zoom_fit:0,setup_component_view:[],radiobutton:0,"export":0,plot2:0,on_generate_excellon_cncjob:0,scale:0,definit:0,overlap:0,on_update_plot:0,attac:[],buffer_path:0,cnc:0,onli:0,machin:0,run:0,plote:0,offset:0,about:0,actual:0,file_chooser_save_act:0,options2form:0,on_generate_cncjob:0,side:0,constructor:0,options_update_ignor:0,on_fileopenexcellon:0,setup_plot:0,regist:0,"float":0,bound:0,excellon:0,loc:0,accordingli:0,ymax:0,area:0,transfer:0,support:0,overwrit:0,width:0,clear_poli:0,get_curr:0,editor:0,fraction:0,on_canvas_configur:0,select:0,"function":0,creation:0,form:0,on_zoom_out:0,cirkuixgeometri:0,set_progress_bar:0,line:0,on_entry_eval_activ:0,info:0,on_options_app2project:0,on_generate_gerber_bounding_box:0,"default":0,access:0,maximum:0,tooldia:0,record:0,limit:0,buffered_path:0,convert_unit:0,request:0,dure:0,parser:0,aperture_pars:0,repres:0,"char":[],set_form_item:0,on_row_activ:0,exist:0,file:[],check:0,tick:0,aplic:0,polygon:0,titl:0,when:0,detail:0,invalid:0,field:0,valid:0,gline:0,geometr:0,on_options_project2app:0,read_form_item:0,deseri:0,variabl:0,draw:0,initil:[],eval:0,ignor:0,on_filequit:0},objtypes:{"0":"py:module","1":"py:method","2":"py:class","3":"py:attribute"},objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","class","Python class"],"3":["py","attribute","Python attribute"]},filenames:["index","camlib"],titles:["Welcome to Cirkuix’s documentation!","This is the main file for camlib"],objects:{"":{cirkuix:[0,0,0,"-"]},"cirkuix.Gerber":{digits:[0,3,1,""],parse_lines:[0,1,1,""],scale:[0,1,1,""],aperture_parse:[0,1,1,""],create_geometry:[0,1,1,""],fix_regions:[0,1,1,""],fraction:[0,3,1,""],parse_file:[0,1,1,""],do_flashes:[0,1,1,""]},"cirkuix.CNCjob":{plot:[0,1,1,""],gcode_parse:[0,1,1,""],polygon2gcode:[0,1,1,""],generate_from_excellon_by_tool:[0,1,1,""],pre_parse:[0,1,1,""],generate_from_excellon:[0,1,1,""],scale:[0,1,1,""],generate_from_geometry:[0,1,1,""],plot2:[0,1,1,""]},"cirkuix.App":{on_options_object2app:[0,1,1,""],setup_plot:[0,1,1,""],file_chooser_action:[0,1,1,""],on_canvas_configure:[0,1,1,""],on_zoom_in:[0,1,1,""],on_delete:[0,1,1,""],on_closewindow:[0,1,1,""],get_current:[0,1,1,""],on_row_activated:[0,1,1,""],on_fileopengerber:[0,1,1,""],on_zoom_fit:[0,1,1,""],adjust_axes:[0,1,1,""],clear_plots:[0,1,1,""],set_form_item:[0,1,1,""],on_generate_excellon_cncjob:[0,1,1,""],read_form:[0,1,1,""],on_generate_isolation:[0,1,1,""],on_key_over_plot:[0,1,1,""],on_options_project2app:[0,1,1,""],on_gerber_generate_noncopper:[0,1,1,""],on_scale_object:[0,1,1,""],new_object:[0,1,1,""],on_activate_name:[0,1,1,""],on_options_update:[0,1,1,""],on_update_plot:[0,1,1,""],get_eval:[0,1,1,""],on_options_object2project:[0,1,1,""],setup_component_editor:[0,1,1,""],on_click_over_plot:[0,1,1,""],on_zoom_out:[0,1,1,""],load_defaults:[0,1,1,""],on_options_app2object:[0,1,1,""],read_form_item:[0,1,1,""],on_clear_plots:[0,1,1,""],on_entry_eval_activate:[0,1,1,""],on_options_combo_change:[0,1,1,""],on_generate_paintarea:[0,1,1,""],setup_project_list:[0,1,1,""],on_gerber_generate_cutout:[0,1,1,""],on_options_project2object:[0,1,1,""],on_eval_update:[0,1,1,""],get_radio_value:[0,1,1,""],build_list:[0,1,1,""],set_progress_bar:[0,1,1,""],info:[0,1,1,""],on_options_app2project:[0,1,1,""],plot_all:[0,1,1,""],file_chooser_save_action:[0,1,1,""],options2form:[0,1,1,""],on_generate_cncjob:[0,1,1,""],zoom:[0,1,1,""],on_file_savedefaults:[0,1,1,""],on_mouse_move_over_plot:[0,1,1,""],on_fileopengcode:[0,1,1,""],on_generate_gerber_bounding_box:[0,1,1,""],on_file_new:[0,1,1,""],setup_obj_classes:[0,1,1,""],on_tree_selection_changed:[0,1,1,""],on_replot:[0,1,1,""],on_filequit:[0,1,1,""],on_cncjob_exportgcode:[0,1,1,""],on_excellon_tool_choose:[0,1,1,""],set_list_selection:[0,1,1,""],on_fileopenexcellon:[0,1,1,""]},cirkuix:{CNCjob:[0,2,1,""],CirkuixGeometry:[0,2,1,""],CirkuixExcellon:[0,2,1,""],Geometry:[0,2,1,""],CirkuixGerber:[0,2,1,""],App:[0,2,1,""],Gerber:[0,2,1,""],CirkuixObj:[0,2,1,""],CirkuixCNCjob:[0,2,1,""],Excellon:[0,2,1,""]},"cirkuix.Excellon":{parse_lines:[0,1,1,""],scale:[0,1,1,""]},"cirkuix.Geometry":{convert_units:[0,1,1,""],scale:[0,1,1,""],bounds:[0,1,1,""],get_empty_area:[0,1,1,""],isolation_geometry:[0,1,1,""],clear_polygon:[0,1,1,""],size:[0,1,1,""]},"cirkuix.CirkuixObj":{read_form:[0,1,1,""],plot:[0,1,1,""],deserialize:[0,1,1,""],build_ui:[0,1,1,""],serialize:[0,1,1,""],setup_axes:[0,1,1,""]}},titleterms:{file:1,main:1,welcom:0,indic:0,cirkuix:0,camlib:1,thi:1,tabl:0,document:0}}) \ No newline at end of file