Formatting.

This commit is contained in:
Jeff Young 2025-02-01 11:35:30 +00:00
parent 91d5238f4c
commit 5dc8e9a5de
9 changed files with 41 additions and 31 deletions

View File

@ -21,10 +21,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* @file design_block_info.h
*/
#ifndef DESIGN_BLOCK_INFO_H_
#define DESIGN_BLOCK_INFO_H_
@ -119,15 +115,16 @@ protected:
/// lazily load stuff not filled in by constructor. This may throw IO_ERRORS.
virtual void load(){};
DESIGN_BLOCK_LIST* m_owner; ///< provides access to DESIGN_BLOCK_LIB_TABLE
protected:
DESIGN_BLOCK_LIST* m_owner; ///< provides access to DESIGN_BLOCK_LIB_TABLE
bool m_loaded;
bool m_loaded;
wxString m_nickname; ///< library as known in DESIGN_BLOCK_LIB_TABLE
wxString m_dbname; ///< Module name.
int m_num; ///< Order number in the display list.
wxString m_doc; ///< Design block description.
wxString m_keywords; ///< Design block keywords.
wxString m_nickname; ///< library as known in DESIGN_BLOCK_LIB_TABLE
wxString m_dbname; ///< Module name.
int m_num; ///< Order number in the display list.
wxString m_doc; ///< Design block description.
wxString m_keywords; ///< Design block keywords.
};
@ -141,9 +138,6 @@ protected:
class KICOMMON_API DESIGN_BLOCK_LIST
{
public:
typedef std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>> DBILIST;
typedef SYNC_QUEUE<std::unique_ptr<IO_ERROR>> ERRLIST;
DESIGN_BLOCK_LIST() : m_lib_table( nullptr ) {}
virtual ~DESIGN_BLOCK_LIST() {}
@ -154,7 +148,7 @@ public:
unsigned GetCount() const { return m_list.size(); }
/// Was forced to add this by modview_frame.cpp
const DBILIST& GetList() const { return m_list; }
const std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>>& GetList() const { return m_list; }
/**
* @return Clears the design block info cache
@ -209,10 +203,10 @@ public:
DESIGN_BLOCK_LIB_TABLE* GetTable() const { return m_lib_table; }
protected:
DESIGN_BLOCK_LIB_TABLE* m_lib_table = nullptr; ///< no ownership
DESIGN_BLOCK_LIB_TABLE* m_lib_table = nullptr; ///< no ownership
DBILIST m_list;
ERRLIST m_errors; ///< some can be PARSE_ERRORs also
std::vector<std::unique_ptr<DESIGN_BLOCK_INFO>> m_list;
SYNC_QUEUE<std::unique_ptr<IO_ERROR>> m_errors; ///< some can be PARSE_ERRORs also
};
#endif // DESIGN_BLOCK_INFO_H_

View File

@ -161,9 +161,10 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
// TODO: blast LOCALE_IO into the sun
SYNC_QUEUE<std::unique_ptr<DESIGN_BLOCK_INFO>> queue_parsed;
thread_pool& tp = GetKiCadThreadPool();
size_t num_elements = m_queue.size();
std::vector<std::future<size_t>> returns( num_elements );
thread_pool& tp = GetKiCadThreadPool();
size_t num_elements = m_queue.size();
std::vector<std::future<size_t>> returns( num_elements );
auto db_thread =
[ this, &queue_parsed ]() -> size_t
@ -231,6 +232,8 @@ void DESIGN_BLOCK_LIST_IMPL::loadDesignBlocks()
DESIGN_BLOCK_LIST_IMPL::DESIGN_BLOCK_LIST_IMPL() :
m_list_timestamp( 0 ), m_progress_reporter( nullptr ), m_cancelled( false )
m_list_timestamp( 0 ),
m_progress_reporter( nullptr ),
m_cancelled( false )
{
}

View File

@ -97,6 +97,7 @@ private:
*/
bool CatchErrors( const std::function<void()>& aFunc );
private:
SYNC_QUEUE<wxString> m_queue;
long long m_list_timestamp;
PROGRESS_REPORTER* m_progress_reporter;

View File

@ -168,13 +168,13 @@ void LIB_TABLE_ROW::SetOptions( const wxString& aOptions )
LIB_TABLE::LIB_TABLE( LIB_TABLE* aFallBackTable, std::unique_ptr<LIB_TABLE_IO> aTableIo ) :
m_io( std::move( aTableIo ) ), m_fallBack( aFallBackTable ), m_version( 0 )
m_io( std::move( aTableIo ) ),
m_fallBack( aFallBackTable ),
m_version( 0 )
{
// If not given, use the default file-based I/O.
if( !m_io )
{
m_io = std::make_unique<FILE_LIB_TABLE_IO>();
}
// not copying fall back, simply search aFallBackTable separately
// if "nickName not found".

View File

@ -43,8 +43,9 @@ DESIGN_BLOCK_TREE_MODEL_ADAPTER::Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLi
}
DESIGN_BLOCK_TREE_MODEL_ADAPTER::DESIGN_BLOCK_TREE_MODEL_ADAPTER(
EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs, APP_SETTINGS_BASE::LIB_TREE& aSettings ) :
DESIGN_BLOCK_TREE_MODEL_ADAPTER::DESIGN_BLOCK_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent,
LIB_TABLE* aLibs,
APP_SETTINGS_BASE::LIB_TREE& aSettings ) :
LIB_TREE_MODEL_ADAPTER( aParent, wxT( "pinned_design_block_libs" ), aSettings ),
m_libs( (DESIGN_BLOCK_LIB_TABLE*) aLibs ),
m_frame( aParent )

View File

@ -50,6 +50,8 @@ PANEL_DESIGN_BLOCK_CHOOSER::PANEL_DESIGN_BLOCK_CHOOSER( SCH_EDIT_FRAME* aFrame,
std::vector<LIB_ID>& aHistoryList,
std::function<void()> aSelectHandler ) :
wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ),
m_dbl_click_timer( nullptr ),
m_open_libs_timer( nullptr ),
m_vsplitter( nullptr ),
m_tree( nullptr ),
m_preview( nullptr ),

View File

@ -103,7 +103,7 @@ protected:
void displayErrors( wxTopLevelWindow* aWindow );
protected:
static wxString g_designBlockSearchString;
static wxString g_designBlockSearchString;
wxTimer* m_dbl_click_timer;
wxTimer* m_open_libs_timer;

View File

@ -46,11 +46,18 @@ public:
SetType( aType );
}
DESIGN_BLOCK_LIB_TABLE_ROW() : type( DESIGN_BLOCK_IO_MGR::KICAD_SEXP ) {}
DESIGN_BLOCK_LIB_TABLE_ROW() :
LIB_TABLE_ROW(),
type( DESIGN_BLOCK_IO_MGR::KICAD_SEXP )
{
}
bool operator==( const DESIGN_BLOCK_LIB_TABLE_ROW& aRow ) const;
bool operator!=( const DESIGN_BLOCK_LIB_TABLE_ROW& aRow ) const { return !( *this == aRow ); }
bool operator!=( const DESIGN_BLOCK_LIB_TABLE_ROW& aRow ) const
{
return !( *this == aRow );
}
/**
* Return the type of design block library table represented by this row.
@ -66,7 +73,8 @@ public:
protected:
DESIGN_BLOCK_LIB_TABLE_ROW( const DESIGN_BLOCK_LIB_TABLE_ROW& aRow ) :
LIB_TABLE_ROW( aRow ), type( aRow.type )
LIB_TABLE_ROW( aRow ),
type( aRow.type )
{
}

View File

@ -290,6 +290,7 @@ private:
void setProperties( std::map<std::string, UTF8>* aProperties );
private:
wxString nickName;
wxString uri_user; ///< what user entered from UI or loaded from disk
wxString options;