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
4a2aebcd
Commit
4a2aebcd
authored
Mar 15, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
double not float
parent
4f54be02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
gen_modules_placefile.cpp
pcbnew/gen_modules_placefile.cpp
+21
-21
No files found.
pcbnew/gen_modules_placefile.cpp
View file @
4a2aebcd
...
@@ -87,7 +87,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
...
@@ -87,7 +87,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
bool
switchedLocale
=
false
;
bool
switchedLocale
=
false
;
/* Calcul des echelles de conversion */
/* Calcul des echelles de conversion */
float
conv_unit
=
0.0001
;
/* unites = INCHES */
double
conv_unit
=
0.0001
;
/* unites = INCHES */
// if(IF_DRILL_METRIC) conv_unit = 0.000254; /* unites = mm */
// if(IF_DRILL_METRIC) conv_unit = 0.000254; /* unites = mm */
...
@@ -180,7 +180,6 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
...
@@ -180,7 +180,6 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
msg
.
Empty
();
msg
<<
moduleCount
;
msg
.
Empty
();
msg
<<
moduleCount
;
Affiche_1_Parametre
(
this
,
65
,
_
(
"Module count"
),
msg
,
RED
);
Affiche_1_Parametre
(
this
,
65
,
_
(
"Module count"
),
msg
,
RED
);
/* Etablissement de la liste des modules par ordre alphabetique */
/* Etablissement de la liste des modules par ordre alphabetique */
Liste
=
(
LIST_MOD
*
)
MyZMalloc
(
moduleCount
*
sizeof
(
LIST_MOD
)
);
Liste
=
(
LIST_MOD
*
)
MyZMalloc
(
moduleCount
*
sizeof
(
LIST_MOD
)
);
...
@@ -248,9 +247,9 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
...
@@ -248,9 +247,9 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
char
*
text
=
line
+
strlen
(
line
);
char
*
text
=
line
+
strlen
(
line
);
sprintf
(
text
,
" %9.4f %9.4f %8.1f "
,
sprintf
(
text
,
" %9.4f %9.4f %8.1f "
,
(
float
)
module_pos
.
x
*
conv_unit
,
module_pos
.
x
*
conv_unit
,
(
float
)
module_pos
.
y
*
conv_unit
,
module_pos
.
y
*
conv_unit
,
(
float
)
Liste
[
ii
].
m_Module
->
m_Orient
/
10
);
double
(
Liste
[
ii
].
m_Module
->
m_Orient
)
/
10
);
int
layer
=
Liste
[
ii
].
m_Module
->
GetLayer
();
int
layer
=
Liste
[
ii
].
m_Module
->
GetLayer
();
...
@@ -307,7 +306,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
...
@@ -307,7 +306,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
/* Print a module report.
/* Print a module report.
*/
*/
{
{
float
conv_unit
;
double
conv_unit
;
MODULE
*
Module
;
MODULE
*
Module
;
D_PAD
*
pad
;
D_PAD
*
pad
;
char
line
[
1024
],
Buff
[
80
];
char
line
[
1024
],
Buff
[
80
];
...
@@ -353,13 +352,13 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
...
@@ -353,13 +352,13 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
fputs
(
"
\n
$BOARD
\n
"
,
rptfile
);
fputs
(
"
\n
$BOARD
\n
"
,
rptfile
);
fputs
(
"unit INCH
\n
"
,
rptfile
);
fputs
(
"unit INCH
\n
"
,
rptfile
);
sprintf
(
line
,
"upper_left_corner %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"upper_left_corner %9.6f %9.6f
\n
"
,
(
float
)
GetBoard
()
->
m_BoundaryBox
.
GetX
()
*
conv_unit
,
GetBoard
()
->
m_BoundaryBox
.
GetX
()
*
conv_unit
,
(
float
)
GetBoard
()
->
m_BoundaryBox
.
GetY
()
*
conv_unit
);
GetBoard
()
->
m_BoundaryBox
.
GetY
()
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"lower_right_corner %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"lower_right_corner %9.6f %9.6f
\n
"
,
(
float
)
(
GetBoard
()
->
m_BoundaryBox
.
GetRight
()
)
*
conv_unit
,
GetBoard
()
->
m_BoundaryBox
.
GetRight
(
)
*
conv_unit
,
(
float
)
(
GetBoard
()
->
m_BoundaryBox
.
GetBottom
()
)
*
conv_unit
);
GetBoard
()
->
m_BoundaryBox
.
GetBottom
(
)
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
fputs
(
"$EndBOARD
\n\n
"
,
rptfile
);
fputs
(
"$EndBOARD
\n\n
"
,
rptfile
);
...
@@ -390,12 +389,13 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
...
@@ -390,12 +389,13 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
module_pos
=
Module
->
m_Pos
;
module_pos
=
Module
->
m_Pos
;
module_pos
.
x
-=
File_Place_Offset
.
x
;
module_pos
.
x
-=
File_Place_Offset
.
x
;
module_pos
.
y
-=
File_Place_Offset
.
y
;
module_pos
.
y
-=
File_Place_Offset
.
y
;
sprintf
(
line
,
"position %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"position %9.6f %9.6f
\n
"
,
(
float
)
module_pos
.
x
*
conv_unit
,
module_pos
.
x
*
conv_unit
,
(
float
)
module_pos
.
y
*
conv_unit
);
module_pos
.
y
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"orientation %.2f
\n
"
,
(
float
)
Module
->
m_Orient
/
10
);
sprintf
(
line
,
"orientation %.2f
\n
"
,
(
double
)
Module
->
m_Orient
/
10
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
if
(
Module
->
GetLayer
()
==
CMP_N
)
strcat
(
line
,
"layer component
\n
"
);
strcat
(
line
,
"layer component
\n
"
);
else
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
else
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
...
@@ -410,22 +410,22 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
...
@@ -410,22 +410,22 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
{
{
fprintf
(
rptfile
,
"$PAD
\"
%.4s
\"\n
"
,
pad
->
m_Padname
);
fprintf
(
rptfile
,
"$PAD
\"
%.4s
\"\n
"
,
pad
->
m_Padname
);
sprintf
(
line
,
"position %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"position %9.6f %9.6f
\n
"
,
(
float
)
pad
->
m_Pos0
.
x
*
conv_unit
,
pad
->
m_Pos0
.
x
*
conv_unit
,
(
float
)
pad
->
m_Pos0
.
y
*
conv_unit
);
pad
->
m_Pos0
.
y
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"size %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"size %9.6f %9.6f
\n
"
,
(
float
)
pad
->
m_Size
.
x
*
conv_unit
,
pad
->
m_Size
.
x
*
conv_unit
,
(
float
)
pad
->
m_Size
.
y
*
conv_unit
);
pad
->
m_Size
.
y
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"drill %9.6f
\n
"
,
(
float
)
pad
->
m_Drill
.
x
*
conv_unit
);
sprintf
(
line
,
"drill %9.6f
\n
"
,
pad
->
m_Drill
.
x
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"shape_offset %9.6f %9.6f
\n
"
,
sprintf
(
line
,
"shape_offset %9.6f %9.6f
\n
"
,
(
float
)
pad
->
m_Offset
.
x
*
conv_unit
,
pad
->
m_Offset
.
x
*
conv_unit
,
(
float
)
pad
->
m_Offset
.
y
*
conv_unit
);
pad
->
m_Offset
.
y
*
conv_unit
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
sprintf
(
line
,
"orientation %.2f
\n
"
,
(
float
)
(
pad
->
m_Orient
-
Module
->
m_Orient
)
/
10
);
sprintf
(
line
,
"orientation %.2f
\n
"
,
double
(
pad
->
m_Orient
-
Module
->
m_Orient
)
/
10
);
fputs
(
line
,
rptfile
);
fputs
(
line
,
rptfile
);
const
char
*
shape_name
[
6
]
=
const
char
*
shape_name
[
6
]
=
{
"??? "
,
"Circ"
,
"Rect"
,
"Oval"
,
"trap"
,
"spec"
};
{
"??? "
,
"Circ"
,
"Rect"
,
"Oval"
,
"trap"
,
"spec"
};
...
...
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