Commit 5a5b9098 authored by Andrey Fedorushkov's avatar Andrey Fedorushkov

all: new Russian GOST patch - author Konstantin Baranovskiy

pcbnew: fix print format in THROW_IO_ERROR
        fix properties file export_vrml.cpp
parent e90fc3a9
This diff is collapsed.
...@@ -609,12 +609,20 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -609,12 +609,20 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() ); wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() );
wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() ); wxPoint pointRightBottom( pageDUMMY.GetRightMarginMils(), pageDUMMY.GetBottomMarginMils() );
// Get page type
int idx = m_paperSizeComboBox->GetSelection();
if( idx < 0 )
idx = 0;
wxString paperType = m_pageFmt[idx].Left( m_pageFmt[idx].Index( wxT( " " ) ) );
// Draw layout preview. // Draw layout preview.
wxString emptyString; wxString emptyString;
GRResetPenAndBrush( ( wxDC* ) &memDC ); GRResetPenAndBrush( ( wxDC* ) &memDC );
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom, m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom,
emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreens, paperType, emptyString, m_tb, m_Screen->m_NumberOfScreens,
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED ); m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED );
memDC.SelectObject( wxNullBitmap ); memDC.SelectObject( wxNullBitmap );
......
...@@ -122,6 +122,10 @@ int NegableTextLength( const wxString& aText ) ...@@ -122,6 +122,10 @@ int NegableTextLength( const wxString& aText )
{ {
if( aText[i] == '~' ) if( aText[i] == '~' )
{ {
/* '~~' draw as '~' and count as two chars */
if( i > 0 && aText[i - 1] == '~' )
i--;
else
char_count--; char_count--;
} }
} }
...@@ -160,8 +164,12 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool aItalic, boo ...@@ -160,8 +164,12 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool aItalic, boo
{ {
int AsciiCode = aText[i]; int AsciiCode = aText[i];
if( AsciiCode == '~' ) /* Skip the negation marks */ /* Skip the negation marks
* and first '~' char of '~~'
* ('~~' draw as '~') */
if( AsciiCode == '~' )
{ {
if( i > 0 && aText[i - 1] != '~' )
continue; continue;
} }
...@@ -406,11 +414,17 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -406,11 +414,17 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
overbar_italic_comp = 0; overbar_italic_comp = 0;
}; };
int overbars = 0; // Number of ~ seen int overbars = 0; /* Number of '~' seen (except '~~') */
ptr = 0; /* ptr = text index */ ptr = 0; /* ptr = text index */
while( ptr < char_count ) while( ptr < char_count )
{ {
if( aText[ptr + overbars] == '~' ) if( aText[ptr + overbars] == '~' )
{
if( ptr + overbars + 1 < aText.length() &&
aText[ptr + overbars + 1] == '~' ) /* '~~' draw as '~' */
ptr++; // skip first '~' char and draw second
else
{ {
/* Found an overbar, adjust the pointers */ /* Found an overbar, adjust the pointers */
overbars++; overbars++;
...@@ -438,6 +452,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel, ...@@ -438,6 +452,7 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
} }
continue; /* Skip ~ processing */ continue; /* Skip ~ processing */
} }
}
AsciiCode = aText.GetChar( ptr + overbars ); AsciiCode = aText.GetChar( ptr + overbars );
......
...@@ -123,7 +123,7 @@ const char* const newstroke_font[] = ...@@ -123,7 +123,7 @@ const char* const newstroke_font[] =
"KYVcUcSbR`RVQTOSQRRPRFSDUCVC", "KYVcUcSbR`RVQTOSQRRPRFSDUCVC",
"H\\RbRD", "H\\RbRD",
"KYNcOcQbR`RVSTUSSRRPRFQDOCNC", "KYNcOcQbR`RVSTUSSRRPRFQDOCNC",
"KZMHNGPFTHVGWF", "KZMSNRPQTSVRWQ",
"F^K[KFYFY[K[", "F^K[KFYFY[K[",
/* // LATIN-1 SUPPLEMENT (0080-00FF) */ /* // LATIN-1 SUPPLEMENT (0080-00FF) */
"F^K[KFYFY[K[", /* U+80 */ "F^K[KFYFY[K[", /* U+80 */
......
This diff is collapsed.
...@@ -155,7 +155,11 @@ static bool engStrToDouble( wxString aStr, double* aDouble ) ...@@ -155,7 +155,11 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
aStr.Append( wxT( "R" ) ); aStr.Append( wxT( "R" ) );
// Regular expression for a value string, e.g., 47k2 // Regular expression for a value string, e.g., 47k2
#if defined(KICAD_GOST)
static wxRegEx valueRegEx( wxT( "^([0-9]+)(мк|[pnumRkKMGT.,кнМГ])([0-9]*)(мк*|[pnumRkKMGTкнМГ]*)" ) );
#else
static wxRegEx valueRegEx( wxT( "^([0-9]+)([pnumRkKMGT.,])([0-9]*)([pnumRkKMGT]*)" ) ); static wxRegEx valueRegEx( wxT( "^([0-9]+)([pnumRkKMGT.,])([0-9]*)([pnumRkKMGT]*)" ) );
#endif
if( !valueRegEx.Matches( aStr ) ) if( !valueRegEx.Matches( aStr ) )
return false; return false;
...@@ -164,7 +168,31 @@ static bool engStrToDouble( wxString aStr, double* aDouble ) ...@@ -164,7 +168,31 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
+ wxT( "." ) + wxT( "." )
+ valueRegEx.GetMatch( aStr, 3 ) ); + valueRegEx.GetMatch( aStr, 3 ) );
wxString multiplierString = valueRegEx.GetMatch( aStr, 2 ); wxString multiplierString = valueRegEx.GetMatch( aStr, 2 );
#if defined(KICAD_GOST)
if ( multiplierString == wxT( "мк" ) )
multiplierString = wxT( "u" );
else if ( multiplierString == wxT( "к" ) )
multiplierString = wxT( "k" );
else if ( multiplierString == wxT( "н" ) )
multiplierString = wxT( "n" );
else if ( multiplierString == wxT( "М" ) )
multiplierString = wxT( "M" );
else if ( multiplierString == wxT( "Г" ) )
multiplierString = wxT( "G" );
#endif
wxString post_multiplierString = valueRegEx.GetMatch( aStr, 4 ); wxString post_multiplierString = valueRegEx.GetMatch( aStr, 4 );
#if defined(KICAD_GOST)
if ( post_multiplierString == wxT( "мк" ) )
multiplierString = wxT( "u" );
else if ( post_multiplierString == wxT( "к" ) )
multiplierString = wxT( "k" );
else if ( post_multiplierString == wxT( "н" ) )
multiplierString = wxT( "n" );
else if ( post_multiplierString == wxT( "М" ) )
multiplierString = wxT( "M" );
else if ( post_multiplierString == wxT( "Г" ) )
multiplierString = wxT( "G" );
#endif
double multiplier; double multiplier;
switch( (wxChar)multiplierString[0] ) switch( (wxChar)multiplierString[0] )
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#define PIN_LENGTH 300 /* Default Length of each pin to be drawn. */ #define PIN_LENGTH 300 /* Default Length of each pin to be drawn. */
#if defined(KICAD_GOST) #if defined(KICAD_GOST)
#define INVERT_PIN_RADIUS 20 /* Radius of inverted pin circle. */ #define INVERT_PIN_RADIUS 30 /* Radius of inverted pin circle. */
#else #else
#define INVERT_PIN_RADIUS 35 /* Radius of inverted pin circle. */ #define INVERT_PIN_RADIUS 35 /* Radius of inverted pin circle. */
#endif #endif
......
...@@ -469,7 +469,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList() ...@@ -469,7 +469,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList()
for( int i = 0; i < m_component->GetPartCount(); i++ ) for( int i = 0; i < m_component->GetPartCount(); i++ )
{ {
wxString msg; wxString msg;
#if defined(KICAD_GOST)
msg.Printf( _( "Part %d" ), i + 1 );
#else
msg.Printf( _( "Part %c" ), 'A' + i ); msg.Printf( _( "Part %c" ), 'A' + i );
#endif
m_partSelectBox->Append( msg ); m_partSelectBox->Append( msg );
} }
} }
......
...@@ -44,7 +44,11 @@ ...@@ -44,7 +44,11 @@
SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) : SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) :
SCH_ITEM( NULL, SCH_JUNCTION_T ) SCH_ITEM( NULL, SCH_JUNCTION_T )
{ {
#if defined(KICAD_GOST)
#define DRAWJUNCTION_DIAMETER 50 /* Diameter of junction symbol between wires by GOST*/
#else
#define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between wires */ #define DRAWJUNCTION_DIAMETER 32 /* Diameter of junction symbol between wires */
#endif
m_pos = pos; m_pos = pos;
m_Layer = LAYER_JUNCTION; m_Layer = LAYER_JUNCTION;
m_size.x = m_size.y = DRAWJUNCTION_DIAMETER; m_size.x = m_size.y = DRAWJUNCTION_DIAMETER;
......
This diff is collapsed.
File mode changed from 100755 to 100644
...@@ -924,7 +924,7 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* ...@@ -924,7 +924,7 @@ bool GPCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES*
if( tmp.GetExt() != KiCadFootprintFileExtension ) if( tmp.GetExt() != KiCadFootprintFileExtension )
{ {
THROW_IO_ERROR( wxString::Format( _( "unexpected file '%s' has found in library path '%'" ), THROW_IO_ERROR( wxString::Format( _( "unexpected file '%s' has found in library path '%s'" ),
files[i].GetData(), aLibraryPath.GetData() ) ); files[i].GetData(), aLibraryPath.GetData() ) );
} }
} }
......
...@@ -1770,7 +1770,7 @@ bool PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProp ...@@ -1770,7 +1770,7 @@ bool PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProp
if( tmp.GetExt() != KiCadFootprintFileExtension ) if( tmp.GetExt() != KiCadFootprintFileExtension )
{ {
THROW_IO_ERROR( wxString::Format( _( "unexpected file '%s' has found in library path '%'" ), THROW_IO_ERROR( wxString::Format( _( "unexpected file '%s' has found in library path '%s'" ),
files[i].GetData(), aLibraryPath.GetData() ) ); files[i].GetData(), aLibraryPath.GetData() ) );
} }
} }
......
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