KiCad PCB EDA Suite
microwave_tool.cpp File Reference

Go to the source code of this file.

Classes

struct  MICROWAVE_TOOL_INFO
 

Enumerations

enum  MWAVE_TOOL_SIMPLE_ID { GAP, STUB, STUB_ARC, FUNCTION_SHAPE }
 

Type of items that are "simple" - just get placed on the board directly, without a graphical interactive setup stage

More...
 

Functions

MICROWAVE_TOOL_INFO getMicrowaveItemCreator (PCB_EDIT_FRAME &frame, int aParam)
 

Variables

static const COLOR4D inductorAreaFill (0.3, 0.3, 0.5, 0.3)
 
static const COLOR4D inductorAreaStroke (0.4, 1.0, 1.0, 1.0)
 
static const double inductorAreaStrokeWidth = 1.0
 
static const double inductorAreaAspect = 0.5
 

Aspect of the preview rectangle - this is hardcoded in the microwave backend for now

More...
 

Enumeration Type Documentation

Type of items that are "simple" - just get placed on the board directly, without a graphical interactive setup stage

Enumerator
GAP 
STUB 
STUB_ARC 
FUNCTION_SHAPE 

Definition at line 54 of file microwave_tool.cpp.

Function Documentation

MICROWAVE_TOOL_INFO getMicrowaveItemCreator ( PCB_EDIT_FRAME frame,
int  aParam 
)

Definition at line 137 of file microwave_tool.cpp.

References PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), MICROWAVE_TOOL_INFO::creatorFunc, FUNCTION_SHAPE, GAP, ID_PCB_MUWAVE_TOOL_FUNCTION_SHAPE_CMD, ID_PCB_MUWAVE_TOOL_GAP_CMD, ID_PCB_MUWAVE_TOOL_STUB_ARC_CMD, ID_PCB_MUWAVE_TOOL_STUB_CMD, MICROWAVE_TOOL_INFO::name, STUB, STUB_ARC, and MICROWAVE_TOOL_INFO::toolId.

Referenced by MICROWAVE_TOOL::addMicrowaveFootprint().

138 {
139  MICROWAVE_TOOL_INFO info;
140 
141  switch( aParam )
142  {
144  info.name = _( "Add Gap" );
146  info.creatorFunc = [&frame] () {
147  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 0 ) );
148  };
149  break;
150 
152  info.name = _( "Add Stub" );
154  info.creatorFunc = [&frame] () {
155  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 1 ) );
156  };
157  break;
158 
160  info.name = _( "Add Stub (Arc)" );
162  info.creatorFunc = [&frame] () {
163  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 2 ) );
164  };
165  break;
166 
168  info.name = _( "Add Polynomial Shape" );
170  info.creatorFunc = [&frame] () {
171  return std::unique_ptr<MODULE>( frame.Create_MuWavePolygonShape() );
172  };
173  break;
174 
175  default:
176  // Avoid uninitilized value:
177  info.toolId = 0;
178  // info.name is already set to empty string
179  break;
180  };
181 
182  return info;
183 }
MODULE * Create_MuWavePolygonShape()
Definition: muonde.cpp:579
MODULE * Create_MuWaveComponent(int shape_type)
Create_MuWaveComponent creates a module "GAP" or "STUB" used in micro wave designs.
Definition: muonde.cpp:226

Variable Documentation

const double inductorAreaAspect = 0.5
static

Aspect of the preview rectangle - this is hardcoded in the microwave backend for now

Definition at line 289 of file microwave_tool.cpp.

const COLOR4D inductorAreaFill(0.3, 0.3, 0.5, 0.3)
static
const COLOR4D inductorAreaStroke(0.4, 1.0, 1.0, 1.0)
static
const double inductorAreaStrokeWidth = 1.0
static

Definition at line 285 of file microwave_tool.cpp.