2009-11-05 19:26:52 +00:00
|
|
|
/*********************************************************/
|
|
|
|
/* cvstruct.h */
|
|
|
|
/*********************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifndef CVSTRUCT_H
|
|
|
|
#define CVSTRUCT_H
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "wx/listctrl.h"
|
2009-04-05 20:49:15 +00:00
|
|
|
#include <wx/filename.h>
|
2009-04-23 15:02:18 +00:00
|
|
|
#include "param_config.h"
|
|
|
|
#include "cvpcb.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Forward declarations of all top-level window classes. */
|
2009-08-20 11:44:06 +00:00
|
|
|
class FOOTPRINTS_LISTBOX;
|
|
|
|
class COMPONENTS_LISTBOX;
|
2007-05-06 16:03:28 +00:00
|
|
|
class WinEDA_DisplayFrame;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
#include "id.h"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-09-22 12:27:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Command IDs for the component library viewer.
|
|
|
|
*
|
|
|
|
* Please add IDs that are unique to the component library viewer here and
|
|
|
|
* not in the global id.h file. This will prevent the entire project from
|
|
|
|
* being rebuilt when adding new commands to the component library viewer.
|
|
|
|
*/
|
|
|
|
enum id_cvpcb_frm
|
|
|
|
{
|
|
|
|
ID_CVPCB_QUIT = ID_END_LIST,
|
|
|
|
ID_CVPCB_READ_INPUT_NETLIST,
|
|
|
|
ID_CVPCB_SAVEQUITCVPCB,
|
|
|
|
ID_CVPCB_CREATE_CONFIGWINDOW,
|
|
|
|
ID_CVPCB_CREATE_SCREENCMP,
|
|
|
|
ID_CVPCB_GOTO_FIRSTNA,
|
|
|
|
ID_CVPCB_GOTO_PREVIOUSNA,
|
|
|
|
ID_CVPCB_DEL_ASSOCIATIONS,
|
|
|
|
ID_CVPCB_AUTO_ASSOCIE,
|
|
|
|
ID_CVPCB_COMPONENT_LIST,
|
|
|
|
ID_CVPCB_FOOTPRINT_LIST,
|
|
|
|
ID_CVPCB_CREATE_STUFF_FILE,
|
|
|
|
ID_CVPCB_SHOW3D_FRAME,
|
|
|
|
ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
|
|
|
|
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST,
|
|
|
|
ID_CVPCB_CONFIG_KEEP_OPEN_ON_SAVE
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The CVPcb application main window.
|
|
|
|
*/
|
2008-04-17 16:25:29 +00:00
|
|
|
class WinEDA_CvpcbFrame : public WinEDA_BasicFrame
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
bool m_KeepCvpcbOpen;
|
|
|
|
FOOTPRINTS_LISTBOX* m_FootprintList;
|
|
|
|
COMPONENTS_LISTBOX* m_ListCmp;
|
2008-04-17 16:25:29 +00:00
|
|
|
WinEDA_DisplayFrame* DrawFrame;
|
2009-11-05 19:26:52 +00:00
|
|
|
WinEDA_Toolbar* m_HToolBar;
|
2009-04-05 20:49:15 +00:00
|
|
|
wxFileName m_NetlistFileName;
|
2009-04-23 15:02:18 +00:00
|
|
|
wxArrayString m_ModuleLibNames;
|
|
|
|
wxArrayString m_AliasLibNames;
|
|
|
|
wxString m_UserLibraryPath;
|
|
|
|
wxString m_NetlistFileExtension;
|
|
|
|
wxString m_DocModulesFileName;
|
|
|
|
FOOTPRINT_LIST m_footprints;
|
|
|
|
COMPONENT_LIST m_components;
|
|
|
|
|
|
|
|
protected:
|
2009-08-20 11:44:06 +00:00
|
|
|
int m_undefinedComponentCnt;
|
|
|
|
bool m_modified;
|
|
|
|
bool m_rightJustify;
|
|
|
|
bool m_isEESchemaNetlist;
|
|
|
|
PARAM_CFG_ARRAY m_projectFileParams;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
2009-08-20 11:44:06 +00:00
|
|
|
WinEDA_CvpcbFrame( const wxString& title,
|
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2008-04-17 16:25:29 +00:00
|
|
|
~WinEDA_CvpcbFrame();
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
void OnLeftClick( wxListEvent& event );
|
|
|
|
void OnLeftDClick( wxListEvent& event );
|
|
|
|
void OnSelectComponent( wxListEvent& event );
|
|
|
|
|
2009-11-05 19:26:52 +00:00
|
|
|
void Update_Config( wxCommandEvent& event );
|
2009-08-20 11:44:06 +00:00
|
|
|
void OnQuit( wxCommandEvent& event );
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void OnSize( wxSizeEvent& SizeEvent );
|
|
|
|
void OnChar( wxKeyEvent& event );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
virtual void ReCreateMenuBar();
|
|
|
|
void SetLanguage( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void ToFirstNA( wxCommandEvent& event );
|
|
|
|
void ToPreviousNA( wxCommandEvent& event );
|
|
|
|
void DelAssociations( wxCommandEvent& event );
|
|
|
|
void SaveQuitCvpcb( wxCommandEvent& event );
|
|
|
|
void LoadNetList( wxCommandEvent& event );
|
|
|
|
void ConfigCvpcb( wxCommandEvent& event );
|
|
|
|
void OnKeepOpenOnSave( wxCommandEvent& event );
|
|
|
|
void DisplayModule( wxCommandEvent& event );
|
|
|
|
void AssocieModule( wxCommandEvent& event );
|
|
|
|
void WriteStuffList( wxCommandEvent& event );
|
|
|
|
void DisplayDocFile( wxCommandEvent& event );
|
|
|
|
void OnSelectFilteringFootprint( wxCommandEvent& event );
|
|
|
|
|
|
|
|
void OnUpdateKeepOpenOnSave( wxUpdateUIEvent& event );
|
|
|
|
|
|
|
|
void SetNewPkg( const wxString& package );
|
|
|
|
void BuildCmpListBox();
|
|
|
|
void BuildFOOTPRINTS_LISTBOX();
|
|
|
|
void CreateScreenCmp();
|
|
|
|
int SaveNetList( const wxString& FullFileName );
|
|
|
|
int SaveComponentList( const wxString& FullFileName );
|
|
|
|
bool ReadNetList();
|
|
|
|
int rdpcad();
|
|
|
|
int ReadSchematicNetlist();
|
|
|
|
int ReadFootprintFilterList( FILE* f );
|
|
|
|
int ReadViewlogicWirList();
|
|
|
|
int ReadViewlogicNetList();
|
|
|
|
void LoadProjectFile( const wxString& FileName );
|
|
|
|
void SaveProjectFile( const wxString& fileName );
|
|
|
|
virtual void LoadSettings();
|
|
|
|
virtual void SaveSettings();
|
2009-04-23 15:02:18 +00:00
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
PARAM_CFG_ARRAY& GetProjectFileParameters( void );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/*********************************************************************/
|
|
|
|
/* ListBox (base class) to display lists of components or footprints */
|
|
|
|
/*********************************************************************/
|
|
|
|
class ITEMS_LISTBOX_BASE : public wxListView
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-08-20 11:44:06 +00:00
|
|
|
ITEMS_LISTBOX_BASE( WinEDA_CvpcbFrame* aParent, wxWindowID aId,
|
|
|
|
const wxPoint& aLocation, const wxSize& aSize );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
~ITEMS_LISTBOX_BASE();
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
int GetSelection();
|
|
|
|
void OnSize( wxSizeEvent& event );
|
2009-05-21 17:42:42 +00:00
|
|
|
|
|
|
|
virtual WinEDA_CvpcbFrame* GetParent();
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/******************************************/
|
|
|
|
/* ListBox showing the list of footprints */
|
|
|
|
/******************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
class FOOTPRINTS_LISTBOX : public ITEMS_LISTBOX_BASE
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
private:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString m_FullFootprintList;
|
|
|
|
wxArrayString m_FilteredFootprintList;
|
2007-05-06 16:03:28 +00:00
|
|
|
public:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString* m_ActiveFootprintList;
|
|
|
|
bool m_UseFootprintFullList;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
public:
|
2009-08-20 11:44:06 +00:00
|
|
|
FOOTPRINTS_LISTBOX( WinEDA_CvpcbFrame* parent, wxWindowID id,
|
|
|
|
const wxPoint& loc, const wxSize& size,
|
|
|
|
int nbitems, wxString choice[] );
|
|
|
|
~FOOTPRINTS_LISTBOX();
|
|
|
|
|
|
|
|
int GetCount();
|
|
|
|
void SetSelection( unsigned index, bool State = TRUE );
|
|
|
|
void SetString( unsigned linecount, const wxString& text );
|
|
|
|
void AppendLine( const wxString& text );
|
|
|
|
void SetFootprintFullList( FOOTPRINT_LIST& list );
|
|
|
|
void SetFootprintFilteredList( COMPONENT* Component,
|
|
|
|
FOOTPRINT_LIST& list );
|
|
|
|
void SetActiveFootprintList( bool FullList, bool Redraw = FALSE );
|
|
|
|
|
|
|
|
wxString GetSelectedFootprint();
|
|
|
|
wxString OnGetItemText( long item, long column ) const;
|
|
|
|
|
|
|
|
// Events functions:
|
|
|
|
void OnLeftClick( wxListEvent& event );
|
|
|
|
void OnLeftDClick( wxListEvent& event );
|
|
|
|
void OnChar( wxKeyEvent& event );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
/****************************************************/
|
|
|
|
/* ListBox showing the list of schematic components */
|
|
|
|
/****************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
2008-04-17 16:25:29 +00:00
|
|
|
wxArrayString m_ComponentList;
|
|
|
|
WinEDA_CvpcbFrame* m_Parent;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
COMPONENTS_LISTBOX( WinEDA_CvpcbFrame* parent, wxWindowID id,
|
|
|
|
const wxPoint& loc, const wxSize& size,
|
|
|
|
int nbitems, wxString choice[] );
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
~COMPONENTS_LISTBOX();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
void Clear();
|
|
|
|
int GetCount();
|
|
|
|
wxString OnGetItemText( long item, long column ) const;
|
|
|
|
void SetSelection( unsigned index, bool State = TRUE );
|
|
|
|
void SetString( unsigned linecount, const wxString& text );
|
|
|
|
void AppendLine( const wxString& text );
|
|
|
|
|
|
|
|
// Events functions:
|
|
|
|
void OnChar( wxKeyEvent& event );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
/*******************************************************/
|
2009-08-20 11:44:06 +00:00
|
|
|
/* class WinEDA_DisplayFrame: used to display footprints */
|
2008-04-17 16:25:29 +00:00
|
|
|
/*******************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
class WinEDA_DisplayFrame : public WinEDA_BasePcbFrame
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
public:
|
2009-04-05 20:49:15 +00:00
|
|
|
WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
|
2009-08-20 11:44:06 +00:00
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size,
|
2008-12-08 15:27:13 +00:00
|
|
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
|
|
|
~WinEDA_DisplayFrame();
|
|
|
|
|
|
|
|
void OnCloseWindow( wxCloseEvent& Event );
|
|
|
|
void RedrawActiveWindow( wxDC* DC, bool EraseBg );
|
|
|
|
void ReCreateHToolbar();
|
|
|
|
void ReCreateVToolbar();
|
|
|
|
void RecreateMenuBar();
|
|
|
|
void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
|
|
|
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
|
|
|
void SetToolbars();
|
|
|
|
void GeneralControle( wxDC* DC, wxPoint Mouse );
|
|
|
|
void InstallOptionsDisplay( wxCommandEvent& event );
|
|
|
|
MODULE* Get_Module( const wxString& CmpName );
|
|
|
|
|
|
|
|
void Process_Settings( wxCommandEvent& event );
|
|
|
|
void Show3D_Frame( wxCommandEvent& event );
|
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
/* SaveCopyInUndoList() virtual
|
|
|
|
* currently: do nothing in cvpcb.
|
|
|
|
* but but be defined because it is a pure virtual in WinEDA_BasePcbFrame
|
|
|
|
*/
|
2009-09-22 12:27:57 +00:00
|
|
|
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy,
|
|
|
|
UndoRedoOpType aTypeCommand = UR_UNSPECIFIED,
|
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) )
|
2009-08-20 11:44:06 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-07-29 13:10:36 +00:00
|
|
|
|
2009-08-03 18:54:48 +00:00
|
|
|
/** Function SaveCopyInUndoList (overloaded).
|
|
|
|
* Creates a new entry in undo list of commands.
|
|
|
|
* add a list of pickers to handle a list of items
|
|
|
|
* @param aItemsList = the list of items modified by the command to undo
|
|
|
|
* @param aTypeCommand = command type (see enum UndoRedoOpType)
|
2009-11-05 19:26:52 +00:00
|
|
|
* @param aTransformPoint = the reference point of the transformation,
|
|
|
|
* for commands like move
|
2009-08-03 18:54:48 +00:00
|
|
|
*/
|
2009-09-22 12:27:57 +00:00
|
|
|
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
|
|
|
UndoRedoOpType aTypeCommand,
|
|
|
|
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) )
|
2009-08-03 18:54:48 +00:00
|
|
|
{
|
|
|
|
// currently: do nothing in cvpcb.
|
|
|
|
}
|
|
|
|
|
2009-08-20 11:44:06 +00:00
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-17 16:25:29 +00:00
|
|
|
#endif //#ifndef CVSTRUCT_H
|