From 54878b04a52372c7268f5392f928b50fe670b021 Mon Sep 17 00:00:00 2001 From: Dominik Wernberger Date: Sat, 14 Nov 2020 00:10:45 +0100 Subject: [PATCH] Rename MODULE to FOOTPRINT --- .../action_plugin_test_undoredo.py | 34 +++++++++---------- pcbnew/python/examples/createFPC40.py | 2 +- pcbnew/python/examples/createPcb.py | 2 +- pcbnew/python/plugins/FootprintWizardBase.py | 2 +- qa/testcases/test_002_board_class.py | 2 +- scripts/test_kicad_plugin.py | 6 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/demos/python_scripts_examples/action_plugin_test_undoredo.py b/demos/python_scripts_examples/action_plugin_test_undoredo.py index 524167dbfa..f7cbf64e02 100644 --- a/demos/python_scripts_examples/action_plugin_test_undoredo.py +++ b/demos/python_scripts_examples/action_plugin_test_undoredo.py @@ -49,22 +49,22 @@ class testundoredo2(ActionPlugin): self.category = "Test Undo/Redo" self.description = "" - def createFPCXModule(self,pads): + def createFPCXFootprint(self,pads): size_025_160mm = wxSizeMM(0.25,1.6) size_150_200mm = wxSizeMM(1.50,2.0) - # create a new module, it's parent is our previously created pcb - module = MODULE(self.pcb) - module.SetReference("FPC"+str(pads)) # give it a reference name - module.Reference().SetPosition(wxPointMM(-1,-1)) - self.pcb.Add(module) # add it to our pcb + # create a new footprint, it's parent is our previously created pcb + footprint = FOOTPRINT(self.pcb) + footprint.SetReference("FPC"+str(pads)) # give it a reference name + footprint.Reference().SetPosition(wxPointMM(-1,-1)) + self.pcb.Add(footprint) # add it to our pcb m_pos = wxPointMM(0,0)#random.randint(10,200),random.randint(10,200)) - module.SetPosition(m_pos) + footprint.SetPosition(m_pos) - # create a pad array and add it to the module + # create a pad array and add it to the footprint - def smdRectPad(module,size,pos,name): - pad = D_PAD(module) + def smdRectPad(footprint,size,pos,name): + pad = D_PAD(footprint) pad.SetSize(size) pad.SetShape(PAD_SHAPE_RECT) pad.SetAttribute(PAD_ATTRIB_SMD) @@ -74,16 +74,16 @@ class testundoredo2(ActionPlugin): return pad for n in range (0,pads): - pad = smdRectPad(module,size_025_160mm,wxPointMM(0.5*n,0),str(n+1)) - module.Add(pad) + pad = smdRectPad(footprint,size_025_160mm,wxPointMM(0.5*n,0),str(n+1)) + footprint.Add(pad) - pad_s0 = smdRectPad(module,size_150_200mm,wxPointMM(-1.6,1.3),"0") - pad_s1 = smdRectPad(module,size_150_200mm,wxPointMM((pads-1)*0.5+1.6,1.3),"0") - module.Add(pad_s0) - module.Add(pad_s1) + pad_s0 = smdRectPad(footprint,size_150_200mm,wxPointMM(-1.6,1.3),"0") + pad_s1 = smdRectPad(footprint,size_150_200mm,wxPointMM((pads-1)*0.5+1.6,1.3),"0") + footprint.Add(pad_s0) + footprint.Add(pad_s1) - e = EDGE_MODULE(module) + e = EDGE_MODULE(footprint) e.SetStart0(wxPointMM(-1,0)) e.SetEnd0(wxPointMM(0,0)) e.SetWidth(FromMM(0.2)) diff --git a/pcbnew/python/examples/createFPC40.py b/pcbnew/python/examples/createFPC40.py index f0d9d7d5c7..1a77652ece 100644 --- a/pcbnew/python/examples/createFPC40.py +++ b/pcbnew/python/examples/createFPC40.py @@ -10,7 +10,7 @@ pads = 40 pcb = BOARD() # create a new module, it's parent is our previously created pcb -module = MODULE(pcb) +module = FOOTPRINT(pcb) module.SetReference("FPC"+str(pads)) # give it a reference name module.Reference().SetPos0(wxPointMM(-1,-1)) pcb.Add(module) # add it to our pcb diff --git a/pcbnew/python/examples/createPcb.py b/pcbnew/python/examples/createPcb.py index 3e03c90aee..0534498c22 100644 --- a/pcbnew/python/examples/createPcb.py +++ b/pcbnew/python/examples/createPcb.py @@ -13,7 +13,7 @@ pcb = BOARD() pcb.GetNetClasses().GetDefault().SetClearance(FromMM(0.1)) # create a new module, it's parent is our previously created pcb -module = MODULE(pcb) +module = FOOTPRINT(pcb) module.SetReference("M1") # give it a reference name module.Reference().SetPos0(wxPointMM(6,-2)) module.Reference().SetDrawCoord() diff --git a/pcbnew/python/plugins/FootprintWizardBase.py b/pcbnew/python/plugins/FootprintWizardBase.py index 94fab7051b..dfbc67f331 100644 --- a/pcbnew/python/plugins/FootprintWizardBase.py +++ b/pcbnew/python/plugins/FootprintWizardBase.py @@ -100,7 +100,7 @@ class FootprintWizard(pcbnew.FootprintWizardPlugin): """ self.buildmessages = "" - self.module = pcbnew.MODULE(None) # create a new module + self.module = pcbnew.FOOTPRINT(None) # create a new module # Perform default checks on all parameters for p in self.params: diff --git a/qa/testcases/test_002_board_class.py b/qa/testcases/test_002_board_class.py index 9414a37c81..ebc818b69e 100644 --- a/qa/testcases/test_002_board_class.py +++ b/qa/testcases/test_002_board_class.py @@ -60,7 +60,7 @@ class TestBoardClass(unittest.TestCase): def test_pcb_get_pad(self): pcb = BOARD() - module = MODULE(pcb) + module = FOOTPRINT(pcb) pcb.Add(module) pad = D_PAD(module) module.Add(pad) diff --git a/scripts/test_kicad_plugin.py b/scripts/test_kicad_plugin.py index 3bb20cc331..87984fc559 100755 --- a/scripts/test_kicad_plugin.py +++ b/scripts/test_kicad_plugin.py @@ -13,7 +13,7 @@ # 3) Entered following command line, script takes no arguments # $ PYTHONPATH=. /test_kicad_plugin.py -from pcbnew import IO_MGR, BOARD, MODULE, FPID, UTF8 +from pcbnew import IO_MGR, BOARD, FOOTPRINT, FPID, UTF8 from os import rename as mv tmp_path = '/tmp' @@ -43,8 +43,8 @@ plugin.FootprintLibCreate( lib_path2 ) board = BOARD() -# The only way to construct a MODULE is to pass it a BOARD? Yep. -module = MODULE( board ) +# The only way to construct a FOOTPRINT is to pass it a BOARD? Yep. +module = FOOTPRINT( board ) fpid = FPID( 'mine' )