Eeschema header housekeeping round 1.
This commit is contained in:
parent
7593ee3917
commit
a85898f904
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
* Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -79,16 +79,11 @@ enum class SCH_LIB_TYPE
|
||||||
LT_EESCHEMA,
|
LT_EESCHEMA,
|
||||||
LT_SYMBOL
|
LT_SYMBOL
|
||||||
};
|
};
|
||||||
|
|
||||||
// Helper class to filter a list of libraries, and/or a list of PART_LIB
|
// Helper class to filter a list of libraries, and/or a list of PART_LIB
|
||||||
// in dialogs
|
// in dialogs
|
||||||
class SCHLIB_FILTER
|
class SCHLIB_FILTER
|
||||||
{
|
{
|
||||||
wxArrayString m_allowedLibs; ///< a list of lib names to list some libraries
|
|
||||||
///< if empty: no filter
|
|
||||||
bool m_filterPowerParts; ///< true to filter (show only) power parts
|
|
||||||
bool m_forceLoad; // When true, load a part lib from the lib
|
|
||||||
// which is given in m_allowedLibs[0]
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCHLIB_FILTER()
|
SCHLIB_FILTER()
|
||||||
{
|
{
|
||||||
|
@ -159,6 +154,13 @@ public:
|
||||||
else
|
else
|
||||||
return dummy;
|
return dummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxArrayString m_allowedLibs; ///< a list of lib names to list some libraries
|
||||||
|
///< if empty: no filter
|
||||||
|
bool m_filterPowerParts; ///< true to filter (show only) power parts
|
||||||
|
bool m_forceLoad; // When true, load a part lib from the lib
|
||||||
|
// which is given in m_allowedLibs[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -307,19 +309,6 @@ public:
|
||||||
*/
|
*/
|
||||||
class PART_LIB
|
class PART_LIB
|
||||||
{
|
{
|
||||||
SCH_LIB_TYPE type; ///< Library type indicator.
|
|
||||||
wxFileName fileName; ///< Library file name.
|
|
||||||
wxDateTime timeStamp; ///< Library save time and date.
|
|
||||||
int versionMajor; ///< Library major version number.
|
|
||||||
int versionMinor; ///< Library minor version number.
|
|
||||||
wxString header; ///< first line of loaded library.
|
|
||||||
bool isModified; ///< Library modification status.
|
|
||||||
int m_mod_hash; ///< incremented each time library is changed.
|
|
||||||
|
|
||||||
SCH_IO_MGR::SCH_FILE_T m_pluginType;
|
|
||||||
std::unique_ptr< SCH_PLUGIN > m_plugin;
|
|
||||||
std::unique_ptr< PROPERTIES > m_properties; ///< Library properties
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PART_LIB( SCH_LIB_TYPE aType, const wxString& aFileName,
|
PART_LIB( SCH_LIB_TYPE aType, const wxString& aFileName,
|
||||||
SCH_IO_MGR::SCH_FILE_T aPluginType = SCH_IO_MGR::SCH_LEGACY );
|
SCH_IO_MGR::SCH_FILE_T aPluginType = SCH_IO_MGR::SCH_LEGACY );
|
||||||
|
@ -456,6 +445,20 @@ public:
|
||||||
* @throw IO_ERROR if there's any problem loading the library.
|
* @throw IO_ERROR if there's any problem loading the library.
|
||||||
*/
|
*/
|
||||||
static PART_LIB* LoadLibrary( const wxString& aFileName );
|
static PART_LIB* LoadLibrary( const wxString& aFileName );
|
||||||
|
|
||||||
|
private:
|
||||||
|
SCH_LIB_TYPE type; ///< Library type indicator.
|
||||||
|
wxFileName fileName; ///< Library file name.
|
||||||
|
wxDateTime timeStamp; ///< Library save time and date.
|
||||||
|
int versionMajor; ///< Library major version number.
|
||||||
|
int versionMinor; ///< Library minor version number.
|
||||||
|
wxString header; ///< first line of loaded library.
|
||||||
|
bool isModified; ///< Library modification status.
|
||||||
|
int m_mod_hash; ///< incremented each time library is changed.
|
||||||
|
|
||||||
|
SCH_IO_MGR::SCH_FILE_T m_pluginType;
|
||||||
|
std::unique_ptr< SCH_PLUGIN > m_plugin;
|
||||||
|
std::unique_ptr< PROPERTIES > m_properties; ///< Library properties
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 CERN
|
* Copyright (C) 2018 CERN
|
||||||
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
* @author Jon Evans <jon@craftyjon.com>
|
* @author Jon Evans <jon@craftyjon.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -148,6 +149,10 @@ public:
|
||||||
return PRIORITY::NONE;
|
return PRIORITY::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxString driverName( SCH_ITEM* aItem ) const;
|
||||||
|
|
||||||
|
public:
|
||||||
CONNECTION_GRAPH* m_graph;
|
CONNECTION_GRAPH* m_graph;
|
||||||
|
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
|
@ -229,10 +234,6 @@ public:
|
||||||
|
|
||||||
/// Used for multiple drivers ERC message; stores the second possible driver (or nullptr)
|
/// Used for multiple drivers ERC message; stores the second possible driver (or nullptr)
|
||||||
SCH_ITEM* m_second_driver;
|
SCH_ITEM* m_second_driver;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
wxString driverName( SCH_ITEM* aItem ) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Associates a net code with the final name of a net
|
/// Associates a net code with the final name of a net
|
||||||
|
@ -323,52 +324,7 @@ public:
|
||||||
|
|
||||||
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem );
|
CONNECTION_SUBGRAPH* GetSubgraphForItem( SCH_ITEM* aItem );
|
||||||
|
|
||||||
// TODO(JE) Remove this when pressure valve is removed
|
|
||||||
static bool m_allowRealTime;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// All the sheets in the schematic (as long as we don't have partial updates)
|
|
||||||
SCH_SHEET_LIST m_sheetList;
|
|
||||||
|
|
||||||
// All connectable items in the schematic
|
|
||||||
std::vector<SCH_ITEM*> m_items;
|
|
||||||
|
|
||||||
// The owner of all CONNECTION_SUBGRAPH objects
|
|
||||||
std::vector<CONNECTION_SUBGRAPH*> m_subgraphs;
|
|
||||||
|
|
||||||
// Cache of a subset of m_subgraphs
|
|
||||||
std::vector<CONNECTION_SUBGRAPH*> m_driver_subgraphs;
|
|
||||||
|
|
||||||
// Cache to lookup subgraphs in m_driver_subgraphs by sheet path
|
|
||||||
std::unordered_map<SCH_SHEET_PATH, std::vector<CONNECTION_SUBGRAPH*>> m_sheet_to_subgraphs_map;
|
|
||||||
|
|
||||||
std::vector<std::pair<SCH_SHEET_PATH, SCH_PIN*>> m_invisible_power_pins;
|
|
||||||
|
|
||||||
std::unordered_map< wxString, std::shared_ptr<BUS_ALIAS> > m_bus_alias_cache;
|
|
||||||
|
|
||||||
std::map<wxString, int> m_net_name_to_code_map;
|
|
||||||
|
|
||||||
std::map<wxString, int> m_bus_name_to_code_map;
|
|
||||||
|
|
||||||
std::map<wxString, std::vector<const CONNECTION_SUBGRAPH*>> m_global_label_cache;
|
|
||||||
|
|
||||||
std::map< std::pair<SCH_SHEET_PATH, wxString>,
|
|
||||||
std::vector<const CONNECTION_SUBGRAPH*> > m_local_label_cache;
|
|
||||||
|
|
||||||
std::unordered_map<wxString, std::vector<CONNECTION_SUBGRAPH*>> m_net_name_to_subgraphs_map;
|
|
||||||
|
|
||||||
std::map<SCH_ITEM*, CONNECTION_SUBGRAPH*> m_item_to_subgraph_map;
|
|
||||||
|
|
||||||
NET_MAP m_net_code_to_subgraphs_map;
|
|
||||||
|
|
||||||
int m_last_net_code;
|
|
||||||
|
|
||||||
int m_last_bus_code;
|
|
||||||
|
|
||||||
int m_last_subgraph_code;
|
|
||||||
|
|
||||||
SCHEMATIC* m_schematic; ///< The schematic this graph represents
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the graphical connectivity between items (i.e. where they touch)
|
* Updates the graphical connectivity between items (i.e. where they touch)
|
||||||
* The items passed in must be on the same sheet.
|
* The items passed in must be on the same sheet.
|
||||||
|
@ -547,6 +503,52 @@ private:
|
||||||
*/
|
*/
|
||||||
int ercCheckHierSheets();
|
int ercCheckHierSheets();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// TODO(JE) Remove this when pressure valve is removed
|
||||||
|
static bool m_allowRealTime;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// All the sheets in the schematic (as long as we don't have partial updates)
|
||||||
|
SCH_SHEET_LIST m_sheetList;
|
||||||
|
|
||||||
|
// All connectable items in the schematic
|
||||||
|
std::vector<SCH_ITEM*> m_items;
|
||||||
|
|
||||||
|
// The owner of all CONNECTION_SUBGRAPH objects
|
||||||
|
std::vector<CONNECTION_SUBGRAPH*> m_subgraphs;
|
||||||
|
|
||||||
|
// Cache of a subset of m_subgraphs
|
||||||
|
std::vector<CONNECTION_SUBGRAPH*> m_driver_subgraphs;
|
||||||
|
|
||||||
|
// Cache to lookup subgraphs in m_driver_subgraphs by sheet path
|
||||||
|
std::unordered_map<SCH_SHEET_PATH, std::vector<CONNECTION_SUBGRAPH*>> m_sheet_to_subgraphs_map;
|
||||||
|
|
||||||
|
std::vector<std::pair<SCH_SHEET_PATH, SCH_PIN*>> m_invisible_power_pins;
|
||||||
|
|
||||||
|
std::unordered_map< wxString, std::shared_ptr<BUS_ALIAS> > m_bus_alias_cache;
|
||||||
|
|
||||||
|
std::map<wxString, int> m_net_name_to_code_map;
|
||||||
|
|
||||||
|
std::map<wxString, int> m_bus_name_to_code_map;
|
||||||
|
|
||||||
|
std::map<wxString, std::vector<const CONNECTION_SUBGRAPH*>> m_global_label_cache;
|
||||||
|
|
||||||
|
std::map< std::pair<SCH_SHEET_PATH, wxString>,
|
||||||
|
std::vector<const CONNECTION_SUBGRAPH*> > m_local_label_cache;
|
||||||
|
|
||||||
|
std::unordered_map<wxString, std::vector<CONNECTION_SUBGRAPH*>> m_net_name_to_subgraphs_map;
|
||||||
|
|
||||||
|
std::map<SCH_ITEM*, CONNECTION_SUBGRAPH*> m_item_to_subgraph_map;
|
||||||
|
|
||||||
|
NET_MAP m_net_code_to_subgraphs_map;
|
||||||
|
|
||||||
|
int m_last_net_code;
|
||||||
|
|
||||||
|
int m_last_bus_code;
|
||||||
|
|
||||||
|
int m_last_subgraph_code;
|
||||||
|
|
||||||
|
SCHEMATIC* m_schematic; ///< The schematic this graph represents
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -33,7 +33,6 @@ using KIGFX::COLOR4D;
|
||||||
class EESCHEMA_SETTINGS : public APP_SETTINGS_BASE
|
class EESCHEMA_SETTINGS : public APP_SETTINGS_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct APPEARANCE
|
struct APPEARANCE
|
||||||
{
|
{
|
||||||
wxString edit_component_visible_columns;
|
wxString edit_component_visible_columns;
|
||||||
|
@ -205,6 +204,18 @@ public:
|
||||||
|
|
||||||
static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
|
static std::vector<BOM_PLUGIN_SETTINGS> DefaultBomPlugins();
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool migrateBomSettings();
|
||||||
|
|
||||||
|
nlohmann::json bomSettingsToJson() const;
|
||||||
|
|
||||||
|
static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
|
||||||
|
|
||||||
|
public:
|
||||||
APPEARANCE m_Appearance;
|
APPEARANCE m_Appearance;
|
||||||
|
|
||||||
AUTOPLACE_FIELDS m_AutoplaceFields;
|
AUTOPLACE_FIELDS m_AutoplaceFields;
|
||||||
|
@ -236,18 +247,6 @@ public:
|
||||||
bool m_RescueNeverShow;
|
bool m_RescueNeverShow;
|
||||||
|
|
||||||
wxString m_lastSymbolLibDir;
|
wxString m_lastSymbolLibDir;
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
virtual std::string getLegacyFrameName() const override { return "SchematicFrame"; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool migrateBomSettings();
|
|
||||||
|
|
||||||
nlohmann::json bomSettingsToJson() const;
|
|
||||||
|
|
||||||
static std::vector<BOM_PLUGIN_SETTINGS> bomSettingsFromJson( const nlohmann::json& aObj );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -45,14 +45,6 @@ class HIERARCHY_NAVIG_DLG;
|
||||||
*/
|
*/
|
||||||
class HIERARCHY_TREE : public wxTreeCtrl
|
class HIERARCHY_TREE : public wxTreeCtrl
|
||||||
{
|
{
|
||||||
// Need to use wxRTTI macros in order for OnCompareItems to work properly
|
|
||||||
// See: https://docs.wxwidgets.org/3.1/classwx_tree_ctrl.html#ab90a465793c291ca7aa827a576b7d146
|
|
||||||
wxDECLARE_ABSTRACT_CLASS( HIERARCHY_TREE );
|
|
||||||
|
|
||||||
private:
|
|
||||||
HIERARCHY_NAVIG_DLG* m_parent;
|
|
||||||
wxImageList* imageList;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HIERARCHY_TREE( HIERARCHY_NAVIG_DLG* parent );
|
HIERARCHY_TREE( HIERARCHY_NAVIG_DLG* parent );
|
||||||
|
|
||||||
|
@ -60,17 +52,18 @@ public:
|
||||||
void onChar( wxKeyEvent& event );
|
void onChar( wxKeyEvent& event );
|
||||||
|
|
||||||
int OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) override;
|
int OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Need to use wxRTTI macros in order for OnCompareItems to work properly
|
||||||
|
// See: https://docs.wxwidgets.org/3.1/classwx_tree_ctrl.html#ab90a465793c291ca7aa827a576b7d146
|
||||||
|
wxDECLARE_ABSTRACT_CLASS( HIERARCHY_TREE );
|
||||||
|
|
||||||
|
HIERARCHY_NAVIG_DLG* m_parent;
|
||||||
|
wxImageList* imageList;
|
||||||
};
|
};
|
||||||
|
|
||||||
class HIERARCHY_NAVIG_DLG : public DIALOG_SHIM
|
class HIERARCHY_NAVIG_DLG : public DIALOG_SHIM
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
SCH_SHEET_PATH m_currSheet;
|
|
||||||
SCH_SHEET_PATH m_list;
|
|
||||||
SCH_EDIT_FRAME* m_SchFrameEditor;
|
|
||||||
HIERARCHY_TREE* m_Tree;
|
|
||||||
int m_nbsheets;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* aParent );
|
HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* aParent );
|
||||||
|
|
||||||
|
@ -87,9 +80,10 @@ private:
|
||||||
/**
|
/**
|
||||||
* Create the hierarchical tree of the schematic.
|
* Create the hierarchical tree of the schematic.
|
||||||
*
|
*
|
||||||
* This routine is reentrant!
|
* @warning This routine is reentrant!
|
||||||
* @param aList = the SCH_SHEET_PATH* list to explore
|
*
|
||||||
* @param aPreviousmenu = the wxTreeItemId used as parent to add sub items
|
* @param[in] aList is the #SCH_SHEET_PATH list to explore.
|
||||||
|
* @param aPreviousmenu is the wxTreeItemId used as parent to add sub items.
|
||||||
*/
|
*/
|
||||||
void buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemId* aPreviousmenu );
|
void buildHierarchyTree( SCH_SHEET_PATH* aList, wxTreeItemId* aPreviousmenu );
|
||||||
|
|
||||||
|
@ -100,18 +94,20 @@ private:
|
||||||
void onSelectSheetPath( wxTreeEvent& event );
|
void onSelectSheetPath( wxTreeEvent& event );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRootString
|
|
||||||
* @return String with page number in parenthesis
|
* @return String with page number in parenthesis
|
||||||
*/
|
*/
|
||||||
wxString getRootString();
|
wxString getRootString();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* formatPageString
|
|
||||||
* @param aName
|
|
||||||
* @param aPage
|
|
||||||
* @return String with page number in parenthesis
|
* @return String with page number in parenthesis
|
||||||
*/
|
*/
|
||||||
wxString formatPageString( wxString aName, wxString aPage );
|
wxString formatPageString( wxString aName, wxString aPage );
|
||||||
|
|
||||||
|
SCH_SHEET_PATH m_currSheet;
|
||||||
|
SCH_SHEET_PATH m_list;
|
||||||
|
SCH_EDIT_FRAME* m_SchFrameEditor;
|
||||||
|
HIERARCHY_TREE* m_Tree;
|
||||||
|
int m_nbsheets;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HIERARCH_H
|
#endif // HIERARCH_H
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
|
||||||
* Copyright (C) 2019 CERN
|
* Copyright (C) 2019 CERN
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -34,25 +34,6 @@ class TRANSFORM;
|
||||||
|
|
||||||
class LIB_ARC : public LIB_ITEM
|
class LIB_ARC : public LIB_ITEM
|
||||||
{
|
{
|
||||||
enum SELECT_T // When creating an arc: status of arc
|
|
||||||
{
|
|
||||||
ARC_STATUS_START,
|
|
||||||
ARC_STATUS_END,
|
|
||||||
ARC_STATUS_OUTLINE,
|
|
||||||
};
|
|
||||||
|
|
||||||
int m_Radius;
|
|
||||||
int m_t1; // First radius angle of the arc in 0.1 degrees.
|
|
||||||
int m_t2; /* Second radius angle of the arc in 0.1 degrees. */
|
|
||||||
wxPoint m_ArcStart;
|
|
||||||
wxPoint m_ArcEnd; /* Arc end position. */
|
|
||||||
wxPoint m_Pos; /* Radius center point. */
|
|
||||||
int m_Width; /* Line width */
|
|
||||||
int m_editState;
|
|
||||||
|
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
|
||||||
const TRANSFORM& aTransform ) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_ARC( LIB_PART * aParent );
|
LIB_ARC( LIB_PART * aParent );
|
||||||
|
|
||||||
|
@ -137,6 +118,8 @@ public:
|
||||||
EDA_ITEM* Clone() const override;
|
EDA_ITEM* Clone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
|
const TRANSFORM& aTransform ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc LIB_ITEM::compare()
|
* @copydoc LIB_ITEM::compare()
|
||||||
|
@ -149,6 +132,22 @@ private:
|
||||||
*/
|
*/
|
||||||
int compare( const LIB_ITEM& aOther,
|
int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
||||||
|
|
||||||
|
enum SELECT_T // When creating an arc: status of arc
|
||||||
|
{
|
||||||
|
ARC_STATUS_START,
|
||||||
|
ARC_STATUS_END,
|
||||||
|
ARC_STATUS_OUTLINE,
|
||||||
|
};
|
||||||
|
|
||||||
|
int m_Radius;
|
||||||
|
int m_t1; // First radius angle of the arc in 0.1 degrees.
|
||||||
|
int m_t2; /* Second radius angle of the arc in 0.1 degrees. */
|
||||||
|
wxPoint m_ArcStart;
|
||||||
|
wxPoint m_ArcEnd; /* Arc end position. */
|
||||||
|
wxPoint m_Pos; /* Radius center point. */
|
||||||
|
int m_Width; /* Line width */
|
||||||
|
int m_editState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -33,10 +33,6 @@
|
||||||
*/
|
*/
|
||||||
class LIB_BEZIER : public LIB_ITEM
|
class LIB_BEZIER : public LIB_ITEM
|
||||||
{
|
{
|
||||||
int m_Width; // Line width
|
|
||||||
std::vector<wxPoint> m_BezierPoints; // list of parameter (3|4)
|
|
||||||
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_BEZIER( LIB_PART * aParent );
|
LIB_BEZIER( LIB_PART * aParent );
|
||||||
|
|
||||||
|
@ -105,6 +101,10 @@ private:
|
||||||
|
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
void* aData, const TRANSFORM& aTransform ) override;
|
void* aData, const TRANSFORM& aTransform ) override;
|
||||||
|
|
||||||
|
int m_Width; // Line width
|
||||||
|
std::vector<wxPoint> m_BezierPoints; // list of parameter (3|4)
|
||||||
|
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -32,10 +32,6 @@
|
||||||
|
|
||||||
class LIB_CIRCLE : public LIB_ITEM
|
class LIB_CIRCLE : public LIB_ITEM
|
||||||
{
|
{
|
||||||
wxPoint m_Pos; // Position or centre (Arc and Circle) or start point (segments).
|
|
||||||
wxPoint m_EndPos; // A point on the circumference of the circle.
|
|
||||||
int m_Width; // Line width.
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_CIRCLE( LIB_PART * aParent );
|
LIB_CIRCLE( LIB_PART * aParent );
|
||||||
|
|
||||||
|
@ -107,6 +103,10 @@ private:
|
||||||
|
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
const TRANSFORM& aTransform ) override;
|
const TRANSFORM& aTransform ) override;
|
||||||
|
|
||||||
|
wxPoint m_Pos; // Position or centre (Arc and Circle) or start point (segments).
|
||||||
|
wxPoint m_EndPos; // A point on the circumference of the circle.
|
||||||
|
int m_Width; // Line width.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,6 @@ typedef std::vector< LIB_PIN* > LIB_PINS;
|
||||||
*/
|
*/
|
||||||
class LIB_ITEM : public EDA_ITEM
|
class LIB_ITEM : public EDA_ITEM
|
||||||
{
|
{
|
||||||
friend class LIB_PART;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_ITEM( KICAD_T aType, LIB_PART* aComponent = NULL, int aUnit = 0, int aConvert = 0,
|
LIB_ITEM( KICAD_T aType, LIB_PART* aComponent = NULL, int aUnit = 0, int aConvert = 0,
|
||||||
FILL_TYPE aFillType = FILL_TYPE::NO_FILL );
|
FILL_TYPE aFillType = FILL_TYPE::NO_FILL );
|
||||||
|
@ -120,7 +118,7 @@ public:
|
||||||
virtual void EndEdit() {}
|
virtual void EndEdit() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the attributes of an item at \a aPosition when it is being edited.
|
* Calculate the attributes of an item at \a aPosition when it is being edited.
|
||||||
*
|
*
|
||||||
* This method gets called by the Draw() method when the item is being edited. This
|
* This method gets called by the Draw() method when the item is being edited. This
|
||||||
* probably should be a pure virtual method but bezier curves are not yet editable in
|
* probably should be a pure virtual method but bezier curves are not yet editable in
|
||||||
|
@ -306,6 +304,9 @@ protected:
|
||||||
virtual void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
virtual void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
const TRANSFORM& aTransform ) = 0;
|
const TRANSFORM& aTransform ) = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class LIB_PART;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Unit identification for multiple parts per package. Set to 0 if the item is common
|
* Unit identification for multiple parts per package. Set to 0 if the item is common
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras at wanadoo.fr
|
||||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
* Copyright (C) 2004-2021 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -62,54 +62,6 @@ public:
|
||||||
ELECTRICAL_PINTYPE m_Type; // Electrical type of the pin.
|
ELECTRICAL_PINTYPE m_Type; // Electrical type of the pin.
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
|
||||||
wxPoint m_position; // Position of the pin.
|
|
||||||
int m_length; // Length of the pin.
|
|
||||||
int m_orientation; // Pin orientation (Up, Down, Left, Right)
|
|
||||||
GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin
|
|
||||||
ELECTRICAL_PINTYPE m_type; // Electrical type of the pin.
|
|
||||||
int m_attributes; // Set bit 0 to indicate pin is invisible.
|
|
||||||
wxString m_name;
|
|
||||||
wxString m_number;
|
|
||||||
int m_numTextSize; // Pin num and Pin name sizes
|
|
||||||
int m_nameTextSize;
|
|
||||||
|
|
||||||
std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Print the pin symbol without text.
|
|
||||||
* If \a aColor != 0, draw with \a aColor, else with the normal pin color.
|
|
||||||
*/
|
|
||||||
void printPinSymbol( const RENDER_SETTINGS* aSettings, const wxPoint& aPos, int aOrientation );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Put the pin number and pin text info, given the pin line coordinates.
|
|
||||||
* The line must be vertical or horizontal.
|
|
||||||
* If aDrawPinName == false the pin name is not printed.
|
|
||||||
* If aDrawPinNum = false the pin number is not printed.
|
|
||||||
* If aTextInside then the text is been put inside,otherwise all is drawn outside.
|
|
||||||
* Pin Name: substring between '~' is negated
|
|
||||||
*/
|
|
||||||
void printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, int aPinOrient,
|
|
||||||
int aTextInside, bool aDrawPinNum, bool aDrawPinName );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draw the electrical type text of the pin (only for the footprint editor)
|
|
||||||
*/
|
|
||||||
void printPinElectricalTypeName( const RENDER_SETTINGS* aSettings, wxPoint& aPosition,
|
|
||||||
int aOrientation );
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* return a string giving the electrical type of a pin.
|
|
||||||
* Can be used when a known, not translated name is needed (for instance in net lists)
|
|
||||||
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE )
|
|
||||||
* @return The electrical name for a pin type (see enun MsgPinElectricType for names).
|
|
||||||
*/
|
|
||||||
static const wxString GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType );
|
|
||||||
|
|
||||||
public:
|
|
||||||
~LIB_PIN() { }
|
~LIB_PIN() { }
|
||||||
|
|
||||||
wxString GetClass() const override
|
wxString GetClass() const override
|
||||||
|
@ -277,6 +229,40 @@ public:
|
||||||
|
|
||||||
void CalcEdit( const wxPoint& aPosition ) override;
|
void CalcEdit( const wxPoint& aPosition ) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a string giving the electrical type of a pin.
|
||||||
|
*
|
||||||
|
* Can be used when a known, not translated name is needed (for instance in net lists)
|
||||||
|
*
|
||||||
|
* @param aType is the electrical type (see enum ELECTRICAL_PINTYPE )
|
||||||
|
* @return The electrical name for a pin type (see enun MsgPinElectricType for names).
|
||||||
|
*/
|
||||||
|
static const wxString GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Print the pin symbol without text.
|
||||||
|
* If \a aColor != 0, draw with \a aColor, else with the normal pin color.
|
||||||
|
*/
|
||||||
|
void printPinSymbol( const RENDER_SETTINGS* aSettings, const wxPoint& aPos, int aOrientation );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put the pin number and pin text info, given the pin line coordinates.
|
||||||
|
* The line must be vertical or horizontal.
|
||||||
|
* If aDrawPinName == false the pin name is not printed.
|
||||||
|
* If aDrawPinNum = false the pin number is not printed.
|
||||||
|
* If aTextInside then the text is been put inside,otherwise all is drawn outside.
|
||||||
|
* Pin Name: substring between '~' is negated
|
||||||
|
*/
|
||||||
|
void printPinTexts( const RENDER_SETTINGS* aSettings, wxPoint& aPinPos, int aPinOrient,
|
||||||
|
int aTextInside, bool aDrawPinNum, bool aDrawPinName );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw the electrical type text of the pin (only for the footprint editor)
|
||||||
|
*/
|
||||||
|
void printPinElectricalTypeName( const RENDER_SETTINGS* aSettings, wxPoint& aPosition,
|
||||||
|
int aOrientation );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @copydoc LIB_ITEM::compare()
|
* @copydoc LIB_ITEM::compare()
|
||||||
|
@ -289,6 +275,20 @@ private:
|
||||||
*/
|
*/
|
||||||
int compare( const LIB_ITEM& aOther,
|
int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxPoint m_position; // Position of the pin.
|
||||||
|
int m_length; // Length of the pin.
|
||||||
|
int m_orientation; // Pin orientation (Up, Down, Left, Right)
|
||||||
|
GRAPHIC_PINSHAPE m_shape; // Shape drawn around pin
|
||||||
|
ELECTRICAL_PINTYPE m_type; // Electrical type of the pin.
|
||||||
|
int m_attributes; // Set bit 0 to indicate pin is invisible.
|
||||||
|
wxString m_name;
|
||||||
|
wxString m_number;
|
||||||
|
int m_numTextSize; // Pin num and Pin name sizes
|
||||||
|
int m_nameTextSize;
|
||||||
|
|
||||||
|
std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -30,12 +30,6 @@
|
||||||
|
|
||||||
class LIB_POLYLINE : public LIB_ITEM
|
class LIB_POLYLINE : public LIB_ITEM
|
||||||
{
|
{
|
||||||
int m_Width; // Line width
|
|
||||||
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
|
|
||||||
|
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
|
||||||
const TRANSFORM& aTransform ) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_POLYLINE( LIB_PART * aParent );
|
LIB_POLYLINE( LIB_PART * aParent );
|
||||||
|
|
||||||
|
@ -119,6 +113,12 @@ private:
|
||||||
*/
|
*/
|
||||||
int compare( const LIB_ITEM& aOther,
|
int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
||||||
|
|
||||||
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
|
const TRANSFORM& aTransform ) override;
|
||||||
|
|
||||||
|
int m_Width; // Line width
|
||||||
|
std::vector<wxPoint> m_PolyPoints; // list of points (>= 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHOR.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -30,13 +30,6 @@
|
||||||
|
|
||||||
class LIB_RECTANGLE : public LIB_ITEM
|
class LIB_RECTANGLE : public LIB_ITEM
|
||||||
{
|
{
|
||||||
wxPoint m_End; // Rectangle end point.
|
|
||||||
wxPoint m_Pos; // Rectangle start point.
|
|
||||||
int m_Width; // Line width
|
|
||||||
|
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
|
||||||
void* aData, const TRANSFORM& aTransform ) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_RECTANGLE( LIB_PART * aParent );
|
LIB_RECTANGLE( LIB_PART * aParent );
|
||||||
|
|
||||||
|
@ -95,7 +88,6 @@ public:
|
||||||
EDA_ITEM* Clone() const override;
|
EDA_ITEM* Clone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc LIB_ITEM::compare()
|
* @copydoc LIB_ITEM::compare()
|
||||||
*
|
*
|
||||||
|
@ -107,6 +99,13 @@ private:
|
||||||
*/
|
*/
|
||||||
int compare( const LIB_ITEM& aOther,
|
int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
||||||
|
|
||||||
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
|
||||||
|
void* aData, const TRANSFORM& aTransform ) override;
|
||||||
|
|
||||||
|
wxPoint m_End; // Rectangle end point.
|
||||||
|
wxPoint m_Pos; // Rectangle start point.
|
||||||
|
int m_Width; // Line width
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,17 +31,13 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define a symbol library graphical text item.
|
* Define a symbol library graphical text item.
|
||||||
* <p>
|
*
|
||||||
* This is only a graphical text item. Field text like the reference designator,
|
* This is only a graphical text item. Field text like the reference designator,
|
||||||
* symbol value, etc. are not LIB_TEXT items. See the #LIB_FIELD class for the
|
* symbol value, etc. are not LIB_TEXT items. See the #LIB_FIELD class for the
|
||||||
* field item definition.
|
* field item definition.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
class LIB_TEXT : public LIB_ITEM, public EDA_TEXT
|
class LIB_TEXT : public LIB_ITEM, public EDA_TEXT
|
||||||
{
|
{
|
||||||
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
|
||||||
const TRANSFORM& aTransform ) override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LIB_TEXT( LIB_PART* aParent );
|
LIB_TEXT( LIB_PART* aParent );
|
||||||
|
|
||||||
|
@ -115,7 +111,6 @@ public:
|
||||||
EDA_ITEM* Clone() const override;
|
EDA_ITEM* Clone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc LIB_ITEM::compare()
|
* @copydoc LIB_ITEM::compare()
|
||||||
*
|
*
|
||||||
|
@ -128,6 +123,9 @@ private:
|
||||||
*/
|
*/
|
||||||
int compare( const LIB_ITEM& aOther,
|
int compare( const LIB_ITEM& aOther,
|
||||||
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
LIB_ITEM::COMPARE_FLAGS aCompareFlags = LIB_ITEM::COMPARE_FLAGS::NORMAL ) const override;
|
||||||
|
|
||||||
|
void print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, void* aData,
|
||||||
|
const TRANSFORM& aTransform ) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
|
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
|
||||||
* Copyright (C) 2015-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -65,13 +65,6 @@ enum RESCUE_TYPE
|
||||||
|
|
||||||
class RESCUE_CANDIDATE
|
class RESCUE_CANDIDATE
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
wxString m_requested_name;
|
|
||||||
wxString m_new_name;
|
|
||||||
LIB_PART* m_lib_candidate;
|
|
||||||
int m_unit;
|
|
||||||
int m_convert;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~RESCUE_CANDIDATE() {}
|
virtual ~RESCUE_CANDIDATE() {}
|
||||||
|
|
||||||
|
@ -112,6 +105,13 @@ public:
|
||||||
* @return True on success.
|
* @return True on success.
|
||||||
*/
|
*/
|
||||||
virtual bool PerformAction( RESCUER* aRescuer ) = 0;
|
virtual bool PerformAction( RESCUER* aRescuer ) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxString m_requested_name;
|
||||||
|
wxString m_new_name;
|
||||||
|
LIB_PART* m_lib_candidate;
|
||||||
|
int m_unit;
|
||||||
|
int m_convert;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,18 +121,19 @@ public:
|
||||||
/**
|
/**
|
||||||
* Grab all possible RESCUE_CASE_CANDIDATE objects into a vector.
|
* Grab all possible RESCUE_CASE_CANDIDATE objects into a vector.
|
||||||
*
|
*
|
||||||
* @param aRescuer - the working RESCUER instance.
|
* @param aRescuer is the working RESCUER instance.
|
||||||
* @param aCandidates - the vector the will hold the candidates.
|
* @param aCandidates is the vector the will hold the candidates.
|
||||||
*/
|
*/
|
||||||
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor RESCUE_CANDIDATE
|
* Create a RESCUE_CANDIDATE.
|
||||||
* @param aRequestedName - the name the schematic asks for
|
*
|
||||||
* @param aNewName - the name we want to change it to
|
* @param aRequestedName us the name the schematic asks for.
|
||||||
* @param aLibCandidate - the part that will give us
|
* @param aNewName is the name we want to change it to.
|
||||||
* @param aUnit The unit of the rescued symbol.
|
* @param aLibCandidate is the part that will give us.
|
||||||
* @param aConvert The body style of the rescued symbol.
|
* @param aUnit is the unit of the rescued symbol.
|
||||||
|
* @param aConvert is the body style of the rescued symbol.
|
||||||
*/
|
*/
|
||||||
RESCUE_CASE_CANDIDATE( const wxString& aRequestedName, const wxString& aNewName,
|
RESCUE_CASE_CANDIDATE( const wxString& aRequestedName, const wxString& aNewName,
|
||||||
LIB_PART* aLibCandidate, int aUnit = 0, int aConvert = 0 );
|
LIB_PART* aLibCandidate, int aUnit = 0, int aConvert = 0 );
|
||||||
|
@ -151,21 +152,22 @@ class RESCUE_CACHE_CANDIDATE: public RESCUE_CANDIDATE
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Grab all possible #RESCUE_CACHE_CANDIDATE objectss into a vector.
|
* Grab all possible #RESCUE_CACHE_CANDIDATE objects into a vector.
|
||||||
*
|
*
|
||||||
* @param aRescuer - the working RESCUER instance.
|
* @param aRescuer is the working RESCUER instance.
|
||||||
* @param aCandidates - the vector the will hold the candidates.
|
* @param aCandidates is the vector the will hold the candidates.
|
||||||
*/
|
*/
|
||||||
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor RESCUE_CACHE_CANDIDATE
|
* Create a RESCUE_CACHE_CANDIDATE.
|
||||||
* @param aRequestedName - the name the schematic asks for
|
*
|
||||||
* @param aNewName - the name we want to change it to
|
* @param aRequestedName is the name the schematic asks for.
|
||||||
* @param aCacheCandidate - the part from the cache
|
* @param aNewName is the name we want to change it to.
|
||||||
* @param aLibCandidate - the part that would be loaded from the library
|
* @param aCacheCandidate is the part from the cache.
|
||||||
* @param aUnit The unit of the rescued symbol.
|
* @param aLibCandidate is the part that would be loaded from the library.
|
||||||
* @param aConvert The body style of the rescued symbol.
|
* @param aUnit is the unit of the rescued symbol.
|
||||||
|
* @param aConvert is the body style of the rescued symbol.
|
||||||
*/
|
*/
|
||||||
RESCUE_CACHE_CANDIDATE( const wxString& aRequestedName, const wxString& aNewName,
|
RESCUE_CACHE_CANDIDATE( const wxString& aRequestedName, const wxString& aNewName,
|
||||||
LIB_PART* aCacheCandidate, LIB_PART* aLibCandidate,
|
LIB_PART* aCacheCandidate, LIB_PART* aLibCandidate,
|
||||||
|
@ -183,27 +185,24 @@ public:
|
||||||
|
|
||||||
class RESCUE_SYMBOL_LIB_TABLE_CANDIDATE : public RESCUE_CANDIDATE
|
class RESCUE_SYMBOL_LIB_TABLE_CANDIDATE : public RESCUE_CANDIDATE
|
||||||
{
|
{
|
||||||
LIB_ID m_requested_id;
|
|
||||||
LIB_ID m_new_id;
|
|
||||||
LIB_PART* m_cache_candidate;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Grab all possible RESCUE_SYMBOL_LIB_TABLE_CANDIDATE objects into a vector.
|
* Grab all possible RESCUE_SYMBOL_LIB_TABLE_CANDIDATE objects into a vector.
|
||||||
*
|
*
|
||||||
* @param aRescuer - the working RESCUER instance.
|
* @param aRescuer is the working #RESCUER instance.
|
||||||
* @param aCandidates - the vector the will hold the candidates.
|
* @param aCandidates is the vector the will hold the candidates.
|
||||||
*/
|
*/
|
||||||
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
static void FindRescues( RESCUER& aRescuer, boost::ptr_vector<RESCUE_CANDIDATE>& aCandidates );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor RESCUE_CANDIDATE
|
* Create RESCUE_CANDIDATE.
|
||||||
* @param aRequestedName - the name the schematic asks for
|
*
|
||||||
* @param aNewName - the name we want to change it to
|
* @param aRequestedName is the name the schematic asks for.
|
||||||
* @param aCacheCandidate - the part from the cache
|
* @param aNewName is the name we want to change it to.
|
||||||
* @param aLibCandidate - the part that would be loaded from the library
|
* @param aCacheCandidate is the part from the cache.
|
||||||
* @param aUnit The unit of the rescued symbol.
|
* @param aLibCandidate is the part that would be loaded from the library.
|
||||||
* @param aConvert The body style of the rescued symbol.
|
* @param aUnit is the unit of the rescued symbol.
|
||||||
|
* @param aConvert is the body style of the rescued symbol.
|
||||||
*/
|
*/
|
||||||
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE( const LIB_ID& aRequestedId, const LIB_ID& aNewId,
|
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE( const LIB_ID& aRequestedId, const LIB_ID& aNewId,
|
||||||
LIB_PART* aCacheCandidate, LIB_PART* aLibCandidate,
|
LIB_PART* aCacheCandidate, LIB_PART* aLibCandidate,
|
||||||
|
@ -216,6 +215,11 @@ public:
|
||||||
virtual wxString GetActionDescription() const override;
|
virtual wxString GetActionDescription() const override;
|
||||||
|
|
||||||
virtual bool PerformAction( RESCUER* aRescuer ) override;
|
virtual bool PerformAction( RESCUER* aRescuer ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
LIB_ID m_requested_id;
|
||||||
|
LIB_ID m_new_id;
|
||||||
|
LIB_PART* m_cache_candidate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,20 +234,6 @@ public:
|
||||||
|
|
||||||
class RESCUER
|
class RESCUER
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
friend class DIALOG_RESCUE_EACH;
|
|
||||||
|
|
||||||
std::vector<SCH_COMPONENT*> m_components;
|
|
||||||
PROJECT* m_prj;
|
|
||||||
SCHEMATIC* m_schematic;
|
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galBackEndType;
|
|
||||||
SCH_SHEET_PATH* m_currentSheet;
|
|
||||||
|
|
||||||
boost::ptr_vector<RESCUE_CANDIDATE> m_all_candidates;
|
|
||||||
std::vector<RESCUE_CANDIDATE*> m_chosen_candidates;
|
|
||||||
|
|
||||||
std::vector<RESCUE_LOG> m_rescue_log;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic, SCH_SHEET_PATH* aCurrentSheet,
|
RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic, SCH_SHEET_PATH* aCurrentSheet,
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType );
|
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackeEndType );
|
||||||
|
@ -253,8 +243,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes out the rescue library. Called after successful PerformAction()s. If this fails,
|
* Write the rescue library.
|
||||||
* undo the actions.
|
*
|
||||||
|
* Called after successful PerformAction()s. If this fails, undo the actions.
|
||||||
*
|
*
|
||||||
* @return True on success.
|
* @return True on success.
|
||||||
*/
|
*/
|
||||||
|
@ -282,12 +273,12 @@ public:
|
||||||
void RemoveDuplicates();
|
void RemoveDuplicates();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returen the number of rescue candidates found.
|
* Return the number of rescue candidates found.
|
||||||
*/
|
*/
|
||||||
size_t GetCandidateCount() { return m_all_candidates.size(); }
|
size_t GetCandidateCount() { return m_all_candidates.size(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of resuce candidates chosen by the user.
|
* Get the number of rescue candidates chosen by the user.
|
||||||
*/
|
*/
|
||||||
size_t GetChosenCandidateCount() { return m_chosen_candidates.size(); }
|
size_t GetChosenCandidateCount() { return m_chosen_candidates.size(); }
|
||||||
|
|
||||||
|
@ -322,14 +313,25 @@ public:
|
||||||
void UndoRescues();
|
void UndoRescues();
|
||||||
|
|
||||||
static bool RescueProject( wxWindow* aParent, RESCUER& aRescuer, bool aRunningOnDemand );
|
static bool RescueProject( wxWindow* aParent, RESCUER& aRescuer, bool aRunningOnDemand );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
friend class DIALOG_RESCUE_EACH;
|
||||||
|
|
||||||
|
std::vector<SCH_COMPONENT*> m_components;
|
||||||
|
PROJECT* m_prj;
|
||||||
|
SCHEMATIC* m_schematic;
|
||||||
|
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galBackEndType;
|
||||||
|
SCH_SHEET_PATH* m_currentSheet;
|
||||||
|
|
||||||
|
boost::ptr_vector<RESCUE_CANDIDATE> m_all_candidates;
|
||||||
|
std::vector<RESCUE_CANDIDATE*> m_chosen_candidates;
|
||||||
|
|
||||||
|
std::vector<RESCUE_LOG> m_rescue_log;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LEGACY_RESCUER : public RESCUER
|
class LEGACY_RESCUER : public RESCUER
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
std::unique_ptr<PART_LIB> m_rescue_lib;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LEGACY_RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic, SCH_SHEET_PATH* aCurrentSheet,
|
LEGACY_RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic, SCH_SHEET_PATH* aCurrentSheet,
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType ) :
|
EDA_DRAW_PANEL_GAL::GAL_TYPE aGalBackEndType ) :
|
||||||
|
@ -350,16 +352,14 @@ public:
|
||||||
virtual bool WriteRescueLibrary( wxWindow *aParent ) override;
|
virtual bool WriteRescueLibrary( wxWindow *aParent ) override;
|
||||||
|
|
||||||
virtual void AddPart( LIB_PART* aNewPart ) override;
|
virtual void AddPart( LIB_PART* aNewPart ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<PART_LIB> m_rescue_lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class SYMBOL_LIB_TABLE_RESCUER : public RESCUER
|
class SYMBOL_LIB_TABLE_RESCUER : public RESCUER
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi;
|
|
||||||
|
|
||||||
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SYMBOL_LIB_TABLE_RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic,
|
SYMBOL_LIB_TABLE_RESCUER( PROJECT& aProject, SCHEMATIC* aSchematic,
|
||||||
SCH_SHEET_PATH* aCurrentSheet,
|
SCH_SHEET_PATH* aCurrentSheet,
|
||||||
|
@ -378,6 +378,11 @@ public:
|
||||||
virtual bool WriteRescueLibrary( wxWindow* aParent ) override;
|
virtual bool WriteRescueLibrary( wxWindow* aParent ) override;
|
||||||
|
|
||||||
virtual void AddPart( LIB_PART* aNewPart ) override;
|
virtual void AddPart( LIB_PART* aNewPart ) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi;
|
||||||
|
|
||||||
|
std::unique_ptr< PROPERTIES > m_properties; ///< Library plugin properties
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _LIB_CACHE_RESCUE_H_
|
#endif // _LIB_CACHE_RESCUE_H_
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2015-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -69,7 +69,7 @@ class SYMBOL_EDITOR_SETTINGS;
|
||||||
* @param aLibId is the symbol library identifier to load.
|
* @param aLibId is the symbol library identifier to load.
|
||||||
* @param aLibTable is the #SYMBOL_LIBRARY_TABLE to load the alias from.
|
* @param aLibTable is the #SYMBOL_LIBRARY_TABLE to load the alias from.
|
||||||
* @param aCacheLib is an optional cache library.
|
* @param aCacheLib is an optional cache library.
|
||||||
* @param aParent is an optiona parent window when displaying an error message.
|
* @param aParent is an optional parent window when displaying an error message.
|
||||||
* @param aShowErrorMessage set to true to show any error messages.
|
* @param aShowErrorMessage set to true to show any error messages.
|
||||||
*
|
*
|
||||||
* @return The symbol found in the library or NULL if the symbol was not found.
|
* @return The symbol found in the library or NULL if the symbol was not found.
|
||||||
|
@ -89,12 +89,6 @@ LIB_PART* SchGetLibPart( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable,
|
||||||
*/
|
*/
|
||||||
class SCH_BASE_FRAME : public EDA_DRAW_FRAME
|
class SCH_BASE_FRAME : public EDA_DRAW_FRAME
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
/// These are only used by symbol_editor. Eeschema should be using the one inside the SCHEMATIC.
|
|
||||||
SCHEMATIC_SETTINGS m_base_frame_defaults;
|
|
||||||
|
|
||||||
SCHEMATIC_SETTINGS* m_defaults;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
FRAME_T aWindowType,
|
FRAME_T aWindowType,
|
||||||
|
@ -147,8 +141,7 @@ public:
|
||||||
void UpdateStatusBar() override;
|
void UpdateStatusBar() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PickSymbolFromLibTree
|
* Call the library viewer to select component to import into schematic.
|
||||||
* Calls the library viewer to select component to import into schematic.
|
|
||||||
* if the library viewer is currently running, it is closed and reopened
|
* if the library viewer is currently running, it is closed and reopened
|
||||||
* in modal mode.
|
* in modal mode.
|
||||||
*
|
*
|
||||||
|
@ -156,17 +149,17 @@ public:
|
||||||
* fields (e.g. footprint selection) should be enabled. This should be false
|
* fields (e.g. footprint selection) should be enabled. This should be false
|
||||||
* when they would have no effect, for example loading a part into symbol_editor.
|
* when they would have no effect, for example loading a part into symbol_editor.
|
||||||
*
|
*
|
||||||
* @param aFilter is a SCHLIB_FILTER filter to pass the allowed library names
|
* @param aFilter is a #SCHLIB_FILTER filter to pass the allowed library names
|
||||||
* and/or the library name to load the component from and/or some other filter
|
* and/or the library name to load the component from and/or some other filter
|
||||||
* if NULL, no filtering.
|
* if NULL, no filtering.
|
||||||
* @param aHistoryList list of previously loaded components - will be edited
|
* @param aHistoryList is the list of previously loaded components - will be edited
|
||||||
* @param aUseLibBrowser bool to call the library viewer to select the component
|
* @param aUseLibBrowser is the flag to call the library viewer to select the component
|
||||||
* @param aUnit preselected unit
|
* @param aUnit is the preselected unit.
|
||||||
* @param aConvert preselected De Morgan shape
|
* @param aConvert is the preselected De Morgan shape.
|
||||||
* @param aHighlight name of component to highlight in the list.
|
* @param aHighlight is the name of component to highlight in the list.
|
||||||
* highlights none if there isn't one by that name
|
* highlights none if there isn't one by that name.
|
||||||
* @param aShowFootprints whether to show footprints in the dialog
|
* @param aShowFootprints is the whether to show footprints in the dialog.
|
||||||
* @param aAllowFields whether to allow field editing in the dialog
|
* @param aAllowFields is whether to allow field editing in the dialog.
|
||||||
*
|
*
|
||||||
* @return the selected component
|
* @return the selected component
|
||||||
*/
|
*/
|
||||||
|
@ -194,17 +187,17 @@ public:
|
||||||
LIB_PART* GetFlattenedLibPart( const LIB_ID& aLibId, bool aShowErrorMsg = false );
|
LIB_PART* GetFlattenedLibPart( const LIB_ID& aLibId, bool aShowErrorMsg = false );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PickSymbolFromLibBrowser
|
* Call the library viewer to select component to import into schematic.
|
||||||
* Calls the library viewer to select component to import into schematic.
|
|
||||||
* if the library viewer is currently running, it is closed and reopened
|
* if the library viewer is currently running, it is closed and reopened
|
||||||
* in modal mode.
|
* in modal mode.
|
||||||
* @param aParent is the caller
|
*
|
||||||
|
* @param aParent is the caller.
|
||||||
* @param aFilter is a filter to pass the allowed library names
|
* @param aFilter is a filter to pass the allowed library names
|
||||||
* and/or some other filter
|
* and/or some other filter.
|
||||||
* @param aPreselectedLibId Preselected component LIB_ID. Not valid if none selected.
|
* @param aPreselectedLibId is the preselected component #LIB_ID. Not valid if none selected.
|
||||||
* @param aUnit preselected unit
|
* @param aUnit is the preselected unit.
|
||||||
* @param aConvert preselected deMorgan conversion
|
* @param aConvert is the preselected deMorgan conversion.
|
||||||
* @return the selected component
|
* @return the selected component.
|
||||||
*/
|
*/
|
||||||
PICKED_SYMBOL PickSymbolFromLibBrowser( wxTopLevelWindow* aParent,
|
PICKED_SYMBOL PickSymbolFromLibBrowser( wxTopLevelWindow* aParent,
|
||||||
const SCHLIB_FILTER* aFilter,
|
const SCHLIB_FILTER* aFilter,
|
||||||
|
@ -261,7 +254,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Saves Symbol Library Tables to disk.
|
* Save Symbol Library Tables to disk.
|
||||||
*
|
*
|
||||||
* @param aGlobal when true, the Global Table is saved.
|
* @param aGlobal when true, the Global Table is saved.
|
||||||
* @param aProject when true, the Project Table is saved.
|
* @param aProject when true, the Project Table is saved.
|
||||||
|
@ -269,6 +262,12 @@ protected:
|
||||||
*/
|
*/
|
||||||
bool saveSymbolLibTables( bool aGlobal, bool aProject );
|
bool saveSymbolLibTables( bool aGlobal, bool aProject );
|
||||||
|
|
||||||
|
/// These are only used by symbol_editor. Eeschema should be using the one inside
|
||||||
|
/// the SCHEMATIC.
|
||||||
|
SCHEMATIC_SETTINGS m_base_frame_defaults;
|
||||||
|
|
||||||
|
SCHEMATIC_SETTINGS* m_defaults;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCH_BASE_FRAME_H_
|
#endif // SCH_BASE_FRAME_H_
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 jean-pierre.charras
|
* Copyright (C) 2011 jean-pierre.charras
|
||||||
* Copyright (C) 2011-2019 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2011-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file sch_bitmap.h
|
* @file sch_bitmap.h
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SCH_BITMAP_H_
|
#ifndef _SCH_BITMAP_H_
|
||||||
|
@ -38,12 +37,8 @@
|
||||||
/**
|
/**
|
||||||
* Object to handle a bitmap image that can be inserted in a schematic.
|
* Object to handle a bitmap image that can be inserted in a schematic.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SCH_BITMAP : public SCH_ITEM
|
class SCH_BITMAP : public SCH_ITEM
|
||||||
{
|
{
|
||||||
wxPoint m_pos; // XY coordinates of center of the bitmap
|
|
||||||
BITMAP_BASE* m_image; // the BITMAP_BASE item
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_BITMAP( const wxPoint& pos = wxPoint( 0, 0 ) );
|
SCH_BITMAP( const wxPoint& pos = wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
|
@ -63,7 +58,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the image "zoom" value
|
* @return the image "zoom" value.
|
||||||
* scale = 1.0 = original size of bitmap.
|
* scale = 1.0 = original size of bitmap.
|
||||||
* scale < 1.0 = the bitmap is drawn smaller than its original size.
|
* scale < 1.0 = the bitmap is drawn smaller than its original size.
|
||||||
* scale > 1.0 = the bitmap is drawn bigger than its original size.
|
* scale > 1.0 = the bitmap is drawn bigger than its original size.
|
||||||
|
@ -89,7 +84,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the actual size (in user units, not in pixels) of the image
|
* @return the actual size (in user units, not in pixels) of the image.
|
||||||
*/
|
*/
|
||||||
wxSize GetSize() const;
|
wxSize GetSize() const;
|
||||||
|
|
||||||
|
@ -103,11 +98,12 @@ public:
|
||||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads and stores an image file. Init the bitmap used to draw this item
|
* Read and store an image file.
|
||||||
* format.
|
|
||||||
*
|
*
|
||||||
* @param aFullFilename The full filename of the image file to read.
|
* Initialize the bitmap used to draw this item format.
|
||||||
* @return bool - true if success reading else false.
|
*
|
||||||
|
* @param aFullFilename is the full filename of the image file to read.
|
||||||
|
* @return true if success reading else false.
|
||||||
*/
|
*/
|
||||||
bool ReadImageFile( const wxString& aFullFilename );
|
bool ReadImageFile( const wxString& aFullFilename );
|
||||||
|
|
||||||
|
@ -117,10 +113,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Virtual function IsMovableFromAnchorPoint
|
* Return true for items which are moved with the anchor point at mouse cursor and false
|
||||||
* Return true for items which are moved with the anchor point at mouse cursor
|
* for items moved with no reference to anchor.
|
||||||
* and false for items moved with no reference to anchor
|
*
|
||||||
* @return false for a bus entry
|
* @return false for a bus entry.
|
||||||
*/
|
*/
|
||||||
bool IsMovableFromAnchorPoint() const override { return false; }
|
bool IsMovableFromAnchorPoint() const override { return false; }
|
||||||
|
|
||||||
|
@ -150,6 +146,10 @@ public:
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
void Show( int nestLevel, std::ostream& os ) const override;
|
void Show( int nestLevel, std::ostream& os ) const override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxPoint m_pos; // XY coordinates of center of the bitmap
|
||||||
|
BITMAP_BASE* m_image; // the BITMAP_BASE item
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -116,43 +116,6 @@ enum SCH_CLEANUP_FLAGS {
|
||||||
*/
|
*/
|
||||||
class SCH_EDIT_FRAME : public SCH_BASE_FRAME
|
class SCH_EDIT_FRAME : public SCH_BASE_FRAME
|
||||||
{
|
{
|
||||||
// The schematic editor control class should be able to access some internal
|
|
||||||
// functions of the editor frame.
|
|
||||||
friend class SCH_EDITOR_CONTROL;
|
|
||||||
|
|
||||||
private:
|
|
||||||
SCHEMATIC* m_schematic; ///< The currently loaded schematic
|
|
||||||
const SCH_CONNECTION* m_highlightedConn; ///< The highlighted net or bus, or nullptr
|
|
||||||
|
|
||||||
wxPageSetupDialogData m_pageSetupData;
|
|
||||||
SCH_ITEM* m_item_to_repeat; ///< Last item to insert by the repeat command.
|
|
||||||
wxString m_netListerCommand; ///< Command line to call a custom net list
|
|
||||||
///< generator.
|
|
||||||
int m_exec_flags; ///< Flags of the wxExecute() function
|
|
||||||
///< to call a custom net list generator.
|
|
||||||
|
|
||||||
DIALOG_SCH_FIND* m_findReplaceDialog;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Save the schematic files that have been modified and not yet saved.
|
|
||||||
*
|
|
||||||
* @return true if the auto save was successful otherwise false.
|
|
||||||
*/
|
|
||||||
bool doAutoSave() override;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the schematic has been modified.
|
|
||||||
*/
|
|
||||||
bool isAutoSaveRequired() const override;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Send the kicad netlist over to CVPCB.
|
|
||||||
*/
|
|
||||||
void sendNetlistToCvpcb();
|
|
||||||
|
|
||||||
void onSize( wxSizeEvent& aEvent );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent );
|
||||||
~SCH_EDIT_FRAME() override;
|
~SCH_EDIT_FRAME() override;
|
||||||
|
@ -174,7 +137,7 @@ public:
|
||||||
void SaveProjectSettings() override;
|
void SaveProjectSettings() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the KiCad project file (*.pro) settings specific to Eeschema.
|
* Load the KiCad project file (*.pro) settings specific to Eeschema.
|
||||||
*
|
*
|
||||||
* @return True if the project file was loaded correctly.
|
* @return True if the project file was loaded correctly.
|
||||||
*/
|
*/
|
||||||
|
@ -237,7 +200,7 @@ public:
|
||||||
* \li \c \$CLEAR: \c "HIGHLIGHTED" Clear components highlight
|
* \li \c \$CLEAR: \c "HIGHLIGHTED" Clear components highlight
|
||||||
* <p>
|
* <p>
|
||||||
* They are a keyword followed by a quoted string.
|
* They are a keyword followed by a quoted string.
|
||||||
* @param cmdline = received command from Pcbnew
|
* @param cmdline is the command received from Pcbnew.
|
||||||
*/
|
*/
|
||||||
void ExecuteRemoteCommand( const char* cmdline ) override;
|
void ExecuteRemoteCommand( const char* cmdline ) override;
|
||||||
|
|
||||||
|
@ -280,36 +243,36 @@ public:
|
||||||
void OnFindDialogClose();
|
void OnFindDialogClose();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Breaks a single segment into two at the specified point.
|
* Break a single segment into two at the specified point.
|
||||||
*
|
*
|
||||||
* NOTE: always appends to the existing undo state.
|
* @note This always appends to the existing undo state.
|
||||||
*
|
*
|
||||||
* @param aSegment Line segment to break
|
* @param aSegment Line segment to break
|
||||||
* @param aPoint Point at which to break the segment
|
* @param aPoint Point at which to break the segment
|
||||||
* @param aNewSegment Pointer to the newly created segment (if given and created)
|
* @param aNewSegment Pointer to the newly created segment (if given and created)
|
||||||
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen.
|
||||||
* @return True if any wires or buses were broken.
|
* @return True if any wires or buses were broken.
|
||||||
*/
|
*/
|
||||||
bool BreakSegment( SCH_LINE* aSegment, const wxPoint& aPoint,
|
bool BreakSegment( SCH_LINE* aSegment, const wxPoint& aPoint,
|
||||||
SCH_LINE** aNewSegment = NULL, SCH_SCREEN* aScreen = nullptr );
|
SCH_LINE** aNewSegment = nullptr, SCH_SCREEN* aScreen = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks every wire and bus for a intersection at \a aPoint and break into two segments
|
* Check every wire and bus for a intersection at \a aPoint and break into two segments
|
||||||
* at \a aPoint if an intersection is found.
|
* at \a aPoint if an intersection is found.
|
||||||
*
|
*
|
||||||
* NOTE: always appends to the existing undo state.
|
* @note This always appends to the existing undo state.
|
||||||
*
|
*
|
||||||
* @param aPoint Test this point for an intersection.
|
* @param aPoint Test this point for an intersection.
|
||||||
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen.
|
||||||
* @return True if any wires or buses were broken.
|
* @return True if any wires or buses were broken.
|
||||||
*/
|
*/
|
||||||
bool BreakSegments( const wxPoint& aPoint, SCH_SCREEN* aScreen = nullptr );
|
bool BreakSegments( const wxPoint& aPoint, SCH_SCREEN* aScreen = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests all junctions and bus entries in the schematic for intersections with wires and
|
* Test all junctions and bus entries in the schematic for intersections with wires and
|
||||||
* buses and breaks any intersections into multiple segments.
|
* buses and breaks any intersections into multiple segments.
|
||||||
*
|
*
|
||||||
* NOTE: always appends to the existing undo state.
|
* @note This always appends to the existing undo state.
|
||||||
*
|
*
|
||||||
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
||||||
* @return True if any wires or buses were broken.
|
* @return True if any wires or buses were broken.
|
||||||
|
@ -330,27 +293,27 @@ public:
|
||||||
* - $PIN: number $PART: reference put cursor on the footprint pad
|
* - $PIN: number $PART: reference put cursor on the footprint pad
|
||||||
* - $SHEET: time_stamp select all footprints of components is the schematic sheet path
|
* - $SHEET: time_stamp select all footprints of components is the schematic sheet path
|
||||||
*
|
*
|
||||||
* @param aObjectToSync = item to be located on board
|
* @param aObjectToSync is the item to be located on board.
|
||||||
* (footprint, pad, text or schematic sheet)
|
* @param aPart is the symbol if \a aObjectToSync is a sub item of a symbol (like a pin).
|
||||||
* @param aPart = component if objectToSync is a sub item of a symbol (like a pin)
|
|
||||||
*/
|
*/
|
||||||
void SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT* aPart );
|
void SendMessageToPCBNEW( EDA_ITEM* aObjectToSync, SCH_COMPONENT* aPart );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a net name to pcbnew for highlighting
|
* Sends a net name to Pcbnew for highlighting
|
||||||
*
|
*
|
||||||
* @param aNetName is the name of a net, or empty string to clear highlight
|
* @param aNetName is the name of a net, or empty string to clear highlight
|
||||||
*/
|
*/
|
||||||
void SendCrossProbeNetName( const wxString& aNetName );
|
void SendCrossProbeNetName( const wxString& aNetName );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a connection (net or bus) to pcbnew for highlighting
|
* Send a connection (net or bus) to Pcbnew for highlighting.
|
||||||
|
*
|
||||||
* @param aConnection is the connection to highlight
|
* @param aConnection is the connection to highlight
|
||||||
*/
|
*/
|
||||||
void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
|
void SetCrossProbeConnection( const SCH_CONNECTION* aConnection );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells PcbNew to clear the existing highlighted net, if one exists
|
* Tell Pcbnew to clear the existing highlighted net, if one exists
|
||||||
*/
|
*/
|
||||||
void SendCrossProbeClearHighlight();
|
void SendCrossProbeClearHighlight();
|
||||||
|
|
||||||
|
@ -365,35 +328,32 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if we are ready to write a netlist file for the current schematic
|
* Check if we are ready to write a netlist file for the current schematic.
|
||||||
*
|
*
|
||||||
* - Test for some issues (missing or duplicate references and sheet names)
|
* Test for some issues (missing or duplicate references and sheet names).
|
||||||
*
|
*
|
||||||
* @param aAnnotateMessage a message to put up in case annotation needs to be performed
|
* @param aAnnotateMessage a message to put up in case annotation needs to be performed.
|
||||||
* @returns true if all is well (i.e. you can call WriteNetListFile next)
|
* @return true if all is well (i.e. you can call WriteNetListFile next).
|
||||||
*/
|
*/
|
||||||
bool ReadyToNetlist( const wxString& aAnnotateMessage );
|
bool ReadyToNetlist( const wxString& aAnnotateMessage );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a netlist file.
|
* Create a netlist file.
|
||||||
*
|
*
|
||||||
* @param aFormat = netlist format (NET_TYPE_PCBNEW ...)
|
* @param aFormat is the netlist format (NET_TYPE_PCBNEW ...).
|
||||||
* @param aFullFileName = full netlist file name
|
* @param aFullFileName is the full netlist file name.
|
||||||
* @param aNetlistOptions = netlist options using OR'ed bits.
|
* @param aNetlistOptions is the netlist options using OR'ed bits.
|
||||||
* <p>
|
* <p>
|
||||||
* For SPICE netlist only:
|
* For SPICE netlist only:
|
||||||
* if NET_USE_NETNAMES is set, use net names from labels in schematic
|
* if NET_USE_NETNAMES is set, use net names from labels in schematic
|
||||||
* else use net numbers (net codes)
|
* else use net numbers (net codes)
|
||||||
* if NET_USE_X_PREFIX is set : change "U" and "IC" reference prefix to "X"
|
* if NET_USE_X_PREFIX is set : change "U" and "IC" reference prefix to "X"
|
||||||
* </p>
|
* </p>
|
||||||
* @param aReporter = a REPORTER to report error messages,
|
* @param aReporter is a #REPORTER to report error messages, can be a nullptr.
|
||||||
* mainly if a command line must be run (can be NULL
|
|
||||||
* @return true if success.
|
* @return true if success.
|
||||||
*/
|
*/
|
||||||
bool WriteNetListFile( int aFormat,
|
bool WriteNetListFile( int aFormat, const wxString& aFullFileName, unsigned aNetlistOptions,
|
||||||
const wxString& aFullFileName,
|
REPORTER* aReporter = nullptr );
|
||||||
unsigned aNetlistOptions,
|
|
||||||
REPORTER* aReporter = NULL );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the current component annotation.
|
* Clear the current component annotation.
|
||||||
|
@ -453,7 +413,8 @@ public:
|
||||||
int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler, bool aOneSheetOnly = false );
|
int CheckAnnotate( ANNOTATION_ERROR_HANDLER aErrorHandler, bool aOneSheetOnly = false );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run a modal version of the Annotate dialog for a specific purpose.
|
* Run a modal version of the annotate dialog for a specific purpose.
|
||||||
|
*
|
||||||
* @param aMessage A user message indicating the purpose.
|
* @param aMessage A user message indicating the purpose.
|
||||||
* @return the result of ShowModal()
|
* @return the result of ShowModal()
|
||||||
*/
|
*/
|
||||||
|
@ -481,6 +442,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when modifying the page settings.
|
* Called when modifying the page settings.
|
||||||
|
*
|
||||||
* In derived classes it can be used to modify parameters like draw area size, and any other
|
* In derived classes it can be used to modify parameters like draw area size, and any other
|
||||||
* local parameter related to the page settings.
|
* local parameter related to the page settings.
|
||||||
*/
|
*/
|
||||||
|
@ -525,18 +487,17 @@ public:
|
||||||
/**
|
/**
|
||||||
* Save \a aSheet to a schematic file.
|
* Save \a aSheet to a schematic file.
|
||||||
*
|
*
|
||||||
* @param aSheet A pointer to the #SCH_SHEET object to save. A NULL pointer saves the
|
* @param aSheet is the #SCH_SHEET object to save. A NULL pointer saves the
|
||||||
* current screen only.
|
* current screen only.
|
||||||
* @param aSaveUnderNewName Controls how the file is to be saved;: using previous name
|
* @param aSaveUnderNewName Controls how the file is to be saved;: using previous name
|
||||||
* or under a new name.
|
* or under a new name.
|
||||||
* @return True if the file has been saved.
|
* @return True if the file has been saved.
|
||||||
*/
|
*/
|
||||||
bool SaveEEFile( SCH_SHEET* aSheet,
|
bool SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName = false );
|
||||||
bool aSaveUnderNewName = false );
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if any of the screens has unsaved changes and asks the user whether to save or
|
* Check if any of the screens has unsaved changes and asks the user whether to save or
|
||||||
* drop them.
|
* drop them.
|
||||||
*
|
*
|
||||||
* @return True if user decided to save or drop changes, false if the operation should be
|
* @return True if user decided to save or drop changes, false if the operation should be
|
||||||
|
@ -548,10 +509,10 @@ public:
|
||||||
bool aFinal = true );
|
bool aFinal = true );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs routine schematic cleaning including breaking wire and buses and deleting
|
* Perform routine schematic cleaning including breaking wire and buses and deleting
|
||||||
* identical objects superimposed on top of each other.
|
* identical objects superimposed on top of each other.
|
||||||
*
|
*
|
||||||
* NOTE: always appends to the existing undo state.
|
* @note This always appends to the existing undo state.
|
||||||
*
|
*
|
||||||
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
* @param aScreen is the screen to examine, or nullptr to examine the current screen
|
||||||
* @return True if any schematic clean up was performed.
|
* @return True if any schematic clean up was performed.
|
||||||
|
@ -562,7 +523,7 @@ public:
|
||||||
* If any single wire passes through _both points_, remove the portion between the two points,
|
* If any single wire passes through _both points_, remove the portion between the two points,
|
||||||
* potentially splitting the wire into two.
|
* potentially splitting the wire into two.
|
||||||
*
|
*
|
||||||
* NOTE: always appends to the existing undo state.
|
* @note This always appends to the existing undo state.
|
||||||
*
|
*
|
||||||
* @param aStart The starting point for trimmming
|
* @param aStart The starting point for trimmming
|
||||||
* @param aEnd The ending point for trimming
|
* @param aEnd The ending point for trimming
|
||||||
|
@ -571,7 +532,7 @@ public:
|
||||||
bool TrimWire( const wxPoint& aStart, const wxPoint& aEnd );
|
bool TrimWire( const wxPoint& aStart, const wxPoint& aEnd );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects a unique list of all possible connection points in the schematic.
|
* Collect a unique list of all possible connection points in the schematic.
|
||||||
*
|
*
|
||||||
* @return vector of connections
|
* @return vector of connections
|
||||||
*/
|
*/
|
||||||
|
@ -582,68 +543,13 @@ public:
|
||||||
void OnUpdatePCB( wxCommandEvent& event );
|
void OnUpdatePCB( wxCommandEvent& event );
|
||||||
void OnAnnotate( wxCommandEvent& event );
|
void OnAnnotate( wxCommandEvent& event );
|
||||||
|
|
||||||
private:
|
|
||||||
// Sets up the tool framework
|
|
||||||
void setupTools();
|
|
||||||
|
|
||||||
void OnExit( wxCommandEvent& event );
|
|
||||||
|
|
||||||
void OnLoadFile( wxCommandEvent& event );
|
|
||||||
void OnAppendProject( wxCommandEvent& event );
|
|
||||||
void OnImportProject( wxCommandEvent& event );
|
|
||||||
|
|
||||||
void OnClearFileHistory( wxCommandEvent& aEvent );
|
|
||||||
|
|
||||||
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
|
||||||
void doCloseWindow() override;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the main window title bar text.
|
|
||||||
*
|
|
||||||
* If file name defined by SCH_SCREEN::m_FileName is not set, the title is set to the
|
|
||||||
* application name appended with no file.
|
|
||||||
* Otherwise, the title is set to the hierarchical sheet path and the full file name, and
|
|
||||||
* read only is appended to the title if the user does not have write access to the file.
|
|
||||||
*/
|
|
||||||
void UpdateTitle();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
|
|
||||||
*/
|
|
||||||
void initScreenZoom();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Verify that the symbol library links \a aSheet and all of it's child sheets have
|
|
||||||
* been remapped to the symbol library table.
|
|
||||||
*
|
|
||||||
* @param aSheet is the #SCH_SHEET object to test.
|
|
||||||
*
|
|
||||||
* @return true if \a aSheet and it's child sheets have not been remapped.
|
|
||||||
*/
|
|
||||||
bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load the given filename but sets the path to the current project path.
|
|
||||||
*
|
|
||||||
* @param full filepath of file to be imported.
|
|
||||||
* @param aFileType SCH_FILE_T value for file type
|
|
||||||
*/
|
|
||||||
bool importFile( const wxString& aFileName, int aFileType );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fills a map of uuid -> reference from the currently loaded schematic
|
|
||||||
* @param aMap is a map to fill
|
|
||||||
*/
|
|
||||||
void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
/**
|
||||||
* Verify that \a aSheet will not cause a recursion error in \a aHierarchy.
|
* Verify that \a aSheet will not cause a recursion error in \a aHierarchy.
|
||||||
*
|
*
|
||||||
* @param aSheet is the #SCH_SHEET object to test.
|
* @param aSheet is the #SCH_SHEET object to test.
|
||||||
* @param aHierarchy is the #SCH_SHEET_PATH where \a aSheet is going to reside.
|
* @param aHierarchy is the #SCH_SHEET_PATH where \a aSheet is going to reside.
|
||||||
*
|
*
|
||||||
* @return true if \a aSheet will cause a resursion error in \a aHierarchy.
|
* @return true if \a aSheet will cause a recursion error in \a aHierarchy.
|
||||||
*/
|
*/
|
||||||
bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
bool CheckSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
||||||
|
|
||||||
|
@ -656,7 +562,7 @@ public:
|
||||||
* this would result in a broken schematic.
|
* this would result in a broken schematic.
|
||||||
*
|
*
|
||||||
* @param aSchematicFileName is the absolute path and file name of the file to test.
|
* @param aSchematicFileName is the absolute path and file name of the file to test.
|
||||||
* @return true if the user accepts the potential file name clase risk.
|
* @return true if the user accepts the potential file name clash risk.
|
||||||
*/
|
*/
|
||||||
bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
|
bool AllowCaseSensitiveFileNameClashes( const wxString& aSchematicFileName );
|
||||||
|
|
||||||
|
@ -685,7 +591,7 @@ public:
|
||||||
* @param aHierarchy is the current hierarchy containing aSheet
|
* @param aHierarchy is the current hierarchy containing aSheet
|
||||||
* @param aClearAnnotationNewItems is a reference to a bool to know if the items managed by
|
* @param aClearAnnotationNewItems is a reference to a bool to know if the items managed by
|
||||||
* this sheet need to have their annotation cleared i.e. when an existing item list is used.
|
* this sheet need to have their annotation cleared i.e. when an existing item list is used.
|
||||||
* it can happens when the edited sheet used an existying file, or becomes a new instance
|
* it can happens when the edited sheet used an existing file, or becomes a new instance
|
||||||
* of a already existing sheet.
|
* of a already existing sheet.
|
||||||
*/
|
*/
|
||||||
bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
bool EditSheetProperties( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||||
|
@ -770,24 +676,21 @@ public:
|
||||||
* If it is a delete command, items are put on list with the .Flags member
|
* If it is a delete command, items are put on list with the .Flags member
|
||||||
* set to DELETED.
|
* set to DELETED.
|
||||||
*
|
*
|
||||||
* @param aItemToCopy = the schematic item modified by the command to undo
|
* @param aItemToCopy is the schematic item modified by the command to undo.
|
||||||
* @param aTypeCommand = command type (see enum UNDO_REDO)
|
* @param aTypeCommand is the command type (see enum UNDO_REDO).
|
||||||
* @param aAppend = add the item to the previous undo list
|
* @param aAppend set to true to add the item to the previous undo list.
|
||||||
*/
|
*/
|
||||||
void SaveCopyInUndoList( SCH_SCREEN* aScreen,
|
void SaveCopyInUndoList( SCH_SCREEN* aScreen, SCH_ITEM* aItemToCopy, UNDO_REDO aTypeCommand,
|
||||||
SCH_ITEM* aItemToCopy,
|
|
||||||
UNDO_REDO aTypeCommand,
|
|
||||||
bool aAppend );
|
bool aAppend );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new entry in undo list of commands.
|
* Create a new entry in undo list of commands.
|
||||||
*
|
*
|
||||||
* @param aItemsList = the list of items modified by the command to undo
|
* @param aItemsList is the the list of items modified by the command to undo/
|
||||||
* @param aTypeCommand = command type (see enum UNDO_REDO)
|
* @param aTypeCommand is the command type (see enum UNDO_REDO).
|
||||||
* @param aAppend = add the item to the previous undo list
|
* @param aAppend set to true to add the item to the previous undo list.
|
||||||
*/
|
*/
|
||||||
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
|
||||||
UNDO_REDO aTypeCommand,
|
|
||||||
bool aAppend );
|
bool aAppend );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -804,10 +707,9 @@ public:
|
||||||
* - data pointed by wrappers are deleted if not in use in schematic
|
* - data pointed by wrappers are deleted if not in use in schematic
|
||||||
* i.e. when they are copy of a schematic item or they are no more in use (DELETED)
|
* i.e. when they are copy of a schematic item or they are no more in use (DELETED)
|
||||||
*
|
*
|
||||||
* @param whichList = the UNDO_REDO_CONTAINER to clear
|
* @param whichList is the UNDO_REDO_CONTAINER to clear
|
||||||
* @param aItemCount = the count of items to remove. < 0 for all items
|
* @param aItemCount is the count of items to remove. Use < 0 to remove all items from
|
||||||
* items are removed from the beginning of the list.
|
* the beginning of the list.
|
||||||
* So this function can be called to remove old commands
|
|
||||||
*/
|
*/
|
||||||
void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
|
void ClearUndoORRedoList( UNDO_REDO_LIST whichList, int aItemCount = -1 ) override;
|
||||||
|
|
||||||
|
@ -826,7 +728,7 @@ public:
|
||||||
EDA_ITEM* GetItem( const KIID& aId ) const override;
|
EDA_ITEM* GetItem( const KIID& aId ) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs an undo of the last edit WITHOUT logging a corresponding redo. Used to cancel
|
* Perform an undo of the last edit WITHOUT logging a corresponding redo. Used to cancel
|
||||||
* an in-progress operation.
|
* an in-progress operation.
|
||||||
*/
|
*/
|
||||||
void RollbackSchematicFromUndo();
|
void RollbackSchematicFromUndo();
|
||||||
|
@ -836,8 +738,8 @@ public:
|
||||||
*
|
*
|
||||||
* This file will contain all components used in the current schematic.
|
* This file will contain all components used in the current schematic.
|
||||||
*
|
*
|
||||||
* @param aUseCurrentSheetFilename = false to use the root sheet filename
|
* @param aUseCurrentSheetFilename set to false to use the root sheet filename
|
||||||
* (default) or true to use the currently opened sheet.
|
* (default) or true to use the currently opened sheet.
|
||||||
* @return true if the file was written successfully.
|
* @return true if the file was written successfully.
|
||||||
*/
|
*/
|
||||||
bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
|
bool CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilename = false );
|
||||||
|
@ -852,8 +754,6 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plot or print the current sheet to the clipboard.
|
* Plot or print the current sheet to the clipboard.
|
||||||
*
|
|
||||||
* @param aDC = wxDC given by the calling print function
|
|
||||||
*/
|
*/
|
||||||
virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
|
virtual void PrintPage( const RENDER_SETTINGS* aSettings ) override;
|
||||||
|
|
||||||
|
@ -867,7 +767,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Set (adds) specified flags for next execution of external generator of the netlist or bom.
|
* Set (adds) specified flags for next execution of external generator of the netlist or bom.
|
||||||
*
|
*
|
||||||
* @param aFlags = wxEXEC_* flags, see wxExecute docs.
|
* @param aFlags is the wxEXEC_* flags, see wxExecute documentation.
|
||||||
*/
|
*/
|
||||||
void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
|
void SetExecFlags( const int aFlags ) { m_exec_flags |= aFlags; }
|
||||||
|
|
||||||
|
@ -875,19 +775,19 @@ public:
|
||||||
* Clear (removes) specified flags that not needed for next execution of external generator
|
* Clear (removes) specified flags that not needed for next execution of external generator
|
||||||
* of the netlist or bom.
|
* of the netlist or bom.
|
||||||
*
|
*
|
||||||
* @param aFlags = wxEXEC_* flags, see wxExecute docs.
|
* @param aFlags is the wxEXEC_* flags, see wxExecute documentation.
|
||||||
*/
|
*/
|
||||||
void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
|
void ClearExecFlags( const int aFlags ) { m_exec_flags &= ~( aFlags ); }
|
||||||
|
|
||||||
wxString GetNetListerCommand() const { return m_netListerCommand; }
|
wxString GetNetListerCommand() const { return m_netListerCommand; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the connection data for the entire schematic hierarchy.
|
* Generate the connection data for the entire schematic hierarchy.
|
||||||
*/
|
*/
|
||||||
void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
|
void RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows Eeschema to install its preferences panels into the preferences dialog.
|
* Allow Eeschema to install its preferences panels into the preferences dialog.
|
||||||
*/
|
*/
|
||||||
void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
|
void InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) override;
|
||||||
|
|
||||||
|
@ -920,13 +820,104 @@ public:
|
||||||
/**
|
/**
|
||||||
* Update the schematic's page reference map for all global labels, and refresh the labels
|
* Update the schematic's page reference map for all global labels, and refresh the labels
|
||||||
* so that they are redrawn with up-to-date references.
|
* so that they are redrawn with up-to-date references.
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
void RecomputeIntersheetRefs();
|
void RecomputeIntersheetRefs();
|
||||||
|
|
||||||
void ShowAllIntersheetRefs( bool aShow );
|
void ShowAllIntersheetRefs( bool aShow );
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* Save the schematic files that have been modified and not yet saved.
|
||||||
|
*
|
||||||
|
* @return true if the auto save was successful otherwise false.
|
||||||
|
*/
|
||||||
|
bool doAutoSave() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the schematic has been modified.
|
||||||
|
*/
|
||||||
|
bool isAutoSaveRequired() const override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send the KiCad netlist over to CVPCB.
|
||||||
|
*/
|
||||||
|
void sendNetlistToCvpcb();
|
||||||
|
|
||||||
|
void onSize( wxSizeEvent& aEvent );
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Sets up the tool framework
|
||||||
|
void setupTools();
|
||||||
|
|
||||||
|
void OnExit( wxCommandEvent& event );
|
||||||
|
|
||||||
|
void OnLoadFile( wxCommandEvent& event );
|
||||||
|
void OnAppendProject( wxCommandEvent& event );
|
||||||
|
void OnImportProject( wxCommandEvent& event );
|
||||||
|
|
||||||
|
void OnClearFileHistory( wxCommandEvent& aEvent );
|
||||||
|
|
||||||
|
bool canCloseWindow( wxCloseEvent& aCloseEvent ) override;
|
||||||
|
void doCloseWindow() override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the main window title bar text.
|
||||||
|
*
|
||||||
|
* If file name defined by SCH_SCREEN::m_FileName is not set, the title is set to the
|
||||||
|
* application name appended with no file.
|
||||||
|
* Otherwise, the title is set to the hierarchical sheet path and the full file name, and
|
||||||
|
* read only is appended to the title if the user does not have write access to the file.
|
||||||
|
*/
|
||||||
|
void UpdateTitle();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the zoom value of the current screen and mark the screen as zoom-initialized.
|
||||||
|
*/
|
||||||
|
void initScreenZoom();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify that the symbol library links \a aSheet and all of it's child sheets have
|
||||||
|
* been remapped to the symbol library table.
|
||||||
|
*
|
||||||
|
* @param aSheet is the #SCH_SHEET object to test.
|
||||||
|
*
|
||||||
|
* @return true if \a aSheet and it's child sheets have not been remapped.
|
||||||
|
*/
|
||||||
|
bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the given filename but sets the path to the current project path.
|
||||||
|
*
|
||||||
|
* @param full filepath of file to be imported.
|
||||||
|
* @param aFileType SCH_FILE_T value for file type
|
||||||
|
*/
|
||||||
|
bool importFile( const wxString& aFileName, int aFileType );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill a map of uuid -> reference from the currently loaded schematic.
|
||||||
|
*
|
||||||
|
* @param aMap is a map to fill
|
||||||
|
*/
|
||||||
|
void mapExistingAnnotation( std::map<wxString, wxString>& aMap );
|
||||||
|
|
||||||
|
private:
|
||||||
|
// The schematic editor control class should be able to access some internal
|
||||||
|
// functions of the editor frame.
|
||||||
|
friend class SCH_EDITOR_CONTROL;
|
||||||
|
|
||||||
|
SCHEMATIC* m_schematic; ///< The currently loaded schematic
|
||||||
|
const SCH_CONNECTION* m_highlightedConn; ///< The highlighted net or bus, or nullptr
|
||||||
|
|
||||||
|
wxPageSetupDialogData m_pageSetupData;
|
||||||
|
SCH_ITEM* m_item_to_repeat; ///< Last item to insert by the repeat command.
|
||||||
|
wxString m_netListerCommand; ///< Command line to call a custom net list
|
||||||
|
///< generator.
|
||||||
|
int m_exec_flags; ///< Flags of the wxExecute() function
|
||||||
|
///< to call a custom net list generator.
|
||||||
|
|
||||||
|
DIALOG_SCH_FIND* m_findReplaceDialog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2004-2019 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -37,24 +37,18 @@ class LIB_FIELD;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCH_FIELD
|
* Instances are attached to a symbol or sheet and provide a place for the component's value,
|
||||||
* instances are attached to a symbol or sheet and provide a place for the component's value,
|
|
||||||
* reference designator, footprint, , a sheet's name, filename, and user definable name-value
|
* reference designator, footprint, , a sheet's name, filename, and user definable name-value
|
||||||
* pairs of arbitrary purpose.
|
* pairs of arbitrary purpose.
|
||||||
*
|
*
|
||||||
* <ul> <li>Field 0 is reserved for the symbol reference.</li>
|
* - Field 0 is reserved for the symbol reference.
|
||||||
* <li>Field 1 is reserved for the symbol value.</li>
|
* - Field 1 is reserved for the symbol value.
|
||||||
* <li>Field 2 is reserved for the symbol footprint.</li>
|
* - Field 2 is reserved for the symbol footprint.
|
||||||
* <li>Field 3 is reserved for the symbol data sheet file.</li>
|
* - Field 3 is reserved for the symbol data sheet file.
|
||||||
* <li>Field 4 and higher are user defineable.</li></ul>
|
* - Field 4 and higher are user definable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SCH_FIELD : public SCH_ITEM, public EDA_TEXT
|
class SCH_FIELD : public SCH_ITEM, public EDA_TEXT
|
||||||
{
|
{
|
||||||
int m_id; ///< Field index, @see enum MANDATORY_FIELD_T
|
|
||||||
|
|
||||||
wxString m_name;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_ITEM* aParent,
|
SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_ITEM* aParent,
|
||||||
const wxString& aName = wxEmptyString );
|
const wxString& aName = wxEmptyString );
|
||||||
|
@ -101,12 +95,11 @@ public:
|
||||||
void DoHypertextMenu( EDA_DRAW_FRAME* aFrame ) override;
|
void DoHypertextMenu( EDA_DRAW_FRAME* aFrame ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetName
|
* Return the field name.
|
||||||
* returns the field name.
|
|
||||||
*
|
*
|
||||||
* @param aUseDefaultName When true return the default field name if the field name is
|
* @param aUseDefaultName When true return the default field name if the field name is
|
||||||
* empty. Otherwise the default field name is returned.
|
* empty. Otherwise the default field name is returned.
|
||||||
* @return A wxString object containing the name of the field.
|
* @return the name of the field.
|
||||||
*/
|
*/
|
||||||
wxString GetName( bool aUseDefaultName = true ) const;
|
wxString GetName( bool aUseDefaultName = true ) const;
|
||||||
|
|
||||||
|
@ -127,25 +120,24 @@ public:
|
||||||
const EDA_RECT GetBoundingBox() const override;
|
const EDA_RECT GetBoundingBox() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsHorizJustifyFlipped
|
* Return whether the field will be rendered with the horizontal justification
|
||||||
* Returns whether the field will be rendered with the horizontal justification
|
|
||||||
* inverted due to rotation or mirroring of the parent.
|
* inverted due to rotation or mirroring of the parent.
|
||||||
*/
|
*/
|
||||||
bool IsHorizJustifyFlipped() const;
|
bool IsHorizJustifyFlipped() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function IsVoid
|
* @return true if the field is either empty or holds "~".
|
||||||
* returns true if the field is either empty or holds "~".
|
|
||||||
*/
|
*/
|
||||||
bool IsVoid() const;
|
bool IsVoid() const;
|
||||||
|
|
||||||
void SwapData( SCH_ITEM* aItem ) override;
|
void SwapData( SCH_ITEM* aItem ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ImportValues
|
* Copy parameters from a LIB_FIELD source.
|
||||||
* copy parameters from a LIB_FIELD source.
|
*
|
||||||
* Pointers and specific values (position) are not copied
|
* Pointers and specific values (position) are not copied.
|
||||||
* @param aSource = the LIB_FIELD to read
|
*
|
||||||
|
* @param aSource is the LIB_FIELD to read.
|
||||||
*/
|
*/
|
||||||
void ImportValues( const LIB_FIELD& aSource );
|
void ImportValues( const LIB_FIELD& aSource );
|
||||||
|
|
||||||
|
@ -211,6 +203,11 @@ public:
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_id; ///< Field index, @see enum MANDATORY_FIELD_T
|
||||||
|
|
||||||
|
wxString m_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 CERN
|
* Copyright (C) 2016 CERN
|
||||||
* Copyright (C) 2016-2020 KiCad Developers, see CHANGELOG.TXT for contributors.
|
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
*
|
*
|
||||||
|
@ -40,8 +40,7 @@ class PROPERTIES;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCH_IO_MGR
|
* A factory which returns an instance of a #SCH_PLUGIN.
|
||||||
* is a factory which returns an instance of a #SCH_PLUGIN.
|
|
||||||
*/
|
*/
|
||||||
class SCH_IO_MGR
|
class SCH_IO_MGR
|
||||||
{
|
{
|
||||||
|
@ -58,10 +57,8 @@ public:
|
||||||
SCH_ALTIUM, ///< Altium file format
|
SCH_ALTIUM, ///< Altium file format
|
||||||
SCH_CADSTAR_ARCHIVE, ///< CADSTAR Schematic Archive
|
SCH_CADSTAR_ARCHIVE, ///< CADSTAR Schematic Archive
|
||||||
SCH_EAGLE, ///< Autodesk Eagle file format
|
SCH_EAGLE, ///< Autodesk Eagle file format
|
||||||
// Add your schematic type here.
|
|
||||||
|
|
||||||
// ALTIUM,
|
// Add your schematic type here.
|
||||||
// etc.
|
|
||||||
SCH_FILE_UNKNOWN
|
SCH_FILE_UNKNOWN
|
||||||
} )
|
} )
|
||||||
|
|
||||||
|
@ -157,12 +154,12 @@ public:
|
||||||
//-----<PUBLIC SCH_PLUGIN API>-------------------------------------------------
|
//-----<PUBLIC SCH_PLUGIN API>-------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a brief hard coded name for this SCH_PLUGIN.
|
* Return a brief hard coded name for this SCH_PLUGIN.
|
||||||
*/
|
*/
|
||||||
virtual const wxString GetName() const = 0;
|
virtual const wxString GetName() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the file extension for the #SCH_PLUGIN.
|
* Return the file extension for the #SCH_PLUGIN.
|
||||||
*/
|
*/
|
||||||
virtual const wxString GetFileExtension() const = 0;
|
virtual const wxString GetFileExtension() const = 0;
|
||||||
|
|
||||||
|
@ -182,7 +179,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int GetModifyHash() const = 0;
|
virtual int GetModifyHash() const = 0;
|
||||||
|
|
||||||
virtual void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = NULL );
|
virtual void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load information from some input file format that this #SCH_PLUGIN implementation
|
* Load information from some input file format that this #SCH_PLUGIN implementation
|
||||||
|
@ -213,7 +210,8 @@ public:
|
||||||
* possible.
|
* possible.
|
||||||
*/
|
*/
|
||||||
virtual SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
virtual SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||||
SCH_SHEET* aAppendToMe = NULL, const PROPERTIES* aProperties = NULL );
|
SCH_SHEET* aAppendToMe = nullptr,
|
||||||
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation
|
* Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation
|
||||||
|
@ -236,12 +234,12 @@ public:
|
||||||
* continues to own this object (plugin may not delete it), and plugins
|
* continues to own this object (plugin may not delete it), and plugins
|
||||||
* should expect it to be optionally NULL. Set the
|
* should expect it to be optionally NULL. Set the
|
||||||
* #PropSaveCurrentSheetOnly property to only save the current sheet.
|
* #PropSaveCurrentSheetOnly property to only save the current sheet.
|
||||||
* Otherwise, all hierarchial sheets are saved.
|
* Otherwise, all hierarchical sheets are saved.
|
||||||
*
|
*
|
||||||
* @throw IO_ERROR if there is a problem saving or exporting.
|
* @throw IO_ERROR if there is a problem saving or exporting.
|
||||||
*/
|
*/
|
||||||
virtual void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
virtual void Save( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populate a list of #LIB_PART alias names contained within the library \a aLibraryPath.
|
* Populate a list of #LIB_PART alias names contained within the library \a aLibraryPath.
|
||||||
|
@ -259,14 +257,13 @@ public:
|
||||||
*
|
*
|
||||||
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
|
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
|
||||||
*/
|
*/
|
||||||
virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList,
|
virtual void EnumerateSymbolLib( wxArrayString& aSymbolNameList, const wxString& aLibraryPath,
|
||||||
const wxString& aLibraryPath,
|
const PROPERTIES* aProperties = nullptr );
|
||||||
const PROPERTIES* aProperties = NULL );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Populate a list of #LIB_PART aliases contained within the library \a aLibraryPath.
|
* Populate a list of #LIB_PART aliases contained within the library \a aLibraryPath.
|
||||||
*
|
*
|
||||||
* @note It is the reponsibility of the caller to delete the returned object from the heap.
|
* @note It is the responsibility of the caller to delete the returned object from the heap.
|
||||||
* Failure to do this will result in memory leaks.
|
* Failure to do this will result in memory leaks.
|
||||||
*
|
*
|
||||||
* @param aSymbolList is an array to populate with the #LIB_PART pointers associated with
|
* @param aSymbolList is an array to populate with the #LIB_PART pointers associated with
|
||||||
|
@ -283,8 +280,8 @@ public:
|
||||||
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
|
* @throw IO_ERROR if the library cannot be found, the part library cannot be loaded.
|
||||||
*/
|
*/
|
||||||
virtual void EnumerateSymbolLib( std::vector<LIB_PART*>& aSymbolList,
|
virtual void EnumerateSymbolLib( std::vector<LIB_PART*>& aSymbolList,
|
||||||
const wxString& aLibraryPath,
|
const wxString& aLibraryPath,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a #LIB_PART object having \a aPartName from the \a aLibraryPath containing
|
* Load a #LIB_PART object having \a aPartName from the \a aLibraryPath containing
|
||||||
|
@ -308,12 +305,12 @@ public:
|
||||||
* is thrown in the case where aAliasName cannot be found.
|
* is thrown in the case where aAliasName cannot be found.
|
||||||
*/
|
*/
|
||||||
virtual LIB_PART* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName,
|
virtual LIB_PART* LoadSymbol( const wxString& aLibraryPath, const wxString& aPartName,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_PART
|
* Write \a aSymbol to an existing library located at \a aLibraryPath. If a #LIB_PART
|
||||||
* by the same name already exists or there are any conflicting alias names, the new
|
* by the same name already exists or there are any conflicting alias names, the new
|
||||||
* #LIB_PART will silently overwrite any existing aliases and/or part becaue libraries
|
* #LIB_PART will silently overwrite any existing aliases and/or part because libraries
|
||||||
* cannot have duplicate alias names. It is the responsibility of the caller to check
|
* cannot have duplicate alias names. It is the responsibility of the caller to check
|
||||||
* the library for conflicts before saving.
|
* the library for conflicts before saving.
|
||||||
*
|
*
|
||||||
|
@ -332,7 +329,7 @@ public:
|
||||||
* @throw IO_ERROR if there is a problem saving.
|
* @throw IO_ERROR if there is a problem saving.
|
||||||
*/
|
*/
|
||||||
virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol,
|
virtual void SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the entire #LIB_PART associated with \a aAliasName from the library
|
* Delete the entire #LIB_PART associated with \a aAliasName from the library
|
||||||
|
@ -353,7 +350,7 @@ public:
|
||||||
* @throw IO_ERROR if there is a problem finding the alias or the library or deleting it.
|
* @throw IO_ERROR if there is a problem finding the alias or the library or deleting it.
|
||||||
*/
|
*/
|
||||||
virtual void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
virtual void DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new empty symbol library at \a aLibraryPath. It is an error to attempt
|
* Create a new empty symbol library at \a aLibraryPath. It is an error to attempt
|
||||||
|
@ -371,7 +368,7 @@ public:
|
||||||
* @throw IO_ERROR if there is a problem finding the library, or creating it.
|
* @throw IO_ERROR if there is a problem finding the library, or creating it.
|
||||||
*/
|
*/
|
||||||
virtual void CreateSymbolLib( const wxString& aLibraryPath,
|
virtual void CreateSymbolLib( const wxString& aLibraryPath,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an existing symbol library and returns true if successful, or if library
|
* Delete an existing symbol library and returns true if successful, or if library
|
||||||
|
@ -393,7 +390,7 @@ public:
|
||||||
* @throw IO_ERROR if there is a problem deleting an existing library.
|
* @throw IO_ERROR if there is a problem deleting an existing library.
|
||||||
*/
|
*/
|
||||||
virtual bool DeleteSymbolLib( const wxString& aLibraryPath,
|
virtual bool DeleteSymbolLib( const wxString& aLibraryPath,
|
||||||
const PROPERTIES* aProperties = NULL );
|
const PROPERTIES* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the library at \a aLibraryPath is writable. (Often
|
* Return true if the library at \a aLibraryPath is writable. (Often
|
||||||
|
@ -478,7 +475,7 @@ public:
|
||||||
SCH_PLUGIN_RELEASER( const SCH_PLUGIN_RELEASER& aOther ) {}
|
SCH_PLUGIN_RELEASER( const SCH_PLUGIN_RELEASER& aOther ) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_PLUGIN_RELEASER( SCH_PLUGIN* aPlugin = NULL ) :
|
SCH_PLUGIN_RELEASER( SCH_PLUGIN* aPlugin = nullptr ) :
|
||||||
plugin( aPlugin )
|
plugin( aPlugin )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -492,7 +489,7 @@ public:
|
||||||
void release()
|
void release()
|
||||||
{
|
{
|
||||||
SCH_IO_MGR::ReleasePlugin( plugin );
|
SCH_IO_MGR::ReleasePlugin( plugin );
|
||||||
plugin = NULL;
|
plugin = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( SCH_PLUGIN* aPlugin )
|
void set( SCH_PLUGIN* aPlugin )
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2004-2020 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -86,19 +86,6 @@ enum DANGLING_END_T
|
||||||
*/
|
*/
|
||||||
class DANGLING_END_ITEM
|
class DANGLING_END_ITEM
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
/// A pointer to the connectable object.
|
|
||||||
EDA_ITEM* m_item;
|
|
||||||
|
|
||||||
/// The position of the connection point.
|
|
||||||
wxPoint m_pos;
|
|
||||||
|
|
||||||
/// The type of connection of #m_item.
|
|
||||||
DANGLING_END_T m_type;
|
|
||||||
|
|
||||||
/// A pointer to the parent object (in the case of pins)
|
|
||||||
const EDA_ITEM* m_parent;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const wxPoint& aPosition )
|
DANGLING_END_ITEM( DANGLING_END_T aType, EDA_ITEM* aItem, const wxPoint& aPosition )
|
||||||
{
|
{
|
||||||
|
@ -143,6 +130,19 @@ public:
|
||||||
EDA_ITEM* GetItem() const { return m_item; }
|
EDA_ITEM* GetItem() const { return m_item; }
|
||||||
const EDA_ITEM* GetParent() const { return m_parent; }
|
const EDA_ITEM* GetParent() const { return m_parent; }
|
||||||
DANGLING_END_T GetType() const { return m_type; }
|
DANGLING_END_T GetType() const { return m_type; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// A pointer to the connectable object.
|
||||||
|
EDA_ITEM* m_item;
|
||||||
|
|
||||||
|
/// The position of the connection point.
|
||||||
|
wxPoint m_pos;
|
||||||
|
|
||||||
|
/// The type of connection of #m_item.
|
||||||
|
DANGLING_END_T m_type;
|
||||||
|
|
||||||
|
/// A pointer to the parent object (in the case of pins)
|
||||||
|
const EDA_ITEM* m_parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,10 +154,6 @@ typedef std::unordered_set<SCH_ITEM*> SCH_ITEM_SET;
|
||||||
*/
|
*/
|
||||||
class STROKE_PARAMS
|
class STROKE_PARAMS
|
||||||
{
|
{
|
||||||
int m_width;
|
|
||||||
PLOT_DASH_TYPE m_plotstyle;
|
|
||||||
COLOR4D m_color;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_THICKNESS ),
|
STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_THICKNESS ),
|
||||||
PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT,
|
PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT,
|
||||||
|
@ -183,6 +179,11 @@ public:
|
||||||
|| m_plotstyle != aOther.m_plotstyle
|
|| m_plotstyle != aOther.m_plotstyle
|
||||||
|| m_color != aOther.m_color;
|
|| m_color != aOther.m_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_width;
|
||||||
|
PLOT_DASH_TYPE m_plotstyle;
|
||||||
|
COLOR4D m_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,23 +196,6 @@ public:
|
||||||
*/
|
*/
|
||||||
class SCH_ITEM : public EDA_ITEM
|
class SCH_ITEM : public EDA_ITEM
|
||||||
{
|
{
|
||||||
friend class CONNECTION_GRAPH;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
SCH_LAYER_ID m_layer;
|
|
||||||
EDA_ITEMS m_connections; // List of items connected to this item.
|
|
||||||
FIELDS_AUTOPLACED m_fieldsAutoplaced; // indicates status of field autoplacement
|
|
||||||
wxPoint m_storedPos; // a temporary variable used in some move commands
|
|
||||||
// to store a initial pos of the item or mouse cursor
|
|
||||||
|
|
||||||
/// Stores pointers to other items that are connected to this one, per sheet
|
|
||||||
std::unordered_map<SCH_SHEET_PATH, SCH_ITEM_SET> m_connected_items;
|
|
||||||
|
|
||||||
/// Stores connectivity information, per sheet
|
|
||||||
std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map;
|
|
||||||
|
|
||||||
bool m_connectivity_dirty;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType );
|
SCH_ITEM( EDA_ITEM* aParent, KICAD_T aType );
|
||||||
|
|
||||||
|
@ -226,7 +210,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swap the internal data structures \a aItem with the schematic item.
|
* Swap the internal data structures \a aItem with the schematic item.
|
||||||
* Obviously, aItem must have the same type than me
|
* Obviously, aItem must have the same type than me.
|
||||||
* @param aItem The item to swap the data structures with.
|
* @param aItem The item to swap the data structures with.
|
||||||
*/
|
*/
|
||||||
virtual void SwapData( SCH_ITEM* aItem );
|
virtual void SwapData( SCH_ITEM* aItem );
|
||||||
|
@ -236,7 +220,7 @@ public:
|
||||||
* The new object is not put in draw list (not linked).
|
* The new object is not put in draw list (not linked).
|
||||||
*
|
*
|
||||||
* @param doClone (default = false) indicates unique values (such as timestamp and
|
* @param doClone (default = false) indicates unique values (such as timestamp and
|
||||||
* sheet name) should be duplicated. Use only for undo/redo operations.
|
* sheet name) should be duplicated. Use only for undo/redo operations.
|
||||||
*/
|
*/
|
||||||
SCH_ITEM* Duplicate( bool doClone = false ) const;
|
SCH_ITEM* Duplicate( bool doClone = false ) const;
|
||||||
|
|
||||||
|
@ -252,30 +236,31 @@ public:
|
||||||
void SetStoredPos( wxPoint aPos ) { m_storedPos = aPos; }
|
void SetStoredPos( wxPoint aPos ) { m_storedPos = aPos; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Searches the item hierarchy to find a SCHEMATIC
|
* Searches the item hierarchy to find a SCHEMATIC.
|
||||||
*
|
*
|
||||||
* Every SCH_ITEM that lives on a SCH_SCREEN should be parented to either that screen
|
* Every SCH_ITEM that lives on a SCH_SCREEN should be parented to either that screen
|
||||||
* or another SCH_ITEM on the same screen (for example, pins to their symbols).
|
* or another SCH_ITEM on the same screen (for example, pins to their symbols).
|
||||||
*
|
*
|
||||||
* Every SCH_SCREEN should be parented to the SCHEMATIC.
|
* Every SCH_SCREEN should be parented to the SCHEMATIC.
|
||||||
* Note that this hierarchy is not the same as the sheet hierarchy!
|
|
||||||
*
|
*
|
||||||
* @return the parent schematic this item lives on, or nullptr
|
* @note This hierarchy is not the same as the sheet hierarchy!
|
||||||
|
*
|
||||||
|
* @return the parent schematic this item lives on, or nullptr.
|
||||||
*/
|
*/
|
||||||
SCHEMATIC* Schematic() const;
|
SCHEMATIC* Schematic() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool - true if the object is locked, else false
|
* @return true if the object is locked, else false.
|
||||||
*/
|
*/
|
||||||
virtual bool IsLocked() const { return false; }
|
virtual bool IsLocked() const { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the 'lock' status to \a aLocked for of this item.
|
* Set the 'lock' status to \a aLocked for of this item.
|
||||||
*/
|
*/
|
||||||
virtual void SetLocked( bool aLocked ) {}
|
virtual void SetLocked( bool aLocked ) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows items to support hypertext actions when hovered/clicked.
|
* Allow items to support hypertext actions when hovered/clicked.
|
||||||
*/
|
*/
|
||||||
virtual bool IsHypertext() const { return false; }
|
virtual bool IsHypertext() const { return false; }
|
||||||
|
|
||||||
|
@ -308,7 +293,8 @@ public:
|
||||||
*
|
*
|
||||||
* Each schematic item should have its own method
|
* Each schematic item should have its own method
|
||||||
*
|
*
|
||||||
* @param aOffset drawing offset (usually {0,0} but can be different when moving an object)
|
* @param aOffset is the drawing offset (usually {0,0} but can be different when moving an
|
||||||
|
* object).
|
||||||
*/
|
*/
|
||||||
virtual void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) = 0;
|
virtual void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) = 0;
|
||||||
|
|
||||||
|
@ -340,7 +326,7 @@ public:
|
||||||
* dangling end ( no connect ), override this method to provide the correct end
|
* dangling end ( no connect ), override this method to provide the correct end
|
||||||
* points.
|
* points.
|
||||||
*
|
*
|
||||||
* @param aItemList - List of DANGLING_END_ITEMS to add to.
|
* @param aItemList is the list of DANGLING_END_ITEMS to add to.
|
||||||
*/
|
*/
|
||||||
virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
|
virtual void GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) {}
|
||||||
|
|
||||||
|
@ -353,11 +339,11 @@ public:
|
||||||
* always returns false. Only override the method if the item can be tested for a
|
* always returns false. Only override the method if the item can be tested for a
|
||||||
* dangling state.
|
* dangling state.
|
||||||
*
|
*
|
||||||
* If aSheet is passed a non-null pointer to a SCH_SHEET_PATH, the overrided method can
|
* If aSheet is passed a non-null pointer to a SCH_SHEET_PATH, the overridden method can
|
||||||
* optionally use it to update sheet-local connectivity information
|
* optionally use it to update sheet-local connectivity information
|
||||||
*
|
*
|
||||||
* @param aItemList - List of items to test item against.
|
* @param aItemList is the list of items to test item against.
|
||||||
* @param aSheet - Sheet path to update connections for
|
* @param aSheet is the sheet path to update connections for.
|
||||||
* @return True if the dangling state has changed from it's current setting.
|
* @return True if the dangling state has changed from it's current setting.
|
||||||
*/
|
*/
|
||||||
virtual bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
|
virtual bool UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
|
||||||
|
@ -376,7 +362,8 @@ public:
|
||||||
virtual bool IsConnectable() const { return false; }
|
virtual bool IsConnectable() const { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the given point can start drawing (usually means the anchor is unused/free/dangling)
|
* @return true if the given point can start drawing (usually means the anchor is
|
||||||
|
* unused/free/dangling).
|
||||||
*/
|
*/
|
||||||
virtual bool IsPointClickableAnchor( const wxPoint& aPos ) const { return false; }
|
virtual bool IsPointClickableAnchor( const wxPoint& aPos ) const { return false; }
|
||||||
|
|
||||||
|
@ -385,7 +372,7 @@ public:
|
||||||
*
|
*
|
||||||
* Not all schematic items have connection points so the default method does nothing.
|
* Not all schematic items have connection points so the default method does nothing.
|
||||||
*
|
*
|
||||||
* @param aPoints List of connection points to add to.
|
* @param aPoints is the list of connection points to add to.
|
||||||
*/
|
*/
|
||||||
virtual std::vector<wxPoint> GetConnectionPoints() const { return {}; }
|
virtual std::vector<wxPoint> GetConnectionPoints() const { return {}; }
|
||||||
|
|
||||||
|
@ -400,37 +387,37 @@ public:
|
||||||
/**
|
/**
|
||||||
* Test the item to see if it is connected to \a aPoint.
|
* Test the item to see if it is connected to \a aPoint.
|
||||||
*
|
*
|
||||||
* @param aPoint A reference to a wxPoint object containing the coordinates to test.
|
* @param aPoint is a reference to a wxPoint object containing the coordinates to test.
|
||||||
* @return True if connection to \a aPoint exists.
|
* @return True if connection to \a aPoint exists.
|
||||||
*/
|
*/
|
||||||
bool IsConnected( const wxPoint& aPoint ) const;
|
bool IsConnected( const wxPoint& aPoint ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the connection associated with this object in the given sheet
|
* Retrieve the connection associated with this object in the given sheet.
|
||||||
*
|
*
|
||||||
* @note The returned value can be nullptr.
|
* @note The returned value can be nullptr.
|
||||||
*/
|
*/
|
||||||
SCH_CONNECTION* Connection( const SCH_SHEET_PATH* aSheet = nullptr ) const;
|
SCH_CONNECTION* Connection( const SCH_SHEET_PATH* aSheet = nullptr ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the set of items connected to this item on the given sheet
|
* Retrieve the set of items connected to this item on the given sheet.
|
||||||
*/
|
*/
|
||||||
SCH_ITEM_SET& ConnectedItems( const SCH_SHEET_PATH& aPath );
|
SCH_ITEM_SET& ConnectedItems( const SCH_SHEET_PATH& aPath );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a connection link between this item and another
|
* Add a connection link between this item and another.
|
||||||
*/
|
*/
|
||||||
void AddConnectionTo( const SCH_SHEET_PATH& aPath, SCH_ITEM* aItem );
|
void AddConnectionTo( const SCH_SHEET_PATH& aPath, SCH_ITEM* aItem );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new connection object associated with this object
|
* Create a new connection object associated with this object.
|
||||||
*
|
*
|
||||||
* @param aPath is the sheet path to initialize
|
* @param aPath is the sheet path to initialize.
|
||||||
*/
|
*/
|
||||||
SCH_CONNECTION* InitializeConnection( const SCH_SHEET_PATH& aPath, CONNECTION_GRAPH* aGraph );
|
SCH_CONNECTION* InitializeConnection( const SCH_SHEET_PATH& aPath, CONNECTION_GRAPH* aGraph );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this item should propagate connection info to aItem
|
* Return true if this item should propagate connection info to \a aItem.
|
||||||
*/
|
*/
|
||||||
virtual bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const { return true; }
|
virtual bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const { return true; }
|
||||||
|
|
||||||
|
@ -483,13 +470,15 @@ public:
|
||||||
/**
|
/**
|
||||||
* Plot the schematic item to \a aPlotter.
|
* Plot the schematic item to \a aPlotter.
|
||||||
*
|
*
|
||||||
* @param aPlotter A pointer to a #PLOTTER object.
|
* @param aPlotter is the #PLOTTER object to plot to.
|
||||||
*/
|
*/
|
||||||
virtual void Plot( PLOTTER* aPlotter ) const;
|
virtual void Plot( PLOTTER* aPlotter ) const;
|
||||||
|
|
||||||
virtual bool operator <( const SCH_ITEM& aItem ) const;
|
virtual bool operator <( const SCH_ITEM& aItem ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class CONNECTION_GRAPH;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide the object specific test to see if it is connected to \a aPosition.
|
* Provide the object specific test to see if it is connected to \a aPosition.
|
||||||
*
|
*
|
||||||
|
@ -500,10 +489,25 @@ private:
|
||||||
* which performs tests common to all schematic items before calling the
|
* which performs tests common to all schematic items before calling the
|
||||||
* item specific connection testing.
|
* item specific connection testing.
|
||||||
*
|
*
|
||||||
* @param aPosition A reference to a wxPoint object containing the test position.
|
* @param aPosition is a reference to a wxPoint object containing the test position.
|
||||||
* @return True if connection to \a aPosition exists.
|
* @return True if connection to \a aPosition exists.
|
||||||
*/
|
*/
|
||||||
virtual bool doIsConnected( const wxPoint& aPosition ) const { return false; }
|
virtual bool doIsConnected( const wxPoint& aPosition ) const { return false; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SCH_LAYER_ID m_layer;
|
||||||
|
EDA_ITEMS m_connections; // List of items connected to this item.
|
||||||
|
FIELDS_AUTOPLACED m_fieldsAutoplaced; // indicates status of field autoplacement
|
||||||
|
wxPoint m_storedPos; // a temporary variable used in some move commands
|
||||||
|
// to store a initial pos of the item or mouse cursor
|
||||||
|
|
||||||
|
/// Store pointers to other items that are connected to this one, per sheet.
|
||||||
|
std::unordered_map<SCH_SHEET_PATH, SCH_ITEM_SET> m_connected_items;
|
||||||
|
|
||||||
|
/// Store connectivity information, per sheet.
|
||||||
|
std::unordered_map<SCH_SHEET_PATH, SCH_CONNECTION*> m_connection_map;
|
||||||
|
|
||||||
|
bool m_connectivity_dirty;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SCH_ITEM_H */
|
#endif /* SCH_ITEM_H */
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -34,10 +34,6 @@ class NETLIST_OBJECT_LIST;
|
||||||
|
|
||||||
class SCH_JUNCTION : public SCH_ITEM
|
class SCH_JUNCTION : public SCH_ITEM
|
||||||
{
|
{
|
||||||
wxPoint m_pos; // Position of the junction.
|
|
||||||
int m_diameter; // Diameter of the junction. Zero is user default.
|
|
||||||
COLOR4D m_color; // Color of the junction. #COLOR4D::UNSPECIFIED is user default.
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_JUNCTION( const wxPoint& aPosition = wxPoint( 0, 0 ), int aDiameter = 0,
|
SCH_JUNCTION( const wxPoint& aPosition = wxPoint( 0, 0 ), int aDiameter = 0,
|
||||||
SCH_LAYER_ID aLayer = LAYER_JUNCTION );
|
SCH_LAYER_ID aLayer = LAYER_JUNCTION );
|
||||||
|
@ -123,6 +119,10 @@ private:
|
||||||
bool doIsConnected( const wxPoint& aPosition ) const override;
|
bool doIsConnected( const wxPoint& aPosition ) const override;
|
||||||
|
|
||||||
SHAPE_CIRCLE getEffectiveShape() const;
|
SHAPE_CIRCLE getEffectiveShape() const;
|
||||||
|
|
||||||
|
wxPoint m_pos; ///< Position of the junction.
|
||||||
|
int m_diameter; ///< Diameter of the junction. Zero is user default.
|
||||||
|
COLOR4D m_color; ///< Color of the junction. #COLOR4D::UNSPECIFIED is user default.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue