KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
eda_units.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <eda_units.h>
25#include <fmt/core.h>
26#include <math/util.h> // for KiROUND
27#include <macros.h>
28#include <charconv>
29#include <wx/translation.h>
30
31
32static void removeTrailingZeros( wxString& aText )
33{
34 int len = aText.length();
35 int removeLast = 0;
36
37 while( --len > 0 && aText[len] == '0' )
38 removeLast++;
39
40 if( len >= 0 && ( aText[len] == '.' || aText[len] == ',' ) )
41 removeLast++;
42
43 aText = aText.RemoveLast( removeLast );
44}
45
46
48{
49 switch( aUnit )
50 {
51 case EDA_UNITS::INCH:
52 case EDA_UNITS::MILS:
53 return true;
54
55 default:
56 return false;
57 }
58}
59
60
62{
63 switch( aUnit )
64 {
65 case EDA_UNITS::UM:
66 case EDA_UNITS::MM:
67 case EDA_UNITS::CM:
68 return true;
69
70 default:
71 return false;
72 }
73}
74
75
76int EDA_UNIT_UTILS::Mm2mils( double aVal )
77{
78 return KiROUND( aVal * 1000. / 25.4 );
79}
80
81
82int EDA_UNIT_UTILS::Mils2mm( double aVal )
83{
84 return KiROUND( aVal * 25.4 / 1000. );
85}
86
87
88bool EDA_UNIT_UTILS::FetchUnitsFromString( const wxString& aTextValue, EDA_UNITS& aUnits )
89{
90 wxString buf( aTextValue.Strip( wxString::both ) );
91 unsigned brk_point = 0;
92
93 while( brk_point < buf.Len() )
94 {
95 wxChar c = buf[brk_point];
96
97 if( !( ( c >= '0' && c <= '9' ) || ( c == '.' ) || ( c == ',' ) || ( c == '-' )
98 || ( c == '+' ) ) )
99 break;
100
101 ++brk_point;
102 }
103
104 // Check the unit designator (2 ch significant)
105 wxString unit( buf.Mid( brk_point ).Strip( wxString::leading ).Left( 2 ).Lower() );
106
107 //check for um, μm (µ is MICRO SIGN) and µm (µ is GREEK SMALL LETTER MU) for micrometre
108 if( unit == wxT( "um" ) || unit == wxT( "\u00B5m" ) || unit == wxT( "\u03BCm" ) )
109 aUnits = EDA_UNITS::UM;
110 else if( unit == wxT( "mm" ) )
111 aUnits = EDA_UNITS::MM;
112 if( unit == wxT( "cm" ) )
113 aUnits = EDA_UNITS::CM;
114 else if( unit == wxT( "mi" ) || unit == wxT( "th" ) ) // "mils" or "thou"
115 aUnits = EDA_UNITS::MILS;
116 else if( unit == wxT( "in" ) || unit == wxT( "\"" ) )
117 aUnits = EDA_UNITS::INCH;
118 else if( unit == wxT( "de" ) || unit == wxT( "ra" ) ) // "deg" or "rad"
119 aUnits = EDA_UNITS::DEGREES;
120 else
121 return false;
122
123 return true;
124}
125
126
128{
129 wxString label;
130
131 switch( aUnits )
132 {
133 case EDA_UNITS::UM: label = wxT( " \u00B5m" ); break; //00B5 for µ
134 case EDA_UNITS::MM: label = wxT( " mm" ); break;
135 case EDA_UNITS::CM: label = wxT( " cm" ); break;
136 case EDA_UNITS::DEGREES: label = wxT( "°" ); break;
137 case EDA_UNITS::MILS: label = wxT( " mils" ); break;
138 case EDA_UNITS::INCH: label = wxT( " in" ); break;
139 case EDA_UNITS::PERCENT: label = wxT( "%" ); break;
140 case EDA_UNITS::UNSCALED: break;
141 default: UNIMPLEMENTED_FOR( wxS( "Unknown units" ) ); break;
142 }
143
144 switch( aType )
145 {
146 case EDA_DATA_TYPE::VOLUME: label += wxT( "³" ); break;
147 case EDA_DATA_TYPE::AREA: label += wxT( "²" ); break;
148 case EDA_DATA_TYPE::DISTANCE: break;
149 default: UNIMPLEMENTED_FOR( wxS( "Unknown measurement" ) ); break;
150 }
151
152 return label;
153}
154
155
157{
158 return GetText( aUnits, aType ).Trim( false );
159}
160
161
162std::string EDA_UNIT_UTILS::FormatAngle( const EDA_ANGLE& aAngle )
163{
164 std::string temp = fmt::format( "{:.10g}", aAngle.AsDegrees() );
165
166 return temp;
167}
168
169
170std::string EDA_UNIT_UTILS::FormatInternalUnits( const EDA_IU_SCALE& aIuScale, int aValue )
171{
172 std::string buf;
173 double engUnits = aValue;
174
175 engUnits /= aIuScale.IU_PER_MM;
176
177 if( engUnits != 0.0 && fabs( engUnits ) <= 0.0001 )
178 {
179 buf = fmt::format( "{:.10f}", engUnits );
180
181 // remove trailing zeros
182 while( !buf.empty() && buf[buf.size() - 1] == '0' )
183 {
184 buf.pop_back();
185 }
186
187 // if the value was really small
188 // we may have just stripped all the zeros after the decimal
189 if( buf[buf.size() - 1] == '.' )
190 {
191 buf.pop_back();
192 }
193 }
194 else
195 {
196 buf = fmt::format( "{:.10g}", engUnits );
197 }
198
199 return buf;
200}
201
202
204 const VECTOR2I& aPoint )
205{
206 return FormatInternalUnits( aIuScale, aPoint.x ) + " "
207 + FormatInternalUnits( aIuScale, aPoint.y );
208}
209
210
211#if 0 // No support for std::from_chars on MacOS yet
212
213bool EDA_UNIT_UTILS::ParseInternalUnits( const std::string& aInput, const EDA_IU_SCALE& aIuScale,
214 int& aOut )
215{
216 double value;
217
218 if( std::from_chars( aInput.data(), aInput.data() + aInput.size(), value ).ec != std::errc() )
219 return false;
220
221 aOut = value * aIuScale.IU_PER_MM;
222 return true;
223}
224
225
226bool EDA_UNIT_UTILS::ParseInternalUnits( const std::string& aInput, const EDA_IU_SCALE& aIuScale,
227 VECTOR2I& aOut )
228{
229 size_t pos = aInput.find( ' ' );
230
231 if( pos == std::string::npos )
232 return false;
233
234 std::string first = aInput.substr( 0, pos );
235 std::string second = aInput.substr( pos + 1 );
236
237 VECTOR2I vec;
238
239 if( !ParseInternalUnits( first, aIuScale, vec.x ) )
240 return false;
241
242 if( !ParseInternalUnits( second, aIuScale, vec.y ) )
243 return false;
244
245 aOut = vec;
246
247 return true;
248}
249
250#endif
251
252
253#define IU_TO_MM( x, scale ) ( x / scale.IU_PER_MM )
254#define IU_TO_IN( x, scale ) ( x / scale.IU_PER_MILS / 1000 )
255#define IU_TO_MILS( x, scale ) ( x / scale.IU_PER_MILS )
256#define MM_TO_IU( x, scale ) ( x * scale.IU_PER_MM )
257#define IN_TO_IU( x, scale ) ( x * scale.IU_PER_MILS * 1000 )
258#define MILS_TO_IU( x, scale ) ( x * scale.IU_PER_MILS )
259
260
262 double aValue )
263{
264 switch( aUnit )
265 {
266 case EDA_UNITS::UM: return IU_TO_MM( aValue, aIuScale ) * 1000;
267 case EDA_UNITS::MM: return IU_TO_MM( aValue, aIuScale );
268 case EDA_UNITS::CM: return IU_TO_MM( aValue, aIuScale ) / 10;
269 case EDA_UNITS::MILS: return IU_TO_MILS( aValue, aIuScale );
270 case EDA_UNITS::INCH: return IU_TO_IN( aValue, aIuScale );
271 case EDA_UNITS::DEGREES: return aValue;
272 default: return aValue;
273 }
274}
275
276
278 double aValue, bool aAddUnitsText,
279 EDA_DATA_TYPE aType )
280{
281 double value_to_print = aValue;
282 bool is_eeschema = ( aIuScale.IU_PER_MM == SCH_IU_PER_MM );
283
284 switch( aType )
285 {
287 value_to_print = ToUserUnit( aIuScale, aUnits, value_to_print );
289
291 value_to_print = ToUserUnit( aIuScale, aUnits, value_to_print );
293
295 value_to_print = ToUserUnit( aIuScale, aUnits, value_to_print );
296 break;
297
299 break;
300 }
301
302 const wxChar* format = nullptr;
303
304 switch( aUnits )
305 {
306
307 case EDA_UNITS::MILS: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.5f" ); break;
308 case EDA_UNITS::INCH: format = is_eeschema ? wxT( "%.6f" ) : wxT( "%.8f" ); break;
309 case EDA_UNITS::DEGREES: format = wxT( "%.4f" ); break;
310 default: format = wxT( "%.10f" ); break;
311 }
312
313 wxString text;
314 text.Printf( format, value_to_print );
316
317 if( value_to_print != 0.0 && ( text == wxS( "0" ) || text == wxS( "-0" ) ) )
318 {
319 text.Printf( wxS( "%.10f" ), value_to_print );
321 }
322
323 if( aAddUnitsText )
324 text << EDA_UNIT_UTILS::GetText( aUnits, aType );
325
326 return text;
327}
328
329
330
331// A lower-precision (for readability) version of StringFromValue()
333 int aValue,
334 bool aAddUnitLabel,
335 EDA_DATA_TYPE aType )
336{
337 return MessageTextFromValue( aIuScale, aUnits, double( aValue ), aAddUnitLabel, aType );
338}
339
340
341// A lower-precision (for readability) version of StringFromValue()
343 long long int aValue,
344 bool aAddUnitLabel,
345 EDA_DATA_TYPE aType )
346{
347 return MessageTextFromValue( aIuScale, aUnits, double( aValue ), aAddUnitLabel, aType );
348}
349
350
351wxString EDA_UNIT_UTILS::UI::MessageTextFromValue( EDA_ANGLE aValue, bool aAddUnitLabel )
352{
353 if( aAddUnitLabel )
354 return wxString::Format( wxT( "%.1f°" ), aValue.AsDegrees() );
355 else
356 return wxString::Format( wxT( "%.1f" ), aValue.AsDegrees() );
357}
358
359
360// A lower-precision (for readability) version of StringFromValue()
362 double aValue, bool aAddUnitsText,
363 EDA_DATA_TYPE aType )
364{
365 wxString text;
366 const wxChar* format;
367 double value = aValue;
368 bool is_eeschema = ( aIuScale.IU_PER_MM == SCH_IU_PER_MM );
369
370 switch( aType )
371 {
373 value = ToUserUnit( aIuScale, aUnits, value );
374 // Fall through to continue computation
376
378 value = ToUserUnit( aIuScale, aUnits, value );
379 // Fall through to continue computation
381
383 value = ToUserUnit( aIuScale, aUnits, value );
384 break;
385
387 break;
388 }
389
390 switch( aUnits )
391 {
392 default:
393 case EDA_UNITS::UM: format = is_eeschema ? wxT( "%.0f" ) : wxT( "%.1f" ); break;
394 case EDA_UNITS::MM: format = is_eeschema ? wxT( "%.2f" ) : wxT( "%.4f" ); break;
395 case EDA_UNITS::CM: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.5f" ); break;
396 case EDA_UNITS::MILS: format = is_eeschema ? wxT( "%.0f" ) : wxT( "%.2f" ); break;
397 case EDA_UNITS::INCH: format = is_eeschema ? wxT( "%.3f" ) : wxT( "%.4f" ); break;
398 case EDA_UNITS::DEGREES: format = wxT( "%.3f" ); break;
399 case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break;
400 }
401
402 text.Printf( format, value );
403
404 if( aAddUnitsText )
405 text += EDA_UNIT_UTILS::GetText( aUnits, aType );
406
407 return text;
408}
409
410
412 EDA_UNITS aUnits,
413 const MINOPTMAX<int>& aValue )
414{
415 wxString msg;
416
417 if( aValue.HasMin() && aValue.Min() > 0 )
418 {
419 msg += _( "min" ) + wxS( " " ) + MessageTextFromValue( aIuScale, aUnits, aValue.Min() );
420 }
421
422 if( aValue.HasOpt() )
423 {
424 if( !msg.IsEmpty() )
425 msg += wxS( "; " );
426
427 msg += _( "opt" ) + wxS( " " ) + MessageTextFromValue( aIuScale, aUnits, aValue.Opt() );
428 }
429
430 if( aValue.HasMax() )
431 {
432 if( !msg.IsEmpty() )
433 msg += wxS( "; " );
434
435 msg += _( "max" ) + wxS( " " ) + MessageTextFromValue( aIuScale, aUnits, aValue.Max() );
436 }
437
438 return msg;
439};
440
441
443 double aValue )
444{
445 switch( aUnits )
446 {
447 case EDA_UNITS::UM: return MM_TO_IU( aValue / 1000.0, aIuScale );
448 case EDA_UNITS::MM: return MM_TO_IU( aValue, aIuScale );
449 case EDA_UNITS::CM: return MM_TO_IU( aValue * 10, aIuScale );
450 case EDA_UNITS::MILS: return MILS_TO_IU( aValue, aIuScale );
451 case EDA_UNITS::INCH: return IN_TO_IU( aValue, aIuScale );
452 default:
455 case EDA_UNITS::PERCENT: return aValue;
456 }
457}
458
459
460double EDA_UNIT_UTILS::UI::DoubleValueFromString( const wxString& aTextValue )
461{
462 double dtmp = 0;
463
464 // Acquire the 'right' decimal point separator
465 const struct lconv* lc = localeconv();
466
467 wxChar decimal_point = lc->decimal_point[0];
468 wxString buf( aTextValue.Strip( wxString::both ) );
469
470 // Convert any entered decimal point separators to the 'right' one
471 buf.Replace( wxT( "." ), wxString( decimal_point, 1 ) );
472 buf.Replace( wxT( "," ), wxString( decimal_point, 1 ) );
473
474 // Find the end of the numeric part
475 unsigned brk_point = 0;
476
477 while( brk_point < buf.Len() )
478 {
479 wxChar ch = buf[brk_point];
480
481 if( !( ( ch >= '0' && ch <= '9' ) || ( ch == decimal_point ) || ( ch == '-' )
482 || ( ch == '+' ) ) )
483 {
484 break;
485 }
486
487 ++brk_point;
488 }
489
490 // Extract the numeric part
491 buf.Left( brk_point ).ToDouble( &dtmp );
492
493 return dtmp;
494}
495
496
498 const wxString& aTextValue, EDA_DATA_TYPE aType )
499{
500 double dtmp = 0;
501
502 // Acquire the 'right' decimal point separator
503 const struct lconv* lc = localeconv();
504
505 wxChar decimal_point = lc->decimal_point[0];
506 wxString buf( aTextValue.Strip( wxString::both ) );
507
508 // Convert any entered decimal point separators to the 'right' one
509 buf.Replace( wxT( "." ), wxString( decimal_point, 1 ) );
510 buf.Replace( wxT( "," ), wxString( decimal_point, 1 ) );
511
512 // Find the end of the numeric part
513 unsigned brk_point = 0;
514
515 while( brk_point < buf.Len() )
516 {
517 wxChar ch = buf[brk_point];
518
519 if( !( (ch >= '0' && ch <= '9') || (ch == decimal_point) || (ch == '-') || (ch == '+') ) )
520 break;
521
522 ++brk_point;
523 }
524
525 // Extract the numeric part
526 buf.Left( brk_point ).ToDouble( &dtmp );
527
528 // Check the optional unit designator (2 ch significant)
529 wxString unit( buf.Mid( brk_point ).Strip( wxString::leading ).Left( 2 ).Lower() );
530
531 if( aUnits == EDA_UNITS::UM
532 || aUnits == EDA_UNITS::MM
533 || aUnits == EDA_UNITS::CM
534 || aUnits == EDA_UNITS::MILS
535 || aUnits == EDA_UNITS::INCH )
536 {
537 //check for um, μm (µ is MICRO SIGN) and µm (µ is GREEK SMALL LETTER MU) for micrometre
538 if( unit == wxT( "um" ) || unit == wxT( "\u00B5m" ) || unit == wxT( "\u03BCm" ) )
539 {
540 aUnits = EDA_UNITS::UM;
541 }
542 else if( unit == wxT( "mm" ) )
543 {
544 aUnits = EDA_UNITS::MM;
545 }
546 else if( unit == wxT( "cm" ) )
547 {
548 aUnits = EDA_UNITS::CM;
549 }
550 else if( unit == wxT( "mi" ) || unit == wxT( "th" ) )
551 {
552 aUnits = EDA_UNITS::MILS;
553 }
554 else if( unit == wxT( "in" ) || unit == wxT( "\"" ) )
555 {
556 aUnits = EDA_UNITS::INCH;
557 }
558 else if( unit == wxT( "oz" ) ) // 1 oz = 1.37 mils
559 {
560 aUnits = EDA_UNITS::MILS;
561 dtmp *= 1.37;
562 }
563 }
564 else if( aUnits == EDA_UNITS::DEGREES )
565 {
566 if( unit == wxT( "ra" ) ) // Radians
567 dtmp *= 180.0f / M_PI;
568 }
569
570 switch( aType )
571 {
573 dtmp = FromUserUnit( aIuScale, aUnits, dtmp );
575
577 dtmp = FromUserUnit( aIuScale, aUnits, dtmp );
579
581 dtmp = FromUserUnit( aIuScale, aUnits, dtmp );
582 break;
583
585 break;
586 }
587
588 return dtmp;
589}
590
591
592long long int EDA_UNIT_UTILS::UI::ValueFromString( const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
593 const wxString& aTextValue, EDA_DATA_TYPE aType )
594{
595 double value = DoubleValueFromString( aIuScale, aUnits, aTextValue, aType );
596
597 return KiROUND<double, long long int>( value );
598}
599
600
601long long int EDA_UNIT_UTILS::UI::ValueFromString( const wxString& aTextValue )
602{
603 double value = DoubleValueFromString( aTextValue );
604
605 return KiROUND<double, long long int>( value );
606}
constexpr double SCH_IU_PER_MM
Schematic internal units 1=100nm.
Definition: base_units.h:72
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition: box2.h:990
double AsDegrees() const
Definition: eda_angle.h:113
T Min() const
Definition: minoptmax.h:33
bool HasMax() const
Definition: minoptmax.h:38
bool HasMin() const
Definition: minoptmax.h:37
T Max() const
Definition: minoptmax.h:34
T Opt() const
Definition: minoptmax.h:35
bool HasOpt() const
Definition: minoptmax.h:39
#define _(s)
#define IU_TO_IN(x, scale)
Definition: eda_units.cpp:254
#define IN_TO_IU(x, scale)
Definition: eda_units.cpp:257
#define IU_TO_MILS(x, scale)
Definition: eda_units.cpp:255
#define MM_TO_IU(x, scale)
Definition: eda_units.cpp:256
#define IU_TO_MM(x, scale)
Definition: eda_units.cpp:253
#define MILS_TO_IU(x, scale)
Definition: eda_units.cpp:258
static void removeTrailingZeros(wxString &aText)
Definition: eda_units.cpp:32
EDA_DATA_TYPE
The type of unit.
Definition: eda_units.h:38
EDA_UNITS
Definition: eda_units.h:46
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:96
KICOMMON_API wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
Definition: eda_units.cpp:361
KICOMMON_API double FromUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Return in internal units the value aValue given in a real unit such as "in", "mm",...
Definition: eda_units.cpp:442
KICOMMON_API long long int ValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Convert aTextValue in aUnits to internal units used by the application.
Definition: eda_units.cpp:592
KICOMMON_API wxString StringFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Return the string from aValue according to aUnits (inch, mm ...) for display.
Definition: eda_units.cpp:277
KICOMMON_API wxString MessageTextFromMinOptMax(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const MINOPTMAX< int > &aValue)
Definition: eda_units.cpp:411
KICOMMON_API double DoubleValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Convert aTextValue to a double.
Definition: eda_units.cpp:497
KICOMMON_API double ToUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Convert aValue in internal units to the appropriate user units defined by aUnit.
Definition: eda_units.cpp:261
KICOMMON_API wxString GetText(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
Definition: eda_units.cpp:127
KICOMMON_API bool FetchUnitsFromString(const wxString &aTextValue, EDA_UNITS &aUnits)
Write any unit info found in the string to aUnits.
Definition: eda_units.cpp:88
KICOMMON_API bool IsImperialUnit(EDA_UNITS aUnit)
Definition: eda_units.cpp:47
KICOMMON_API bool IsMetricUnit(EDA_UNITS aUnit)
Definition: eda_units.cpp:61
KICOMMON_API wxString GetLabel(EDA_UNITS aUnits, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Get the units string for a given units type.
Definition: eda_units.cpp:156
KICOMMON_API int Mm2mils(double aVal)
Convert mm to mils.
Definition: eda_units.cpp:76
KICOMMON_API std::string FormatInternalUnits(const EDA_IU_SCALE &aIuScale, int aValue)
Converts aValue from internal units to a string appropriate for writing to file.
Definition: eda_units.cpp:170
KICOMMON_API std::string FormatAngle(const EDA_ANGLE &aAngle)
Convert aAngle from board units to a string appropriate for writing to file.
Definition: eda_units.cpp:162
KICOMMON_API int Mils2mm(double aVal)
Convert mils to mm.
Definition: eda_units.cpp:82
const double IU_PER_MM
Definition: base_units.h:76