2009-02-04 15:25:03 +00:00
|
|
|
|
/***************/
|
|
|
|
|
/* genstf() */
|
|
|
|
|
/***************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* genere le fichier STF type 'ref' 'nom_empreinte' pour DRAFT */
|
|
|
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
#include "wxstruct.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "confirm.h"
|
|
|
|
|
#include "gestfich.h"
|
2009-04-05 20:49:15 +00:00
|
|
|
|
#include "macros.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "cvpcb.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#include "protos.h"
|
2009-02-04 15:25:03 +00:00
|
|
|
|
#include "cvstruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
|
|
|
|
|
|
void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
2009-04-23 15:02:18 +00:00
|
|
|
|
FILE* FileEquiv;
|
|
|
|
|
wxString Line;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
wxFileName fn = m_NetlistFileName;
|
2009-02-04 15:25:03 +00:00
|
|
|
|
|
2009-05-06 11:55:36 +00:00
|
|
|
|
if( m_components.empty() )
|
2009-02-04 15:25:03 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* calcul du nom du fichier */
|
2009-04-05 20:49:15 +00:00
|
|
|
|
fn.SetExt( RetroFileExtension );
|
|
|
|
|
|
|
|
|
|
wxFileDialog dlg( this, wxT( "Save Stuff File" ), fn.GetPath(),
|
|
|
|
|
fn.GetFullName(), RetroFileWildcard,
|
|
|
|
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
|
|
|
|
|
|
|
|
|
|
if( dlg.ShowModal() == wxID_CANCEL )
|
2009-02-04 15:25:03 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
|
FileEquiv = wxFopen( dlg.GetPath(), wxT( "wt" ) );
|
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
|
if( FileEquiv == 0 )
|
|
|
|
|
{
|
2009-04-05 20:49:15 +00:00
|
|
|
|
Line = _( "Unable to create " ) + dlg.GetPath();
|
2009-02-04 15:25:03 +00:00
|
|
|
|
DisplayError( this, Line, 30 );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generation de la liste */
|
2009-05-06 11:55:36 +00:00
|
|
|
|
BOOST_FOREACH( COMPONENT& component, m_components )
|
2009-02-04 15:25:03 +00:00
|
|
|
|
{
|
|
|
|
|
/* g<>n<EFBFBD>ration du composant si son empreinte est d<>finie */
|
2009-05-06 11:55:36 +00:00
|
|
|
|
if( component.m_Module.empty() )
|
2009-02-04 15:25:03 +00:00
|
|
|
|
continue;
|
|
|
|
|
fprintf( FileEquiv, "comp = \"%s\" module = \"%s\"\n",
|
2009-05-06 11:55:36 +00:00
|
|
|
|
CONV_TO_UTF8( component.m_Reference ),
|
|
|
|
|
CONV_TO_UTF8( component.m_Module ) );
|
2009-02-04 15:25:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose( FileEquiv );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|