KiCad PCB EDA Suite
DSN Namespace Reference

This source file implements export and import capabilities to the specctra dsn file format. More...

Classes

class  ANCESTOR
 
class  BOUNDARY
 
class  CIRCLE
 
class  CLASS
 Class CLASS corresponds to the <class_descriptor> in the specctra spec. More...
 
class  CLASS_CLASS
 
class  CLASSES
 
class  COMP_ORDER
 Class COMP_ORDER corresponds to the <component_order_descriptor>. More...
 
class  COMPONENT
 Class COMPONENT implements the <component_descriptor> in the specctra dsn spec. More...
 
class  CONNECT
 
class  CONTROL
 
class  COPPER_PLANE
 Class COPPER_PLANE corresponds to a <plane_descriptor> in the specctra dsn spec. More...
 
class  ELEM
 Class ELEM is a base class for any DSN element class. More...
 
class  ELEM_HOLDER
 Class ELEM_HOLDER is a holder for any DSN class. More...
 
class  FROMTO
 
class  GRID
 
class  HISTORY
 
class  IMAGE
 
class  KEEPOUT
 Class KEEPOUT is used for <keepout_descriptor> and <plane_descriptor>. More...
 
class  LAYER
 
class  LAYER_NOISE_WEIGHT
 
class  LAYER_RULE
 
class  LIBRARY
 Class LIBRARY corresponds to the <library_descriptor> in the specctra dsn specification. More...
 
class  NET
 Class NET corresponds to a <net_descriptor> in the DSN spec. More...
 
class  NET_OUT
 Class NET_OUT corresponds to the <net_out_descriptor> of the specctra dsn spec. More...
 
class  NETWORK
 
class  PADSTACK
 Class PADSTACK holds either a via or a pad definition. More...
 
class  PARSER
 Class PARSER is simply a configuration record per the SPECCTRA DSN file spec. More...
 
class  PATH
 Class PATH supports both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec. More...
 
class  PCB
 
class  PIN
 
struct  PIN_PAIR
 Struct PIN_PAIR is used within the WAS_IS class below to hold a pair of PIN_REFs and corresponds to the (pins was is) construct within the specctra dsn spec. More...
 
struct  PIN_REF
 Class PIN_REF corresponds to the <pin_reference> definition in the specctra dsn spec. More...
 
class  PLACE
 Class PLACE implements the <placement_reference> in the specctra dsn spec. More...
 
class  PLACEMENT
 
struct  POINT
 Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system. More...
 
struct  PROPERTY
 
class  QARC
 
class  RECTANGLE
 
class  REGION
 
class  ROUTE
 
class  RULE
 Class RULE corresponds to the <rule_descriptor> in the specctra dsn spec. More...
 
class  SESSION
 Class SESSION corresponds to the <session_file_descriptor> in the specctra dsn spec. More...
 
class  SHAPE
 Class SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec. More...
 
class  SPECCTRA_DB
 Class SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file. More...
 
class  SPECCTRA_LAYER_PAIR
 
class  STRINGPROP
 Class STRINGPROP is a container for a single property whose value is a string. More...
 
class  STRUCTURE
 
class  STRUCTURE_OUT
 
class  SUPPLY_PIN
 Class SUPPLY_PIN corresponds to the <supply_pin_descriptor> in the specctra dsn spec. More...
 
class  TOKPROP
 Class TOKPROP is a container for a single property whose value is another DSN_T token. More...
 
class  TOPOLOGY
 
class  UNIT_RES
 Class UNIT_RES is a holder for either a T_unit or T_resolution object which are usually mutually exclusive in the dsn grammar, except within the T_pcb level. More...
 
class  VIA
 Class VIA corresponds to the <via_descriptor> in the specctra dsn spec. More...
 
class  WAS_IS
 Class WAS_IS corresponds to the <was_is_descriptor> in the specctra dsn spec. More...
 
class  WINDOW
 
class  WIRE
 Class WIRE corresponds to <wire_shape_descriptor> in the specctra dsn spec. More...
 
class  WIRE_VIA
 Class WIRE_VIA corresponds to <wire_via_descriptor> in the specctra dsn spec. More...
 
class  WIRING
 Class WIRING corresponds to <wiring_descriptor> in the specctra dsn spec. More...
 

Typedefs

typedef std::vector< std::string > STRINGS
 
typedef std::vector< POINTPOINTS
 
typedef std::vector< PROPERTYPROPERTIES
 
typedef boost::ptr_vector< LAYER_RULELAYER_RULES
 
typedef boost::ptr_vector< PATHPATHS
 
typedef boost::ptr_vector< WINDOWWINDOWS
 
typedef boost::ptr_vector< KEEPOUTKEEPOUTS
 
typedef boost::ptr_vector< LAYERLAYERS
 
typedef boost::ptr_vector< SPECCTRA_LAYER_PAIRSPECCTRA_LAYER_PAIRS
 
typedef boost::ptr_vector< COPPER_PLANECOPPER_PLANES
 
typedef boost::ptr_vector< PLACEPLACES
 
typedef boost::ptr_vector< COMPONENTCOMPONENTS
 
typedef boost::ptr_vector< PINPINS
 
typedef boost::ptr_vector< IMAGEIMAGES
 
typedef boost::ptr_vector< PADSTACKPADSTACKS
 
typedef std::vector< PIN_REFPIN_REFS
 
typedef boost::ptr_vector< FROMTOFROMTOS
 
typedef boost::ptr_vector< COMP_ORDERCOMP_ORDERS
 
typedef boost::ptr_vector< NETNETS
 
typedef boost::ptr_vector< CLASSCLASSLIST
 
typedef boost::ptr_vector< WIREWIRES
 
typedef boost::ptr_vector< WIRE_VIAWIRE_VIAS
 
typedef boost::ptr_vector< ANCESTORANCESTORS
 
typedef boost::ptr_vector< SUPPLY_PINSUPPLY_PINS
 
typedef boost::ptr_vector< NET_OUTNET_OUTS
 
typedef std::vector< PIN_PAIRPIN_PAIRS
 
typedef boost::ptr_set< PADSTACKPADSTACKSET
 
typedef std::map< wxString, int > PINMAP
 data type used to ensure unique-ness of pin names, holding (wxString and int) More...
 
typedef std::set< std::string > STRINGSET
 
typedef std::pair< STRINGSET::iterator, bool > STRINGSET_PAIR
 

Enumerations

enum  T {
  T_NONE = DSN_NONE, T_COMMENT = DSN_COMMENT, T_STRING_QUOTE = DSN_STRING_QUOTE, T_QUOTE_DEF = DSN_QUOTE_DEF,
  T_DASH = DSN_DASH, T_SYMBOL = DSN_SYMBOL, T_NUMBER = DSN_NUMBER, T_RIGHT = DSN_RIGHT,
  T_LEFT = DSN_LEFT, T_STRING = DSN_STRING, T_EOF = DSN_EOF, T_absolute = 0,
  T_add_group, T_add_pins, T_added, T_allow_antenna,
  T_allow_redundant_wiring, T_amp, T_ancestor, T_antipad,
  T_aperture_type, T_array, T_attach, T_attr,
  T_average_pair_length, T_back, T_base_design, T_bbv_ctr2ctr,
  T_bend_keepout, T_bond, T_both, T_bottom,
  T_bottom_layer_sel, T_boundary, T_brickpat, T_bundle,
  T_bus, T_bypass, T_capacitance_resolution, T_capacitor,
  T_case_sensitive, T_cct1, T_cct1a, T_center_center,
  T_checking_trim_by_pin, T_circ, T_circle, T_circuit,
  T_class, T_class_class, T_classes, T_clear,
  T_clearance, T_cluster, T_cm, T_color,
  T_colors, T_comment, T_comp, T_comp_edge_center,
  T_comp_order, T_component, T_composite, T_conductance_resolution,
  T_conductor, T_conflict, T_connect, T_constant,
  T_contact, T_control, T_corner, T_corners,
  T_cost, T_created_time, T_cross, T_crosstalk_model,
  T_current_resolution, T_deleted, T_deleted_keepout, T_delta,
  T_diagonal, T_direction, T_directory, T_discrete,
  T_effective_via_length, T_elongate_keepout, T_exclude, T_expose,
  T_extra_image_directory, T_family, T_family_family, T_family_family_spacing,
  T_fanout, T_farad, T_file, T_fit,
  T_fix, T_flip_style, T_floor_plan, T_footprint,
  T_forbidden, T_force_to_terminal_point, T_forgotten, T_free,
  T_fromto, T_front, T_front_only, T_gap,
  T_gate, T_gates, T_generated_by_freeroute, T_global,
  T_grid, T_group, T_group_set, T_guide,
  T_hard, T_height, T_high, T_history,
  T_horizontal, T_host_cad, T_host_version, T_image,
  T_image_conductor, T_image_image, T_image_image_spacing, T_image_outline_clearance,
  T_image_set, T_image_type, T_inch, T_include,
  T_include_pins_in_crosstalk, T_inductance_resolution, T_insert, T_instcnfg,
  T_inter_layer_clearance, T_jumper, T_junction_type, T_keepout,
  T_kg, T_kohm, T_large, T_large_large,
  T_layer, T_layer_depth, T_layer_noise_weight, T_layer_pair,
  T_layer_rule, T_length, T_length_amplitude, T_length_factor,
  T_length_gap, T_library, T_library_out, T_limit,
  T_limit_bends, T_limit_crossing, T_limit_vias, T_limit_way,
  T_linear, T_linear_interpolation, T_load, T_lock_type,
  T_logical_part, T_logical_part_mapping, T_low, T_match_fromto_delay,
  T_match_fromto_length, T_match_group_delay, T_match_group_length, T_match_net_delay,
  T_match_net_length, T_max_delay, T_max_len, T_max_length,
  T_max_noise, T_max_restricted_layer_length, T_max_stagger, T_max_stub,
  T_max_total_delay, T_max_total_length, T_max_total_vias, T_medium,
  T_mhenry, T_mho, T_microvia, T_mid_driven,
  T_mil, T_min_gap, T_mirror, T_mirror_first,
  T_mixed, T_mm, T_negative_diagonal, T_net,
  T_net_number, T_net_out, T_net_pin_changes, T_nets,
  T_network, T_network_out, T_no, T_noexpose,
  T_noise_accumulation, T_noise_calculation, T_normal, T_object_type,
  T_off, T_off_grid, T_offset, T_on,
  T_open, T_opposite_side, T_order, T_orthogonal,
  T_outline, T_overlap, T_pad, T_pad_pad,
  T_padstack, T_pair, T_parallel, T_parallel_noise,
  T_parallel_segment, T_parser, T_part_library, T_path,
  T_pcb, T_permit_orient, T_permit_side, T_physical,
  T_physical_part_mapping, T_piggyback, T_pin, T_pin_allow,
  T_pin_cap_via, T_pin_via_cap, T_pin_width_taper, T_pins,
  T_pintype, T_place, T_place_boundary, T_place_control,
  T_place_keepout, T_place_rule, T_placement, T_plan,
  T_plane, T_pn, T_point, T_polygon,
  T_polyline_path, T_position, T_positive_diagonal, T_power,
  T_power_dissipation, T_power_fanout, T_prefix, T_primary,
  T_priority, T_property, T_protect, T_qarc,
  T_quarter, T_radius, T_ratio, T_ratio_tolerance,
  T_rect, T_reduced, T_region, T_region_class,
  T_region_class_class, T_region_net, T_relative_delay, T_relative_group_delay,
  T_relative_group_length, T_relative_length, T_reorder, T_reroute_order_viols,
  T_resistance_resolution, T_resistor, T_resolution, T_restricted_layer_length_factor,
  T_room, T_rotate, T_rotate_first, T_round,
  T_roundoff_rotation, T_route, T_route_to_fanout_only, T_routes,
  T_routes_include, T_rule, T_same_net_checking, T_sample_window,
  T_saturation_length, T_sec, T_secondary, T_self,
  T_sequence_number, T_session, T_set_color, T_set_pattern,
  T_shape, T_shield, T_shield_gap, T_shield_loop,
  T_shield_tie_down_interval, T_shield_width, T_side, T_signal,
  T_site, T_small, T_smd, T_snap,
  T_snap_angle, T_soft, T_source, T_space_in_quoted_tokens,
  T_spacing, T_spare, T_spiral_via, T_square,
  T_stack_via, T_stack_via_depth, T_standard, T_starburst,
  T_status, T_structure, T_structure_out, T_subgate,
  T_subgates, T_substituted, T_such, T_suffix,
  T_super_placement, T_supply, T_supply_pin, T_swapping,
  T_switch_window, T_system, T_tandem_noise, T_tandem_segment,
  T_tandem_shield_overhang, T_term_only, T_terminal, T_terminator,
  T_test, T_test_points, T_testpoint, T_threshold,
  T_time_length_factor, T_time_resolution, T_tjunction, T_tolerance,
  T_top, T_topology, T_total, T_track_id,
  T_turret, T_type, T_um, T_unassigned,
  T_unconnects, T_unit, T_up, T_use_array,
  T_use_layer, T_use_net, T_use_via, T_value,
  T_vertical, T_via, T_via_array_template, T_via_at_smd,
  T_via_keepout, T_via_number, T_via_rotate_first, T_via_site,
  T_via_size, T_virtual_pin, T_volt, T_voltage_resolution,
  T_was_is, T_way, T_weight, T_width,
  T_window, T_wire, T_wire_keepout, T_wires,
  T_wires_include, T_wiring, T_write_resolution, T_x,
  T_xy, T_y
}
 enum T contains all this lexer's tokens. More...
 

Functions

const char * GetTokenText (T aTok)
 Function GetTokenText is in the DSN namespace and returns the C string representing a SPECCTRA_DB::keyword. More...
 
bool operator< (const PADSTACK &lhs, const PADSTACK &rhs)
 Function operator< is used by the PADSTACKSET boost::ptr_set below. More...
 
static double scale (int kicadDist)
 Function scale converts a distance from PCBNEW internal units to the reported specctra dsn units in floating point format. More...
 
static double IU2um (int kicadDist)
 
static double mapX (int x)
 
static double mapY (int y)
 
static POINT mapPt (const wxPoint &pt)
 Function mapPt converts a KiCad point into a DSN file point. More...
 
static bool isRoundKeepout (D_PAD *aPad)
 Function isRoundKeepout decides if the pad is a copper-less through hole which needs to be made into a round keepout. More...
 
static PATHmakePath (const POINT &aStart, const POINT &aEnd, const std::string &aLayerName)
 Function makePath creates a PATH element with a single straight line, a pair of vertices. More...
 
static int scale (double distance, UNIT_RES *aResolution)
 Function scale converts a session file distance to KiCad units of deci-mils. More...
 
static wxPoint mapPt (const POINT &aPoint, UNIT_RES *aResolution)
 Function mapPt translates a point from the Specctra Session format coordinate system to the KiCad coordinate system. More...
 

Detailed Description

This source file implements export and import capabilities to the specctra dsn file format.

C++ does not put enum values in separate namespaces unless the enum itself is in a separate namespace.

The grammar for that file format is documented fairly well. There are classes for each major type of descriptor in the spec.

Since there are so many classes in here, it may be helpful to generate the Doxygen directory:

$ cd &ltkicadSourceRoot&gt $ doxygen

Then you can view the html documentation in the &ltkicadSourceRoot&gt/doxygen directory. The main class in this file is SPECCTRA_DB and its main functions are LoadPCB(), LoadSESSION(), and ExportPCB().

Wide use is made of boost::ptr_vector&lt&gt and std::vector&lt&gt template classes. If the contained object is small, then std::vector tends to be used. If the contained object is large, variable size, or would require writing an assignment operator() or copy constructore, then boost::ptr_vector cannot be beat.

All the token enums must be in separate namespaces otherwise the C++ compiler will eventually complain if it sees more than one DSNLEXER in the same compilation unit, say by mutliple header file inclusion. Plus this also enables re-use of the same enum name T. A typedef can always be used to clarify which enum T is in play should that ever be a problem. This is unlikely since Parse() functions will usually only be exposed to one header file like this one. But if there is a problem, then use: typedef DSN::T T; within that problem area.

Typedef Documentation

typedef boost::ptr_vector<ANCESTOR> DSN::ANCESTORS

Definition at line 3261 of file specctra.h.

typedef boost::ptr_vector<CLASS> DSN::CLASSLIST

Definition at line 2801 of file specctra.h.

typedef boost::ptr_vector<COMP_ORDER> DSN::COMP_ORDERS

Definition at line 2558 of file specctra.h.

typedef boost::ptr_vector<COMPONENT> DSN::COMPONENTS

Definition at line 1781 of file specctra.h.

typedef boost::ptr_vector<COPPER_PLANE> DSN::COPPER_PLANES

Definition at line 1331 of file specctra.h.

typedef boost::ptr_vector<FROMTO> DSN::FROMTOS

Definition at line 2524 of file specctra.h.

typedef boost::ptr_vector<IMAGE> DSN::IMAGES

Definition at line 2088 of file specctra.h.

typedef boost::ptr_vector<KEEPOUT> DSN::KEEPOUTS

Definition at line 1001 of file specctra.h.

typedef boost::ptr_vector<LAYER_RULE> DSN::LAYER_RULES

Definition at line 568 of file specctra.h.

typedef boost::ptr_vector<LAYER> DSN::LAYERS

Definition at line 1260 of file specctra.h.

typedef boost::ptr_vector<NET_OUT> DSN::NET_OUTS

Definition at line 3408 of file specctra.h.

typedef boost::ptr_vector<NET> DSN::NETS

Definition at line 2686 of file specctra.h.

typedef boost::ptr_vector<PADSTACK> DSN::PADSTACKS

Definition at line 2209 of file specctra.h.

typedef boost::ptr_set<PADSTACK> DSN::PADSTACKSET

Definition at line 3596 of file specctra.h.

typedef boost::ptr_vector<PATH> DSN::PATHS

Definition at line 646 of file specctra.h.

typedef std::vector<PIN_PAIR> DSN::PIN_PAIRS

Definition at line 3493 of file specctra.h.

typedef std::vector<PIN_REF> DSN::PIN_REFS

Definition at line 2456 of file specctra.h.

typedef std::map<wxString, int> DSN::PINMAP

data type used to ensure unique-ness of pin names, holding (wxString and int)

Definition at line 493 of file specctra_export.cpp.

typedef boost::ptr_vector<PIN> DSN::PINS

Definition at line 1969 of file specctra.h.

typedef boost::ptr_vector<PLACE> DSN::PLACES

Definition at line 1729 of file specctra.h.

typedef std::vector<POINT> DSN::POINTS

Definition at line 159 of file specctra.h.

typedef std::vector<PROPERTY> DSN::PROPERTIES

Definition at line 184 of file specctra.h.

typedef boost::ptr_vector<SPECCTRA_LAYER_PAIR> DSN::SPECCTRA_LAYER_PAIRS

Definition at line 1290 of file specctra.h.

typedef std::vector<std::string> DSN::STRINGS

Definition at line 158 of file specctra.h.

typedef std::set<std::string> DSN::STRINGSET

Definition at line 786 of file specctra_export.cpp.

typedef std::pair<STRINGSET::iterator, bool> DSN::STRINGSET_PAIR

Definition at line 787 of file specctra_export.cpp.

typedef boost::ptr_vector<SUPPLY_PIN> DSN::SUPPLY_PINS

Definition at line 3351 of file specctra.h.

typedef boost::ptr_vector<WINDOW> DSN::WINDOWS

Definition at line 877 of file specctra.h.

typedef boost::ptr_vector<WIRE_VIA> DSN::WIRE_VIAS

Definition at line 3083 of file specctra.h.

typedef boost::ptr_vector<WIRE> DSN::WIRES

Definition at line 2947 of file specctra.h.

Enumeration Type Documentation

enum DSN::T

enum T contains all this lexer's tokens.

Enumerator
T_NONE 
T_COMMENT 
T_STRING_QUOTE 
T_QUOTE_DEF 
T_DASH 
T_SYMBOL 
T_NUMBER 
T_RIGHT 
T_LEFT 
T_STRING 
T_EOF 
T_absolute 
T_add_group 
T_add_pins 
T_added 
T_allow_antenna 
T_allow_redundant_wiring 
T_amp 
T_ancestor 
T_antipad 
T_aperture_type 
T_array 
T_attach 
T_attr 
T_average_pair_length 
T_back 
T_base_design 
T_bbv_ctr2ctr 
T_bend_keepout 
T_bond 
T_both 
T_bottom 
T_bottom_layer_sel 
T_boundary 
T_brickpat 
T_bundle 
T_bus 
T_bypass 
T_capacitance_resolution 
T_capacitor 
T_case_sensitive 
T_cct1 
T_cct1a 
T_center_center 
T_checking_trim_by_pin 
T_circ 
T_circle 
T_circuit 
T_class 
T_class_class 
T_classes 
T_clear 
T_clearance 
T_cluster 
T_cm 
T_color 
T_colors 
T_comment 
T_comp 
T_comp_edge_center 
T_comp_order 
T_component 
T_composite 
T_conductance_resolution 
T_conductor 
T_conflict 
T_connect 
T_constant 
T_contact 
T_control 
T_corner 
T_corners 
T_cost 
T_created_time 
T_cross 
T_crosstalk_model 
T_current_resolution 
T_deleted 
T_deleted_keepout 
T_delta 
T_diagonal 
T_direction 
T_directory 
T_discrete 
T_effective_via_length 
T_elongate_keepout 
T_exclude 
T_expose 
T_extra_image_directory 
T_family 
T_family_family 
T_family_family_spacing 
T_fanout 
T_farad 
T_file 
T_fit 
T_fix 
T_flip_style 
T_floor_plan 
T_footprint 
T_forbidden 
T_force_to_terminal_point 
T_forgotten 
T_free 
T_fromto 
T_front 
T_front_only 
T_gap 
T_gate 
T_gates 
T_generated_by_freeroute 
T_global 
T_grid 
T_group 
T_group_set 
T_guide 
T_hard 
T_height 
T_high 
T_history 
T_horizontal 
T_host_cad 
T_host_version 
T_image 
T_image_conductor 
T_image_image 
T_image_image_spacing 
T_image_outline_clearance 
T_image_set 
T_image_type 
T_inch 
T_include 
T_include_pins_in_crosstalk 
T_inductance_resolution 
T_insert 
T_instcnfg 
T_inter_layer_clearance 
T_jumper 
T_junction_type 
T_keepout 
T_kg 
T_kohm 
T_large 
T_large_large 
T_layer 
T_layer_depth 
T_layer_noise_weight 
T_layer_pair 
T_layer_rule 
T_length 
T_length_amplitude 
T_length_factor 
T_length_gap 
T_library 
T_library_out 
T_limit 
T_limit_bends 
T_limit_crossing 
T_limit_vias 
T_limit_way 
T_linear 
T_linear_interpolation 
T_load 
T_lock_type 
T_logical_part 
T_logical_part_mapping 
T_low 
T_match_fromto_delay 
T_match_fromto_length 
T_match_group_delay 
T_match_group_length 
T_match_net_delay 
T_match_net_length 
T_max_delay 
T_max_len 
T_max_length 
T_max_noise 
T_max_restricted_layer_length 
T_max_stagger 
T_max_stub 
T_max_total_delay 
T_max_total_length 
T_max_total_vias 
T_medium 
T_mhenry 
T_mho 
T_microvia 
T_mid_driven 
T_mil 
T_min_gap 
T_mirror 
T_mirror_first 
T_mixed 
T_mm 
T_negative_diagonal 
T_net 
T_net_number 
T_net_out 
T_net_pin_changes 
T_nets 
T_network 
T_network_out 
T_no 
T_noexpose 
T_noise_accumulation 
T_noise_calculation 
T_normal 
T_object_type 
T_off 
T_off_grid 
T_offset 
T_on 
T_open 
T_opposite_side 
T_order 
T_orthogonal 
T_outline 
T_overlap 
T_pad 
T_pad_pad 
T_padstack 
T_pair 
T_parallel 
T_parallel_noise 
T_parallel_segment 
T_parser 
T_part_library 
T_path 
T_pcb 
T_permit_orient 
T_permit_side 
T_physical 
T_physical_part_mapping 
T_piggyback 
T_pin 
T_pin_allow 
T_pin_cap_via 
T_pin_via_cap 
T_pin_width_taper 
T_pins 
T_pintype 
T_place 
T_place_boundary 
T_place_control 
T_place_keepout 
T_place_rule 
T_placement 
T_plan 
T_plane 
T_pn 
T_point 
T_polygon 
T_polyline_path 
T_position 
T_positive_diagonal 
T_power 
T_power_dissipation 
T_power_fanout 
T_prefix 
T_primary 
T_priority 
T_property 
T_protect 
T_qarc 
T_quarter 
T_radius 
T_ratio 
T_ratio_tolerance 
T_rect 
T_reduced 
T_region 
T_region_class 
T_region_class_class 
T_region_net 
T_relative_delay 
T_relative_group_delay 
T_relative_group_length 
T_relative_length 
T_reorder 
T_reroute_order_viols 
T_resistance_resolution 
T_resistor 
T_resolution 
T_restricted_layer_length_factor 
T_room 
T_rotate 
T_rotate_first 
T_round 
T_roundoff_rotation 
T_route 
T_route_to_fanout_only 
T_routes 
T_routes_include 
T_rule 
T_same_net_checking 
T_sample_window 
T_saturation_length 
T_sec 
T_secondary 
T_self 
T_sequence_number 
T_session 
T_set_color 
T_set_pattern 
T_shape 
T_shield 
T_shield_gap 
T_shield_loop 
T_shield_tie_down_interval 
T_shield_width 
T_side 
T_signal 
T_site 
T_small 
T_smd 
T_snap 
T_snap_angle 
T_soft 
T_source 
T_space_in_quoted_tokens 
T_spacing 
T_spare 
T_spiral_via 
T_square 
T_stack_via 
T_stack_via_depth 
T_standard 
T_starburst 
T_status 
T_structure 
T_structure_out 
T_subgate 
T_subgates 
T_substituted 
T_such 
T_suffix 
T_super_placement 
T_supply 
T_supply_pin 
T_swapping 
T_switch_window 
T_system 
T_tandem_noise 
T_tandem_segment 
T_tandem_shield_overhang 
T_term_only 
T_terminal 
T_terminator 
T_test 
T_test_points 
T_testpoint 
T_threshold 
T_time_length_factor 
T_time_resolution 
T_tjunction 
T_tolerance 
T_top 
T_topology 
T_total 
T_track_id 
T_turret 
T_type 
T_um 
T_unassigned 
T_unconnects 
T_unit 
T_up 
T_use_array 
T_use_layer 
T_use_net 
T_use_via 
T_value 
T_vertical 
T_via 
T_via_array_template 
T_via_at_smd 
T_via_keepout 
T_via_number 
T_via_rotate_first 
T_via_site 
T_via_size 
T_virtual_pin 
T_volt 
T_voltage_resolution 
T_was_is 
T_way 
T_weight 
T_width 
T_window 
T_wire 
T_wire_keepout 
T_wires 
T_wires_include 
T_wiring 
T_write_resolution 
T_x 
T_xy 
T_y 

Definition at line 26 of file specctra_lexer.h.

27  {
28  // these first few are negative special ones for syntax, and are
29  // inherited from DSNLEXER.
30  T_NONE = DSN_NONE,
34  T_DASH = DSN_DASH,
37  T_RIGHT = DSN_RIGHT, // right bracket: ')'
38  T_LEFT = DSN_LEFT, // left bracket: '('
39  T_STRING = DSN_STRING, // a quoted string, stripped of the quotes
40  T_EOF = DSN_EOF, // special case for end of file
41 
42  T_absolute = 0,
44  T_add_pins,
45  T_added,
48  T_amp,
49  T_ancestor,
50  T_antipad,
52  T_array,
53  T_attach,
54  T_attr,
56  T_back,
60  T_bond,
61  T_both,
62  T_bottom,
64  T_boundary,
65  T_brickpat,
66  T_bundle,
67  T_bus,
68  T_bypass,
72  T_cct1,
73  T_cct1a,
76  T_circ,
77  T_circle,
78  T_circuit,
79  T_class,
81  T_classes,
82  T_clear,
84  T_cluster,
85  T_cm,
86  T_color,
87  T_colors,
88  T_comment,
89  T_comp,
96  T_conflict,
97  T_connect,
98  T_constant,
99  T_contact,
100  T_control,
101  T_corner,
102  T_corners,
103  T_cost,
105  T_cross,
108  T_deleted,
110  T_delta,
111  T_diagonal,
112  T_direction,
113  T_directory,
114  T_discrete,
117  T_exclude,
118  T_expose,
120  T_family,
123  T_fanout,
124  T_farad,
125  T_file,
126  T_fit,
127  T_fix,
128  T_flip_style,
129  T_floor_plan,
130  T_footprint,
131  T_forbidden,
133  T_forgotten,
134  T_free,
135  T_fromto,
136  T_front,
137  T_front_only,
138  T_gap,
139  T_gate,
140  T_gates,
142  T_global,
143  T_grid,
144  T_group,
145  T_group_set,
146  T_guide,
147  T_hard,
148  T_height,
149  T_high,
150  T_history,
151  T_horizontal,
152  T_host_cad,
154  T_image,
159  T_image_set,
160  T_image_type,
161  T_inch,
162  T_include,
165  T_insert,
166  T_instcnfg,
168  T_jumper,
170  T_keepout,
171  T_kg,
172  T_kohm,
173  T_large,
175  T_layer,
178  T_layer_pair,
179  T_layer_rule,
180  T_length,
183  T_length_gap,
184  T_library,
186  T_limit,
189  T_limit_vias,
190  T_limit_way,
191  T_linear,
193  T_load,
194  T_lock_type,
197  T_low,
204  T_max_delay,
205  T_max_len,
206  T_max_length,
207  T_max_noise,
210  T_max_stub,
214  T_medium,
215  T_mhenry,
216  T_mho,
217  T_microvia,
218  T_mid_driven,
219  T_mil,
220  T_min_gap,
221  T_mirror,
223  T_mixed,
224  T_mm,
226  T_net,
227  T_net_number,
228  T_net_out,
230  T_nets,
231  T_network,
233  T_no,
234  T_noexpose,
237  T_normal,
239  T_off,
240  T_off_grid,
241  T_offset,
242  T_on,
243  T_open,
245  T_order,
246  T_orthogonal,
247  T_outline,
248  T_overlap,
249  T_pad,
250  T_pad_pad,
251  T_padstack,
252  T_pair,
253  T_parallel,
256  T_parser,
258  T_path,
259  T_pcb,
262  T_physical,
264  T_piggyback,
265  T_pin,
266  T_pin_allow,
270  T_pins,
271  T_pintype,
272  T_place,
276  T_place_rule,
277  T_placement,
278  T_plan,
279  T_plane,
280  T_pn,
281  T_point,
282  T_polygon,
284  T_position,
286  T_power,
289  T_prefix,
290  T_primary,
291  T_priority,
292  T_property,
293  T_protect,
294  T_qarc,
295  T_quarter,
296  T_radius,
297  T_ratio,
299  T_rect,
300  T_reduced,
301  T_region,
304  T_region_net,
309  T_reorder,
312  T_resistor,
313  T_resolution,
315  T_room,
316  T_rotate,
318  T_round,
320  T_route,
322  T_routes,
324  T_rule,
328  T_sec,
329  T_secondary,
330  T_self,
332  T_session,
333  T_set_color,
335  T_shape,
336  T_shield,
337  T_shield_gap,
341  T_side,
342  T_signal,
343  T_site,
344  T_small,
345  T_smd,
346  T_snap,
347  T_snap_angle,
348  T_soft,
349  T_source,
351  T_spacing,
352  T_spare,
353  T_spiral_via,
354  T_square,
355  T_stack_via,
357  T_standard,
358  T_starburst,
359  T_status,
360  T_structure,
362  T_subgate,
363  T_subgates,
365  T_such,
366  T_suffix,
368  T_supply,
369  T_supply_pin,
370  T_swapping,
372  T_system,
376  T_term_only,
377  T_terminal,
378  T_terminator,
379  T_test,
381  T_testpoint,
382  T_threshold,
385  T_tjunction,
386  T_tolerance,
387  T_top,
388  T_topology,
389  T_total,
390  T_track_id,
391  T_turret,
392  T_type,
393  T_um,
394  T_unassigned,
395  T_unconnects,
396  T_unit,
397  T_up,
398  T_use_array,
399  T_use_layer,
400  T_use_net,
401  T_use_via,
402  T_value,
403  T_vertical,
404  T_via,
406  T_via_at_smd,
408  T_via_number,
410  T_via_site,
411  T_via_size,
413  T_volt,
415  T_was_is,
416  T_way,
417  T_weight,
418  T_width,
419  T_window,
420  T_wire,
422  T_wires,
424  T_wiring,
426  T_x,
427  T_xy,
428  T_y
429  };

Function Documentation

const char * DSN::GetTokenText ( T  aTok)

Function GetTokenText is in the DSN namespace and returns the C string representing a SPECCTRA_DB::keyword.

We needed a non-instanance function to get at the SPECCTRA_DB::keyword[] and class SPECCTRA_DB is not defined yet.

Definition at line 69 of file specctra.cpp.

References SPECCTRA_LEXER::TokenName().

Referenced by DSN::UNIT_RES::Format(), DSN::LAYER::Format(), DSN::TOKPROP::Format(), DSN::GRID::Format(), DSN::PLACE::Format(), DSN::SHAPE::Format(), DSN::FROMTO::Format(), DSN::NET::Format(), DSN::WIRE::Format(), DSN::WIRE_VIA::Format(), DSN::PLACEMENT::FormatContents(), DSN::IMAGE::FormatContents(), DSN::PADSTACK::FormatContents(), and PCB_PARSER::parseVersion().

70 {
71  return SPECCTRA_LEXER::TokenName( aTok );
72 }
static const char * TokenName(DSN::T aTok)
Function TokenName returns the name of the token in ASCII form.
static bool DSN::isRoundKeepout ( D_PAD aPad)
static

Function isRoundKeepout decides if the pad is a copper-less through hole which needs to be made into a round keepout.

Definition at line 224 of file specctra_export.cpp.

References LSET::AllCuMask(), D_PAD::GetDrillSize(), D_PAD::GetLayerSet(), D_PAD::GetShape(), D_PAD::GetSize(), and PAD_SHAPE_CIRCLE.

Referenced by DSN::SPECCTRA_DB::makeIMAGE(), and DSN::SPECCTRA_DB::makePADSTACK().

225 {
226  if( aPad->GetShape()==PAD_SHAPE_CIRCLE )
227  {
228  if( aPad->GetDrillSize().x >= aPad->GetSize().x )
229  return true;
230 
231  if( !( aPad->GetLayerSet() & LSET::AllCuMask() ).any() )
232  return true;
233  }
234 
235  return false;
236 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:639
const wxSize & GetDrillSize() const
Definition: class_pad.h:260
PAD_SHAPE_T GetShape() const
Function GetShape.
Definition: class_pad.h:201
LSET GetLayerSet() const override
Function GetLayerSet returns a "layer mask", which is a bitmap of all layers on which the TRACK segme...
Definition: class_pad.h:377
const wxSize & GetSize() const
Definition: class_pad.h:254
static double DSN::IU2um ( int  kicadDist)
inlinestatic

Definition at line 184 of file specctra_export.cpp.

Referenced by DSN::SPECCTRA_DB::makePADSTACK(), and DSN::SPECCTRA_DB::makeVia().

185 {
186  return kicadDist * (1000.0 / IU_PER_MM);
187 }
static PATH* DSN::makePath ( const POINT aStart,
const POINT aEnd,
const std::string &  aLayerName 
)
static

Function makePath creates a PATH element with a single straight line, a pair of vertices.

Definition at line 243 of file specctra_export.cpp.

References DSN::PATH::AppendPoint(), DSN::PATH::SetLayerId(), and T_path.

Referenced by DSN::SPECCTRA_DB::makePADSTACK().

244 {
245  PATH* path = new PATH( 0, T_path );
246 
247  path->AppendPoint( aStart );
248  path->AppendPoint( aEnd );
249  path->SetLayerId( aLayerName.c_str() );
250  return path;
251 }
void SetLayerId(const char *aLayerId)
Definition: specctra.h:602
void AppendPoint(const POINT &aPoint)
Definition: specctra.h:595
Class PATH supports both the and the per the specctra dsn spec...
Definition: specctra.h:576
static wxPoint DSN::mapPt ( const POINT aPoint,
UNIT_RES aResolution 
)
static

Function mapPt translates a point from the Specctra Session format coordinate system to the KiCad coordinate system.

Parameters
aPointThe session point to translate
aResolution- The amount to scale the point.
Returns
wxPoint - The KiCad coordinate system point.

Definition at line 196 of file specctra_import.cpp.

References scale(), DSN::POINT::x, and DSN::POINT::y.

197 {
198  wxPoint ret( scale( aPoint.x, aResolution ),
199  -scale( aPoint.y, aResolution ) ); // negate y
200 
201  return ret;
202 }
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
const int scale
static POINT DSN::mapPt ( const wxPoint pt)
static

Function mapPt converts a KiCad point into a DSN file point.

Kicad's BOARD coordinates are in nanometers (called Internal Units or IU)and we are exporting in units of mils, so we have to scale them.

Definition at line 208 of file specctra_export.cpp.

References DSN::POINT::FixNegativeZero(), mapX(), mapY(), wxPoint::x, DSN::POINT::x, wxPoint::y, and DSN::POINT::y.

Referenced by DSN::SPECCTRA_DB::fillBOUNDARY(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DSN::SPECCTRA_DB::makeTRACK(), and DSN::SPECCTRA_DB::makeVIA().

209 {
210  POINT ret;
211 
212  ret.x = mapX( pt.x );
213  ret.y = mapY( pt.y );
214  ret.FixNegativeZero();
215  return ret;
216 }
void FixNegativeZero()
Function FixNegativeZero will change negative zero to positive zero in the IEEE floating point storag...
Definition: specctra.h:136
double y
Definition: specctra.h:97
double x
Definition: specctra.h:96
Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system.
Definition: specctra.h:94
static double mapY(int y)
static double mapX(int x)
static double DSN::mapX ( int  x)
inlinestatic

Definition at line 190 of file specctra_export.cpp.

References scale().

Referenced by mapPt().

191 {
192  return scale( x );
193 }
const int scale
static double DSN::mapY ( int  y)
inlinestatic

Definition at line 196 of file specctra_export.cpp.

References scale().

Referenced by mapPt().

197 {
198  return -scale( y ); // make y negative, since it is increasing going down.
199 }
const int scale
bool DSN::operator< ( const PADSTACK lhs,
const PADSTACK rhs 
)
inline

Function operator< is used by the PADSTACKSET boost::ptr_set below.

Definition at line 2216 of file specctra.h.

References DSN::PADSTACK::Compare().

2217 {
2218  return PADSTACK::Compare( (PADSTACK*) &lhs, (PADSTACK*) &rhs ) < 0;
2219 }
static int DSN::scale ( double  distance,
UNIT_RES aResolution 
)
static

Function scale converts a session file distance to KiCad units of deci-mils.

Parameters
distanceThe session file length to convert.
aResolutionThe session UNIT_RES which holds the engineering unit specifier
Returns
int - The KiCad length in deci-mils

Definition at line 157 of file specctra_import.cpp.

References DSN::UNIT_RES::GetEngUnits(), DSN::UNIT_RES::GetValue(), KiROUND(), T_cm, T_inch, T_mil, T_mm, and T_um.

158 {
159  double resValue = aResolution->GetValue();
160  double factor;
161 
162  switch( aResolution->GetEngUnits() )
163  {
164  default:
165  case T_inch:
166  factor = 25.4e6; // nanometers per inch
167  break;
168  case T_mil:
169  factor = 25.4e3; // nanometers per mil
170  break;
171  case T_cm:
172  factor = 1e7; // nanometers per cm
173  break;
174  case T_mm:
175  factor = 1e6; // nanometers per mm
176  break;
177  case T_um:
178  factor = 1e3; // nanometers per um
179  break;
180  }
181 
182  int ret = KiROUND( factor * distance / resValue );
183 
184  return ret;
185 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
DSN_T GetEngUnits() const
Definition: specctra.h:423
int GetValue() const
Definition: specctra.h:424
static double DSN::scale ( int  kicadDist)
inlinestatic

Function scale converts a distance from PCBNEW internal units to the reported specctra dsn units in floating point format.

Definition at line 176 of file specctra_export.cpp.

Referenced by DSN::SPECCTRA_DB::exportNETCLASS(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::makeIMAGE(), DSN::SPECCTRA_DB::makePADSTACK(), DSN::SPECCTRA_DB::makeTRACK(), DSN::SPECCTRA_DB::makeVia(), DSN::SPECCTRA_DB::makeVIA(), mapPt(), mapX(), and mapY().

177 {
178  // nanometers to um
179  return kicadDist / ( IU_PER_MM / 1000.0 );
180 }