Loading pcbnew/dialogs/dialog_footprint_wizard_list.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::OnCellWizardClick( wxGridEvent& event ) { { int click_row = event.GetRow(); int click_row = event.GetRow(); m_FootprintWizard = FOOTPRINT_WIZARDS::GetWizard(click_row); m_FootprintWizard = FOOTPRINT_WIZARDS::GetWizard(click_row); m_footprintWizardsGrid->SelectRow(event.GetRow(),false); } } FOOTPRINT_WIZARD* DIALOG_FOOTPRINT_WIZARD_LIST::GetWizard() FOOTPRINT_WIZARD* DIALOG_FOOTPRINT_WIZARD_LIST::GetWizard() Loading pcbnew/footprint_wizard_frame.cpp +12 −0 Original line number Original line Diff line number Diff line Loading @@ -399,6 +399,18 @@ void FOOTPRINT_WIZARD_FRAME::ClickOnParameterList( wxCommandEvent& event ) SetCurItem( NULL ); SetCurItem( NULL ); // Delete the current footprint // Delete the current footprint GetBoard()->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll(); MODULE *m = m_FootprintWizard->GetModule(); if (m) { /* Here we should make a copy of the object before adding to board*/ m->SetParent(GetBoard()); GetBoard()->m_Modules.Append(m); } else { printf ("m_FootprintWizard->GetModule() returns NULL\n"); } DisplayWizardInfos(); DisplayWizardInfos(); Zoom_Automatique( false ); Zoom_Automatique( false ); m_canvas->Refresh(); m_canvas->Refresh(); Loading pcbnew/scripting/module.i +19 −0 Original line number Original line Diff line number Diff line Loading @@ -95,3 +95,22 @@ def FootprintIsWritable(lpath): } } %{ MODULE *PyModule_to_MODULE(PyObject *obj0) { void *argp; int res1 = SWIG_ConvertPtr(obj0, &argp,SWIGTYPE_p_MODULE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "Converting object to MODULE*"); } return (MODULE*)argp; fail: return NULL; } %} No newline at end of file pcbnew/scripting/pcbnew_footprint_wizards.cpp +27 −3 Original line number Original line Diff line number Diff line Loading @@ -176,8 +176,14 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterNames(int aPage) wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues(int aPage) wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues(int aPage) { { wxArrayString a; PyObject *arglist; return a; wxArrayString ret; arglist = Py_BuildValue("(i)", aPage); ret = CallRetArrayStrMethod("GetParameterValues",arglist); Py_DECREF(arglist); return ret; } } wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aValues) wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aValues) Loading @@ -186,9 +192,27 @@ wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aV return ret; return ret; } } /* this is a SWIG function declaration -from module.i*/ MODULE *PyModule_to_MODULE(PyObject *obj0); MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule() MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule() { { return NULL; PyObject *result, *obj; result = CallMethod("GetModule",NULL); if (!result) return NULL; obj = PyObject_GetAttrString(result, "this"); if (PyErr_Occurred()) { PyObject *t, *v, *b; PyErr_Fetch(&t, &v, &b); printf ("calling GetModule()\n"); printf ("Exception: %s\n",PyString_AsString(PyObject_Str(v))); printf (" : %s\n",PyString_AsString(PyObject_Str(b))); } return PyModule_to_MODULE(obj); } } Loading pcbnew/scripting/pcbnew_footprint_wizards.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,8 @@ #include <vector> #include <vector> #include <class_footprint_wizard.h> #include <class_footprint_wizard.h> class PYTHON_FOOTPRINT_WIZARD: public FOOTPRINT_WIZARD class PYTHON_FOOTPRINT_WIZARD: public FOOTPRINT_WIZARD { { Loading Loading
pcbnew/dialogs/dialog_footprint_wizard_list.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::OnCellWizardClick( wxGridEvent& event ) { { int click_row = event.GetRow(); int click_row = event.GetRow(); m_FootprintWizard = FOOTPRINT_WIZARDS::GetWizard(click_row); m_FootprintWizard = FOOTPRINT_WIZARDS::GetWizard(click_row); m_footprintWizardsGrid->SelectRow(event.GetRow(),false); } } FOOTPRINT_WIZARD* DIALOG_FOOTPRINT_WIZARD_LIST::GetWizard() FOOTPRINT_WIZARD* DIALOG_FOOTPRINT_WIZARD_LIST::GetWizard() Loading
pcbnew/footprint_wizard_frame.cpp +12 −0 Original line number Original line Diff line number Diff line Loading @@ -399,6 +399,18 @@ void FOOTPRINT_WIZARD_FRAME::ClickOnParameterList( wxCommandEvent& event ) SetCurItem( NULL ); SetCurItem( NULL ); // Delete the current footprint // Delete the current footprint GetBoard()->m_Modules.DeleteAll(); GetBoard()->m_Modules.DeleteAll(); MODULE *m = m_FootprintWizard->GetModule(); if (m) { /* Here we should make a copy of the object before adding to board*/ m->SetParent(GetBoard()); GetBoard()->m_Modules.Append(m); } else { printf ("m_FootprintWizard->GetModule() returns NULL\n"); } DisplayWizardInfos(); DisplayWizardInfos(); Zoom_Automatique( false ); Zoom_Automatique( false ); m_canvas->Refresh(); m_canvas->Refresh(); Loading
pcbnew/scripting/module.i +19 −0 Original line number Original line Diff line number Diff line Loading @@ -95,3 +95,22 @@ def FootprintIsWritable(lpath): } } %{ MODULE *PyModule_to_MODULE(PyObject *obj0) { void *argp; int res1 = SWIG_ConvertPtr(obj0, &argp,SWIGTYPE_p_MODULE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "Converting object to MODULE*"); } return (MODULE*)argp; fail: return NULL; } %} No newline at end of file
pcbnew/scripting/pcbnew_footprint_wizards.cpp +27 −3 Original line number Original line Diff line number Diff line Loading @@ -176,8 +176,14 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterNames(int aPage) wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues(int aPage) wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues(int aPage) { { wxArrayString a; PyObject *arglist; return a; wxArrayString ret; arglist = Py_BuildValue("(i)", aPage); ret = CallRetArrayStrMethod("GetParameterValues",arglist); Py_DECREF(arglist); return ret; } } wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aValues) wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aValues) Loading @@ -186,9 +192,27 @@ wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues(int aPage,wxArrayString& aV return ret; return ret; } } /* this is a SWIG function declaration -from module.i*/ MODULE *PyModule_to_MODULE(PyObject *obj0); MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule() MODULE *PYTHON_FOOTPRINT_WIZARD::GetModule() { { return NULL; PyObject *result, *obj; result = CallMethod("GetModule",NULL); if (!result) return NULL; obj = PyObject_GetAttrString(result, "this"); if (PyErr_Occurred()) { PyObject *t, *v, *b; PyErr_Fetch(&t, &v, &b); printf ("calling GetModule()\n"); printf ("Exception: %s\n",PyString_AsString(PyObject_Str(v))); printf (" : %s\n",PyString_AsString(PyObject_Str(b))); } return PyModule_to_MODULE(obj); } } Loading
pcbnew/scripting/pcbnew_footprint_wizards.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,8 @@ #include <vector> #include <vector> #include <class_footprint_wizard.h> #include <class_footprint_wizard.h> class PYTHON_FOOTPRINT_WIZARD: public FOOTPRINT_WIZARD class PYTHON_FOOTPRINT_WIZARD: public FOOTPRINT_WIZARD { { Loading