Formatting and commenting.
This commit is contained in:
parent
6f2b2d7e19
commit
b52106aa37
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -37,8 +37,6 @@ bool EDA_UNIT_UTILS::IsImperialUnit( EDA_UNITS aUnit )
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +50,6 @@ bool EDA_UNIT_UTILS::IsMetricUnit( EDA_UNITS aUnit )
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -436,7 +432,9 @@ double EDA_UNIT_UTILS::UI::DoubleValueFromString( const wxString& aTextValue )
|
||||||
|
|
||||||
if( !( ( ch >= '0' && ch <= '9' ) || ( ch == decimal_point ) || ( ch == '-' )
|
if( !( ( ch >= '0' && ch <= '9' ) || ( ch == decimal_point ) || ( ch == '-' )
|
||||||
|| ( ch == '+' ) ) )
|
|| ( ch == '+' ) ) )
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
++brk_point;
|
++brk_point;
|
||||||
}
|
}
|
||||||
|
@ -482,7 +480,8 @@ double EDA_UNIT_UTILS::UI::DoubleValueFromString( const EDA_IU_SCALE& aIuScale,
|
||||||
// Check the optional unit designator (2 ch significant)
|
// Check the optional unit designator (2 ch significant)
|
||||||
wxString unit( buf.Mid( brk_point ).Strip( wxString::leading ).Left( 2 ).Lower() );
|
wxString unit( buf.Mid( brk_point ).Strip( wxString::leading ).Left( 2 ).Lower() );
|
||||||
|
|
||||||
if( aUnits == EDA_UNITS::MILLIMETRES || aUnits == EDA_UNITS::MILS
|
if( aUnits == EDA_UNITS::MILLIMETRES
|
||||||
|
|| aUnits == EDA_UNITS::MILS
|
||||||
|| aUnits == EDA_UNITS::INCHES )
|
|| aUnits == EDA_UNITS::INCHES )
|
||||||
{
|
{
|
||||||
if( unit == wxT( "mm" ) )
|
if( unit == wxT( "mm" ) )
|
||||||
|
|
|
@ -195,6 +195,7 @@ namespace EDA_UNIT_UTILS
|
||||||
* converts \a aTextValue to a double
|
* converts \a aTextValue to a double
|
||||||
* @warning This utilizes the current locale and will break if decimal formats differ
|
* @warning This utilizes the current locale and will break if decimal formats differ
|
||||||
*
|
*
|
||||||
|
* @param aIuScale The internal units scale for the current frame/app.
|
||||||
* @param aUnits The units of \a aTextValue.
|
* @param aUnits The units of \a aTextValue.
|
||||||
* @param aTextValue A reference to a wxString object containing the string to convert.
|
* @param aTextValue A reference to a wxString object containing the string to convert.
|
||||||
* @return A double representing that value in internal units
|
* @return A double representing that value in internal units
|
||||||
|
@ -210,9 +211,10 @@ namespace EDA_UNIT_UTILS
|
||||||
* converts \a aTextValue in \a aUnits to internal units used by the application.
|
* converts \a aTextValue in \a aUnits to internal units used by the application.
|
||||||
* @warning This utilizes the current locale and will break if decimal formats differ
|
* @warning This utilizes the current locale and will break if decimal formats differ
|
||||||
*
|
*
|
||||||
|
* @param aIuScale The internal units scale for the current frame/app.
|
||||||
* @param aUnits The units of \a aTextValue.
|
* @param aUnits The units of \a aTextValue.
|
||||||
* @param aTextValue A reference to a wxString object containing the string to convert.
|
* @param aTextValue A reference to a wxString object containing the string to convert.
|
||||||
* @return The string from Value, according to units (inch, mm ...) for display,
|
* @return A long long int representing that value in internal units
|
||||||
*/
|
*/
|
||||||
long long int ValueFromString( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
|
long long int ValueFromString( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
|
||||||
const wxString& aTextValue,
|
const wxString& aTextValue,
|
||||||
|
|
Loading…
Reference in New Issue