You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB

  1. /*****************/
  2. /* genequiv.cpp */
  3. /*****************/
  4. #include "fctsys.h"
  5. #include "wxstruct.h"
  6. #include "confirm.h"
  7. #include "gestfich.h"
  8. #include "macros.h"
  9. #include "cvpcb.h"
  10. #include "protos.h"
  11. #include "cvstruct.h"
  12. void WinEDA_CvpcbFrame::WriteStuffList( wxCommandEvent& event )
  13. {
  14. FILE* FileEquiv;
  15. wxString Line;
  16. wxFileName fn = m_NetlistFileName;
  17. if( m_components.empty() )
  18. return;
  19. fn.SetExt( RetroFileExtension );
  20. wxFileDialog dlg( this, wxT( "Save Stuff File" ), fn.GetPath(),
  21. fn.GetFullName(), RetroFileWildcard,
  22. wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
  23. if( dlg.ShowModal() == wxID_CANCEL )
  24. return;
  25. FileEquiv = wxFopen( dlg.GetPath(), wxT( "wt" ) );
  26. if( FileEquiv == 0 )
  27. {
  28. Line = _( "Unable to create " ) + dlg.GetPath();
  29. DisplayError( this, Line, 30 );
  30. return;
  31. }
  32. BOOST_FOREACH( COMPONENT& component, m_components )
  33. {
  34. if( component.m_Module.empty() )
  35. continue;
  36. fprintf( FileEquiv, "comp = \"%s\" module = \"%s\"\n",
  37. CONV_TO_UTF8( component.m_Reference ),
  38. CONV_TO_UTF8( component.m_Module ) );
  39. }
  40. fclose( FileEquiv );
  41. }