66#include <dialogs/dialog_text_properties.h>
67#include <dialogs/dialog_tablecell_properties.h>
68#include <dialogs/dialog_table_properties.h>
74#include <wx/textdlg.h>
104 const int unit = symbol->
GetUnit();
108 for(
int ii = 0; ii < nUnits; ii++ )
112 if( missingUnits.count( ii + 1 ) == 0 )
113 unit_text +=
_(
" (already placed)" );
126 if( !missingUnits.empty() )
130 for(
int unitNumber : missingUnits )
179 wxEmptyString, wxITEM_CHECK );
214 if(
pin->GetAlt().IsEmpty() || (
pin->GetAlt() == libPin->
GetName() ) )
262 if( !
pin && !sheetPin )
290 wxASSERT_MSG( drawingTools,
"eeshema.InteractiveDrawing tool is not available" );
292 auto hasElements = [
this](
const SELECTION& aSel )
294 return !
m_frame->GetScreen()->Items().empty();
297 auto sheetHasUndefinedPins = [](
const SELECTION& aSel )
299 if( aSel.Size() == 1 && aSel.Front()->Type() ==
SCH_SHEET_T )
305 auto attribDNPCond = [
this](
const SELECTION& aSel )
308 wxString variant =
m_frame->Schematic().GetCurrentVariant();
310 return std::all_of( aSel.Items().begin(), aSel.Items().end(),
311 [sheet, variant](
const EDA_ITEM* item )
313 return !item->IsType( { SCH_SYMBOL_T } )
314 ||
static_cast<const SCH_SYMBOL*
>( item )->GetDNP( sheet, variant );
318 auto attribExcludeFromSimCond = [](
const SELECTION& aSel )
320 return std::all_of( aSel.Items().begin(), aSel.Items().end(),
323 return !item->IsType( { SCH_SYMBOL_T } )
324 ||
static_cast<const SCH_SYMBOL*
>( item )->GetExcludedFromSim();
328 auto attribExcludeFromBOMCond = [](
const SELECTION& aSel )
330 return std::all_of( aSel.Items().begin(), aSel.Items().end(),
333 return !item->IsType( { SCH_SYMBOL_T } )
334 ||
static_cast<const SCH_SYMBOL*
>( item )->GetExcludedFromBOM();
339 auto attribExcludeFromBoardCond = [](
const SELECTION& aSel )
341 return std::all_of( aSel.Items().begin(), aSel.Items().end(),
344 return !item->IsType( { SCH_SYMBOL_T } )
345 ||
static_cast<const SCH_SYMBOL*
>( item )->GetExcludedFromBoard();
353 auto haveHighlight = [
this](
const SELECTION& sel )
360 auto anyTextTool = [
this](
const SELECTION& aSel )
369 auto duplicateCondition = [](
const SELECTION& aSel )
377 auto orientCondition = [](
const SELECTION& aSel )
387 auto propertiesCondition = [
this](
const SELECTION& aSel )
389 if( aSel.GetSize() == 0 )
406 if( !firstItem || !eeSelection )
409 switch( firstItem->
Type() )
431 if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
434 return item->Type() == SCH_LINE_T
435 && static_cast<const SCH_LINE*>( item )->IsGraphicLine();
440 else if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
443 return item->Type() == SCH_JUNCTION_T;
448 else if( std::all_of( aSel.Items().begin(), aSel.Items().end(),
451 const SCH_ITEM* schItem = dynamic_cast<const SCH_ITEM*>( item );
453 wxCHECK( schItem, false );
455 return ( schItem->HasLineStroke() && schItem->IsConnectable() )
456 || item->Type() == SCH_JUNCTION_T;
464 default:
return false;
468 auto autoplaceCondition = [](
const SELECTION& aSel )
531 std::shared_ptr<SYMBOL_UNIT_MENU> menu = std::make_shared<SYMBOL_UNIT_MENU>();
532 menu->SetTool( tool );
533 tool->GetToolMenu().RegisterSubMenu( menu );
539 std::shared_ptr<BODY_STYLE_MENU> menu = std::make_shared<BODY_STYLE_MENU>();
540 menu->SetTool( tool );
541 tool->GetToolMenu().RegisterSubMenu( menu );
547 std::shared_ptr<ALT_PIN_FUNCTION_MENU> menu = std::make_shared<ALT_PIN_FUNCTION_MENU>();
548 menu->SetTool( tool );
549 tool->GetToolMenu().RegisterSubMenu( menu );
555 std::shared_ptr<PIN_TRICKS_MENU> menu = std::make_shared<PIN_TRICKS_MENU>();
556 menu->SetTool( tool );
557 tool->GetToolMenu().RegisterSubMenu( menu );
561 auto makeTransformMenu = [&]()
574 auto makeAttributesMenu = [&]()
587 auto makeEditFieldsMenu = [&]()
599 auto makeConvertToMenu = [&]()
638 moveMenu.AddMenu( makeTransformMenu(), orientCondition, 200 );
644 moveMenu.AddSeparator();
665 drawMenu.
AddMenu( makeTransformMenu(), orientCondition, 200 );
689 selToolMenu.
AddMenu( makeTransformMenu(), orientCondition, 200 );
701 selToolMenu.
AddMenu( makeConvertToMenu(), toChangeCondition, 200 );
751 wxLogTrace(
"KICAD_SCH_MOVE",
"SCH_EDIT_TOOL::Rotate: start, clockwise=%d, selection size=%u", clockwise,
758 int principalItemCount = 0;
765 std::map<SCH_SHEET_PIN*, SCH_NO_CONNECT*> noConnects;
768 commit = &localCommit;
770 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
777 principalItemCount++;
786 if( principalItemCount == 1 )
798 switch( head->
Type() )
804 symbol->
Rotate( rotPoint, !clockwise );
806 if(
m_frame->eeconfig()->m_AutoplaceFields.enable )
894 rotPoint =
m_frame->GetNearestHalfGridPosition(
group->GetPosition() );
896 group->Rotate( rotPoint, !clockwise );
898 group->Move( rotPoint -
m_frame->GetNearestHalfGridPosition(
group->GetPosition() ) );
907 rotPoint =
m_frame->GetNearestHalfGridPosition(
table->GetCenter() );
909 table->Rotate( rotPoint, !clockwise );
911 table->Move( rotPoint -
m_frame->GetNearestHalfGridPosition(
table->GetCenter() ) );
917 head->
Rotate( rotPoint, clockwise );
931 sheet->
Rotate( rotPoint, !clockwise );
939 m_frame->UpdateItem( head,
false,
true );
949 for(
EDA_ITEM* edaItem : selection )
965 line->
Rotate( rotPoint, !clockwise );
995 field->
Rotate( rotPoint, !clockwise );
1006 table->Rotate( rotPoint, !clockwise );
1009 table->Move( beforeCenter -
table->GetCenter() );
1017 sheet->
Rotate( rotPoint, !clockwise );
1022 item->
Rotate( rotPoint, !clockwise );
1024 wxLogTrace(
"KICAD_SCH_MOVE",
" SCH_EDIT_TOOL::Rotate: item type=%d rotated, pos (%d,%d) -> (%d,%d)",
1025 item->
Type(), posBefore.
x, posBefore.
y, posAfter.
x, posAfter.
y );
1028 m_frame->UpdateItem( item,
false,
true );
1032 wxLogTrace(
"KICAD_SCH_MOVE",
"SCH_EDIT_TOOL::Rotate: complete, moving=%d", moving );
1036 wxLogTrace(
"KICAD_SCH_MOVE",
"SCH_EDIT_TOOL::Rotate: posting refreshPreview" );
1041 for(
auto& [sheetPin, noConnect] : noConnects )
1043 if( noConnect->GetPosition() != sheetPin->GetTextPos() )
1045 commit->
Modify( noConnect, screen );
1046 noConnect->SetPosition( sheetPin->GetTextPos() );
1060 m_frame->Schematic().CleanUp( commit );
1062 if( !localCommit.
Empty() )
1063 localCommit.
Push(
_(
"Rotate" ) );
1074 if( selection.
GetSize() == 0 )
1079 bool connections =
false;
1085 std::map<SCH_SHEET_PIN*, SCH_NO_CONNECT*> noConnects;
1088 commit = &localCommit;
1090 if( selection.
GetSize() == 1 )
1095 switch( item->
Type() )
1165 noConnects =
static_cast<SCH_SHEET*
>( item )->GetNoConnects();
1188 m_frame->UpdateItem( item,
false,
true );
1190 else if( selection.
GetSize() > 1 )
1194 for(
EDA_ITEM* edaItem : selection )
1196 item =
static_cast<SCH_ITEM*
>( edaItem );
1240 m_frame->UpdateItem( item,
false,
true );
1245 for(
EDA_ITEM* selected : selection )
1254 for(
auto& [sheetPin, noConnect] : noConnects )
1256 if( noConnect->GetPosition() != sheetPin->GetTextPos() )
1258 commit->
Modify( noConnect, screen );
1259 noConnect->SetPosition( sheetPin->GetTextPos() );
1275 m_frame->Schematic().CleanUp( commit );
1278 if( !localCommit.
Empty() )
1279 localCommit.
Push(
_(
"Mirror" ) );
1295 unsigned aFallbackRotationsCCW )
1297 std::set<wxString> handledKeys;
1306 const VECTOR2I bRelPos = bField.GetPosition() - bField.GetParentPosition();
1309 const EDA_ANGLE bTextAngle = bField.GetTextAngle();
1316 bField.SetPosition( bField.GetParentPosition() + aRelPos );
1317 bField.SetHorizJustify( aTextJustifyH );
1318 bField.SetVertJustify( aTextJustifyV );
1319 bField.SetTextAngle( aTextAngle );
1326 auto it = std::find_if( aBFields.begin(), aBFields.end(),
1329 return bField.GetCanonicalName() == name;
1332 if( it != aBFields.end() )
1336 swapFieldTextProps( aField, bField );
1341 for(
unsigned ii = 0; ii < aFallbackRotationsCCW; ii++ )
1348 handledKeys.insert(
name );
1355 const wxString bName = bField.GetCanonicalName();
1356 if( handledKeys.find( bName ) == handledKeys.end() )
1358 for(
unsigned ii = 0; ii < aFallbackRotationsCCW; ii++ )
1360 bField.Rotate( bField.GetParentPosition(),
false );
1372 if( selection.
Size() < 2 )
1392 bool connections =
false;
1398 commit = &localCommit;
1400 for(
size_t i = 0; i < sorted.size() - 1; i++ )
1412 std::swap( aPos, bPos );
1421 std::swap( aSide, bSide );
1453 std::vector<SCH_FIELD>& aFields = aLabelBase.
GetFields();
1454 std::vector<SCH_FIELD>& bFields = bLabelBase.
GetFields();
1456 const unsigned rotationsAtoB = aSpinStyle.
CCWRotationsTo( bSpinStyle );
1467 if( !aText || !bText )
1493 std::swap( aOrient, bOrient );
1506 m_frame->UpdateItem( a,
false,
true );
1507 m_frame->UpdateItem( b,
false,
true );
1523 if( !localCommit.
Empty() )
1524 localCommit.
Push(
_(
"Swap" ) );
1544 if( !
m_frame->eeconfig()->m_Input.allow_unconstrained_pin_swaps )
1550 if( selection.
Size() < 2 )
1567 std::set<wxString> sharedSheetPaths;
1568 std::set<wxString> sharedProjectNames;
1571 &sharedProjectNames ) )
1575 std::set<wxString> friendlySheets;
1577 if( !sharedSheetPaths.empty() )
1580 if( !sharedProjectNames.empty() )
1584 if( projects.IsEmpty() )
1586 m_frame->ShowInfoBarError(
_(
"Pin swaps are disabled for symbols shared across other projects. "
1587 "Duplicate the sheet to edit pins independently." ) );
1592 wxString::Format(
_(
"Pin swaps are disabled for symbols shared across other projects (%s). "
1593 "Duplicate the sheet to edit pins independently." ),
1597 else if( !friendlySheets.empty() )
1602 wxString::Format(
_(
"Pin swaps are disabled for symbols used by multiple sheet instances (%s). "
1603 "Duplicate the sheet to edit pins independently." ),
1609 _(
"Pin swaps are disabled for shared symbols. Duplicate the sheet to edit pins independently." ) );
1615 bool connections =
false;
1621 commit = &localCommit;
1627 bool swappedLibPins =
false;
1629 for(
size_t i = 0; i < sorted.size() - 1; i++ )
1632 SCH_PIN* bPin =
static_cast<SCH_PIN*
>( sorted[( i + 1 ) % sorted.size()] );
1645 m_frame->UpdateItem( aPin,
false,
true );
1646 m_frame->UpdateItem( bPin,
false,
true );
1649 if( swappedLibPins )
1653 m_frame->UpdateItem( parentSymbol,
false,
true );
1666 m_frame->Schematic().CleanUp( commit );
1673 if( !localCommit.
Empty() )
1674 localCommit.
Push(
_(
"Swap Pins" ) );
1684 if( !aGraph || !aPin )
1692 const std::set<SCH_ITEM*>& items = sg->
GetItems();
1694 size_t pinCount = 0;
1702 switch( item->
Type() )
1710 if( conn && conn->
IsNet() )
1736 if( orderedPins.size() < 2 )
1743 std::vector<SCH_LABEL_BASE*> labels;
1745 for(
EDA_ITEM* item : orderedPins )
1753 _(
"Each selected pin must have exactly one attached net label and no other pin connections." ) );
1757 labels.push_back( label );
1760 if( labels.size() >= 2 )
1767 for(
size_t i = 0; i < labels.size() - 1; ++i )
1771 wxString aText = a->
GetText();
1772 wxString bText = b->
GetText();
1777 commit.
Push(
_(
"Swap Pin Labels" ) );
1789 if( selectedUnits.size() < 2 )
1797 std::vector<std::vector<SCH_LABEL_BASE*>> symbolLabelVectors;
1801 std::vector<std::pair<VECTOR2I, SCH_LABEL_BASE*>> byPos;
1803 for(
SCH_PIN*
pin : symbol->GetPins( &sheetPath ) )
1809 m_frame->ShowInfoBarError(
_(
"Each pin of selected units must have exactly one attached net label and "
1810 "no other pin connections." ) );
1814 byPos.emplace_back(
pin->GetPosition(), label );
1818 std::sort( byPos.begin(), byPos.end(),
1819 [](
const auto& a,
const auto& b )
1821 if( a.first.x != b.first.x )
1822 return a.first.x < b.first.x;
1824 return a.first.y < b.first.y;
1828 std::vector<SCH_LABEL_BASE*> labels;
1830 for(
const auto& pr : byPos )
1831 labels.push_back( pr.second );
1833 symbolLabelVectors.push_back( labels );
1837 const size_t pinCount = symbolLabelVectors.front().size();
1842 for(
size_t pin = 0;
pin < pinCount;
pin++ )
1844 for(
auto& vec : symbolLabelVectors )
1847 wxString carry = symbolLabelVectors.back()[
pin]->GetText();
1849 for(
size_t i = 0; i < symbolLabelVectors.size(); i++ )
1858 if( !commit.
Empty() )
1859 commit.
Push(
_(
"Swap Unit Labels" ) );
1867 const std::vector<std::unique_ptr<SCH_ITEM>>& sourceItems =
m_frame->GetRepeatItems();
1869 if( sourceItems.empty() )
1878 for(
const std::unique_ptr<SCH_ITEM>& item : sourceItems )
1881 bool restore_state =
false;
1892 enteredGroup->AddItem( newItem );
1901 if( !label->IncrementLabel( cfg->m_Drawing.repeat_label_increment ) )
1902 m_frame->ShowInfoBarWarning(
_(
"Label value cannot go below zero" ),
true );
1915 schIUScale.MilsToIU( cfg->m_Drawing.default_repeat_offset_y ) ) );
1924 if(
m_frame->CheckSheetForRecursion( sheet, currentSheet ) )
1927 const wxString originalFileName = sheet->
GetFileName();
1932 restore_state = !
m_frame->EditSheetProperties( sheet, currentSheet );
1945 commit.Added( newItem,
m_frame->GetScreen() );
1954 if(
m_frame->eeconfig()->m_AnnotatePanel.automatic )
1956 static_cast<SCH_SYMBOL*
>( newItem )->ClearAnnotation(
nullptr,
false );
1959 true , annotateStartNum,
false,
false,
false,
1975 newItems.
Add( newItem );
1981 m_frame->Schematic().CleanUp( &commit );
1982 commit.Push(
_(
"Repeat Item" ) );
1986 if( !newItems.
Empty() )
1987 m_frame->SaveCopyForRepeatItem(
static_cast<SCH_ITEM*
>( newItems[0] ) );
1989 for(
size_t ii = 1; ii < newItems.
GetSize(); ++ii )
1990 m_frame->AddCopyForRepeatItem(
static_cast<SCH_ITEM*
>( newItems[ii] ) );
2001 std::vector<VECTOR2I> pts;
2002 bool updateHierarchy =
false;
2023 pts.insert( pts.end(), tmp_pts.begin(), tmp_pts.end() );
2046 static_cast<SCH_FIELD*
>( sch_item )->SetVisible(
false );
2052 static_cast<SCH_TABLECELL*
>( sch_item )->SetText( wxEmptyString );
2089 m_frame->DeleteJunction( &commit, junction );
2092 commit.
Push(
_(
"Delete" ) );
2094 if( updateHierarchy )
2095 m_frame->UpdateHierarchyNavigator();
2119 caption.Printf(
_(
"Edit %s Field" ),
TitleCaps( fieldName ) );
2123 caption.Printf(
_(
"Edit '%s' Field" ), aField->
GetName() );
2143 if( !commit.
Empty() )
2144 commit.
Push( caption );
2152 if( sel.
Size() != 1 )
2155 bool clearSelection = sel.
IsHover();
2171 if( item ==
nullptr )
2203 clearSelection =
true;
2227 if( clearSelection )
2239 bool moving = head && head->
IsMoving();
2241 if( selection.
Empty() )
2244 std::vector<SCH_ITEM*> autoplaceItems;
2246 for(
unsigned ii = 0; ii < selection.
GetSize(); ii++ )
2251 autoplaceItems.push_back( item );
2256 for(
SCH_ITEM* sch_item : autoplaceItems )
2258 if( !moving && !sch_item->IsNew() )
2272 if( !commit.
Empty() )
2273 commit.
Push(
_(
"Autoplace Fields" ) );
2288 if( !selection.
Empty() )
2312 if( selection.
Empty() )
2318 if( !symbol->
IsNew() )
2326 m_frame->SelectBodyStyle( symbol, nextBodyStyle );
2328 if( symbol->
IsNew() )
2331 if( !commit.
Empty() )
2332 commit.
Push(
_(
"Change Body Style" ) );
2344 bool clearSelection = selection.
IsHover();
2346 if( selection.
Empty() )
2371 switch( curr_item->
Type() )
2378 std::deque<SCH_LINE*> lines;
2381 lines.push_back(
static_cast<SCH_LINE*
>( selItem ) );
2389 std::deque<SCH_JUNCTION*> junctions;
2392 junctions.push_back(
static_cast<SCH_JUNCTION*
>( selItem ) );
2401 std::deque<SCH_ITEM*> items;
2404 items.push_back(
static_cast<SCH_ITEM*
>( selItem ) );
2422 if( inspectionTool )
2430 std::vector<SCH_TABLECELL*> cells;
2452 if( selection.
Size() > 1 )
2458 if( clearSelection )
2467 switch( aItem->
Type() )
2488 if(
m_frame->eeconfig()->m_AutoplaceFields.enable )
2504 if( wxWindow* blocking_win =
editor->Kiway().GetBlockingDialog() )
2505 blocking_win->Close(
true );
2511 editor->LoadSymbolFromSchematic( symbol );
2522 if( wxWindow* blocking_win =
editor->Kiway().GetBlockingDialog() )
2523 blocking_win->Close(
true );
2547 bool isUndoable =
false;
2548 bool doClearAnnotation =
false;
2549 bool okPressed =
false;
2550 bool updateHierarchyNavigator =
false;
2560 okPressed =
m_frame->EditSheetProperties( sheet, &
m_frame->GetCurrentSheet(), &isUndoable, &doClearAnnotation,
2561 &updateHierarchyNavigator );
2567 commit.
Push(
_(
"Edit Sheet Properties" ) );
2571 std::vector<SCH_ITEM*> items;
2573 items.emplace_back( sheet );
2574 m_frame->Schematic().OnItemsRemoved( items );
2575 m_frame->Schematic().OnItemsAdded( items );
2577 m_frame->Schematic().RefreshHierarchy();
2578 m_frame->UpdateHierarchyNavigator();
2591 if( doClearAnnotation )
2605 m_frame->GetCanvas()->Refresh();
2607 if( updateHierarchyNavigator )
2608 m_frame->UpdateHierarchyNavigator();
2691 dlg.SetTitle(
_(
"Rule Area Properties" ) );
2706 wxFAIL_MSG( wxString(
"Cannot edit schematic item type " ) + aItem->
GetClass() );
2722 commit = &localCommit;
2724 for(
unsigned int i = 0; i < selection.GetSize(); ++i )
2728 if( item && item->
Type() != convertTo )
2739 wxCHECK2( sourceText,
continue );
2741 switch( item->
Type() )
2761 txt =
_(
"<empty>" );
2772 txt =
text->GetText();
2773 href =
text->GetHyperlink();
2790 int textSize =
text->GetTextSize().y;
2823 position =
m_frame->GetNearestGridPosition( position );
2831 auto getValidNetname = [](
const wxString& aText )
2833 wxString local_txt = aText;
2834 local_txt.Replace(
"\n",
"_" );
2835 local_txt.Replace(
"\r",
"_" );
2836 local_txt.Replace(
"\t",
"_" );
2840 local_txt.Replace(
" ",
"_" );
2845 if( local_txt.IsEmpty() )
2846 return _(
"<empty>" );
2874 newtext = new_label;
2899 newtext = new_label;
2924 newtext = new_label;
2941 new_label->
GetFields().push_back( netclass );
2948 newtext = new_label;
2968 bbox.
Inflate( -label->GetLabelBoxExpansion() );
2999 new_textbox->
SetEnd( botRight );
3002 newtext = new_textbox;
3009 wxCHECK2( newtext,
continue );
3020 wxCHECK2( eda_text && new_eda_text,
continue );
3035 if( label && new_label )
3044 return field.GetId() == FIELD_T::INTERSHEET_REFS
3045 && new_label->Type() != SCH_GLOBAL_LABEL_T;
3067 if( !localCommit.
Empty() )
3068 localCommit.
Push(
_(
"Change To" ) );
3070 if( selection.IsHover() )
3083 if( selection.
GetSize() == 0 )
3092 commit = &localCommit;
3094 auto setJustify = [&](
EDA_TEXT* aTextItem )
3104 for(
EDA_ITEM* edaItem : selection )
3106 item =
static_cast<SCH_ITEM*
>( edaItem );
3113 setJustify(
static_cast<SCH_FIELD*
>( item ) );
3120 setJustify(
static_cast<SCH_TEXT*
>( item ) );
3131 setJustify( label );
3134 m_frame->UpdateItem( item,
false,
true );
3138 for(
EDA_ITEM* selected : selection )
3152 if( !localCommit.
Empty() )
3155 localCommit.
Push(
_(
"Left Justify" ) );
3157 localCommit.
Push(
_(
"Center Justify" ) );
3159 localCommit.
Push(
_(
"Right Justify" ) );
3176 if( !
IsOK(
m_frame,
_(
"Do you wish to delete the unreferenced pins from this sheet?" ) ) )
3185 commit.
Push(
_(
"Cleanup Sheet Pins" ) );
3210 screen =
m_frame->GetScreen();
3219 if( prevInstance.
size() )
3227 screen =
m_frame->GetScreen();
3230 sheet =
m_frame->GetCurrentSheet().Last();
3237 msg.Printf(
_(
"Enter page number for sheet path%s" ),
3238 ( sheetPath.Length() > 20 ) ?
"\n" + sheetPath :
" " + sheetPath );
3240 wxTextEntryDialog dlg(
m_frame, msg,
_(
"Edit Sheet Page Number" ), pageNumber );
3242 dlg.SetTextValidator( wxFILTER_ALPHANUMERIC );
3244 if( dlg.ShowModal() == wxID_CANCEL || dlg.GetValue() == instance.
GetPageNumber() )
3249 commit.
Modify( sheet, screen );
3253 if( instance ==
m_frame->GetCurrentSheet() )
3255 m_frame->GetScreen()->SetPageNumber( dlg.GetValue() );
3256 m_frame->OnPageSettingsChange();
3259 commit.
Push( wxS(
"Change Sheet Page Number" ) );
3276 wxString* filename = aEvent.
Parameter<wxString*>();
3283 if( !
image->GetReferenceImage().ReadImageFile( *filename ) )
3285 wxMessageBox( wxString::Format(
_(
"Could not load image from '%s'." ), *filename ) );
3295 std::set<std::pair<SCH_SYMBOL*, SCH_SCREEN*>>& aCollectedUnits )
3303 aCollectedUnits.insert( { symbol,
m_frame->GetScreen() } );
3309 wxString ref = symbol->
GetRef( &
m_frame->GetCurrentSheet() );
3316 std::vector<SCH_SYMBOL*> otherUnits;
3321 aCollectedUnits.insert( { otherUnit, screen } );
3334 wxString variant =
m_frame->Schematic().GetCurrentVariant();
3336 std::set<std::pair<SCH_SYMBOL*, SCH_SCREEN*>> collectedUnits;
3339 bool new_state =
false;
3341 for(
const auto& [symbol,
_] : collectedUnits )
3353 for(
const auto& [symbol, screen] : collectedUnits )
3355 commit.
Modify( symbol, screen );
3358 symbol->SetDNP( new_state );
3361 symbol->SetExcludedFromSim( new_state );
3364 symbol->SetExcludedFromBOM( new_state );
3367 symbol->SetExcludedFromBoard( new_state );
3370 if( !commit.
Empty() )
3371 commit.
Push(
_(
"Toggle Attribute" ) );
3385 return _(
"Edit Symbol Properties..." );
3401 return _(
"Edit Netclasses..." );
3404 return wxEmptyString;
constexpr EDA_IU_SCALE schIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION decrementPrimary
static TOOL_ACTION unselectAll
static TOOL_ACTION decrementSecondary
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION unselectItem
static TOOL_ACTION showSymbolLibTable
static TOOL_ACTION pasteSpecial
static TOOL_ACTION groupProperties
static TOOL_ACTION rightJustify
static TOOL_ACTION pageSettings
static TOOL_ACTION incrementSecondary
static TOOL_ACTION duplicate
static TOOL_ACTION incrementPrimary
static TOOL_ACTION doDelete
static TOOL_ACTION deleteTool
static TOOL_ACTION increment
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION leftJustify
static TOOL_ACTION copyAsText
static TOOL_ACTION refreshPreview
static TOOL_ACTION selectAll
static TOOL_ACTION centerJustify
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
void update() override
Update menu state stub.
ACTION_MENU * create() const override
Return an instance of this class. It has to be overridden in inheriting classes.
constexpr const Vec & GetPosition() const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr const Vec GetEnd() const
constexpr void SetOrigin(const Vec &pos)
constexpr Vec Centre() const
constexpr const Vec GetCenter() const
constexpr coord_type GetLeft() const
constexpr const Vec & GetOrigin() const
constexpr coord_type GetRight() const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
void Unstage(EDA_ITEM *aItem, BASE_SCREEN *aScreen)
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT & Removed(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
Calculate the connectivity of a schematic and generates netlists.
CONNECTION_SUBGRAPH * GetSubgraphForItem(SCH_ITEM *aItem) const
A subgraph is a set of items that are electrically connected on a single sheet.
const std::set< SCH_ITEM * > & GetItems() const
Provide a read-only reference to the items in the subgraph.
Dialog to update or change schematic library symbols.
This class is setup in expectation of its children possibly using Kiway player so DIALOG_SHIM::ShowQu...
void UpdateField(SCH_FIELD *aField)
Dialog used to edit SCH_SYMBOL objects in a schematic.
@ TABLECELL_PROPS_EDIT_TABLE
enum TABLECELL_PROPS_RETVALUE GetReturnValue()
bool HitTestDrawingSheetItems(KIGFX::VIEW *aView, const VECTOR2I &aPosition)
bool IsHorizontal() const
A set of EDA_ITEMs (i.e., without duplicates).
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual void SetPosition(const VECTOR2I &aPos)
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
EDA_ITEM_FLAGS GetEditFlags() const
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
EDA_ITEM * GetParent() const
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
virtual void SetParent(EDA_ITEM *aParent)
void SetEnd(const VECTOR2I &aEnd)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
const EDA_ANGLE & GetTextAngle() const
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
wxString GetHyperlink() const
GR_TEXT_H_ALIGN_T GetHorizJustify() const
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
void SetBold(bool aBold)
Set the text to be bold - this will also update the font if needed.
void SetHyperlink(wxString aLink)
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetText(const wxString &aText)
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
int GetTextThickness() const
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
void SetFont(KIFONT::FONT *aFont)
VECTOR2I GetTextSize() const
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
EE_TYPE Overlapping(const BOX2I &aRect) const
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual wxString GetClass() const =0
Return the class name.
void RecacheAllItems()
Rebuild GAL display lists.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
A logical library item identifier and consists of various portions much like a URI.
int GetUnitCount() const override
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
A singleton reporter that reports to nowhere.
These are loaded from Eeschema settings but then overwritten by the project settings.
SCHEMATIC_SETTINGS & Settings() const
static TOOL_ACTION rotateCCW
static TOOL_ACTION placeClassLabel
static TOOL_ACTION swapPins
static TOOL_ACTION editValue
static TOOL_ACTION setExcludeFromBOM
static TOOL_ACTION mirrorV
static TOOL_ACTION clearHighlight
static TOOL_ACTION placeGlobalLabel
static TOOL_ACTION changeSymbols
static TOOL_ACTION updateSymbol
static TOOL_ACTION autoplaceFields
static TOOL_ACTION changeSymbol
static TOOL_ACTION ddAddImage
static TOOL_ACTION properties
static TOOL_ACTION editReference
static TOOL_ACTION placeHierLabel
static TOOL_ACTION placeLabel
static TOOL_ACTION toText
static TOOL_ACTION toHLabel
static TOOL_ACTION rotateCW
static TOOL_ACTION importSheet
static TOOL_ACTION toLabel
static TOOL_ACTION setDNP
static TOOL_ACTION swapUnitLabels
static TOOL_ACTION placeImage
static TOOL_ACTION editWithLibEdit
static TOOL_ACTION cleanupSheetPins
static TOOL_ACTION toDLabel
static TOOL_ACTION cycleBodyStyle
static TOOL_ACTION mirrorH
static TOOL_ACTION setExcludeFromSimulation
static TOOL_ACTION ddAppendFile
static TOOL_ACTION placeSchematicText
static TOOL_ACTION toTextBox
static TOOL_ACTION annotate
static TOOL_ACTION updateSymbols
static TOOL_ACTION swapPinLabels
static TOOL_ACTION enterSheet
static TOOL_ACTION editFootprint
static TOOL_ACTION repeatDrawItem
static TOOL_ACTION editTextAndGraphics
static TOOL_ACTION editPageNumber
static TOOL_ACTION toGLabel
static TOOL_ACTION setExcludeFromBoard
Object to handle a bitmap image that can be inserted in a schematic.
static const std::vector< KICAD_T > FieldOwners
static const std::vector< KICAD_T > DeletableItems
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
static SELECTION_CONDITION SingleMultiFunctionPin
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION MultipleSymbolsOrPower
static SELECTION_CONDITION AllPinsOrSheetPins
static SELECTION_CONDITION SingleSymbolOrPower
static SELECTION_CONDITION SingleMultiUnitSymbol
static SELECTION_CONDITION SingleMultiBodyStyleSymbol
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
Schematic editor (Eeschema) main window.
void ShowSchematicSetupDialog(const wxString &aInitialPage=wxEmptyString)
EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const override
Fetch an item by KIID.
const wxString & GetHighlightedConnection() const
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
VECTOR2I GetPosition() const override
wxString GetCanonicalName() const
Get a non-language-specific name for a field which can be used for storage, variable look-up,...
wxString GetName(bool aUseDefaultName=true) const
Return the field name (not translated).
void SetPosition(const VECTOR2I &aPosition) override
void SetText(const wxString &aText) override
VECTOR2I GetParentPosition() const
A set of SCH_ITEMs (i.e., without duplicates).
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual bool IsConnectable() const
virtual void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo)
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode)
const SYMBOL * GetParentSymbol() const
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
virtual void MirrorHorizontally(int aCenter)
Mirror item horizontally about aCenter.
virtual void Move(const VECTOR2I &aMoveVector)
Move the item by aMoveVector to a new position.
void SetConnectivityDirty(bool aDirty=true)
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
virtual void Rotate(const VECTOR2I &aCenter, bool aRotateCCW)
Rotate the item around aCenter 90 degrees in the clockwise direction.
AUTOPLACE_ALGO GetFieldsAutoplaced() const
Return whether the fields have been automatically placed.
wxString GetClass() const override
Return the class name.
bool IsGroupableType() const
virtual std::vector< VECTOR2I > GetConnectionPoints() const
Add all the connection points for this item to aPoints.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
virtual void MirrorVertically(int aCenter)
Mirror item vertically about aCenter.
void AddFields(const std::vector< SCH_FIELD > &aFields)
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
SPIN_STYLE GetSpinStyle() const
void SetShape(LABEL_FLAG_SHAPE aShape)
LABEL_FLAG_SHAPE GetShape() const
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
std::vector< SCH_FIELD > & GetFields()
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Segment description base class to describe items which have 2 end points (track, wire,...
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
const std::map< wxString, ALT > & GetAlternates() const
bool IsConnectable() const override
const wxString & GetName() const
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void ClearAnnotationOfNewSheetPaths(SCH_SHEET_LIST &aInitialSheetPathList)
Clear the annotation for the symbols inside new sheetpaths when a complex hierarchy is modified and n...
bool IsExplicitJunction(const VECTOR2I &aPosition) const
Indicate that a junction dot is necessary at the given location.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
const wxString & GetFileName() const
SCH_ITEM * GetItem(const VECTOR2I &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath, bool aResetPrefix)
Clear the annotation for the symbols in aSheetPath on the screen.
void SetPosition(const VECTOR2I &aPos) override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SCREEN * LastScreen()
wxString GetPageNumber() const
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false, bool aEscapeSheetNames=false) const
Return the sheet path in a human readable form made from the sheet names.
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
size_t size() const
Forwarded method from std::vector.
void pop_back()
Forwarded method from std::vector.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
SHEET_SIDE GetSide() const
void SetSide(SHEET_SIDE aEdge)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
wxString GetFileName() const
Return the filename corresponding to this sheet.
std::map< SCH_SHEET_PIN *, SCH_NO_CONNECT * > GetNoConnects() const
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
SCH_SCREEN * GetScreen() const
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
wxString GetUnitDisplayName(int aUnit, bool aLabel) const override
Return the display name for a given unit aUnit.
bool IsAnnotated(const SCH_SHEET_PATH *aSheet) const
Check if the symbol has a valid annotation (reference) for the given sheet path.
bool IsMultiBodyStyle() const override
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Automatically orient all the fields in the symbol.
wxString GetBodyStyleDescription(int aBodyStyle, bool aLabel) const override
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
bool HasDeMorganBodyStyles() const override
int GetBodyStyleCount() const override
Return the number of body styles of the symbol.
void SetOrientation(int aOrientation)
Compute the new transform matrix based on aOrientation for the symbol which is applied to the current...
bool IsMissingLibSymbol() const
Check to see if the library symbol is set to the dummy library symbol.
const LIB_ID & GetLibId() const override
int GetOrientation() const override
Get the display symbol orientation.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool IsPower() const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
int GetMarginBottom() const
int GetLegacyTextMargin() const
int GetMarginLeft() const
int GetMarginRight() const
virtual void Rotate90(bool aClockwise)
virtual void MirrorSpinStyle(bool aLeftRight)
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
virtual void Add(EDA_ITEM *aItem)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
VECTOR2I GetReferencePoint() const
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
virtual unsigned int GetSize() const override
Return the number of stored items.
int Size() const
Returns the number of selected parts.
std::deque< EDA_ITEM * > & Items()
std::vector< EDA_ITEM * > GetItemsSortedBySelectionOrder() const
bool OnlyContains(std::vector< KICAD_T > aList) const
Checks if all items in the selection have a type in aList.
bool Empty() const
Checks if there is anything selected.
bool HasReferencePoint() const
size_t CountType(KICAD_T aType) const
unsigned CCWRotationsTo(const SPIN_STYLE &aOther) const
Get CCW rotation needed to get to the given spin style.
The symbol library editor main window.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
This file is part of the common library.
@ SYMBOL_PROPS_EDIT_SCHEMATIC_SYMBOL
@ SYMBOL_PROPS_WANT_EXCHANGE_SYMBOL
@ SYMBOL_PROPS_WANT_UPDATE_SYMBOL
@ SYMBOL_PROPS_EDIT_LIBRARY_SYMBOL
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
#define IGNORE_PARENT_GROUP
#define IS_NEW
New item, just created.
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define STRUCT_DELETED
flag indication structures to be erased
#define ENDPOINT
ends. (Used to support dragging.)
#define STARTPOINT
When a line is selected, these flags indicate which.
@ ID_POPUP_SCH_PIN_TRICKS_HIER_LABEL
@ ID_POPUP_SCH_PIN_TRICKS_WIRE
@ ID_POPUP_SCH_ALT_PIN_FUNCTION
@ ID_POPUP_SCH_SELECT_UNIT1
@ ID_POPUP_SCH_SELECT_UNIT
@ ID_POPUP_SCH_SELECT_BODY_STYLE
@ ID_POPUP_SCH_PLACE_UNIT1
@ ID_POPUP_SCH_SELECT_BODY_STYLE1
@ ID_POPUP_SCH_PIN_TRICKS_NET_LABEL
@ ID_POPUP_SCH_PIN_TRICKS_NO_CONNECT
@ ID_POPUP_SCH_SELECT_UNIT_END
@ ID_POPUP_SCH_ALT_PIN_FUNCTION_END
@ ID_POPUP_SCH_PIN_TRICKS_GLOBAL_LABEL
@ ERCE_UNANNOTATED
Symbol has not been annotated.
@ ERCE_DUPLICATE_REFERENCE
More than one symbol with the same reference.
@ ERCE_FOOTPRINT_LINK_ISSUES
The footprint link is invalid, or points to a missing (or inactive) footprint or library.
@ ERCE_UNDEFINED_NETCLASS
A netclass was referenced but not defined.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
@ ERCE_FOOTPRINT_FILTERS
The assigned footprint doesn't match the footprint filters.
@ FRAME_SCH_SYMBOL_EDITOR
@ LAYER_SCHEMATIC_DRAWINGSHEET
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define UNIMPLEMENTED_FOR(type)
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
void CollectOtherUnits(const wxString &aRef, int aUnit, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)
Class to handle a set of SCH_ITEMs.
ANNOTATE_ORDER_T
Schematic annotation order options.
@ ANNOTATE_SELECTION
Annotate the selection.
ANNOTATE_ALGO_T
Schematic annotation type options.
SHEET_SIDE
Define the edge of the sheet that the sheet pin is positioned.
T * GetAppSettings(const char *aFilename)
wxString UnescapeString(const wxString &aSource)
wxString TitleCaps(const wxString &aString)
Capitalize the first letter in each word.
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
void AccumulateDescriptions(wxString &aDesc, const T &aItemCollection)
Build a comma-separated list from a collection of wxStrings.
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
wxString GetDefaultFieldName(FIELD_T aFieldId, bool aTranslateForHI)
Return a default symbol field name for a mandatory field type.
@ USER
The field ID hasn't been set yet; field is invalid.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
GR_TEXT_V_ALIGN_T
This is API surface mapped to common.types.VertialAlignment.
constexpr GR_TEXT_H_ALIGN_T GetFlippedAlignment(GR_TEXT_H_ALIGN_T aAlign)
Get the reverse alignment: left-right are swapped, others are unchanged.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D