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
d68940c4
Commit
d68940c4
authored
Feb 07, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes.
parent
87d2caa4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
39 deletions
+70
-39
notes_about_pcbnew_new_file_format.odt
Documentation/notes_about_pcbnew_new_file_format.odt
+0
-0
AboutDialog_main.cpp
common/dialog_about/AboutDialog_main.cpp
+2
-0
eda_doc.cpp
common/eda_doc.cpp
+4
-0
edaappl.cpp
common/edaappl.cpp
+1
-0
appl_wxstruct.h
include/appl_wxstruct.h
+22
-1
menubar.cpp
kicad/menubar.cpp
+15
-28
preferences.cpp
kicad/preferences.cpp
+15
-6
tracks_width_versus_current.cpp
pcb_calculator/tracks_width_versus_current.cpp
+11
-4
No files found.
notes_about_pcbnew_new_file_format.odt
→
Documentation/
notes_about_pcbnew_new_file_format.odt
View file @
d68940c4
File moved
common/dialog_about/AboutDialog_main.cpp
View file @
d68940c4
...
...
@@ -302,6 +302,8 @@ static void InitKiCadAboutNew( AboutAppInfo& info )
new
Contributor
(
wxT
(
"Iñigo Zuluagaz"
),
wxT
(
"inigo_zuluaga@yahoo.es"
),
wxT
(
"Icons by"
),
KiBitmapNew
(
edit_module_xpm
)
)
);
info
.
AddArtist
(
new
Contributor
(
wxT
(
"Fabrizio Tappero"
),
wxT
(
"fabrizio.tappero@gmail.com"
),
wxT
(
"New icons by"
),
KiBitmapNew
(
edit_module_xpm
)
)
);
info
.
AddArtist
(
new
Contributor
(
wxT
(
"Konstantin Baranovskiy"
),
wxT
(
"baranovskiykonstantin@gmail.com"
),
wxT
(
"New icons by"
),
KiBitmapNew
(
edit_module_xpm
)
)
);
info
.
AddArtist
(
new
Contributor
(
wxT
(
"Renie Marquet"
),
wxT
(
"reniemarquet@uol.com.br"
),
wxT
(
"3D modules by"
),
KiBitmapNew
(
three_d_xpm
)
)
);
info
.
AddArtist
(
...
...
common/eda_doc.cpp
View file @
d68940c4
...
...
@@ -19,6 +19,9 @@ void EDA_APP::ReadPdfBrowserInfos()
wxASSERT
(
m_commonSettings
!=
NULL
);
m_PdfBrowser
=
m_commonSettings
->
Read
(
wxT
(
"PdfBrowserName"
),
wxEmptyString
);
int
tmp
;
m_commonSettings
->
Read
(
wxT
(
"UseSystemBrowser"
),
&
tmp
,
0
);
m_useSystemPdfBrowser
=
tmp
!=
0
;
}
...
...
@@ -27,6 +30,7 @@ void EDA_APP::WritePdfBrowserInfos()
wxASSERT
(
m_commonSettings
!=
NULL
);
m_commonSettings
->
Write
(
wxT
(
"PdfBrowserName"
),
m_PdfBrowser
);
m_commonSettings
->
Write
(
wxT
(
"UseSystemBrowser"
),
m_useSystemPdfBrowser
);
}
...
...
common/edaappl.cpp
View file @
d68940c4
...
...
@@ -273,6 +273,7 @@ EDA_APP::EDA_APP()
m_Locale
=
NULL
;
m_projectSettings
=
NULL
;
m_commonSettings
=
NULL
;
ForceSystemPdfBrowser
(
false
);
}
...
...
include/appl_wxstruct.h
View file @
d68940c4
...
...
@@ -97,6 +97,9 @@ protected:
/// The file name of the the program selected for browsing pdf files.
wxString
m_PdfBrowser
;
/// true to use the selected PDF browser, if exists, or false to use the default
bool
m_useSystemPdfBrowser
;
wxPathList
m_searchPaths
;
wxFileHistory
m_fileHistory
;
wxString
m_HelpFileName
;
...
...
@@ -150,11 +153,29 @@ public:
wxLocale
*
GetLocale
()
{
return
m_Locale
;
}
/**
* @return the full file name of the prefered PDF browser
* ( the file name is empty if no prefered there is no PDF browser selected
*/
wxString
GetPdfBrowserFileName
()
const
{
return
m_PdfBrowser
;
}
/**
* Set the name of a prefered PDF browser, which could be an alternate browser
* to the system PDF browser.
*/
void
SetPdfBrowserFileName
(
const
wxString
&
aFileName
)
{
m_PdfBrowser
=
aFileName
;
}
bool
UseSystemPdfBrowser
()
const
{
return
m_PdfBrowser
.
IsEmpty
();
}
/**
* @return true if the PDF browser is the default (system) PDF browser
* and false if the PDF browser is the prefered (selected) browser
* returns false if there is no selected browser
*/
bool
UseSystemPdfBrowser
()
const
{
return
m_useSystemPdfBrowser
||
m_PdfBrowser
.
IsEmpty
();
}
/**
* force the use of system PDF browser, even if a preferend PDF browser is set
*/
void
ForceSystemPdfBrowser
(
bool
aFlg
)
{
m_useSystemPdfBrowser
=
aFlg
;
}
wxFileHistory
&
GetFileHistory
()
{
return
m_fileHistory
;
}
...
...
kicad/menubar.cpp
View file @
d68940c4
...
...
@@ -97,7 +97,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// static to remember this menu
// Create and try to get the current menubar
wxMenuItem
*
item
;
wxMenuBar
*
menuBar
=
GetMenuBar
();
if
(
!
menuBar
)
...
...
@@ -219,32 +218,24 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
wxMenu
*
SubMenuPdfBrowserChoice
=
new
wxMenu
;
// Default
item
=
new
wxMenuItem
(
SubMenuPdfBrowserChoice
,
ID_SELECT_DEFAULT_PDF_BROWSER
,
_
(
"&Default"
),
_
(
"Use system default PDF viewer used to browse datasheets"
),
wxITEM_CHECK
);
SETBITMAPS
(
datasheet_xpm
);
SubMenuPdfBrowserChoice
->
Append
(
item
);
AddMenuItem
(
SubMenuPdfBrowserChoice
,
ID_SELECT_DEFAULT_PDF_BROWSER
,
_
(
"&Default"
),
_
(
"Use system default PDF viewer used to browse datasheets"
),
KiBitmap
(
datasheet_xpm
),
wxITEM_CHECK
);
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_DEFAULT_PDF_BROWSER
,
wxGetApp
().
UseSystemPdfBrowser
()
);
// Favourite
item
=
new
wxMenuItem
(
SubMenuPdfBrowserChoice
,
ID_SELECT_PREFERED_PDF_BROWSER
,
_
(
"&Favourite"
),
_
(
"Use your favourite PDF viewer used to browse datasheets"
),
wxITEM_CHECK
);
SETBITMAPS
(
preference_xpm
);
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
AppendSeparator
();
AddMenuItem
(
SubMenuPdfBrowserChoice
,
ID_SELECT_PREFERED_PDF_BROWSER
,
_
(
"&Favourite"
),
_
(
"Use your favourite PDF viewer used to browse datasheets"
),
KiBitmap
(
preference_xpm
),
wxITEM_CHECK
);
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_PREFERED_PDF_BROWSER
,
!
wxGetApp
().
UseSystemPdfBrowser
()
);
SubMenuPdfBrowserChoice
->
AppendSeparator
();
// Append PDF Viewer submenu to preferences
AddMenuItem
(
SubMenuPdfBrowserChoice
,
ID_SELECT_PREFERED_PDF_BROWSER_NAME
,
...
...
@@ -253,8 +244,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
KiBitmap
(
datasheet_xpm
)
);
// PDF viewer submenu
AddMenuItem
(
preferencesMenu
,
SubMenuPdfBrowserChoice
,
-
1
,
AddMenuItem
(
preferencesMenu
,
SubMenuPdfBrowserChoice
,
-
1
,
_
(
"&PDF Viewer"
),
_
(
"PDF viewer preferences"
),
KiBitmap
(
datasheet_xpm
)
);
...
...
@@ -270,14 +260,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
AddHelpVersionInfoMenuEntry
(
helpMenu
);
// Contents
AddMenuItem
(
helpMenu
,
wxID_HELP
,
AddMenuItem
(
helpMenu
,
wxID_HELP
,
_
(
"&Contents"
),
_
(
"Open the KiCad handbook"
),
KiBitmap
(
online_help_xpm
)
);
AddMenuItem
(
helpMenu
,
wxID_INDEX
,
AddMenuItem
(
helpMenu
,
wxID_INDEX
,
_
(
"&Getting Started in KiCad"
),
_
(
"Open the
\"
Getting Started in KiCad
\"
guide for beginners"
),
KiBitmap
(
help_xpm
)
);
...
...
@@ -286,8 +274,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
helpMenu
->
AppendSeparator
();
// About
AddMenuItem
(
helpMenu
,
wxID_ABOUT
,
AddMenuItem
(
helpMenu
,
wxID_ABOUT
,
_
(
"&About KiCad"
),
_
(
"About KiCad project manager"
),
KiBitmap
(
info_xpm
)
);
...
...
kicad/preferences.cpp
View file @
d68940c4
...
...
@@ -49,6 +49,7 @@ void KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event )
void
KICAD_MANAGER_FRAME
::
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
)
{
wxGetApp
().
ForceSystemPdfBrowser
(
true
);
wxGetApp
().
WritePdfBrowserInfos
();
}
...
...
@@ -61,26 +62,34 @@ void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event )
void
KICAD_MANAGER_FRAME
::
OnSelectPreferredPdfBrowser
(
wxCommandEvent
&
event
)
{
bool
select
=
event
.
GetId
()
==
ID_SELECT_PREFERED_PDF_BROWSER_NAME
;
wxGetApp
().
ForceSystemPdfBrowser
(
false
)
;
if
(
!
wxGetApp
().
GetPdfBrowserFileName
()
&&
!
select
)
bool
selectName
=
event
.
GetId
()
==
ID_SELECT_PREFERED_PDF_BROWSER_NAME
;
if
(
wxGetApp
().
GetPdfBrowserFileName
().
IsEmpty
()
&&
!
selectName
)
{
DisplayError
(
this
,
_
(
"You must choose a PDF viewer before using this option."
)
);
}
wxString
wildcard
(
wxT
(
"*"
)
);
if
(
!
wxGetApp
().
GetPdfBrowserFileName
().
IsEmpty
()
&&
!
selectName
)
{
wxGetApp
().
WritePdfBrowserInfos
();
return
;
}
wxString
mask
(
wxT
(
"*"
)
);
#ifdef __WINDOWS__
wildcard
+=
wxT
(
".exe"
);
mask
+=
wxT
(
".exe"
);
#endif
w
ildcard
=
_
(
"Executable files ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
w
xString
wildcard
=
_
(
"Executable files ("
)
+
mask
+
wxT
(
")|"
)
+
mask
;
wxGetApp
().
ReadPdfBrowserInfos
();
wxFileName
fn
=
wxGetApp
().
GetPdfBrowserFileName
();
wxFileDialog
dlg
(
this
,
_
(
"Select Preferred Pdf Browser"
),
fn
.
GetPath
(),
fn
.
GetFull
Name
(),
wildcard
,
fn
.
GetFull
Path
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
...
...
pcb_calculator/tracks_width_versus_current.cpp
View file @
d68940c4
...
...
@@ -28,6 +28,7 @@
* for more info
*/
#include <cmath>
#include <wx/wx.h>
#include <wx/config.h>
...
...
@@ -67,10 +68,10 @@ void PCB_CALCULATOR_FRAME::TW_WriteConfig()
void
PCB_CALCULATOR_FRAME
::
OnTWCalculateButt
(
wxCommandEvent
&
event
)
{
// Prepare parameters:
double
current
=
ReturnDoubleFromString
(
m_TrackCurrentValue
->
GetValue
(
)
);
double
thickness
=
ReturnDoubleFromString
(
m_TrackThicknessValue
->
GetValue
(
)
);
double
deltaT_C
=
ReturnDoubleFromString
(
m_TrackDeltaTValue
->
GetValue
(
)
);
double
track_len
=
ReturnDoubleFromString
(
m_TrackLengthValue
->
GetValue
(
)
);
double
current
=
std
::
abs
(
ReturnDoubleFromString
(
m_TrackCurrentValue
->
GetValue
()
)
);
double
thickness
=
std
::
abs
(
ReturnDoubleFromString
(
m_TrackThicknessValue
->
GetValue
()
)
);
double
deltaT_C
=
std
::
abs
(
ReturnDoubleFromString
(
m_TrackDeltaTValue
->
GetValue
()
)
);
double
track_len
=
std
::
abs
(
ReturnDoubleFromString
(
m_TrackLengthValue
->
GetValue
()
)
);
double
extTrackWidth
;
double
intTrackWidth
;
...
...
@@ -91,13 +92,16 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
double
scale
=
m_TW_ExtTrackWidth_choiceUnit
->
GetUnitScale
();
double
ext_area
=
thickness
*
extTrackWidth
;
msg
.
Printf
(
wxT
(
"%g"
),
ext_area
/
(
scale
*
scale
)
);
m_ExtTrackAreaValue
->
SetValue
(
msg
);
wxString
strunit
=
m_TW_ExtTrackWidth_choiceUnit
->
GetUnitName
();
msg
=
strunit
+
wxT
(
" x "
)
+
strunit
;
m_ExtTrackAreaUnitLabel
->
SetLabel
(
msg
);
scale
=
m_TW_IntTrackWidth_choiceUnit
->
GetUnitScale
();
double
int_area
=
thickness
*
intTrackWidth
;
msg
.
Printf
(
wxT
(
"%g"
),
int_area
/
(
scale
*
scale
)
);
m_IntTrackAreaValue
->
SetValue
(
msg
);
strunit
=
m_TW_IntTrackWidth_choiceUnit
->
GetUnitName
();
msg
=
strunit
+
wxT
(
" x "
)
+
strunit
;
...
...
@@ -108,6 +112,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
double
ext_res
=
rho
/
ext_area
*
track_len
;
msg
.
Printf
(
wxT
(
"%g"
),
ext_res
);
m_ExtTrackResistValue
->
SetValue
(
msg
);
double
int_res
=
rho
/
int_area
*
track_len
;
msg
.
Printf
(
wxT
(
"%g"
),
int_res
);
m_IntTrackResistValue
->
SetValue
(
msg
);
...
...
@@ -116,6 +121,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
double
ext_drop_volt
=
ext_res
*
current
;
msg
.
Printf
(
wxT
(
"%g"
),
ext_drop_volt
);
m_ExtTrackVDropValue
->
SetValue
(
msg
);
double
int_drop_volt
=
int_res
*
current
;
msg
.
Printf
(
wxT
(
"%g"
),
int_drop_volt
);
m_IntTrackVDropValue
->
SetValue
(
msg
);
...
...
@@ -124,6 +130,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
double
loss
=
ext_drop_volt
*
current
;
msg
.
Printf
(
wxT
(
"%g"
),
loss
);
m_ExtTrackLossValue
->
SetValue
(
msg
);
loss
=
int_drop_volt
*
current
;
msg
.
Printf
(
wxT
(
"%g"
),
loss
);
m_IntTrackLossValue
->
SetValue
(
msg
);
...
...
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