53 switch( aFootprintShape )
56 msg =
_(
"Gap Size:" );
57 cmp_name = wxT(
"muwave_gap" );
62 msg =
_(
"Stub Size:" );
63 cmp_name = wxT(
"muwave_stub" );
69 msg =
_(
"Arc Stub Radius Value:" );
70 cmp_name = wxT(
"muwave_arcstub" );
82 if( dlg.ShowQuasiModal() != wxID_OK )
85 value = dlg.GetValue();
92 double fcoeff = 10.0, fval;
93 msg.Printf( wxT(
"%3.1f" ),
angle / fcoeff );
95 _(
"Create Microwave Footprint" ), msg );
102 if( !msg.ToDouble( &fval ) )
121 switch( aFootprintShape )
124 oX = -( gap_size +
pad->GetSize().x ) / 2;
127 pad->SetX(
pad->GetPos0().x +
pad->GetPosition().x );
131 pad->SetX0( oX + gap_size +
pad->GetSize().x );
132 pad->SetX(
pad->GetPos0().x +
pad->GetPosition().x );
136 pad->SetNumber( wxT(
"1" ) );
138 pad->SetY0( -( gap_size +
pad->GetSize().y ) / 2 );
139 pad->SetSize( wxSize(
pad->GetSize().x, gap_size ) );
140 pad->SetY(
pad->GetPos0().y +
pad->GetPosition().y );
148 int numPoints = (
angle / 50 ) + 3;
149 std::vector<wxPoint> polyPoints;
150 polyPoints.reserve( numPoints );
152 polyPoints.emplace_back( wxPoint( 0, 0 ) );
154 int theta = -
angle / 2;
156 for(
int ii = 1; ii < numPoints - 1; ii++ )
158 wxPoint pt( 0, -gap_size );
160 polyPoints.push_back( pt );
164 if( theta >
angle / 2 )
169 polyPoints.push_back( polyPoints[0] );
171 pad->AddPrimitivePoly( polyPoints, 0,
true );
187 int aTextSize,
int aPadCount )
214 pad->SetSize( wxSize( tw, tw ) );
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
wxString GetValue() const
void OnModify() override
Must be called after a board change to set the modified flag.
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Returns the BOARD_DESIGN_SETTINGS for the open project.
int GetCurrentTrackWidth() const
This file is part of the common library.
FOOTPRINT * CreateNewFootprint(const wxString &aFootprintName, bool aQuiet=false)
Creates a new footprint, at position 0,0.
A KICAD version of wxTextEntryDialog which supports the various improvements/work-arounds from DIALOG...
Smd pad, appears on the solder paste layer (default)
void SetTextSize(const wxSize &aNewSize)
void RotatePoint(int *pX, int *pY, double angle)
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static DIRECTION_45::AngleType angle(const VECTOR2I &a, const VECTOR2I &b)
The main frame for Pcbnew.
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
EDA_UNITS GetUserUnits() const
Return the user units currently in use.