Fix autoplace fields overlapping symbol body for rotated symbols
The autoplace algorithm was incorrectly setting field text angles for 90/270 degree rotated symbols. It set ANGLE_VERTICAL, but GetBoundingBox() applies both the field angle AND the symbol transform, resulting in 180-degree effective rotation. This caused incorrect bounding box dimensions and fields overlapping the symbol body. The fix sets field text angle to ANGLE_HORIZONTAL for all symbols. For rotated symbols, the symbol transform alone produces the correct vertical display orientation. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16538
This commit is contained in:
@@ -197,10 +197,12 @@ protected:
|
||||
continue;
|
||||
}
|
||||
|
||||
if( m_symbol->GetTransform().y1 )
|
||||
field->SetTextAngle( ANGLE_VERTICAL );
|
||||
else
|
||||
field->SetTextAngle( ANGLE_HORIZONTAL );
|
||||
// Set field angle to HORIZONTAL. GetBoundingBox() applies both the field's text
|
||||
// angle and the symbol transform. For 90/270 degree rotated symbols, this results
|
||||
// in vertical text display. Previously, setting VERTICAL for rotated symbols
|
||||
// caused 180-degree effective rotation (field angle + symbol transform), which
|
||||
// resulted in incorrect bounding box dimensions and field overlap issues.
|
||||
field->SetTextAngle( ANGLE_HORIZONTAL );
|
||||
|
||||
BOX2I bbox = field->GetBoundingBox();
|
||||
int field_width = bbox.GetWidth();
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
{
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {
|
||||
"board_outline_line_width": 0.1,
|
||||
"copper_line_width": 0.2,
|
||||
"copper_text_size_h": 1.5,
|
||||
"copper_text_size_v": 1.5,
|
||||
"copper_text_thickness": 0.3,
|
||||
"other_line_width": 0.15,
|
||||
"silk_line_width": 0.15,
|
||||
"silk_text_size_h": 1.0,
|
||||
"silk_text_size_v": 1.0,
|
||||
"silk_text_thickness": 0.15
|
||||
},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"rules": {
|
||||
"min_copper_edge_clearance": 0.0,
|
||||
"solder_mask_clearance": 0.0,
|
||||
"solder_mask_min_width": 0.0
|
||||
},
|
||||
"track_widths": [],
|
||||
"via_dimensions": []
|
||||
},
|
||||
"layer_presets": [],
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
"erc": {
|
||||
"erc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"pin_map": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
]
|
||||
],
|
||||
"rule_severities": {
|
||||
"bus_definition_conflict": "error",
|
||||
"bus_entry_needed": "error",
|
||||
"bus_to_bus_conflict": "error",
|
||||
"bus_to_net_conflict": "error",
|
||||
"conflicting_netclasses": "error",
|
||||
"different_unit_footprint": "error",
|
||||
"different_unit_net": "error",
|
||||
"duplicate_reference": "error",
|
||||
"duplicate_sheet_names": "error",
|
||||
"endpoint_off_grid": "warning",
|
||||
"extra_units": "error",
|
||||
"global_label_dangling": "warning",
|
||||
"hier_label_mismatch": "error",
|
||||
"label_dangling": "error",
|
||||
"lib_symbol_issues": "warning",
|
||||
"missing_bidi_pin": "warning",
|
||||
"missing_input_pin": "warning",
|
||||
"missing_power_pin": "error",
|
||||
"missing_unit": "warning",
|
||||
"multiple_net_names": "warning",
|
||||
"net_not_bus_member": "warning",
|
||||
"no_connect_connected": "warning",
|
||||
"no_connect_dangling": "warning",
|
||||
"pin_not_connected": "error",
|
||||
"pin_not_driven": "error",
|
||||
"pin_to_pin": "warning",
|
||||
"power_pin_not_driven": "error",
|
||||
"similar_labels": "warning",
|
||||
"simulation_model_issue": "ignore",
|
||||
"unannotated": "error",
|
||||
"unit_value_mismatch": "error",
|
||||
"unresolved_variable": "error",
|
||||
"wire_dangling": "error"
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "issue16538.kicad_pro",
|
||||
"version": 1
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12,
|
||||
"clearance": 0.2,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Default",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.25,
|
||||
"via_diameter": 0.8,
|
||||
"via_drill": 0.4,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 3
|
||||
},
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
"netclass_patterns": []
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
"gencad": "",
|
||||
"idf": "",
|
||||
"netlist": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"schematic": {
|
||||
"annotate_start_num": 0,
|
||||
"drawing": {
|
||||
"dashed_lines_dash_length_ratio": 12.0,
|
||||
"dashed_lines_gap_length_ratio": 3.0,
|
||||
"default_line_thickness": 6.0,
|
||||
"default_text_size": 50.0,
|
||||
"field_names": [],
|
||||
"intersheets_ref_own_page": false,
|
||||
"intersheets_ref_prefix": "",
|
||||
"intersheets_ref_short": false,
|
||||
"intersheets_ref_show": false,
|
||||
"intersheets_ref_suffix": "",
|
||||
"junction_size_choice": 3,
|
||||
"label_size_ratio": 0.375,
|
||||
"pin_symbol_size": 25.0,
|
||||
"text_offset_ratio": 0.15
|
||||
},
|
||||
"legacy_lib_dir": "",
|
||||
"legacy_lib_list": [],
|
||||
"meta": {
|
||||
"version": 1
|
||||
},
|
||||
"net_format_name": "",
|
||||
"ngspice": {
|
||||
"fix_include_paths": true,
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"model_mode": 0,
|
||||
"workbook_filename": ""
|
||||
},
|
||||
"page_layout_descr_file": "",
|
||||
"plot_directory": "",
|
||||
"spice_current_sheet_as_root": false,
|
||||
"spice_external_command": "spice \"%I\"",
|
||||
"spice_model_current_sheet_as_root": true,
|
||||
"spice_save_all_currents": false,
|
||||
"spice_save_all_voltages": false,
|
||||
"subpart_first_id": 65,
|
||||
"subpart_id_separator": 0
|
||||
},
|
||||
"sheets": [
|
||||
[
|
||||
"124c7e5c-c037-4b06-ae8c-2198d5f4d67b",
|
||||
""
|
||||
]
|
||||
],
|
||||
"text_variables": {}
|
||||
}
|
||||
@@ -0,0 +1,838 @@
|
||||
(kicad_sch (version 20230121) (generator eeschema)
|
||||
|
||||
(uuid 124c7e5c-c037-4b06-ae8c-2198d5f4d67b)
|
||||
|
||||
(paper "A4")
|
||||
|
||||
(lib_symbols
|
||||
(symbol "Device:C_Polarized" (pin_numbers hide) (pin_names (offset 0.254)) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "C" (at 0.635 2.54 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "C_Polarized" (at 0.635 -2.54 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "" (at 0.9652 -3.81 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "cap capacitor" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "Polarized capacitor" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_fp_filters" "CP_*" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "C_Polarized_0_1"
|
||||
(rectangle (start -2.286 0.508) (end 2.286 1.016)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -1.778 2.286)
|
||||
(xy -0.762 2.286)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -1.27 2.794)
|
||||
(xy -1.27 1.778)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(rectangle (start 2.286 -0.508) (end -2.286 -1.016)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type outline))
|
||||
)
|
||||
)
|
||||
(symbol "C_Polarized_1_1"
|
||||
(pin passive line (at 0 3.81 270) (length 2.794)
|
||||
(name "~" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 0 -3.81 90) (length 2.794)
|
||||
(name "~" (effects (font (size 1.27 1.27))))
|
||||
(number "2" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "Device:LED" (pin_numbers hide) (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "D" (at 0 2.54 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Value" "LED" (at 0 -2.54 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "LED diode" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "Light emitting diode" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_fp_filters" "LED* LED_SMD:* LED_THT:*" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "LED_0_1"
|
||||
(polyline
|
||||
(pts
|
||||
(xy -1.27 -1.27)
|
||||
(xy -1.27 1.27)
|
||||
)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -1.27 0)
|
||||
(xy 1.27 0)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 1.27 -1.27)
|
||||
(xy 1.27 1.27)
|
||||
(xy -1.27 0)
|
||||
(xy 1.27 -1.27)
|
||||
)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -3.048 -0.762)
|
||||
(xy -4.572 -2.286)
|
||||
(xy -3.81 -2.286)
|
||||
(xy -4.572 -2.286)
|
||||
(xy -4.572 -1.524)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy -1.778 -0.762)
|
||||
(xy -3.302 -2.286)
|
||||
(xy -2.54 -2.286)
|
||||
(xy -3.302 -2.286)
|
||||
(xy -3.302 -1.524)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
)
|
||||
(symbol "LED_1_1"
|
||||
(pin passive line (at -3.81 0 0) (length 2.54)
|
||||
(name "K" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 3.81 0 180) (length 2.54)
|
||||
(name "A" (effects (font (size 1.27 1.27))))
|
||||
(number "2" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "R" (at 2.032 0 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Value" "R" (at 0 0 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at -1.778 0 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "R res resistor" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "Resistor" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_fp_filters" "R_*" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "R_0_1"
|
||||
(rectangle (start -1.016 -2.54) (end 1.016 2.54)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
)
|
||||
(symbol "R_1_1"
|
||||
(pin passive line (at 0 3.81 270) (length 1.27)
|
||||
(name "~" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 0 -3.81 90) (length 1.27)
|
||||
(name "~" (effects (font (size 1.27 1.27))))
|
||||
(number "2" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "Transistor_BJT:BC846" (pin_names (offset 0) hide) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "Q" (at 5.08 1.905 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "BC846" (at 5.08 0 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Package_TO_SOT_SMD:SOT-23" (at 5.08 -1.905 0)
|
||||
(effects (font (size 1.27 1.27) italic) (justify left) hide)
|
||||
)
|
||||
(property "Datasheet" "https://assets.nexperia.com/documents/data-sheet/BC846_SER.pdf" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left) hide)
|
||||
)
|
||||
(property "ki_keywords" "NPN Transistor" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "0.1A Ic, 65V Vce, NPN Transistor, SOT-23" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_fp_filters" "SOT?23*" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "BC846_0_1"
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.635 0.635)
|
||||
(xy 2.54 2.54)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.635 -0.635)
|
||||
(xy 2.54 -2.54)
|
||||
(xy 2.54 -2.54)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0.635 1.905)
|
||||
(xy 0.635 -1.905)
|
||||
(xy 0.635 -1.905)
|
||||
)
|
||||
(stroke (width 0.508) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 1.27 -1.778)
|
||||
(xy 1.778 -1.27)
|
||||
(xy 2.286 -2.286)
|
||||
(xy 1.27 -1.778)
|
||||
(xy 1.27 -1.778)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type outline))
|
||||
)
|
||||
(circle (center 1.27 0) (radius 2.8194)
|
||||
(stroke (width 0.254) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
)
|
||||
(symbol "BC846_1_1"
|
||||
(pin input line (at -5.08 0 0) (length 5.715)
|
||||
(name "B" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 2.54 -5.08 90) (length 2.54)
|
||||
(name "E" (effects (font (size 1.27 1.27))))
|
||||
(number "2" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
(pin passive line (at 2.54 5.08 270) (length 2.54)
|
||||
(name "C" (effects (font (size 1.27 1.27))))
|
||||
(number "3" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "#PWR" (at 0 -6.35 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Value" "GND" (at 0 -3.81 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "global power" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "GND_0_1"
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0 0)
|
||||
(xy 0 -1.27)
|
||||
(xy 1.27 -1.27)
|
||||
(xy 0 -2.54)
|
||||
(xy -1.27 -1.27)
|
||||
(xy 0 -1.27)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
)
|
||||
(symbol "GND_1_1"
|
||||
(pin power_in line (at 0 0 270) (length 0) hide
|
||||
(name "GND" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
(symbol "power:VCC" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
|
||||
(property "Reference" "#PWR" (at 0 -3.81 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Value" "VCC" (at 0 3.81 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_keywords" "global power" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "ki_description" "Power symbol creates a global label with name \"VCC\"" (at 0 0 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(symbol "VCC_0_1"
|
||||
(polyline
|
||||
(pts
|
||||
(xy -0.762 1.27)
|
||||
(xy 0 2.54)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0 0)
|
||||
(xy 0 2.54)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
(polyline
|
||||
(pts
|
||||
(xy 0 2.54)
|
||||
(xy 0.762 1.27)
|
||||
)
|
||||
(stroke (width 0) (type default))
|
||||
(fill (type none))
|
||||
)
|
||||
)
|
||||
(symbol "VCC_1_1"
|
||||
(pin power_in line (at 0 0 90) (length 0) hide
|
||||
(name "VCC" (effects (font (size 1.27 1.27))))
|
||||
(number "1" (effects (font (size 1.27 1.27))))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(junction (at 184.15 111.76) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 1a4027e4-9adc-4c20-a0b0-6ccb50f8d03d)
|
||||
)
|
||||
(junction (at 158.75 111.76) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 2078ae0b-e0f4-46e5-917f-8808a1ab4984)
|
||||
)
|
||||
(junction (at 171.45 111.76) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 393c6525-b24f-4d17-9e8b-0d45c3d56af7)
|
||||
)
|
||||
(junction (at 146.05 111.76) (diameter 0) (color 0 0 0 0)
|
||||
(uuid 4a9116ac-ffd6-495f-a9a2-5e88e57e8b24)
|
||||
)
|
||||
(junction (at 158.75 82.55) (diameter 0) (color 0 0 0 0)
|
||||
(uuid c14a80cf-33fd-45f8-bb00-fc8f0f4a16ca)
|
||||
)
|
||||
(junction (at 171.45 82.55) (diameter 0) (color 0 0 0 0)
|
||||
(uuid cd7cf756-9fec-4eff-b09f-c6031dd1a692)
|
||||
)
|
||||
(junction (at 146.05 82.55) (diameter 0) (color 0 0 0 0)
|
||||
(uuid e65e836d-366f-43a2-9980-7e1bd3616a17)
|
||||
)
|
||||
|
||||
(wire (pts (xy 171.45 82.55) (xy 158.75 82.55))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 1279cb1e-3279-4cf0-afde-499dc011050c)
|
||||
)
|
||||
(wire (pts (xy 156.21 111.76) (xy 158.75 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 2d7d8f14-81e3-483a-882b-2dfdc3a936ec)
|
||||
)
|
||||
(wire (pts (xy 146.05 111.76) (xy 146.05 116.84))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 3f139a95-8cba-4923-b903-feac8710a0d7)
|
||||
)
|
||||
(wire (pts (xy 184.15 127) (xy 184.15 132.08))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 4578f165-2e7d-4007-bac8-7a05d7d0da2b)
|
||||
)
|
||||
(wire (pts (xy 158.75 111.76) (xy 160.02 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 484b91b2-6c63-4a24-8442-1e8db37ccbf1)
|
||||
)
|
||||
(wire (pts (xy 184.15 111.76) (xy 184.15 116.84))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 498579d8-4ef3-4a37-bf23-0408abb52241)
|
||||
)
|
||||
(wire (pts (xy 184.15 105.41) (xy 184.15 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 4a61409e-a15b-44e5-8936-c2d573e3a302)
|
||||
)
|
||||
(wire (pts (xy 170.18 111.76) (xy 171.45 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 4cf649e1-618b-4b77-8387-ce86ddb63049)
|
||||
)
|
||||
(wire (pts (xy 158.75 82.55) (xy 146.05 82.55))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 6247f2cd-ec0f-484b-8e96-45f97266c290)
|
||||
)
|
||||
(wire (pts (xy 173.99 111.76) (xy 171.45 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 67d43341-6320-43d5-ba03-bd1d1a8a8aeb)
|
||||
)
|
||||
(wire (pts (xy 184.15 82.55) (xy 171.45 82.55))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 8bc2832e-127f-4d13-bedc-ce5397c34c94)
|
||||
)
|
||||
(wire (pts (xy 181.61 111.76) (xy 184.15 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 934f2a8b-85d5-445f-8df4-90445235cd20)
|
||||
)
|
||||
(wire (pts (xy 146.05 127) (xy 146.05 132.08))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 94557761-525d-4b47-868e-00a702fc89fe)
|
||||
)
|
||||
(wire (pts (xy 146.05 105.41) (xy 146.05 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 9897ffe4-d0ce-459f-81f0-b12b41390fdd)
|
||||
)
|
||||
(wire (pts (xy 170.18 121.92) (xy 176.53 121.92))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 9a2ca88f-0681-4d05-919a-7f3ff34d7c4e)
|
||||
)
|
||||
(wire (pts (xy 160.02 121.92) (xy 170.18 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 9a636c84-ca9a-4173-9872-b01322cabe86)
|
||||
)
|
||||
(wire (pts (xy 146.05 82.55) (xy 146.05 80.01))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 9c129fea-ab26-420e-b716-c37bd42287eb)
|
||||
)
|
||||
(wire (pts (xy 184.15 85.09) (xy 184.15 82.55))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid 9efe9c95-2ff6-426c-92d2-5e46d3c24021)
|
||||
)
|
||||
(wire (pts (xy 146.05 92.71) (xy 146.05 97.79))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid a8a928c1-507c-4426-ae86-49cfa42320b4)
|
||||
)
|
||||
(wire (pts (xy 171.45 82.55) (xy 171.45 91.44))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid ab9a5510-e5d1-4e58-8637-1ea084588551)
|
||||
)
|
||||
(wire (pts (xy 184.15 92.71) (xy 184.15 97.79))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid ae98dd20-2931-43b9-a334-5e6dfcd9410c)
|
||||
)
|
||||
(wire (pts (xy 158.75 99.06) (xy 158.75 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid b0704a51-dab1-43c1-b223-38e5da74f5d5)
|
||||
)
|
||||
(wire (pts (xy 171.45 99.06) (xy 171.45 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid b59ca926-0738-4335-8968-58b18713eee6)
|
||||
)
|
||||
(wire (pts (xy 146.05 111.76) (xy 148.59 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid c0077452-0164-407f-9df9-721873e399d4)
|
||||
)
|
||||
(wire (pts (xy 170.18 121.92) (xy 160.02 111.76))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid d6d07743-86fa-4e77-893b-19eceaa55f7e)
|
||||
)
|
||||
(wire (pts (xy 153.67 121.92) (xy 160.02 121.92))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid e22dc517-c01e-4c36-b07d-786f439ae348)
|
||||
)
|
||||
(wire (pts (xy 146.05 82.55) (xy 146.05 85.09))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid e25c15fe-4bb8-4b2b-b688-7849c0c85133)
|
||||
)
|
||||
(wire (pts (xy 158.75 82.55) (xy 158.75 91.44))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid ea67025c-8fb3-44a4-b287-74daa1f82e06)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 184.15 101.6 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 04f4b31e-5e6a-4f67-84cc-e5c13603fea3)
|
||||
(property "Reference" "R4" (at 186.69 100.33 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10K" (at 186.69 102.87 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "" (at 182.372 101.6 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 184.15 101.6 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "2" (uuid 840cea41-f3eb-46b9-8ed2-741ce90d7609))
|
||||
(pin "1" (uuid 4ed93310-61ff-431e-9f53-9f57676a666c))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "R4") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C_Polarized") (at 152.4 111.76 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 0eaa0f25-9bf0-4db9-b657-5fdd74aca9b1)
|
||||
(property "Reference" "C1" (at 151.511 104.14 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Value" "10u" (at 151.511 106.68 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 156.21 110.7948 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 152.4 111.76 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid e2a0787b-b2dc-4ab6-97aa-4dce55f31ed8))
|
||||
(pin "2" (uuid 285db36d-f13a-43d2-9eb8-9defcf168044))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "C1") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "power:GND") (at 146.05 132.08 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 2dd3439e-c6a0-4264-b5da-27f459ddf0ae)
|
||||
(property "Reference" "#PWR01" (at 146.05 138.43 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Value" "GND" (at 146.05 137.16 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 146.05 132.08 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 146.05 132.08 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 9b3cdd35-87b5-4d45-98b9-41c3fcc9d37e))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "#PWR01") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Transistor_BJT:BC846") (at 148.59 121.92 0) (mirror y) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no)
|
||||
(uuid 5b414573-0aa5-4f81-a30b-7c9e9afd365d)
|
||||
(property "Reference" "Q2" (at 143.51 120.65 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "BC846" (at 143.51 123.19 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Package_TO_SOT_SMD:SOT-23" (at 143.51 123.825 0)
|
||||
(effects (font (size 1.27 1.27) italic) (justify left) hide)
|
||||
)
|
||||
(property "Datasheet" "https://assets.nexperia.com/documents/data-sheet/BC846_SER.pdf" (at 148.59 121.92 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left) hide)
|
||||
)
|
||||
(pin "2" (uuid 262ad11f-0671-42ef-8f15-b7813a1dd0c2))
|
||||
(pin "3" (uuid 622a422e-e3c6-4e70-a2ec-f0bd4e1768f6))
|
||||
(pin "1" (uuid 0b3ec899-7e6c-42e1-833b-fe89c0d3b67f))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "Q2") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "power:VCC") (at 146.05 80.01 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 6580d005-bafa-496c-adbd-4057ae27508a)
|
||||
(property "Reference" "#PWR02" (at 146.05 83.82 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Value" "VCC" (at 146.05 74.93 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 146.05 80.01 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 146.05 80.01 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid b09cc8ec-3199-4030-bbf9-c062ecde1a01))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "#PWR02") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:LED") (at 146.05 88.9 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 6b74245b-1126-40d3-be7a-7f175ba92cda)
|
||||
(property "Reference" "D1" (at 149.86 89.2175 90)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
)
|
||||
(property "Value" "LED" (at 149.86 91.7575 90)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
)
|
||||
(property "Footprint" "" (at 146.05 88.9 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 146.05 88.9 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 7f46f6ff-5e26-4d56-9a29-8191518d2938))
|
||||
(pin "2" (uuid 426572d2-0729-4801-8458-c00310c34c0d))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "D1") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:C_Polarized") (at 177.8 111.76 270) (mirror x) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 7706dd76-7e41-47df-96b2-28cbbe83ed2d)
|
||||
(property "Reference" "C2" (at 178.689 104.14 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Value" "10u" (at 178.689 106.68 90)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 173.99 110.7948 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 177.8 111.76 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid e2a0787b-b2dc-4ab6-97aa-4dce55f31ed8))
|
||||
(pin "2" (uuid 285db36d-f13a-43d2-9eb8-9defcf168044))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "C2") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Transistor_BJT:BC846") (at 181.61 121.92 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid 87a1900e-7fa8-4392-8bf5-4b89efabf3cb)
|
||||
(property "Reference" "Q1" (at 186.69 120.65 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "BC846" (at 186.69 123.19 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "Package_TO_SOT_SMD:SOT-23" (at 186.69 123.825 0)
|
||||
(effects (font (size 1.27 1.27) italic) (justify left) hide)
|
||||
)
|
||||
(property "Datasheet" "https://assets.nexperia.com/documents/data-sheet/BC846_SER.pdf" (at 181.61 121.92 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left) hide)
|
||||
)
|
||||
(pin "2" (uuid 262ad11f-0671-42ef-8f15-b7813a1dd0c2))
|
||||
(pin "3" (uuid 622a422e-e3c6-4e70-a2ec-f0bd4e1768f6))
|
||||
(pin "1" (uuid 0b3ec899-7e6c-42e1-833b-fe89c0d3b67f))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "Q1") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 158.75 95.25 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid b7806fef-479b-4b96-a9b5-9103ec7a0c92)
|
||||
(property "Reference" "R1" (at 161.29 93.98 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10K" (at 161.29 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "" (at 156.972 95.25 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 158.75 95.25 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "2" (uuid 840cea41-f3eb-46b9-8ed2-741ce90d7609))
|
||||
(pin "1" (uuid 4ed93310-61ff-431e-9f53-9f57676a666c))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "R1") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 171.45 95.25 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid c7019ead-734c-4fab-855b-8714179df278)
|
||||
(property "Reference" "R3" (at 173.99 93.98 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10K" (at 173.99 96.52 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "" (at 169.672 95.25 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 171.45 95.25 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "2" (uuid 840cea41-f3eb-46b9-8ed2-741ce90d7609))
|
||||
(pin "1" (uuid 4ed93310-61ff-431e-9f53-9f57676a666c))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "R3") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:LED") (at 184.15 88.9 90) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid cf9f4a64-0d8a-4e10-9d43-511c23ed1f52)
|
||||
(property "Reference" "D2" (at 187.96 89.2175 90)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
)
|
||||
(property "Value" "LED" (at 187.96 91.7575 90)
|
||||
(effects (font (size 1.27 1.27)) (justify right))
|
||||
)
|
||||
(property "Footprint" "" (at 184.15 88.9 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 184.15 88.9 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 7f46f6ff-5e26-4d56-9a29-8191518d2938))
|
||||
(pin "2" (uuid 426572d2-0729-4801-8458-c00310c34c0d))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "D2") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "Device:R") (at 146.05 101.6 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid e34fd6b7-f447-4645-a627-e8c14379bb6d)
|
||||
(property "Reference" "R2" (at 148.59 100.33 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Value" "10K" (at 148.59 102.87 0)
|
||||
(effects (font (size 1.27 1.27)) (justify left))
|
||||
)
|
||||
(property "Footprint" "" (at 144.272 101.6 90)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "~" (at 146.05 101.6 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "2" (uuid 840cea41-f3eb-46b9-8ed2-741ce90d7609))
|
||||
(pin "1" (uuid 4ed93310-61ff-431e-9f53-9f57676a666c))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "R2") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(symbol (lib_id "power:GND") (at 184.15 132.08 0) (unit 1)
|
||||
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
|
||||
(uuid e5cc36e8-60c7-4527-b0c6-60dce6a0a74a)
|
||||
(property "Reference" "#PWR?" (at 184.15 138.43 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Value" "GND" (at 184.15 137.16 0)
|
||||
(effects (font (size 1.27 1.27)))
|
||||
)
|
||||
(property "Footprint" "" (at 184.15 132.08 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(property "Datasheet" "" (at 184.15 132.08 0)
|
||||
(effects (font (size 1.27 1.27)) hide)
|
||||
)
|
||||
(pin "1" (uuid 9b3cdd35-87b5-4d45-98b9-41c3fcc9d37e))
|
||||
(instances
|
||||
(project "issue16538"
|
||||
(path "/124c7e5c-c037-4b06-ae8c-2198d5f4d67b"
|
||||
(reference "#PWR?") (unit 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(sheet_instances
|
||||
(path "/" (page "1"))
|
||||
)
|
||||
)
|
||||
@@ -131,6 +131,7 @@ set( QA_EESCHEMA_SRCS
|
||||
test_symbol_embedded_files.cpp
|
||||
test_symbol_clipboard_export.cpp
|
||||
test_schematic_clipboard_export.cpp
|
||||
test_autoplace_fields.cpp
|
||||
)
|
||||
|
||||
if( WIN32 )
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Test suite for autoplace fields functionality.
|
||||
* Tests fix for issue #16538: autoplace fields overlaps symbol text.
|
||||
*/
|
||||
|
||||
#include <qa_utils/wx_utils/unit_test_utils.h>
|
||||
#include "eeschema_test_utils.h"
|
||||
|
||||
#include <sch_symbol.h>
|
||||
#include <sch_field.h>
|
||||
#include <sch_item.h>
|
||||
#include <geometry/eda_angle.h>
|
||||
|
||||
|
||||
class TEST_AUTOPLACE_FIELDS_FIXTURE : public KI_TEST::SCHEMATIC_TEST_FIXTURE
|
||||
{
|
||||
public:
|
||||
SCH_SYMBOL* GetSymbolByRef( const wxString& aRef )
|
||||
{
|
||||
if( !m_schematic )
|
||||
return nullptr;
|
||||
|
||||
SCH_SCREEN* screen = m_schematic->RootScreen();
|
||||
|
||||
if( !screen )
|
||||
return nullptr;
|
||||
|
||||
for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
|
||||
{
|
||||
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
|
||||
|
||||
if( symbol && symbol->GetRef( &m_schematic->Hierarchy()[0], false ) == aRef )
|
||||
return symbol;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE( AutoplaceFields, TEST_AUTOPLACE_FIELDS_FIXTURE )
|
||||
|
||||
|
||||
/**
|
||||
* Test that field bounding boxes for rotated symbols have correct dimensions.
|
||||
* This is a regression test for issue #16538.
|
||||
*
|
||||
* The bug was that when computing field bounding boxes for autoplace, the code
|
||||
* set field text angle to ANGLE_VERTICAL for 90/270 degree rotated symbols.
|
||||
* However, GetBoundingBox() applies BOTH the field angle AND the symbol transform,
|
||||
* resulting in 180-degree effective rotation (field angle + symbol transform).
|
||||
* This caused the bounding box dimensions to be incorrect.
|
||||
*
|
||||
* The fix sets field text angle to ANGLE_HORIZONTAL, so that GetBoundingBox()
|
||||
* applies only the symbol transform (90 degrees), giving correct dimensions
|
||||
* for vertical text display.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE( RotatedSymbolFieldBoundingBox )
|
||||
{
|
||||
wxFileName fn;
|
||||
fn.SetPath( KI_TEST::GetEeschemaTestDataDir() );
|
||||
fn.AppendDir( wxS( "issue16538" ) );
|
||||
fn.SetName( wxS( "issue16538" ) );
|
||||
fn.SetExt( FILEEXT::KiCadSchematicFileExtension );
|
||||
|
||||
LoadSchematic( fn.GetFullPath() );
|
||||
|
||||
SCH_SYMBOL* symbol = GetSymbolByRef( wxS( "C1" ) );
|
||||
BOOST_REQUIRE( symbol );
|
||||
|
||||
// Verify the symbol is rotated 90 degrees (y1 != 0)
|
||||
TRANSFORM transform = symbol->GetTransform();
|
||||
BOOST_CHECK( transform.y1 != 0 );
|
||||
|
||||
// Get the reference field
|
||||
SCH_FIELD* refField = symbol->GetField( FIELD_T::REFERENCE );
|
||||
BOOST_REQUIRE( refField );
|
||||
|
||||
// Set the field to horizontal angle (as the fix does)
|
||||
refField->SetTextAngle( ANGLE_HORIZONTAL );
|
||||
|
||||
// Get the bounding box after setting horizontal angle
|
||||
BOX2I bbox = refField->GetBoundingBox();
|
||||
|
||||
// For a 90-degree rotated symbol with horizontal field angle:
|
||||
// The bounding box should be tall and narrow (text displays vertically)
|
||||
// Height should be greater than width for short text like "C1"
|
||||
BOOST_CHECK_MESSAGE( bbox.GetHeight() > bbox.GetWidth(),
|
||||
wxString::Format( "Expected vertical bounding box (height > width) "
|
||||
"for rotated symbol. Got width=%lld, height=%lld",
|
||||
static_cast<long long>( bbox.GetWidth() ),
|
||||
static_cast<long long>( bbox.GetHeight() ) ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test that GetDrawRotation returns correct visual orientation.
|
||||
*/
|
||||
BOOST_AUTO_TEST_CASE( FieldDrawRotationForRotatedSymbol )
|
||||
{
|
||||
wxFileName fn;
|
||||
fn.SetPath( KI_TEST::GetEeschemaTestDataDir() );
|
||||
fn.AppendDir( wxS( "issue16538" ) );
|
||||
fn.SetName( wxS( "issue16538" ) );
|
||||
fn.SetExt( FILEEXT::KiCadSchematicFileExtension );
|
||||
|
||||
LoadSchematic( fn.GetFullPath() );
|
||||
|
||||
SCH_SYMBOL* symbol = GetSymbolByRef( wxS( "C1" ) );
|
||||
BOOST_REQUIRE( symbol );
|
||||
|
||||
SCH_FIELD* refField = symbol->GetField( FIELD_T::REFERENCE );
|
||||
BOOST_REQUIRE( refField );
|
||||
|
||||
// Set field to horizontal angle (as the fix does for autoplace)
|
||||
refField->SetTextAngle( ANGLE_HORIZONTAL );
|
||||
|
||||
// For a 90-degree rotated symbol with horizontal field angle,
|
||||
// GetDrawRotation should return vertical (the visual orientation)
|
||||
EDA_ANGLE drawRotation = refField->GetDrawRotation();
|
||||
BOOST_CHECK_MESSAGE( drawRotation.IsVertical(),
|
||||
wxString::Format( "Expected vertical draw rotation for 90-degree "
|
||||
"rotated symbol with horizontal field angle. "
|
||||
"Got %f degrees", drawRotation.AsDegrees() ) );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
Reference in New Issue
Block a user