Complete comment translation of cvpcb source and fix tool tip capitalization.
This commit is contained in:
parent
56995b3359
commit
8c36cbf472
|
@ -2,7 +2,7 @@
|
||||||
/* CVPCB: autosel.cpp */
|
/* CVPCB: autosel.cpp */
|
||||||
/**********************/
|
/**********************/
|
||||||
|
|
||||||
/* Routines de selection automatique des modules */
|
/* Routines for automatic selection of modules. */
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -81,7 +81,7 @@ void WinEDA_CvpcbFrame::AssocieModule( wxCommandEvent& event )
|
||||||
if( m_components.empty() )
|
if( m_components.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* recherche des equivalences a travers les fichiers possibles */
|
/* Find equivalents in all available files. */
|
||||||
for( ii = 0; ii < m_AliasLibNames.GetCount(); ii++ )
|
for( ii = 0; ii < m_AliasLibNames.GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
fn = m_AliasLibNames[ii];
|
fn = m_AliasLibNames[ii];
|
||||||
|
@ -106,7 +106,6 @@ found in the default search paths." ),
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lecture fichier n */
|
|
||||||
while( GetLine( file, Line, NULL, sizeof(Line) ) != NULL )
|
while( GetLine( file, Line, NULL, sizeof(Line) ) != NULL )
|
||||||
{
|
{
|
||||||
char* text = Line;
|
char* text = Line;
|
||||||
|
@ -133,7 +132,7 @@ found in the default search paths." ),
|
||||||
fclose( file );
|
fclose( file );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the number of footpint aliases. */
|
/* Display the number of footprint aliases. */
|
||||||
msg.Printf( _( "%d footprint aliases found." ), aliases.size() );
|
msg.Printf( _( "%d footprint aliases found." ), aliases.size() );
|
||||||
SetStatusText( msg, 0 );
|
SetStatusText( msg, 0 );
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/***************************************/
|
/*************/
|
||||||
/** cfg.cpp : configuration de CVPCB **/
|
/** cfg.cpp **/
|
||||||
/***************************************/
|
/*************/
|
||||||
|
|
||||||
/* lit ou met a jour la configuration de CVPCB */
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "appl_wxstruct.h"
|
#include "appl_wxstruct.h"
|
||||||
|
@ -52,20 +50,19 @@ PARAM_CFG_ARRAY& WinEDA_CvpcbFrame::GetProjectFileParameters( void )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lit la configuration
|
* Reads the configuration
|
||||||
* 1 - lit cvpcb.cnf
|
* 1 - bed cvpcb.cnf
|
||||||
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
|
* 2 - if not in path of <cvpcb.exe> / cvpcb.cnf
|
||||||
* 3 - si non trouve: init des variables aux valeurs par defaut
|
* 3 - If not found: init variables to default values
|
||||||
*
|
*
|
||||||
* Remarque:
|
* Note:
|
||||||
* le chemin de l'executable cvpcb.exe doit etre dans BinDir
|
* The path of the executable must be in cvpcb.exe.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void WinEDA_CvpcbFrame::LoadProjectFile( const wxString& FileName )
|
void WinEDA_CvpcbFrame::LoadProjectFile( const wxString& FileName )
|
||||||
{
|
{
|
||||||
wxFileName fn = FileName;
|
wxFileName fn = FileName;
|
||||||
|
|
||||||
/* Init des valeurs par defaut */
|
|
||||||
m_ModuleLibNames.Clear();
|
m_ModuleLibNames.Clear();
|
||||||
m_AliasLibNames.Clear();
|
m_AliasLibNames.Clear();
|
||||||
|
|
||||||
|
@ -85,9 +82,6 @@ void WinEDA_CvpcbFrame::LoadProjectFile( const wxString& FileName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* fonction relai d'appel a Save_Config,
|
|
||||||
* la vraie fonction de sauvegarde de la config
|
|
||||||
*/
|
|
||||||
void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::Update_Config( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
SaveProjectFile( m_NetlistFileName.GetFullPath() );
|
SaveProjectFile( m_NetlistFileName.GetFullPath() );
|
||||||
|
@ -106,7 +100,6 @@ void WinEDA_CvpcbFrame::SaveProjectFile( const wxString& fileName )
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* ecriture de la configuration */
|
|
||||||
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP,
|
wxGetApp().WriteProjectConfig( dlg.GetPath(), GROUP,
|
||||||
GetProjectFileParameters() );
|
GetProjectFileParameters() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
PIN::PIN()
|
PIN::PIN()
|
||||||
{
|
{
|
||||||
m_Index = 0; /* variable utilisee selon types de netlistes */
|
m_Index = 0; /* Variable used by types of netlists. */
|
||||||
m_Type = 0; /* code type electrique ( Entree Sortie Passive..) */
|
m_Type = 0; /* Electrical type. */
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator<( const PIN& item1, const PIN& item2 )
|
bool operator<( const PIN& item1, const PIN& item2 )
|
||||||
|
|
|
@ -26,13 +26,10 @@ static const wxString KeepCvpcbOpenEntry( wxT( "KeepCvpcbOpen" ) );
|
||||||
static const wxString FootprintDocFileEntry( wxT( "footprints_doc_file" ) );
|
static const wxString FootprintDocFileEntry( wxT( "footprints_doc_file" ) );
|
||||||
|
|
||||||
|
|
||||||
/*************************************/
|
|
||||||
/* Event table for WinEDA_CvpcbFrame */
|
|
||||||
/*************************************/
|
|
||||||
BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
||||||
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_CvpcbFrame::LoadNetList )
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, WinEDA_CvpcbFrame::LoadNetList )
|
||||||
|
|
||||||
// Menu events
|
// Menu events
|
||||||
EVT_MENU( ID_LOAD_PROJECT,
|
EVT_MENU( ID_LOAD_PROJECT,
|
||||||
WinEDA_CvpcbFrame::LoadNetList )
|
WinEDA_CvpcbFrame::LoadNetList )
|
||||||
EVT_MENU( ID_SAVE_PROJECT,
|
EVT_MENU( ID_SAVE_PROJECT,
|
||||||
|
@ -54,7 +51,7 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
||||||
ID_LANGUAGE_CHOICE_END,
|
ID_LANGUAGE_CHOICE_END,
|
||||||
WinEDA_CvpcbFrame::SetLanguage )
|
WinEDA_CvpcbFrame::SetLanguage )
|
||||||
|
|
||||||
// Toolbar events
|
// Toolbar events
|
||||||
EVT_TOOL( ID_CVPCB_QUIT,
|
EVT_TOOL( ID_CVPCB_QUIT,
|
||||||
WinEDA_CvpcbFrame::OnQuit )
|
WinEDA_CvpcbFrame::OnQuit )
|
||||||
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST,
|
EVT_TOOL( ID_CVPCB_READ_INPUT_NETLIST,
|
||||||
|
@ -82,12 +79,12 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
||||||
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
|
EVT_TOOL( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST,
|
||||||
WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
|
WinEDA_CvpcbFrame::OnSelectFilteringFootprint )
|
||||||
|
|
||||||
// Frame events
|
// Frame events
|
||||||
EVT_CHAR( WinEDA_CvpcbFrame::OnChar )
|
EVT_CHAR( WinEDA_CvpcbFrame::OnChar )
|
||||||
EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow )
|
EVT_CLOSE( WinEDA_CvpcbFrame::OnCloseWindow )
|
||||||
EVT_SIZE( WinEDA_CvpcbFrame::OnSize )
|
EVT_SIZE( WinEDA_CvpcbFrame::OnSize )
|
||||||
|
|
||||||
// List item events
|
// List item events
|
||||||
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST,
|
EVT_LIST_ITEM_SELECTED( ID_CVPCB_FOOTPRINT_LIST,
|
||||||
WinEDA_CvpcbFrame::OnLeftClick )
|
WinEDA_CvpcbFrame::OnLeftClick )
|
||||||
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST,
|
EVT_LIST_ITEM_ACTIVATED( ID_CVPCB_FOOTPRINT_LIST,
|
||||||
|
@ -99,22 +96,19 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
||||||
WinEDA_CvpcbFrame::OnUpdateKeepOpenOnSave )
|
WinEDA_CvpcbFrame::OnUpdateKeepOpenOnSave )
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
|
||||||
/*******************************************************/
|
long style ) :
|
||||||
/* Constructeur de WinEDA_CvpcbFrame: la fenetre generale */
|
|
||||||
/*******************************************************/
|
|
||||||
WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
|
|
||||||
WinEDA_BasicFrame( NULL, CVPCB_FRAME, title, wxDefaultPosition,
|
WinEDA_BasicFrame( NULL, CVPCB_FRAME, title, wxDefaultPosition,
|
||||||
wxDefaultSize, style )
|
wxDefaultSize, style )
|
||||||
{
|
{
|
||||||
m_FrameName = wxT( "CvpcbFrame" );
|
m_FrameName = wxT( "CvpcbFrame" );
|
||||||
|
|
||||||
m_ListCmp = NULL;
|
m_ListCmp = NULL;
|
||||||
m_FootprintList = NULL;
|
m_FootprintList = NULL;
|
||||||
DrawFrame = NULL;
|
DrawFrame = NULL;
|
||||||
m_HToolBar = NULL;
|
m_HToolBar = NULL;
|
||||||
m_modified = false;
|
m_modified = false;
|
||||||
m_rightJustify = false;
|
m_rightJustify = false;
|
||||||
m_isEESchemaNetlist = false;
|
m_isEESchemaNetlist = false;
|
||||||
m_KeepCvpcbOpen = false;
|
m_KeepCvpcbOpen = false;
|
||||||
m_undefinedComponentCnt = 0;
|
m_undefinedComponentCnt = 0;
|
||||||
|
@ -125,7 +119,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
|
||||||
* this is of the responsibility to users to create this file
|
* this is of the responsibility to users to create this file
|
||||||
* if they want to have a list of footprints
|
* if they want to have a list of footprints
|
||||||
*/
|
*/
|
||||||
m_DocModulesFileName = DEFAULT_FOOTPRINTS_LIST_FILENAME;
|
m_DocModulesFileName = DEFAULT_FOOTPRINTS_LIST_FILENAME;
|
||||||
|
|
||||||
// Give an icon
|
// Give an icon
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
|
@ -151,13 +145,11 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
|
||||||
ReCreateMenuBar();
|
ReCreateMenuBar();
|
||||||
ReCreateHToolbar();
|
ReCreateHToolbar();
|
||||||
|
|
||||||
// Creation des listes de modules disponibles et des composants du schema
|
// Create list of available modules and components of the schematic
|
||||||
// Create child subwindows.
|
|
||||||
BuildCmpListBox();
|
BuildCmpListBox();
|
||||||
BuildFOOTPRINTS_LISTBOX();
|
BuildFOOTPRINTS_LISTBOX();
|
||||||
|
|
||||||
/* Creation des contraintes de dimension de la fenetre d'affichage des
|
/* Create size constraints of the component list window display. */
|
||||||
* composants du schema */
|
|
||||||
wxLayoutConstraints* linkpos = new wxLayoutConstraints;
|
wxLayoutConstraints* linkpos = new wxLayoutConstraints;
|
||||||
linkpos->top.SameAs( this, wxTop );
|
linkpos->top.SameAs( this, wxTop );
|
||||||
linkpos->bottom.SameAs( this, wxBottom );
|
linkpos->bottom.SameAs( this, wxBottom );
|
||||||
|
@ -166,8 +158,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
|
||||||
if( m_ListCmp )
|
if( m_ListCmp )
|
||||||
m_ListCmp->SetConstraints( linkpos );
|
m_ListCmp->SetConstraints( linkpos );
|
||||||
|
|
||||||
/* Creation des contraintes de dimension de la fenetre d'affichage des
|
/* Create size constraints for the footprint display window. */
|
||||||
* modules de la librairie */
|
|
||||||
linkpos = new wxLayoutConstraints;
|
linkpos = new wxLayoutConstraints;
|
||||||
linkpos->top.SameAs( m_ListCmp, wxTop );
|
linkpos->top.SameAs( m_ListCmp, wxTop );
|
||||||
linkpos->bottom.SameAs( m_ListCmp, wxBottom );
|
linkpos->bottom.SameAs( m_ListCmp, wxBottom );
|
||||||
|
@ -183,38 +174,37 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
|
||||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||||
|
|
||||||
#if defined(KICAD_AUIMANAGER)
|
#if defined(KICAD_AUIMANAGER)
|
||||||
m_auimgr.SetManagedWindow(this);
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
wxAuiPaneInfo horiz;
|
wxAuiPaneInfo horiz;
|
||||||
horiz.Gripper(false);
|
horiz.Gripper( false );
|
||||||
horiz.DockFixed(true);
|
horiz.DockFixed( true );
|
||||||
horiz.Movable(false);
|
horiz.Movable( false );
|
||||||
horiz.Floatable(false);
|
horiz.Floatable( false );
|
||||||
horiz.CloseButton(false);
|
horiz.CloseButton( false );
|
||||||
horiz.CaptionVisible(false);
|
horiz.CaptionVisible( false );
|
||||||
|
|
||||||
wxAuiPaneInfo vert(horiz);
|
wxAuiPaneInfo vert( horiz );
|
||||||
|
|
||||||
vert.TopDockable(false).BottomDockable(false);
|
vert.TopDockable( false ).BottomDockable( false );
|
||||||
horiz.LeftDockable(false).RightDockable(false);
|
horiz.LeftDockable( false ).RightDockable( false );
|
||||||
|
|
||||||
m_auimgr.AddPane(m_HToolBar,
|
m_auimgr.AddPane( m_HToolBar,
|
||||||
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());
|
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top() );
|
||||||
|
|
||||||
m_auimgr.AddPane(m_FootprintList,
|
m_auimgr.AddPane( m_FootprintList,
|
||||||
wxAuiPaneInfo(horiz).Name(wxT("m_FootprintList")).Left().BestSize(m_FrameSize.x * 0.3 ,m_FrameSize.y * 0.9));
|
wxAuiPaneInfo( horiz ).Name( wxT( "m_FootprintList" ) ).
|
||||||
|
Left().BestSize( m_FrameSize.x * 0.3, m_FrameSize.y * 0.9 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane(m_ListCmp,
|
m_auimgr.AddPane( m_ListCmp,
|
||||||
wxAuiPaneInfo().Name(wxT("m_ListCmp")).CentrePane());
|
wxAuiPaneInfo().Name( wxT( "m_ListCmp" ) ).CentrePane() );
|
||||||
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************/
|
|
||||||
WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
|
WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
|
||||||
/******************************************/
|
|
||||||
{
|
{
|
||||||
wxConfig* config = wxGetApp().m_EDA_Config;
|
wxConfig* config = wxGetApp().m_EDA_Config;
|
||||||
|
|
||||||
|
@ -268,25 +258,19 @@ void WinEDA_CvpcbFrame::SaveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnSize( wxSizeEvent& event )
|
void WinEDA_CvpcbFrame::OnSize( wxSizeEvent& event )
|
||||||
/************************************************/
|
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::OnQuit( wxCommandEvent& event )
|
||||||
/******************************************************/
|
|
||||||
{
|
{
|
||||||
Close( TRUE );
|
Close( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
/**********************************************************/
|
|
||||||
{
|
{
|
||||||
int diag;
|
int diag;
|
||||||
|
|
||||||
|
@ -296,7 +280,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
wxMessageDialog dialog( this,
|
wxMessageDialog dialog( this,
|
||||||
_( "Net and component list modified.\nSave before exit ?" ),
|
_( "Net and component list modified.\nSave before exit ?" ),
|
||||||
_( "Confirmation" ),
|
_( "Confirmation" ),
|
||||||
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION | wxYES_DEFAULT );
|
wxYES_NO | wxCANCEL | wxICON_EXCLAMATION |
|
||||||
|
wxYES_DEFAULT );
|
||||||
|
|
||||||
ii = dialog.ShowModal();
|
ii = dialog.ShowModal();
|
||||||
|
|
||||||
|
@ -330,7 +315,8 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
// Close the help frame
|
// Close the help frame
|
||||||
if( wxGetApp().m_HtmlCtrl )
|
if( wxGetApp().m_HtmlCtrl )
|
||||||
{
|
{
|
||||||
if( wxGetApp().m_HtmlCtrl->GetFrame() ) // returns NULL if no help frame active
|
if( wxGetApp().m_HtmlCtrl->GetFrame() ) // returns NULL if no help
|
||||||
|
// frame active
|
||||||
wxGetApp().m_HtmlCtrl->GetFrame()->Close( TRUE );
|
wxGetApp().m_HtmlCtrl->GetFrame()->Close( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,35 +332,31 @@ void WinEDA_CvpcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnChar( wxKeyEvent& event )
|
void WinEDA_CvpcbFrame::OnChar( wxKeyEvent& event )
|
||||||
/************************************************/
|
|
||||||
{
|
{
|
||||||
switch( event.GetKeyCode() )
|
switch( event.GetKeyCode() )
|
||||||
{
|
{
|
||||||
case WXK_LEFT:
|
case WXK_LEFT:
|
||||||
case WXK_NUMPAD_LEFT:
|
case WXK_NUMPAD_LEFT:
|
||||||
m_ListCmp->SetFocus();
|
m_ListCmp->SetFocus();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WXK_RIGHT:
|
case WXK_RIGHT:
|
||||||
case WXK_NUMPAD_RIGHT:
|
case WXK_NUMPAD_RIGHT:
|
||||||
m_FootprintList->SetFocus();;
|
m_FootprintList->SetFocus();;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
event.Skip();
|
event.Skip();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
|
||||||
/*******************************************************/
|
|
||||||
{
|
{
|
||||||
int ii = 0;
|
int ii = 0;
|
||||||
int selection;
|
int selection;
|
||||||
|
|
||||||
if( m_components.empty() )
|
if( m_components.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -384,8 +366,7 @@ void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
|
||||||
if( selection < 0 )
|
if( selection < 0 )
|
||||||
selection = 0;
|
selection = 0;
|
||||||
|
|
||||||
BOOST_FOREACH( COMPONENT& component, m_components )
|
BOOST_FOREACH( COMPONENT & component, m_components ) {
|
||||||
{
|
|
||||||
if( component.m_Module.IsEmpty() && ii > selection )
|
if( component.m_Module.IsEmpty() && ii > selection )
|
||||||
{
|
{
|
||||||
m_ListCmp->SetSelection( ii );
|
m_ListCmp->SetSelection( ii );
|
||||||
|
@ -400,12 +381,10 @@ void WinEDA_CvpcbFrame::ToFirstNA( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event )
|
||||||
/**********************************************************/
|
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
int selection;
|
int selection;
|
||||||
|
|
||||||
if( m_components.empty() )
|
if( m_components.empty() )
|
||||||
return;
|
return;
|
||||||
|
@ -416,7 +395,7 @@ void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event )
|
||||||
if( selection < 0 )
|
if( selection < 0 )
|
||||||
selection = m_ListCmp->GetCount() - 1;
|
selection = m_ListCmp->GetCount() - 1;
|
||||||
|
|
||||||
BOOST_REVERSE_FOREACH( COMPONENT& component, m_components )
|
BOOST_REVERSE_FOREACH( COMPONENT & component, m_components )
|
||||||
{
|
{
|
||||||
if( component.m_Module.IsEmpty() && ii < selection )
|
if( component.m_Module.IsEmpty() && ii < selection )
|
||||||
{
|
{
|
||||||
|
@ -431,33 +410,29 @@ void WinEDA_CvpcbFrame::ToPreviousNA( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::SaveQuitCvpcb( wxCommandEvent& event )
|
||||||
/**********************************************************/
|
|
||||||
{
|
{
|
||||||
if( SaveNetList( wxEmptyString ) > 0 )
|
if( SaveNetList( wxEmptyString ) > 0 )
|
||||||
{
|
{
|
||||||
m_modified = false;
|
m_modified = false;
|
||||||
if ( ! m_KeepCvpcbOpen )
|
if( !m_KeepCvpcbOpen )
|
||||||
Close( TRUE );
|
Close( TRUE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************/
|
/* Removes all associations already made
|
||||||
void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
|
|
||||||
/*************************************************************/
|
|
||||||
|
|
||||||
/* Supprime toutes les associations deja faites
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void WinEDA_CvpcbFrame::DelAssociations( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxString Line;
|
wxString Line;
|
||||||
|
|
||||||
if( IsOK( this, _( "Delete selections" ) ) )
|
if( IsOK( this, _( "Delete selections" ) ) )
|
||||||
{
|
{
|
||||||
m_ListCmp->SetSelection( 0 );
|
m_ListCmp->SetSelection( 0 );
|
||||||
|
|
||||||
BOOST_FOREACH( COMPONENT& component, m_components )
|
BOOST_FOREACH( COMPONENT & component, m_components )
|
||||||
{
|
{
|
||||||
component.m_Module.Empty();
|
component.m_Module.Empty();
|
||||||
SetNewPkg( wxEmptyString );
|
SetNewPkg( wxEmptyString );
|
||||||
|
@ -483,7 +458,7 @@ void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event )
|
||||||
wxFileName newFileName;
|
wxFileName newFileName;
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
|
||||||
if ( id >= wxID_FILE1 && id <= wxID_FILE9 )
|
if( id >= wxID_FILE1 && id <= wxID_FILE9 )
|
||||||
{
|
{
|
||||||
newFileName = GetFileFromHistory( id, _( "Netlist" ) );
|
newFileName = GetFileFromHistory( id, _( "Netlist" ) );
|
||||||
}
|
}
|
||||||
|
@ -529,11 +504,10 @@ void WinEDA_CvpcbFrame::LoadNetList( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::ConfigCvpcb( wxCommandEvent& event )
|
||||||
/***********************************************************/
|
|
||||||
{
|
{
|
||||||
DIALOG_CVPCB_CONFIG ConfigFrame( this );
|
DIALOG_CVPCB_CONFIG ConfigFrame( this );
|
||||||
|
|
||||||
ConfigFrame.ShowModal();
|
ConfigFrame.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,13 +518,7 @@ void WinEDA_CvpcbFrame::OnKeepOpenOnSave( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
|
||||||
/************************************************************/
|
|
||||||
|
|
||||||
/* Fonction liee au boutton "Visu"
|
|
||||||
* Affiche l'ecran de visualisation des modules
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
CreateScreenCmp();
|
CreateScreenCmp();
|
||||||
DrawFrame->AdjustScrollBars();
|
DrawFrame->AdjustScrollBars();
|
||||||
|
@ -558,9 +526,7 @@ void WinEDA_CvpcbFrame::DisplayModule( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
|
||||||
/********************************************************/
|
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
|
||||||
|
@ -571,36 +537,28 @@ void WinEDA_CvpcbFrame::SetLanguage( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
|
void WinEDA_CvpcbFrame::DisplayDocFile( wxCommandEvent& event )
|
||||||
/*************************************************************/
|
|
||||||
{
|
{
|
||||||
GetAssociatedDocument( this, m_DocModulesFileName,
|
GetAssociatedDocument( this, m_DocModulesFileName,
|
||||||
&wxGetApp().GetLibraryPathList() );
|
&wxGetApp().GetLibraryPathList() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnLeftClick( wxListEvent& event )
|
void WinEDA_CvpcbFrame::OnLeftClick( wxListEvent& event )
|
||||||
/******************************************************/
|
|
||||||
{
|
{
|
||||||
m_FootprintList->OnLeftClick( event );
|
m_FootprintList->OnLeftClick( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnLeftDClick( wxListEvent& event )
|
void WinEDA_CvpcbFrame::OnLeftDClick( wxListEvent& event )
|
||||||
/******************************************************/
|
|
||||||
{
|
{
|
||||||
m_FootprintList->OnLeftDClick( event );
|
m_FootprintList->OnLeftDClick( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
|
void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
|
||||||
/*************************************************************/
|
|
||||||
{
|
{
|
||||||
int selection;
|
int selection;
|
||||||
|
|
||||||
if( !m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
|
if( !m_HToolBar->GetToolState( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST ) )
|
||||||
{
|
{
|
||||||
|
@ -626,12 +584,9 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
void WinEDA_CvpcbFrame::OnSelectFilteringFootprint( wxCommandEvent& event )
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
/* Select full/filtered footprint display on tool click
|
/* Select full/filtered footprint display on tool click
|
||||||
*/
|
*/
|
||||||
|
void WinEDA_CvpcbFrame::OnSelectFilteringFootprint( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxListEvent l_event;
|
wxListEvent l_event;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**********************************************/
|
/*********/
|
||||||
/* CVPCB : declaration des variables globales */
|
/* CVPCB */
|
||||||
/**********************************************/
|
/*********/
|
||||||
|
|
||||||
#ifndef __CVPCB_H__
|
#ifndef __CVPCB_H__
|
||||||
#define __CVPCB_H__
|
#define __CVPCB_H__
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
|
|
||||||
// config for footprints doc file acces
|
// config for footprints doc file access
|
||||||
#define DEFAULT_FOOTPRINTS_LIST_FILENAME wxT( "footprints_doc/footprints.pdf" )
|
#define DEFAULT_FOOTPRINTS_LIST_FILENAME wxT( "footprints_doc/footprints.pdf" )
|
||||||
|
|
||||||
// Define print format to display a schematic component line
|
// Define print format to display a schematic component line
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#define FILTERFOOTPRINTKEY "FilterFootprint"
|
#define FILTERFOOTPRINTKEY "FilterFootprint"
|
||||||
|
|
||||||
/* Types de netliste: */
|
/* Net list types. */
|
||||||
#define TYPE_NON_SPECIFIE 0
|
#define TYPE_NON_SPECIFIE 0
|
||||||
#define TYPE_ORCADPCB2 1
|
#define TYPE_ORCADPCB2 1
|
||||||
#define TYPE_PCAD 2
|
#define TYPE_PCAD 2
|
||||||
|
@ -30,12 +30,12 @@
|
||||||
class PIN
|
class PIN
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int m_Index; /* variable utilisee selon types de netlistes */
|
int m_Index; /* Type of net list. */
|
||||||
int m_Type; /* code type electrique ( Entree Sortie Passive..) */
|
int m_Type; /* Electrical connection type. */
|
||||||
wxString m_Net; /* Pointeur sur le texte nom de net */
|
wxString m_Net; /* Name of net. */
|
||||||
wxString m_Number;
|
wxString m_Number;
|
||||||
wxString m_Name;
|
wxString m_Name;
|
||||||
wxString m_Repere; /* utilise selon formats de netliste */
|
wxString m_Repere; /* Formats used by net lister. */
|
||||||
|
|
||||||
PIN();
|
PIN();
|
||||||
};
|
};
|
||||||
|
@ -55,14 +55,14 @@ extern bool same_pin_net( const PIN* item1, const PIN* item2 );
|
||||||
class COMPONENT
|
class COMPONENT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int m_Num; /* Numero d'ordre */
|
int m_Num; /* Component number. */
|
||||||
int m_Multi; /* Nombre d' unites par boitier */
|
int m_Multi; /* Part if component has multiple parts. */
|
||||||
PIN_LIST m_Pins; /* pointeur sur la liste des Pins */
|
PIN_LIST m_Pins; /* List of component pins. */
|
||||||
wxString m_Reference; /* U3, R5 ... */
|
wxString m_Reference; /* Reference designator: U3, R5 ... */
|
||||||
wxString m_Value; /* 7400, 47K ... */
|
wxString m_Value; /* Value: 7400, 47K ... */
|
||||||
wxString m_TimeStamp; /* Signature temporelle ("00000000" si absente) */
|
wxString m_TimeStamp; /* Time stamp ("00000000" if absent) */
|
||||||
wxString m_Module; /* Nom du module (Package) corresp */
|
wxString m_Module; /* Footprint (module) name. */
|
||||||
wxString m_Repere; /* utilise selon formats de netliste */
|
wxString m_Repere; /* Net list format */
|
||||||
wxArrayString m_FootprintFilter; /* List of allowed footprints (wildcards
|
wxArrayString m_FootprintFilter; /* List of allowed footprints (wildcards
|
||||||
* allowed ). If empty: no filtering */
|
* allowed ). If empty: no filtering */
|
||||||
|
|
||||||
|
@ -79,11 +79,11 @@ extern bool operator<( const COMPONENT& item1, const COMPONENT& item2 );
|
||||||
class FOOTPRINT
|
class FOOTPRINT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxString m_Module; /* Nom du module */
|
wxString m_Module; /* Module name. */
|
||||||
wxString m_LibName; /* Nom de la librairie contenant ce module */
|
wxString m_LibName; /* Name of the library containing this module. */
|
||||||
int m_Num; /* Numero d'ordre pour affichage sur la liste */
|
int m_Num; /* Order number in the display list. */
|
||||||
wxString m_Doc; /* Doc associee */
|
wxString m_Doc; /* Footprint description. */
|
||||||
wxString m_KeyWord; /* Mots cles associes */
|
wxString m_KeyWord; /* Footprint key words. */
|
||||||
|
|
||||||
FOOTPRINT();
|
FOOTPRINT();
|
||||||
};
|
};
|
||||||
|
@ -93,7 +93,6 @@ typedef boost::ptr_vector< FOOTPRINT > FOOTPRINT_LIST;
|
||||||
/* FOOTPRINT object list sort function. */
|
/* FOOTPRINT object list sort function. */
|
||||||
extern bool operator<( const FOOTPRINT& item1, const FOOTPRINT& item2 );
|
extern bool operator<( const FOOTPRINT& item1, const FOOTPRINT& item2 );
|
||||||
|
|
||||||
/* Gestion des noms des librairies */
|
|
||||||
extern const wxString FootprintAliasFileExtension;
|
extern const wxString FootprintAliasFileExtension;
|
||||||
extern const wxString RetroFileExtension;
|
extern const wxString RetroFileExtension;
|
||||||
extern const wxString ComponentFileExtension;
|
extern const wxString ComponentFileExtension;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/***********************************************************/
|
/*********************************************************/
|
||||||
/* cvstruct.h : */
|
/* cvstruct.h */
|
||||||
/* descriptions des principales classes derivees utilisees */
|
/*********************************************************/
|
||||||
/***********************************************************/
|
|
||||||
|
|
||||||
#ifndef CVSTRUCT_H
|
#ifndef CVSTRUCT_H
|
||||||
#define CVSTRUCT_H
|
#define CVSTRUCT_H
|
||||||
|
@ -59,7 +58,7 @@ public:
|
||||||
FOOTPRINTS_LISTBOX* m_FootprintList;
|
FOOTPRINTS_LISTBOX* m_FootprintList;
|
||||||
COMPONENTS_LISTBOX* m_ListCmp;
|
COMPONENTS_LISTBOX* m_ListCmp;
|
||||||
WinEDA_DisplayFrame* DrawFrame;
|
WinEDA_DisplayFrame* DrawFrame;
|
||||||
WinEDA_Toolbar* m_HToolBar; // Toolbar horizontal haut d'ecran
|
WinEDA_Toolbar* m_HToolBar;
|
||||||
wxFileName m_NetlistFileName;
|
wxFileName m_NetlistFileName;
|
||||||
wxArrayString m_ModuleLibNames;
|
wxArrayString m_ModuleLibNames;
|
||||||
wxArrayString m_AliasLibNames;
|
wxArrayString m_AliasLibNames;
|
||||||
|
@ -76,7 +75,6 @@ protected:
|
||||||
bool m_isEESchemaNetlist;
|
bool m_isEESchemaNetlist;
|
||||||
PARAM_CFG_ARRAY m_projectFileParams;
|
PARAM_CFG_ARRAY m_projectFileParams;
|
||||||
|
|
||||||
// Constructor and destructor
|
|
||||||
public:
|
public:
|
||||||
WinEDA_CvpcbFrame( const wxString& title,
|
WinEDA_CvpcbFrame( const wxString& title,
|
||||||
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
|
||||||
|
@ -86,7 +84,7 @@ public:
|
||||||
void OnLeftDClick( wxListEvent& event );
|
void OnLeftDClick( wxListEvent& event );
|
||||||
void OnSelectComponent( wxListEvent& event );
|
void OnSelectComponent( wxListEvent& event );
|
||||||
|
|
||||||
void Update_Config( wxCommandEvent& event ); /* enregistrement de la config */
|
void Update_Config( wxCommandEvent& event );
|
||||||
void OnQuit( wxCommandEvent& event );
|
void OnQuit( wxCommandEvent& event );
|
||||||
void OnCloseWindow( wxCloseEvent& Event );
|
void OnCloseWindow( wxCloseEvent& Event );
|
||||||
void OnSize( wxSizeEvent& SizeEvent );
|
void OnSize( wxSizeEvent& SizeEvent );
|
||||||
|
@ -269,7 +267,8 @@ public:
|
||||||
* add a list of pickers to handle a list of items
|
* add a list of pickers to handle a list of items
|
||||||
* @param aItemsList = the list of items modified by the command to undo
|
* @param aItemsList = the list of items modified by the command to undo
|
||||||
* @param aTypeCommand = command type (see enum UndoRedoOpType)
|
* @param aTypeCommand = command type (see enum UndoRedoOpType)
|
||||||
* @param aTransformPoint = the reference point of the transformation, for commands like move
|
* @param aTransformPoint = the reference point of the transformation,
|
||||||
|
* for commands like move
|
||||||
*/
|
*/
|
||||||
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList,
|
||||||
UndoRedoOpType aTypeCommand,
|
UndoRedoOpType aTypeCommand,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Name: dialog_cvpcb_config.cpp
|
// Name: dialog_cvpcb_config.cpp
|
||||||
// Author: jean-pierre Charras
|
// Author: jean-pierre Charras
|
||||||
// Licence: gpl
|
// Licence: gpl
|
||||||
|
@ -40,9 +39,7 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( WinEDA_CvpcbFrame* parent ) :
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::Init()
|
void DIALOG_CVPCB_CONFIG::Init()
|
||||||
/*************************************/
|
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
|
@ -73,15 +70,13 @@ void DIALOG_CVPCB_CONFIG::Init()
|
||||||
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
m_DefaultLibraryPathslistBox->Append( libpaths[ii] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// select the first path afer the current path project
|
// select the first path after the current path project
|
||||||
if( libpaths.GetCount() > 1 )
|
if( libpaths.GetCount() > 1 )
|
||||||
m_DefaultLibraryPathslistBox->Select( 1 );
|
m_DefaultLibraryPathslistBox->Select( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
|
||||||
/******************************************************************/
|
|
||||||
{
|
{
|
||||||
// Recreate the user lib path
|
// Recreate the user lib path
|
||||||
if( m_LibPathChanged )
|
if( m_LibPathChanged )
|
||||||
|
@ -96,9 +91,7 @@ void DIALOG_CVPCB_CONFIG::OnCancelClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
|
||||||
/**************************************************************/
|
|
||||||
{
|
{
|
||||||
m_Parent->m_DocModulesFileName = m_TextHelpModulesFileName->GetValue();
|
m_Parent->m_DocModulesFileName = m_TextHelpModulesFileName->GetValue();
|
||||||
|
|
||||||
|
@ -114,8 +107,8 @@ void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set new active library list if the lib list of if default path list
|
||||||
// Set new active library list if the lib list of if default path list was modified
|
// was modified
|
||||||
if( m_LibListChanged || m_LibPathChanged )
|
if( m_LibListChanged || m_LibPathChanged )
|
||||||
{
|
{
|
||||||
// Recreate lib list
|
// Recreate lib list
|
||||||
|
@ -138,21 +131,16 @@ void DIALOG_CVPCB_CONFIG::OnOkClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnCloseWindow( wxCloseEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnCloseWindow( wxCloseEvent& event )
|
||||||
/**************************************************************/
|
|
||||||
{
|
{
|
||||||
EndModal( 0 );
|
EndModal( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
|
||||||
/*********************************************************************/
|
|
||||||
|
|
||||||
/* Remove a library to the library list.
|
/* Remove a library to the library list.
|
||||||
* The real list (g_LibName_List) is not changed, so the change can be cancelled
|
* The real list (g_LibName_List) is not changed, so the change can be canceled
|
||||||
*/
|
*/
|
||||||
|
void DIALOG_CVPCB_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
|
|
||||||
|
@ -170,15 +158,12 @@ void DIALOG_CVPCB_CONFIG::OnRemoveLibClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
|
||||||
/**************************************************************************/
|
|
||||||
|
|
||||||
/* Insert or add a library to the library list:
|
/* Insert or add a library to the library list:
|
||||||
* The new library is put in list before (insert button) the selection,
|
* The new library is put in list before (insert button) the selection,
|
||||||
* or added (add button) to end of list
|
* or added (add button) to end of list
|
||||||
* The real list (g_LibName_List) is not changed, so the change can be cancelled
|
* The real list (g_LibName_List) is not changed, so the change can be canceled
|
||||||
*/
|
*/
|
||||||
|
void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
wxString libfilename, wildcard;
|
wxString libfilename, wildcard;
|
||||||
|
@ -235,7 +220,7 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
||||||
fn.SetExt(wxEmptyString);
|
fn.SetExt(wxEmptyString);
|
||||||
libfilename = fn.GetFullPath();
|
libfilename = fn.GetFullPath();
|
||||||
|
|
||||||
//Add or insert new library name, if not already in list
|
// Add or insert new library name, if not already in list
|
||||||
if( list->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
|
if( list->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )
|
||||||
{
|
{
|
||||||
m_LibListChanged = TRUE;
|
m_LibListChanged = TRUE;
|
||||||
|
@ -254,16 +239,14 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
||||||
/***********************************************************************/
|
|
||||||
{
|
{
|
||||||
wxString path = wxGetApp().ReturnLastVisitedLibraryPath();
|
wxString path = wxGetApp().ReturnLastVisitedLibraryPath();
|
||||||
|
|
||||||
bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ), /* Titre de la fenetre */
|
bool select = EDA_DirectorySelector( _( "Default Path for Libraries" ),
|
||||||
path, /* Chemin par defaut */
|
path,
|
||||||
wxDD_DEFAULT_STYLE,
|
wxDD_DEFAULT_STYLE,
|
||||||
this, /* parent frame */
|
this,
|
||||||
wxDefaultPosition );
|
wxDefaultPosition );
|
||||||
|
|
||||||
if( !select )
|
if( !select )
|
||||||
|
@ -303,9 +286,7 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertPath( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
||||||
/***********************************************************************/
|
|
||||||
{
|
{
|
||||||
int ii = m_listUserPaths->GetSelection();
|
int ii = m_listUserPaths->GetSelection();
|
||||||
|
|
||||||
|
@ -328,9 +309,7 @@ void DIALOG_CVPCB_CONFIG::OnRemoveUserPath( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************/
|
|
||||||
void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event )
|
void DIALOG_CVPCB_CONFIG::OnBrowseModDocFile( wxCommandEvent& event )
|
||||||
/**************************************************************************/
|
|
||||||
{
|
{
|
||||||
wxString FullFileName;
|
wxString FullFileName;
|
||||||
wxString docpath, filename;
|
wxString docpath, filename;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Name: dialog_display_options.cpp
|
// Name: dialog_display_options.cpp
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Author: jean-pierre Charras
|
// Author: jean-pierre Charras
|
||||||
|
@ -32,17 +33,14 @@
|
||||||
////@end XPM images
|
////@end XPM images
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
void WinEDA_DisplayFrame::InstallOptionsDisplay( wxCommandEvent& event )
|
||||||
void WinEDA_DisplayFrame::InstallOptionsDisplay(wxCommandEvent& event)
|
|
||||||
/*********************************************************************/
|
|
||||||
/* Creation de la fenetre d'options de la fenetre de visu */
|
|
||||||
{
|
{
|
||||||
WinEDA_FootprintDisplayOptionsFrame* OptionWindow =
|
WinEDA_FootprintDisplayOptionsFrame* OptionWindow =
|
||||||
new WinEDA_FootprintDisplayOptionsFrame(this);
|
new WinEDA_FootprintDisplayOptionsFrame( this );
|
||||||
OptionWindow->ShowModal();
|
|
||||||
OptionWindow->Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OptionWindow->ShowModal();
|
||||||
|
OptionWindow->Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -72,49 +70,65 @@ END_EVENT_TABLE()
|
||||||
* WinEDA_FootprintDisplayOptionsFrame constructors
|
* WinEDA_FootprintDisplayOptionsFrame constructors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
WinEDA_FootprintDisplayOptionsFrame::WinEDA_FootprintDisplayOptionsFrame( )
|
WinEDA_FootprintDisplayOptionsFrame::WinEDA_FootprintDisplayOptionsFrame()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WinEDA_FootprintDisplayOptionsFrame::WinEDA_FootprintDisplayOptionsFrame( WinEDA_BasePcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
|
||||||
{
|
|
||||||
m_Parent = parent;
|
|
||||||
|
|
||||||
Create(parent, id, caption, pos, size, style);
|
WinEDA_FootprintDisplayOptionsFrame::WinEDA_FootprintDisplayOptionsFrame(
|
||||||
|
WinEDA_BasePcbFrame* parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& caption,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style )
|
||||||
|
{
|
||||||
|
m_Parent = parent;
|
||||||
|
|
||||||
|
Create( parent, id, caption, pos, size, style );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* WinEDA_FootprintDisplayOptionsFrame creator
|
* WinEDA_FootprintDisplayOptionsFrame creator
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
bool WinEDA_FootprintDisplayOptionsFrame::Create( wxWindow* parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& caption,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style )
|
||||||
{
|
{
|
||||||
////@begin WinEDA_FootprintDisplayOptionsFrame member initialisation
|
////@begin WinEDA_FootprintDisplayOptionsFrame member initialisation
|
||||||
OuterBoxSizer = NULL;
|
OuterBoxSizer = NULL;
|
||||||
MainBoxSizer = NULL;
|
MainBoxSizer = NULL;
|
||||||
m_EdgesDisplayOption = NULL;
|
m_EdgesDisplayOption = NULL;
|
||||||
m_TextDisplayOption = NULL;
|
m_TextDisplayOption = NULL;
|
||||||
ColumnBoxSizer = NULL;
|
ColumnBoxSizer = NULL;
|
||||||
m_IsShowPadFill = NULL;
|
m_IsShowPadFill = NULL;
|
||||||
m_IsShowViaFill = NULL;
|
m_IsShowViaFill = NULL;
|
||||||
m_IsShowPadNum = NULL;
|
m_IsShowPadNum = NULL;
|
||||||
m_CancelButton = NULL;
|
m_CancelButton = NULL;
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame member initialisation
|
////@end WinEDA_FootprintDisplayOptionsFrame member initialisation
|
||||||
|
|
||||||
////@begin WinEDA_FootprintDisplayOptionsFrame creation
|
////@begin WinEDA_FootprintDisplayOptionsFrame creation
|
||||||
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
|
SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
|
||||||
wxDialog::Create( parent, id, caption, pos, size, style );
|
wxDialog::Create( parent, id, caption, pos, size, style );
|
||||||
|
|
||||||
CreateControls();
|
CreateControls();
|
||||||
if (GetSizer())
|
if( GetSizer() )
|
||||||
{
|
{
|
||||||
GetSizer()->SetSizeHints(this);
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
Centre();
|
Centre();
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame creation
|
////@end WinEDA_FootprintDisplayOptionsFrame creation
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Control creation for WinEDA_FootprintDisplayOptionsFrame
|
* Control creation for WinEDA_FootprintDisplayOptionsFrame
|
||||||
*/
|
*/
|
||||||
|
@ -126,73 +140,108 @@ void WinEDA_FootprintDisplayOptionsFrame::CreateControls()
|
||||||
|
|
||||||
WinEDA_FootprintDisplayOptionsFrame* itemDialog1 = this;
|
WinEDA_FootprintDisplayOptionsFrame* itemDialog1 = this;
|
||||||
|
|
||||||
OuterBoxSizer = new wxBoxSizer(wxVERTICAL);
|
OuterBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
itemDialog1->SetSizer(OuterBoxSizer);
|
itemDialog1->SetSizer( OuterBoxSizer );
|
||||||
|
|
||||||
MainBoxSizer = new wxBoxSizer(wxHORIZONTAL);
|
MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
OuterBoxSizer->Add(MainBoxSizer, 1, wxGROW|wxALL, 5);
|
OuterBoxSizer->Add( MainBoxSizer, 1, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
wxArrayString m_EdgesDisplayOptionStrings;
|
wxArrayString m_EdgesDisplayOptionStrings;
|
||||||
m_EdgesDisplayOptionStrings.Add(_("&Line"));
|
m_EdgesDisplayOptionStrings.Add( _( "&Line" ) );
|
||||||
m_EdgesDisplayOptionStrings.Add(_("&Filled"));
|
m_EdgesDisplayOptionStrings.Add( _( "&Filled" ) );
|
||||||
m_EdgesDisplayOptionStrings.Add(_("&Sketch"));
|
m_EdgesDisplayOptionStrings.Add( _( "&Sketch" ) );
|
||||||
m_EdgesDisplayOption = new wxRadioBox( itemDialog1, EDGE_SELECT, _("Edges:"), wxDefaultPosition, wxDefaultSize, m_EdgesDisplayOptionStrings, 1, wxRA_SPECIFY_COLS );
|
m_EdgesDisplayOption =
|
||||||
m_EdgesDisplayOption->SetSelection(0);
|
new wxRadioBox( itemDialog1, EDGE_SELECT, _( "Edges:" ),
|
||||||
MainBoxSizer->Add(m_EdgesDisplayOption, 0, wxALIGN_TOP|wxALL, 5);
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
m_EdgesDisplayOptionStrings,
|
||||||
|
1, wxRA_SPECIFY_COLS );
|
||||||
|
m_EdgesDisplayOption->SetSelection( 0 );
|
||||||
|
MainBoxSizer->Add( m_EdgesDisplayOption, 0, wxALIGN_TOP | wxALL, 5 );
|
||||||
|
|
||||||
wxArrayString m_TextDisplayOptionStrings;
|
wxArrayString m_TextDisplayOptionStrings;
|
||||||
m_TextDisplayOptionStrings.Add(_("&Line"));
|
m_TextDisplayOptionStrings.Add( _( "&Line" ) );
|
||||||
m_TextDisplayOptionStrings.Add(_("&Filled"));
|
m_TextDisplayOptionStrings.Add( _( "&Filled" ) );
|
||||||
m_TextDisplayOptionStrings.Add(_("&Sketch"));
|
m_TextDisplayOptionStrings.Add( _( "&Sketch" ) );
|
||||||
m_TextDisplayOption = new wxRadioBox( itemDialog1, TEXT_SELECT, _("Texts:"), wxDefaultPosition, wxDefaultSize, m_TextDisplayOptionStrings, 1, wxRA_SPECIFY_COLS );
|
m_TextDisplayOption =
|
||||||
m_TextDisplayOption->SetSelection(0);
|
new wxRadioBox( itemDialog1, TEXT_SELECT, _( "Texts:" ),
|
||||||
MainBoxSizer->Add(m_TextDisplayOption, 0, wxALIGN_TOP|wxALL, 5);
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
m_TextDisplayOptionStrings, 1,
|
||||||
|
wxRA_SPECIFY_COLS );
|
||||||
|
m_TextDisplayOption->SetSelection( 0 );
|
||||||
|
MainBoxSizer->Add( m_TextDisplayOption, 0, wxALIGN_TOP | wxALL, 5 );
|
||||||
|
|
||||||
ColumnBoxSizer = new wxBoxSizer(wxVERTICAL);
|
ColumnBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
MainBoxSizer->Add(ColumnBoxSizer, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
MainBoxSizer->Add( ColumnBoxSizer, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||||
|
|
||||||
m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT, _("Fill &pad"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
m_IsShowPadFill = new wxCheckBox( itemDialog1, PADFILL_OPT,
|
||||||
m_IsShowPadFill->SetValue(false);
|
_( "Fill &pad" ), wxDefaultPosition,
|
||||||
ColumnBoxSizer->Add(m_IsShowPadFill, 1, wxGROW|wxALL, 5);
|
wxDefaultSize, wxCHK_2STATE );
|
||||||
|
m_IsShowPadFill->SetValue( false );
|
||||||
|
ColumnBoxSizer->Add( m_IsShowPadFill, 1, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
m_IsShowViaFill = new wxCheckBox( itemDialog1, VIAFILL_OPT, _("Fill &via"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
m_IsShowViaFill = new wxCheckBox( itemDialog1, VIAFILL_OPT,
|
||||||
m_IsShowViaFill->SetValue(false);
|
_( "Fill &via" ), wxDefaultPosition,
|
||||||
ColumnBoxSizer->Add(m_IsShowViaFill, 1, wxGROW|wxALL, 5);
|
wxDefaultSize, wxCHK_2STATE );
|
||||||
|
m_IsShowViaFill->SetValue( false );
|
||||||
|
ColumnBoxSizer->Add( m_IsShowViaFill, 1, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
m_IsShowPadNum = new wxCheckBox( itemDialog1, PADNUM_OPT, _("Show pad &number"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
m_IsShowPadNum =
|
||||||
m_IsShowPadNum->SetValue(false);
|
new wxCheckBox( itemDialog1, PADNUM_OPT, _( "Show pad &number" ),
|
||||||
if (WinEDA_FootprintDisplayOptionsFrame::ShowToolTips())
|
wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||||
m_IsShowPadNum->SetToolTip(_("Display pad number"));
|
m_IsShowPadNum->SetValue( false );
|
||||||
ColumnBoxSizer->Add(m_IsShowPadNum, 1, wxGROW|wxALL, 5);
|
if( WinEDA_FootprintDisplayOptionsFrame::ShowToolTips() )
|
||||||
|
m_IsShowPadNum->SetToolTip( _( "Display pad number" ) );
|
||||||
|
ColumnBoxSizer->Add( m_IsShowPadNum, 1, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
wxStaticLine* itemStaticLine9 = new wxStaticLine( itemDialog1, ID_STATICLINE1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
wxStaticLine* itemStaticLine9 = new wxStaticLine( itemDialog1,
|
||||||
OuterBoxSizer->Add(itemStaticLine9, 0, wxGROW|wxALL, 5);
|
ID_STATICLINE1,
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
wxLI_HORIZONTAL );
|
||||||
|
OuterBoxSizer->Add( itemStaticLine9, 0, wxGROW | wxALL, 5 );
|
||||||
|
|
||||||
wxStdDialogButtonSizer* itemStdDialogButtonSizer10 = new wxStdDialogButtonSizer;
|
wxStdDialogButtonSizer* itemStdDialogButtonSizer10 =
|
||||||
|
new wxStdDialogButtonSizer;
|
||||||
|
|
||||||
OuterBoxSizer->Add(itemStdDialogButtonSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
OuterBoxSizer->Add( itemStdDialogButtonSizer10,
|
||||||
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
0,
|
||||||
itemStdDialogButtonSizer10->AddButton(itemButton11);
|
wxALIGN_CENTER_HORIZONTAL | wxALL,
|
||||||
|
5 );
|
||||||
|
wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _( "&OK" ),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize, 0 );
|
||||||
|
itemStdDialogButtonSizer10->AddButton( itemButton11 );
|
||||||
|
|
||||||
m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_CancelButton = new wxButton( itemDialog1, wxID_CANCEL, _( "&Cancel" ),
|
||||||
itemStdDialogButtonSizer10->AddButton(m_CancelButton);
|
wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
itemStdDialogButtonSizer10->AddButton( m_CancelButton );
|
||||||
|
|
||||||
wxButton* itemButton13 = new wxButton( itemDialog1, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxButton* itemButton13 =
|
||||||
itemStdDialogButtonSizer10->AddButton(itemButton13);
|
new wxButton( itemDialog1, wxID_APPLY, _( "&Apply" ),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
itemStdDialogButtonSizer10->AddButton( itemButton13 );
|
||||||
|
|
||||||
itemStdDialogButtonSizer10->Realize();
|
itemStdDialogButtonSizer10->Realize();
|
||||||
|
|
||||||
// Set validators
|
// Set validators
|
||||||
m_EdgesDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModEdge) );
|
m_EdgesDisplayOption->SetValidator( wxGenericValidator( &DisplayOpt.
|
||||||
m_TextDisplayOption->SetValidator( wxGenericValidator(& DisplayOpt.DisplayModText) );
|
DisplayModEdge ) );
|
||||||
m_IsShowPadFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayPadFill) );
|
m_TextDisplayOption->SetValidator( wxGenericValidator( &DisplayOpt.
|
||||||
m_IsShowViaFill->SetValidator( wxGenericValidator( & DisplayOpt.DisplayViaFill) );
|
DisplayModText ) );
|
||||||
m_IsShowPadNum->SetValidator( wxGenericValidator(& DisplayOpt.DisplayPadNum) );
|
m_IsShowPadFill->SetValidator( wxGenericValidator( &DisplayOpt.
|
||||||
|
DisplayPadFill ) );
|
||||||
|
m_IsShowViaFill->SetValidator( wxGenericValidator( &DisplayOpt.
|
||||||
|
DisplayViaFill ) );
|
||||||
|
m_IsShowPadNum->SetValidator( wxGenericValidator( &DisplayOpt.
|
||||||
|
DisplayPadNum ) );
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame content construction
|
////@end WinEDA_FootprintDisplayOptionsFrame content construction
|
||||||
|
|
||||||
m_CancelButton->SetFocus(); /* Necessary to use escape key as cancel under wxGRk */
|
/* Necessary to use escape key as cancel under wxGTK. */
|
||||||
|
m_CancelButton->SetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Should we show tooltips?
|
* Should we show tooltips?
|
||||||
*/
|
*/
|
||||||
|
@ -202,59 +251,69 @@ bool WinEDA_FootprintDisplayOptionsFrame::ShowToolTips()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get bitmap resources
|
* Get bitmap resources
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxBitmap WinEDA_FootprintDisplayOptionsFrame::GetBitmapResource( const wxString& name )
|
wxBitmap WinEDA_FootprintDisplayOptionsFrame::GetBitmapResource(
|
||||||
|
const wxString& name )
|
||||||
{
|
{
|
||||||
// Bitmap retrieval
|
// Bitmap retrieval
|
||||||
////@begin WinEDA_FootprintDisplayOptionsFrame bitmap retrieval
|
////@begin WinEDA_FootprintDisplayOptionsFrame bitmap retrieval
|
||||||
wxUnusedVar(name);
|
wxUnusedVar( name );
|
||||||
return wxNullBitmap;
|
return wxNullBitmap;
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame bitmap retrieval
|
////@end WinEDA_FootprintDisplayOptionsFrame bitmap retrieval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get icon resources
|
* Get icon resources
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxIcon WinEDA_FootprintDisplayOptionsFrame::GetIconResource( const wxString& name )
|
wxIcon WinEDA_FootprintDisplayOptionsFrame::GetIconResource(
|
||||||
|
const wxString& name )
|
||||||
{
|
{
|
||||||
// Icon retrieval
|
// Icon retrieval
|
||||||
////@begin WinEDA_FootprintDisplayOptionsFrame icon retrieval
|
////@begin WinEDA_FootprintDisplayOptionsFrame icon retrieval
|
||||||
wxUnusedVar(name);
|
wxUnusedVar( name );
|
||||||
return wxNullIcon;
|
return wxNullIcon;
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame icon retrieval
|
////@end WinEDA_FootprintDisplayOptionsFrame icon retrieval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Update settings related to edges, text strings, and pads
|
* Update settings related to edges, text strings, and pads
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings(void)
|
void WinEDA_FootprintDisplayOptionsFrame::UpdateObjectSettings( void )
|
||||||
{
|
{
|
||||||
// Update settings
|
// Update settings
|
||||||
////@begin WinEDA_FootprintDisplayOptionsFrame update settings
|
////@begin WinEDA_FootprintDisplayOptionsFrame update settings
|
||||||
m_Parent->m_DisplayModEdge = m_EdgesDisplayOption->GetSelection();
|
m_Parent->m_DisplayModEdge = m_EdgesDisplayOption->GetSelection();
|
||||||
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
|
m_Parent->m_DisplayModText = m_TextDisplayOption->GetSelection();
|
||||||
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
|
m_Parent->m_DisplayPadNum = m_IsShowPadNum->GetValue();
|
||||||
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
|
m_Parent->m_DisplayPadFill = m_IsShowPadFill->GetValue();
|
||||||
m_Parent->m_DisplayViaFill = m_IsShowViaFill->GetValue();
|
m_Parent->m_DisplayViaFill = m_IsShowViaFill->GetValue();
|
||||||
m_Parent->DrawPanel->Refresh();
|
m_Parent->DrawPanel->Refresh();
|
||||||
|
|
||||||
////@end WinEDA_FootprintDisplayOptionsFrame update settings
|
////@end WinEDA_FootprintDisplayOptionsFrame update settings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void WinEDA_FootprintDisplayOptionsFrame::OnOkClick( wxCommandEvent& event )
|
void WinEDA_FootprintDisplayOptionsFrame::OnOkClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
UpdateObjectSettings();
|
UpdateObjectSettings();
|
||||||
EndModal( 1 );
|
EndModal( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
||||||
*/
|
*/
|
||||||
|
@ -264,11 +323,12 @@ void WinEDA_FootprintDisplayOptionsFrame::OnCancelClick( wxCommandEvent& event )
|
||||||
EndModal( -1 );
|
EndModal( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
|
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void WinEDA_FootprintDisplayOptionsFrame::OnApplyClick( wxCommandEvent& event )
|
void WinEDA_FootprintDisplayOptionsFrame::OnApplyClick( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
UpdateObjectSettings();
|
UpdateObjectSettings();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*********************************************************************/
|
/**********************/
|
||||||
/** setvisu() : initialisations de l'ecran d'affichage du composant **/
|
/** displayframe.cpp **/
|
||||||
/*********************************************************************/
|
/**********************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "appl_wxstruct.h"
|
#include "appl_wxstruct.h"
|
||||||
|
@ -17,16 +17,12 @@
|
||||||
/*
|
/*
|
||||||
* NOTE: There is something in 3d_viewer.h that causes a compiler error in
|
* NOTE: There is something in 3d_viewer.h that causes a compiler error in
|
||||||
* <boost/foreach.hpp> in Linux so move it after cvpcb.h where it is
|
* <boost/foreach.hpp> in Linux so move it after cvpcb.h where it is
|
||||||
* included to prevent the error from occuring.
|
* included to prevent the error from occurring.
|
||||||
*/
|
*/
|
||||||
#include "3d_viewer.h"
|
#include "3d_viewer.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************/
|
|
||||||
/* Construction de la table des evenements pour WinEDA_DrawFrame */
|
|
||||||
/*****************************************************************/
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( WinEDA_DisplayFrame, WinEDA_BasePcbFrame )
|
BEGIN_EVENT_TABLE( WinEDA_DisplayFrame, WinEDA_BasePcbFrame )
|
||||||
EVT_CLOSE( WinEDA_DisplayFrame::OnCloseWindow )
|
EVT_CLOSE( WinEDA_DisplayFrame::OnCloseWindow )
|
||||||
EVT_SIZE( WinEDA_DrawFrame::OnSize )
|
EVT_SIZE( WinEDA_DrawFrame::OnSize )
|
||||||
|
@ -61,14 +57,15 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
|
||||||
SetBaseScreen( new PCB_SCREEN() );
|
SetBaseScreen( new PCB_SCREEN() );
|
||||||
|
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
// Initilialize grid id to a default value if not found in config or bad:
|
// Internalize grid id to a default value if not found in config or bad:
|
||||||
if( (m_LastGridSizeId <= 0) ||
|
if( (m_LastGridSizeId <= 0) ||
|
||||||
(m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
|
(m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
|
||||||
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;
|
m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;
|
||||||
|
|
||||||
// Initialize some display options
|
// Initialize some display options
|
||||||
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here
|
DisplayOpt.DisplayPadIsol = false; // Pad clearance has no meaning here
|
||||||
DisplayOpt.ShowTrackClearanceMode = 0; // tracks and vias clearance has no meaning here
|
DisplayOpt.ShowTrackClearanceMode = 0; /* tracks and vias clearance has
|
||||||
|
* no meaning here. */
|
||||||
|
|
||||||
|
|
||||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||||
|
@ -78,9 +75,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************/
|
|
||||||
WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
|
WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
|
||||||
/******************************************/
|
|
||||||
{
|
{
|
||||||
delete GetBoard();
|
delete GetBoard();
|
||||||
|
|
||||||
|
@ -91,13 +86,10 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************************/
|
|
||||||
void WinEDA_DisplayFrame::OnCloseWindow( wxCloseEvent& event )
|
|
||||||
/************************************************************/
|
|
||||||
|
|
||||||
/* Called when the frame is closed
|
/* Called when the frame is closed
|
||||||
* Save current settings (frame position and size
|
* Save current settings (frame position and size
|
||||||
*/
|
*/
|
||||||
|
void WinEDA_DisplayFrame::OnCloseWindow( wxCloseEvent& event )
|
||||||
{
|
{
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
wxSize size;
|
wxSize size;
|
||||||
|
@ -110,16 +102,12 @@ void WinEDA_DisplayFrame::OnCloseWindow( wxCloseEvent& event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************/
|
|
||||||
void WinEDA_DisplayFrame::ReCreateVToolbar()
|
void WinEDA_DisplayFrame::ReCreateVToolbar()
|
||||||
/************************************************/
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/************************************************/
|
|
||||||
void WinEDA_DisplayFrame::ReCreateHToolbar()
|
void WinEDA_DisplayFrame::ReCreateHToolbar()
|
||||||
/************************************************/
|
|
||||||
{
|
{
|
||||||
if( m_HToolBar != NULL )
|
if( m_HToolBar != NULL )
|
||||||
return;
|
return;
|
||||||
|
@ -161,38 +149,29 @@ void WinEDA_DisplayFrame::ReCreateHToolbar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************/
|
|
||||||
void WinEDA_DisplayFrame::SetToolbars()
|
void WinEDA_DisplayFrame::SetToolbars()
|
||||||
/*******************************************/
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
void WinEDA_DisplayFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
/*************************************************************************/
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
void WinEDA_DisplayFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
void WinEDA_DisplayFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||||
/*************************************************************************/
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
bool WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos,
|
||||||
bool WinEDA_DisplayFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
|
wxMenu* PopMenu )
|
||||||
/*********************************************************************************/
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************/
|
|
||||||
void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
|
void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
|
||||||
/****************************************************************/
|
|
||||||
{
|
{
|
||||||
wxRealPoint delta;
|
wxRealPoint delta;
|
||||||
int flagcurseur = 0;
|
int flagcurseur = 0;
|
||||||
|
@ -325,7 +304,7 @@ void WinEDA_DisplayFrame::Show3D_Frame( wxCommandEvent& event )
|
||||||
m_Draw3DFrame->Show( TRUE );
|
m_Draw3DFrame->Show( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Virtual fonction needed by the PCB_SCREEN class derived from BASE_SCREEN
|
/* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN
|
||||||
* this is a virtual pure function in BASE_SCREEN
|
* this is a virtual pure function in BASE_SCREEN
|
||||||
* do nothing in cvpcb
|
* do nothing in cvpcb
|
||||||
* could be removed later
|
* could be removed later
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/***************/
|
/*****************/
|
||||||
/* genstf() */
|
/* genequiv.cpp */
|
||||||
/***************/
|
/*****************/
|
||||||
|
|
||||||
/* genere le fichier STF type 'ref' 'nom_empreinte' pour DRAFT */
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "wxstruct.h"
|
#include "wxstruct.h"
|
||||||
|
@ -24,7 +22,6 @@ void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
|
||||||
if( m_components.empty() )
|
if( m_components.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* calcul du nom du fichier */
|
|
||||||
fn.SetExt( RetroFileExtension );
|
fn.SetExt( RetroFileExtension );
|
||||||
|
|
||||||
wxFileDialog dlg( this, wxT( "Save Stuff File" ), fn.GetPath(),
|
wxFileDialog dlg( this, wxT( "Save Stuff File" ), fn.GetPath(),
|
||||||
|
@ -43,10 +40,8 @@ void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generation de la liste */
|
|
||||||
BOOST_FOREACH( COMPONENT& component, m_components )
|
BOOST_FOREACH( COMPONENT& component, m_components )
|
||||||
{
|
{
|
||||||
/* génération du composant si son empreinte est définie */
|
|
||||||
if( component.m_Module.empty() )
|
if( component.m_Module.empty() )
|
||||||
continue;
|
continue;
|
||||||
fprintf( FileEquiv, "comp = \"%s\" module = \"%s\"\n",
|
fprintf( FileEquiv, "comp = \"%s\" module = \"%s\"\n",
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/***************/
|
/*****************/
|
||||||
/* genorcad() */
|
/* genorcad.cpp */
|
||||||
/***************/
|
/*****************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ComplŠte la netliste (*.NET) en y placant les ref *.lib FORMAT ORCADPCB
|
* Create the netlist (* NET) by placing the *.lib ref FORMAT ORCADPCB
|
||||||
* La valeur (Part Value) est tronquee a 16 lettres
|
* The value (share value) is truncated to 16 letters.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
#define MAX_LEN_NETNAME 16
|
#define MAX_LEN_NETNAME 16
|
||||||
|
|
||||||
/* Routines locales */
|
|
||||||
static void TriPinsModule( COMPONENT* CurrentCmp );
|
static void TriPinsModule( COMPONENT* CurrentCmp );
|
||||||
static void ChangePinNet( wxString& PinNet, bool rightJustify );
|
static void ChangePinNet( wxString& PinNet, bool rightJustify );
|
||||||
|
|
||||||
/* Variables Locales */
|
|
||||||
int NetNumCode; /* Nombre utilise pour cree des NetNames lors de
|
int NetNumCode; /* Number of used for NetNames created during
|
||||||
* reaffectation de NetNames */
|
* reallocation of NetNames. */
|
||||||
|
|
||||||
int genorcad( bool rightJustify )
|
int genorcad( bool rightJustify )
|
||||||
{
|
{
|
||||||
|
@ -35,10 +35,6 @@ int genorcad( bool rightJustify )
|
||||||
fprintf( dest, "( { Netlist by %s, date = %s }\n",
|
fprintf( dest, "( { Netlist by %s, date = %s }\n",
|
||||||
CONV_TO_UTF8( Title ), Line );
|
CONV_TO_UTF8( Title ), Line );
|
||||||
|
|
||||||
/***********************/
|
|
||||||
/* Lecture de la liste */
|
|
||||||
/***********************/
|
|
||||||
|
|
||||||
CurrentCmp = BaseListeCmp;
|
CurrentCmp = BaseListeCmp;
|
||||||
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
|
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
|
||||||
{
|
{
|
||||||
|
@ -52,13 +48,11 @@ int genorcad( bool rightJustify )
|
||||||
|
|
||||||
fprintf( dest, " %s ", CONV_TO_UTF8( CurrentCmp->m_Reference ) );
|
fprintf( dest, " %s ", CONV_TO_UTF8( CurrentCmp->m_Reference ) );
|
||||||
|
|
||||||
/* placement de la valeur */
|
|
||||||
fprintf( dest, "%s\n", CONV_TO_UTF8( CurrentCmp->m_Value ) );
|
fprintf( dest, "%s\n", CONV_TO_UTF8( CurrentCmp->m_Value ) );
|
||||||
|
|
||||||
/* Tri des pins */
|
/* Sort pins. */
|
||||||
TriPinsModule( CurrentCmp );
|
TriPinsModule( CurrentCmp );
|
||||||
|
|
||||||
/* Placement de la liste des pins */
|
|
||||||
Pin = CurrentCmp->m_Pins;
|
Pin = CurrentCmp->m_Pins;
|
||||||
for( ; Pin != NULL; Pin = Pin->Pnext )
|
for( ; Pin != NULL; Pin = Pin->Pnext )
|
||||||
{
|
{
|
||||||
|
@ -82,12 +76,8 @@ int genorcad( bool rightJustify )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************/
|
/* Sort pins */
|
||||||
static void TriPinsModule( COMPONENT* CurrentCmp )
|
static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
/***********************************************/
|
|
||||||
|
|
||||||
/* Tri et controle des pins du module CurrentCmp
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
PIN* Pin, * NextPin, ** BasePin;
|
PIN* Pin, * NextPin, ** BasePin;
|
||||||
int nbpins = 0, ii;
|
int nbpins = 0, ii;
|
||||||
|
@ -96,11 +86,9 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
if( Pin == NULL )
|
if( Pin == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* comptage des pins */
|
|
||||||
for( ; Pin != NULL; Pin = Pin->Pnext )
|
for( ; Pin != NULL; Pin = Pin->Pnext )
|
||||||
nbpins++;
|
nbpins++;
|
||||||
|
|
||||||
/* Tri des pins: etablissement de la liste des pointeurs */
|
|
||||||
BasePin = (PIN**) MyZMalloc( nbpins * sizeof(PIN*) );
|
BasePin = (PIN**) MyZMalloc( nbpins * sizeof(PIN*) );
|
||||||
|
|
||||||
Pin = CurrentCmp->m_Pins;
|
Pin = CurrentCmp->m_Pins;
|
||||||
|
@ -109,10 +97,8 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
BasePin[ii] = Pin;
|
BasePin[ii] = Pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tri des Pins */
|
|
||||||
qsort( BasePin, nbpins, sizeof( COMPONENT*), PinCompare );
|
qsort( BasePin, nbpins, sizeof( COMPONENT*), PinCompare );
|
||||||
|
|
||||||
/* Remise a jour des pointeurs chaines */
|
|
||||||
for( ii = 0; ii < nbpins - 1; ii++ )
|
for( ii = 0; ii < nbpins - 1; ii++ )
|
||||||
{
|
{
|
||||||
BasePin[ii]->Pnext = BasePin[ii + 1];
|
BasePin[ii]->Pnext = BasePin[ii + 1];
|
||||||
|
@ -123,7 +109,7 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
|
|
||||||
MyFree( BasePin );
|
MyFree( BasePin );
|
||||||
|
|
||||||
/* Elimination des redondances */
|
/* Remove duplicate pins. */
|
||||||
Pin = CurrentCmp->m_Pins;
|
Pin = CurrentCmp->m_Pins;
|
||||||
while( Pin != NULL )
|
while( Pin != NULL )
|
||||||
{
|
{
|
||||||
|
@ -134,7 +120,7 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
{
|
{
|
||||||
Pin = Pin->Pnext; continue;
|
Pin = Pin->Pnext; continue;
|
||||||
}
|
}
|
||||||
/* 2 pins successives ont le meme numero */
|
/* Successive 2 pins have the same number. */
|
||||||
if( Pin->m_PinNet != NextPin->m_PinNet )
|
if( Pin->m_PinNet != NextPin->m_PinNet )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -150,13 +136,12 @@ static void TriPinsModule( COMPONENT* CurrentCmp )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************/
|
/* **** JP translate ****
|
||||||
static void ChangePinNet( wxString& PinNet, bool rightJustify )
|
*
|
||||||
/*******************************************/
|
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
|
||||||
|
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
|
||||||
/* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
|
|
||||||
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
|
|
||||||
*/
|
*/
|
||||||
|
static void ChangePinNet( wxString& PinNet, bool rightJustify )
|
||||||
{
|
{
|
||||||
PIN* Pin;
|
PIN* Pin;
|
||||||
COMPONENT* CurrentCmp;
|
COMPONENT* CurrentCmp;
|
||||||
|
@ -166,11 +151,11 @@ static void ChangePinNet( wxString& PinNet, bool rightJustify )
|
||||||
|
|
||||||
OldName = PinNet;
|
OldName = PinNet;
|
||||||
ii = PinNet.Len();
|
ii = PinNet.Len();
|
||||||
if( rightJustify ) /* On conserve les 8 dernieres lettres du nom */
|
if( rightJustify ) /* Retain the last 8 letters of the name. */
|
||||||
{
|
{
|
||||||
NewName = OldName.Right( 8 ); NewName << NetNumCode;
|
NewName = OldName.Right( 8 ); NewName << NetNumCode;
|
||||||
}
|
}
|
||||||
else /* On conserve les 8 premieres lettres du nom */
|
else /* Retains the 8 first letters of the name. */
|
||||||
{
|
{
|
||||||
NewName = OldName.Left( 8 ); NewName << NetNumCode;
|
NewName = OldName.Left( 8 ); NewName << NetNumCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/*******************************************************************/
|
/**************/
|
||||||
/* CVPCB: Routines de base : */
|
/* init.cpp */
|
||||||
/* lecture Netliste et creation des fenetres composants et modules */
|
/**************/
|
||||||
/*******************************************************************/
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -15,12 +14,9 @@
|
||||||
#include "cvstruct.h"
|
#include "cvstruct.h"
|
||||||
|
|
||||||
|
|
||||||
/* routines locales : */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* - Affecte un module au composant selectionne
|
* Set the module to the selected component
|
||||||
* - Selectionne le composant suivant
|
* Selects the next component
|
||||||
*/
|
*/
|
||||||
void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
|
void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
|
||||||
{
|
{
|
||||||
|
@ -49,7 +45,8 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
|
||||||
Component->m_Module = package;
|
Component->m_Module = package;
|
||||||
|
|
||||||
Line.Printf( CMP_FORMAT, NumCmp + 1,
|
Line.Printf( CMP_FORMAT, NumCmp + 1,
|
||||||
GetChars( Component->m_Reference ), GetChars( Component->m_Value ),
|
GetChars( Component->m_Reference ),
|
||||||
|
GetChars( Component->m_Value ),
|
||||||
GetChars( Component->m_Module ) );
|
GetChars( Component->m_Module ) );
|
||||||
m_modified = true;
|
m_modified = true;
|
||||||
|
|
||||||
|
@ -70,9 +67,8 @@ void WinEDA_CvpcbFrame::SetNewPkg( const wxString& package )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lecture de la netliste selon format, ainsi que du fichier des composants
|
* Read the netlist format and file components.
|
||||||
*/
|
*/
|
||||||
bool WinEDA_CvpcbFrame::ReadNetList()
|
bool WinEDA_CvpcbFrame::ReadNetList()
|
||||||
{
|
{
|
||||||
|
@ -89,7 +85,6 @@ bool WinEDA_CvpcbFrame::ReadNetList()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lecture des correspondances */
|
|
||||||
LoadComponentFile( m_NetlistFileName.GetFullPath(), m_components );
|
LoadComponentFile( m_NetlistFileName.GetFullPath(), m_components );
|
||||||
|
|
||||||
if( m_ListCmp == NULL )
|
if( m_ListCmp == NULL )
|
||||||
|
@ -120,7 +115,7 @@ bool WinEDA_CvpcbFrame::ReadNetList()
|
||||||
m_undefinedComponentCnt );
|
m_undefinedComponentCnt );
|
||||||
SetStatusText( msg, 1 );
|
SetStatusText( msg, 1 );
|
||||||
|
|
||||||
/* Mise a jour du titre de la fenetre principale */
|
/* Update the title of the main window. */
|
||||||
SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
||||||
wxT( " " ) + m_NetlistFileName.GetFullPath() );
|
wxT( " " ) + m_NetlistFileName.GetFullPath() );
|
||||||
return true;
|
return true;
|
||||||
|
@ -128,9 +123,9 @@ bool WinEDA_CvpcbFrame::ReadNetList()
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sauvegarde des fichiers netliste et cmp
|
* Backup and NetList cmp
|
||||||
* Le nom complet du fichier Netliste doit etre dans FFileName.
|
* The full name of the netlist file must be in FFileName.
|
||||||
* Le nom du fichier cmp en est deduit
|
* The file name is deducted in cmp
|
||||||
*/
|
*/
|
||||||
int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
|
int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
|
||||||
{
|
{
|
||||||
|
@ -158,7 +153,7 @@ int WinEDA_CvpcbFrame::SaveNetList( const wxString& fileName )
|
||||||
|
|
||||||
if( netlist == 0 )
|
if( netlist == 0 )
|
||||||
{
|
{
|
||||||
DisplayError( this, _( "Unable to create netlist file" ) );
|
DisplayError( this, _( "Unable to create net list file" ) );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/**************/
|
/***************/
|
||||||
/* listlib.cpp */
|
/* listlib.cpp */
|
||||||
/**************/
|
/**(************/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cherche toutes les ref <chemin lib>*.??? si nom fichier pr‚sent,
|
* Searches for all ref <path lib> *.??? if offering their file name,
|
||||||
* ou examine <chemin lib>[MODULE.LIB]
|
* or reviews <path lib> [MODULE.LIB]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "wxstruct.h"
|
#include "wxstruct.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -25,26 +25,25 @@
|
||||||
static wxString s_files_not_found;
|
static wxString s_files_not_found;
|
||||||
static wxString s_files_invalid;
|
static wxString s_files_invalid;
|
||||||
|
|
||||||
/* routines locales : */
|
|
||||||
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
|
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routine lisant la liste des librairies, et generant la liste chainee
|
* Read the list of libraries and generate a list modules.
|
||||||
* des modules disponibles
|
|
||||||
*
|
*
|
||||||
* Module descr format:
|
* Module description format:
|
||||||
* $MODULE c64acmd
|
* $MODULE c64acmd
|
||||||
* Li c64acmd
|
* Li c64acmd DIN connector
|
||||||
* Cd Connecteur DIN Europe 96 Contacts AC male droit
|
* Cd Europe 96 Contact AC male right
|
||||||
* Kw PAD_CONN DIN
|
* Kw PAD_CONN DIN
|
||||||
* $EndMODULE
|
* $Endmodule
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool LoadFootprintFiles( const wxArrayString& libNames,
|
bool LoadFootprintFiles( const wxArrayString& libNames,
|
||||||
FOOTPRINT_LIST& list )
|
FOOTPRINT_LIST& list )
|
||||||
{
|
{
|
||||||
FILE* file; /* pour lecture librairie */
|
FILE* file;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
wxFileName filename;
|
wxFileName filename;
|
||||||
int end;
|
int end;
|
||||||
|
@ -68,13 +67,11 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
|
||||||
/* Parse Libraries Listed */
|
/* Parse Libraries Listed */
|
||||||
for( i = 0; i < libNames.GetCount(); i++ )
|
for( i = 0; i < libNames.GetCount(); i++ )
|
||||||
{
|
{
|
||||||
/* Calcul du nom complet de la librairie */
|
|
||||||
filename = libNames[i];
|
filename = libNames[i];
|
||||||
filename.SetExt( ModuleFileExtension );
|
filename.SetExt( ModuleFileExtension );
|
||||||
|
|
||||||
tmp = wxGetApp().FindLibraryPath( filename );
|
tmp = wxGetApp().FindLibraryPath( filename );
|
||||||
|
|
||||||
|
|
||||||
if( !tmp )
|
if( !tmp )
|
||||||
{
|
{
|
||||||
s_files_not_found << filename.GetFullName() << wxT("\n");
|
s_files_not_found << filename.GetFullName() << wxT("\n");
|
||||||
|
@ -99,10 +96,9 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Lecture du nombre de composants */
|
/* TODO: Read the number of components. */
|
||||||
fseek( file, 0, 0 );
|
fseek( file, 0, 0 );
|
||||||
|
|
||||||
/* TODO lecture nom des composants : */
|
|
||||||
end = 0;
|
end = 0;
|
||||||
while( !end && fgets( buffer, 255, file ) != NULL )
|
while( !end && fgets( buffer, 255, file ) != NULL )
|
||||||
{
|
{
|
||||||
|
@ -162,13 +158,11 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routine de lecture du fichier Doc associe a la librairie ModLibName.
|
* Read the file Doc combines a library ModLibName.
|
||||||
* Cree en memoire la chaine liste des docs pointee par MList
|
* Create the list of doc strings pointed to by list
|
||||||
* ModLibName = full file Name de la librairie Modules
|
* ModLibName = full file name of the library modules
|
||||||
*/
|
*/
|
||||||
static void
|
static void ReadDocLib( const wxString& ModLibName, FOOTPRINT_LIST& list )
|
||||||
ReadDocLib( const wxString& ModLibName,
|
|
||||||
FOOTPRINT_LIST& list )
|
|
||||||
{
|
{
|
||||||
FOOTPRINT* NewMod;
|
FOOTPRINT* NewMod;
|
||||||
char Line[1024];
|
char Line[1024];
|
||||||
|
@ -202,7 +196,7 @@ ReadDocLib( const wxString& ModLibName,
|
||||||
continue;
|
continue;
|
||||||
if( Line[1] == 'E' )
|
if( Line[1] == 'E' )
|
||||||
break;
|
break;
|
||||||
if( Line[1] == 'M' ) /* 1 module description */
|
if( Line[1] == 'M' )
|
||||||
{
|
{
|
||||||
/* Parse file line by line */
|
/* Parse file line by line */
|
||||||
while( GetLine( mdc_file, Line, NULL, sizeof(Line) - 1 ) )
|
while( GetLine( mdc_file, Line, NULL, sizeof(Line) - 1 ) )
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/***************************************************/
|
/***************/
|
||||||
/* Localisation des elements pointes par la souris */
|
/* loadcmp.cpp */
|
||||||
/***************************************************/
|
/***************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "wxstruct.h"
|
#include "wxstruct.h"
|
||||||
|
@ -16,17 +16,14 @@
|
||||||
#include "cvstruct.h"
|
#include "cvstruct.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************
|
/**
|
||||||
|
* Analyze the libraries to find the module.
|
||||||
|
* If this module is found, copy it into memory, and
|
||||||
|
* string end of the list of modules.
|
||||||
*
|
*
|
||||||
* Analyse les LIBRAIRIES pour trouver le module demande
|
* @param CmpName - Module name
|
||||||
* Si ce module est trouve, le copie en memoire, et le
|
* @return - Module if found otherwise NULL.
|
||||||
* chaine en fin de liste des modules
|
*/
|
||||||
* - Entree:
|
|
||||||
* name_cmp = nom du module
|
|
||||||
* - Retour:
|
|
||||||
* Pointeur sur le nouveau module.
|
|
||||||
*
|
|
||||||
*****************************************************************/
|
|
||||||
MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
|
MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
|
||||||
{
|
{
|
||||||
int LineNum, Found = 0;
|
int LineNum, Found = 0;
|
||||||
|
@ -39,7 +36,6 @@ MODULE* WinEDA_DisplayFrame::Get_Module( const wxString& CmpName )
|
||||||
|
|
||||||
for( ii = 0; ii < parent->m_ModuleLibNames.GetCount(); ii++ )
|
for( ii = 0; ii < parent->m_ModuleLibNames.GetCount(); ii++ )
|
||||||
{
|
{
|
||||||
/* Calcul du nom complet de la librairie */
|
|
||||||
fn = parent->m_ModuleLibNames[ii];
|
fn = parent->m_ModuleLibNames[ii];
|
||||||
fn.SetExt( ModuleFileExtension );
|
fn.SetExt( ModuleFileExtension );
|
||||||
|
|
||||||
|
@ -64,7 +60,7 @@ found in the default search paths." ),
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lecture entete chaine definie par ENTETE_LIBRAIRIE */
|
/* Read header. */
|
||||||
LineNum = 0;
|
LineNum = 0;
|
||||||
GetLine( file, Line, &LineNum );
|
GetLine( file, Line, &LineNum );
|
||||||
StrPurge( Line );
|
StrPurge( Line );
|
||||||
|
@ -78,7 +74,6 @@ found in the default search paths." ),
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lecture de la liste des composants de la librairie */
|
|
||||||
Found = 0;
|
Found = 0;
|
||||||
while( !Found && GetLine( file, Line, &LineNum ) )
|
while( !Found && GetLine( file, Line, &LineNum ) )
|
||||||
{
|
{
|
||||||
|
@ -96,13 +91,12 @@ found in the default search paths." ),
|
||||||
if( stricmp( Line, CONV_TO_UTF8( CmpName ) ) == 0 )
|
if( stricmp( Line, CONV_TO_UTF8( CmpName ) ) == 0 )
|
||||||
{
|
{
|
||||||
Found = 1;
|
Found = 1;
|
||||||
break; /* Trouve! */
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lecture de la librairie */
|
|
||||||
while( Found && GetLine( file, Line, &LineNum ) )
|
while( Found && GetLine( file, Line, &LineNum ) )
|
||||||
{
|
{
|
||||||
if( Line[0] != '$' )
|
if( Line[0] != '$' )
|
||||||
|
@ -114,15 +108,16 @@ found in the default search paths." ),
|
||||||
if( strnicmp( Line, "$MODULE", 7 ) != 0 )
|
if( strnicmp( Line, "$MODULE", 7 ) != 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Lecture du nom du composant */
|
/* Read component name. */
|
||||||
sscanf( Line + 7, " %s", Name );
|
sscanf( Line + 7, " %s", Name );
|
||||||
if( stricmp( Name, CONV_TO_UTF8( CmpName ) ) == 0 ) /* composant localise */
|
if( stricmp( Name, CONV_TO_UTF8( CmpName ) ) == 0 )
|
||||||
{
|
{
|
||||||
Module = new MODULE( GetBoard() );
|
Module = new MODULE( GetBoard() );
|
||||||
// Switch the locale to standard C (needed to print floating point numbers like 1.3)
|
// Switch the locale to standard C (needed to print floating
|
||||||
|
// point numbers like 1.3)
|
||||||
SetLocaleTo_C_standard();
|
SetLocaleTo_C_standard();
|
||||||
Module->ReadDescr( file, &LineNum );
|
Module->ReadDescr( file, &LineNum );
|
||||||
SetLocaleTo_Default(); // revert to the current locale
|
SetLocaleTo_Default(); // revert to the current locale
|
||||||
Module->SetPosition( wxPoint( 0, 0 ) );
|
Module->SetPosition( wxPoint( 0, 0 ) );
|
||||||
fclose( file );
|
fclose( file );
|
||||||
return Module;
|
return Module;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/***************************************/
|
/***************************************/
|
||||||
/* menucfg : buils the cvpcb main menu */
|
/* menucfg : build the cvpcb main menu */
|
||||||
/***************************************/
|
/***************************************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
|
@ -14,34 +14,24 @@
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
|
|
||||||
|
|
||||||
/*******************************************/
|
|
||||||
void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
/*******************************************/
|
|
||||||
|
|
||||||
/* Creation des menus de la fenetre principale
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
wxMenuItem* item;
|
wxMenuItem* item;
|
||||||
wxMenuBar* menuBar;
|
wxMenuBar* menuBar;
|
||||||
|
|
||||||
/* Destroy the existing menu bar so it can be rebuilt. This allows
|
|
||||||
* language changes of the menu text on the fly. */
|
|
||||||
// if( menuBar )
|
|
||||||
// SetMenuBar( NULL );
|
|
||||||
|
|
||||||
menuBar = new wxMenuBar();
|
menuBar = new wxMenuBar();
|
||||||
|
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
|
||||||
_( "&Open" ),
|
_( "&Open" ),
|
||||||
_( "Open a NetList file" ) );
|
_( "Open a net list file" ) );
|
||||||
item->SetBitmap( open_xpm );
|
item->SetBitmap( open_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
||||||
_( "&Save As..." ),
|
_( "&Save As..." ),
|
||||||
_( "Save New NetList and Footprints List files" ) );
|
_( "Save new net list and footprint list files" ) );
|
||||||
item->SetBitmap( save_xpm );
|
item->SetBitmap( save_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
@ -51,13 +41,12 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( exit_xpm );
|
item->SetBitmap( exit_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
// Creation des selections des anciens fichiers
|
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
|
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
|
||||||
|
|
||||||
// Menu Configuration:
|
// Menu Configuration:
|
||||||
wxMenu* configmenu = new wxMenu;
|
wxMenu* configmenu = new wxMenu;
|
||||||
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
|
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Configuration" ),
|
||||||
_( "Setting Libraries, Directories and others..." ) );
|
_( "Set libraries and library search paths" ) );
|
||||||
item->SetBitmap( config_xpm );
|
item->SetBitmap( config_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
|
@ -91,6 +80,7 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
menuBar->Append( configmenu, _( "&Preferences" ) );
|
menuBar->Append( configmenu, _( "&Preferences" ) );
|
||||||
menuBar->Append( helpMenu, _( "&Help" ) );
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
||||||
|
|
||||||
// Associate the menu bar with the frame
|
/* Calling SetMenuBar() will Destroy the existing menu bar so it can be
|
||||||
|
* rebuilt. This allows language changes of the menu text on the fly. */
|
||||||
SetMenuBar( menuBar );
|
SetMenuBar( menuBar );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**************************************/
|
/**************/
|
||||||
/** protos.h liste des fonctions **/
|
/** protos.h **/
|
||||||
/**************************************/
|
/**************/
|
||||||
|
|
||||||
#ifndef PROTOS_H
|
#ifndef PROTOS_H
|
||||||
#define PROTOS_H
|
#define PROTOS_H
|
||||||
|
@ -16,5 +16,5 @@ extern bool LoadFootprintFiles( const wxArrayString& libNames,
|
||||||
FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
|
FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
|
||||||
FOOTPRINT_LIST& list );
|
FOOTPRINT_LIST& list );
|
||||||
|
|
||||||
#endif // PROTOS_H
|
#endif // PROTOS_H
|
||||||
|
|
||||||
|
|
|
@ -19,16 +19,16 @@
|
||||||
#include "cvstruct.h"
|
#include "cvstruct.h"
|
||||||
|
|
||||||
|
|
||||||
#define SEPARATEUR '|' /* caractere separateur dans netliste */
|
#define SEPARATEUR '|' /* Separator character in NetList */
|
||||||
|
|
||||||
/* routines locales : */
|
|
||||||
|
|
||||||
static int ReadPinConnection( FILE* f, COMPONENT* CurrentCmp );
|
static int ReadPinConnection( FILE* f, COMPONENT* CurrentCmp );
|
||||||
|
|
||||||
/* Tri la liste des composants par ordre alphabetique et met a jour le nouveau
|
|
||||||
* chainage avant/arriere retourne un pointeur sur le 1er element de la liste */
|
|
||||||
|
|
||||||
#define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist data
|
/* Sort the list alphabetically by component and and returns
|
||||||
|
* a pointer to the 1st element of list */
|
||||||
|
|
||||||
|
#define BUFFER_CHAR_SIZE 1024 // Size of buffers used to store netlist data
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,7 +117,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" )
|
/* Read the file header (must be "( { OrCAD PCB" or "({ OrCAD PCB" )
|
||||||
* or "# EESchema Netliste"
|
* or "# EESchema Netlist"
|
||||||
*/
|
*/
|
||||||
result = fgets( Line, BUFFER_CHAR_SIZE, source );
|
result = fgets( Line, BUFFER_CHAR_SIZE, source );
|
||||||
/* test for netlist type PCB2 */
|
/* test for netlist type PCB2 */
|
||||||
|
@ -231,9 +231,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
|
||||||
while( Line[i] == ' ' )
|
while( Line[i] == ' ' )
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
/* goto beginning of reference */
|
/* goto beginning of reference */
|
||||||
|
|
||||||
/* debut reference trouv‚ */
|
|
||||||
for( ; ; i++ )
|
for( ; ; i++ )
|
||||||
{
|
{
|
||||||
#if defined(KICAD_GOST)
|
#if defined(KICAD_GOST)
|
||||||
|
@ -249,7 +247,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
|
||||||
while( Line[i] == ' ' )
|
while( Line[i] == ' ' )
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
/** goto beginning of value */
|
/** goto beginning of value */
|
||||||
|
|
||||||
for( ; ; i++ )
|
for( ; ; i++ )
|
||||||
{
|
{
|
||||||
|
@ -348,13 +346,13 @@ int ReadPinConnection( FILE* f, COMPONENT* Cmp )
|
||||||
|
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
/* debut description trouv‚ */
|
/* Find beginning of description. */
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
if( fgets( Line, BUFFER_CHAR_SIZE, f ) == 0 )
|
if( fgets( Line, BUFFER_CHAR_SIZE, f ) == 0 )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* remove blanks from the beginning of the line */
|
/* Remove blanks from the beginning of the line. */
|
||||||
i = 0; while( Line[i] == ' ' )
|
i = 0; while( Line[i] == ' ' )
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
@ -368,14 +366,14 @@ int ReadPinConnection( FILE* f, COMPONENT* Cmp )
|
||||||
if( Line[i] < ' ' )
|
if( Line[i] < ' ' )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* fin de description ? */
|
/* End of description? */
|
||||||
if( Line[i] == ')' )
|
if( Line[i] == ')' )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
net.Empty();
|
net.Empty();
|
||||||
numpin.Empty();
|
numpin.Empty();
|
||||||
|
|
||||||
/* Read pin name , 4 letters */
|
/* Read pin name, 4 letters */
|
||||||
for( jj = 0; jj < 4; jj++, i++ )
|
for( jj = 0; jj < 4; jj++, i++ )
|
||||||
{
|
{
|
||||||
if( Line[i] == ' ' )
|
if( Line[i] == ' ' )
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
/**************/
|
/****************/
|
||||||
/* savecmp() */
|
/* savecmp.cpp */
|
||||||
/**************/
|
/****************/
|
||||||
|
|
||||||
/* sauvegarde la liste des associations composants/empreintes */
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "wxstruct.h"
|
#include "wxstruct.h"
|
||||||
|
@ -18,16 +16,17 @@
|
||||||
#include "cvstruct.h"
|
#include "cvstruct.h"
|
||||||
|
|
||||||
|
|
||||||
/* Chaines de caractere d'identification */
|
/* File header. */
|
||||||
char EnteteCmpMod[] = { "Cmp-Mod V01" };
|
char EnteteCmpMod[] = { "Cmp-Mod V01" };
|
||||||
|
|
||||||
const wxString titleComponentLibErr( _( "Component Library Error" ) );
|
const wxString titleComponentLibErr( _( "Component Library Error" ) );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routine de sauvegarde du fichier des modules
|
* Backup modules file.
|
||||||
* Retourne 1 si OK
|
*
|
||||||
* 0 si ecriture non faite
|
* @param NetlistFullFileName - Name of net list file to save.
|
||||||
|
* @returns - 1 if OK, 0 if error.
|
||||||
*/
|
*/
|
||||||
int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
|
int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
|
||||||
{
|
{
|
||||||
|
@ -36,12 +35,11 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
|
||||||
char Line[1024];
|
char Line[1024];
|
||||||
wxString Title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion();
|
wxString Title = wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion();
|
||||||
|
|
||||||
/* calcul du nom du fichier */
|
|
||||||
fn.SetExt( ComponentFileExtension );
|
fn.SetExt( ComponentFileExtension );
|
||||||
|
|
||||||
dest = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
|
dest = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
|
||||||
if( dest == NULL )
|
if( dest == NULL )
|
||||||
return 0; /* Erreur ecriture */
|
return 0;
|
||||||
|
|
||||||
fprintf( dest, "%s", EnteteCmpMod );
|
fprintf( dest, "%s", EnteteCmpMod );
|
||||||
fprintf( dest, " Created by %s", CONV_TO_UTF8( Title ) );
|
fprintf( dest, " Created by %s", CONV_TO_UTF8( Title ) );
|
||||||
|
@ -68,7 +66,7 @@ int WinEDA_CvpcbFrame::SaveComponentList( const wxString& NetlistFullFileName )
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* recupere la liste des associations composants/empreintes
|
* Load list of associated components and footprints.
|
||||||
*/
|
*/
|
||||||
bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
||||||
{
|
{
|
||||||
|
@ -78,7 +76,6 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
||||||
FILE* source;
|
FILE* source;
|
||||||
wxFileName fn = fileName;
|
wxFileName fn = fileName;
|
||||||
|
|
||||||
/* calcul du nom du fichier */
|
|
||||||
fn.SetExt( ComponentFileExtension );
|
fn.SetExt( ComponentFileExtension );
|
||||||
|
|
||||||
source = wxFopen( fn.GetFullPath(), wxT( "rt" ) );
|
source = wxFopen( fn.GetFullPath(), wxT( "rt" ) );
|
||||||
|
@ -90,7 +87,7 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Identification du Type de fichier CmpMod */
|
/* Identification of the type of file CmpMod */
|
||||||
if( fgets( Line, 79, source ) == 0 )
|
if( fgets( Line, 79, source ) == 0 )
|
||||||
{
|
{
|
||||||
msg.Printf( _( " <%s> does not appear to be a valid Kicad component library." ),
|
msg.Printf( _( " <%s> does not appear to be a valid Kicad component library." ),
|
||||||
|
@ -108,13 +105,12 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lecture de la liste */
|
|
||||||
while( !eof && fgets( Line, 79, source ) != 0 )
|
while( !eof && fgets( Line, 79, source ) != 0 )
|
||||||
{
|
{
|
||||||
if( strnicmp( Line, "EndListe", 8 ) == 0 )
|
if( strnicmp( Line, "EndListe", 8 ) == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Recherche du debut de description du composant */
|
/* Search the beginning of the component description. */
|
||||||
if( strnicmp( Line, "BeginCmp", 8 ) != 0 )
|
if( strnicmp( Line, "BeginCmp", 8 ) != 0 )
|
||||||
continue;
|
continue;
|
||||||
timestamp.Empty();
|
timestamp.Empty();
|
||||||
|
@ -171,16 +167,16 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
|
||||||
ilib.Trim( FALSE );
|
ilib.Trim( FALSE );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} /* Fin lecture description de 1 composant */
|
} /* End reading component description. */
|
||||||
|
|
||||||
/* Recherche du composant correspondant en netliste et
|
/* Search corresponding component and NetList
|
||||||
* mise a jour de ses parametres */
|
* Update its parameters. */
|
||||||
BOOST_FOREACH( COMPONENT& component, list )
|
BOOST_FOREACH( COMPONENT& component, list )
|
||||||
{
|
{
|
||||||
if( namecmp != component.m_Reference )
|
if( namecmp != component.m_Reference )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* composant identifie , copie du nom du module correspondant */
|
/* Copy the name of the corresponding module. */
|
||||||
component.m_Module = ilib;
|
component.m_Module = ilib;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*********************************************************************/
|
/*****************/
|
||||||
/** setvisu.cpp: initialisations de l'ecran d'affichage du composant **/
|
/** setvisu.cpp **/
|
||||||
/*********************************************************************/
|
/*****************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
/*
|
/*
|
||||||
* NOTE: There is something in 3d_viewer.h that causes a compiler error in
|
* NOTE: There is something in 3d_viewer.h that causes a compiler error in
|
||||||
* <boost/foreach.hpp> in Linux so move it after cvpcb.h where it is
|
* <boost/foreach.hpp> in Linux so move it after cvpcb.h where it is
|
||||||
* included to prevent the error from occuring.
|
* included to prevent the error from occurring.
|
||||||
*/
|
*/
|
||||||
#include "3d_viewer.h"
|
#include "3d_viewer.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/***************************************************/
|
/********************/
|
||||||
/* tool_cvpcb.cpp: construction du menu principal */
|
/* tool_cvpcb.cpp */
|
||||||
/***************************************************/
|
/********************/
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "appl_wxstruct.h"
|
#include "appl_wxstruct.h"
|
||||||
|
@ -13,9 +13,7 @@
|
||||||
#include "cvstruct.h"
|
#include "cvstruct.h"
|
||||||
|
|
||||||
|
|
||||||
/*********************************************/
|
|
||||||
void WinEDA_CvpcbFrame::ReCreateHToolbar()
|
void WinEDA_CvpcbFrame::ReCreateHToolbar()
|
||||||
/*********************************************/
|
|
||||||
{
|
{
|
||||||
wxConfig* config = wxGetApp().m_EDA_Config;
|
wxConfig* config = wxGetApp().m_EDA_Config;
|
||||||
|
|
||||||
|
@ -23,16 +21,18 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
|
||||||
|
|
||||||
#if !defined(KICAD_AUIMANAGER)
|
#if !defined(KICAD_AUIMANAGER)
|
||||||
SetToolBar( (wxToolBar *)m_HToolBar );
|
SetToolBar( (wxToolBar *)m_HToolBar );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
|
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
|
||||||
wxBitmap( open_xpm ),
|
wxBitmap( open_xpm ),
|
||||||
_( "Open a NetList file" ) );
|
_( "Open a net list file" ) );
|
||||||
|
|
||||||
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString,
|
m_HToolBar->AddTool( ID_CVPCB_SAVEQUITCVPCB, wxEmptyString,
|
||||||
wxBitmap( save_xpm ),
|
wxBitmap( save_xpm ),
|
||||||
_( "Save NetList and Footprints List files" ) );
|
_( "Save net list and footprint files" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
|
m_HToolBar->AddTool( ID_CVPCB_CREATE_CONFIGWINDOW, wxEmptyString,
|
||||||
|
@ -46,7 +46,7 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
|
||||||
|
|
||||||
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
|
m_HToolBar->AddTool( ID_CVPCB_AUTO_ASSOCIE, wxEmptyString,
|
||||||
wxBitmap( auto_associe_xpm ),
|
wxBitmap( auto_associe_xpm ),
|
||||||
_( "Automatic Association" ) );
|
_( "Perform automatic footprint association" ) );
|
||||||
|
|
||||||
m_HToolBar->AddSeparator();
|
m_HToolBar->AddSeparator();
|
||||||
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
|
m_HToolBar->AddTool( ID_CVPCB_GOTO_PREVIOUSNA, wxEmptyString,
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
/* writenetlistpcbnew.cpp */
|
/* writenetlistpcbnew.cpp */
|
||||||
/***************************/
|
/***************************/
|
||||||
|
|
||||||
/*
|
|
||||||
* Complete la netliste (*.NET) en y placant les ref *.lib FORMAT PCBNEW ou
|
|
||||||
* ORCADPCB
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -19,7 +15,7 @@
|
||||||
|
|
||||||
#define MAX_LEN_NETNAME 16
|
#define MAX_LEN_NETNAME 16
|
||||||
|
|
||||||
/* Routines locales */
|
|
||||||
static void ChangePinNet( COMPONENT_LIST& list, wxString& PinNet,
|
static void ChangePinNet( COMPONENT_LIST& list, wxString& PinNet,
|
||||||
int* netNumber, bool rightJustify );
|
int* netNumber, bool rightJustify );
|
||||||
static void WriteFootprintFilterInfos( FILE* dest, COMPONENT_LIST& list );
|
static void WriteFootprintFilterInfos( FILE* dest, COMPONENT_LIST& list );
|
||||||
|
@ -66,6 +62,13 @@ static void RemoveDuplicatePins( COMPONENT& component )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create Kicad net list file.
|
||||||
|
*
|
||||||
|
* @todo: None of the printf() call return values are checked for failure,
|
||||||
|
* a value less than zero. Check all printf() return values and
|
||||||
|
* return a true(pass) or false(fail) to the caller.
|
||||||
|
*/
|
||||||
int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
|
int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
|
||||||
bool rightJustify )
|
bool rightJustify )
|
||||||
{
|
{
|
||||||
|
@ -80,9 +83,6 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
|
||||||
else
|
else
|
||||||
fprintf( file, "( { netlist created %s }\n", Line );
|
fprintf( file, "( { netlist created %s }\n", Line );
|
||||||
|
|
||||||
/***********************/
|
|
||||||
/* Lecture de la liste */
|
|
||||||
/***********************/
|
|
||||||
|
|
||||||
BOOST_FOREACH( COMPONENT& component, list )
|
BOOST_FOREACH( COMPONENT& component, list )
|
||||||
{
|
{
|
||||||
|
@ -96,13 +96,11 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
|
||||||
|
|
||||||
fprintf( file, " %s ", CONV_TO_UTF8( component.m_Reference ) );
|
fprintf( file, " %s ", CONV_TO_UTF8( component.m_Reference ) );
|
||||||
|
|
||||||
/* placement de la valeur */
|
|
||||||
fprintf( file, "%s\n", CONV_TO_UTF8( component.m_Value ) );
|
fprintf( file, "%s\n", CONV_TO_UTF8( component.m_Value ) );
|
||||||
|
|
||||||
component.m_Pins.sort();
|
component.m_Pins.sort();
|
||||||
RemoveDuplicatePins( component );
|
RemoveDuplicatePins( component );
|
||||||
|
|
||||||
/* Placement de la liste des pins */
|
|
||||||
BOOST_FOREACH( PIN& pin, component.m_Pins )
|
BOOST_FOREACH( PIN& pin, component.m_Pins )
|
||||||
{
|
{
|
||||||
if( pin.m_Net.Len() > MAX_LEN_NETNAME )
|
if( pin.m_Net.Len() > MAX_LEN_NETNAME )
|
||||||
|
@ -164,7 +162,7 @@ void WriteFootprintFilterInfos( FILE* file, COMPONENT_LIST& list )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/* *** JP translate ***
|
||||||
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
|
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
|
||||||
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
|
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
|
||||||
*/
|
*/
|
||||||
|
@ -178,12 +176,12 @@ static void ChangePinNet( COMPONENT_LIST& list, wxString& PinNet,
|
||||||
|
|
||||||
OldName = PinNet;
|
OldName = PinNet;
|
||||||
|
|
||||||
if( rightJustify ) /* On conserve les 8 dernieres lettres du nom */
|
if( rightJustify ) /* Retain the last 8 letters of the name. */
|
||||||
{
|
{
|
||||||
NewName = OldName.Right( 8 );
|
NewName = OldName.Right( 8 );
|
||||||
NewName << *netNumber;
|
NewName << *netNumber;
|
||||||
}
|
}
|
||||||
else /* On conserve les 8 premieres lettres du nom */
|
else /* Retain the first 8 letters of the name. */
|
||||||
{
|
{
|
||||||
NewName = OldName.Left( 8 );
|
NewName = OldName.Left( 8 );
|
||||||
NewName << *netNumber;
|
NewName << *netNumber;
|
||||||
|
|
Loading…
Reference in New Issue