clean up output generation plugin
This commit is contained in:
parent
1a35690b3f
commit
d2ea4eba1a
|
@ -1,16 +0,0 @@
|
|||
import pcbnew
|
||||
|
||||
__all__ = ["AsyOutputs"]
|
||||
|
||||
class AsyOutputs(pcbnew.ActionPlugin):
|
||||
def defaults(self):
|
||||
self.name = "Generate Assembly Outputs"
|
||||
self.category = "Output Generation"
|
||||
self.description = "Generate CSV BOM, Drawings, and add to pdf"
|
||||
|
||||
self.pcbnew_icon_support = hasattr(self, "show_toolbar_button")
|
||||
self.show_toolbar_button = True
|
||||
|
||||
def Run(self):
|
||||
# The entry function of the plugin that is executed on user action
|
||||
print("Hello World - AsyOutputs")
|
|
@ -13,8 +13,8 @@ class FabOutputs(pcbnew.ActionPlugin):
|
|||
self.category = "Output Generation"
|
||||
self.description = "Generate Gerbers, BOM, Drawings, etc and add to pdf/zip"
|
||||
|
||||
self.pcbnew_icon_support = hasattr(self, "show_toolbar_button")
|
||||
self.show_toolbar_button = True
|
||||
self.icon_file_name = os.path.join(os.path.dirname(__file__), "icon.png")
|
||||
|
||||
def Run(self):
|
||||
# ================
|
||||
|
@ -84,38 +84,45 @@ class FabOutputs(pcbnew.ActionPlugin):
|
|||
"soldermask defined": None, # TODO: how do I want to determine this?
|
||||
}
|
||||
|
||||
dir_fab.mkdir(parents=True, exist_ok=True)
|
||||
dir_asy.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
files_fab = []
|
||||
files_asy = []
|
||||
|
||||
# ================
|
||||
# Gerbers
|
||||
# ================
|
||||
#### SETTINGS
|
||||
tent_vias = True
|
||||
trim_silkscreen = False
|
||||
|
||||
plot_controller = pcbnew.PLOT_CONTROLLER(pcb)
|
||||
plot_options = plot_controller.GetPlotOptions()
|
||||
|
||||
# Set General Options:
|
||||
# plot_options.Format()
|
||||
plot_options.SetOutputDirectory(dir_fab)
|
||||
plot_options.SetPlotFrameRef(False)
|
||||
plot_options.SetPlotValue(False)
|
||||
plot_options.SetPlotReference(True)
|
||||
plot_options.SetPlotInvisibleText(False)
|
||||
plot_options.SetPlotViaOnMaskLayer(False)
|
||||
plot_options.SetPlotViaOnMaskLayer(not tent_vias)
|
||||
plot_options.SetExcludeEdgeLayer(True)
|
||||
plot_options.SetUseAuxOrigin(False)
|
||||
plot_options.SetMirror(False)
|
||||
plot_options.SetNegative(False)
|
||||
#plot_options.SetDrillMarksType(PLOT_DRILL_MARKS_TYPE)
|
||||
#plot_options.SetScale(PLOT_SCALE)
|
||||
plot_options.SetAutoScale(True)
|
||||
plot_options.SetScale(1)
|
||||
# plot_options.SetAutoScale(True)
|
||||
#plot_options.SetPlotMode(PLOT_MODE)
|
||||
#plot_options.SetLineWidth(pcbnew.FromMM(PLOT_LINE_WIDTH))
|
||||
plot_options.SetUseGerberAttributes(True)
|
||||
plot_options.SetUseGerberProtelExtensions(False)
|
||||
plot_options.SetCreateGerberJobFile(False)
|
||||
plot_options.SetSubtractMaskFromSilk(True)
|
||||
plot_options.SetIncludeGerberNetlistInfo(False)
|
||||
|
||||
plot_options.SetUseGerberX2format(True)
|
||||
# plot_options.SetDrillMarksType()
|
||||
plot_options.SetSubtractMaskFromSilk(trim_silkscreen)
|
||||
|
||||
plot_plan = [
|
||||
# ( layer ID, file extension, description)
|
||||
|
@ -169,32 +176,39 @@ class FabOutputs(pcbnew.ActionPlugin):
|
|||
files_fab.append(fname)
|
||||
|
||||
# ================
|
||||
# Pick and Place
|
||||
# ================s
|
||||
|
||||
# Drawing
|
||||
# ================
|
||||
# TODO
|
||||
|
||||
# ================
|
||||
# Fab Drawing
|
||||
# BOM
|
||||
# ================
|
||||
|
||||
fname = f"README_FABRICATION{suffix}.TXT"
|
||||
with open(dir_fab / fname, "w") as f:
|
||||
f.write(f"{project_name}-REV{rev}\n")
|
||||
f.write(f"Layer Order\n")
|
||||
# for layer in plot_plan:
|
||||
|
||||
files_fab.append(fname)
|
||||
# TODO
|
||||
|
||||
# ================
|
||||
# Assembly Drawing
|
||||
# Pick and Place
|
||||
# ================
|
||||
# TODO
|
||||
|
||||
# ================
|
||||
# Fab Notes
|
||||
# ================
|
||||
|
||||
with open(dir_asy / f"README_ASSEMBLY{suffix}.TXT", "w") as f:
|
||||
f.write(f"{project_name}-REV{rev}\n")
|
||||
# fname = f"README_FABRICATION{suffix}.TXT"
|
||||
# with open(dir_fab / fname, "w") as f:
|
||||
# f.write(f"{project_name}-REV{rev}\n")
|
||||
# f.write(f"Layer Order\n")
|
||||
# # for layer in plot_plan:
|
||||
# files_fab.append(fname)
|
||||
|
||||
files_asy.append(fname)
|
||||
# ================
|
||||
# Assembly Notes
|
||||
# ================
|
||||
|
||||
# fname = f"README_ASSEMBLY{suffix}.TXT"
|
||||
# with open(dir_asy / fname, "w") as f:
|
||||
# f.write(f"{project_name}-REV{rev}\n")
|
||||
# files_asy.append(fname)
|
||||
|
||||
# ================
|
||||
# Zip
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
from .FabOutputs import FabOutputs
|
||||
from .AsyOutputs import AsyOutputs
|
||||
|
||||
FabOutputs().register() # Instantiate and register to Pcbnew
|
||||
AsyOutputs().register() # Instantiate and register to Pcbnew
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
scripting/plugins/OutputGeneration/icon.jpeg
Normal file
BIN
scripting/plugins/OutputGeneration/icon.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
scripting/plugins/OutputGeneration/icon.png
Normal file
BIN
scripting/plugins/OutputGeneration/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -1,17 +0,0 @@
|
|||
import pcbnew
|
||||
import os
|
||||
|
||||
class TestPlugin(pcbnew.ActionPlugin):
|
||||
def defaults(self):
|
||||
self.name = "TestPlugin"
|
||||
self.category = "A descriptive category name"
|
||||
self.description = "A description of the plugin and what it does"
|
||||
|
||||
# self.pcbnew_icon_support = hasattr(self, "show_toolbar_button")
|
||||
# self.show_toolbar_button = True
|
||||
# icon_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
# self.icon_file_name = os.path.join(icon_dir, 'icon.png')
|
||||
|
||||
def Run(self):
|
||||
# The entry function of the plugin that is executed on user action
|
||||
print("Hello World - testplugin")
|
|
@ -1,3 +0,0 @@
|
|||
from .TestPlugin_action import TestPlugin
|
||||
plugin = TestPlugin()
|
||||
plugin.register()
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 761 B |
|
@ -1 +0,0 @@
|
|||
from .TestPlugin import plugin
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user