2013-04-25 16:29:35 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2018-01-28 08:51:28 +00:00
|
|
|
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2013-04-25 16:29:35 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
/**
|
|
|
|
* @file cvpcb_mainframe.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CVPCB_MAINFRAME_H_
|
|
|
|
#define _CVPCB_MAINFRAME_H_
|
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
#include <wx/listctrl.h>
|
2011-02-05 16:15:48 +00:00
|
|
|
#include <wx/filename.h>
|
2013-09-14 20:33:22 +00:00
|
|
|
#include <pcb_netlist.h>
|
2013-05-31 17:33:46 +00:00
|
|
|
#include <footprint_info.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2018-01-29 15:39:40 +00:00
|
|
|
#include <pcb_base_frame.h>
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
#include <config_params.h>
|
2018-01-28 08:51:28 +00:00
|
|
|
#include <auto_associate.h>
|
2017-03-23 00:59:25 +00:00
|
|
|
#include <memory>
|
2011-02-05 16:15:48 +00:00
|
|
|
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
/* Forward declarations of all top-level window classes. */
|
2011-12-16 13:32:23 +00:00
|
|
|
class wxAuiToolBar;
|
2011-02-05 16:15:48 +00:00
|
|
|
class FOOTPRINTS_LISTBOX;
|
|
|
|
class COMPONENTS_LISTBOX;
|
2013-05-31 17:33:46 +00:00
|
|
|
class LIBRARY_LISTBOX;
|
2011-02-05 16:15:48 +00:00
|
|
|
class DISPLAY_FOOTPRINTS_FRAME;
|
2013-06-06 15:37:48 +00:00
|
|
|
class COMPONENT;
|
2013-09-14 20:33:22 +00:00
|
|
|
class FP_LIB_TABLE;
|
2011-02-05 16:15:48 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
namespace CV { struct IFACE; }
|
2011-02-05 16:15:48 +00:00
|
|
|
|
|
|
|
/**
|
2011-08-29 19:50:05 +00:00
|
|
|
* The CvPcb application main window.
|
2011-02-05 16:15:48 +00:00
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
class CVPCB_MAINFRAME : public KIWAY_PLAYER
|
2011-02-05 16:15:48 +00:00
|
|
|
{
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
friend struct CV::IFACE;
|
2013-09-14 20:33:22 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxArrayString m_footprintListEntries;
|
2016-02-25 13:57:59 +00:00
|
|
|
wxString m_currentSearchPattern;
|
2016-02-25 09:52:29 +00:00
|
|
|
bool m_keepCvpcbOpen;
|
|
|
|
NETLIST m_netlist;
|
|
|
|
int m_filteringOptions;
|
|
|
|
wxAuiToolBar* m_mainToolBar;
|
2014-07-05 20:42:59 +00:00
|
|
|
FOOTPRINTS_LISTBOX* m_footprintListBox;
|
|
|
|
LIBRARY_LISTBOX* m_libListBox;
|
|
|
|
COMPONENTS_LISTBOX* m_compListBox;
|
2016-02-25 13:57:59 +00:00
|
|
|
wxTextCtrl* m_tcFilterString;
|
2016-02-25 09:52:29 +00:00
|
|
|
|
|
|
|
public:
|
2011-08-04 11:23:19 +00:00
|
|
|
wxArrayString m_ModuleLibNames;
|
2015-01-11 17:22:45 +00:00
|
|
|
wxArrayString m_EquFilesNames;
|
2017-03-23 00:59:25 +00:00
|
|
|
std::unique_ptr<FOOTPRINT_LIST> m_FootprintsList;
|
2011-02-05 16:15:48 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_undefinedComponentCnt;
|
|
|
|
bool m_modified;
|
2012-05-25 06:58:52 +00:00
|
|
|
bool m_skipComponentSelect; // true to skip OnSelectComponent event
|
|
|
|
// (in automatic selection/deletion of associations)
|
2011-02-05 16:15:48 +00:00
|
|
|
PARAM_CFG_ARRAY m_projectFileParams;
|
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent );
|
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
public:
|
2011-02-05 16:15:48 +00:00
|
|
|
~CVPCB_MAINFRAME();
|
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl=0 ) override;
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void KiwayMailIn( KIWAY_EXPRESS& aEvent ) override;
|
2015-06-07 18:18:45 +00:00
|
|
|
|
2014-03-21 11:50:04 +00:00
|
|
|
/**
|
|
|
|
* @return a pointer on the Footprint Viewer frame, if exists, or NULL
|
|
|
|
*/
|
2016-01-06 07:36:08 +00:00
|
|
|
DISPLAY_FOOTPRINTS_FRAME* GetFootprintViewerFrame();
|
2014-03-21 11:50:04 +00:00
|
|
|
|
2011-12-18 20:22:16 +00:00
|
|
|
/**
|
|
|
|
* Function OnSelectComponent
|
|
|
|
* Called when clicking on a component in component list window
|
2013-04-25 16:29:35 +00:00
|
|
|
* * Updates the filtered footprint list, if the filtered list option is selected
|
2011-12-18 20:22:16 +00:00
|
|
|
* * Updates the current selected footprint in footprint list
|
|
|
|
* * Updates the footprint shown in footprint display window (if opened)
|
|
|
|
*/
|
2011-02-05 16:15:48 +00:00
|
|
|
void OnSelectComponent( wxListEvent& event );
|
2016-02-25 09:52:29 +00:00
|
|
|
|
2013-09-14 20:33:22 +00:00
|
|
|
/**
|
2016-02-25 13:57:59 +00:00
|
|
|
* Function OnEditFootprintLibraryTable
|
2013-09-14 20:33:22 +00:00
|
|
|
* displays the footprint library table editing dialog and updates the global and local
|
|
|
|
* footprint tables accordingly.
|
|
|
|
*/
|
2016-02-25 13:57:59 +00:00
|
|
|
void OnEditFootprintLibraryTable( wxCommandEvent& event );
|
2013-09-14 20:33:22 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void OnQuit( wxCommandEvent& event );
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void OnSize( wxSizeEvent& SizeEvent );
|
|
|
|
void ReCreateHToolbar();
|
2016-09-24 18:53:15 +00:00
|
|
|
virtual void ReCreateMenuBar() override;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2013-06-08 16:06:26 +00:00
|
|
|
void ChangeFocus( bool aMoveRight );
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void ToFirstNA( wxCommandEvent& event );
|
|
|
|
void ToPreviousNA( wxCommandEvent& event );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DelAssociations
|
|
|
|
* removes all component footprint associations already made
|
|
|
|
*/
|
2011-02-05 16:15:48 +00:00
|
|
|
void DelAssociations( wxCommandEvent& event );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void SaveQuitCvpcb( wxCommandEvent& event );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2015-03-29 21:22:53 +00:00
|
|
|
void OnConfigurePaths( wxCommandEvent& aEvent );
|
|
|
|
|
2015-01-11 17:22:45 +00:00
|
|
|
/**
|
|
|
|
* Function OnEditEquFilesList
|
|
|
|
* envokes the equ files list edit dialog.
|
|
|
|
*/
|
|
|
|
void OnEditEquFilesList( wxCommandEvent& aEvent );
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void OnKeepOpenOnSave( wxCommandEvent& event );
|
|
|
|
void DisplayModule( wxCommandEvent& event );
|
2011-08-29 19:50:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called by the automatic association button
|
|
|
|
* Read *.equ files to try to find corresponding footprint
|
|
|
|
* for each component that is not already linked to a footprint ( a "free"
|
|
|
|
* component )
|
|
|
|
* format of a line:
|
|
|
|
* 'cmp_ref' 'footprint_name'
|
|
|
|
*/
|
2015-01-13 08:05:43 +00:00
|
|
|
void AutomaticFootprintMatching( wxCommandEvent& event );
|
2011-08-29 19:50:05 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void DisplayDocFile( wxCommandEvent& event );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnSelectFilteringFootprint
|
|
|
|
* is the command event handler for enabling and disabling footprint filtering.
|
|
|
|
*/
|
2011-02-05 16:15:48 +00:00
|
|
|
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
|
|
|
|
2016-02-25 09:52:29 +00:00
|
|
|
/**
|
2016-02-25 13:57:59 +00:00
|
|
|
* Function OnEnterFilteringText
|
|
|
|
* Is called each time the text of m_tcFilterString is changed.
|
2016-02-25 09:52:29 +00:00
|
|
|
*/
|
2016-02-25 13:57:59 +00:00
|
|
|
void OnEnterFilteringText( wxCommandEvent& event );
|
2011-02-05 16:15:48 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
/**
|
|
|
|
* Function SetNewPkg
|
2017-06-10 12:05:30 +00:00
|
|
|
* set the footprint name for all selected components in component list
|
2012-02-11 09:04:26 +00:00
|
|
|
* and selects the next component.
|
2017-06-10 12:05:30 +00:00
|
|
|
* @param aFootprintName = the new footprint name
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
2012-02-11 09:04:26 +00:00
|
|
|
void SetNewPkg( const wxString& aFootprintName );
|
2015-01-13 08:05:43 +00:00
|
|
|
|
2017-06-10 12:05:30 +00:00
|
|
|
/**
|
|
|
|
* Function SetNewPkg
|
|
|
|
* Set the footprint name for the component of position aIndex in the component list
|
|
|
|
*
|
|
|
|
* @param aFootprintName = the new footprint name
|
|
|
|
* @param aIndex = the index of the component to modify in the component list
|
|
|
|
*/
|
|
|
|
void SetNewPkg( const wxString& aFootprintName, int aIndex );
|
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void BuildCmpListBox();
|
|
|
|
void BuildFOOTPRINTS_LISTBOX();
|
2013-05-31 17:33:46 +00:00
|
|
|
void BuildLIBRARY_LISTBOX();
|
2013-04-26 15:11:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create or Update the frame showing the current highlighted footprint
|
|
|
|
* and (if showed) the 3D display frame
|
|
|
|
*/
|
2011-02-05 16:15:48 +00:00
|
|
|
void CreateScreenCmp();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
/**
|
2016-02-25 09:52:29 +00:00
|
|
|
* Function SaveFootprintAssociation
|
2015-06-07 18:18:45 +00:00
|
|
|
* saves the edits that the user has done by sending them back to eeschema
|
|
|
|
* via the kiway.
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
2016-02-25 09:52:29 +00:00
|
|
|
void SaveFootprintAssociation();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
/**
|
2017-06-15 09:28:36 +00:00
|
|
|
* Function ReadNetListAndFpFiles
|
|
|
|
* loads the netlist file built on the fly by Eeschema and loads
|
|
|
|
* footprint libraries from fp lib tables.
|
2015-06-07 18:18:45 +00:00
|
|
|
* @param aNetlist is the netlist from eeschema in kicad s-expr format.
|
2017-06-15 09:28:36 +00:00
|
|
|
* (see CVPCB_MAINFRAME::KiwayMailIn() to know how to get this netlist)
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
2017-06-15 09:28:36 +00:00
|
|
|
bool ReadNetListAndFpFiles( const std::string& aNetlist );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2017-06-15 09:28:36 +00:00
|
|
|
/**
|
|
|
|
* Function ReadSchematicNetlist
|
|
|
|
* read the netlist (.net) file built on the fly by Eeschema.
|
|
|
|
* @param aNetlist is the netlist buffer filled by eeschema, in kicad s-expr format.
|
|
|
|
* It is the same netlist as the .net file created by Eeschema.
|
|
|
|
* (This method is called by ReadNetListAndFpFiles)
|
|
|
|
*/
|
2015-06-07 18:18:45 +00:00
|
|
|
int ReadSchematicNetlist( const std::string& aNetlist );
|
2011-08-24 19:44:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function LoadProjectFile
|
2016-02-25 13:57:59 +00:00
|
|
|
* reads the CvPcb configuration parameter from the project (.pro) file \a aFileName
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
void LoadProjectFile();
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2016-02-25 13:57:59 +00:00
|
|
|
/**
|
|
|
|
* Function SaveProjectFile
|
|
|
|
* Saves the CvPcb configuration parameter from the project (.pro) file \a aFileName
|
|
|
|
*/
|
|
|
|
void SaveProjectFile();
|
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void LoadSettings( wxConfigBase* aCfg ) override;
|
2011-08-24 19:44:05 +00:00
|
|
|
|
2016-09-25 17:06:49 +00:00
|
|
|
void SaveSettings( wxConfigBase* aCfg ) override;
|
2011-02-21 18:27:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-08-24 19:44:05 +00:00
|
|
|
* Function DisplayStatus
|
2013-06-08 16:06:26 +00:00
|
|
|
* updates the information displayed on the status bar at bottom of the main frame.
|
|
|
|
*
|
|
|
|
* When the library or component list controls have the focus, the footprint assignment
|
|
|
|
* status of the components is displayed in the first status bar pane and the list of
|
|
|
|
* filters for the selected component is displayed in the second status bar pane. When
|
|
|
|
* the footprint list control has the focus, the description of the selected footprint is
|
|
|
|
* displayed in the first status bar pane and the key words for the selected footprint are
|
|
|
|
* displayed in the second status bar pane. The third status bar pane always displays the
|
|
|
|
* current footprint list filtering.
|
2011-02-05 16:15:48 +00:00
|
|
|
*/
|
|
|
|
void DisplayStatus();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function LoadFootprintFiles
|
2011-08-24 19:44:05 +00:00
|
|
|
* reads the list of footprint (*.mod files) and generate the list of footprints.
|
2011-02-05 16:15:48 +00:00
|
|
|
* for each module are stored
|
|
|
|
* the module name
|
|
|
|
* documentation string
|
|
|
|
* associated keywords
|
|
|
|
* m_ModuleLibNames is the list of library that must be read (loaded)
|
|
|
|
* fills m_footprints
|
|
|
|
* @return true if libraries are found, false otherwise.
|
|
|
|
*/
|
2011-08-04 11:23:19 +00:00
|
|
|
bool LoadFootprintFiles();
|
2011-02-05 16:15:48 +00:00
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
/**
|
|
|
|
* Function GetProjectFileParameters
|
2011-08-29 19:50:05 +00:00
|
|
|
* return project file parameter list for CvPcb.
|
2011-08-24 19:44:05 +00:00
|
|
|
* <p>
|
2011-08-29 19:50:05 +00:00
|
|
|
* Populate the project file parameter array specific to CvPcb if it hasn't
|
2011-08-24 19:44:05 +00:00
|
|
|
* already been populated and return a reference to the array to the caller.
|
|
|
|
* Creating the parameter list at run time has the advantage of being able
|
|
|
|
* to define local variables. The old method of statically building the array
|
|
|
|
* at compile time requiring global variable definitions.
|
|
|
|
* </p>
|
|
|
|
*
|
2011-08-29 19:50:05 +00:00
|
|
|
* @return A reference to a PARAM_CFG_ARRAY contain the project settings for CvPcb.
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
2011-02-05 16:15:48 +00:00
|
|
|
PARAM_CFG_ARRAY& GetProjectFileParameters( void );
|
|
|
|
|
2011-08-24 19:44:05 +00:00
|
|
|
/**
|
|
|
|
* Function UpdateTitle
|
|
|
|
* sets the main window title bar text.
|
|
|
|
* <p>
|
2016-02-25 09:52:29 +00:00
|
|
|
* If no current project open( eeschema run outside kicad manager with no schematic loaded),
|
|
|
|
* the title is set to the application name appended with "no project".
|
|
|
|
* Otherwise, the title shows the project name.
|
2011-08-24 19:44:05 +00:00
|
|
|
*/
|
|
|
|
void UpdateTitle();
|
|
|
|
|
2011-10-12 13:09:12 +00:00
|
|
|
/**
|
|
|
|
* Function SendMessageToEESCHEMA
|
2012-01-23 04:33:36 +00:00
|
|
|
* Send a remote command to Eeschema via a socket,
|
|
|
|
* Commands are
|
|
|
|
* $PART: "reference" put cursor on component anchor
|
2011-10-12 13:09:12 +00:00
|
|
|
*/
|
2012-01-23 04:33:36 +00:00
|
|
|
void SendMessageToEESCHEMA();
|
2011-10-12 13:09:12 +00:00
|
|
|
|
2013-06-06 15:37:48 +00:00
|
|
|
COMPONENT* GetSelectedComponent();
|
|
|
|
|
2016-02-25 09:52:29 +00:00
|
|
|
/**
|
2016-11-20 23:35:08 +00:00
|
|
|
* @return the LIB_ID of the selected footprint in footprint listview
|
2016-02-25 09:52:29 +00:00
|
|
|
* or a empty string if no selection
|
|
|
|
*/
|
|
|
|
const wxString GetSelectedFootprint();
|
|
|
|
|
2015-01-13 08:05:43 +00:00
|
|
|
private:
|
2016-02-25 13:57:59 +00:00
|
|
|
// UI event handlers.
|
|
|
|
// Keep consistent the display state of toggle menus or tools in toolbar
|
|
|
|
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
2016-02-25 09:52:29 +00:00
|
|
|
void OnFilterFPbyKeywords( wxUpdateUIEvent& event );
|
|
|
|
void OnFilterFPbyPinCount( wxUpdateUIEvent& event );
|
|
|
|
void OnFilterFPbyLibrary( wxUpdateUIEvent& event );
|
|
|
|
void OnFilterFPbyKeyName( wxUpdateUIEvent& event );
|
2015-01-13 08:05:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* read the .equ files and populate the list of equvalents
|
|
|
|
* @param aList the list to populate
|
|
|
|
* @param aErrorMessages is a pointer to a wxString to store error messages
|
|
|
|
* (can be NULL)
|
|
|
|
* @return the error count ( 0 = no error)
|
|
|
|
*/
|
|
|
|
int buildEquivalenceList( FOOTPRINT_EQUIVALENCE_LIST& aList, wxString * aErrorMessages = NULL );
|
|
|
|
|
2016-02-25 13:57:59 +00:00
|
|
|
void refreshAfterComponentSearch (COMPONENT* component);
|
2016-02-24 16:30:35 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //#ifndef _CVPCB_MAINFRAME_H_
|