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.

59 lines
1.3 KiB

  1. /***************/
  2. /* genstf() */
  3. /***************/
  4. /* genere le fichier STF type 'ref' 'nom_empreinte' pour DRAFT */
  5. #include "fctsys.h"
  6. #include "wxstruct.h"
  7. #include "common.h"
  8. #include "cvpcb.h"
  9. #include "protos.h"
  10. void WinEDA_CvpcbFrame::WriteStuffList(wxCommandEvent & event)
  11. {
  12. FILE * FileEquiv;
  13. STORECMP * Cmp;
  14. wxString Line, FullFileName, Mask;
  15. if( nbcomp <= 0 ) return;
  16. /* calcul du nom du fichier */
  17. Mask = wxT("*") + ExtRetroBuffer;
  18. FullFileName = FFileName;
  19. ChangeFileNameExt(FullFileName, ExtRetroBuffer);
  20. FullFileName = EDA_FileSelector( wxT("Create Stuff File"),
  21. wxGetCwd(), /* Chemin par defaut */
  22. FullFileName, /* nom fichier par defaut */
  23. ExtRetroBuffer, /* extension par defaut */
  24. Mask, /* Masque d'affichage */
  25. this,
  26. wxFD_SAVE,
  27. TRUE
  28. );
  29. if ( FullFileName.IsEmpty() ) return;
  30. FileEquiv = wxFopen(FullFileName, wxT("wt") );
  31. if (FileEquiv == 0 )
  32. {
  33. Line = _("Unable to create ") + FullFileName;
  34. DisplayError(this, Line,30);
  35. return;
  36. }
  37. /* Generation de la liste */
  38. for (Cmp = g_BaseListeCmp ; Cmp != NULL ; Cmp = Cmp->Pnext )
  39. {
  40. /* g�n�ration du composant si son empreinte est d�finie */
  41. if ( Cmp->m_Module.IsEmpty() ) continue;
  42. fprintf(FileEquiv, "comp = \"%s\" module = \"%s\"\n",
  43. CONV_TO_UTF8(Cmp->m_Reference),
  44. CONV_TO_UTF8(Cmp->m_Module));
  45. }
  46. fclose(FileEquiv);
  47. }