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
3f38a6d8
Commit
3f38a6d8
authored
May 22, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worksheetcode cleaning and fix plot sheet filename bug under Linux.
parent
001723e0
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
225 additions
and
328 deletions
+225
-328
title_block_shapes.h
common/title_block_shapes.h
+196
-295
title_block_shapes_gost.h
common/title_block_shapes_gost.h
+12
-15
worksheet_shape_builder.h
common/worksheet_shape_builder.h
+2
-0
schframe.cpp
eeschema/schframe.cpp
+15
-18
No files found.
common/title_block_shapes.h
View file @
3f38a6d8
This diff is collapsed.
Click to expand it.
common/title_block_shapes_gost.h
View file @
3f38a6d8
...
...
@@ -35,8 +35,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define SIZETEXT 100 // worksheet text size
#define SIZETEXT_REF 50 // worksheet frame reference text size
#define TEXTSIZE 100 // worksheet text size
#define PAS_REF 2000 // reference markings on worksheet frame
// used in worksheet.cpp
...
...
@@ -974,10 +973,8 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
wxPoint
pos
;
wxPoint
end
;
int
refx
,
refy
;
wxString
Line
;
Ki_WorkSheetData
*
WsItem
;
wxSize
size
(
SIZETEXT
*
m_milsToIu
,
SIZETEXT
*
m_milsToIu
);
wxSize
size_ref
(
SIZETEXT_REF
*
m_milsToIu
,
SIZETEXT_REF
*
m_milsToIu
);
wxSize
size
(
TEXTSIZE
*
m_milsToIu
,
TEXTSIZE
*
m_milsToIu
);
wxString
msg
;
WS_DRAW_ITEM_TEXT
*
gtext
;
...
...
@@ -994,10 +991,10 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
int
lnWosn
=
m_penSize
*
2
;
int
lnWtonk
=
m_penSize
;
wxSize
sz
;
wxSize
size0_8
(
SIZETEXT
*
m_milsToIu
*
0
.
8
,
SIZETEXT
*
m_milsToIu
*
1
);
wxSize
size1_5
(
SIZETEXT
*
m_milsToIu
*
1
.
5
,
SIZETEXT
*
m_milsToIu
*
1
.
5
);
wxSize
size2
(
SIZETEXT
*
m_milsToIu
*
2
,
SIZETEXT
*
m_milsToIu
*
2
);
wxSize
size3
(
SIZETEXT
*
m_milsToIu
*
3
,
SIZETEXT
*
m_milsToIu
*
3
);
wxSize
size0_8
(
TEXTSIZE
*
m_milsToIu
*
0
.
8
,
TEXTSIZE
*
m_milsToIu
*
1
);
wxSize
size1_5
(
TEXTSIZE
*
m_milsToIu
*
1
.
5
,
TEXTSIZE
*
m_milsToIu
*
1
.
5
);
wxSize
size2
(
TEXTSIZE
*
m_milsToIu
*
2
,
TEXTSIZE
*
m_milsToIu
*
2
);
wxSize
size3
(
TEXTSIZE
*
m_milsToIu
*
3
,
TEXTSIZE
*
m_milsToIu
*
3
);
// Draw the border.
Append
(
new
WS_DRAW_ITEM_RECT
(
...
...
@@ -1112,9 +1109,9 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
int
index
=
0
;
wxString
fullMsg
=
msg
;
do
// Reduce the height of wrapped title until the fit
while
(
1
)
// Reduce the height of wrapped title until the fit
{
do
// Wrap the title
while
(
1
)
// Wrap the title
{
titleWidth
=
ReturnGraphicTextWidth
(
msg
,
sz
.
x
,
false
,
false
)
/
m_milsToIu
;
...
...
@@ -1122,7 +1119,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
{
index
=
0
;
do
while
(
1
)
{
msg
=
msg
.
Left
(
msg
.
Length
()
-
1
);
...
...
@@ -1163,7 +1160,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
}
}
}
}
while
(
1
);
}
}
else
{
...
...
@@ -1180,7 +1177,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
break
;
}
}
while
(
1
);
}
if
(
titleFieldHeight
<
(
int
)
(
titleHeight
*
lines
.
Count
()
)
)
{
...
...
@@ -1191,7 +1188,7 @@ void WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(
}
else
break
;
}
while
(
1
);
}
pos
.
x
=
(
refx
-
Mm2mils
(
85
)
)
*
m_milsToIu
;
pos
.
y
=
...
...
common/worksheet_shape_builder.h
View file @
3f38a6d8
...
...
@@ -133,6 +133,8 @@ public:
WS_DRAW_ITEM_LIST
()
{
m_idx
=
0
;
m_milsToIu
=
1
.
0
;
m_penSize
=
1
;
}
~
WS_DRAW_ITEM_LIST
()
...
...
eeschema/schframe.cpp
View file @
3f38a6d8
...
...
@@ -530,27 +530,24 @@ wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
* However if filename is too long name is <sheet filename>-<sheet number>
*/
#define FN_LEN_MAX
100 // A reasonnable value for the full file
name len
#define FN_LEN_MAX
80 // A reasonable value for the short file
name len
fn
.
ClearExt
();
wxString
filename
=
fn
.
GetFullPath
();
if
(
(
filename
.
Len
()
+
m_CurrentSheet
->
PathHumanReadable
().
Len
()
)
<
FN_LEN_MAX
)
{
filename
+=
m_CurrentSheet
->
PathHumanReadable
();
filename
.
Replace
(
wxT
(
"/"
),
wxT
(
"-"
)
);
filename
.
RemoveLast
();
// To avoid issues on unix, ensure the filename does not start
// by '-', which has a special meaning in command lines
#ifndef __WINDOWS__
wxString
newfn
;
if
(
filename
.
StartsWith
(
wxT
(
"-"
),
&
newfn
)
)
filename
=
newfn
;
#endif
}
wxString
filename
=
fn
.
GetName
();
wxString
sheetFullName
=
m_CurrentSheet
->
PathHumanReadable
();
sheetFullName
.
Trim
(
true
);
sheetFullName
.
Trim
(
false
);
// Remove the last '/' of the path human readable
// (and for the root sheet, make sheetFullName empty):
sheetFullName
.
RemoveLast
();
// Convert path human readable separator to '-'
sheetFullName
.
Replace
(
wxT
(
"/"
),
wxT
(
"-"
)
);
if
(
(
filename
.
Len
()
+
sheetFullName
.
Len
()
)
<
FN_LEN_MAX
)
filename
+=
sheetFullName
;
else
{
filename
<<
wxT
(
"-"
)
<<
GetScreen
()
->
m_ScreenNumber
;
}
return
filename
;
}
...
...
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