| 1 | # -*- coding: ascii -*- |
| 2 | # $Id$ |
| 3 | # |
| 4 | # Author: [email protected] |
| 5 | # Date: 18-Jun-2015 |
| 6 | |
| 7 | from __future__scip-python python python-stdlib 3.11 __future__/__init__: import absolute_importscip-python python python-stdlib 3.11 __future__/absolute_import.absolute_import. |
| 8 | from __future__scip-python python python-stdlib 3.11 __future__/__init__: import print_functionscip-python python python-stdlib 3.11 __future__/print_function.print_function. |
| 9 | __author__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/__author__. = "Vasilis Vlachoudis" |
| 10 | __email__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/__email__. = "[email protected]" |
| 11 | |
| 12 | try: |
| 13 | from Tkinterscip-python python bCNC 0.9.14.318 Tkinter/__init__: import * |
| 14 | except ImportErrorscip-python python python-stdlib 3.11 builtins/ImportError#: |
| 15 | from tkinterscip-python python python-stdlib 3.11 tkinter/__init__: import * |
| 16 | |
| 17 | import Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__: |
| 18 | import tkExtra |
| 19 | |
| 20 | |
| 21 | #=============================================================================== |
| 22 | # Link to main app |
| 23 | #=============================================================================== |
| 24 | class _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#: |
| 25 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(app)): |
| 26 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#app. = appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(app) |
| 27 | |
| 28 | #---------------------------------------------------------------------- |
| 29 | # Add a widget in the widgets list to enable disable during the run |
| 30 | #---------------------------------------------------------------------- |
| 31 | def addWidgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#addWidget().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#addWidget().(self), widgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#addWidget().(widget)): |
| 32 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#addWidget().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#app..widgets.append(widgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#addWidget().(widget)) |
| 33 | |
| 34 | #---------------------------------------------------------------------- |
| 35 | # Send a command to Grbl |
| 36 | #---------------------------------------------------------------------- |
| 37 | def sendGCodescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#sendGCode().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#sendGCode().(self), cmdscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#sendGCode().(cmd)): |
| 38 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#sendGCode().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#app..sendGCode(cmdscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#sendGCode().(cmd)) |
| 39 | |
| 40 | #---------------------------------------------------------------------- |
| 41 | # Accept the user key if not editing any text |
| 42 | #---------------------------------------------------------------------- |
| 43 | def acceptKeyscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#acceptKey().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#acceptKey().(self), skipRunscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#acceptKey().(skipRun)=False): |
| 44 | return selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#acceptKey().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#app..acceptKey(skipRunscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#acceptKey().(skipRun)) |
| 45 | |
| 46 | #---------------------------------------------------------------------- |
| 47 | def saveConfigscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#saveConfig().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#saveConfig().(self)): |
| 48 | pass |
| 49 | |
| 50 | #---------------------------------------------------------------------- |
| 51 | def loadConfigscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#loadConfig().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#loadConfig().(self)): |
| 52 | pass |
| 53 | |
| 54 | |
| 55 | #=============================================================================== |
| 56 | # Button Group, a group of widgets that will be placed in the ribbon |
| 57 | #=============================================================================== |
| 58 | class ButtonGroupscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#(Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.LabelGroupscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/LabelGroup#, _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#): |
| 59 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(name), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(app)): |
| 60 | Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.LabelGroupscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/LabelGroup#.__init__scip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/LabelGroup#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(name)) |
| 61 | _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#.__init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(app)) |
| 62 | if ":" in namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(name): |
| 63 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(self).labelscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/LabelGroup#label.["text"] = namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonGroup#__init__().(name).split(":")[1] |
| 64 | |
| 65 | |
| 66 | #=============================================================================== |
| 67 | # Button Group, a group of widgets that will be placed in the ribbon |
| 68 | #=============================================================================== |
| 69 | class ButtonMenuGroupscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#(Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.MenuGroupscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/MenuGroup#, _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#): |
| 70 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(name), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(app), menulistscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(menulist)=None): |
| 71 | Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.MenuGroupscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/MenuGroup#.__init__scip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/MenuGroup#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(name), menulistscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(menulist)) |
| 72 | _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#.__init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/ButtonMenuGroup#__init__().(app)) |
| 73 | |
| 74 | |
| 75 | #=============================================================================== |
| 76 | # Page, Frame |
| 77 | #=============================================================================== |
| 78 | class PageFramescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#(Framescip-python python python-stdlib 3.11 tkinter/__init__:, _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#): |
| 79 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(name), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(app)): |
| 80 | Framescip-python python python-stdlib 3.11 tkinter/__init__:.__init__scip-python python python-stdlib 3.11 tkinter/Frame#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(master)) |
| 81 | _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#.__init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(app)) |
| 82 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(self).namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#name. = namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageFrame#__init__().(name) |
| 83 | |
| 84 | |
| 85 | #=============================================================================== |
| 86 | # Page, LabelFrame |
| 87 | #=============================================================================== |
| 88 | class PageLabelFramescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#(LabelFramescip-python python python-stdlib 3.11 tkinter/__init__:, _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#): |
| 89 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(name), name_alias_lngscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(name_alias_lng), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(app)): |
| 90 | LabelFramescip-python python python-stdlib 3.11 tkinter/__init__:.__init__scip-python python python-stdlib 3.11 tkinter/LabelFrame#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(master), textscip-python python python-stdlib 3.11 tkinter/LabelFrame#__init__().(text)=name_alias_lngscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(name_alias_lng), foregroundscip-python python python-stdlib 3.11 tkinter/LabelFrame#__init__().(foreground)="DarkBlue") |
| 91 | _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#.__init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(app)) |
| 92 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(self).namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#name. = namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageLabelFrame#__init__().(name) |
| 93 | |
| 94 | |
| 95 | #=============================================================================== |
| 96 | # Page, ExLabelFrame |
| 97 | #=============================================================================== |
| 98 | class PageExLabelFramescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#(tkExtra.ExLabelFrame, _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#): |
| 99 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(master), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(name), name_alias_lngscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(name_alias_lng), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(app)): |
| 100 | tkExtra.ExLabelFrame.__init__(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(master), text=name_alias_lngscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(name_alias_lng), foreground="DarkBlue") |
| 101 | _LinkAppscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#.__init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/_LinkApp#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(self), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(app)) |
| 102 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(self).namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#name. = namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/PageExLabelFrame#__init__().(name) |
| 103 | |
| 104 | |
| 105 | #=============================================================================== |
| 106 | # CNC Page interface between the basic Page class and the bCNC class |
| 107 | #=============================================================================== |
| 108 | class Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#(Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.Pagescip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#): |
| 109 | groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#groups. = {} |
| 110 | framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames. = {} |
| 111 | |
| 112 | def __init__scip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(master), appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(app), **kwscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(kw)): |
| 113 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#app. = appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(app) |
| 114 | Ribbonscip-python python bCNC 0.9.14.318 Ribbon/__init__:.Pagescip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#.__init__scip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#__init__().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(self), masterscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(master), **kwscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(kw)) |
| 115 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#__init__().(self).registerscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#register().() |
| 116 | |
| 117 | #---------------------------------------------------------------------- |
| 118 | # Should be overridden with the groups and frames to register |
| 119 | #---------------------------------------------------------------------- |
| 120 | def registerscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#register().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#register().(self)): |
| 121 | pass |
| 122 | |
| 123 | #---------------------------------------------------------------------- |
| 124 | # Register groups |
| 125 | #---------------------------------------------------------------------- |
| 126 | def _registerscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(self), groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(groups), framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(frames)): |
| 127 | if groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(groups): |
| 128 | for g in groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(groups): |
| 129 | w = g(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(self).masterscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#master.._ribbonFrame, selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#app.) |
| 130 | Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#groups.[w.name] = w |
| 131 | |
| 132 | if framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(frames): |
| 133 | for f in framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(frames): |
| 134 | w = f(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(self).masterscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#master.._pageFrame, selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#_register().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#app.) |
| 135 | Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames.[w.name] = w |
| 136 | |
| 137 | #---------------------------------------------------------------------- |
| 138 | # Add a widget in the widgets list to enable disable during the run |
| 139 | #---------------------------------------------------------------------- |
| 140 | def addWidgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addWidget().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addWidget().(self), widgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addWidget().(widget)): |
| 141 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addWidget().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#app..widgets.append(widgetscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addWidget().(widget)) |
| 142 | |
| 143 | #---------------------------------------------------------------------- |
| 144 | # Send a command to Grbl |
| 145 | #---------------------------------------------------------------------- |
| 146 | def sendGCodescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#sendGCode().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#sendGCode().(self), cmdscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#sendGCode().(cmd)): |
| 147 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#sendGCode().(self).appscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#app..sendGCode(cmdscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#sendGCode().(cmd)) |
| 148 | |
| 149 | #---------------------------------------------------------------------- |
| 150 | def addRibbonGroupscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(self), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(name), **argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(args)): |
| 151 | if not argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(args): argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(args) = {"side":LEFTscip-python python python-stdlib 3.11 tkinter/__init__:, "fill":BOTHscip-python python python-stdlib 3.11 tkinter/__init__:} |
| 152 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(self).ribbonsscip-python python bCNC 0.9.14.318 `bCNC.Ribbon`/Page#ribbons..appendscip-python python python-stdlib 3.11 builtins/list#append().((Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.groupsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#groups.[namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(name)], argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addRibbonGroup().(args))) |
| 153 | |
| 154 | #---------------------------------------------------------------------- |
| 155 | def addPageFramescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(self), namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(name), **argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(args)): |
| 156 | if not argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(args): argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(args) = {"side":TOPscip-python python python-stdlib 3.11 tkinter/__init__:, "fill":BOTHscip-python python python-stdlib 3.11 tkinter/__init__:} |
| 157 | if isinstance(namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(name),strscip-python python python-stdlib 3.11 builtins/str#): |
| 158 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(self).framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames..append((Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames.[namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(name)], argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(args))) |
| 159 | else: |
| 160 | selfscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(self).framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames..append((namescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(name), argsscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#addPageFrame().(args))) |
| 161 | |
| 162 | #---------------------------------------------------------------------- |
| 163 | @staticmethodscip-python python python-stdlib 3.11 builtins/staticmethod# |
| 164 | def saveConfigscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#saveConfig().(): |
| 165 | for frame in Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames..valuesscip-python python python-stdlib 3.11 builtins/dict#values().(): |
| 166 | frame.saveConfig() |
| 167 | |
| 168 | #---------------------------------------------------------------------- |
| 169 | @staticmethodscip-python python python-stdlib 3.11 builtins/staticmethod# |
| 170 | def loadConfigscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#loadConfig().(): |
| 171 | for frame in Pagescip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#.framesscip-python python bCNC 0.9.14.318 `bCNC.CNCRibbon`/Page#frames..valuesscip-python python python-stdlib 3.11 builtins/dict#values().(): |
| 172 | frame.loadConfig() |