diff --git a/demos/python_scripts_examples/action_menu_add_automatic_border.py b/demos/python_scripts_examples/action_menu_add_automatic_border.py index ad71c8ff67..994d8e4d48 100644 --- a/demos/python_scripts_examples/action_menu_add_automatic_border.py +++ b/demos/python_scripts_examples/action_menu_add_automatic_border.py @@ -176,7 +176,7 @@ class add_automatic_border( ActionPlugin ): max_y = self.max( max_y, bbox.GetY() + bbox.GetHeight() ) # Same with modules: Find including area - for module in pcb.GetModules(): + for module in pcb.GetFootprints(): bbox = module.GetBoundingBox() min_x = self.min( min_x, bbox.GetX() ) min_y = self.min( min_y, bbox.GetY() ) diff --git a/demos/python_scripts_examples/action_plugin_test_undoredo.py b/demos/python_scripts_examples/action_plugin_test_undoredo.py index ca052ad255..524167dbfa 100644 --- a/demos/python_scripts_examples/action_plugin_test_undoredo.py +++ b/demos/python_scripts_examples/action_plugin_test_undoredo.py @@ -14,7 +14,7 @@ class testundoredo0(ActionPlugin): def Run(self): pcb = GetBoard() - for module in pcb.GetModules(): + for module in pcb.GetFootprints(): pcb.RemoveNative(module) @@ -32,7 +32,7 @@ class testundoredo1(ActionPlugin): area = pcb.GetArea(0) pcb.RemoveNative(area) - for module in pcb.GetModules(): + for module in pcb.GetFootprints(): pcb.RemoveNative(module) for track in pcb.GetTracks(): @@ -138,7 +138,7 @@ class testundoredo3(ActionPlugin): area = pcb.GetArea(i) area.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20))) - for module in pcb.GetModules(): + for module in pcb.GetFootprints(): module.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20))) if random.randint(0,10) > 5: module.Flip(module.GetPosition()) diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index 0a1ac18db4..70b02317bd 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -178,7 +178,7 @@ public: wxString GetPath() const { return m_lib_path.GetPath(); } bool IsWritable() const { return m_lib_path.IsOk() && m_lib_path.IsDirWritable(); } - FOOTPRINT_MAP& GetModules() { return m_footprints; } + FOOTPRINT_MAP& GetFootprints() { return m_footprints; } // Most all functions in this class throw IO_ERROR exceptions. There are no // error codes nor user interface calls from here, nor in any PLUGIN. @@ -896,7 +896,7 @@ void GPCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxSt // Some of the files may have been parsed correctly so we want to add the valid files to // the library. - for( MODULE_CITER it = m_cache->GetModules().begin(); it != m_cache->GetModules().end(); ++it ) + for( MODULE_CITER it = m_cache->GetFootprints().begin(); it != m_cache->GetFootprints().end(); ++it ) aFootprintNames.Add( FROM_UTF8( it->first.c_str() ) ); if( !errorMsg.IsEmpty() && !aBestEfforts ) @@ -915,7 +915,7 @@ const FOOTPRINT* GPCB_PLUGIN::getFootprint( const wxString& aLibraryPath, validateCache( aLibraryPath, checkModified ); - const FOOTPRINT_MAP& mods = m_cache->GetModules(); + const FOOTPRINT_MAP& mods = m_cache->GetFootprints(); MODULE_CITER it = mods.find( TO_UTF8( aFootprintName ) ); diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 3dc0b804d1..972ed86275 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -103,7 +103,7 @@ public: bool Exists() const { return m_lib_path.IsOk() && m_lib_path.DirExists(); } - FOOTPRINT_MAP& GetModules() { return m_modules; } + FOOTPRINT_MAP& GetFootprints() { return m_modules; } // Most all functions in this class throw IO_ERROR exceptions. There are no // error codes nor user interface calls from here, nor in any PLUGIN. @@ -2158,7 +2158,7 @@ void PCB_IO::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& // Some of the files may have been parsed correctly so we want to add the valid files to // the library. - for( MODULE_CITER it = m_cache->GetModules().begin(); it != m_cache->GetModules().end(); ++it ) + for( MODULE_CITER it = m_cache->GetFootprints().begin(); it != m_cache->GetFootprints().end(); ++it ) aFootprintNames.Add( it->first ); if( !errorMsg.IsEmpty() && !aBestEfforts ) @@ -2184,7 +2184,7 @@ const FOOTPRINT* PCB_IO::getFootprint( const wxString& aLibraryPath, // do nothing with the error } - const FOOTPRINT_MAP& mods = m_cache->GetModules(); + const FOOTPRINT_MAP& mods = m_cache->GetFootprints(); MODULE_CITER it = mods.find( aFootprintName ); @@ -2263,7 +2263,7 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFoot wxString footprintName = aFootprint->GetFPID().GetLibItemName(); - FOOTPRINT_MAP& mods = m_cache->GetModules(); + FOOTPRINT_MAP& mods = m_cache->GetFootprints(); // Quietly overwrite module and delete module file from path for any by same name. wxFileName fn( aLibraryPath, aFootprint->GetFPID().GetLibItemName(), diff --git a/pcbnew/python/examples/createPcb.py b/pcbnew/python/examples/createPcb.py index 67af965de4..3e03c90aee 100644 --- a/pcbnew/python/examples/createPcb.py +++ b/pcbnew/python/examples/createPcb.py @@ -41,9 +41,9 @@ pcb.Save("my2.kicad_pcb") pcb = LoadBoard("my2.kicad_pcb") -print(map( lambda x: x.GetReference() , list(pcb.GetModules()))) +print(map( lambda x: x.GetReference() , list(pcb.GetFootprints()))) -for m in pcb.GetModules(): +for m in pcb.GetFootprints(): for p in m.Pads(): print('pad ', p.GetName(), p.GetPosition(), p.GetOffset()) diff --git a/pcbnew/python/examples/hidePcbValuesShowReferences.py b/pcbnew/python/examples/hidePcbValuesShowReferences.py index e90598764a..fb27103c48 100644 --- a/pcbnew/python/examples/hidePcbValuesShowReferences.py +++ b/pcbnew/python/examples/hidePcbValuesShowReferences.py @@ -6,7 +6,7 @@ filename=sys.argv[1] pcb = LoadBoard(filename) -for module in pcb.GetModules(): +for module in pcb.GetFootprints(): print("* Module: %s" % module.GetReference()) module.Value().SetVisible(False) # set Value as Hidden module.Reference().SetVisible(True) # set Reference as Visible diff --git a/pcbnew/python/examples/listPcb.py b/pcbnew/python/examples/listPcb.py index 089dac172e..32ef5577d5 100644 --- a/pcbnew/python/examples/listPcb.py +++ b/pcbnew/python/examples/listPcb.py @@ -49,7 +49,7 @@ for item in pcb.GetDrawings(): print("") print("LIST MODULES:") -for module in pcb.GetModules(): +for module in pcb.GetFootprints(): print("* Module: %s at %s" % (module.GetReference(), ToUnits(module.GetPosition()))) print("") diff --git a/pcbnew/swig/tests/test1.py b/pcbnew/swig/tests/test1.py index 03c18fa31f..d12437058f 100644 --- a/pcbnew/swig/tests/test1.py +++ b/pcbnew/swig/tests/test1.py @@ -4,7 +4,7 @@ import pcbnew pcb = pcbnew.GetBoard() -for m in pcb.GetModules(): +for m in pcb.GetFootprints(): print(m.GetPosition()) for p in m.Pads(): print("p=>", p.GetPosition(), p.GetName()) diff --git a/pcbnew/swig/tests/test2.py b/pcbnew/swig/tests/test2.py index f2ca27c9dd..63245f7800 100644 --- a/pcbnew/swig/tests/test2.py +++ b/pcbnew/swig/tests/test2.py @@ -4,7 +4,7 @@ import pcbnew pcb = pcbnew.GetBoard() -for m in pcb.GetModules(): +for m in pcb.GetFootprints(): print(m.GetReference(), "(", m.GetValue(), ") at ", m.GetPosition()) for p in m.Pads(): print(" pad", p.GetName(), "at", p.GetPosition()) diff --git a/qa/testcases/test_001_pcb_load.py b/qa/testcases/test_001_pcb_load.py index e864475641..2d0916e770 100644 --- a/qa/testcases/test_001_pcb_load.py +++ b/qa/testcases/test_001_pcb_load.py @@ -16,12 +16,12 @@ class TestPCBLoad(unittest.TestCase): self.assertEqual(len(tracks),361) def test_pcb_modules(self): - modules = list(self.pcb.GetModules()) + modules = list(self.pcb.GetFootprints()) self.assertEqual(len(modules), 72) def test_pcb_module_references(self): board_refs = list(module.GetReference() for - module in self.pcb.GetModules()) + module in self.pcb.GetFootprints()) known_refs = [u'P1', u'P3', u'C2', u'C1', u'D1', u'Q3', u'Q5', u'Q7', u'Q6', u'Q1', u'Q2', u'Q4', u'Q8', u'P2', u'U1', u'U4',