Skip to content

Commit 0119808

Browse files
authored
Merge pull request #8 from sparkfun/release_candidate
Version 1.2.0
2 parents c6d226f + 5964e87 commit 0119808

File tree

2 files changed

+49
-49
lines changed

2 files changed

+49
-49
lines changed

SparkFunKiCadCAMmer/plugin.py

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self):
2727

2828
self._pcbnew_frame = None
2929

30-
self.supportedVersions = ['7.','8.']
30+
self.supportedVersions = ['7.','8.','9.']
3131

3232
self.kicad_build_version = pcbnew.GetBuildVersion()
3333

@@ -91,56 +91,56 @@ def Run(self):
9191
def run_cammer(dlg, p_cammer):
9292
self.logger.log(logging.INFO, "Running CAMmer")
9393

94-
if self.IsSupported():
95-
command = []
96-
97-
layers = dlg.CurrentSettings()["Layers"]
98-
layersCommand = ""
99-
for layer,include in layers.items():
100-
if include == 'true': # JSON format
101-
if layersCommand == "":
102-
layersCommand = layer
103-
else:
104-
layersCommand = layersCommand + "," + layer
105-
106-
if layersCommand != "":
107-
command.extend(['-l', layersCommand])
108-
109-
edges = dlg.CurrentSettings()["Edges"]
110-
edgesCommand = ""
111-
for edge,include in edges.items():
112-
if include == 'true': # JSON format
113-
if edgesCommand == "":
114-
edgesCommand = edge
115-
else:
116-
edgesCommand = edgesCommand + "," + edge
117-
118-
if edgesCommand != "":
119-
command.extend(['-e', edgesCommand])
120-
121-
self.logger.log(logging.INFO, command)
122-
123-
board = pcbnew.GetBoard()
124-
125-
if board is not None:
126-
sysExit, report = p_cammer.startCAMmerCommand(command, board, self.logger)
127-
logWarn = logging.INFO
128-
if sysExit >= 1:
129-
logWarn = logging.WARN
130-
if sysExit >= 2:
131-
logWarn = logging.ERROR
132-
self.logger.log(logWarn, report)
133-
if sysExit > 0:
134-
wx.MessageBox("CAMmer " + ("warning" if (sysExit == 1) else "error") + ".\nPlease check cammer.log for details.",
135-
("Warning" if (sysExit == 1) else "Error"), wx.OK | (wx.ICON_WARNING if (sysExit == 1) else wx.ICON_ERROR))
94+
if not self.IsSupported():
95+
# Log a warning if this version of KiCad has not been tested
96+
self.logger.log(logging.WARNING, "Version check failed. \"{}\" may not be supported. CAMming may fail".format(self.kicad_build_version))
97+
98+
command = []
99+
100+
layers = dlg.CurrentSettings()["Layers"]
101+
layersCommand = ""
102+
for layer,include in layers.items():
103+
if include == 'true': # JSON format
104+
if layersCommand == "":
105+
layersCommand = layer
136106
else:
137-
wx.MessageBox("CAMmer complete.\nPlease check cammer.log for details.",
138-
"Info", wx.OK | wx.ICON_INFORMATION)
139-
else:
140-
self.logger.log(logging.ERROR, "Could not get the board")
107+
layersCommand = layersCommand + "," + layer
141108

109+
if layersCommand != "":
110+
command.extend(['-l', layersCommand])
111+
112+
edges = dlg.CurrentSettings()["Edges"]
113+
edgesCommand = ""
114+
for edge,include in edges.items():
115+
if include == 'true': # JSON format
116+
if edgesCommand == "":
117+
edgesCommand = edge
118+
else:
119+
edgesCommand = edgesCommand + "," + edge
120+
121+
if edgesCommand != "":
122+
command.extend(['-e', edgesCommand])
123+
124+
self.logger.log(logging.INFO, command)
125+
126+
board = pcbnew.GetBoard()
127+
128+
if board is not None:
129+
sysExit, report = p_cammer.startCAMmerCommand(command, board, self.logger)
130+
logWarn = logging.INFO
131+
if sysExit >= 1:
132+
logWarn = logging.WARNING
133+
if sysExit >= 2:
134+
logWarn = logging.ERROR
135+
self.logger.log(logWarn, report)
136+
if sysExit > 0:
137+
wx.MessageBox("CAMmer " + ("warning" if (sysExit == 1) else "error") + ".\nPlease check cammer.log for details.",
138+
("Warning" if (sysExit == 1) else "Error"), wx.OK | (wx.ICON_WARNING if (sysExit == 1) else wx.ICON_ERROR))
139+
else:
140+
wx.MessageBox("CAMmer complete.\nPlease check cammer.log for details.",
141+
"Info", wx.OK | wx.ICON_INFORMATION)
142142
else:
143-
self.logger.log(logging.ERROR, "Version check failed. \"{}\" not supported".format(self.kicad_build_version))
143+
self.logger.log(logging.ERROR, "Could not get the board")
144144

145145
dlg.EndModal(wx.ID_OK)
146146

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.2"
1+
__version__ = "1.2.0"

0 commit comments

Comments
 (0)