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()
wxPoint pointLeftTop( pageDUMMY.GetLeftMarginMils(), pageDUMMY.GetTopMarginMils() );
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.
wxString emptyString;
GRResetPenAndBrush( ( wxDC* ) &memDC );
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 );
memDC.SelectObject( wxNullBitmap );
......
......@@ -122,7 +122,11 @@ int NegableTextLength( const wxString& aText )
{
if( aText[i] == '~' )
{
char_count--;
/* '~~' draw as '~' and count as two chars */
if( i > 0 && aText[i - 1] == '~' )
i--;
else
char_count--;
}
}
......@@ -160,9 +164,13 @@ int ReturnGraphicTextWidth( const wxString& aText, int aXSize, bool aItalic, boo
{
int AsciiCode = aText[i];
if( AsciiCode == '~' ) /* Skip the negation marks */
/* Skip the negation marks
* and first '~' char of '~~'
* ('~~' draw as '~') */
if( AsciiCode == '~' )
{
continue;
if( i > 0 && aText[i - 1] != '~' )
continue;
}
const char* ptcar = GetHersheyShapeDescription( AsciiCode );
......@@ -406,37 +414,44 @@ void DrawGraphicText( EDA_DRAW_PANEL* aPanel,
overbar_italic_comp = 0;
};
int overbars = 0; // Number of ~ seen
int overbars = 0; /* Number of '~' seen (except '~~') */
ptr = 0; /* ptr = text index */
while( ptr < char_count )
{
if( aText[ptr + overbars] == '~' )
{
/* Found an overbar, adjust the pointers */
overbars++;
if( ptr + overbars + 1 < aText.length() &&
aText[ptr + overbars + 1] == '~' ) /* '~~' draw as '~' */
ptr++; // skip first '~' char and draw second
if( overbars & 1 ) // odd overbars count
{
/* Starting the overbar */
overbar_pos = current_char_pos;
overbar_pos.x += overbar_italic_comp;
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
RotatePoint( &overbar_pos, aPos, aOrient );
}
else
{
/* Ending the overbar */
coord[0] = overbar_pos;
overbar_pos = current_char_pos;
overbar_pos.x += overbar_italic_comp;
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
RotatePoint( &overbar_pos, aPos, aOrient );
coord[1] = overbar_pos;
/* Plot the overbar segment */
DrawGraphicTextPline( clipBox, aDC, aColor, aWidth,
sketch_mode, 2, coord, aCallback, aPlotter );
/* Found an overbar, adjust the pointers */
overbars++;
if( overbars & 1 ) // odd overbars count
{
/* Starting the overbar */
overbar_pos = current_char_pos;
overbar_pos.x += overbar_italic_comp;
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
RotatePoint( &overbar_pos, aPos, aOrient );
}
else
{
/* Ending the overbar */
coord[0] = overbar_pos;
overbar_pos = current_char_pos;
overbar_pos.x += overbar_italic_comp;
overbar_pos.y -= OverbarPositionY( size_v, aWidth );
RotatePoint( &overbar_pos, aPos, aOrient );
coord[1] = overbar_pos;
/* Plot the overbar segment */
DrawGraphicTextPline( clipBox, aDC, aColor, aWidth,
sketch_mode, 2, coord, aCallback, aPlotter );
}
continue; /* Skip ~ processing */
}
continue; /* Skip ~ processing */
}
AsciiCode = aText.GetChar( ptr + overbars );
......
......@@ -123,7 +123,7 @@ const char* const newstroke_font[] =
"KYVcUcSbR`RVQTOSQRRPRFSDUCVC",
"H\\RbRD",
"KYNcOcQbR`RVSTUSSRRPRFQDOCNC",
"KZMHNGPFTHVGWF",
"KZMSNRPQTSVRWQ",
"F^K[KFYFY[K[",
/* // LATIN-1 SUPPLEMENT (0080-00FF) */
"F^K[KFYFY[K[", /* U+80 */
......
This diff is collapsed.
......@@ -155,7 +155,11 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
aStr.Append( wxT( "R" ) );
// 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]*)" ) );
#endif
if( !valueRegEx.Matches( aStr ) )
return false;
......@@ -164,7 +168,31 @@ static bool engStrToDouble( wxString aStr, double* aDouble )
+ wxT( "." )
+ valueRegEx.GetMatch( aStr, 3 ) );
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 );
#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;
switch( (wxChar)multiplierString[0] )
......
......@@ -36,7 +36,7 @@
#define PIN_LENGTH 300 /* Default Length of each pin to be drawn. */
#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
#define INVERT_PIN_RADIUS 35 /* Radius of inverted pin circle. */
#endif
......
......@@ -469,7 +469,11 @@ void LIB_EDIT_FRAME::UpdatePartSelectList()
for( int i = 0; i < m_component->GetPartCount(); i++ )
{
wxString msg;
#if defined(KICAD_GOST)
msg.Printf( _( "Part %d" ), i + 1 );
#else
msg.Printf( _( "Part %c" ), 'A' + i );
#endif
m_partSelectBox->Append( msg );
}
}
......
......@@ -44,7 +44,11 @@
SCH_JUNCTION::SCH_JUNCTION( const wxPoint& pos ) :
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 */
#endif
m_pos = pos;
m_Layer = LAYER_JUNCTION;
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*
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() ) );
}
}
......
......@@ -1770,7 +1770,7 @@ bool PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, PROPERTIES* aProp
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() ) );
}
}
......
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