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 118 of file microwave_tool.cpp.

References PCB_EDIT_FRAME::Create_MuWaveComponent(), PCB_EDIT_FRAME::Create_MuWavePolygonShape(), MICROWAVE_TOOL_INFO::creatorFunc, PCB_TOOL::frame(), 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().

119 {
120  MICROWAVE_TOOL_INFO info;
121 
122  switch( aParam )
123  {
125  info.name = _( "Add Gap" );
127  info.creatorFunc = [&frame] () {
128  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 0 ) );
129  };
130  break;
131 
133  info.name = _( "Add Stub" );
135  info.creatorFunc = [&frame] () {
136  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 1 ) );
137  };
138  break;
139 
141  info.name = _( "Add Stub (Arc)" );
143  info.creatorFunc = [&frame] () {
144  return std::unique_ptr<MODULE>( frame.Create_MuWaveComponent( 2 ) );
145  };
146  break;
147 
149  info.name = _( "Add Polynomial Shape" );
151  info.creatorFunc = [&frame] () {
152  return std::unique_ptr<MODULE>( frame.Create_MuWavePolygonShape() );
153  };
154  break;
155 
156  default:
157  // Avoid uninitilized value:
158  info.toolId = 0;
159  // info.name is already set to empty string
160  break;
161  };
162 
163  return info;
164 }
MODULE * Create_MuWavePolygonShape()
Definition: microwave.cpp:577
MODULE * Create_MuWaveComponent(int shape_type)
Create_MuWaveComponent creates a module "GAP" or "STUB" used in micro wave designs.
Definition: microwave.cpp:228

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 271 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 267 of file microwave_tool.cpp.