Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e96f1aeb
Commit
e96f1aeb
authored
Apr 27, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove valeur_param(), that does not work in Kicad Nanometer
parent
9d6c1d12
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
76 additions
and
80 deletions
+76
-80
3d_aux.cpp
3d-viewer/3d_aux.cpp
+1
-1
base_units.cpp
common/base_units.cpp
+16
-0
common.cpp
common/common.cpp
+0
-33
drawframe.cpp
common/drawframe.cpp
+5
-0
class_drc_erc_item.cpp
eeschema/class_drc_erc_item.cpp
+2
-6
base_units.h
include/base_units.h
+23
-2
common.h
include/common.h
+0
-19
fctsys.h
include/fctsys.h
+0
-3
wxstruct.h
include/wxstruct.h
+12
-1
class_dimension.cpp
pcbnew/class_dimension.cpp
+2
-1
class_drawsegment.cpp
pcbnew/class_drawsegment.cpp
+4
-4
class_drc_item.cpp
pcbnew/class_drc_item.cpp
+1
-0
class_edge_mod.cpp
pcbnew/class_edge_mod.cpp
+1
-1
class_mire.cpp
pcbnew/class_mire.cpp
+2
-1
class_track.cpp
pcbnew/class_track.cpp
+4
-6
editrack.cpp
pcbnew/editrack.cpp
+2
-2
specctra_export.cpp
pcbnew/specctra_export.cpp
+1
-0
No files found.
3d-viewer/3d_aux.cpp
View file @
e96f1aeb
...
...
@@ -70,7 +70,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices )
RotatePoint
(
&
aVertices
[
ii
].
x
,
&
aVertices
[
ii
].
y
,
(
int
)
(
m_MatRotation
.
z
*
10
)
);
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
#define SCALE_3D_CONV (
PCB_INTERNAL_UNIT
/ UNITS3D_TO_UNITSPCB)
#define SCALE_3D_CONV (
(IU_PER_MILS * 1000)
/ UNITS3D_TO_UNITSPCB)
aVertices
[
ii
].
x
+=
m_MatPosition
.
x
*
SCALE_3D_CONV
;
aVertices
[
ii
].
y
+=
m_MatPosition
.
y
*
SCALE_3D_CONV
;
aVertices
[
ii
].
z
+=
m_MatPosition
.
z
*
SCALE_3D_CONV
;
...
...
common/base_units.cpp
View file @
e96f1aeb
...
...
@@ -67,6 +67,11 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue )
wxString
CoordinateToString
(
int
aValue
,
bool
aConvertToMils
)
{
return
LengthDoubleToString
(
(
double
)
aValue
,
aConvertToMils
);
}
wxString
LengthDoubleToString
(
double
aValue
,
bool
aConvertToMils
)
{
wxString
text
;
const
wxChar
*
format
;
...
...
@@ -249,3 +254,14 @@ int ReturnValueFromTextCtrl( const wxTextCtrl& aTextCtr )
return
value
;
}
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPos
)
{
aString
<<
wxT
(
"@ ("
)
<<
CoordinateToString
(
aPos
.
x
);
aString
<<
wxT
(
","
)
<<
CoordinateToString
(
aPos
.
y
);
aString
<<
wxT
(
")"
);
return
aString
;
}
common/common.cpp
View file @
e96f1aeb
...
...
@@ -334,39 +334,6 @@ unsigned long GetNewTimeStamp()
}
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
)
{
switch
(
g_UserUnit
)
{
case
MILLIMETRES
:
buf_texte
.
Printf
(
_
(
"%3.3f mm"
),
valeur
*
0.00254
);
break
;
case
INCHES
:
buf_texte
.
Printf
(
wxT
(
"%2.4f
\"
"
),
valeur
*
0.0001
);
break
;
case
UNSCALED_UNITS
:
buf_texte
.
Printf
(
wxT
(
"%d"
),
valeur
);
break
;
}
return
buf_texte
;
}
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPos
)
{
wxString
temp
;
aString
<<
wxT
(
"@ ("
)
<<
valeur_param
(
aPos
.
x
,
temp
);
aString
<<
wxT
(
","
)
<<
valeur_param
(
aPos
.
y
,
temp
);
aString
<<
wxT
(
")"
);
return
aString
;
}
double
RoundTo0
(
double
x
,
double
precision
)
{
assert
(
precision
!=
0
);
...
...
common/drawframe.cpp
View file @
e96f1aeb
...
...
@@ -584,6 +584,11 @@ wxString EDA_DRAW_FRAME::CoordinateToString( int aValue, bool aConvertToMils )
return
::
CoordinateToString
(
aValue
,
aConvertToMils
);
}
wxString
EDA_DRAW_FRAME
::
LengthDoubleToString
(
double
aValue
,
bool
aConvertToMils
)
{
return
::
LengthDoubleToString
(
aValue
,
aConvertToMils
);
}
bool
EDA_DRAW_FRAME
::
HandleBlockBegin
(
wxDC
*
aDC
,
int
aKey
,
const
wxPoint
&
aPosition
)
{
...
...
eeschema/class_drc_erc_item.cpp
View file @
e96f1aeb
...
...
@@ -30,6 +30,7 @@
#include <class_drc_item.h>
#include <erc.h>
#include <base_units.h>
wxString
DRC_ITEM
::
GetErrorText
()
const
{
...
...
@@ -57,14 +58,9 @@ wxString DRC_ITEM::GetErrorText() const
}
}
wxString
DRC_ITEM
::
ShowCoord
(
const
wxPoint
&
aPos
)
{
wxString
ret
;
wxPoint
pos_in_pcb_units
=
aPos
;
pos_in_pcb_units
.
x
*=
10
;
pos_in_pcb_units
.
y
*=
10
;
ret
<<
pos_in_pcb_units
;
ret
<<
aPos
;
return
ret
;
}
include/base_units.h
View file @
e96f1aeb
...
...
@@ -50,16 +50,27 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue );
/**
* Function CoordinateToString
* is a helper to convert the integer coordinate \a aValue to a string in inches,
* is a helper to convert the
\a
integer coordinate \a aValue to a string in inches,
* millimeters, or unscaled units according to the current user units setting.
*
* @param aValue The coordinate to convert.
* @param aValue The
integer
coordinate to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
* the current user unit is millimeters.
* @return The converted string for display in user interface elements.
*/
wxString
CoordinateToString
(
int
aValue
,
bool
aConvertToMils
=
false
);
/**
* Function LenghtDoubleToString
* is a helper to convert the \a double length \a aValue to a string in inches,
* millimeters, or unscaled units according to the current user units setting.
*
* @param aValue The double value to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
* the current user unit is millimeters.
* @return The converted string for display in user interface elements.
*/
wxString
LengthDoubleToString
(
double
aValue
,
bool
aConvertToMils
=
false
);
/**
* Function ReturnStringFromValue
...
...
@@ -72,6 +83,16 @@ wxString CoordinateToString( int aValue, bool aConvertToMils = false );
*/
wxString
ReturnStringFromValue
(
EDA_UNITS_T
aUnit
,
int
aValue
,
bool
aAddUnitSymbol
=
false
);
/**
* Operator << overload
* outputs a point to the argument string in a format resembling
* "@ (x,y)
* @param aString Where to put the text describing the point value
* @param aPoint The point to output.
* @return wxString& - the input string
*/
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPoint
);
/**
* Function PutValueInLocalUnits
* converts \a aValue from internal units to user units and append the units notation
...
...
include/common.h
View file @
e96f1aeb
...
...
@@ -541,17 +541,6 @@ private:
bool
EnsureTextCtrlWidth
(
wxTextCtrl
*
aCtrl
,
const
wxString
*
aString
=
NULL
);
/**
* Operator << overload
* outputs a point to the argument string in a format resembling
* "@ (x,y)
* @param aString Where to put the text describing the point value
* @param aPoint The point to output.
* @return wxString& - the input string
*/
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPoint
);
/**
* Function ProcessExecute
* runs a child process.
...
...
@@ -583,14 +572,6 @@ int GetCommandOptions( const int argc, const char** argv,
const
char
*
stringtst
,
const
char
**
optarg
,
int
*
optind
);
/* Returns to display the value of a parameter, by type of units selected
* Input: value in mils, buffer text
* Returns to buffer: text: value expressed in inches or millimeters
* Followed by " or mm
*/
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
);
/**
* Returns the units symbol.
*
...
...
include/fctsys.h
View file @
e96f1aeb
...
...
@@ -29,9 +29,6 @@
#define M_PI 3.141592653
#endif
#define PCB_INTERNAL_UNIT 10000 // PCBNEW internal unit = 1/10000 inch
#define EESCHEMA_INTERNAL_UNIT 1000 // EESCHEMA internal unit = 1/1000 inch
#ifdef __WINDOWS__
#define DIR_SEP '\\'
#define STRING_DIR_SEP wxT( "\\" )
...
...
include/wxstruct.h
View file @
e96f1aeb
...
...
@@ -841,7 +841,7 @@ public:
/**
* Function CoordinateToString
* is a helper to convert the integer coordinate \a aValue to a string in inches or mm
* is a helper to convert the
\a
integer coordinate \a aValue to a string in inches or mm
* according to the current user units setting.
* @param aValue The coordinate to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
...
...
@@ -850,6 +850,17 @@ public:
*/
wxString
CoordinateToString
(
int
aValue
,
bool
aConvertToMils
=
false
);
/**
* Function LengthDoubleToString
* is a helper to convert the \a double value \a aValue to a string in inches or mm
* according to the current user units setting.
* @param aValue The coordinate to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
* the current user unit is millimeters.
* @return The converted string for display in user interface elements.
*/
wxString
LengthDoubleToString
(
double
aValue
,
bool
aConvertToMils
=
false
);
DECLARE_EVENT_TABLE
()
};
...
...
pcbnew/class_dimension.cpp
View file @
e96f1aeb
...
...
@@ -41,6 +41,7 @@
#include <class_board.h>
#include <class_pcb_text.h>
#include <class_dimension.h>
#include <base_units.h>
DIMENSION
::
DIMENSION
(
BOARD_ITEM
*
aParent
)
:
...
...
@@ -344,7 +345,7 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
if
(
!
aDoNotChangeText
)
{
m_Value
=
mesure
;
valeur_param
(
m_Value
,
msg
);
msg
=
::
CoordinateToString
(
m_Value
);
SetText
(
msg
);
}
}
...
...
pcbnew/class_drawsegment.cpp
View file @
e96f1aeb
...
...
@@ -47,6 +47,7 @@
#include <class_board.h>
#include <class_module.h>
#include <class_drawsegment.h>
#include <base_units.h>
DRAWSEGMENT
::
DRAWSEGMENT
(
BOARD_ITEM
*
aParent
,
KICAD_T
idtype
)
:
...
...
@@ -373,7 +374,7 @@ void DRAWSEGMENT::DisplayInfo( EDA_DRAW_FRAME* frame )
frame
->
AppendMsgPanel
(
_
(
"Layer"
),
board
->
GetLayerName
(
m_Layer
),
DARKBROWN
);
valeur_param
(
(
unsigned
)
m_Width
,
msg
);
msg
=
frame
->
CoordinateToString
(
m_Width
);
frame
->
AppendMsgPanel
(
_
(
"Width"
),
msg
,
DARKCYAN
);
}
...
...
@@ -527,12 +528,11 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect ) const
wxString
DRAWSEGMENT
::
GetSelectMenuText
()
const
{
wxString
text
;
wxString
temp
;
wxString
temp
=
::
LengthDoubleToString
(
GetLength
()
)
;
text
.
Printf
(
_
(
"Pcb Graphic: %s length: %s on %s"
),
GetChars
(
ShowShape
(
(
STROKE_T
)
m_Shape
)
),
GetChars
(
valeur_param
(
GetLength
(),
temp
)
),
GetChars
(
GetLayerName
()
)
);
GetChars
(
temp
),
GetChars
(
GetLayerName
()
)
);
return
text
;
}
...
...
pcbnew/class_drc_item.cpp
View file @
e96f1aeb
...
...
@@ -32,6 +32,7 @@
#include <pcbnew.h>
#include <drc_stuff.h>
#include <class_drc_item.h>
#include <base_units.h>
wxString
DRC_ITEM
::
GetErrorText
()
const
...
...
pcbnew/class_edge_mod.cpp
View file @
e96f1aeb
...
...
@@ -255,7 +255,7 @@ void EDGE_MODULE::DisplayInfo( EDA_DRAW_FRAME* frame )
frame
->
AppendMsgPanel
(
_
(
"Mod Layer"
),
board
->
GetLayerName
(
module
->
GetLayer
()
),
RED
);
frame
->
AppendMsgPanel
(
_
(
"Seg Layer"
),
board
->
GetLayerName
(
GetLayer
()
),
RED
);
valeur_param
(
m_Width
,
msg
);
msg
=
frame
->
CoordinateToString
(
m_Width
);
frame
->
AppendMsgPanel
(
_
(
"Width"
),
msg
,
BLUE
);
}
...
...
pcbnew/class_mire.cpp
View file @
e96f1aeb
...
...
@@ -42,6 +42,7 @@
#include <class_board.h>
#include <class_mire.h>
#include <base_units.h>
PCB_TARGET
::
PCB_TARGET
(
BOARD_ITEM
*
aParent
)
:
...
...
@@ -210,7 +211,7 @@ wxString PCB_TARGET::GetSelectMenuText() const
wxString
text
;
wxString
msg
;
valeur_param
(
m_Size
,
msg
);
msg
=
::
CoordinateToString
(
m_Size
);
text
.
Printf
(
_
(
"Target on %s size %s"
),
GetChars
(
GetLayerName
()
),
GetChars
(
msg
)
);
...
...
pcbnew/class_track.cpp
View file @
e96f1aeb
...
...
@@ -46,6 +46,7 @@
#include <pcbnew.h>
#include <protos.h>
#include <base_units.h>
/**
* Function ShowClearance
...
...
@@ -138,10 +139,7 @@ EDA_ITEM* TRACK::Clone() const
wxString
TRACK
::
ShowWidth
()
const
{
wxString
msg
;
valeur_param
(
m_Width
,
msg
);
wxString
msg
=
::
CoordinateToString
(
m_Width
);
return
msg
;
}
...
...
@@ -1173,7 +1171,7 @@ void TRACK::DisplayInfoBase( EDA_DRAW_FRAME* frame )
// Display segment length
if
(
Type
()
!=
PCB_VIA_T
)
// Display Diam and Drill values
{
msg
=
frame
->
CoordinateToString
(
KiROUND
(
GetLength
()
)
);
msg
=
frame
->
LengthDoubleToString
(
GetLength
(
)
);
frame
->
AppendMsgPanel
(
_
(
"Segment Length"
),
msg
,
DARKCYAN
);
}
}
...
...
@@ -1553,7 +1551,7 @@ wxString TRACK::GetSelectMenuText() const
}
text
<<
_
(
" on "
)
<<
GetLayerName
()
<<
wxT
(
" "
)
<<
_
(
"Net:"
)
<<
GetNet
()
<<
wxT
(
" "
)
<<
_
(
"Length:"
)
<<
valeur_param
(
GetLength
(),
temp
);
<<
wxT
(
" "
)
<<
_
(
"Length:"
)
<<
::
LengthDoubleToString
(
GetLength
()
);
return
text
;
}
...
...
pcbnew/editrack.cpp
View file @
e96f1aeb
...
...
@@ -789,13 +789,13 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
for
(
TRACK
*
track
=
g_FirstTrackSegment
;
track
;
track
=
track
->
Next
()
)
trackLen
+=
track
->
GetLength
();
valeur_param
(
KiROUND
(
trackLen
),
msg
);
msg
=
frame
->
LengthDoubleToString
(
trackLen
);
frame
->
AppendMsgPanel
(
_
(
"Track Len"
),
msg
,
DARKCYAN
);
if
(
lenDie
!=
0
)
// display the track len on board and the actual track len
{
frame
->
AppendMsgPanel
(
_
(
"Full Len"
),
msg
,
DARKCYAN
);
valeur_param
(
KiROUND
(
trackLen
+
lenDie
),
msg
);
msg
=
frame
->
LengthDoubleToString
(
trackLen
+
lenDie
);
frame
->
AppendMsgPanel
(
_
(
"On Die"
),
msg
,
DARKCYAN
);
}
...
...
pcbnew/specctra_export.cpp
View file @
e96f1aeb
...
...
@@ -48,6 +48,7 @@
#include <class_track.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <base_units.h>
#include <collectors.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment