2007-08-23 04:28:46 +00:00
|
|
|
|
/******************************/
|
|
|
|
|
/* PCBNEW: echange de modules */
|
|
|
|
|
/******************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/* Fichier xchmod.cpp */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
#include "common.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "confirm.h"
|
|
|
|
|
#include "kicad_string.h"
|
|
|
|
|
#include "gestfich.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#include "pcbnew.h"
|
|
|
|
|
#include "autorout.h"
|
|
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
|
|
/* variables locales */
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
enum id_ExchangeModule {
|
|
|
|
|
ID_EXEC_EXCHANGE_MODULE = 1900,
|
|
|
|
|
ID_EXEC_EXCHANGE_ID_MODULES,
|
|
|
|
|
ID_EXEC_EXCHANGE_ID_MODULE_AND_VALUE,
|
|
|
|
|
ID_EXEC_EXCHANGE_ALL_MODULES,
|
|
|
|
|
ID_CLOSE_EXCHANGE_MODULE,
|
|
|
|
|
ID_BROWSE_LIB_MODULES
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/************************************/
|
|
|
|
|
/* class WinEDA_ExchangeModuleFrame */
|
|
|
|
|
/************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
class WinEDA_ExchangeModuleFrame : public wxDialog
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
WinEDA_BasePcbFrame* m_Parent;
|
|
|
|
|
wxDC* m_DC;
|
|
|
|
|
MODULE* m_CurrentModule;
|
|
|
|
|
WinEDA_EnterText* m_OldModule;
|
|
|
|
|
WinEDA_EnterText* m_OldValue;
|
|
|
|
|
WinEDA_EnterText* m_NewModule;
|
|
|
|
|
wxTextCtrl* m_WinMsg;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
// Constructor and destructor
|
2009-05-01 18:06:03 +00:00
|
|
|
|
WinEDA_ExchangeModuleFrame( WinEDA_BasePcbFrame* parent,
|
|
|
|
|
MODULE* Module, wxDC* DC, const wxPoint& pos );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
~WinEDA_ExchangeModuleFrame()
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
private:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
void OnQuit( wxCommandEvent& event );
|
|
|
|
|
void Change_Module( wxCommandEvent& event );
|
|
|
|
|
void Change_ModuleId( wxCommandEvent& event );
|
|
|
|
|
void Change_ModuleAll( wxCommandEvent& event );
|
2009-05-01 18:06:03 +00:00
|
|
|
|
int Maj_ListeCmp( const wxString& reference, const wxString& old_name,
|
|
|
|
|
const wxString& new_name, bool ShowError );
|
|
|
|
|
MODULE* Change_1_Module( MODULE* Module,
|
|
|
|
|
const wxString& new_module,
|
|
|
|
|
bool ShowError );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
void Sel_NewMod_By_Liste( wxCommandEvent& event );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
BEGIN_EVENT_TABLE( WinEDA_ExchangeModuleFrame, wxDialog )
|
2009-04-05 20:49:15 +00:00
|
|
|
|
EVT_BUTTON( ID_EXEC_EXCHANGE_MODULE,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::Change_Module )
|
|
|
|
|
EVT_BUTTON( ID_EXEC_EXCHANGE_ID_MODULES,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::Change_ModuleId )
|
|
|
|
|
EVT_BUTTON( ID_EXEC_EXCHANGE_ID_MODULE_AND_VALUE,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::Change_ModuleId )
|
|
|
|
|
EVT_BUTTON( ID_EXEC_EXCHANGE_ALL_MODULES,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::Change_ModuleAll )
|
|
|
|
|
EVT_BUTTON( ID_CLOSE_EXCHANGE_MODULE,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::OnQuit )
|
|
|
|
|
EVT_BUTTON( ID_BROWSE_LIB_MODULES,
|
|
|
|
|
WinEDA_ExchangeModuleFrame::Sel_NewMod_By_Liste )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
WinEDA_ExchangeModuleFrame::WinEDA_ExchangeModuleFrame(
|
|
|
|
|
WinEDA_BasePcbFrame* parent,
|
|
|
|
|
MODULE* Module,
|
|
|
|
|
wxDC* DC,
|
|
|
|
|
const wxPoint&
|
|
|
|
|
framepos ) :
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxDialog( parent, -1, _( "Exchange Modules" ), framepos, wxSize( 360, 460 ),
|
|
|
|
|
DIALOG_STYLE )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxButton* Button;
|
|
|
|
|
|
|
|
|
|
m_Parent = parent;
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_DC = DC;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
Centre();
|
|
|
|
|
|
|
|
|
|
m_CurrentModule = Module;
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
SetSizer( MainBoxSizer );
|
|
|
|
|
wxBoxSizer* UpperBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
|
|
|
|
|
|
|
|
MainBoxSizer->Add( UpperBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
wxBoxSizer* LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
wxBoxSizer* RightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
|
|
|
|
|
|
|
|
|
UpperBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
UpperBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
/* Creation des boutons de commande */
|
|
|
|
|
Button = new wxButton( this, ID_EXEC_EXCHANGE_MODULE,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Change module" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
|
|
|
|
|
|
|
|
|
|
Button = new wxButton( this, ID_EXEC_EXCHANGE_ID_MODULES,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Change same modules" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 );
|
|
|
|
|
|
|
|
|
|
Button = new wxButton( this, ID_EXEC_EXCHANGE_ID_MODULE_AND_VALUE,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Ch. same module+value" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 );
|
|
|
|
|
|
|
|
|
|
Button = new wxButton( this, ID_EXEC_EXCHANGE_ALL_MODULES,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Change all" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 );
|
|
|
|
|
|
|
|
|
|
Button = new wxButton( this, ID_BROWSE_LIB_MODULES,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Browse Libs modules" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT, 5 );
|
|
|
|
|
|
|
|
|
|
Button = new wxButton( this, ID_CLOSE_EXCHANGE_MODULE,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
_( "Close" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
RightBoxSizer->Add( Button, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
|
|
|
|
|
|
|
|
|
|
m_OldModule = new WinEDA_EnterText( this, _( "Current Module" ),
|
2009-04-05 20:49:15 +00:00
|
|
|
|
m_CurrentModule ?
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_CurrentModule->m_LibRef.GetData() :
|
|
|
|
|
wxEmptyString,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
LeftBoxSizer, wxSize( 150, -1 ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
m_OldModule->Enable( FALSE );
|
|
|
|
|
|
|
|
|
|
m_OldValue = new WinEDA_EnterText( this, _( "Current Value" ),
|
2009-04-05 20:49:15 +00:00
|
|
|
|
m_CurrentModule ?
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_CurrentModule->m_Value->m_Text.GetData() :
|
|
|
|
|
wxEmptyString,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
LeftBoxSizer, wxSize( 150, -1 ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
m_OldValue->Enable( FALSE );
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_NewModule = new WinEDA_EnterText( this, _( "New Module" ),
|
|
|
|
|
m_OldModule->GetValue(),
|
|
|
|
|
LeftBoxSizer, wxSize( 150, -1 ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_WinMsg = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition,
|
|
|
|
|
wxSize( 340, 230 ),
|
|
|
|
|
wxTE_READONLY | wxTE_MULTILINE );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
MainBoxSizer->Add( m_WinMsg, 0, wxGROW | wxALL, 5 );
|
|
|
|
|
|
|
|
|
|
GetSizer()->Fit( this );
|
|
|
|
|
GetSizer()->SetSizeHints( this );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_BasePcbFrame::InstallExchangeModuleFrame( MODULE* Module,
|
|
|
|
|
wxDC* DC,
|
2009-04-05 20:49:15 +00:00
|
|
|
|
const wxPoint& pos )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
WinEDA_ExchangeModuleFrame* frame =
|
|
|
|
|
new WinEDA_ExchangeModuleFrame( this, Module, DC, pos );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
frame->ShowModal();
|
|
|
|
|
frame->Destroy();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_ExchangeModuleFrame::OnQuit( wxCommandEvent& WXUNUSED( event ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
Close( true ); // true is to force the frame to close
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************/
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/*
|
|
|
|
|
* Met a jour le fichier name.CMP (s'il existe) apres un echange de module
|
|
|
|
|
* (par la commande changeMod), si les modules sont geres par ce fichier
|
2008-03-22 18:08:44 +00:00
|
|
|
|
*
|
2007-08-23 04:28:46 +00:00
|
|
|
|
* Si ShowError != 0 affiche message d'erreur si le fichier .cmp n'est pas
|
|
|
|
|
* trouve.
|
|
|
|
|
* Retoure 1 si erreur
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
int WinEDA_ExchangeModuleFrame::Maj_ListeCmp( const wxString& reference,
|
|
|
|
|
const wxString& old_name,
|
|
|
|
|
const wxString& new_name,
|
|
|
|
|
bool ShowError )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
wxFileName fn;
|
|
|
|
|
wxFileName tmpFileName;
|
|
|
|
|
FILE* FichCmp, * NewFile;
|
|
|
|
|
char Line[1024];
|
|
|
|
|
wxString msg;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
if( old_name == new_name )
|
|
|
|
|
return 0; /* pas de changement de nom */
|
|
|
|
|
|
|
|
|
|
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn = m_Parent->GetScreen()->m_FileName;
|
|
|
|
|
fn.SetExt( NetCmpExtBuffer );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
// Modification du fichier .cmp correcpondant
|
2009-04-05 20:49:15 +00:00
|
|
|
|
FichCmp = wxFopen( fn.GetFullPath(), wxT( "rt" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( FichCmp == NULL )
|
|
|
|
|
{
|
|
|
|
|
if( ShowError )
|
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
msg.Printf( _( "file %s not found" ), fn.GetFullPath().c_str() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
m_WinMsg->WriteText( msg );
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Analyse du fichier et modif */
|
2009-04-05 20:49:15 +00:00
|
|
|
|
tmpFileName = fn;
|
|
|
|
|
tmpFileName.SetExt( wxT( "$$$" ) );
|
|
|
|
|
NewFile = wxFopen( tmpFileName.GetFullPath(), wxT( "wt" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( NewFile == NULL )
|
|
|
|
|
{
|
|
|
|
|
if( ShowError )
|
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
msg.Printf( _( "Unable to create file %s" ),
|
|
|
|
|
tmpFileName.GetFullPath().c_str() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
m_WinMsg->WriteText( msg );
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fgets( Line, sizeof(Line), FichCmp );
|
2009-05-01 18:06:03 +00:00
|
|
|
|
fprintf( NewFile, "Cmp-Mod V01 Genere par PcbNew le %s\n",
|
|
|
|
|
DateAndTime( Line ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
bool start_descr = FALSE;
|
|
|
|
|
while( fgets( Line, sizeof(Line), FichCmp ) != NULL )
|
|
|
|
|
{
|
|
|
|
|
if( strnicmp( Line, "Reference = ", 9 ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
char buf[1024];
|
|
|
|
|
strcpy( buf, Line + 12 );
|
|
|
|
|
strtok( buf, ";\n\r" );
|
|
|
|
|
if( stricmp( buf, CONV_TO_UTF8( reference ) ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
start_descr = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( (strnicmp( Line, "Begin", 5 ) == 0)
|
2009-05-01 18:06:03 +00:00
|
|
|
|
|| (strnicmp( Line, "End", 3 ) == 0) )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
|
|
|
|
start_descr = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( start_descr && strnicmp( Line, "IdModule", 8 ) == 0 )
|
|
|
|
|
{
|
|
|
|
|
sprintf( Line + 8, " = %s;\n", CONV_TO_UTF8( new_name ) );
|
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
msg = wxT( " * in <" ) + fn.GetFullPath() + wxT( ">.\n" );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
m_WinMsg->WriteText( msg );
|
|
|
|
|
|
|
|
|
|
start_descr = FALSE;
|
|
|
|
|
}
|
|
|
|
|
fputs( Line, NewFile );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose( FichCmp );
|
|
|
|
|
fclose( NewFile );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
wxRemoveFile( fn.GetFullPath() );
|
|
|
|
|
wxRenameFile( tmpFileName.GetFullPath(), fn.GetFullPath() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
return 0;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Routine de changement d'un module:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
* Change le module pointe par la souris, par un autre en conservant
|
|
|
|
|
* - meme orientation
|
|
|
|
|
* - meme position
|
|
|
|
|
* - memes textes valeur et ref
|
|
|
|
|
* - memes netnames pour pads de meme nom
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_ExchangeModuleFrame::Change_Module( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxString newmodulename = m_NewModule->GetValue();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( newmodulename == wxEmptyString )
|
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( Change_1_Module( m_CurrentModule, newmodulename, TRUE ) )
|
|
|
|
|
{
|
2009-01-05 05:21:35 +00:00
|
|
|
|
m_Parent->GetBoard()->m_Status_Pcb = 0;
|
2009-05-24 18:28:36 +00:00
|
|
|
|
m_Parent->GetBoard()->Build_Pads_Full_List();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Routine de changement de tous les modules de meme nom lib que celui
|
2007-08-23 04:28:46 +00:00
|
|
|
|
* selectionne, en conservant
|
|
|
|
|
* - meme orientation
|
|
|
|
|
* - meme position
|
|
|
|
|
* - memes textes valeur et ref
|
|
|
|
|
* - memes netnames pour pads de meme nom
|
|
|
|
|
* et en remplacant l'ancien module par le noveau module
|
|
|
|
|
* Attention: m_CurrentModule ne pointe plus sur le module de reference
|
|
|
|
|
* puisque celui ci a ete change!!
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_ExchangeModuleFrame::Change_ModuleId( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxString msg;
|
2009-02-15 20:14:26 +00:00
|
|
|
|
MODULE* Module, * PtBack;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
bool change = FALSE;
|
|
|
|
|
wxString newmodulename = m_NewModule->GetValue();
|
|
|
|
|
wxString value, lib_reference; // pour memo Reflib et value de reference
|
|
|
|
|
bool check_module_value = FALSE;
|
|
|
|
|
int ShowErr = 5; // Affiche 5 messages d'err maxi
|
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
if( m_Parent->GetBoard()->m_Modules == NULL )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
return;
|
|
|
|
|
if( newmodulename == wxEmptyString )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
lib_reference = m_CurrentModule->m_LibRef;
|
|
|
|
|
if( event.GetId() == ID_EXEC_EXCHANGE_ID_MODULE_AND_VALUE )
|
|
|
|
|
{
|
|
|
|
|
check_module_value = TRUE;
|
|
|
|
|
value = m_CurrentModule->m_Value->m_Text;
|
|
|
|
|
msg.Printf( _( "Change modules <%s> -> <%s> (val = %s)?" ),
|
2009-05-01 18:06:03 +00:00
|
|
|
|
m_CurrentModule->m_LibRef.GetData(),
|
|
|
|
|
newmodulename.GetData(),
|
|
|
|
|
m_CurrentModule->m_Value->m_Text.GetData() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
msg.Printf( _( "Change modules <%s> -> <%s> ?" ),
|
2009-05-01 18:06:03 +00:00
|
|
|
|
lib_reference.GetData(), newmodulename.GetData() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !IsOK( this, msg ) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Le changement s'effectue a partir du dernier module car la routine
|
|
|
|
|
* Change_1_Module() modifie le dernier module de la liste
|
|
|
|
|
*/
|
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
Module = m_Parent->GetBoard()->m_Modules;
|
|
|
|
|
for( ; Module != NULL; Module = Module->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2009-02-15 20:14:26 +00:00
|
|
|
|
if( Module->Next() == NULL )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
/* Ici Module pointe le dernier module de la liste */
|
2009-05-01 18:06:03 +00:00
|
|
|
|
for( ;
|
|
|
|
|
Module && ( (BOARD*) Module != m_Parent->GetBoard() );
|
|
|
|
|
Module = PtBack )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
|
|
|
|
MODULE* module;
|
2009-02-15 20:14:26 +00:00
|
|
|
|
PtBack = Module->Back();
|
|
|
|
|
if( lib_reference.CmpNoCase( Module->m_LibRef ) != 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
continue;
|
|
|
|
|
if( check_module_value )
|
|
|
|
|
{
|
2009-02-15 20:14:26 +00:00
|
|
|
|
if( value.CmpNoCase( Module->m_Value->m_Text ) != 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
continue;
|
|
|
|
|
}
|
2009-02-15 20:14:26 +00:00
|
|
|
|
module = Change_1_Module( Module, newmodulename.GetData(), ShowErr );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( module )
|
|
|
|
|
change = TRUE;
|
|
|
|
|
else if( ShowErr )
|
|
|
|
|
ShowErr--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( change )
|
|
|
|
|
{
|
2009-01-05 05:21:35 +00:00
|
|
|
|
m_Parent->GetBoard()->m_Status_Pcb = 0;
|
2009-05-24 18:28:36 +00:00
|
|
|
|
m_Parent->GetBoard()->Build_Pads_Full_List();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Routine de changement de tous les modules par les modules de meme nom lib:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
* en conservant
|
|
|
|
|
* - meme orientation
|
|
|
|
|
* - meme position
|
|
|
|
|
* - memes textes valeur et ref
|
|
|
|
|
* - memes netnames pour pads de meme nom
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_ExchangeModuleFrame::Change_ModuleAll( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-05-01 18:06:03 +00:00
|
|
|
|
MODULE* Module, * PtBack;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
bool change = FALSE;
|
|
|
|
|
int ShowErr = 5; // Affiche 5 messages d'err maxi
|
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
if( m_Parent->GetBoard()->m_Modules == NULL )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( !IsOK( this, _( "Change ALL modules ?" ) ) )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Le changement s'effectue a partir du dernier module car la routine
|
|
|
|
|
* Change_1_Module() modifie le dernier module de la liste
|
|
|
|
|
*/
|
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
Module = m_Parent->GetBoard()->m_Modules;
|
|
|
|
|
for( ; Module != NULL; Module = Module->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2009-02-15 20:14:26 +00:00
|
|
|
|
if( Module->Next() == NULL )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
/* Ici Module pointe le dernier module de la liste */
|
2009-05-01 18:06:03 +00:00
|
|
|
|
for( ;
|
|
|
|
|
Module && ( (BOARD*) Module != m_Parent->GetBoard() );
|
|
|
|
|
Module = PtBack )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2009-02-15 20:14:26 +00:00
|
|
|
|
PtBack = Module->Back();
|
|
|
|
|
if( Change_1_Module( Module, Module->m_LibRef.GetData(), ShowErr ) )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
change = TRUE;
|
|
|
|
|
else if( ShowErr )
|
|
|
|
|
ShowErr--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( change )
|
|
|
|
|
{
|
2009-01-05 05:21:35 +00:00
|
|
|
|
m_Parent->GetBoard()->m_Status_Pcb = 0;
|
2009-05-24 18:28:36 +00:00
|
|
|
|
m_Parent->GetBoard()->Build_Pads_Full_List();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Routine de changement d'un module:
|
2007-08-23 04:28:46 +00:00
|
|
|
|
* Change le module de numero empr, avec le module de nom new_module
|
|
|
|
|
* - meme orientation
|
|
|
|
|
* - meme position
|
|
|
|
|
* - memes textes valeur et ref
|
|
|
|
|
* - memes netnames pour pads de meme nom
|
|
|
|
|
* Retourne :
|
|
|
|
|
* 0 si pas de changement ( si le nouveau module n'est pas en libr)
|
|
|
|
|
* 1 si OK
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* Module,
|
|
|
|
|
const wxString& new_module,
|
|
|
|
|
bool ShowError )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxString namecmp, oldnamecmp;
|
|
|
|
|
MODULE* NewModule;
|
|
|
|
|
wxString Line;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
if( Module == NULL )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
return NULL;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxBusyCursor dummy;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/* Memorisation des parametres utiles de l'ancien module */
|
2009-02-15 20:14:26 +00:00
|
|
|
|
oldnamecmp = Module->m_LibRef;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
namecmp = new_module;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/* Chargement du module */
|
|
|
|
|
Line.Printf( _( "Change module %s (%s) " ),
|
2009-05-01 18:06:03 +00:00
|
|
|
|
Module->m_Reference->m_Text.GetData(), oldnamecmp.GetData() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
m_WinMsg->WriteText( Line );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
namecmp.Trim( TRUE );
|
|
|
|
|
namecmp.Trim( FALSE );
|
2009-05-01 18:06:03 +00:00
|
|
|
|
NewModule = m_Parent->Get_Librairie_Module( wxEmptyString,
|
|
|
|
|
namecmp,
|
|
|
|
|
ShowError );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( NewModule == NULL ) /* Nouveau module NON trouve, reaffichage de l'ancien */
|
|
|
|
|
{
|
|
|
|
|
m_WinMsg->WriteText( wxT( "No\n" ) );
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
if( Module == m_CurrentModule )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
m_CurrentModule = NewModule;
|
|
|
|
|
m_WinMsg->WriteText( wxT( "Ok\n" ) );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/* Effacement a l'ecran de l'ancien module */
|
2009-02-15 20:14:26 +00:00
|
|
|
|
Module->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-02-15 20:14:26 +00:00
|
|
|
|
m_Parent->Exchange_Module( this, Module, NewModule );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
/* Affichage du nouveau module */
|
2008-04-01 05:21:50 +00:00
|
|
|
|
NewModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
Maj_ListeCmp( NewModule->m_Reference->m_Text,
|
|
|
|
|
oldnamecmp,
|
|
|
|
|
namecmp,
|
|
|
|
|
ShowError );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
return NewModule;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
/*
|
2009-05-01 18:06:03 +00:00
|
|
|
|
* Remplace le module OldModule par le module NewModule (en conservant
|
|
|
|
|
* position, orientation..)
|
|
|
|
|
* OldModule est supprim<EFBFBD> de la memoire.
|
2007-08-23 04:28:46 +00:00
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
|
|
|
|
|
MODULE* OldModule,
|
|
|
|
|
MODULE* NewModule )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-05-01 18:06:03 +00:00
|
|
|
|
wxPoint oldpos; /* memorisation temporaire pos curseur */
|
2008-12-14 19:45:05 +00:00
|
|
|
|
D_PAD* pad, * old_pad;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
if( (OldModule->Type() != TYPE_MODULE)
|
|
|
|
|
|| (NewModule->Type() != TYPE_MODULE) )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2009-05-21 17:42:42 +00:00
|
|
|
|
DisplayError( winaff,
|
|
|
|
|
wxT( "WinEDA_BasePcbFrame::Exchange_Module() StuctType error" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
NewModule->SetParent( GetBoard() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
GetBoard()->m_Status_Pcb = 0;
|
2008-04-17 16:25:29 +00:00
|
|
|
|
oldpos = GetScreen()->m_Curseur;
|
|
|
|
|
GetScreen()->m_Curseur = OldModule->m_Pos;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
Place_Module( NewModule, NULL );
|
2008-04-17 16:25:29 +00:00
|
|
|
|
GetScreen()->m_Curseur = oldpos;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
/* Changement eventuel de couche */
|
|
|
|
|
if( OldModule->GetLayer() != NewModule->GetLayer() )
|
|
|
|
|
{
|
2009-01-05 05:21:35 +00:00
|
|
|
|
GetBoard()->Change_Side_Module( NewModule, NULL );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Rotation eventuelle du module */
|
|
|
|
|
if( OldModule->m_Orient != NewModule->m_Orient )
|
|
|
|
|
{
|
|
|
|
|
Rotate_Module( NULL, NewModule, OldModule->m_Orient, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Mise a jour des textes ref et val */
|
|
|
|
|
NewModule->m_Reference->m_Text = OldModule->m_Reference->m_Text;
|
2009-05-01 18:06:03 +00:00
|
|
|
|
NewModule->m_Value->m_Text = OldModule->m_Value->m_Text;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
/* Mise a jour des autres parametres */
|
|
|
|
|
NewModule->m_TimeStamp = OldModule->m_TimeStamp;
|
2008-04-01 05:21:50 +00:00
|
|
|
|
NewModule->m_Path = OldModule->m_Path;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
/* mise a jour des netnames ( lorsque c'est possible) */
|
2008-12-14 19:45:05 +00:00
|
|
|
|
pad = NewModule->m_Pads;
|
|
|
|
|
for( ; pad != NULL; pad = pad->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
|
pad->SetNetname( wxEmptyString );
|
|
|
|
|
pad->SetNet( 0 );
|
|
|
|
|
old_pad = OldModule->m_Pads;
|
|
|
|
|
for( ; old_pad != NULL; old_pad = old_pad->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2008-12-14 19:45:05 +00:00
|
|
|
|
if( strnicmp( pad->m_Padname, old_pad->m_Padname,
|
2009-05-01 18:06:03 +00:00
|
|
|
|
sizeof(pad->m_Padname) ) == 0 )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
2009-05-01 18:06:03 +00:00
|
|
|
|
pad->SetNetname( old_pad->GetNetname() );
|
2008-12-14 19:45:05 +00:00
|
|
|
|
pad->SetNet( old_pad->GetNet() );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Effacement de l'ancien module */
|
2009-05-01 18:06:03 +00:00
|
|
|
|
OldModule->DeleteStructure();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-01-05 05:21:35 +00:00
|
|
|
|
GetBoard()->m_Status_Pcb = 0;
|
2009-05-01 18:06:03 +00:00
|
|
|
|
NewModule->m_Flags = 0;
|
2008-04-17 16:25:29 +00:00
|
|
|
|
GetScreen()->SetModify();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
return NewModule;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-05-01 18:06:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* affiche la liste des modules en librairie et selectione 1 nom
|
|
|
|
|
*/
|
2007-08-23 04:28:46 +00:00
|
|
|
|
void WinEDA_ExchangeModuleFrame::Sel_NewMod_By_Liste( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
|
wxString newname;
|
|
|
|
|
|
|
|
|
|
newname = m_Parent->Select_1_Module_From_List( m_Parent,
|
|
|
|
|
wxEmptyString,
|
|
|
|
|
wxEmptyString,
|
|
|
|
|
wxEmptyString );
|
|
|
|
|
if( newname != wxEmptyString )
|
|
|
|
|
m_NewModule->SetValue( newname );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2009-03-30 15:36:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function RecreateBOMFileFromBoard
|
|
|
|
|
* Recreates a .cmp file from the current loaded board
|
|
|
|
|
* this is the same as created by cvpcb.
|
|
|
|
|
* can be used if this file is lost
|
|
|
|
|
*/
|
2009-05-01 18:06:03 +00:00
|
|
|
|
void WinEDA_PcbFrame::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
wxFileName fn;
|
|
|
|
|
FILE* FichCmp;
|
|
|
|
|
char Line[1024];
|
|
|
|
|
MODULE* Module = GetBoard()->m_Modules;
|
|
|
|
|
wxString msg;
|
|
|
|
|
wxString wildcard;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
|
|
|
|
if( Module == NULL )
|
|
|
|
|
{
|
|
|
|
|
DisplayError( this, _( "No Modules!" ) );
|
2009-03-30 15:36:41 +00:00
|
|
|
|
return;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Calcul nom fichier CMP par changement de l'extension du nom netliste */
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn = GetScreen()->m_FileName;
|
|
|
|
|
fn.SetExt( NetCmpExtBuffer );
|
|
|
|
|
wildcard = _( "Component files (." ) + NetCmpExtBuffer + wxT( ")|*." ) +
|
2009-05-01 18:06:03 +00:00
|
|
|
|
NetCmpExtBuffer;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
|
|
wxFileDialog dlg( this, _( "Save Component Files" ), wxEmptyString,
|
|
|
|
|
fn.GetFullName(), wildcard,
|
|
|
|
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
|
|
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
2009-03-30 15:36:41 +00:00
|
|
|
|
return;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn = dlg.GetPath();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
FichCmp = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
if( FichCmp == NULL )
|
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
msg = _( "Unable to create file " ) + fn.GetFullPath();
|
2007-08-23 04:28:46 +00:00
|
|
|
|
DisplayError( this, msg );
|
2009-03-30 15:36:41 +00:00
|
|
|
|
return;
|
2007-08-23 04:28:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fgets( Line, sizeof(Line), FichCmp );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fprintf( FichCmp, "Cmp-Mod V01 Genere par PcbNew le %s\n",
|
|
|
|
|
DateAndTime( Line ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
|
2008-11-24 06:53:43 +00:00
|
|
|
|
for( ; Module != NULL; Module = Module->Next() )
|
2007-08-23 04:28:46 +00:00
|
|
|
|
{
|
|
|
|
|
fprintf( FichCmp, "\nBeginCmp\n" );
|
|
|
|
|
fprintf( FichCmp, "TimeStamp = %8.8lX\n", Module->m_TimeStamp );
|
2009-05-01 18:06:03 +00:00
|
|
|
|
fprintf( FichCmp, "Path = %s\n", CONV_TO_UTF8( Module->m_Path ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
fprintf( FichCmp, "Reference = %s;\n",
|
|
|
|
|
!Module->m_Reference->m_Text.IsEmpty() ?
|
|
|
|
|
CONV_TO_UTF8( Module->m_Reference->m_Text ) : "[NoRef]" );
|
|
|
|
|
fprintf( FichCmp, "ValeurCmp = %s;\n",
|
|
|
|
|
!Module->m_Value->m_Text.IsEmpty() ?
|
|
|
|
|
CONV_TO_UTF8( Module->m_Value->m_Text ) : "[NoVal]" );
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fprintf( FichCmp, "IdModule = %s;\n",
|
|
|
|
|
CONV_TO_UTF8( Module->m_LibRef ) );
|
2007-08-23 04:28:46 +00:00
|
|
|
|
fprintf( FichCmp, "EndCmp\n" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fprintf( FichCmp, "\nEndListe\n" );
|
|
|
|
|
fclose( FichCmp );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|