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
1393eb0f
Commit
1393eb0f
authored
Jan 05, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish up SCH_SHEET::{Set,Get}PageSettings() switch over
parent
d3afe95c
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
443 additions
and
304 deletions
+443
-304
common.cpp
common/common.cpp
+60
-78
dialog_page_settings.cpp
common/dialogs/dialog_page_settings.cpp
+13
-13
dialog_SVG_print.cpp
eeschema/dialogs/dialog_SVG_print.cpp
+0
-1
dialog_plot_schematic_HPGL.cpp
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
+3
-3
dialog_print_using_printer.cpp
eeschema/dialogs/dialog_print_using_printer.cpp
+10
-9
eeschema_config.cpp
eeschema/eeschema_config.cpp
+17
-13
files-io.cpp
eeschema/files-io.cpp
+4
-1
libedit_plot_component.cpp
eeschema/libedit_plot_component.cpp
+64
-46
libeditframe.cpp
eeschema/libeditframe.cpp
+39
-3
libeditframe.h
eeschema/libeditframe.h
+11
-1
load_one_schematic_file.cpp
eeschema/load_one_schematic_file.cpp
+16
-35
sch_screen.cpp
eeschema/sch_screen.cpp
+7
-6
sch_sheet.cpp
eeschema/sch_sheet.cpp
+1
-1
sch_sheet.h
eeschema/sch_sheet.h
+2
-2
schframe.cpp
eeschema/schframe.cpp
+37
-4
sheet.cpp
eeschema/sheet.cpp
+1
-1
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+34
-1
viewlib_frame.h
eeschema/viewlib_frame.h
+12
-3
class_base_screen.h
include/class_base_screen.h
+1
-2
class_sch_screen.h
include/class_sch_screen.h
+8
-3
common.h
include/common.h
+61
-40
wxBasePcbFrame.h
include/wxBasePcbFrame.h
+1
-6
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+14
-0
wxstruct.h
include/wxstruct.h
+12
-12
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+6
-13
class_board.h
pcbnew/class_board.h
+1
-1
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+2
-2
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+2
-2
xchgmod.cpp
pcbnew/xchgmod.cpp
+4
-2
No files found.
common/common.cpp
View file @
1393eb0f
...
...
@@ -176,53 +176,53 @@ bool EnsureTextCtrlWidth( wxTextCtrl* aCtrl, const wxString* aString )
//-----<PAGE_INFO>-------------------------------------------------------------
// Standard page sizes in
1/1000 inch
// Standard page sizes in
mils
#if defined(KICAD_GOST)
static
const
PAGE_INFO
pageA4
(
wxSize
(
8283
,
11700
),
wxT
(
"A4"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA4
(
wxSize
(
8283
,
11700
),
wxT
(
"A4"
)
);
#else
static
const
PAGE_INFO
pageA4
(
wxSize
(
11700
,
8267
),
wxT
(
"A4"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA4
(
wxSize
(
11700
,
8267
),
wxT
(
"A4"
)
);
#endif
static
const
PAGE_INFO
pageA3
(
wxSize
(
16535
,
11700
),
wxT
(
"A3"
)
);
static
const
PAGE_INFO
pageA2
(
wxSize
(
23400
,
16535
),
wxT
(
"A2"
)
);
static
const
PAGE_INFO
pageA1
(
wxSize
(
33070
,
23400
),
wxT
(
"A1"
)
);
static
const
PAGE_INFO
pageA0
(
wxSize
(
46800
,
33070
),
wxT
(
"A0"
)
);
static
const
PAGE_INFO
pageA
(
wxSize
(
11000
,
8500
),
wxT
(
"A"
)
);
static
const
PAGE_INFO
pageB
(
wxSize
(
17000
,
11000
),
wxT
(
"B"
)
);
static
const
PAGE_INFO
pageC
(
wxSize
(
22000
,
17000
),
wxT
(
"C"
)
);
static
const
PAGE_INFO
pageD
(
wxSize
(
34000
,
22000
),
wxT
(
"D"
)
);
static
const
PAGE_INFO
pageE
(
wxSize
(
44000
,
34000
),
wxT
(
"E"
)
);
static
const
PAGE_INFO
pageGERBER
(
wxSize
(
32000
,
32000
),
wxT
(
"GERBER"
)
);
double
PAGE_INFO
::
s_user_width
=
17.0
;
double
PAGE_INFO
::
s_user_height
=
11.0
;
static
const
PAGE_INFO
pageUser
(
wxSize
(
17000
,
11000
),
wxT
(
"User"
)
);
static
const
PAGE_INFO
*
stdPageSizes
[]
=
{
&
pageA4
,
&
pageA3
,
&
pageA2
,
&
pageA1
,
&
pageA0
,
&
pageA
,
&
pageB
,
&
pageC
,
&
pageD
,
&
pageE
,
// &pageGERBER, omitted, not standard
&
pageUser
,
};
const
PAGE_INFO
PAGE_INFO
::
pageA3
(
wxSize
(
16535
,
11700
),
wxT
(
"A3"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA2
(
wxSize
(
23400
,
16535
),
wxT
(
"A2"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA1
(
wxSize
(
33070
,
23400
),
wxT
(
"A1"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA0
(
wxSize
(
46800
,
33070
),
wxT
(
"A0"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageA
(
wxSize
(
11000
,
8500
),
wxT
(
"A"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageB
(
wxSize
(
17000
,
11000
),
wxT
(
"B"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageC
(
wxSize
(
22000
,
17000
),
wxT
(
"C"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageD
(
wxSize
(
34000
,
22000
),
wxT
(
"D"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageE
(
wxSize
(
44000
,
34000
),
wxT
(
"E"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageGERBER
(
wxSize
(
32000
,
32000
),
wxT
(
"GERBER"
)
);
const
PAGE_INFO
PAGE_INFO
::
pageUser
(
wxSize
(
17000
,
11000
),
wxT
(
"User"
)
);
int
PAGE_INFO
::
s_user_width
=
17000
;
int
PAGE_INFO
::
s_user_height
=
11000
;
/*
wxArrayString PAGE_INFO::GetStandardSizes()
{
wxArrayString ret;
static const PAGE_INFO* stdPageSizes[] = {
&pageA4,
&pageA3,
&pageA2,
&pageA1,
&pageA0,
&pageA,
&pageB,
&pageC,
&pageD,
&pageE,
// &pageGERBER, // standard?
&pageUser,
};
for( unsigned i=0; i < DIM( stdPageSizes ); ++i )
ret.Add( stdPageSizes[i]->GetType() );
return ret;
}
*/
bool
PAGE_INFO
::
SetType
(
const
wxString
&
aType
)
{
...
...
@@ -252,9 +252,13 @@ bool PAGE_INFO::SetType( const wxString& aType )
*
this
=
pageGERBER
;
else
if
(
aType
==
pageUser
.
GetType
()
)
{
// pageUser is const, and may not and does not hold the custom size,
// so customize *this later
*
this
=
pageUser
;
m_widthInches
=
s_user_width
;
m_heightInches
=
s_user_height
;
// customize:
m_size
.
x
=
s_user_width
;
m_size
.
y
=
s_user_height
;
}
else
rc
=
false
;
...
...
@@ -263,22 +267,18 @@ bool PAGE_INFO::SetType( const wxString& aType )
}
PAGE_INFO
::
PAGE_INFO
(
const
wxSize
&
aSizeMils
,
const
wxString
&
aType
)
PAGE_INFO
::
PAGE_INFO
(
const
wxSize
&
aSizeMils
,
const
wxString
&
aType
)
:
m_size
(
aSizeMils
)
{
// aSizeMils is in 1/1000th of an inch
SetWidthInches
(
aSizeMils
.
x
/
1000.0
);
SetHeightInches
(
aSizeMils
.
y
/
1000.0
);
m_type
=
aType
;
m_Type
=
aType
;
// Adjust the default value for margins to 400 mils (0,4 inch or 10 mm)
#if defined(KICAD_GOST)
m_
LeftM
argin
=
GOST_LEFTMARGIN
;
m_
RightM
argin
=
GOST_RIGHTMARGIN
;
m_
TopM
argin
=
GOST_TOPMARGIN
;
m_
BottomM
argin
=
GOST_BOTTOMMARGIN
;
m_
left_m
argin
=
GOST_LEFTMARGIN
;
m_
right_m
argin
=
GOST_RIGHTMARGIN
;
m_
top_m
argin
=
GOST_TOPMARGIN
;
m_
bottom_m
argin
=
GOST_BOTTOMMARGIN
;
#else
m_
LeftMargin
=
m_RightMargin
=
m_TopMargin
=
m_BottomM
argin
=
400
;
m_
left_margin
=
m_right_margin
=
m_top_margin
=
m_bottom_m
argin
=
400
;
#endif
}
...
...
@@ -289,42 +289,24 @@ PAGE_INFO::PAGE_INFO( const wxString& aType )
}
void
PAGE_INFO
::
SetWidthInches
(
double
aWidthInInches
)
{
// limit resolution to 1/1000th of an inch
int
mils
=
aWidthInInches
*
1000
+
0.5
;
m_widthInches
=
mils
/
1000.0
;
}
void
PAGE_INFO
::
SetHeightInches
(
double
aHeightInInches
)
{
// limit resolution to 1/1000th of an inch
int
mils
=
aHeightInInches
*
1000
+
0.5
;
m_heightInches
=
mils
/
1000.0
;
}
void
PAGE_INFO
::
SetUserWidthInches
(
double
aWidthInInches
)
void
PAGE_INFO
::
SetUserWidthMils
(
int
aWidthInMils
)
{
if
(
aWidthIn
Inches
<
6.
0
)
aWidthIn
Inches
=
6.
0
;
else
if
(
aWidthIn
Inches
>
44.
0
)
aWidthIn
Inches
=
44.
0
;
if
(
aWidthIn
Mils
<
600
0
)
aWidthIn
Mils
=
600
0
;
else
if
(
aWidthIn
Mils
>
4400
0
)
aWidthIn
Mils
=
4400
0
;
s_user_width
=
aWidthIn
Inche
s
;
s_user_width
=
aWidthIn
Mil
s
;
}
void
PAGE_INFO
::
SetUserHeight
Inches
(
double
aHeightInInche
s
)
void
PAGE_INFO
::
SetUserHeight
Mils
(
int
aHeightInMil
s
)
{
if
(
aHeightIn
Inches
<
4.
0
)
aHeightIn
Inches
=
4.
0
;
else
if
(
aHeightIn
Inches
>
44.
0
)
aHeightIn
Inches
=
44.
0
;
if
(
aHeightIn
Mils
<
400
0
)
aHeightIn
Mils
=
400
0
;
else
if
(
aHeightIn
Mils
>
4400
0
)
aHeightIn
Mils
=
4400
0
;
s_user_height
=
aHeightIn
Inche
s
;
s_user_height
=
aHeightIn
Mil
s
;
}
...
...
common/dialogs/dialog_page_settings.cpp
View file @
1393eb0f
...
...
@@ -79,8 +79,8 @@ void DIALOG_PAGES_SETTINGS::initDialog()
switch
(
g_UserUnit
)
{
case
MILLIMETRES
:
userSizeX
=
m_user_size
.
GetWidth
Inches
()
*
25.4
;
userSizeY
=
m_user_size
.
GetHeight
Inches
()
*
25.4
;
userSizeX
=
m_user_size
.
GetWidth
Mils
()
*
25.4e-3
;
userSizeY
=
m_user_size
.
GetHeight
Mils
()
*
25.4e-3
;
msg
.
Printf
(
wxT
(
"%.2f"
),
userSizeX
);
m_TextUserSizeX
->
SetValue
(
msg
);
...
...
@@ -91,8 +91,8 @@ void DIALOG_PAGES_SETTINGS::initDialog()
default
:
case
INCHES
:
userSizeX
=
m_user_size
.
GetWidth
Inches
()
;
userSizeY
=
m_user_size
.
GetHeight
Inches
()
;
userSizeX
=
m_user_size
.
GetWidth
Mils
()
/
1000.0
;
userSizeY
=
m_user_size
.
GetHeight
Mils
()
/
1000.0
;
msg
.
Printf
(
wxT
(
"%.3f"
),
userSizeX
);
m_TextUserSizeX
->
SetValue
(
msg
);
...
...
@@ -101,10 +101,10 @@ void DIALOG_PAGES_SETTINGS::initDialog()
m_TextUserSizeY
->
SetValue
(
msg
);
break
;
/* // you want it in
1/1000ths of an inch
, why?
/* // you want it in
mils
, why?
case UNSCALED_UNITS:
userSizeX = m_user_size.GetWidth
Inches() * 1000
;
userSizeY = m_user_size.GetHeight
Inches() * 1000
;
userSizeX = m_user_size.GetWidth
Mils()
;
userSizeY = m_user_size.GetHeight
Mils()
;
msg.Printf( wxT( "%f" ), m_userSizeX );
m_TextUserSizeX->SetValue( msg );
msg.Printf( wxT( "%f" ), m_userSizeY );
...
...
@@ -204,20 +204,20 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings( wxCommandEvent& event )
switch
(
g_UserUnit
)
{
case
MILLIMETRES
:
PAGE_INFO
::
SetUserWidth
Inches
(
userSizeX
/
25.4
);
PAGE_INFO
::
SetUserHeight
Inches
(
userSizeY
/
25.4
);
PAGE_INFO
::
SetUserWidth
Mils
(
int
(
userSizeX
*
1000.0
/
25.4
)
);
PAGE_INFO
::
SetUserHeight
Mils
(
int
(
userSizeY
*
1000.0
/
25.4
)
);
break
;
default
:
case
INCHES
:
PAGE_INFO
::
SetUserWidth
Inches
(
userSizeX
);
PAGE_INFO
::
SetUserHeight
Inches
(
userSizeY
);
PAGE_INFO
::
SetUserWidth
Mils
(
int
(
1000
*
userSizeX
)
);
PAGE_INFO
::
SetUserHeight
Mils
(
int
(
1000
*
userSizeY
)
);
break
;
/* // set in 1/1000ths of an inch, but why?
case UNSCALED_UNITS:
PAGE_INFO::SetUserWidth
Inches( userSizeX /1000
);
PAGE_INFO::SetUserHeight
Inches( userSizeY /1000
);
PAGE_INFO::SetUserWidth
Mils( (int) userSizeX
);
PAGE_INFO::SetUserHeight
Mils( (int) userSizeY
);
break;
*/
}
...
...
eeschema/dialogs/dialog_SVG_print.cpp
View file @
1393eb0f
...
...
@@ -238,7 +238,6 @@ bool DIALOG_SVG_PRINT::DrawSVGPage( EDA_DRAW_FRAME* frame,
screen
->
m_IsPrinting
=
false
;
panel
->
m_ClipBox
=
tmp
;
GRForceBlackPen
(
false
);
screen
->
m_StartVisu
=
tmp_startvisu
;
...
...
eeschema/dialogs/dialog_plot_schematic_HPGL.cpp
View file @
1393eb0f
...
...
@@ -100,7 +100,7 @@ private:
void
OnPlotCurrent
(
wxCommandEvent
&
event
);
void
OnPlotAll
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
Accept
p
lotOffset
(
wxCommandEvent
&
event
);
void
Accept
P
lotOffset
(
wxCommandEvent
&
event
);
void
initDlg
();
void
SetPenSpeed
();
...
...
@@ -119,7 +119,7 @@ private:
// static members (static to remember last state):
HPGL_PAGEZ_T
DIALOG_PLOT_SCHEMATIC_HPGL
::
s_pageSizeSelect
=
PAGE_DEFAULT
;
bool
DIALOG_PLOT_SCHEMATIC_HPGL
::
s_plot_Sheet_Ref
=
true
;
wxSize
DIALOG_PLOT_SCHEMATIC_HPGL
::
s_Offset
;
void
SCH_EDIT_FRAME
::
ToPlot_HPGL
(
wxCommandEvent
&
event
)
{
...
...
@@ -202,7 +202,7 @@ void DIALOG_PLOT_SCHEMATIC_HPGL::SetPageOffsetValue()
}
void
DIALOG_PLOT_SCHEMATIC_HPGL
::
Accept
p
lotOffset
(
wxCommandEvent
&
event
)
void
DIALOG_PLOT_SCHEMATIC_HPGL
::
Accept
P
lotOffset
(
wxCommandEvent
&
event
)
{
s_pageSizeSelect
=
(
HPGL_PAGEZ_T
)
m_SizeOption
->
GetSelection
();
...
...
eeschema/dialogs/dialog_print_using_printer.cpp
View file @
1393eb0f
...
...
@@ -95,7 +95,7 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( SCH_EDIT_FRAME* aParent
m_checkMonochrome
->
SetValue
(
aParent
->
GetPrintMonochrome
()
);
#ifdef __WXMAC__
/
* Problems with modal on wx-2.9 - Anyway preview is standard for OSX */
/
/ Problems with modal on wx-2.9 - Anyway preview is standard for OSX
m_buttonPreview
->
Hide
();
#endif
}
...
...
@@ -310,7 +310,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
{
int
oldZoom
;
wxPoint
tmp_startvisu
;
wxSize
SheetSize
;
// Page size in internal units
wxSize
pageSizeIU
;
// Page size in internal units
wxPoint
old_org
;
EDA_RECT
oldClipBox
;
wxRect
fitRect
;
...
...
@@ -320,13 +320,13 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
wxBusyCursor
dummy
;
/
* Save current scale factor, offsets, and clip box. */
/
/ Save current scale factor, offsets, and clip box.
tmp_startvisu
=
aScreen
->
m_StartVisu
;
oldZoom
=
aScreen
->
GetZoom
();
old_org
=
aScreen
->
m_DrawOrg
;
oldClipBox
=
panel
->
m_ClipBox
;
/
* Change scale factor, offsets, and clip box to print the whole page. */
/
/ Change scale factor, offsets, and clip box to print the whole page.
panel
->
m_ClipBox
.
SetOrigin
(
wxPoint
(
0
,
0
)
);
panel
->
m_ClipBox
.
SetSize
(
wxSize
(
0x7FFFFF0
,
0x7FFFFF0
)
);
...
...
@@ -346,16 +346,17 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
wxLogDebug
(
wxT
(
"MinX = %d, MaxX = %d, MinY = %d, MaxY = %d"
),
memDC
.
MinX
(),
memDC
.
MaxX
(),
memDC
.
MinY
(),
memDC
.
MaxY
()
);
SheetSize
.
x
=
memDC
.
MaxX
()
-
memDC
.
MinX
();
SheetSize
.
y
=
memDC
.
MaxY
()
-
memDC
.
MinY
();
pageSizeIU
.
x
=
memDC
.
MaxX
()
-
memDC
.
MinX
();
pageSizeIU
.
y
=
memDC
.
MaxY
()
-
memDC
.
MinY
();
FitThisSizeToPageMargins
(
SheetSize
,
parent
->
GetPageSetupData
()
);
FitThisSizeToPageMargins
(
pageSizeIU
,
parent
->
GetPageSetupData
()
);
fitRect
=
GetLogicalPageMarginsRect
(
parent
->
GetPageSetupData
()
);
}
else
{
SheetSize
=
aScreen
->
m_CurrentSheetDesc
->
m_Size
;
FitThisSizeToPaper
(
SheetSize
);
pageSizeIU
=
aScreen
->
GetPageSettings
().
GetSizeIU
();
FitThisSizeToPaper
(
pageSizeIU
);
fitRect
=
GetLogicalPaperRect
();
}
...
...
eeschema/eeschema_config.cpp
View file @
1393eb0f
...
...
@@ -77,7 +77,7 @@ void LIB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
break
;
/
* Hotkey IDs */
/
/ Hotkey IDs
case
ID_PREFERENCES_HOTKEY_SHOW_EDITOR
:
InstallHotkeyFrame
(
this
,
s_Eeschema_Hokeys_Descr
);
break
;
...
...
@@ -145,7 +145,7 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
break
;
/
* Hotkey IDs */
/
/ Hotkey IDs
case
ID_PREFERENCES_HOTKEY_EXPORT_CONFIG
:
ExportHotkeyConfigToFile
(
s_Eeschema_Hokeys_Descr
);
break
;
...
...
@@ -267,7 +267,7 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
NET_TYPE_PCBNEW
,
NET_TYPE_CUSTOM_MAX
)
);
/
* NOTE: Left as global until supporting code can be fixed. */
/
/ NOTE: Left as global until supporting code can be fixed.
m_projectFileParams
.
push_back
(
new
PARAM_CFG_INT
(
wxT
(
"HPGLSpd"
),
&
g_HPGL_Pen_Descr
.
m_Pen_Speed
,
20
,
2
,
45
)
);
...
...
@@ -277,6 +277,8 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
m_projectFileParams
.
push_back
(
new
PARAM_CFG_INT
(
wxT
(
"HPGLNum"
),
&
g_HPGL_Pen_Descr
.
m_Pen_Num
,
1
,
1
,
8
)
);
/* these globals don't exist
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offX_A4" ),
&g_Sheet_A4.m_Offset.x ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_A4" ),
...
...
@@ -317,6 +319,8 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters()
&g_Sheet_E.m_Offset.x ) );
m_projectFileParams.push_back( new PARAM_CFG_INT( wxT( "offY_E" ),
&g_Sheet_E.m_Offset.y ) );
*/
m_projectFileParams
.
push_back
(
new
PARAM_CFG_INT
(
wxT
(
"RptD_X"
),
&
g_RepeatStep
.
x
,
0
,
-
1000
,
+
1000
)
);
...
...
@@ -362,7 +366,7 @@ bool SCH_EDIT_FRAME::LoadProjectFile( const wxString& aFileName, bool aForceRere
IsRead
=
false
;
}
/
* User library path takes precedent over default library search paths. */
/
/ User library path takes precedent over default library search paths.
wxGetApp
().
InsertLibraryPath
(
m_userLibraryPath
,
1
);
/* If the list is void, force loading the library "power.lib" that is
...
...
@@ -382,7 +386,7 @@ void SCH_EDIT_FRAME::SaveProjectFile()
{
wxFileName
fn
;
fn
=
g_RootSheet
->
GetScreen
()
->
GetFileName
();
/
*ConfigFileName*/
fn
=
g_RootSheet
->
GetScreen
()
->
GetFileName
();
/
/ConfigFileName
fn
.
SetExt
(
ProjectFileExtension
);
if
(
!
IsWritable
(
fn
)
)
...
...
@@ -528,7 +532,7 @@ void SCH_EDIT_FRAME::LoadSettings()
cfg
->
Read
(
ShowHiddenPinsEntry
,
&
m_showAllPins
,
false
);
cfg
->
Read
(
HorzVertLinesOnlyEntry
,
&
g_HVLines
,
true
);
/
* Load print preview window session settings. */
/
/ Load print preview window session settings.
cfg
->
Read
(
PreviewFramePositionXEntry
,
&
tmp
,
-
1
);
m_previewPosition
.
x
=
(
int
)
tmp
;
cfg
->
Read
(
PreviewFramePositionYEntry
,
&
tmp
,
-
1
);
...
...
@@ -538,7 +542,7 @@ void SCH_EDIT_FRAME::LoadSettings()
cfg
->
Read
(
PreviewFrameHeightEntry
,
&
tmp
,
-
1
);
m_previewSize
.
SetHeight
(
(
int
)
tmp
);
/
* Load print dialog session settings. */
/
/ Load print dialog session settings.
cfg
->
Read
(
PrintDialogPositionXEntry
,
&
tmp
,
-
1
);
m_printDialogPosition
.
x
=
(
int
)
tmp
;
cfg
->
Read
(
PrintDialogPositionYEntry
,
&
tmp
,
-
1
);
...
...
@@ -552,7 +556,7 @@ void SCH_EDIT_FRAME::LoadSettings()
cfg
->
Read
(
SpiceNetNamesEntry
,
&
g_OptNetListUseNames
,
false
);
cfg
->
Read
(
SimulatorCommandEntry
,
&
m_simulatorCommand
);
/
* Load find dialog session setting. */
/
/ Load find dialog session setting.
cfg
->
Read
(
FindDialogPositionXEntry
,
&
tmp
,
-
1
);
m_findDialogPosition
.
x
=
(
int
)
tmp
;
cfg
->
Read
(
FindDialogPositionYEntry
,
&
tmp
,
-
1
);
...
...
@@ -568,7 +572,7 @@ void SCH_EDIT_FRAME::LoadSettings()
m_findReplaceData
->
SetFindString
(
cfg
->
Read
(
FindStringEntry
,
wxEmptyString
)
);
m_findReplaceData
->
SetReplaceString
(
cfg
->
Read
(
ReplaceStringEntry
,
wxEmptyString
)
);
/
* Load the find and replace string history list. */
/
/ Load the find and replace string history list.
for
(
size_t
i
=
0
;
i
<
FR_HISTORY_LIST_CNT
;
i
++
)
{
wxString
tmpHistory
;
...
...
@@ -619,13 +623,13 @@ void SCH_EDIT_FRAME::SaveSettings()
cfg
->
Write
(
ShowHiddenPinsEntry
,
m_showAllPins
);
cfg
->
Write
(
HorzVertLinesOnlyEntry
,
g_HVLines
);
/
* Save print preview window session settings. */
/
/ Save print preview window session settings.
cfg
->
Write
(
PreviewFramePositionXEntry
,
m_previewPosition
.
x
);
cfg
->
Write
(
PreviewFramePositionYEntry
,
m_previewPosition
.
y
);
cfg
->
Write
(
PreviewFrameWidthEntry
,
m_previewSize
.
GetWidth
()
);
cfg
->
Write
(
PreviewFrameHeightEntry
,
m_previewSize
.
GetHeight
()
);
/
* Save print dialog session settings. */
/
/ Save print dialog session settings.
cfg
->
Write
(
PrintDialogPositionXEntry
,
m_printDialogPosition
.
x
);
cfg
->
Write
(
PrintDialogPositionYEntry
,
m_printDialogPosition
.
y
);
cfg
->
Write
(
PrintDialogWidthEntry
,
m_printDialogSize
.
GetWidth
()
);
...
...
@@ -635,7 +639,7 @@ void SCH_EDIT_FRAME::SaveSettings()
cfg
->
Write
(
SpiceNetNamesEntry
,
g_OptNetListUseNames
);
cfg
->
Write
(
SimulatorCommandEntry
,
m_simulatorCommand
);
/
* Save find dialog session setting. */
/
/ Save find dialog session setting.
cfg
->
Write
(
FindDialogPositionXEntry
,
m_findDialogPosition
.
x
);
cfg
->
Write
(
FindDialogPositionYEntry
,
m_findDialogPosition
.
y
);
cfg
->
Write
(
FindDialogWidthEntry
,
m_findDialogSize
.
GetWidth
()
);
...
...
@@ -647,7 +651,7 @@ void SCH_EDIT_FRAME::SaveSettings()
cfg
->
Write
(
FindStringEntry
,
m_findReplaceData
->
GetFindString
()
);
cfg
->
Write
(
ReplaceStringEntry
,
m_findReplaceData
->
GetReplaceString
()
);
/
* Save the find and replace string history list. */
/
/ Save the find and replace string history list.
size_t
i
;
wxString
tmpHistory
;
wxString
entry
;
// invoke constructor outside of any loops
...
...
eeschema/files-io.cpp
View file @
1393eb0f
...
...
@@ -244,7 +244,10 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
if
(
aIsNew
)
{
screen
->
m_CurrentSheetDesc
=
&
g_Sheet_A4
;
/* SCH_SCREEN constructor does this now
screen->SetPageSettings( PAGE_INFO( wxT( "A4" ) ) );
*/
screen
->
SetZoom
(
32
);
screen
->
SetGrid
(
ID_POPUP_GRID_LEVEL_1000
+
m_LastGridSizeId
);
screen
->
m_Title
=
NAMELESS_PROJECT
;
...
...
eeschema/libedit_plot_component.cpp
View file @
1393eb0f
...
...
@@ -33,54 +33,71 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
switch
(
event
.
GetId
()
)
{
case
ID_LIBEDIT_GEN_PNG_FILE
:
{
bool
fmt_is_jpeg
=
false
;
// could be selectable later. so keep this option.
file_ext
=
fmt_is_jpeg
?
wxT
(
"jpg"
)
:
wxT
(
"png"
);
mask
=
wxT
(
"*."
)
+
file_ext
;
wxFileName
fn
(
cmp
->
GetName
()
);
fn
.
SetExt
(
file_ext
);
FullFileName
=
EDA_FileSelector
(
_
(
"Filename:"
),
wxGetCwd
(),
fn
.
GetFullName
(),
file_ext
,
mask
,
this
,
wxFD_SAVE
,
true
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
// calling wxYield is mandatory under Linux, after closing the file selector dialog
// to refresh the screen before creating the PNG or JPEG image from screen
wxYield
();
CreatePNGorJPEGFile
(
FullFileName
,
fmt_is_jpeg
);
}
{
bool
fmt_is_jpeg
=
false
;
// could be selectable later. so keep this option.
file_ext
=
fmt_is_jpeg
?
wxT
(
"jpg"
)
:
wxT
(
"png"
);
mask
=
wxT
(
"*."
)
+
file_ext
;
wxFileName
fn
(
cmp
->
GetName
()
);
fn
.
SetExt
(
file_ext
);
FullFileName
=
EDA_FileSelector
(
_
(
"Filename:"
),
wxGetCwd
(),
fn
.
GetFullName
(),
file_ext
,
mask
,
this
,
wxFD_SAVE
,
true
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
// calling wxYield is mandatory under Linux, after closing the file selector dialog
// to refresh the screen before creating the PNG or JPEG image from screen
wxYield
();
CreatePNGorJPEGFile
(
FullFileName
,
fmt_is_jpeg
);
}
break
;
case
ID_LIBEDIT_GEN_SVG_FILE
:
{
file_ext
=
wxT
(
"svg"
);
mask
=
wxT
(
"*."
)
+
file_ext
;
wxFileName
fn
(
cmp
->
GetName
()
);
fn
.
SetExt
(
file_ext
);
FullFileName
=
EDA_FileSelector
(
_
(
"Filename:"
),
wxGetCwd
(),
fn
.
GetFullName
(),
file_ext
,
mask
,
this
,
wxFD_SAVE
,
true
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
/* Give a size to the SVG draw area = component size + margin
* the margin is 10% the size of the component size
*/
wxSize
pagesize
=
GetScreen
()
->
ReturnPageSize
(
);
wxSize
componentSize
=
m_component
->
GetBoundingBox
(
m_unit
,
m_convert
).
GetSize
();
// Add a small margin to the plot bounding box
componentSize
.
x
=
(
int
)(
componentSize
.
x
*
1.2
);
componentSize
.
y
=
(
int
)(
componentSize
.
y
*
1.2
);
GetScreen
()
->
SetPageSize
(
componentSize
);
SVG_Print_Component
(
FullFileName
);
GetScreen
()
->
SetPageSize
(
pagesize
);
}
{
file_ext
=
wxT
(
"svg"
);
mask
=
wxT
(
"*."
)
+
file_ext
;
wxFileName
fn
(
cmp
->
GetName
()
);
fn
.
SetExt
(
file_ext
);
FullFileName
=
EDA_FileSelector
(
_
(
"Filename:"
),
wxGetCwd
(),
fn
.
GetFullName
(),
file_ext
,
mask
,
this
,
wxFD_SAVE
,
true
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
#if 0 // would the PAGE_INFO margins work for this old code:
// Give a size to the SVG draw area = component size + margin
// the margin is 10% the size of the component size
wxSize pagesize = GetScreen()->ReturnPageSize( );
wxSize componentSize = m_component->GetBoundingBox( m_unit, m_convert ).GetSize();
// Add a small margin to the plot bounding box
componentSize.x = (int)(componentSize.x * 1.2);
componentSize.y = (int)(componentSize.y * 1.2);
GetScreen()->SetPageSize( componentSize );
SVG_Print_Component( FullFileName );
GetScreen()->SetPageSize( pagesize );
#else
PAGE_INFO
pageSave
=
GetScreen
()
->
GetPageSettings
();
PAGE_INFO
pageTemp
=
pageSave
;
wxSize
componentSize
=
m_component
->
GetBoundingBox
(
m_unit
,
m_convert
).
GetSize
();
// Add a small margin to the plot bounding box
pageTemp
.
SetWidthMils
(
int
(
componentSize
.
x
*
1.2
)
);
pageTemp
.
SetHeightMils
(
int
(
componentSize
.
y
*
1.2
)
);
GetScreen
()
->
SetPageSettings
(
pageTemp
);
SVG_Print_Component
(
FullFileName
);
GetScreen
()
->
SetPageSettings
(
pageSave
);
#endif
}
break
;
}
}
...
...
@@ -116,7 +133,8 @@ void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode
if
(
!
m_component
)
return
;
wxSize
pagesize
=
GetScreen
()
->
ReturnPageSize
();
wxSize
pagesize
=
GetScreen
()
->
GetPageSettings
().
GetSizeIU
();
/* Plot item centered to the page
* In libedit, the component is centered at 0,0 coordinates.
* So we must plot it with an offset = pagesize/2.
...
...
eeschema/libeditframe.cpp
View file @
1393eb0f
...
...
@@ -209,7 +209,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
SetIcon
(
icon
);
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
SetScreen
(
new
SCH_SCREEN
()
);
GetScreen
()
->
m_Center
=
true
;
...
...
@@ -287,6 +287,39 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
}
void
LIB_EDIT_FRAME
::
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
)
{
GetScreen
()
->
SetPageSettings
(
aPageSettings
);
}
const
PAGE_INFO
&
LIB_EDIT_FRAME
::
GetPageSettings
()
const
{
return
GetScreen
()
->
GetPageSettings
();
}
const
wxSize
LIB_EDIT_FRAME
::
GetPageSizeIU
()
const
{
// GetSizeIU is compile time dependent:
return
GetScreen
()
->
GetPageSettings
().
GetSizeIU
();
}
const
wxPoint
&
LIB_EDIT_FRAME
::
GetOriginAxisPosition
()
const
{
wxASSERT
(
GetScreen
()
);
return
GetScreen
()
->
GetOriginAxisPosition
();
}
void
LIB_EDIT_FRAME
::
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
)
{
wxASSERT
(
GetScreen
()
);
GetScreen
()
->
SetOriginAxisPosition
(
aPosition
);
}
void
LIB_EDIT_FRAME
::
LoadSettings
()
{
wxConfig
*
cfg
;
...
...
@@ -379,8 +412,11 @@ double LIB_EDIT_FRAME::BestZoom()
}
else
{
dx
=
GetScreen
()
->
m_CurrentSheetDesc
->
m_Size
.
x
;
dy
=
GetScreen
()
->
m_CurrentSheetDesc
->
m_Size
.
y
;
const
PAGE_INFO
&
pageInfo
=
GetScreen
()
->
GetPageSettings
();
dx
=
pageInfo
.
GetSizeIU
().
x
;
dy
=
pageInfo
.
GetSizeIU
().
y
;
GetScreen
()
->
SetScrollCenterPosition
(
wxPoint
(
0
,
0
)
);
}
...
...
eeschema/libeditframe.h
View file @
1393eb0f
...
...
@@ -257,7 +257,17 @@ public:
double
BestZoom
();
// Returns the best zoom
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
SCH_SCREEN
*
GetScreen
()
{
return
(
SCH_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
SCH_SCREEN
*
GetScreen
()
const
{
return
(
SCH_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
// note: a common base class shared between LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME
// would allow sharing of these 5 functions:
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
);
// overload EDA_DRAW_FRAME
const
PAGE_INFO
&
GetPageSettings
()
const
;
// overload EDA_DRAW_FRAME
const
wxSize
GetPageSizeIU
()
const
;
// overload EDA_DRAW_FRAME
const
wxPoint
&
GetOriginAxisPosition
()
const
;
// overload EDA_DRAW_FRAME
void
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
);
// overload EDA_DRAW_FRAME
void
OnHotKey
(
wxDC
*
aDC
,
int
aHotKey
,
const
wxPoint
&
aPosition
,
EDA_ITEM
*
aItem
=
NULL
);
...
...
eeschema/load_one_schematic_file.cpp
View file @
1393eb0f
...
...
@@ -48,7 +48,7 @@
#include "sch_bitmap.h"
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE
_SCREEN
*
Window
);
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
SCH
_SCREEN
*
Window
);
static
void
LoadLayers
(
LINE_READER
*
aLine
);
...
...
@@ -300,45 +300,20 @@ static void LoadLayers( LINE_READER* aLine )
/* Read the schematic header. */
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
BASE
_SCREEN
*
aScreen
)
bool
ReadSchemaDescr
(
LINE_READER
*
aLine
,
wxString
&
aMsgDiag
,
SCH
_SCREEN
*
aScreen
)
{
char
T
ext
[
256
];
char
t
ext
[
256
];
char
buf
[
1024
];
int
ii
;
PAGE_INFO
*
wsheet
=
&
g_Sheet_A4
;
wxSize
PageSize
;
char
*
line
;
static
PAGE_INFO
*
SheetFormatList
[]
=
{
&
g_Sheet_A4
,
&
g_Sheet_A3
,
&
g_Sheet_A2
,
&
g_Sheet_A1
,
&
g_Sheet_A0
,
&
g_Sheet_A
,
&
g_Sheet_B
,
&
g_Sheet_C
,
&
g_Sheet_D
,
&
g_Sheet_E
,
&
g_Sheet_user
,
NULL
};
line
=
aLine
->
Line
();
wxSize
pageSize
;
char
*
line
=
aLine
->
Line
();
sscanf
(
line
,
"%s %s %d %d"
,
Text
,
Text
,
&
PageSize
.
x
,
&
P
ageSize
.
y
);
sscanf
(
line
,
"%s %s %d %d"
,
text
,
text
,
&
pageSize
.
x
,
&
p
ageSize
.
y
);
wxString
pagename
=
FROM_UTF8
(
Text
);
for
(
ii
=
0
;
SheetFormatList
[
ii
]
!=
NULL
;
ii
++
)
{
wsheet
=
SheetFormatList
[
ii
];
if
(
wsheet
->
m_Name
.
CmpNoCase
(
pagename
)
==
0
)
/* Descr found ! */
{
// Get the user page size and make it the default
if
(
wsheet
==
&
g_Sheet_user
)
{
g_Sheet_user
.
m_Size
=
PageSize
;
}
wxString
pagename
=
FROM_UTF8
(
text
);
break
;
}
}
PAGE_INFO
pageInfo
;
if
(
SheetFormatList
[
ii
]
==
NULL
)
if
(
!
pageInfo
.
SetType
(
pagename
)
)
{
aMsgDiag
.
Printf
(
wxT
(
"Eeschema file dimension definition error \
line %d,
\a
Abort reading file.
\n
"
),
...
...
@@ -346,7 +321,13 @@ line %d, \aAbort reading file.\n" ),
aMsgDiag
<<
FROM_UTF8
(
line
);
}
aScreen
->
m_CurrentSheetDesc
=
wsheet
;
if
(
pagename
==
wxT
(
"User"
)
)
{
pageInfo
.
SetWidthMils
(
pageSize
.
x
);
pageInfo
.
SetHeightMils
(
pageSize
.
y
);
}
aScreen
->
SetPageSettings
(
pageInfo
);
for
(
;
;
)
{
...
...
eeschema/sch_screen.cpp
View file @
1393eb0f
...
...
@@ -97,14 +97,15 @@ static GRID_TYPE SchematicGridList[] = {
#define SCHEMATIC_GRID_LIST_CNT ( sizeof( SchematicGridList ) / sizeof( GRID_TYPE ) )
SCH_SCREEN
::
SCH_SCREEN
(
const
wxSize
&
aPageSizeIU
)
:
BASE_SCREEN
(
SCH_SCREEN_T
)
SCH_SCREEN
::
SCH_SCREEN
()
:
BASE_SCREEN
(
SCH_SCREEN_T
),
m_paper
(
wxT
(
"A4"
)
)
{
size_t
i
;
SetDrawItems
(
NULL
);
// Schematic items list
m_Zoom
=
32
;
SetZoom
(
32
)
;
for
(
i
=
0
;
i
<
SCHEMATIC_ZOOM_LIST_CNT
;
i
++
)
m_ZoomList
.
Add
(
SchematicZoomList
[
i
]
);
...
...
@@ -118,7 +119,7 @@ SCH_SCREEN::SCH_SCREEN( const wxSize& aPageSizeIU ) :
// Suitable for schematic only. For libedit and viewlib, must be set to true
m_Center
=
false
;
InitDataPoints
(
aPageSizeIU
);
InitDataPoints
(
m_paper
.
GetSizeIU
()
);
}
...
...
@@ -574,8 +575,8 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
* sheet ( ScreenNumber = 1 ) within the files
*/
if
(
fprintf
(
aFile
,
"$Descr %s %d %d
\n
"
,
TO_UTF8
(
m_
CurrentSheetDesc
->
m_Name
),
m_
CurrentSheetDesc
->
m_Size
.
x
,
m_CurrentSheetDesc
->
m_Size
.
y
)
<
0
if
(
fprintf
(
aFile
,
"$Descr %s %d %d
\n
"
,
TO_UTF8
(
m_
paper
.
GetType
()
),
m_
paper
.
GetWidthMils
(),
m_paper
.
GetHeightMils
()
)
<
0
||
fprintf
(
aFile
,
"encoding utf-8
\n
"
)
<
0
||
fprintf
(
aFile
,
"Sheet %d %d
\n
"
,
m_ScreenNumber
,
m_NumberOfScreen
)
<
0
||
fprintf
(
aFile
,
"Title %s
\n
"
,
EscapedUTF8
(
m_Title
).
c_str
()
)
<
0
...
...
eeschema/sch_sheet.cpp
View file @
1393eb0f
...
...
@@ -794,7 +794,7 @@ bool SCH_SHEET::Load( SCH_EDIT_FRAME* aFrame )
}
else
{
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
SetScreen
(
new
SCH_SCREEN
()
);
success
=
aFrame
->
LoadOneEEFile
(
m_screen
,
m_fileName
);
if
(
success
)
...
...
eeschema/sch_sheet.h
View file @
1393eb0f
...
...
@@ -243,6 +243,8 @@ typedef boost::ptr_vector<SCH_SHEET_PIN> SCH_SHEET_PINS;
*/
class
SCH_SHEET
:
public
SCH_ITEM
{
friend
class
SCH_SHEET_PIN
;
/// Screen that contains the physical data for the sheet. In complex hierarchies
/// multiple sheets can share a common screen.
SCH_SCREEN
*
m_screen
;
...
...
@@ -270,8 +272,6 @@ class SCH_SHEET : public SCH_ITEM
/// The size of the sheet.
wxSize
m_size
;
friend
class
SCH_SHEET_PIN
;
public
:
SCH_SHEET
(
const
wxPoint
&
pos
=
wxPoint
(
0
,
0
)
);
...
...
eeschema/schframe.cpp
View file @
1393eb0f
...
...
@@ -285,6 +285,39 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
}
void
SCH_EDIT_FRAME
::
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
)
{
GetScreen
()
->
SetPageSettings
(
aPageSettings
);
}
const
PAGE_INFO
&
SCH_EDIT_FRAME
::
GetPageSettings
()
const
{
return
GetScreen
()
->
GetPageSettings
();
}
const
wxSize
SCH_EDIT_FRAME
::
GetPageSizeIU
()
const
{
// GetSizeIU is compile time dependent:
return
GetScreen
()
->
GetPageSettings
().
GetSizeIU
();
}
const
wxPoint
&
SCH_EDIT_FRAME
::
GetOriginAxisPosition
()
const
{
wxASSERT
(
GetScreen
()
);
return
GetScreen
()
->
GetOriginAxisPosition
();
}
void
SCH_EDIT_FRAME
::
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
)
{
wxASSERT
(
GetScreen
()
);
GetScreen
()
->
SetOriginAxisPosition
(
aPosition
);
}
void
SCH_EDIT_FRAME
::
SetSheetNumberAndCount
()
{
SCH_SCREEN
*
screen
=
GetScreen
();
...
...
@@ -345,7 +378,7 @@ void SCH_EDIT_FRAME::CreateScreens()
if
(
g_RootSheet
->
GetScreen
()
==
NULL
)
{
g_RootSheet
->
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
g_RootSheet
->
SetScreen
(
new
SCH_SCREEN
()
);
SetScreen
(
g_RootSheet
->
GetScreen
()
);
}
...
...
@@ -355,7 +388,7 @@ void SCH_EDIT_FRAME::CreateScreens()
m_CurrentSheet
->
Push
(
g_RootSheet
);
if
(
GetScreen
()
==
NULL
)
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
SetScreen
(
new
SCH_SCREEN
()
);
GetScreen
()
->
SetZoom
(
32.0
);
GetScreen
()
->
m_UndoRedoCountMax
=
10
;
...
...
@@ -489,8 +522,8 @@ double SCH_EDIT_FRAME::BestZoom()
int
dx
,
dy
;
wxSize
size
;
dx
=
GetScreen
()
->
m_CurrentSheetDesc
->
m_Size
.
x
;
dy
=
GetScreen
()
->
m_CurrentSheetDesc
->
m_Size
.
y
;
dx
=
GetScreen
()
->
GetPageSettings
().
GetWidthIU
()
;
dy
=
GetScreen
()
->
GetPageSettings
().
GetHeightIU
()
;
size
=
m_canvas
->
GetClientSize
();
...
...
eeschema/sheet.cpp
View file @
1393eb0f
...
...
@@ -116,7 +116,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )
}
else
// New file.
{
aSheet
->
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
aSheet
->
SetScreen
(
new
SCH_SCREEN
()
);
aSheet
->
GetScreen
()
->
SetFileName
(
fileName
.
GetFullPath
()
);
}
}
...
...
eeschema/viewlib_frame.cpp
View file @
1393eb0f
...
...
@@ -125,7 +125,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( wxWindow* father, CMP_LIBRARY* Library, wxSemaph
if
(
m_Semaphore
)
MakeModal
(
true
);
SetScreen
(
new
SCH_SCREEN
(
GetPageSettings
().
GetSizeIU
()
)
);
SetScreen
(
new
SCH_SCREEN
()
);
GetScreen
()
->
m_Center
=
true
;
// Center coordinate origins on screen.
LoadSettings
();
...
...
@@ -265,6 +265,39 @@ LIB_VIEW_FRAME::~LIB_VIEW_FRAME()
}
void
LIB_VIEW_FRAME
::
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
)
{
GetScreen
()
->
SetPageSettings
(
aPageSettings
);
}
const
PAGE_INFO
&
LIB_VIEW_FRAME
::
GetPageSettings
()
const
{
return
GetScreen
()
->
GetPageSettings
();
}
const
wxSize
LIB_VIEW_FRAME
::
GetPageSizeIU
()
const
{
// GetSizeIU is compile time dependent:
return
GetScreen
()
->
GetPageSettings
().
GetSizeIU
();
}
const
wxPoint
&
LIB_VIEW_FRAME
::
GetOriginAxisPosition
()
const
{
wxASSERT
(
GetScreen
()
);
return
GetScreen
()
->
GetOriginAxisPosition
();
}
void
LIB_VIEW_FRAME
::
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
)
{
wxASSERT
(
GetScreen
()
);
GetScreen
()
->
SetOriginAxisPosition
(
aPosition
);
}
void
LIB_VIEW_FRAME
::
OnCloseWindow
(
wxCloseEvent
&
Event
)
{
SaveSettings
();
...
...
eeschema/viewlib_frame.h
View file @
1393eb0f
...
...
@@ -34,12 +34,11 @@
#include <wx/gdicmn.h>
#include "wxstruct.h"
#include "class_sch_screen.h"
class
wxSashLayoutWindow
;
class
wxListBox
;
class
wxSemaphore
;
class
SCH_SCREEN
;
class
CMP_LIBRARY
;
...
...
@@ -108,7 +107,17 @@ public:
void
ClickOnCmpList
(
wxCommandEvent
&
event
);
void
OnSetRelativeOffset
(
wxCommandEvent
&
event
);
SCH_SCREEN
*
GetScreen
()
{
return
(
SCH_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
SCH_SCREEN
*
GetScreen
()
const
{
return
(
SCH_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
// note: a common base class shared between LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME
// would allow sharing of these 5 functions:
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
);
// overload EDA_DRAW_FRAME
const
PAGE_INFO
&
GetPageSettings
()
const
;
// overload EDA_DRAW_FRAME
const
wxSize
GetPageSizeIU
()
const
;
// overload EDA_DRAW_FRAME
const
wxPoint
&
GetOriginAxisPosition
()
const
;
// overload EDA_DRAW_FRAME
void
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
);
// overload EDA_DRAW_FRAME
void
GeneralControl
(
wxDC
*
aDC
,
const
wxPoint
&
aPosition
,
int
aHotKey
=
0
);
...
...
include/class_base_screen.h
View file @
1393eb0f
...
...
@@ -142,8 +142,7 @@ public:
wxString
m_Commentaire3
;
wxString
m_Commentaire4
;
/* Grid and zoom values. */
wxPoint
m_GridOrigin
;
wxPoint
m_GridOrigin
;
wxArrayDouble
m_ZoomList
;
///< Array of standard zoom (i.e. scale) coefficients.
bool
m_IsPrinting
;
...
...
include/class_sch_screen.h
View file @
1393eb0f
...
...
@@ -65,7 +65,10 @@ class SCH_SCREEN : public BASE_SCREEN
///< Delete when it goes to zero.
/// The size of the paper to print or plot on
PAGE_INFO
m_paper
;
// keep with the MVC 'model' as this class gets split
PAGE_INFO
m_paper
;
// keep with the MVC 'model' if this class gets split
/// Position of the origin axis, which is used in exports mostly, but not yet in EESCHEMA
wxPoint
m_originAxisPosition
;
SCH_ITEM
*
m_drawList
;
///< Object list for the screen.
/// @todo use DLIST<SCH_ITEM> or superior container
...
...
@@ -86,9 +89,8 @@ public:
/**
* Constructor
* @param aPageSizeIU is the size of the initial paper page in internal units.
*/
SCH_SCREEN
(
const
wxSize
&
aPageSizeIU
);
SCH_SCREEN
();
~
SCH_SCREEN
();
...
...
@@ -100,6 +102,9 @@ public:
const
PAGE_INFO
&
GetPageSettings
()
const
{
return
m_paper
;
}
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
)
{
m_paper
=
aPageSettings
;
}
const
wxPoint
&
GetOriginAxisPosition
()
const
{
return
m_originAxisPosition
;
}
void
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
)
{
m_originAxisPosition
=
aPosition
;
}
void
DecRefCount
();
void
IncRefCount
();
...
...
include/common.h
View file @
1393eb0f
...
...
@@ -126,13 +126,15 @@ enum EDA_UNITS_T {
class
LibNameList
;
class
PAGE_INFO
;
//
class PAGE_INFO;
/**
* Class PAGE_INFO
* describes the page size and margins of a paper page on which to
* eventually print or plot. Here paper is described in inches, but
* accessors for mils, and internal units (IU) are supported.
* eventually print or plot. Paper sizes are often described in inches.
* Here paper is described in 1/1000th of an inch (mils). For convenience
* there are some read only accessors for internal units (IU), which is a compile
* time calculation, not runtime.
*
* @author Dick Hollenbeck
*/
...
...
@@ -142,7 +144,7 @@ public:
PAGE_INFO
(
const
wxString
&
aType
=
wxT
(
"A3"
)
);
PAGE_INFO
(
const
wxSize
&
aSizeMils
,
const
wxString
&
aName
);
const
wxString
&
GetType
()
const
{
return
m_
T
ype
;
}
const
wxString
&
GetType
()
const
{
return
m_
t
ype
;
}
/**
* Function SetType
...
...
@@ -152,80 +154,99 @@ public:
* @param aStandardPageDescriptionName is a wxString constant giving one of:
* "A4" "A3" "A2" "A1" "A0" "A" "B" "C" "D" "E" "GERBER", or "User". If "User"
* then the width and height are custom, and will be set according to previous calls
* to static PAGE_INFO::SetUserWidth
Inches( double aWidthInInches
) and
* static PAGE_INFO::SetUserHeight
Inches( double aHeightInInches
);
* to static PAGE_INFO::SetUserWidth
Mils(
) and
* static PAGE_INFO::SetUserHeight
Mils(
);
*
* @return bool - true iff @a aStandarePageDescription was a recognized type.
*/
bool
SetType
(
const
wxString
&
aStandardPageDescriptionName
);
void
SetWidth
Inches
(
double
aWidthInInches
);
void
SetHeightInches
(
double
aHeightInInches
);
void
SetWidth
Mils
(
int
aWidthInMils
)
{
m_size
.
x
=
aWidthInMils
;
}
int
GetWidthMils
()
const
{
return
m_size
.
x
;
}
double
GetWidthInches
()
const
{
return
m_widthInches
;
}
double
GetHeightInches
()
const
{
return
m_heightInches
;
}
void
SetHeightMils
(
int
aHeightInMils
)
{
m_size
.
y
=
aHeightInMils
;
}
int
GetHeightMils
()
const
{
return
m_size
.
y
;
}
int
GetWidthMils
()
const
{
return
int
(
1000
*
m_widthInches
);
}
int
GetHeightMils
()
const
{
return
int
(
1000
*
m_heightInches
);
}
const
wxSize
GetSizeMils
()
const
{
return
wxSize
(
GetWidthMils
(),
GetHeightMils
()
);
}
const
wxSize
&
GetSizeMils
()
const
{
return
m_size
;
}
// Accessors returning "Internal Units (IU)". IUs are mils in EESCHEMA,
// and either deci-mils or nanometers in PCBNew.
#if defined(PCBNEW)
# if defined(KICAD_NANOMETRE)
int
GetWidthIU
()
const
{
return
int
(
2.54e
7
*
m_widthInches
);
}
int
GetHeightIU
()
const
{
return
int
(
2.54e
7
*
m_heightInches
);
}
int
GetWidthIU
()
const
{
return
int
(
2.54e
4
*
GetWidthMils
()
);
}
int
GetHeightIU
()
const
{
return
int
(
2.54e
4
*
GetHeightMils
()
);
}
# else
int
GetWidthIU
()
const
{
return
int
(
10
000
*
m_widthInches
);
}
int
GetHeightIU
()
const
{
return
int
(
10
000
*
m_heightInches
);
}
int
GetWidthIU
()
const
{
return
int
(
10
*
GetWidthMils
()
);
}
int
GetHeightIU
()
const
{
return
int
(
10
*
GetHeightMils
()
);
}
# endif
const
wxSize
GetSizeIU
()
const
{
return
wxSize
(
GetWidthIU
(),
GetHeightIU
()
);
}
#elif defined(EESCHEMA)
int
GetWidthIU
()
const
{
return
int
(
1000
*
m_widthInches
);
}
int
GetHeightIU
()
const
{
return
int
(
1000
*
m_heightInches
);
}
int
GetWidthIU
()
const
{
return
GetWidthMils
(
);
}
int
GetHeightIU
()
const
{
return
GetHeightMils
(
);
}
const
wxSize
GetSizeIU
()
const
{
return
wxSize
(
GetWidthIU
(),
GetHeightIU
()
);
}
#endif
// wxPoint GetOffsetMils() const { return m_Offset; }
int
GetLeftMarginMils
()
const
{
return
m_LeftMargin
;
}
int
GetRightMarginMils
()
const
{
return
m_RightMargin
;
}
int
GetTopMarginMils
()
const
{
return
m_TopMargin
;
}
int
GetBottomMarginMils
()
const
{
return
m_BottomMargin
;
}
int
GetLeftMarginMils
()
const
{
return
m_left_margin
;
}
int
GetRightMarginMils
()
const
{
return
m_right_margin
;
}
int
GetTopMarginMils
()
const
{
return
m_top_margin
;
}
int
GetBottomMarginMils
()
const
{
return
m_bottom_margin
;
}
void
SetLeftMarginMils
(
int
aMargin
)
{
m_left_margin
=
aMargin
;
}
void
SetRightMarginMils
(
int
aMargin
)
{
m_right_margin
=
aMargin
;
}
void
SetTopMarginMils
(
int
aMargin
)
{
m_top_margin
=
aMargin
;
}
void
SetBottomMarginMils
(
int
aMargin
)
{
m_bottom_margin
=
aMargin
;
}
/**
* Function SetUserWidth
Inche
s
* sets the width of type "User" page in
inche
s.
* Function SetUserWidth
Mil
s
* sets the width of type "User" page in
mil
s.
*/
static
void
SetUserWidth
Inches
(
double
aWidthInInche
s
);
static
void
SetUserWidth
Mils
(
int
aWidthInMil
s
);
/**
* Function SetUserHeight
Inche
s
* sets the height type "User" page in
inche
s.
* Function SetUserHeight
Mil
s
* sets the height type "User" page in
mil
s.
*/
static
void
SetUserHeight
Inches
(
double
aHeightInInche
s
);
static
void
SetUserHeight
Mils
(
int
aHeightInMil
s
);
/**
* Function GetStandardSizes
* returns the standard page types, such as "A4", "A3", etc.
*/
static wxArrayString GetStandardSizes();
*/
private
:
wxString
m_Type
;
///< paper type: A4, A3, etc.
double
m_widthInches
;
double
m_heightInches
;
// standard pre-defined sizes
static
const
PAGE_INFO
pageA4
;
static
const
PAGE_INFO
pageA3
;
static
const
PAGE_INFO
pageA2
;
static
const
PAGE_INFO
pageA1
;
static
const
PAGE_INFO
pageA0
;
static
const
PAGE_INFO
pageA
;
static
const
PAGE_INFO
pageB
;
static
const
PAGE_INFO
pageC
;
static
const
PAGE_INFO
pageD
;
static
const
PAGE_INFO
pageE
;
static
const
PAGE_INFO
pageGERBER
;
static
const
PAGE_INFO
pageUser
;
// all dimensions here are in mils
wxString
m_type
;
///< paper type: A4, A3, etc.
wxSize
m_size
;
///< mils
// wxPoint m_
Offset; ///< plot offset in 1/1000 inche
s
// wxPoint m_
offset_mils; ///< plot offset in mil
s
int
m_
LeftM
argin
;
int
m_
RightM
argin
;
int
m_
TopM
argin
;
int
m_
BottomM
argin
;
int
m_
left_m
argin
;
int
m_
right_m
argin
;
int
m_
top_m
argin
;
int
m_
bottom_m
argin
;
static
double
s_user_height
;
static
double
s_user_width
;
static
int
s_user_height
;
static
int
s_user_width
;
};
...
...
include/wxBasePcbFrame.h
View file @
1393eb0f
...
...
@@ -133,8 +133,6 @@ public:
return
m_Pcb
;
}
BOARD_DESIGN_SETTINGS
*
GetDesignSettings
();
// General
virtual
void
OnCloseWindow
(
wxCloseEvent
&
Event
)
=
0
;
virtual
void
RedrawActiveWindow
(
wxDC
*
DC
,
bool
EraseBg
)
{
}
...
...
@@ -147,10 +145,7 @@ public:
virtual
void
SetToolID
(
int
aId
,
int
aCursor
,
const
wxString
&
aToolMsg
);
virtual
void
UpdateStatusBar
();
virtual
PCB_SCREEN
*
GetScreen
()
const
{
return
(
PCB_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
PCB_SCREEN
*
GetScreen
()
const
{
return
(
PCB_SCREEN
*
)
EDA_DRAW_FRAME
::
GetScreen
();
}
/**
* Function BestZoom
...
...
include/wxEeschemaStruct.h
View file @
1393eb0f
...
...
@@ -342,6 +342,20 @@ public:
SCH_SCREEN
*
GetScreen
()
const
;
// note: a common base class shared between LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME
// would allow sharing of these three functions:
// note: a common base class shared between LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME
// would allow sharing of these 5 functions:
void
SetPageSettings
(
const
PAGE_INFO
&
aPageSettings
);
// overload EDA_DRAW_FRAME
const
PAGE_INFO
&
GetPageSettings
()
const
;
// overload EDA_DRAW_FRAME
const
wxSize
GetPageSizeIU
()
const
;
// overload EDA_DRAW_FRAME
const
wxPoint
&
GetOriginAxisPosition
()
const
;
// overload EDA_DRAW_FRAME
void
SetOriginAxisPosition
(
const
wxPoint
&
aPosition
);
// overload EDA_DRAW_FRAME
virtual
wxString
GetScreenDesc
();
void
InstallConfigFrame
(
wxCommandEvent
&
event
);
...
...
include/wxstruct.h
View file @
1393eb0f
...
...
@@ -363,6 +363,10 @@ public:
*/
class
EDA_DRAW_FRAME
:
public
EDA_BASE_FRAME
{
/// Let the #EDA_DRAW_PANEL object have access to the protected data since
/// it is closely tied to the #EDA_DRAW_FRAME.
friend
class
EDA_DRAW_PANEL
;
///< Id of active button on the vertical toolbar.
int
m_toolId
;
...
...
@@ -416,19 +420,13 @@ protected:
/// Panel used to display information at the bottom of the main window.
EDA_MSG_PANEL
*
m_messagePanel
;
/// Let the #EDA_DRAW_PANEL object have access to the protected data since
/// it is closely tied to the #EDA_DRAW_FRAME.
friend
class
EDA_DRAW_PANEL
;
private
:
BASE_SCREEN
*
m_currentScreen
;
///< current used SCREEN
bool
m_snapToGrid
;
///< Indicates if cursor should be snapped to grid.
protected
:
void
SetScreen
(
BASE_SCREEN
*
aScreen
)
{
m_currentScreen
=
aScreen
;
}
void
SetScreen
(
BASE_SCREEN
*
aScreen
)
{
m_currentScreen
=
aScreen
;
}
/**
* Function unitsChangeRefresh
...
...
@@ -439,6 +437,7 @@ protected:
*/
virtual
void
unitsChangeRefresh
();
public
:
EDA_DRAW_FRAME
(
wxWindow
*
father
,
int
idtype
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
...
...
@@ -474,11 +473,12 @@ public:
virtual
wxString
GetScreenDesc
();
/**
* Function GetBaseScreen
* is virtual and returns a pointer to a BASE_SCREEN or one of its
* derivatives. It may be overloaded by derived classes.
* Function GetScreen
* returns a pointer to a BASE_SCREEN or one of its
* derivatives. It is overloaded by derived classes to return
* SCH_SCREEN or PCB_SCREEN.
*/
virtual
BASE_SCREEN
*
GetScreen
()
const
{
return
m_currentScreen
;
}
virtual
BASE_SCREEN
*
GetScreen
()
const
{
return
m_currentScreen
;
}
void
OnMenuOpen
(
wxMenuEvent
&
event
);
void
OnMouseEvent
(
wxMouseEvent
&
event
);
...
...
pcbnew/basepcbframe.cpp
View file @
1393eb0f
...
...
@@ -48,7 +48,7 @@
#include "class_drawpanel.h"
/
* Configuration entry names. */
/
/ Configuration entry names.
static
const
wxString
UserGridSizeXEntry
(
wxT
(
"PcbUserGrid_X"
)
);
static
const
wxString
UserGridSizeYEntry
(
wxT
(
"PcbUserGrid_Y"
)
);
static
const
wxString
UserGridUnitsEntry
(
wxT
(
"PcbUserGrid_Unit"
)
);
...
...
@@ -94,7 +94,7 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* father,
m_DisplayModEdge
=
FILLED
;
// How to display module drawings (line/ filled / sketch)
m_DisplayModText
=
FILLED
;
// How to display module texts (line/ filled / sketch)
m_DisplayPcbTrackFill
=
true
;
/
* false = sketch , true = filled */
m_DisplayPcbTrackFill
=
true
;
/
/ false = sketch , true = filled
m_Draw3DFrame
=
NULL
;
// Display Window in 3D mode (OpenGL)
m_ModuleEditFrame
=
NULL
;
// Frame for footprint edition
...
...
@@ -194,14 +194,7 @@ EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
}
BOARD_DESIGN_SETTINGS
*
PCB_BASE_FRAME
::
GetDesignSettings
()
{
wxASSERT
(
m_Pcb
);
return
m_Pcb
?
&
m_Pcb
->
GetDesignSettings
()
:
NULL
;
}
double
PCB_BASE_FRAME
::
BestZoom
(
void
)
double
PCB_BASE_FRAME
::
BestZoom
()
{
int
dx
,
dy
;
...
...
@@ -236,7 +229,7 @@ double PCB_BASE_FRAME::BestZoom( void )
}
void
PCB_BASE_FRAME
::
CursorGoto
(
const
wxPoint
&
aPos
)
void
PCB_BASE_FRAME
::
CursorGoto
(
const
wxPoint
&
aPos
)
{
// factored out of pcbnew/find.cpp
...
...
@@ -244,7 +237,7 @@ void PCB_BASE_FRAME::CursorGoto( const wxPoint& aPos )
wxClientDC
dc
(
m_canvas
);
/
* There may be need to reframe the drawing. */
/
/ There may be need to reframe the drawing.
if
(
!
m_canvas
->
IsPointOnDisplay
(
aPos
)
)
{
screen
->
SetCrossHairPosition
(
aPos
);
...
...
@@ -267,7 +260,7 @@ void PCB_BASE_FRAME::ReCreateMenuBar( void )
}
/
* Virtual functions: Do nothing for PCB_BASE_FRAME window */
/
/ Virtual functions: Do nothing for PCB_BASE_FRAME window
void
PCB_BASE_FRAME
::
Show3D_Frame
(
wxCommandEvent
&
event
)
{
}
...
...
pcbnew/class_board.h
View file @
1393eb0f
...
...
@@ -176,7 +176,7 @@ private:
COLORS_DESIGN_SETTINGS
*
m_colorsSettings
;
// Link to current colors settings
PAGE_INFO
m_paper
;
/// Position of the origin axis
.
/// Position of the origin axis
, which is used in exports mostly
wxPoint
m_originAxisPosition
;
/**
...
...
pcbnew/kicad_plugin.cpp
View file @
1393eb0f
...
...
@@ -476,8 +476,8 @@ void KICAD_PLUGIN::loadSHEET()
int
w
=
intParse
(
width
);
int
h
=
intParse
(
height
);
page
.
SetWidth
Inches
(
w
/
1000.0
);
page
.
SetHeight
Inches
(
h
/
1000.0
);
page
.
SetWidth
Mils
(
w
);
page
.
SetHeight
Mils
(
h
);
}
}
...
...
pcbnew/pcbnew_config.cpp
View file @
1393eb0f
...
...
@@ -41,7 +41,7 @@
#include "worksheet.h"
#include "dialog_hotkeys_editor.h"
#include "class_
pa
d.h"
#include "class_
boar
d.h"
#include "pcbplot.h"
#include "pcbnew.h"
...
...
@@ -210,7 +210,7 @@ void PCB_EDIT_FRAME::SaveProjectSettings()
PARAM_CFG_ARRAY
PCB_EDIT_FRAME
::
GetProjectFileParameters
()
{
PARAM_CFG_ARRAY
pca
;
BOARD_DESIGN_SETTINGS
&
bds
=
*
GetDesignSettings
();
BOARD_DESIGN_SETTINGS
&
bds
=
GetBoard
()
->
GetDesignSettings
();
pca
.
push_back
(
new
PARAM_CFG_FILENAME
(
wxT
(
"LibDir"
),
&
g_UserLibDirBuffer
,
GROUPLIB
)
);
...
...
pcbnew/xchgmod.cpp
View file @
1393eb0f
...
...
@@ -152,6 +152,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
FILE
*
FichCmp
,
*
NewFile
;
char
line
[
1024
];
wxString
msg
;
char
*
ignore
;
if
(
old_name
==
new_name
)
return
0
;
...
...
@@ -189,7 +190,7 @@ int DIALOG_EXCHANGE_MODULE::Maj_ListeCmp( const wxString& reference,
return
1
;
}
fgets
(
line
,
sizeof
(
line
),
FichCmp
);
ignore
=
fgets
(
line
,
sizeof
(
line
),
FichCmp
);
fprintf
(
NewFile
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
TO_UTF8
(
DateAndTime
()
)
);
...
...
@@ -587,6 +588,7 @@ void PCB_EDIT_FRAME::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
MODULE
*
Module
=
GetBoard
()
->
m_Modules
;
wxString
msg
;
wxString
wildcard
;
char
*
ignore
;
if
(
Module
==
NULL
)
{
...
...
@@ -617,7 +619,7 @@ void PCB_EDIT_FRAME::RecreateCmpFileFromBoard( wxCommandEvent& aEvent )
return
;
}
fgets
(
line
,
sizeof
(
line
),
FichCmp
);
ignore
=
fgets
(
line
,
sizeof
(
line
),
FichCmp
);
fprintf
(
FichCmp
,
"Cmp-Mod V01 Genere par PcbNew le %s
\n
"
,
TO_UTF8
(
DateAndTime
()
)
);
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
...
...
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