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
Hide 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
...
@@ -31,7 +31,7 @@ wxString GetBuildVersion()
...
@@ -31,7 +31,7 @@ wxString GetBuildVersion()
wxString
GetAboutBuildVersion
()
wxString
GetAboutBuildVersion
()
/*********************************************/
/*********************************************/
{
{
return
g_BuildAboutVersion
;
return
g_BuildAboutVersion
;
}
}
/********************************/
/********************************/
...
@@ -500,7 +500,9 @@ int GetTimeStamp()
...
@@ -500,7 +500,9 @@ int GetTimeStamp()
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
)
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
* entree : valeur en mils , buffer de texte
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* suivie de " ou mm
* suivie de " ou mm
...
@@ -518,6 +520,34 @@ const wxString& valeur_param( int valeur, wxString& buf_texte )
...
@@ -518,6 +520,34 @@ const wxString& valeur_param( int valeur, wxString& buf_texte )
return
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
)
wxString
&
operator
<<
(
wxString
&
aString
,
const
wxPoint
&
aPos
)
{
{
...
...
eeschema/affiche.cpp
View file @
b02b170d
...
@@ -68,7 +68,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -68,7 +68,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
/* Affichage du nom */
/* Affichage du nom */
Affiche_1_Parametre
(
frame
,
24
,
_
(
"PinName"
),
m_PinName
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
30
,
_
(
"PinName"
),
m_PinName
,
DARKCYAN
);
/* Affichage du numero */
/* Affichage du numero */
if
(
m_PinNum
==
0
)
if
(
m_PinNum
==
0
)
...
@@ -76,11 +76,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -76,11 +76,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
else
else
ReturnPinStringNum
(
Text
);
ReturnPinStringNum
(
Text
);
Affiche_1_Parametre
(
frame
,
40
,
_
(
"PinNum"
),
Text
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
38
,
_
(
"PinNum"
),
Text
,
DARKCYAN
);
/* Affichage du type */
/* Affichage du type */
ii
=
m_PinType
;
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 */
/* Affichage de la visiblite */
ii
=
m_Attributs
;
ii
=
m_Attributs
;
...
@@ -88,11 +88,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -88,11 +88,11 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
Text
=
_
(
"no"
);
Text
=
_
(
"no"
);
else
else
Text
=
_
(
"yes"
);
Text
=
_
(
"yes"
);
Affiche_1_Parametre
(
frame
,
5
8
,
_
(
"Display"
),
Text
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
5
0
,
_
(
"Display"
),
Text
,
DARKGREEN
);
/*
Affichage de la longueur
*/
/*
Display pin length
*/
Text
.
Printf
(
wxT
(
"%d"
),
m_PinLen
);
Text
=
MakeStringFromValue
(
m_PinLen
,
EESCHEMA_INTERNAL_UNIT
);
Affiche_1_Parametre
(
frame
,
66
,
_
(
"Leng
h"
),
Text
,
MAGENTA
);
Affiche_1_Parametre
(
frame
,
56
,
_
(
"Lengt
h"
),
Text
,
MAGENTA
);
/* Affichage de l'orientation */
/* Affichage de l'orientation */
switch
(
m_Orient
)
switch
(
m_Orient
)
...
@@ -113,7 +113,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -113,7 +113,7 @@ void LibDrawPin::Display_Infos( WinEDA_DrawFrame* frame )
Text
=
wxT
(
"??"
);
break
;
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 )
...
@@ -168,7 +168,7 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
msg
=
_
(
"All"
);
msg
=
_
(
"All"
);
else
else
msg
.
Printf
(
wxT
(
"%d"
),
m_Unit
);
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
)
if
(
m_Convert
==
0
)
msg
=
_
(
"All"
);
msg
=
_
(
"All"
);
...
@@ -178,11 +178,11 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
...
@@ -178,11 +178,11 @@ void LibEDA_BaseStruct::Display_Infos_DrawEntry( WinEDA_DrawFrame* frame )
msg
=
_
(
"yes"
);
msg
=
_
(
"yes"
);
else
else
msg
=
wxT
(
"?"
);
msg
=
wxT
(
"?"
);
Affiche_1_Parametre
(
frame
,
1
6
,
_
(
"Convert"
),
msg
,
BROWN
);
Affiche_1_Parametre
(
frame
,
1
4
,
_
(
"Convert"
),
msg
,
BROWN
);
if
(
m_Width
)
if
(
m_Width
)
valeur_param
(
m_Width
,
msg
);
msg
=
MakeStringFromValue
(
m_Width
,
EESCHEMA_INTERNAL_UNIT
);
else
else
msg
=
_
(
"default"
);
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
...
@@ -647,13 +647,22 @@ int GetCommandOptions( const int argc, const char** argv, const char
const
char
**
optarg
,
int
*
optind
);
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
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
* entree : valeur en mils , buffer de texte
* entree : valeur en mils , buffer de texte
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* retourne en buffer : texte : valeur exprimee en pouces ou millimetres
* suivie de " ou mm
* 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
);
wxString
ReturnUnitSymbol
(
int
Units
=
g_UnitMetric
);
int
ReturnValueFromString
(
int
Units
,
const
wxString
&
TextValue
,
int
Internal_Unit
);
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