2009-11-05 19:26:52 +00:00
|
|
|
/*****************/
|
|
|
|
/* genequiv.cpp */
|
|
|
|
/*****************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#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"
|
2011-02-05 16:15:48 +00:00
|
|
|
#include "cvpcb_mainframe.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
|
2011-02-05 16:15:48 +00:00
|
|
|
void CVPCB_MAINFRAME::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;
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2009-05-06 11:55:36 +00:00
|
|
|
BOOST_FOREACH( COMPONENT& component, m_components )
|
2009-02-04 15:25:03 +00:00
|
|
|
{
|
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
|
|
|
}
|