Update conn minor check to use Advanced Config

This commit is contained in:
Seth Hillbrand 2024-06-03 11:56:37 -07:00
parent 74998790e8
commit 9f2c9636f0
3 changed files with 19 additions and 1 deletions

View File

@ -112,6 +112,7 @@ static const wxChar TriangulateMinimumArea[] = wxT( "TriangulateMinimumArea" );
static const wxChar EnableCacheFriendlyFracture[] = wxT( "EnableCacheFriendlyFracture" );
static const wxChar EnableAPILogging[] = wxT( "EnableAPILogging" );
static const wxChar MaxFileSystemWatchers[] = wxT( "MaxFileSystemWatchers" );
static const wxChar MinorSchematicGraphSize[] = wxT( "MinorSchematicGraphSize" );
} // namespace KEYS
@ -268,6 +269,8 @@ ADVANCED_CFG::ADVANCED_CFG()
m_MaxFilesystemWatchers = 16384;
m_MinorSchematicGraphSize = 10000;
loadFromConfigFile();
}
@ -494,6 +497,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_MaxFilesystemWatchers, m_MaxFilesystemWatchers,
0, 2147483647 ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MinorSchematicGraphSize,
&m_MinorSchematicGraphSize, m_MinorSchematicGraphSize,
0, 2147483647 ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;

View File

@ -30,6 +30,7 @@
#include <sch_connection.h>
#include <sch_item.h>
#include <wx/treectrl.h>
#include <advanced_config.h>
#ifdef DEBUG
@ -481,7 +482,8 @@ public:
*/
bool IsMinor() const
{
return m_items.size() < 10000;
return static_cast<ssize_t>( m_items.size() )
< ADVANCED_CFG::GetCfg().m_MinorSchematicGraphSize;
}
private:

View File

@ -590,6 +590,15 @@ public:
*/
int m_MaxFilesystemWatchers;
/**
* Set the number of items in a schematic graph for it to be considered "minor"
*
* Setting name: "MinorSchematicGraphSize"
* Valid values: 0 to 2147483647
* Default value: 10000
*/
int m_MinorSchematicGraphSize;
///@}
private: