54 switch( aFootprintShape )
56 case MICROWAVE_FOOTPRINT_SHAPE::GAP:
57 msg =
_(
"Gap Size:" );
58 cmp_name = wxT(
"muwave_gap" );
62 case MICROWAVE_FOOTPRINT_SHAPE::STUB:
63 msg =
_(
"Stub Size:" );
64 cmp_name = wxT(
"muwave_stub" );
69 case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC:
70 msg =
_(
"Arc Stub Radius Value:" );
71 cmp_name = wxT(
"muwave_arcstub" );
92 if( aFootprintShape == MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC )
96 _(
"Create Microwave Footprint" ), msg );
106 if( !msg.ToDouble( &fval ) )
128 switch( aFootprintShape )
130 case MICROWAVE_FOOTPRINT_SHAPE::GAP:
131 offsetX = -( gap_size +
pad->GetSize().x ) / 2;
133 pad->SetX(
pad->GetPosition().x + offsetX );
137 pad->SetX(
pad->GetPosition().x + offsetX + gap_size +
pad->GetSize().x );
140 case MICROWAVE_FOOTPRINT_SHAPE::STUB:
141 pad->SetNumber( wxT(
"1" ) );
142 offsetY = -( gap_size +
pad->GetSize().y ) / 2;
146 pad->SetY(
pad->GetPosition().y + offsetY );
149 case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC:
151 pad->SetShape( PAD_SHAPE::CUSTOM );
152 pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
154 int numPoints = ( angle.
AsDegrees() / 5.0 ) + 3;
155 std::vector<VECTOR2I> polyPoints;
156 polyPoints.reserve( numPoints );
158 polyPoints.emplace_back(
VECTOR2I( 0, 0 ) );
162 for(
int ii = 1; ii < numPoints - 1; ii++ )
166 polyPoints.push_back( pt );
170 if( theta > angle / 2 )
175 polyPoints.push_back( polyPoints[0] );
177 pad->AddPrimitivePoly( polyPoints, 0,
true );
193 int aTextSize,
int aPadCount )
223 pad->SetShape( PAD_SHAPE::RECTANGLE );
224 pad->SetAttribute( PAD_ATTRIB::SMD );
227 pad->SetNumber( wxString::Format( wxT(
"%d" ), pad_num ) );
int GetCurrentTrackWidth() const
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
FOOTPRINT * CreateNewFootprint(wxString aFootprintName, const wxString &aLibName)
Creates a new footprint, at position 0,0.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
The main frame for Pcbnew.
void OnModify() override
Must be called after a board change to set the modified flag.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int ValueFromString(const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aTextValue in aUnits to internal units used by the frame.
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
wxString GetValue() const
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
static constexpr EDA_ANGLE ANGLE_0
static constexpr EDA_ANGLE ANGLE_180
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I