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
b02b170d
Commit
b02b170d
authored
Sep 05, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eeschema: minor bug solved: bad value when display lines widths in info screen in libedit
parent
5a904e46
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
16 deletions
+55
-16
common.cpp
common/common.cpp
+32
-2
affiche.cpp
eeschema/affiche.cpp
+12
-12
common.h
include/common.h
+11
-2
No files found.
common/common.cpp
View file @
b02b170d
...
...
@@ -500,7 +500,9 @@ int GetTimeStamp()
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
)
/**************************************************************/
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
/**
* @todo replace this obsolete funtion by MakeStringFromValue
* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
* entree : valeur en mils , buffer de texte
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* suivie de " ou mm
...
...
@@ -518,6 +520,34 @@ const wxString& valeur_param( int valeur, wxString& buf_texte )
return
buf_texte
;
}
/****************************************************************************************/
const
wxString
MakeStringFromValue
(
int
value
,
int
internal_unit
)
/****************************************************************************************/
/** Function MakeStringFromValue
* convert the value of a parameter to a string like <value in prefered units> <unit symbol>
* like 100 mils converted to 0.1 " or 0.245 mm
* use g_UnitMetric do select inch or metric format
* @param : value in internal units
* @param : internal_unit per inch: currently 1000 for eeschema and 10000 for pcbnew
* @return : the string to display or print
*/
{
wxString
text
;
if
(
g_UnitMetric
)
{
text
.
Printf
(
wxT
(
"%3.3f mm"
),
(
float
)
value
*
2.54
/
(
float
)
internal_unit
);
}
else
{
text
.
Printf
(
wxT
(
"%2.4f
\"
"
),
(
float
)
value
/
(
float
)
internal_unit
);
}
return
text
;
}
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPos
)
{
...
...
eeschema/affiche.cpp
View file @
b02b170d
...
...
@@ -68,7 +68,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
frame
->
MsgPanel
->
EraseMsgBox
();
/* Affichage du nom */
Affiche_1_Parametre
(
frame
,
24
,
_
(
"PinName"
),
m_PinName
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
30
,
_
(
"PinName"
),
m_PinName
,
DARKCYAN
);
/* Affichage du numero */
if
(
m_PinNum
==
0
)
...
...
@@ -76,11 +76,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
else
ReturnPinStringNum
(
Text
);
Affiche_1_Parametre
(
frame
,
40
,
_
(
"PinNum"
),
Text
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
38
,
_
(
"PinNum"
),
Text
,
DARKCYAN
);
/* Affichage du type */
ii
=
m_PinType
;
Affiche_1_Parametre
(
frame
,
4
8
,
_
(
"PinType"
),
MsgPinElectricType
[
ii
],
RED
);
Affiche_1_Parametre
(
frame
,
4
4
,
_
(
"PinType"
),
MsgPinElectricType
[
ii
],
RED
);
/* Affichage de la visiblite */
ii
=
m_Attributs
;
...
...
@@ -88,11 +88,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
Text
=
_
(
"no"
);
else
Text
=
_
(
"yes"
);
Affiche_1_Parametre
(
frame
,
5
8
,
_
(
"Display"
),
Text
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
5
0
,
_
(
"Display"
),
Text
,
DARKGREEN
);
/*
Affichage de la longueur
*/
Text
.
Printf
(
wxT
(
"%d"
),
m_PinLen
);
Affiche_1_Parametre
(
frame
,
66
,
_
(
"Leng
h"
),
Text
,
MAGENTA
);
/*
Display pin length
*/
Text
=
MakeStringFromValue
(
m_PinLen
,
EESCHEMA_INTERNAL_UNIT
);
Affiche_1_Parametre
(
frame
,
56
,
_
(
"Lengt
h"
),
Text
,
MAGENTA
);
/* Affichage de l'orientation */
switch
(
m_Orient
)
...
...
@@ -113,7 +113,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
Text
=
wxT
(
"??"
);
break
;
}
Affiche_1_Parametre
(
frame
,
7
2
,
_
(
"Orient"
),
Text
,
MAGENTA
);
Affiche_1_Parametre
(
frame
,
6
2
,
_
(
"Orient"
),
Text
,
MAGENTA
);
}
...
...
@@ -168,7 +168,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
msg
=
_
(
"All"
);
else
msg
.
Printf
(
wxT
(
"%d"
),
m_Unit
);
Affiche_1_Parametre
(
frame
,
10
,
_
(
"Unit"
),
msg
,
BROWN
);
Affiche_1_Parametre
(
frame
,
8
,
_
(
"Unit"
),
msg
,
BROWN
);
if
(
m_Convert
==
0
)
msg
=
_
(
"All"
);
...
...
@@ -178,11 +178,11 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
msg
=
_
(
"yes"
);
else
msg
=
wxT
(
"?"
);
Affiche_1_Parametre
(
frame
,
1
6
,
_
(
"Convert"
),
msg
,
BROWN
);
Affiche_1_Parametre
(
frame
,
1
4
,
_
(
"Convert"
),
msg
,
BROWN
);
if
(
m_Width
)
valeur_param
(
m_Width
,
msg
);
msg
=
MakeStringFromValue
(
m_Width
,
EESCHEMA_INTERNAL_UNIT
);
else
msg
=
_
(
"default"
);
Affiche_1_Parametre
(
frame
,
2
4
,
_
(
"Width"
),
msg
,
BLUE
);
Affiche_1_Parametre
(
frame
,
2
0
,
_
(
"Width"
),
msg
,
BLUE
);
}
include/common.h
View file @
b02b170d
...
...
@@ -647,13 +647,22 @@ int GetCommandOptions( const int argc, const char** argv, const char
const
char
**
optarg
,
int
*
optind
);
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
);
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
* entree : valeur en mils , buffer de texte
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* suivie de " ou mm
*/
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
);
/** Function MakeStringFromValue
* convert the value of a parameter to a string like <value in prefered units> <unit symbol>
* like 100 mils converted to 0.1 " or 0.245 mm
* use g_UnitMetric do select inch or metric format
* @param : value in internal units
* @param : internal_unit per inch: currently 1000 for eeschema and 10000 for pcbnew
* @return : the string to display or print
*/
const
wxString
MakeStringFromValue
(
int
value
,
int
internal_unit
);
wxString
ReturnUnitSymbol
(
int
Units
=
g_UnitMetric
);
int
ReturnValueFromString
(
int
Units
,
const
wxString
&
TextValue
,
int
Internal_Unit
);
...
...
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