7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Code formatting.

This commit is contained in:
Maciej Suminski 2015-02-18 17:53:46 +01:00
parent 112adccbcb
commit 4fb9bce354
100 changed files with 3005 additions and 4238 deletions
common
include
pcbnew
class_drawsegment.hclass_module.cppclass_module.hclass_pad.hclass_pcb_text.h
dialogs
loadcmp.cppmenubar_pcbframe.cpppcbframe.cpppcbnew_id.h
router
tools
xchgmod.cpp

View File

@ -35,7 +35,7 @@ bool SEG::PointCloserThan( const VECTOR2I& aP, int aDist ) const
{
VECTOR2I d = B - A;
ecoord dist_sq = (ecoord) aDist * aDist;
ecoord dist_sq_thr = (ecoord) (aDist + 1) * (aDist + 1);
ecoord dist_sq_thr = (ecoord) ( aDist + 1 ) * ( aDist + 1 );
SEG::ecoord l_squared = d.Dot( d );
SEG::ecoord t = d.Dot( aP - A );

View File

@ -29,35 +29,37 @@
#include <wx_status_popup.h>
#include <wxPcbStruct.h>
WX_STATUS_POPUP::WX_STATUS_POPUP ( PCB_EDIT_FRAME *parent ) :
wxPopupWindow ( parent )
WX_STATUS_POPUP::WX_STATUS_POPUP( PCB_EDIT_FRAME* aParent ) :
wxPopupWindow( aParent )
{
m_panel = new wxPanel( this, wxID_ANY );
m_panel->SetBackgroundColour( *wxLIGHT_GREY );
m_topSizer = new wxBoxSizer( wxVERTICAL );
m_panel->SetSizer( m_topSizer );
}
void WX_STATUS_POPUP::updateSize()
{
m_topSizer->Fit( m_panel );
SetClientSize( m_panel->GetSize( ) );
SetClientSize( m_panel->GetSize() );
}
WX_STATUS_POPUP::~WX_STATUS_POPUP()
{
}
void WX_STATUS_POPUP::Popup(wxWindow *focus)
void WX_STATUS_POPUP::Popup( wxWindow* )
{
Show(true);
Show( true );
Raise();
}
void WX_STATUS_POPUP::Move( const wxPoint& aWhere )
{
SetPosition ( aWhere );
}

View File

@ -35,14 +35,14 @@
#include "wx_unit_binder.h"
WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl *aTextInput, wxStaticText *aUnitLabel, wxSpinButton *aSpinButton )
WX_UNIT_BINDER::WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl* aTextInput, wxStaticText* aUnitLabel, wxSpinButton* aSpinButton )
{
// Use the currently selected units
m_units = g_UserUnit;
m_textCtrl = aTextInput;
m_textCtrl->SetValue ( wxT("0") );
m_textCtrl->SetValue( wxT( "0" ) );
m_unitLabel = aUnitLabel;
m_unitLabel->SetLabel ( GetAbbreviatedUnitsLabel (m_units));
m_unitLabel->SetLabel( GetAbbreviatedUnitsLabel( m_units ) );
}
@ -50,15 +50,17 @@ WX_UNIT_BINDER::~WX_UNIT_BINDER()
{
}
void WX_UNIT_BINDER::SetValue( int aValue )
{
wxString s = StringFromValue( m_units, aValue, false );
m_textCtrl->SetValue ( s );
m_textCtrl->SetValue( s );
m_unitLabel->SetLabel ( GetAbbreviatedUnitsLabel (m_units));
m_unitLabel->SetLabel( GetAbbreviatedUnitsLabel( m_units ) );
}
int WX_UNIT_BINDER::GetValue() const
{
wxString s = m_textCtrl->GetValue();
@ -66,8 +68,9 @@ int WX_UNIT_BINDER::GetValue() const
return ValueFromString( m_units, s );
}
void WX_UNIT_BINDER::Enable ( bool aEnable )
void WX_UNIT_BINDER::Enable( bool aEnable )
{
m_textCtrl->Enable ( aEnable );
m_unitLabel->Enable ( aEnable );
}
m_textCtrl->Enable( aEnable );
m_unitLabel->Enable( aEnable );
}

View File

@ -147,7 +147,7 @@ public:
#define BRIGHTENED (1 << 26) ///< item is drawn with a bright contour
#define DP_COUPLED (1 << 27) ///< item is coupled with another item making a differential pair
///< (applies to segments only)
///< (applies to segments only)
#define EDA_ITEM_ALL_FLAGS -1

View File

@ -134,7 +134,7 @@ public:
* removes the item aItem (if exists in the collector).
* @param aItem the item to be removed.
*/
void Remove( const EDA_ITEM *aItem )
void Remove( const EDA_ITEM* aItem )
{
for( size_t i = 0; i < m_List.size(); i++ )
{
@ -257,7 +257,6 @@ public:
return cnt;
}
/**
* Function Collect
* scans an EDA_ITEM using this class's Inspector method, which does

View File

@ -50,7 +50,7 @@ public:
/**
* Function GetSize()
* Returns information about number of vertices stored.
* @param Number of vertices.
* @return Number of vertices.
*/
inline unsigned int GetSize() const
{

View File

@ -206,7 +206,7 @@ public:
return sqrt( SquaredDistance( aP ) );
}
void CanonicalCoefs ( ecoord& qA, ecoord& qB, ecoord& qC) const
void CanonicalCoefs( ecoord& qA, ecoord& qB, ecoord& qC ) const
{
qA = A.y - B.y;
qB = B.x - A.x;
@ -223,8 +223,8 @@ public:
bool Collinear( const SEG& aSeg ) const
{
ecoord qa, qb, qc;
CanonicalCoefs ( qa, qb, qc );
CanonicalCoefs( qa, qb, qc );
ecoord d1 = std::abs( aSeg.A.x * qa + aSeg.A.y * qb + qc );
ecoord d2 = std::abs( aSeg.B.x * qa + aSeg.B.y * qb + qc );
@ -234,23 +234,23 @@ public:
bool ApproxCollinear( const SEG& aSeg ) const
{
ecoord p, q, r;
CanonicalCoefs ( p, q, r );
ecoord dist1 = ( p * aSeg.A.x + q * aSeg.A.y + r ) / sqrt( p * p + q * q );
ecoord dist2 = ( p * aSeg.B.x + q * aSeg.B.y + r ) / sqrt( p * p + q * q );
CanonicalCoefs( p, q, r );
return std::abs(dist1) <= 1 && std::abs(dist2) <= 1;
ecoord dist1 = ( p * aSeg.A.x + q * aSeg.A.y + r ) / sqrt( p * p + q * q );
ecoord dist2 = ( p * aSeg.B.x + q * aSeg.B.y + r ) / sqrt( p * p + q * q );
return std::abs( dist1 ) <= 1 && std::abs( dist2 ) <= 1;
}
bool ApproxParallel ( const SEG& aSeg ) const
{
ecoord p, q, r;
CanonicalCoefs ( p, q, r );
ecoord dist1 = ( p * aSeg.A.x + q * aSeg.A.y + r ) / sqrt( p * p + q * q );
ecoord dist2 = ( p * aSeg.B.x + q * aSeg.B.y + r ) / sqrt( p * p + q * q );
CanonicalCoefs( p, q, r );
return std::abs(dist1 - dist2) <= 1;
ecoord dist1 = ( p * aSeg.A.x + q * aSeg.A.y + r ) / sqrt( p * p + q * q );
ecoord dist2 = ( p * aSeg.B.x + q * aSeg.B.y + r ) / sqrt( p * p + q * q );
return std::abs( dist1 - dist2 ) <= 1;
}
@ -291,7 +291,7 @@ public:
return ( A - B ).SquaredEuclideanNorm();
}
ecoord TCoef ( const VECTOR2I& aP ) const;
ecoord TCoef( const VECTOR2I& aP ) const;
/**
* Function Index()
@ -310,7 +310,7 @@ public:
void Reverse()
{
std::swap ( A, B );
std::swap( A, B );
}
private:
@ -320,7 +320,6 @@ private:
int m_index;
};
inline VECTOR2I SEG::LineProject( const VECTOR2I& aP ) const
{
VECTOR2I d = B - A;
@ -337,7 +336,6 @@ inline VECTOR2I SEG::LineProject( const VECTOR2I& aP ) const
return A + VECTOR2I( xp, yp );
}
inline int SEG::LineDistance( const VECTOR2I& aP, bool aDetermineSide ) const
{
ecoord p = A.y - B.y;
@ -349,10 +347,10 @@ inline int SEG::LineDistance( const VECTOR2I& aP, bool aDetermineSide ) const
return aDetermineSide ? dist : abs( dist );
}
inline SEG::ecoord SEG::TCoef ( const VECTOR2I& aP ) const
inline SEG::ecoord SEG::TCoef( const VECTOR2I& aP ) const
{
VECTOR2I d = B - A;
return d.Dot ( aP - A);
return d.Dot( aP - A);
}
inline const VECTOR2I SEG::NearestPoint( const VECTOR2I& aP ) const
@ -376,7 +374,6 @@ inline const VECTOR2I SEG::NearestPoint( const VECTOR2I& aP ) const
return A + VECTOR2I( xp, yp );
}
inline std::ostream& operator<<( std::ostream& aStream, const SEG& aSeg )
{
aStream << "[ " << aSeg.A << " - " << aSeg.B << " ]";

View File

@ -76,16 +76,15 @@ public:
ALL = 0xff
};
/**
* Enum VIEW_VISIBILITY_FLAGS.
* Defines the visibility of the item (temporarily hidden, invisible, etc).
/**
* Enum VIEW_VISIBILITY_FLAGS.
* Defines the visibility of the item (temporarily hidden, invisible, etc).
*/
enum VIEW_VISIBILITY_FLAGS {
VISIBLE = 0x01, /// Item is visible (in general)
HIDDEN = 0x02 /// Item is temporarily hidden (e.g. being used by a tool). Overrides VISIBLE flag.
};
VIEW_ITEM() : m_view( NULL ), m_flags( VISIBLE ), m_requiredUpdate( ALL ),
m_groups( NULL ), m_groupsSize( 0 ) {}
@ -141,13 +140,14 @@ public:
void ViewSetVisible( bool aIsVisible = true )
{
bool cur_visible = m_flags & VISIBLE;
if( cur_visible != aIsVisible )
{
if(aIsVisible)
if( aIsVisible )
m_flags |= VISIBLE;
else
m_flags &= ~VISIBLE;
ViewUpdate( APPEARANCE | COLOR );
}
}
@ -158,12 +158,12 @@ public:
*
* @param aHide: whether the item is hidden (on all layers), or not.
*/
void ViewHide ( bool aHide = true )
void ViewHide( bool aHide = true )
{
if(! (m_flags & VISIBLE) )
if( !( m_flags & VISIBLE ) )
return;
if(aHide)
if( aHide )
m_flags |= HIDDEN;
else
m_flags &= ~HIDDEN;
@ -242,7 +242,7 @@ protected:
}
VIEW* m_view; ///< Current dynamic view the item is assigned to.
int m_flags; ///< Visibility flags
int m_flags; ///< Visibility flags
int m_requiredUpdate; ///< Flag required for updating
///* Helper for storing cached items group ids
@ -341,7 +341,7 @@ protected:
* Function isRenderable()
* Returns if the item should be drawn or not.
*/
bool isRenderable() const
bool isRenderable() const
{
return m_flags == VISIBLE;
}

View File

@ -41,18 +41,18 @@ class PCB_EDIT_FRAME;
class WX_STATUS_POPUP: public wxPopupWindow
{
public:
WX_STATUS_POPUP ( PCB_EDIT_FRAME *parent );
WX_STATUS_POPUP( PCB_EDIT_FRAME* aParent );
virtual ~WX_STATUS_POPUP();
virtual void Popup(wxWindow *focus = NULL);
virtual void Popup(wxWindow* aFocus = NULL);
virtual void Move( const wxPoint &aWhere );
protected:
void updateSize();
wxPanel *m_panel;
wxBoxSizer *m_topSizer;
wxPanel* m_panel;
wxBoxSizer* m_topSizer;
};
#endif /* __WX_STATUS_POPUP_H_*/

View File

@ -43,7 +43,7 @@ public:
* @param aUnitLabel is the units label displayed next to the text field.
* @param aSpinButton is an optional spin button (for adjusting the input value)
*/
WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl *aTextInput, wxStaticText *aUnitLabel, wxSpinButton *aSpinButton = NULL );
WX_UNIT_BINDER( wxWindow* aParent, wxTextCtrl* aTextInput, wxStaticText* aUnitLabel, wxSpinButton* aSpinButton = NULL );
virtual ~WX_UNIT_BINDER();
@ -64,20 +64,20 @@ public:
* Function Enable
* Enables/diasables the binded widgets
*/
void Enable ( bool aEnable );
void Enable( bool aEnable );
protected:
void onTextChanged ( wxEvent& aEvent );
void onTextChanged( wxEvent& aEvent );
///> Text input control.
wxTextCtrl* m_textCtrl;
///> Label showing currently used units.
wxStaticText* m_unitLabel;
wxStaticText* m_unitLabel;
///> Currently used units.
EDA_UNITS_T m_units;
EDA_UNITS_T m_units;
///> Step size (added/subtracted difference if spin buttons are used).
int m_step;

View File

@ -69,7 +69,7 @@ public:
/// skip the linked list stuff, and parent
const DRAWSEGMENT& operator = ( const DRAWSEGMENT& rhs );
static inline bool ClassOf( const EDA_ITEM *aItem )
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_LINE_T == aItem->Type();
}

View File

@ -815,12 +815,14 @@ void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
}
}
const BOX2I MODULE::ViewBBox() const
{
return BOX2I( VECTOR2I( GetFootprintRect().GetOrigin() ),
VECTOR2I( GetFootprintRect().GetSize() ) );
VECTOR2I( GetFootprintRect().GetSize() ) );
}
void MODULE::ViewUpdate( int aUpdateFlags )
{
if( !m_view )
@ -1115,6 +1117,7 @@ void MODULE::SetOrientation( double newangle )
CalculateBoundingBox();
}
double MODULE::PadCoverageRatio() const
{
double padArea = 0.0;
@ -1128,5 +1131,5 @@ double MODULE::PadCoverageRatio() const
double ratio = padArea / moduleArea;
return std::min(ratio, 1.0);
return std::min( ratio, 1.0 );
}

View File

@ -262,7 +262,8 @@ public:
m_ModuleStatus &= ~MODULE_to_PLACE;
}
bool PadsLocked() const { return (m_ModuleStatus & MODULE_PADS_LOCKED ); }
bool PadsLocked() const { return ( m_ModuleStatus & MODULE_PADS_LOCKED ); }
void SetPadsLocked( bool aPadsLocked )
{
if( aPadsLocked )
@ -569,9 +570,9 @@ public:
m_initial_comments = aInitialComments;
}
/**
* Function PadCoverageRatio
* Calculates the ratio of total area of the footprint pads to the area of the
/**
* Function PadCoverageRatio
* Calculates the ratio of total area of the footprint pads to the area of the
* footprint. Used by selection tool heuristics.
* @return the ratio
*/

View File

@ -94,7 +94,7 @@ public:
///< used for edge board connectors
static LSET UnplatedHoleMask(); ///< layer set for a mechanical unplated through hole pad
static inline bool ClassOf( const EDA_ITEM *aItem )
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_PAD_T == aItem->Type();
}

View File

@ -49,7 +49,7 @@ public:
~TEXTE_PCB();
static inline bool ClassOf( const EDA_ITEM *aItem )
static inline bool ClassOf( const EDA_ITEM* aItem )
{
return aItem && PCB_TEXT_T == aItem->Type();
}

View File

@ -313,9 +313,9 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
break;
}
if (m_CurrentModule->IsLocked() )
if( m_CurrentModule->IsLocked() )
m_AutoPlaceCtrl->SetSelection( 2 );
else if (m_CurrentModule->PadsLocked() )
else if( m_CurrentModule->PadsLocked() )
m_AutoPlaceCtrl->SetSelection( 1 );
else
m_AutoPlaceCtrl->SetSelection( 0 );

View File

@ -27,23 +27,22 @@
DIALOG_PNS_DIFF_PAIR_DIMENSIONS::DIALOG_PNS_DIFF_PAIR_DIMENSIONS( wxWindow* aParent, PNS_SIZES_SETTINGS& aSizes ) :
DIALOG_PNS_DIFF_PAIR_DIMENSIONS_BASE( aParent ),
m_traceWidth ( this, m_traceWidthText, m_traceWidthUnit ),
m_traceGap (this, m_traceGapText, m_traceGapUnit ),
m_viaGap ( this, m_viaGapText, m_viaGapUnit ),
m_traceWidth( this, m_traceWidthText, m_traceWidthUnit ),
m_traceGap( this, m_traceGapText, m_traceGapUnit ),
m_viaGap( this, m_viaGapText, m_viaGapUnit ),
m_sizes( aSizes )
{
m_traceWidth.SetValue ( aSizes.DiffPairWidth() );
m_traceGap.SetValue ( aSizes.DiffPairGap() );
m_viaGap.SetValue ( aSizes.DiffPairViaGap() );
m_viaTraceGapEqual->SetValue ( m_sizes.DiffPairViaGapSameAsTraceGap() );
m_traceWidth.SetValue( aSizes.DiffPairWidth() );
m_traceGap.SetValue( aSizes.DiffPairGap() );
m_viaGap.SetValue( aSizes.DiffPairViaGap() );
m_viaTraceGapEqual->SetValue( m_sizes.DiffPairViaGapSameAsTraceGap() );
updateCheckbox();
}
void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::updateCheckbox()
{
printf("Checked: %d", m_viaTraceGapEqual->GetValue());
if( m_viaTraceGapEqual->GetValue() )
{
m_sizes.SetDiffPairViaGapSameAsTraceGap( true );
@ -58,6 +57,7 @@ void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::updateCheckbox()
}
}
void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::OnClose( wxCloseEvent& aEvent )
{
// Do nothing, it is result of ESC pressing
@ -71,7 +71,7 @@ void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::OnOkClick( wxCommandEvent& aEvent )
m_sizes.SetDiffPairGap ( m_traceGap.GetValue() );
m_sizes.SetDiffPairViaGap ( m_viaGap.GetValue() );
m_sizes.SetDiffPairWidth ( m_traceWidth.GetValue() );
// todo: verify against design rules
EndModal( 1 );
}
@ -83,9 +83,10 @@ void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::OnCancelClick( wxCommandEvent& aEvent )
EndModal( 0 );
}
void DIALOG_PNS_DIFF_PAIR_DIMENSIONS::OnViaTraceGapEqualCheck( wxCommandEvent& event )
{
event.Skip();
updateCheckbox();
}

View File

@ -33,23 +33,22 @@ class PNS_SIZES_SETTINGS;
class DIALOG_PNS_DIFF_PAIR_DIMENSIONS : public DIALOG_PNS_DIFF_PAIR_DIMENSIONS_BASE
{
public:
DIALOG_PNS_DIFF_PAIR_DIMENSIONS( wxWindow* aParent, PNS_SIZES_SETTINGS& aSizes );
public:
DIALOG_PNS_DIFF_PAIR_DIMENSIONS( wxWindow* aParent, PNS_SIZES_SETTINGS& aSizes );
virtual void OnClose( wxCloseEvent& aEvent );
virtual void OnOkClick( wxCommandEvent& aEvent );
virtual void OnCancelClick( wxCommandEvent& aEvent );
virtual void OnViaTraceGapEqualCheck( wxCommandEvent& event );
virtual void OnClose( wxCloseEvent& aEvent );
virtual void OnOkClick( wxCommandEvent& aEvent );
virtual void OnCancelClick( wxCommandEvent& aEvent );
virtual void OnViaTraceGapEqualCheck( wxCommandEvent& event );
private:
void updateCheckbox( );
private:
void updateCheckbox();
WX_UNIT_BINDER m_traceWidth;
WX_UNIT_BINDER m_traceGap;
WX_UNIT_BINDER m_viaGap;
WX_UNIT_BINDER m_traceWidth;
WX_UNIT_BINDER m_traceGap;
WX_UNIT_BINDER m_viaGap;
PNS_SIZES_SETTINGS& m_sizes;
PNS_SIZES_SETTINGS& m_sizes;
};
#endif // __dialog_pns_settings__

View File

@ -20,63 +20,59 @@
/**
* Length tuner settings dialog.
*/
*/
#include "dialog_pns_length_tuning_settings.h"
#include <router/pns_meander_placer.h>
DIALOG_PNS_LENGTH_TUNING_SETTINGS::DIALOG_PNS_LENGTH_TUNING_SETTINGS( wxWindow* aParent, PNS_MEANDER_SETTINGS& aSettings, PNS_ROUTER_MODE aMode ) :
DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE( aParent ),
m_minAmpl ( this, m_minAmplText, m_minAmplUnit ),
m_maxAmpl (this, m_maxAmplText, m_maxAmplUnit ),
m_spacing ( this, m_spacingText, m_spacingUnit ),
m_targetLength ( this, m_targetLengthText, m_targetLengthUnit ),
m_minAmpl( this, m_minAmplText, m_minAmplUnit ),
m_maxAmpl( this, m_maxAmplText, m_maxAmplUnit ),
m_spacing( this, m_spacingText, m_spacingUnit ),
m_targetLength( this, m_targetLengthText, m_targetLengthUnit ),
m_settings( aSettings ),
m_mode ( aMode )
m_mode( aMode )
{
m_miterStyle->Enable ( false );
m_radiusText->Enable ( aMode != PNS_MODE_TUNE_DIFF_PAIR );
m_miterStyle->Enable( false );
m_radiusText->Enable( aMode != PNS_MODE_TUNE_DIFF_PAIR );
//m_minAmpl.Enable ( aMode != PNS_MODE_TUNE_DIFF_PAIR_SKEW );
m_minAmpl.SetValue ( m_settings.m_minAmplitude );
m_maxAmpl.SetValue ( m_settings.m_maxAmplitude );
m_spacing.SetValue ( m_settings.m_spacing );
m_radiusText->SetValue ( wxString::Format(wxT("%i"), m_settings.m_cornerRadiusPercentage) );
m_minAmpl.SetValue( m_settings.m_minAmplitude );
m_maxAmpl.SetValue( m_settings.m_maxAmplitude );
m_miterStyle->SetSelection ( m_settings.m_cornerType == PNS_MEANDER_SETTINGS::ROUND ? 1 : 0 );
m_spacing.SetValue( m_settings.m_spacing );
m_radiusText->SetValue( wxString::Format( wxT( "%i" ), m_settings.m_cornerRadiusPercentage ) );
m_miterStyle->SetSelection( m_settings.m_cornerType == PNS_MEANDER_SETTINGS::ROUND ? 1 : 0 );
switch( aMode )
{
case PNS_MODE_TUNE_SINGLE:
SetTitle ( _("Single track length tuning") );
SetTitle( _( "Single track length tuning" ) );
m_legend->SetBitmap( KiBitmap( tune_single_track_length_legend_xpm ) );
m_targetLength.SetValue ( m_settings.m_targetLength );
m_targetLength.SetValue( m_settings.m_targetLength );
break;
case PNS_MODE_TUNE_DIFF_PAIR:
SetTitle ( _("Differential pair length tuning") );
SetTitle( _( "Differential pair length tuning" ) );
m_legend->SetBitmap( KiBitmap( tune_diff_pair_length_legend_xpm ) );
m_targetLength.SetValue ( m_settings.m_targetLength );
m_targetLength.SetValue( m_settings.m_targetLength );
break;
case PNS_MODE_TUNE_DIFF_PAIR_SKEW:
SetTitle ( _("Differential pair skew tuning") );
SetTitle( _( "Differential pair skew tuning" ) );
m_legend->SetBitmap( KiBitmap( tune_diff_pair_skew_legend_xpm ) );
m_targetLengthLabel->SetLabel( _("Target skew: ") );
m_targetLengthLabel->SetLabel( _( "Target skew: " ) );
m_targetLength.SetValue ( m_settings.m_targetSkew );
break;
default:
break;
}
m_stdButtonsOK->SetDefault();
m_targetLengthText->SetSelection(-1, -1);
m_targetLengthText->SetSelection( -1, -1 );
m_targetLengthText->SetFocus();
}
@ -90,26 +86,22 @@ void DIALOG_PNS_LENGTH_TUNING_SETTINGS::OnClose( wxCloseEvent& aEvent )
void DIALOG_PNS_LENGTH_TUNING_SETTINGS::OnOkClick( wxCommandEvent& aEvent )
{
// fixme: use validators and TransferDataFromWindow
m_settings.m_minAmplitude = m_minAmpl.GetValue();
m_settings.m_maxAmplitude = m_maxAmpl.GetValue();
m_settings.m_spacing = m_spacing.GetValue();
m_settings.m_cornerRadiusPercentage = wxAtoi( m_radiusText->GetValue() );
if (m_mode == PNS_MODE_TUNE_DIFF_PAIR_SKEW)
if( m_mode == PNS_MODE_TUNE_DIFF_PAIR_SKEW )
m_settings.m_targetSkew = m_targetLength.GetValue();
else
m_settings.m_targetLength = m_targetLength.GetValue();
if ( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
if( m_settings.m_maxAmplitude < m_settings.m_minAmplitude )
m_settings.m_maxAmplitude = m_settings.m_maxAmplitude;
m_settings.m_cornerType = m_miterStyle->GetSelection( ) ? PNS_MEANDER_SETTINGS::CHAMFER : PNS_MEANDER_SETTINGS::ROUND;
m_settings.m_cornerType = m_miterStyle->GetSelection() ? PNS_MEANDER_SETTINGS::CHAMFER : PNS_MEANDER_SETTINGS::ROUND;
EndModal( 1 );
}

View File

@ -35,22 +35,21 @@ class PNS_MEANDER_SETTINGS;
class DIALOG_PNS_LENGTH_TUNING_SETTINGS : public DIALOG_PNS_LENGTH_TUNING_SETTINGS_BASE
{
public:
DIALOG_PNS_LENGTH_TUNING_SETTINGS( wxWindow* aParent, PNS_MEANDER_SETTINGS& aSettings, PNS_ROUTER_MODE aMode );
public:
DIALOG_PNS_LENGTH_TUNING_SETTINGS( wxWindow* aParent, PNS_MEANDER_SETTINGS& aSettings, PNS_ROUTER_MODE aMode );
virtual void OnClose( wxCloseEvent& aEvent );
virtual void OnOkClick( wxCommandEvent& aEvent );
virtual void OnCancelClick( wxCommandEvent& aEvent );
private:
virtual void OnClose( wxCloseEvent& aEvent );
virtual void OnOkClick( wxCommandEvent& aEvent );
virtual void OnCancelClick( wxCommandEvent& aEvent );
WX_UNIT_BINDER m_minAmpl;
WX_UNIT_BINDER m_maxAmpl;
WX_UNIT_BINDER m_spacing;
WX_UNIT_BINDER m_targetLength;
private:
WX_UNIT_BINDER m_minAmpl;
WX_UNIT_BINDER m_maxAmpl;
WX_UNIT_BINDER m_spacing;
WX_UNIT_BINDER m_targetLength;
PNS_MEANDER_SETTINGS& m_settings;
PNS_ROUTER_MODE m_mode;
PNS_MEANDER_SETTINGS& m_settings;
PNS_ROUTER_MODE m_mode;
};
#endif // __dialog_pns_settings__

File diff suppressed because it is too large Load Diff

View File

@ -42,16 +42,16 @@ DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SE
m_viaDrill.SetValue( m_settings.GetCustomViaDrill() );
m_trackWidthText->SetFocus();
m_trackWidthText->SetSelection(-1, -1);
m_trackWidthText->SetSelection( -1, -1 );
m_stdButtonsOK->SetDefault();
// Pressing ENTER when any of the text input fields is active applies changes
#if wxCHECK_VERSION( 3, 0, 0 )
Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( DIALOG_TRACK_VIA_SIZE::onOkClick ), NULL, this );
#else
Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_TRACK_VIA_SIZE::onOkClick ), NULL, this );
#endif
Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_TRACK_VIA_SIZE::onClose ) );
}

View File

@ -34,26 +34,25 @@ class BOARD_DESIGN_SETTINGS;
/** Implementing DIALOG_TRACK_VIA_SIZE_BASE */
class DIALOG_TRACK_VIA_SIZE : public DIALOG_TRACK_VIA_SIZE_BASE
{
public:
/** Constructor */
DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SETTINGS& aSettings );
public:
/** Constructor */
DIALOG_TRACK_VIA_SIZE( wxWindow* aParent, BOARD_DESIGN_SETTINGS& aSettings );
protected:
protected:
WX_UNIT_BINDER m_trackWidth;
WX_UNIT_BINDER m_viaDiameter;
WX_UNIT_BINDER m_viaDrill;
WX_UNIT_BINDER m_trackWidth;
WX_UNIT_BINDER m_viaDiameter;
WX_UNIT_BINDER m_viaDrill;
// Routings settings that are modified by the dialog.
BOARD_DESIGN_SETTINGS& m_settings;
// Routings settings that are modified by the dialog.
BOARD_DESIGN_SETTINGS& m_settings;
///> Checks if values given in the dialog are sensible.
bool check();
///> Checks if values given in the dialog are sensible.
bool check();
// Handlers for DIALOG_TRACK_VIA_SIZE_BASE events.
void onClose( wxCloseEvent& aEvent );
void onOkClick( wxCommandEvent& aEvent );
void onCancelClick( wxCommandEvent& aEvent );
// Handlers for DIALOG_TRACK_VIA_SIZE_BASE events.
void onClose( wxCloseEvent& aEvent );
void onOkClick( wxCommandEvent& aEvent );
void onCancelClick( wxCommandEvent& aEvent );
};
#endif // __dialog_track_via_size__

View File

@ -63,7 +63,7 @@ static void DisplayCmpDoc( wxString& aName, void* aData );
static FOOTPRINT_LIST MList;
static void clearModuleItemFlags ( BOARD_ITEM *aItem )
static void clearModuleItemFlags( BOARD_ITEM* aItem )
{
aItem->ClearFlags();
}

View File

@ -515,7 +515,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "Configure Interactive Routing." ),
KiBitmap( add_tracks_xpm ) ); // fixme: icon
//--- dimensions submenu ------------------------------------------------------
wxMenu* dimensionsMenu = new wxMenu;

Some files were not shown because too many files have changed in this diff Show More