diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06703cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,51 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files, back +*.cab +*.msi +*.msm +*.msp +*.bak + +# Windows shortcuts +*.lnk + +# Python executable +*.pyc + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/FabricationPositions/PositionsDlg.fbp b/FabricationPositions/PositionsDlg.fbp new file mode 100644 index 0000000..ebc96d7 --- /dev/null +++ b/FabricationPositions/PositionsDlg.fbp @@ -0,0 +1,495 @@ + + + + + + Python + 1 + source_name + 0 + 0 + res + UTF-8 + connect + PositionsDlg + 1000 + none + + 0 + PositionsDlg + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + PositionsDlg + + 499,296 + wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Generating Fab Positions + + + + + + + bSizer3 + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Generating Modules Fab Positions + 0 + + 0 + + + 0 + + 1 + m_comment + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + + 0 + + + bSizer31 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Output DIR + 0 + + 0 + + + 0 + + 1 + m_staticText4 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_textCtrlDir + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + grb + + + + + + + + + 5 + wxALIGN_RIGHT|wxEXPAND + 0 + + + bSizer1 + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 0 + + 1 + + 1 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_OK + Apply + + 0 + + 0 + + + 0 + + 1 + m_buttonOK + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_CANCEL + Cancel + + 0 + + 0 + + + 0 + + 1 + m_buttonCancel + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer4 + wxVERTICAL + none + + + + + + diff --git a/FabricationPositions/PositionsDlg.py b/FabricationPositions/PositionsDlg.py new file mode 100644 index 0000000..ea0ca4a --- /dev/null +++ b/FabricationPositions/PositionsDlg.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +########################################################################### +## Python code generated with wxFormBuilder (version Oct 26 2018) +## http://www.wxformbuilder.org/ +## +## PLEASE DO *NOT* EDIT THIS FILE! +########################################################################### + +import wx +import wx.xrc + +########################################################################### +## Class PositionsDlg +########################################################################### + +class PositionsDlg ( wx.Dialog ): + + def __init__( self, parent ): + wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Generating Fab Positions", pos = wx.DefaultPosition, size = wx.Size( 499,296 ), style = wx.CAPTION|wx.CLOSE_BOX|wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER ) + + self.SetSizeHints( wx.DefaultSize, wx.DefaultSize ) + + bSizer3 = wx.BoxSizer( wx.VERTICAL ) + + self.m_comment = wx.StaticText( self, wx.ID_ANY, u"Generating Modules Fab Positions", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_comment.Wrap( -1 ) + + bSizer3.Add( self.m_comment, 0, wx.ALL|wx.EXPAND, 5 ) + + self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + bSizer3.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 ) + + bSizer31 = wx.BoxSizer( wx.HORIZONTAL ) + + self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Output DIR", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText4.Wrap( -1 ) + + bSizer31.Add( self.m_staticText4, 0, wx.ALL, 5 ) + + self.m_textCtrlDir = wx.TextCtrl( self, wx.ID_ANY, u"grb", wx.DefaultPosition, wx.DefaultSize, 0 ) + bSizer31.Add( self.m_textCtrlDir, 0, wx.ALL|wx.EXPAND, 5 ) + + + bSizer3.Add( bSizer31, 0, 0, 5 ) + + bSizer1 = wx.BoxSizer( wx.HORIZONTAL ) + + + bSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 ) + + self.m_buttonOK = wx.Button( self, wx.ID_OK, u"Apply", wx.DefaultPosition, wx.DefaultSize, 0 ) + + self.m_buttonOK.SetDefault() + bSizer1.Add( self.m_buttonOK, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) + + self.m_buttonCancel = wx.Button( self, wx.ID_CANCEL, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0 ) + bSizer1.Add( self.m_buttonCancel, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 ) + + + bSizer3.Add( bSizer1, 0, wx.ALIGN_RIGHT|wx.EXPAND, 5 ) + + bSizer4 = wx.BoxSizer( wx.VERTICAL ) + + + bSizer3.Add( bSizer4, 1, wx.EXPAND, 5 ) + + + self.SetSizer( bSizer3 ) + self.Layout() + + self.Centre( wx.BOTH ) + + def __del__( self ): + pass + + diff --git a/FabricationPositions/fabrication_positions.py b/FabricationPositions/fabrication_positions.py index eed38f3..64205d8 100644 --- a/FabricationPositions/fabrication_positions.py +++ b/FabricationPositions/fabrication_positions.py @@ -8,7 +8,12 @@ # main script from https://forum.kicad.info/t/pcba-wants-all-parts-in-the-pos-file-not-just-smd/10045/6 # -___version___="1.2.1" +### plugins errors +#import pcbnew +#pcbnew.GetWizardsBackTrace() + + +___version___="1.2.2" #wx.LogMessage("My message") #mm_ius = 1000000.0 @@ -24,7 +29,7 @@ from wx.lib.embeddedimage import PyEmbeddedImage execfile ("C:/kicad-wb-1602/msys64/home/userC/out3Dm/pack-x86_64/share/kicad/scripting/plugins/getpos.py") """ -def generate_POS(): +def generate_POS(dir): import os mm_ius = 1000000.0 @@ -36,18 +41,27 @@ def generate_POS(): path, fname = os.path.split(dirpath) ext = os.path.splitext(os.path.basename(fileName))[1] name = os.path.splitext(os.path.basename(fileName))[0] - + #wx.LogMessage(dir) #lsep=os.linesep lsep='\n' + if len(dir)>0: + dir = dir.rstrip('\\').rstrip('/') + if not os.path.exists(path+os.sep+dir): + #create dir + os.mkdir(path+os.sep+dir) + dir = dir+os.sep + #wx.LogMessage(dir) + else: + dir = dir+os.sep #LogMsg1=lsep+"reading from:" + lsep + dirpath + lsep + lsep - out_filename_top_SMD=path+os.sep+name+"_POS_top_SMD.txt" - out_filename_bot_SMD=path+os.sep+name+"_POS_bot_SMD.txt" - out_filename_top_THD=path+os.sep+name+"_POS_top_THD.txt" - out_filename_bot_THD=path+os.sep+name+"_POS_bot_THD.txt" - out_filename_top_VIRTUAL=path+os.sep+name+"_POS_top_Virtual.txt" - out_filename_bot_VIRTUAL=path+os.sep+name+"_POS_bot_Virtual.txt" - out_filename_ALL=path+os.sep+name+"_POS_All.txt" + out_filename_top_SMD=path+os.sep+dir+name+"_POS_top_SMD.txt" + out_filename_bot_SMD=path+os.sep+dir+name+"_POS_bot_SMD.txt" + out_filename_top_THD=path+os.sep+dir+name+"_POS_top_THD.txt" + out_filename_bot_THD=path+os.sep+dir+name+"_POS_bot_THD.txt" + out_filename_top_VIRTUAL=path+os.sep+dir+name+"_POS_top_Virtual.txt" + out_filename_bot_VIRTUAL=path+os.sep+dir+name+"_POS_bot_Virtual.txt" + out_filename_ALL=path+os.sep+dir+name+"_POS_All.txt" #out_filename=path+os.sep+name+"_POS.txt" #LogMsg1+="written to:" + lsep + out_filename_top_SMD + lsep #LogMsg1+="written to:" + lsep + out_filename_bot_SMD + lsep @@ -253,19 +267,54 @@ def generate_POS(): LogMsg1+= 'Pcb Height ' +'{0:.3f}'.format( pcb_height ) + 'mm, Pcb Width ' + '{0:.3f}'.format( pcb_width ) + 'mm' +lsep+'[based on Edge bounding box]' +lsep LogMsg1+= lsep #LogMsg1+=lsep+"reading from:" + lsep + dirpath + lsep + lsep - LogMsg1+="written to:" + lsep + out_filename_top_SMD + lsep - LogMsg1+=out_filename_bot_SMD + lsep - LogMsg1+=out_filename_top_THD + lsep - LogMsg1+=out_filename_bot_THD + lsep - LogMsg1+=out_filename_top_VIRTUAL + lsep - LogMsg1+=out_filename_bot_VIRTUAL + lsep - LogMsg1+=out_filename_ALL + lsep - + if 0: + LogMsg1+="written to:" + lsep + out_filename_top_SMD + lsep + LogMsg1+=out_filename_bot_SMD + lsep + LogMsg1+=out_filename_top_THD + lsep + LogMsg1+=out_filename_bot_THD + lsep + LogMsg1+=out_filename_top_VIRTUAL + lsep + LogMsg1+=out_filename_bot_VIRTUAL + lsep + LogMsg1+=out_filename_ALL + lsep + else: + LogMsg1+="written to:" + lsep + path+os.sep+dir + lsep return LogMsg1 #return LogMsg1+LogMsg +# Python plugin stuff +from . import PositionsDlg + +class Positions_Dlg(PositionsDlg.PositionsDlg): + # from https://github.com/MitjaNemec/Kicad_action_plugins + # hack for new wxFormBuilder generating code incompatible with old wxPython + # noinspection PyMethodOverriding + def SetSizeHints(self, sz1, sz2): + if wx.__version__ < '4.0': + self.SetSizeHintsSz(sz1, sz2) + else: + super(Positions_Dlg, self).SetSizeHints(sz1, sz2) + + #def onApplyClick(self, event): + # return self.EndModal(wx.ID_OK) + # + #def onCancelClick(self, event): + # return self.EndModal(wx.ID_CANCEL) + + def __init__(self, parent): + import wx + PositionsDlg.PositionsDlg.__init__(self, parent) + #self.GetSizer().Fit(self) + self.SetMinSize(self.GetSize()) + # self.m_buttonDelete.Bind(wx.EVT_BUTTON, self.onDeleteClick) + # self.m_buttonReconnect.Bind(wx.EVT_BUTTON, self.onConnectClick) + # if wx.__version__ < '4.0': + # self.m_buttonReconnect.SetToolTipString( u"Select two converging Tracks to re-connect them\nor Select tracks including one round corner to be straighten" ) + # self.m_buttonRound.SetToolTipString( u"Select two connected Tracks to round the corner\nThen choose distance from intersection and the number of segments" ) + # else: + # self.m_buttonReconnect.SetToolTip( u"Select two converging Tracks to re-connect them\nor Select tracks including one round corner to be straighten" ) + # self.m_buttonRound.SetToolTip( u"Select two connected Tracks to round the corner\nThen choose distance from intersection and the number of segments" ) +# class generatePOS( pcbnew.ActionPlugin ): @@ -296,97 +345,114 @@ class generatePOS( pcbnew.ActionPlugin ): #wx.MessageDialog(self.frame,"ciao") #subprocess.check_call(["C:\pathToYourProgram\yourProgram.exe", "your", "arguments", "comma", "separated"]) #http://stackoverflow.com/questions/1811691/running-an-outside-program-executable-in-python - class displayDialog(wx.Dialog): - """ - The default frame - http://stackoverflow.com/questions/3566603/how-do-i-make-wx-textctrl-multi-line-text-update-smoothly - """ - - #---------------------------------------------------------------------- - #def __init__(self): - # """Constructor""" - # wx.Frame.__init__(self, None, title="Display Frame", style=wx.DEFAULT_FRAME_STYLE, wx.ICON_INFORMATION) - # panel = wx.Panel(self) - def __init__(self, parent): - wx.Dialog.__init__(self, parent, id=-1, title="Generate POS output")# - #, style=wx.DEFAULT_DIALOG_STYLE, wx.ICON_INFORMATION) - #, style=wx.DEFAULT_DIALOG_STYLE, wx.ICON_INFORMATION) - #, pos=DefaultPosition, size=DefaultSize, style = wx.DEFAULT_FRAME_STYLE & (~wx.MAXIMIZE_BOX), name="fname") - #, wx.ICON_INFORMATION) #, title="Annular Check", style=wx.DEFAULT_FRAME_STYLE, wx.ICON_INFORMATION) - # - - self.SetIcon(PyEmbeddedImage(getPos_ico_b64_data).GetIcon()) - #wx.IconFromBitmap(wx.Bitmap("icon.ico", wx.BITMAP_TYPE_ANY))) - self.panel = wx.Panel(self) - self.title = wx.StaticText(self.panel, label="Generate POS debug:") - #self.result = wx.StaticText(self.panel, label="") - #self.result.SetForegroundColour('#FF0000') - self.button = wx.Button(self.panel, label="Close") - #self.lblname = wx.StaticText(self.panel, label="Your name:") - #self.editname = wx.TextCtrl(self.panel, size=(140, -1)) - self.editname = wx.TextCtrl(self.panel, size = (600, 500), style = wx.TE_MULTILINE|wx.TE_READONLY) - - - # Set sizer for the frame, so we can change frame size to match widgets - self.windowSizer = wx.BoxSizer() - self.windowSizer.Add(self.panel, 1, wx.ALL | wx.EXPAND) - - # Set sizer for the panel content - self.sizer = wx.GridBagSizer(5, 0) - self.sizer.Add(self.title, (0, 0)) - #self.sizer.Add(self.result, (1, 0)) - #self.sizer.Add(self.lblname, (1, 0)) - self.sizer.Add(self.editname, (1, 0)) - self.sizer.Add(self.button, (2, 0), (1, 2), flag=wx.EXPAND) - - # Set simple sizer for a nice border - self.border = wx.BoxSizer() - self.border.Add(self.sizer, 1, wx.ALL | wx.EXPAND, 5) - - # Use the sizers - self.panel.SetSizerAndFit(self.border) - self.SetSizerAndFit(self.windowSizer) - #self.result.SetLabel(msg) - # Set event handlers - #self.Show() - self.button.Bind(wx.EVT_BUTTON, self.OnClose) - self.Bind(wx.EVT_CLOSE,self.OnClose) - - def OnClose(self,e): - #wx.LogMessage("c") - e.Skip() - #self.Close() - self.Destroy() - - #def OnButton(self, e): - # self.result.SetLabel(self.editname.GetValue()) - def setMsg(self, t_msg): - self.editname.SetValue(t_msg) - - - - def f_mm(raw): - return repr(raw/mm_ius) - - board = pcbnew.GetBoard() - - #fileName = GetBoard().GetFileName() - fileName = pcbnew.GetBoard().GetFileName() - if len(fileName)==0: - wx.LogMessage("a board needs to be saved/loaded!") + #from https://github.com/MitjaNemec/Kicad_action_plugins + #hack wxFormBuilder py2/py3 + _pcbnew_frame = [x for x in wx.GetTopLevelWindows() if x.GetTitle().lower().startswith('pcbnew')][0] + aParameters = Positions_Dlg(_pcbnew_frame) + aParameters.Show() + modal_result = aParameters.ShowModal() + if modal_result == wx.ID_OK: + DirName = aParameters.m_textCtrlDir.GetValue() + #wx.LogMessage(DirName) + #wx.LogMessage(LayerName+';'+str(LayerIndex)+';'+LayerStdName) + GenPos(DirName) else: - LogMsg='' - # msg="'get_pos.py'"+os.linesep - msg="Generate POS output: version = "+___version___+os.linesep - #msg+="Generate POS output"+os.linesep - #print (msg) - #LogMsg=msg+'\n\n' - - print(msg) - LogMsg+=msg - reply=generate_POS() - LogMsg+=reply - + None # Cancel + +## +###class displayDialog(wx.Dialog): +### """ +### The default frame +### http://stackoverflow.com/questions/3566603/how-do-i-make-wx-textctrl-multi-line-text-update-smoothly +### """ +### +### #---------------------------------------------------------------------- +### #def __init__(self): +### # """Constructor""" +### # wx.Frame.__init__(self, None, title="Display Frame", style=wx.DEFAULT_FRAME_STYLE, wx.ICON_INFORMATION) +### # panel = wx.Panel(self) +### def __init__(self, parent): +### wx.Dialog.__init__(self, parent, id=-1, title="Generate POS output")# +### #, style=wx.DEFAULT_DIALOG_STYLE, wx.ICON_INFORMATION) +### #, style=wx.DEFAULT_DIALOG_STYLE, wx.ICON_INFORMATION) +### #, pos=DefaultPosition, size=DefaultSize, style = wx.DEFAULT_FRAME_STYLE & (~wx.MAXIMIZE_BOX), name="fname") +### #, wx.ICON_INFORMATION) #, title="Annular Check", style=wx.DEFAULT_FRAME_STYLE, wx.ICON_INFORMATION) +### # +### +### self.SetIcon(PyEmbeddedImage(getPos_ico_b64_data).GetIcon()) +### #wx.IconFromBitmap(wx.Bitmap("icon.ico", wx.BITMAP_TYPE_ANY))) +### self.panel = wx.Panel(self) +### self.title = wx.StaticText(self.panel, label="Generate POS debug:") +### #self.result = wx.StaticText(self.panel, label="") +### #self.result.SetForegroundColour('#FF0000') +### self.button = wx.Button(self.panel, label="Close") +### #self.lblname = wx.StaticText(self.panel, label="Your name:") +### #self.editname = wx.TextCtrl(self.panel, size=(140, -1)) +### self.editname = wx.TextCtrl(self.panel, size = (600, 500), style = wx.TE_MULTILINE|wx.TE_READONLY) +### +### +### # Set sizer for the frame, so we can change frame size to match widgets +### self.windowSizer = wx.BoxSizer() +### self.windowSizer.Add(self.panel, 1, wx.ALL | wx.EXPAND) +### +### # Set sizer for the panel content +### self.sizer = wx.GridBagSizer(5, 0) +### self.sizer.Add(self.title, (0, 0)) +### #self.sizer.Add(self.result, (1, 0)) +### #self.sizer.Add(self.lblname, (1, 0)) +### self.sizer.Add(self.editname, (1, 0)) +### self.sizer.Add(self.button, (2, 0), (1, 2), flag=wx.EXPAND) +### +### # Set simple sizer for a nice border +### self.border = wx.BoxSizer() +### self.border.Add(self.sizer, 1, wx.ALL | wx.EXPAND, 5) +### +### # Use the sizers +### self.panel.SetSizerAndFit(self.border) +### self.SetSizerAndFit(self.windowSizer) +### #self.result.SetLabel(msg) +### # Set event handlers +### #self.Show() +### self.button.Bind(wx.EVT_BUTTON, self.OnClose) +### self.Bind(wx.EVT_CLOSE,self.OnClose) +### +### def OnClose(self,e): +### #wx.LogMessage("c") +### e.Skip() +### #self.Close() +### self.Destroy() +### +### #def OnButton(self, e): +### # self.result.SetLabel(self.editname.GetValue()) +### def setMsg(self, t_msg): +### self.editname.SetValue(t_msg) +### + +def GenPos(dir): + def f_mm(raw): + return repr(raw/mm_ius) + + board = pcbnew.GetBoard() + + #fileName = GetBoard().GetFileName() + fileName = pcbnew.GetBoard().GetFileName() + if len(fileName)==0: + wx.MessageBox("a board needs to be saved/loaded!") + else: + LogMsg='' + # msg="'get_pos.py'"+os.linesep + msg="Generate POS output: version = "+___version___+os.linesep + #msg+="Generate POS output"+os.linesep + #print (msg) + #LogMsg=msg+'\n\n' + + #print(msg) + LogMsg+=msg + reply=generate_POS(dir) + LogMsg+=reply + wx.LogMessage(LogMsg) + + if 0: frame = displayDialog(None) #frame = wx.Frame(None) frame.Center() diff --git a/MoveToLayer/move_to_layer.py b/MoveToLayer/move_to_layer.py index 6a1a950..8425071 100644 --- a/MoveToLayer/move_to_layer.py +++ b/MoveToLayer/move_to_layer.py @@ -19,6 +19,11 @@ # # +### plugins errors +#import pcbnew +#pcbnew.GetWizardsBackTrace() + + import wx import pcbnew from pcbnew import * diff --git a/MoveToLayer/move_to_layer.py.bak b/MoveToLayer/move_to_layer.py.bak index bc6b7b1..6a1a950 100644 --- a/MoveToLayer/move_to_layer.py.bak +++ b/MoveToLayer/move_to_layer.py.bak @@ -25,19 +25,20 @@ from pcbnew import * import base64 from wx.lib.embeddedimage import PyEmbeddedImage import os -___version___="1.2.2" +___version___="1.2.3" from . import Move2LayerDlg def MoveToLayer(pcb,layerId): + found_selected=False for drw in pcb.GetDrawings(): if drw.IsSelected(): drw.SetLayer(layerId) found_selected=True if found_selected!=True: - LogMsg="select lines to be moved to new layer\n" + LogMsg="select drawings to be moved to new layer\n" LogMsg+="use GAL for selecting lines" wx.LogMessage(LogMsg) else: @@ -101,7 +102,7 @@ class move_to_draw_layer( pcbnew.ActionPlugin ): of the plugin """ import os - self.name = "Move Selected Drawings to chosen Layer\nversion "+___version___ + self.name = "Move Selected Drawings to chosen Layer \nversion "+___version___ self.category = "Modify PCB" self.description = "Move Selected Drawings to chosen Layer on an existing PCB" self.icon_file_name = os.path.join(os.path.dirname(__file__), "./move2layer.png")