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" );
91 if( aFootprintShape == MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC )
95 _(
"Create Microwave Footprint" ), msg );
104 if( !msg.ToDouble( &fval ) )
126 switch( aFootprintShape )
128 case MICROWAVE_FOOTPRINT_SHAPE::GAP:
129 offsetX = -( gap_size +
pad->GetSize().x ) / 2;
131 pad->SetX(
pad->GetPosition().x + offsetX );
135 pad->SetX(
pad->GetPosition().x + offsetX + gap_size +
pad->GetSize().x );
138 case MICROWAVE_FOOTPRINT_SHAPE::STUB:
139 pad->SetNumber( wxT(
"1" ) );
140 offsetY = -( gap_size +
pad->GetSize().y ) / 2;
144 pad->SetY(
pad->GetPosition().y + offsetY );
147 case MICROWAVE_FOOTPRINT_SHAPE::STUB_ARC:
149 pad->SetShape( PAD_SHAPE::CUSTOM );
150 pad->SetAnchorPadShape( PAD_SHAPE::RECTANGLE );
152 int numPoints = ( angle.
AsDegrees() / 5.0 ) + 3;
153 std::vector<VECTOR2I> polyPoints;
154 polyPoints.reserve( numPoints );
156 polyPoints.emplace_back(
VECTOR2I( 0, 0 ) );
160 for(
int ii = 1; ii < numPoints - 1; ii++ )
164 polyPoints.push_back( pt );
168 if( theta > angle / 2 )
173 polyPoints.push_back( polyPoints[0] );
175 pad->AddPrimitivePoly( polyPoints, 0,
true );
191 int aTextSize,
int aPadCount )
221 pad->SetShape( PAD_SHAPE::RECTANGLE );
222 pad->SetAttribute( PAD_ATTRIB::SMD );
225 pad->SetNumber( wxString::Format( wxT(
"%d" ), pad_num ) );
int GetCurrentTrackWidth() const
void SetTextSize(VECTOR2I aNewSize)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName, const wxString &aLibName, bool aQuiet)
Creates a new footprint, at position 0,0.
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_180
static constexpr EDA_ANGLE & ANGLE_0
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.