Commit cdf248b2 authored by charras's avatar charras

minor bugs fix.

parent 34d5dff9
......@@ -14,8 +14,7 @@
static void LoadDCodeFile( WinEDA_GerberFrame* frame,
const wxString& FullFileName,
wxDC* DC );
const wxString& FullFileName );
void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
......@@ -26,11 +25,7 @@ void WinEDA_GerberFrame::OnFileHistory( wxCommandEvent& event )
if( fn != wxEmptyString && Clear_Pcb( true ) )
{
wxClientDC dc( DrawPanel );
DrawPanel->CursorOff( &dc );
LoadOneGerberFile( fn, &dc, false );
DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc );
LoadOneGerberFile( fn, false );
}
}
......@@ -40,16 +35,12 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
{
int id = event.GetId();
wxClientDC dc( DrawPanel );
DrawPanel->CursorOff( &dc );
switch( id )
{
case ID_LOAD_FILE:
if( Clear_Pcb( TRUE ) )
{
LoadOneGerberFile( wxEmptyString, &dc, 0 );
LoadOneGerberFile( wxEmptyString, 0 );
}
break;
......@@ -60,7 +51,7 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
GetScreen()->m_Active_Layer++;
if( !LoadOneGerberFile( wxEmptyString, &dc, 0 ) )
if( !LoadOneGerberFile( wxEmptyString, 0 ) )
GetScreen()->m_Active_Layer = origLayer;
SetToolbars();
......@@ -68,7 +59,7 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
break;
case ID_APPEND_FILE:
LoadOneGerberFile( wxEmptyString, &dc, 0 );
LoadOneGerberFile( wxEmptyString, 0 );
break;
case ID_NEW_BOARD:
......@@ -82,24 +73,21 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
break;
case ID_GERBVIEW_LOAD_DCODE_FILE:
LoadDCodeFile( this, wxEmptyString, &dc );
LoadDCodeFile( this, wxEmptyString );
break;
case ID_SAVE_BOARD:
SaveGerberFile( GetScreen()->m_FileName, &dc );
SaveGerberFile( GetScreen()->m_FileName );
break;
case ID_SAVE_BOARD_AS:
SaveGerberFile( wxEmptyString, &dc );
SaveGerberFile( wxEmptyString );
break;
default:
DisplayError( this, wxT( "File_io Internal Error" ) );
break;
}
DrawPanel->MouseToCursorSchema();
DrawPanel->CursorOn( &dc );
}
......@@ -111,8 +99,7 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
* 1 if OK
*/
bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
wxDC* DC,
int mode )
int mode )
{
wxString filetypes;
wxFileName filename = FullFileName;
......@@ -165,7 +152,7 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
wxSetWorkingDirectory( filename.GetPath() );
filename.SetExt( g_PenFilenameExt );
if( Read_GERBER_File( DC, GetScreen()->m_FileName, filename.GetFullPath() ) )
if( Read_GERBER_File( GetScreen()->m_FileName, filename.GetFullPath() ) )
SetLastProject( GetScreen()->m_FileName );
Zoom_Automatique( FALSE );
......@@ -184,8 +171,7 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
* 1 if OK
*/
static void LoadDCodeFile( WinEDA_GerberFrame* frame,
const wxString& FullFileName,
wxDC* DC )
const wxString& FullFileName )
{
wxString wildcard;
wxFileName fn = FullFileName;
......@@ -218,8 +204,7 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame,
/* Save the file in ASCII PCB.
*/
bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName,
wxDC* DC )
bool WinEDA_GerberFrame::SaveGerberFile( const wxString& FullFileName )
{
wxString wildcard;
wxFileName fn = FullFileName;
......
......@@ -95,26 +95,21 @@ bool WinEDA_App::OnInit()
return true;
fn = argv[1];
fn.SetExt( g_PhotoFilenameExt );
if( fn.IsOk() )
{
wxClientDC dc( frame->DrawPanel );
frame->DrawPanel->PrepareGraphicContext( &dc );
if( fn.DirExists() )
wxSetWorkingDirectory( fn.GetPath() );
// Load all files specified on the command line.
for( int i = 1; i < argc; ++i )
for( int ii = 1; ii < argc && ii <= LAYER_COUNT; ++ii )
{
fn = wxFileName( argv[i] );
fn.SetExt( g_PhotoFilenameExt );
fn = wxFileName( argv[ii] );
if( fn.FileExists() )
{
( (PCB_SCREEN*) frame->GetScreen() )->m_Active_Layer = i - 1;
frame->LoadOneGerberFile( fn.GetFullPath(), &dc, FALSE );
( (PCB_SCREEN*) frame->GetScreen() )->m_Active_Layer = ii - 1;
frame->LoadOneGerberFile( fn.GetFullPath(), FALSE );
}
}
}
......
......@@ -380,7 +380,7 @@ public:
int ReturnGCodeNumber( char*& Text );
int ReturnDCodeNumber( char*& Text );
bool Execute_G_Command( char*& text, int G_commande );
bool Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
bool Execute_DCODE_Command( WinEDA_GerberFrame* frame,
char*& text, int D_commande );
/**
......@@ -393,7 +393,7 @@ public:
* Function ReadRS274XCommand
* reads a single RS274X command terminated with a %
*/
bool ReadRS274XCommand( WinEDA_GerberFrame* frame, wxDC* DC,
bool ReadRS274XCommand( WinEDA_GerberFrame* frame,
char aBuff[GERBER_BUFZ], char*& text );
/**
......
......@@ -102,8 +102,7 @@
* CrLf after each command
* G codes BROKE
*/
bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
const wxString& GERBER_FullFileName,
bool WinEDA_GerberFrame::Read_GERBER_File( const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName )
{
int G_commande = 0,
......@@ -197,7 +196,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
case 'D': /* Line type Dxx : Tool selection (xx > 0) or
* command if xx = 0..9 */
D_commande = gerber->ReturnDCodeNumber( text );
gerber->Execute_DCODE_Command( this, DC, text, D_commande );
gerber->Execute_DCODE_Command( this, text, D_commande );
break;
case 'X':
......@@ -205,7 +204,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
pos = gerber->ReadXYCoord( text );
if( *text == '*' ) // command like X12550Y19250*
{
gerber->Execute_DCODE_Command( this, DC, text,
gerber->Execute_DCODE_Command( this, text,
gerber->m_Last_Pen_Command );
}
break;
......@@ -220,7 +219,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
{
gerber->m_CommandState = ENTER_RS274X_CMD;
if( !gerber->ReadRS274XCommand( this, DC, line, text ) )
if( !gerber->ReadRS274XCommand( this, line, text ) )
{
error++;
}
......@@ -244,7 +243,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
if( error )
{
msg.Printf( _( "%d errors while reading Gerber file [%s]" ),
error, GERBER_FullFileName.GetData() );
error, GetChars(GERBER_FullFileName) );
DisplayError( this, msg );
}
fclose( gerber->m_Current_File );
......
......@@ -849,7 +849,7 @@ static bool mapExposure( int param1, bool curExposure, bool isNegative )
}
bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame,
char*& text, int D_commande )
{
wxSize size( 15, 15 );
......
......@@ -106,7 +106,7 @@ static double ReadDouble( char*& text )
}
bool GERBER::ReadRS274XCommand( WinEDA_GerberFrame* frame, wxDC* DC,
bool GERBER::ReadRS274XCommand( WinEDA_GerberFrame* frame,
char buff[GERBER_BUFZ], char*& text )
{
bool ok = true;
......
......@@ -138,13 +138,11 @@ public:
void Files_io( wxCommandEvent& event );
void OnFileHistory( wxCommandEvent& event );
bool LoadOneGerberFile( const wxString& FileName, wxDC* DC,
int mode );
int ReadGerberFile( wxDC* DC, FILE* File, bool Append );
bool Read_GERBER_File( wxDC* DC,
const wxString& GERBER_FullFileName,
bool LoadOneGerberFile( const wxString& FileName, int mode );
int ReadGerberFile( FILE* File, bool Append );
bool Read_GERBER_File( const wxString& GERBER_FullFileName,
const wxString& D_Code_FullFileName );
bool SaveGerberFile( const wxString& FileName, wxDC* DC );
bool SaveGerberFile( const wxString& FileName );
void GeneralControle( wxDC* DC, wxPoint Mouse );
......
No preview for this file type
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-11-20 20:25+0100\n"
"PO-Revision-Date: 2009-11-20 20:28+0100\n"
"POT-Creation-Date: 2009-11-21 20:29+0100\n"
"PO-Revision-Date: 2009-11-21 20:35+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
......@@ -2552,49 +2552,9 @@ msgstr "Attention: option d'échelle ajustée à une valeur très grande"
msgid "No layer selected"
msgstr "Pas de couche sélectionnée"
#: pcbnew/dialog_freeroute_exchange.cpp:179
msgid "Export a Specctra Design (*.dsn) File"
msgstr "Exporter un fichier de conception Specctra (*.dsn)"
#: pcbnew/dialog_freeroute_exchange.cpp:181
msgid "Export a Specctra DSN file (to FreeRouter)"
msgstr "Exporter un fichier Specctra DSN (pour FreeRoute)"
#: pcbnew/dialog_freeroute_exchange.cpp:184
msgid "Launch FreeRouter via Java Web Start"
msgstr "Lancer FreeRouter via Java Web Start"
#: pcbnew/dialog_freeroute_exchange.cpp:186
msgid "Use Java Web Start function to run FreeRouter via Internet (or your Browser if not found)"
msgstr "Utiliser Java Web Start function pour lancer FreeRouter via Internet (ou votre Navigateur si non trouvé)"
#: pcbnew/dialog_freeroute_exchange.cpp:189
msgid "Back Import the Specctra Session (*.ses) File"
msgstr "Importer un Fichier Specctra Session (*.ses)"
#: pcbnew/dialog_freeroute_exchange.cpp:191
msgid "Merge a session file created by FreeRouter with the current board."
msgstr "Importer un fichier session créé par FreeRouter dans le C.I. courant."
#: pcbnew/dialog_freeroute_exchange.cpp:198
msgid "Visit FreeRouting.net website"
msgstr "Visiter le site FreeRouting.net"
#: pcbnew/dialog_freeroute_exchange.cpp:200
msgid "Launch your browser and go to the FreeRouting.net website"
msgstr "Lancer votre navigateur pour aller sur FreeRouting.net"
#: pcbnew/dialog_freeroute_exchange.cpp:203
msgid "FreeRouting.net URL"
msgstr "URL FreeRouting.net"
#: pcbnew/dialog_freeroute_exchange.cpp:208
msgid "The URL of the FreeRouting.net website"
msgstr "L' URL du site FreeRouting.net"
#: pcbnew/dialog_freeroute_exchange.cpp:214
msgid "&Close"
msgstr "&Fermer"
#: pcbnew/dialog_freeroute_exchange.cpp:68
msgid "Freeroute Help"
msgstr ""
#: pcbnew/dialog_edit_module_for_Modedit.cpp:83
msgid "Use this attribute for most non smd components"
......@@ -3925,10 +3885,6 @@ msgstr "Test module"
msgid "Add Pads"
msgstr "Addition de \"pins\""
#: pcbnew/tool_modedit.cpp:203
msgid "Display Grid OFF"
msgstr "Suppression de l'affichage de la grille"
#: pcbnew/tool_modedit.cpp:208
msgid "Display Polar Coord ON"
msgstr "Activer affichage coord Polaires"
......@@ -4890,7 +4846,7 @@ msgstr "Effacer Marqueur"
#: pcbnew/onrightclick.cpp:792
msgid "Marker Error Info"
msgstr "Info de Marqueurd'Erreur"
msgstr "Info du Marqueur d'Erreur"
#: pcbnew/onrightclick.cpp:812
msgid "Auto Width"
......@@ -4911,7 +4867,7 @@ msgstr "Utiliser les dimensions de pistes et vias de leur valeurs en Netclasse"
#: pcbnew/onrightclick.cpp:832
#, c-format
msgid "Track %s"
msgstr "Piste %s:"
msgstr "Piste %s"
#: pcbnew/onrightclick.cpp:834
#: pcbnew/onrightclick.cpp:862
......@@ -7401,6 +7357,10 @@ msgstr "Offset de tracé X"
msgid "Plot Offset Y"
msgstr "Offset de tracé Y"
#: eeschema/plothpgl.cpp:372
msgid "&Close"
msgstr "&Fermer"
#: eeschema/plothpgl.cpp:381
msgid "&Accept Offset"
msgstr "&Accepter Offset"
......@@ -10444,6 +10404,7 @@ msgid "File <"
msgstr "Fichier <"
#: cvpcb/readschematicnetlist.cpp:115
#: kicad/prjconfig.cpp:93
msgid "> not found"
msgstr "> non trouvé"
......@@ -11009,25 +10970,24 @@ msgstr "Polygones:"
msgid "Show D codes"
msgstr "Montrer DCodes"
#: gerbview/readgerb.cpp:138
#: gerbview/dcode.cpp:299
#: gerbview/readgerb.cpp:137
msgid "File "
msgstr "Fichier "
#: gerbview/readgerb.cpp:246
#: gerbview/readgerb.cpp:245
#, c-format
msgid "%d errors while reading Gerber file [%s]"
msgstr "%d erreurs pendant lecture fichier gerber [%s]"
#: gerbview/readgerb.cpp:268
#: gerbview/files.cpp:197
#: gerbview/files.cpp:231
#: gerbview/readgerb.cpp:267
#: gerbview/files.cpp:183
#: gerbview/files.cpp:216
#, c-format
msgid "Gerber DCODE files (%s)|*.%s"
msgstr "Fichiers Gerber DCODE (%s)|*.%s"
#: gerbview/readgerb.cpp:273
#: gerbview/files.cpp:203
#: gerbview/readgerb.cpp:272
#: gerbview/files.cpp:189
msgid "Load GERBER DCODE File"
msgstr "Charger Fichier de DCodes"
......@@ -11056,67 +11016,67 @@ msgstr "Effacer textes pcb"
msgid "Delete layer %d?"
msgstr "Effacer couche %d"
#: gerbview/files.cpp:81
#: gerbview/files.cpp:72
msgid "Not yet available..."
msgstr "non encore disponible"
#: gerbview/files.cpp:127
#: gerbview/files.cpp:114
msgid "Gerber files (.gbr .gbx .lgr .ger .pho)| .gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|"
msgstr "Fichiers Gerber (.gbr .gbx .lgr .ger .pho)| *.gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|"
#: gerbview/files.cpp:131
#: gerbview/files.cpp:118
msgid "Top layer (*.GTL)|*.GTL;*.gtl|"
msgstr "Couche composant"
#: gerbview/files.cpp:132
#: gerbview/files.cpp:119
msgid "Bottom layer (*.GBL)|*.GBL;*.gbl|"
msgstr "Couche cuivre"
#: gerbview/files.cpp:133
#: gerbview/files.cpp:120
msgid "Bottom solder resist (*.GBS)|*.GBS;*.gbs|"
msgstr "Masque soudure cuivre (*.GBS)|*.GBS;*.gbs|"
#: gerbview/files.cpp:134
#: gerbview/files.cpp:121
msgid "Top solder resist (*.GTS)|*.GTS;*.gts|"
msgstr "Masque soudure composant (*.GTS)|*.GTS;*.gts|"
#: gerbview/files.cpp:135
#: gerbview/files.cpp:122
msgid "Bottom overlay (*.GBO)|*.GBO;*.gbo|"
msgstr ""
#: gerbview/files.cpp:136
#: gerbview/files.cpp:123
msgid "Top overlay (*.GTO)|*.GTO;*.gto|"
msgstr ""
#: gerbview/files.cpp:137
#: gerbview/files.cpp:124
msgid "Bottom paste (*.GBP)|*.GBP;*.gbp|"
msgstr "Bottom paste (*.GBP)|*.GBP;*.gbp|"
#: gerbview/files.cpp:138
#: gerbview/files.cpp:125
msgid "Top paste (*.GTP)|*.GTP;*.gtp|"
msgstr "Masque pate à souder composant (*.GTP)|*.GTP;*.gtp|"
#: gerbview/files.cpp:139
#: gerbview/files.cpp:126
msgid "Keep-out layer (*.GKO)|*.GKO;*.gko|"
msgstr ""
#: gerbview/files.cpp:140
#: gerbview/files.cpp:127
msgid "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
msgstr "Couches mécaniques (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
#: gerbview/files.cpp:141
#: gerbview/files.cpp:128
msgid "Top Pad Master (*.GPT)|*.GPT;*.gpt|"
msgstr ""
#: gerbview/files.cpp:142
#: gerbview/files.cpp:129
msgid "Bottom Pad Master (*.GPB)|*.GPB;*.gpb|"
msgstr ""
#: gerbview/files.cpp:152
#: gerbview/files.cpp:139
msgid "Open Gerber File"
msgstr "Ouvrir Fichier Gerber"
#: gerbview/files.cpp:235
#: gerbview/files.cpp:220
msgid "Save Gerber File"
msgstr "Sauver Fichier Gerber"
......@@ -12158,10 +12118,6 @@ msgstr "Options de Nettoyage"
msgid "TextMod properties"
msgstr "Propriétés du Texte sur Module"
#: pcbnew/dialog_freeroute_exchange.h:46
msgid "dialog_freeroute_exchange"
msgstr "dialog_freeroute_exchange"
#: pcbnew/dialog_initpcb.h:38
msgid "Global Delete"
msgstr "Effacements Globaux"
......@@ -12567,6 +12523,35 @@ msgstr "DCodes id."
msgid "Page Settings"
msgstr "Ajustage opt Page"
#~ msgid "Export a Specctra Design (*.dsn) File"
#~ msgstr "Exporter un fichier de conception Specctra (*.dsn)"
#~ msgid "Export a Specctra DSN file (to FreeRouter)"
#~ msgstr "Exporter un fichier Specctra DSN (pour FreeRoute)"
#~ msgid "Launch FreeRouter via Java Web Start"
#~ msgstr "Lancer FreeRouter via Java Web Start"
#~ msgid ""
#~ "Use Java Web Start function to run FreeRouter via Internet (or your "
#~ "Browser if not found)"
#~ msgstr ""
#~ "Utiliser Java Web Start function pour lancer FreeRouter via Internet (ou "
#~ "votre Navigateur si non trouvé)"
#~ msgid "Back Import the Specctra Session (*.ses) File"
#~ msgstr "Importer un Fichier Specctra Session (*.ses)"
#~ msgid "Merge a session file created by FreeRouter with the current board."
#~ msgstr ""
#~ "Importer un fichier session créé par FreeRouter dans le C.I. courant."
#~ msgid "Visit FreeRouting.net website"
#~ msgstr "Visiter le site FreeRouting.net"
#~ msgid "Launch your browser and go to the FreeRouting.net website"
#~ msgstr "Lancer votre navigateur pour aller sur FreeRouting.net"
#~ msgid "FreeRouting.net URL"
#~ msgstr "URL FreeRouting.net"
#~ msgid "The URL of the FreeRouting.net website"
#~ msgstr "L' URL du site FreeRouting.net"
#~ msgid "Display Grid OFF"
#~ msgstr "Suppression de l'affichage de la grille"
#~ msgid "dialog_freeroute_exchange"
#~ msgstr "dialog_freeroute_exchange"
#~ msgid "Drc OFF"
#~ msgstr "Drc DESACTIVEE"
#~ msgid "Show General Ratsnest"
......
......@@ -164,19 +164,28 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
case TYPE_TRACK:
case TYPE_VIA:
EXCHG( ( (TRACK*) aItem )->m_Start, ( (TRACK*) aImage )->m_Start );
EXCHG( ( (TRACK*) aItem )->m_End, ( (TRACK*) aImage )->m_End );
EXCHG( ( (TRACK*) aItem )->m_Width, ( (TRACK*) aImage )->m_Width );
EXCHG( ( (TRACK*) aItem )->m_Shape, ( (TRACK*) aImage )->m_Shape );
{
int itmp = ((TRACK*) aItem )->GetDrillValue();
if( ((TRACK*) aItem )->IsDrillDefault() )
itmp = -1;
int atmp = ((TRACK*) aImage )->GetDrillValue();
if( ((TRACK*) aImage )->IsDrillDefault() )
TRACK* track = (TRACK*) aItem;
TRACK* image = (TRACK*) aImage;
EXCHG( track->m_Start, image->m_Start );
EXCHG( track->m_End, image->m_End );
EXCHG( track->m_Width, image->m_Width );
EXCHG( track->m_Shape, image->m_Shape );
int atmp = track->GetDrillValue();
if( track->IsDrillDefault() )
atmp = -1;
( (TRACK*) aItem )->SetDrillValue( atmp );
( (TRACK*) aImage )->SetDrillValue(itmp);
int itmp = image->GetDrillValue();
if( image->IsDrillDefault() )
itmp = -1;
EXCHG(itmp, atmp );
if( atmp > 0 )
track->SetDrillValue( atmp );
else
track->SetDrillDefault();
if( itmp > 0 )
image->SetDrillValue( itmp );
else
image->SetDrillDefault();
}
break;
......
......@@ -181,7 +181,7 @@ public:
* Function IsDrillDefault
* @return true if the drill value is default value (-1)
*/
bool IsDrillDefault(void) { return m_Drill < 0; }
bool IsDrillDefault(void) { return m_Drill <= 0; }
/**
* Function GetDrillValue
......
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