/* * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors. * Author: SYSUEric . * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef _ODB_COMPONENT_H_ #define _ODB_COMPONENT_H_ #include "odb_util.h" #include #include #include "odb_attribute.h" #include "odb_eda_data.h" class ODB_COMPONENT; class COMPONENTS_MANAGER : public ATTR_MANAGER { public: COMPONENTS_MANAGER() = default; virtual ~COMPONENTS_MANAGER() { m_compList.clear(); } ODB_COMPONENT& AddComponent( const FOOTPRINT* aFp, const EDA_DATA::PACKAGE& aPkg ); void Write( std::ostream& ost ) const; private: std::list m_compList; }; class ODB_COMPONENT : public ATTR_RECORD_WRITER { public: ODB_COMPONENT( size_t aIndex, size_t r ) : m_index( aIndex ), m_pkg_ref( r ) {} const size_t m_index; /// m_center; wxString m_rot = wxT( "0" ); wxString m_mirror = wxT( "N" ); wxString m_comp_name; /// m_prp; // !< Component Property Record struct TOEPRINT { public: TOEPRINT( const EDA_DATA::PIN& pin ) : m_pin_num( pin.m_index ), m_toeprint_name( pin.m_name ) { } const size_t m_pin_num; /// m_center; /// m_toeprints; void Write( std::ostream& ost ) const; }; #endif // _ODB_COMPONENT_H_