~zaka62/kicad/zaka-workspace

« back to all changes in this revision

Viewing changes to pcbnew/gen_modules_placefile.cpp

  • Committer: zaka62
  • Author(s): Kicad developers team.
  • Date: 2012-05-04 16:10:32 UTC
  • mfrom: (3480.1.60 testing)
  • Revision ID: zaka62@mail.ru-20120504161032-c5lnbcyhhbt9fn4z
Merge upstream changes from the 3540 commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
    if( singleFile )
213
213
    {
214
214
        side = 2;
215
 
        fn.SetName( fn.GetName() + wxT( "_" ) + wxT("all") );
 
215
        fn.SetName( fn.GetName() + wxT( "-" ) + wxT("all") );
216
216
    }
217
217
     else
218
 
        fn.SetName( fn.GetName() + wxT( "_" ) + frontLayerName );
 
218
        fn.SetName( fn.GetName() + wxT( "-" ) + frontLayerName );
219
219
 
220
220
    fn.SetExt( FootprintPlaceFileExtension );
221
221
 
252
252
    side = 0;
253
253
    fn = screen->GetFileName();
254
254
    fn.SetPath( GetOutputDirectory() );
255
 
    fn.SetName( fn.GetName() + wxT( "_" ) + backLayerName );
 
255
    fn.SetName( fn.GetName() + wxT( "-" ) + backLayerName );
256
256
    fn.SetExt( wxT( "pos" ) );
257
257
 
258
258
    fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(),
286
286
}
287
287
 
288
288
// Defined values to write coordinates using inches or mm:
289
 
static const double conv_unit_inch = 0.0001;      // units = INCHES
 
289
static const double conv_unit_inch = 0.001 / IU_PER_MILS ;      // units = INCHES
290
290
static const char unit_text_inch[] = "## Unit = inches, Angle = deg.\n";
291
291
 
292
 
static const double conv_unit_mm = 0.00254;    // units = mm
 
292
static const double conv_unit_mm = 1.0 / IU_PER_MM;    // units = mm
293
293
static const char unit_text_mm[] = "## Unit = mm, Angle = deg.\n";
294
294
 
295
295
static wxPoint File_Place_Offset;  // Offset coordinates for generated file.
451
451
    fputs( line, file );
452
452
 
453
453
    sprintf( line,
454
 
             "# Ref    Val                  PosX       PosY        Rot     Side\n" );
 
454
             "# Ref    Val                  Package         PosX       PosY        Rot     Side\n" );
455
455
    fputs( line, file );
456
456
 
457
457
    for( int ii = 0; ii < moduleCount; ii++ )
458
458
    {
459
459
        wxPoint  module_pos;
460
 
        wxString ref = list[ii].m_Reference;
461
 
        wxString val = list[ii].m_Value;
462
 
        sprintf( line, "%-8.8s %-16.16s ", TO_UTF8( ref ), TO_UTF8( val ) );
 
460
        const wxString& ref = list[ii].m_Reference;
 
461
        const wxString& val = list[ii].m_Value;
 
462
        const wxString& pkg = list[ii].m_Module->m_LibRef;
 
463
        sprintf( line, "%-8.8s %-16.16s %-16.16s", 
 
464
                 TO_UTF8( ref ), TO_UTF8( val ), TO_UTF8( pkg ) );
463
465
 
464
466
        module_pos    = list[ii].m_Module->m_Pos;
465
467
        module_pos -= File_Place_Offset;
466
468
 
467
469
        char* text = line + strlen( line );
 
470
        /* Keep the coordinates in the first quadrant, like the gerbers
 
471
         * (i.e. change sign to y) */
468
472
        sprintf( text, " %9.4f  %9.4f  %8.1f    ",
469
473
                 module_pos.x * conv_unit,
470
 
                 module_pos.y * conv_unit,
 
474
                 -module_pos.y * conv_unit,
471
475
                 double(list[ii].m_Module->m_Orient) / 10 );
472
476
 
473
477
        int layer = list[ii].m_Module->GetLayer();