* Add Henner's patch (with minimal changes) to ensure CVpcb footprint view window is always brought into view, even after being hidden by another window
This commit is contained in:
commit
159017ed62
|
@ -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 ) ) );
|
new Contributor( wxT( "Iñigo Zuluagaz" ), wxT( "inigo_zuluaga@yahoo.es" ), wxT( "Icons by" ), KiBitmapNew( edit_module_xpm ) ) );
|
||||||
info.AddArtist(
|
info.AddArtist(
|
||||||
new Contributor( wxT( "Fabrizio Tappero" ), wxT( "fabrizio.tappero@gmail.com" ), wxT( "New icons by" ), KiBitmapNew( edit_module_xpm ) ) );
|
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(
|
info.AddArtist(
|
||||||
new Contributor( wxT( "Renie Marquet" ), wxT( "reniemarquet@uol.com.br" ), wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) );
|
new Contributor( wxT( "Renie Marquet" ), wxT( "reniemarquet@uol.com.br" ), wxT( "3D modules by" ), KiBitmapNew( three_d_xpm ) ) );
|
||||||
info.AddArtist(
|
info.AddArtist(
|
||||||
|
|
|
@ -19,6 +19,9 @@ void EDA_APP::ReadPdfBrowserInfos()
|
||||||
wxASSERT( m_commonSettings != NULL );
|
wxASSERT( m_commonSettings != NULL );
|
||||||
|
|
||||||
m_PdfBrowser = m_commonSettings->Read( wxT( "PdfBrowserName" ), wxEmptyString );
|
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 );
|
wxASSERT( m_commonSettings != NULL );
|
||||||
|
|
||||||
m_commonSettings->Write( wxT( "PdfBrowserName" ), m_PdfBrowser );
|
m_commonSettings->Write( wxT( "PdfBrowserName" ), m_PdfBrowser );
|
||||||
|
m_commonSettings->Write( wxT( "UseSystemBrowser" ), m_useSystemPdfBrowser );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -273,6 +273,7 @@ EDA_APP::EDA_APP()
|
||||||
m_Locale = NULL;
|
m_Locale = NULL;
|
||||||
m_projectSettings = NULL;
|
m_projectSettings = NULL;
|
||||||
m_commonSettings = NULL;
|
m_commonSettings = NULL;
|
||||||
|
ForceSystemPdfBrowser( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -934,6 +934,15 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
|
||||||
{
|
{
|
||||||
if( m_DisplayFootprintFrame->IsIconized() )
|
if( m_DisplayFootprintFrame->IsIconized() )
|
||||||
m_DisplayFootprintFrame->Iconize( false );
|
m_DisplayFootprintFrame->Iconize( false );
|
||||||
|
|
||||||
|
// The display footprint window might be buried under some other
|
||||||
|
// windows, so CreateScreenCmp() on an existing window would not
|
||||||
|
// show any difference, leaving the user confused.
|
||||||
|
// So we want to put it to front, second after our CVPCB_MAINFRAME.
|
||||||
|
// We do this by a little dance of bringing it to front then the main
|
||||||
|
// frame back.
|
||||||
|
m_DisplayFootprintFrame->Raise(); // Make sure that is visible.
|
||||||
|
Raise(); // .. but still we want the focus.
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DisplayFootprintFrame->InitDisplay();
|
m_DisplayFootprintFrame->InitDisplay();
|
||||||
|
|
|
@ -97,6 +97,9 @@ protected:
|
||||||
|
|
||||||
/// The file name of the the program selected for browsing pdf files.
|
/// The file name of the the program selected for browsing pdf files.
|
||||||
wxString m_PdfBrowser;
|
wxString m_PdfBrowser;
|
||||||
|
/// true to use the selected PDF browser, if exists, or false to use the default
|
||||||
|
bool m_useSystemPdfBrowser;
|
||||||
|
|
||||||
wxPathList m_searchPaths;
|
wxPathList m_searchPaths;
|
||||||
wxFileHistory m_fileHistory;
|
wxFileHistory m_fileHistory;
|
||||||
wxString m_HelpFileName;
|
wxString m_HelpFileName;
|
||||||
|
@ -150,11 +153,29 @@ public:
|
||||||
|
|
||||||
wxLocale* GetLocale() { return m_Locale; }
|
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; }
|
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; }
|
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; }
|
wxFileHistory& GetFileHistory() { return m_fileHistory; }
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,6 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
// static to remember this menu
|
// static to remember this menu
|
||||||
|
|
||||||
// Create and try to get the current menubar
|
// Create and try to get the current menubar
|
||||||
wxMenuItem* item;
|
|
||||||
wxMenuBar* menuBar = GetMenuBar();
|
wxMenuBar* menuBar = GetMenuBar();
|
||||||
|
|
||||||
if( !menuBar )
|
if( !menuBar )
|
||||||
|
@ -219,32 +218,24 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
wxMenu* SubMenuPdfBrowserChoice = new wxMenu;
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_DEFAULT_PDF_BROWSER,
|
||||||
ID_SELECT_DEFAULT_PDF_BROWSER,
|
_( "&Default" ),
|
||||||
_( "&Default" ),
|
_( "Use system default PDF viewer used to browse datasheets" ),
|
||||||
_( "Use system default PDF viewer used to browse datasheets" ),
|
KiBitmap( datasheet_xpm ),
|
||||||
wxITEM_CHECK );
|
wxITEM_CHECK );
|
||||||
|
|
||||||
SETBITMAPS( datasheet_xpm );
|
|
||||||
|
|
||||||
SubMenuPdfBrowserChoice->Append( item );
|
|
||||||
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_DEFAULT_PDF_BROWSER,
|
||||||
wxGetApp().UseSystemPdfBrowser() );
|
wxGetApp().UseSystemPdfBrowser() );
|
||||||
|
|
||||||
// Favourite
|
// Favourite
|
||||||
item = new wxMenuItem( SubMenuPdfBrowserChoice,
|
AddMenuItem( SubMenuPdfBrowserChoice, ID_SELECT_PREFERED_PDF_BROWSER,
|
||||||
ID_SELECT_PREFERED_PDF_BROWSER,
|
_( "&Favourite" ),
|
||||||
_( "&Favourite" ),
|
_( "Use your favourite PDF viewer used to browse datasheets" ),
|
||||||
_( "Use your favourite PDF viewer used to browse datasheets" ),
|
KiBitmap( preference_xpm ),
|
||||||
wxITEM_CHECK );
|
wxITEM_CHECK );
|
||||||
|
|
||||||
SETBITMAPS( preference_xpm );
|
|
||||||
|
|
||||||
SubMenuPdfBrowserChoice->Append( item );
|
|
||||||
SubMenuPdfBrowserChoice->AppendSeparator();
|
|
||||||
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
|
SubMenuPdfBrowserChoice->Check( ID_SELECT_PREFERED_PDF_BROWSER,
|
||||||
!wxGetApp().UseSystemPdfBrowser() );
|
!wxGetApp().UseSystemPdfBrowser() );
|
||||||
|
|
||||||
|
SubMenuPdfBrowserChoice->AppendSeparator();
|
||||||
// Append PDF Viewer submenu to preferences
|
// Append PDF Viewer submenu to preferences
|
||||||
AddMenuItem( SubMenuPdfBrowserChoice,
|
AddMenuItem( SubMenuPdfBrowserChoice,
|
||||||
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
ID_SELECT_PREFERED_PDF_BROWSER_NAME,
|
||||||
|
@ -253,8 +244,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
KiBitmap( datasheet_xpm ) );
|
KiBitmap( datasheet_xpm ) );
|
||||||
|
|
||||||
// PDF viewer submenu
|
// PDF viewer submenu
|
||||||
AddMenuItem( preferencesMenu,
|
AddMenuItem( preferencesMenu, SubMenuPdfBrowserChoice, -1,
|
||||||
SubMenuPdfBrowserChoice, -1,
|
|
||||||
_( "&PDF Viewer" ),
|
_( "&PDF Viewer" ),
|
||||||
_( "PDF viewer preferences" ),
|
_( "PDF viewer preferences" ),
|
||||||
KiBitmap( datasheet_xpm ) );
|
KiBitmap( datasheet_xpm ) );
|
||||||
|
@ -270,14 +260,12 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
AddHelpVersionInfoMenuEntry( helpMenu );
|
AddHelpVersionInfoMenuEntry( helpMenu );
|
||||||
|
|
||||||
// Contents
|
// Contents
|
||||||
AddMenuItem( helpMenu,
|
AddMenuItem( helpMenu, wxID_HELP,
|
||||||
wxID_HELP,
|
|
||||||
_( "&Contents" ),
|
_( "&Contents" ),
|
||||||
_( "Open the KiCad handbook" ),
|
_( "Open the KiCad handbook" ),
|
||||||
KiBitmap( online_help_xpm ) );
|
KiBitmap( online_help_xpm ) );
|
||||||
|
|
||||||
AddMenuItem( helpMenu,
|
AddMenuItem( helpMenu, wxID_INDEX,
|
||||||
wxID_INDEX,
|
|
||||||
_( "&Getting Started in KiCad" ),
|
_( "&Getting Started in KiCad" ),
|
||||||
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
|
_( "Open the \"Getting Started in KiCad\" guide for beginners" ),
|
||||||
KiBitmap( help_xpm ) );
|
KiBitmap( help_xpm ) );
|
||||||
|
@ -286,8 +274,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
|
||||||
helpMenu->AppendSeparator();
|
helpMenu->AppendSeparator();
|
||||||
|
|
||||||
// About
|
// About
|
||||||
AddMenuItem( helpMenu,
|
AddMenuItem( helpMenu, wxID_ABOUT,
|
||||||
wxID_ABOUT,
|
|
||||||
_( "&About KiCad" ),
|
_( "&About KiCad" ),
|
||||||
_( "About KiCad project manager" ),
|
_( "About KiCad project manager" ),
|
||||||
KiBitmap( info_xpm ) );
|
KiBitmap( info_xpm ) );
|
||||||
|
|
|
@ -49,6 +49,7 @@ void KICAD_MANAGER_FRAME::OnUpdateDefaultPdfBrowser( wxUpdateUIEvent& event )
|
||||||
|
|
||||||
void KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser( wxCommandEvent& event )
|
void KICAD_MANAGER_FRAME::OnSelectDefaultPdfBrowser( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
|
wxGetApp().ForceSystemPdfBrowser( true );
|
||||||
wxGetApp().WritePdfBrowserInfos();
|
wxGetApp().WritePdfBrowserInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,26 +62,34 @@ void KICAD_MANAGER_FRAME::OnUpdatePreferredPdfBrowser( wxUpdateUIEvent& event )
|
||||||
|
|
||||||
void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& 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,
|
DisplayError( this,
|
||||||
_( "You must choose a PDF viewer before using this option." ) );
|
_( "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__
|
#ifdef __WINDOWS__
|
||||||
wildcard += wxT( ".exe" );
|
mask += wxT( ".exe" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wildcard = _( "Executable files (" ) + wildcard + wxT( ")|" ) + wildcard;
|
wxString wildcard = _( "Executable files (" ) + mask + wxT( ")|" ) + mask;
|
||||||
|
|
||||||
wxGetApp().ReadPdfBrowserInfos();
|
wxGetApp().ReadPdfBrowserInfos();
|
||||||
wxFileName fn = wxGetApp().GetPdfBrowserFileName();
|
wxFileName fn = wxGetApp().GetPdfBrowserFileName();
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Select Preferred Pdf Browser" ), fn.GetPath(),
|
wxFileDialog dlg( this, _( "Select Preferred Pdf Browser" ), fn.GetPath(),
|
||||||
fn.GetFullName(), wildcard,
|
fn.GetFullPath(), wildcard,
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
* for more info
|
* for more info
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#include <wx/config.h>
|
#include <wx/config.h>
|
||||||
|
|
||||||
|
@ -67,10 +68,10 @@ void PCB_CALCULATOR_FRAME::TW_WriteConfig()
|
||||||
void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
// Prepare parameters:
|
// Prepare parameters:
|
||||||
double current = ReturnDoubleFromString( m_TrackCurrentValue->GetValue() );
|
double current = std::abs( ReturnDoubleFromString( m_TrackCurrentValue->GetValue() ) );
|
||||||
double thickness = ReturnDoubleFromString( m_TrackThicknessValue->GetValue() );
|
double thickness = std::abs( ReturnDoubleFromString( m_TrackThicknessValue->GetValue() ) );
|
||||||
double deltaT_C = ReturnDoubleFromString( m_TrackDeltaTValue->GetValue() );
|
double deltaT_C = std::abs( ReturnDoubleFromString( m_TrackDeltaTValue->GetValue() ) );
|
||||||
double track_len = ReturnDoubleFromString( m_TrackLengthValue->GetValue() );
|
double track_len = std::abs( ReturnDoubleFromString( m_TrackLengthValue->GetValue() ) );
|
||||||
double extTrackWidth;
|
double extTrackWidth;
|
||||||
double intTrackWidth;
|
double intTrackWidth;
|
||||||
|
|
||||||
|
@ -91,13 +92,16 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
||||||
double scale = m_TW_ExtTrackWidth_choiceUnit->GetUnitScale();
|
double scale = m_TW_ExtTrackWidth_choiceUnit->GetUnitScale();
|
||||||
double ext_area = thickness * extTrackWidth;
|
double ext_area = thickness * extTrackWidth;
|
||||||
msg.Printf( wxT( "%g" ), ext_area / (scale * scale) );
|
msg.Printf( wxT( "%g" ), ext_area / (scale * scale) );
|
||||||
|
|
||||||
m_ExtTrackAreaValue->SetValue( msg );
|
m_ExtTrackAreaValue->SetValue( msg );
|
||||||
wxString strunit = m_TW_ExtTrackWidth_choiceUnit->GetUnitName();
|
wxString strunit = m_TW_ExtTrackWidth_choiceUnit->GetUnitName();
|
||||||
msg = strunit + wxT( " x " ) + strunit;
|
msg = strunit + wxT( " x " ) + strunit;
|
||||||
m_ExtTrackAreaUnitLabel->SetLabel( msg );
|
m_ExtTrackAreaUnitLabel->SetLabel( msg );
|
||||||
|
|
||||||
scale = m_TW_IntTrackWidth_choiceUnit->GetUnitScale();
|
scale = m_TW_IntTrackWidth_choiceUnit->GetUnitScale();
|
||||||
double int_area = thickness * intTrackWidth;
|
double int_area = thickness * intTrackWidth;
|
||||||
msg.Printf( wxT( "%g" ), int_area / (scale * scale) );
|
msg.Printf( wxT( "%g" ), int_area / (scale * scale) );
|
||||||
|
|
||||||
m_IntTrackAreaValue->SetValue( msg );
|
m_IntTrackAreaValue->SetValue( msg );
|
||||||
strunit = m_TW_IntTrackWidth_choiceUnit->GetUnitName();
|
strunit = m_TW_IntTrackWidth_choiceUnit->GetUnitName();
|
||||||
msg = strunit + wxT( " x " ) + strunit;
|
msg = strunit + wxT( " x " ) + strunit;
|
||||||
|
@ -108,6 +112,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
||||||
double ext_res = rho / ext_area * track_len;
|
double ext_res = rho / ext_area * track_len;
|
||||||
msg.Printf( wxT( "%g" ), ext_res );
|
msg.Printf( wxT( "%g" ), ext_res );
|
||||||
m_ExtTrackResistValue->SetValue( msg );
|
m_ExtTrackResistValue->SetValue( msg );
|
||||||
|
|
||||||
double int_res = rho / int_area * track_len;
|
double int_res = rho / int_area * track_len;
|
||||||
msg.Printf( wxT( "%g" ), int_res );
|
msg.Printf( wxT( "%g" ), int_res );
|
||||||
m_IntTrackResistValue->SetValue( msg );
|
m_IntTrackResistValue->SetValue( msg );
|
||||||
|
@ -116,6 +121,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
||||||
double ext_drop_volt = ext_res * current;
|
double ext_drop_volt = ext_res * current;
|
||||||
msg.Printf( wxT( "%g" ), ext_drop_volt );
|
msg.Printf( wxT( "%g" ), ext_drop_volt );
|
||||||
m_ExtTrackVDropValue->SetValue( msg );
|
m_ExtTrackVDropValue->SetValue( msg );
|
||||||
|
|
||||||
double int_drop_volt = int_res * current;
|
double int_drop_volt = int_res * current;
|
||||||
msg.Printf( wxT( "%g" ), int_drop_volt );
|
msg.Printf( wxT( "%g" ), int_drop_volt );
|
||||||
m_IntTrackVDropValue->SetValue( msg );
|
m_IntTrackVDropValue->SetValue( msg );
|
||||||
|
@ -124,6 +130,7 @@ void PCB_CALCULATOR_FRAME::OnTWCalculateButt( wxCommandEvent& event )
|
||||||
double loss = ext_drop_volt * current;
|
double loss = ext_drop_volt * current;
|
||||||
msg.Printf( wxT( "%g" ), loss );
|
msg.Printf( wxT( "%g" ), loss );
|
||||||
m_ExtTrackLossValue->SetValue( msg );
|
m_ExtTrackLossValue->SetValue( msg );
|
||||||
|
|
||||||
loss = int_drop_volt * current;
|
loss = int_drop_volt * current;
|
||||||
msg.Printf( wxT( "%g" ), loss );
|
msg.Printf( wxT( "%g" ), loss );
|
||||||
m_IntTrackLossValue->SetValue( msg );
|
m_IntTrackLossValue->SetValue( msg );
|
||||||
|
|
|
@ -334,7 +334,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
refdes = aIDFBoard.GetRefDes();
|
refdes = aIDFBoard.GetRefDes();
|
||||||
}
|
}
|
||||||
|
|
||||||
double rotz = modfile->m_MatRotation.z + aModule->GetOrientation()/10.0;
|
double rotz = aModule->GetOrientation()/10.0;
|
||||||
double locx = modfile->m_MatPosition.x;
|
double locx = modfile->m_MatPosition.x;
|
||||||
double locy = modfile->m_MatPosition.y;
|
double locy = modfile->m_MatPosition.y;
|
||||||
double locz = modfile->m_MatPosition.z;
|
double locz = modfile->m_MatPosition.z;
|
||||||
|
@ -343,6 +343,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
|
|
||||||
if( top )
|
if( top )
|
||||||
{
|
{
|
||||||
|
rotz += modfile->m_MatRotation.z;
|
||||||
locy = -locy;
|
locy = -locy;
|
||||||
RotatePoint( &locx, &locy, aModule->GetOrientation() );
|
RotatePoint( &locx, &locy, aModule->GetOrientation() );
|
||||||
locy = -locy;
|
locy = -locy;
|
||||||
|
@ -352,6 +353,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
RotatePoint( &locx, &locy, aModule->GetOrientation() );
|
RotatePoint( &locx, &locy, aModule->GetOrientation() );
|
||||||
locy = -locy;
|
locy = -locy;
|
||||||
|
|
||||||
|
rotz -= modfile->m_MatRotation.z;
|
||||||
rotz = 180.0 - rotz;
|
rotz = 180.0 - rotz;
|
||||||
|
|
||||||
if( rotz >= 360.0 )
|
if( rotz >= 360.0 )
|
||||||
|
|
|
@ -1055,13 +1055,35 @@ bool IDF_COMP::substituteComponent( FILE* aLibFile )
|
||||||
if( parent->RegisterOutline( "NOGEOM_NOPART" ) )
|
if( parent->RegisterOutline( "NOGEOM_NOPART" ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Create a star shape 5mm high with points on 5 and 2.5 mm circles
|
||||||
fprintf( aLibFile, ".ELECTRICAL\n" );
|
fprintf( aLibFile, ".ELECTRICAL\n" );
|
||||||
fprintf( aLibFile, "\"NOGEOM\" \"NOPART\" MM 5\n" );
|
fprintf( aLibFile, "\"NOGEOM\" \"NOPART\" MM 5\n" );
|
||||||
// TODO: for now we shall use a simple cylinder; a more intricate
|
|
||||||
// and readily recognized feature (a stylistic X) would be of
|
double a, da, x, y;
|
||||||
// much greater value.
|
da = M_PI / 5.0;
|
||||||
fprintf( aLibFile, "0 0 0 0\n" );
|
a = da / 2.0;
|
||||||
fprintf( aLibFile, "0 2.5 0 360\n" );
|
|
||||||
|
for( int i = 0; i < 10; ++i )
|
||||||
|
{
|
||||||
|
if( i & 1 )
|
||||||
|
{
|
||||||
|
x = 2.5 * cos( a );
|
||||||
|
y = 2.5 * sin( a );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = 1.5 * cos( a );
|
||||||
|
y = 1.5 * sin( a );
|
||||||
|
}
|
||||||
|
|
||||||
|
a += da;
|
||||||
|
fprintf( aLibFile, "0 %.3f %.3f 0\n", x, y );
|
||||||
|
}
|
||||||
|
|
||||||
|
a = da / 2.0;
|
||||||
|
x = 1.5 * cos( a );
|
||||||
|
y = 1.5 * sin( a );
|
||||||
|
fprintf( aLibFile, "0 %.3f %.3f 0\n", x, y );
|
||||||
fprintf( aLibFile, ".END_ELECTRICAL\n\n" );
|
fprintf( aLibFile, ".END_ELECTRICAL\n\n" );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue