Commit e0742b62 authored by charras's avatar charras

fixed labels errors in dilaoge_global_edit_tracks and vias_base

fixed some problems in gencad export (not all)
fixed a size problem when opening dialog_layers_setup2 (windows specific)
parent 98bc9bb9
No preview for this file type
This diff is collapsed.
......@@ -61,11 +61,10 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
m_gridDisplayCurrentSettings->EnableDragColSize( true );
m_gridDisplayCurrentSettings->SetColLabelSize( 30 );
m_gridDisplayCurrentSettings->SetColLabelValue( 0, _("Track size") );
m_gridDisplayCurrentSettings->SetColLabelValue( 1, _("Via size") );
m_gridDisplayCurrentSettings->SetColLabelValue( 2, _("Via Diameter") );
m_gridDisplayCurrentSettings->SetColLabelValue( 3, _("Via drill") );
m_gridDisplayCurrentSettings->SetColLabelValue( 4, _("uVia size") );
m_gridDisplayCurrentSettings->SetColLabelValue( 5, _("uVia Drill") );
m_gridDisplayCurrentSettings->SetColLabelValue( 1, _("Via diameter") );
m_gridDisplayCurrentSettings->SetColLabelValue( 2, _("Via drill") );
m_gridDisplayCurrentSettings->SetColLabelValue( 3, _("uVia size") );
m_gridDisplayCurrentSettings->SetColLabelValue( 4, _("uVia Drill") );
m_gridDisplayCurrentSettings->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
......@@ -80,9 +79,9 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
// Cell Defaults
m_gridDisplayCurrentSettings->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
sbCurrSettingsSizer->Add( m_gridDisplayCurrentSettings, 0, wxTOP|wxBOTTOM, 5 );
sbCurrSettingsSizer->Add( m_gridDisplayCurrentSettings, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbCurrSettingsSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( sbCurrSettingsSizer, 1, wxALL|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
......@@ -135,7 +134,7 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
sbSizerCommands->Add( fgSizer2, 1, wxEXPAND, 5 );
bLowerSizer->Add( sbSizerCommands, 1, 0, 5 );
bLowerSizer->Add( sbSizerCommands, 1, wxEXPAND, 5 );
wxBoxSizer* bbuttonsSizer;
bbuttonsSizer = new wxBoxSizer( wxVERTICAL );
......@@ -145,7 +144,7 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE
bLowerSizer->Add( bbuttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
bMainSizer->Add( bLowerSizer, 1, wxEXPAND, 5 );
bMainSizer->Add( bLowerSizer, 1, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer );
this->Layout();
......
......@@ -32,7 +32,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE</property>
<property name="pos"></property>
<property name="size">647,380</property>
<property name="size">711,418</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title"></property>
......@@ -77,8 +77,8 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Current Settings</property>
......@@ -311,7 +311,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxTOP|wxBOTTOM</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxGrid" expanded="1">
<property name="autosize_cols">1</property>
......@@ -324,7 +324,7 @@
<property name="cell_vert_alignment">wxALIGN_CENTRE</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">30</property>
<property name="col_label_values">&quot;Track size&quot; &quot;Via size&quot; &quot;Via Diameter&quot; &quot;Via drill&quot; &quot;uVia size&quot; &quot;uVia Drill&quot;</property>
<property name="col_label_values">&quot;Track size&quot; &quot;Via diameter&quot; &quot;Via drill&quot; &quot;uVia size&quot; &quot;uVia Drill&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">5</property>
<property name="column_sizes"></property>
......@@ -473,7 +473,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
......@@ -482,7 +482,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
......
......@@ -63,7 +63,7 @@ class DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE : public wxDialog
public:
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 647,380 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 711,418 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE();
};
......
......@@ -174,6 +174,8 @@ DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) :
Init();
SetAutoLayout( true );
Layout();
Center();
}
......
......@@ -22,6 +22,7 @@ static void CreateRoutesSection( FILE* file, BOARD* pcb );
static void CreateSignalsSection( FILE* file, BOARD* pcb );
static void CreateShapesSection( FILE* file, BOARD* pcb );
static void CreatePadsShapesSection( FILE* file, BOARD* pcb );
static void CreatePadsStacksSection( FILE* file, BOARD* pcb );
static void FootprintWriteShape( FILE* File, MODULE* module );
// layer name for Gencad export
......@@ -72,8 +73,8 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
wxString msg, ext, wildcard;
FILE* file;
ext = wxT( "gcd" );
wildcard = _( "GenCAD board files (.gcd)|*.gcd" );
ext = wxT( "cad" );
wildcard = _( "GenCAD 1.4 board files (.cad)|*.cad" );
fn.SetExt( ext );
wxFileDialog dlg( this, _( "Save GenCAD Board File" ), wxGetCwd(),
......@@ -126,14 +127,20 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
/* Create the shapes list
* (shapes of pads and footprints */
CreatePadsShapesSection( file, GetBoard() ); // doit etre appele avant CreateShapesSection()
CreatePadsShapesSection( file, GetBoard() ); /* Must be called
* before CreatePadsStacksSection and
* CreateShapesSection()
*/
CreatePadsStacksSection( file, GetBoard() );
CreateShapesSection( file, GetBoard() );
CreateDevicesSection( file, GetBoard() );
CreateComponentsSection( file, GetBoard() );
/* Create the list of Nets: */
CreateSignalsSection( file, GetBoard() );
CreateDevicesSection( file, GetBoard() );
CreateComponentsSection( file, GetBoard() );
// Cretaes the Routes section (i.e. the list of board tracks)
CreateRoutesSection( file, GetBoard() );
fclose( file );
......@@ -168,6 +175,22 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
/* Creates the pads shapes list ( 1 shape per pad )
* Uses .GetSubRatsnest member of class D_PAD, to handle the shape id (value 1 ..n)
* for pads shapes PAD1 to PADn
*
* The PADS section is used to describe the shape of all the pads used on the printed circuit
* board. The PADS section must be included, even if only a default pad is described and used for
* all pads. The keywords used in the PADS section are:
* $PADS
* PAD <pad_name> <pad_type> <drill_size>
* LINE <line_ref>
* ARC <arc_ref>
* CIRCLE <circle_ref>
* RECTANGLE <rectangle_ref>
* ATTRIBUTE <attrib_ref>
* $ENDPADS
* $PADS and $ENDPADS mark the PADS section of the GenCAD file. Each pad description
* must start with a PAD keyword.
* The layer in which a pad lies is defined in the SHAPE section of the GenCAD specification.
* The pad is always placed on a shape at the pad origin, or in a pad stack at the pad stack origin.
*/
{
std::vector<D_PAD*> pads;
......@@ -279,6 +302,25 @@ void CreatePadsShapesSection( FILE* file, BOARD* pcb )
}
/*****************************************************/
void CreatePadsStacksSection( FILE* file, BOARD* pcb )
/*****************************************************/
/*The PADSTACKS section is optional, and is used to describe how a group of pads are
* arranged. The keywords used in the PADSTACKS section are:
* $PADSTACKS
* PADSTACK <pad_name> <drill_size>
* PAD <pad_name> <layer> <rot> <mirror>
* ATTRIBUTE <attrib_ref>
* $ENDPADSTACKS
* $PADSTACKS and $ENDPADSTACKS mark the PADSTACKS section of the GenCAD file.
*/
{
fputs( "$PADSTACKS\n", file );
fputs( "$ENDPADSTACKS\n\n", file );
}
/**************************************************/
void CreateShapesSection( FILE* file, BOARD* pcb )
/**************************************************/
......@@ -293,6 +335,7 @@ void CreateShapesSection( FILE* file, BOARD* pcb )
* Syntaxe:
* $SHAPES
* SHAPE <shape_name>
* INSERT <string> here <string> = "TH"
* shape_descr (line, arc ..)
* PIN <pin_name> <pad_name> <x_y_ref> <layer> <rot> <mirror>
*
......@@ -462,7 +505,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
if( net->GetNet() <= 0 ) // dummy equipot (non connexion)
continue;
msg = wxT( "\nSIGNAL " ) + net->GetNetname();
msg = wxT( "SIGNAL " ) + net->GetNetname();
fputs( CONV_TO_UTF8( msg ), file );
fputs( "\n", file );
......@@ -498,7 +541,7 @@ bool CreateHeaderInfoData( FILE* file, WinEDA_PcbFrame* frame )
*/
{
wxString msg;
PCB_SCREEN* screen = (PCB_SCREEN*)( frame->GetScreen() );
PCB_SCREEN* screen = (PCB_SCREEN*) ( frame->GetScreen() );
fputs( "$HEADER\n", file );
fputs( "GENCAD 1.4\n", file );
......@@ -550,7 +593,8 @@ static int Track_list_Sort_by_Netcode( const void* refptr, const void* objptr )
void CreateRoutesSection( FILE* file, BOARD* pcb )
/*************************************************/
/* Creates the tracks, vias
/* Creates the section ROUTES
* that handles tracks, vias
* TODO: add zones
* section:
* $ROUTE
......@@ -606,7 +650,7 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
netname = net->GetNetname();
else
netname = wxT( "_noname_" );
fprintf( file, "\nROUTE %s\n", CONV_TO_UTF8( netname ) );
fprintf( file, "ROUTE %s\n", CONV_TO_UTF8( netname ) );
}
if( old_width != track->m_Width )
......@@ -647,7 +691,7 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
void CreateDevicesSection( FILE* file, BOARD* pcb )
/***************************************************/
/* Creatthes the section $DEVICES
/* Creates the section $DEVICES
* This is a list of footprints properties
* ( Shapes are in section $SHAPE )
*/
......@@ -682,7 +726,7 @@ void CreateDevicesSection( FILE* file, BOARD* pcb )
void CreateBoardSection( FILE* file, BOARD* pcb )
/*************************************************/
/* Creatthe section $BOARD.
/* Creates the section $BOARD.
* We output here only the board boudary box
*/
{
......@@ -780,6 +824,7 @@ void FootprintWriteShape( FILE* file, MODULE* module )
* The shape is always given "normal" (Orient 0, not mirrored)
* Syntax:
* SHAPE <shape_name>
* INSERT <string> here <string> = "TH"
* shape_descr (line, arc ..):
* LINE startX startY endX endY
* ARC startX startY endX endY centreX centreY
......@@ -792,7 +837,8 @@ void FootprintWriteShape( FILE* file, MODULE* module )
/* creates header: */
fprintf( file, "\nSHAPE %s\n", CONV_TO_UTF8( module->m_Reference->m_Text ) );
fprintf( file, "SHAPE %s\n", CONV_TO_UTF8( module->m_Reference->m_Text ) );
fprintf( file, "INSERT %s\n", (module->m_Attributs & MOD_CMS) ? "SMD" : "TH" );
/* creates Attributs */
if( module->m_Attributs != MOD_DEFAULT )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment