Update KICAD6->KICAD7
This commit is contained in:
parent
b39aae6a93
commit
a9ed47f06c
|
@ -42,7 +42,7 @@
|
|||
|
||||
/// A variable name whose value holds the path of 3D shape files.
|
||||
/// Currently an environment variable, eventually a project variable.
|
||||
#define KICAD6_3DMODEL_DIR wxT( "KICAD6_3DMODEL_DIR" )
|
||||
#define KICAD7_3DMODEL_DIR wxT( "KICAD7_3DMODEL_DIR" )
|
||||
|
||||
|
||||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
|
||||
|
|
|
@ -109,7 +109,7 @@ bool DIALOG_GLOBAL_LIB_TABLE_CONFIG::TransferDataToWindow()
|
|||
SystemDirsAppend( &ss );
|
||||
|
||||
wxString templatePath =
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_TEMPLATE_DIR" ) ).GetValue();
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD7_TEMPLATE_DIR" ) ).GetValue();
|
||||
|
||||
if( !templatePath.IsEmpty() )
|
||||
ss.AddPaths( templatePath, 0 );
|
||||
|
|
|
@ -35,13 +35,13 @@ using STRING_MAP = std::map<wxString, wxString>;
|
|||
*/
|
||||
static const ENV_VAR::ENV_VAR_LIST predefinedEnvVars = {
|
||||
wxS( "KIPRJMOD" ),
|
||||
wxS( "KICAD6_SYMBOL_DIR" ),
|
||||
wxS( "KICAD6_3DMODEL_DIR" ),
|
||||
wxS( "KICAD6_FOOTPRINT_DIR" ),
|
||||
wxS( "KICAD6_TEMPLATE_DIR" ),
|
||||
wxS( "KICAD7_SYMBOL_DIR" ),
|
||||
wxS( "KICAD7_3DMODEL_DIR" ),
|
||||
wxS( "KICAD7_FOOTPRINT_DIR" ),
|
||||
wxS( "KICAD7_TEMPLATE_DIR" ),
|
||||
wxS( "KICAD_USER_TEMPLATE_DIR" ),
|
||||
wxS( "KICAD_PTEMPLATES" ),
|
||||
wxS( "KICAD6_3RD_PARTY" ),
|
||||
wxS( "KICAD7_3RD_PARTY" ),
|
||||
};
|
||||
|
||||
|
||||
|
@ -67,19 +67,19 @@ static void initialiseEnvVarHelp( STRING_MAP& aMap )
|
|||
{
|
||||
// Set up dynamically, as we want to be able to use _() translations,
|
||||
// which can't be done statically
|
||||
aMap[wxS( "KICAD6_FOOTPRINT_DIR" )] =
|
||||
aMap[wxS( "KICAD7_FOOTPRINT_DIR" )] =
|
||||
_( "The base path of locally installed system "
|
||||
"footprint libraries (.pretty folders).");
|
||||
aMap[wxS( "KICAD6_3DMODEL_DIR" )] =
|
||||
aMap[wxS( "KICAD7_3DMODEL_DIR" )] =
|
||||
_( "The base path of system footprint 3D shapes (.3Dshapes folders).");
|
||||
aMap[wxS( "KICAD6_SYMBOL_DIR" )] =
|
||||
aMap[wxS( "KICAD7_SYMBOL_DIR" )] =
|
||||
_( "The base path of the locally installed symbol libraries.");
|
||||
aMap[wxS( "KICAD6_TEMPLATE_DIR" )] =
|
||||
aMap[wxS( "KICAD7_TEMPLATE_DIR" )] =
|
||||
_( "A directory containing project templates installed with KiCad.");
|
||||
aMap[wxS( "KICAD_USER_TEMPLATE_DIR" )] =
|
||||
_( "Optional. Can be defined if you want to create your own project "
|
||||
"templates folder.");
|
||||
aMap[wxS( "KICAD6_3RD_PARTY" )] =
|
||||
aMap[wxS( "KICAD7_3RD_PARTY" )] =
|
||||
_( "A directory containing 3rd party plugins, libraries and other "
|
||||
"downloadable content.");
|
||||
aMap[wxS( "KIPRJMOD" )] =
|
||||
|
@ -88,18 +88,18 @@ static void initialiseEnvVarHelp( STRING_MAP& aMap )
|
|||
"variable can be used to define files and paths relative to the currently loaded "
|
||||
"project. For instance, ${KIPRJMOD}/libs/footprints.pretty can be defined as a "
|
||||
"folder containing a project specific footprint library named footprints.pretty." );
|
||||
aMap[wxS( "KICAD6_SCRIPTING_DIR" )] =
|
||||
aMap[wxS( "KICAD7_SCRIPTING_DIR" )] =
|
||||
_( "A directory containing system-wide scripts installed with KiCad" );
|
||||
aMap[wxS( "KICAD6_USER_SCRIPTING_DIR" )] =
|
||||
aMap[wxS( "KICAD7_USER_SCRIPTING_DIR" )] =
|
||||
_( "A directory containing user-specific scripts installed with KiCad" );
|
||||
|
||||
// Deprecated vars
|
||||
aMap[wxS( "KICAD_PTEMPLATES" )] =
|
||||
_( "Deprecated version of KICAD_TEMPLATE_DIR.");
|
||||
aMap[wxS( "KISYS3DMOD" )] =
|
||||
_( "Deprecated version of KICAD6_3DMODEL_DIR." );
|
||||
_( "Deprecated version of KICAD7_3DMODEL_DIR." );
|
||||
aMap[wxS( "KISYSMOD" )] =
|
||||
_( "Deprecated version of KICAD6_FOOTPRINT_DIR." );
|
||||
_( "Deprecated version of KICAD7_FOOTPRINT_DIR." );
|
||||
aMap[wxS( "KICAD_SYMBOL_DIR" )] =
|
||||
_( "Deprecated version of KICAD_SYMBOL_DIR.");
|
||||
}
|
||||
|
|
|
@ -305,8 +305,8 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
|
|||
// check the path relative to the current project directory;
|
||||
// NB: this is not necessarily the same as the current working directory, which has already
|
||||
// been checked. This case accounts for partial paths which do not contain ${KIPRJMOD}.
|
||||
// This check is performed before checking the path relative to ${KICAD6_3DMODEL_DIR} so that
|
||||
// users can potentially override a model within ${KICAD6_3DMODEL_DIR}.
|
||||
// This check is performed before checking the path relative to ${KICAD7_3DMODEL_DIR} so that
|
||||
// users can potentially override a model within ${KICAD7_3DMODEL_DIR}.
|
||||
if( !m_paths.begin()->m_Pathexp.empty() && !tname.StartsWith( ":" ) )
|
||||
{
|
||||
tmpFN.Assign( m_paths.begin()->m_Pathexp, "" );
|
||||
|
@ -339,11 +339,11 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
|
|||
}
|
||||
}
|
||||
|
||||
// check the partial path relative to ${KICAD6_3DMODEL_DIR} (legacy behavior)
|
||||
// check the partial path relative to ${KICAD7_3DMODEL_DIR} (legacy behavior)
|
||||
if( !tname.StartsWith( wxS( ":" ) ) )
|
||||
{
|
||||
wxFileName fpath;
|
||||
wxString fullPath( wxS( "${KICAD6_3DMODEL_DIR}" ) );
|
||||
wxString fullPath( wxS( "${KICAD7_3DMODEL_DIR}" ) );
|
||||
fullPath.Append( fpath.GetPathSeparator() );
|
||||
fullPath.Append( tname );
|
||||
fullPath = ExpandEnvVarSubstitutions( fullPath, m_project );
|
||||
|
@ -365,8 +365,8 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
|
|||
{
|
||||
if( !( m_errflags & ERRFLG_RELPATH ) )
|
||||
{
|
||||
// this can happen if the file was intended to be relative to ${KICAD6_3DMODEL_DIR}
|
||||
// but ${KICAD6_3DMODEL_DIR} is not set or is incorrect.
|
||||
// this can happen if the file was intended to be relative to ${KICAD7_3DMODEL_DIR}
|
||||
// but ${KICAD7_3DMODEL_DIR} is not set or is incorrect.
|
||||
m_errflags |= ERRFLG_RELPATH;
|
||||
wxString errmsg = "[3D File Resolver] No such path";
|
||||
errmsg.append( wxS( "\n" ) );
|
||||
|
@ -442,7 +442,7 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath )
|
|||
|
||||
if( !path.DirExists() )
|
||||
{
|
||||
if( aPath.m_Pathvar == wxS( "${KICAD6_3DMODEL_DIR}" )
|
||||
if( aPath.m_Pathvar == wxS( "${KICAD7_3DMODEL_DIR}" )
|
||||
|| aPath.m_Pathvar == wxS( "${KIPRJMOD}" ) || aPath.m_Pathvar == wxS( "$(KIPRJMOD)" )
|
||||
|| aPath.m_Pathvar == wxS( "${KISYS3DMOD}" ) || aPath.m_Pathvar == wxS( "$(KISYS3DMOD)" ) )
|
||||
{
|
||||
|
@ -795,7 +795,7 @@ bool FILENAME_RESOLVER::GetKicadPaths( std::list< wxString >& paths ) const
|
|||
{
|
||||
// filter out URLs, template directories, and known system paths
|
||||
if( mS->first == wxS( "KICAD_PTEMPLATES" )
|
||||
|| mS->first == wxS( "KICAD6_FOOTPRINT_DIR" ) )
|
||||
|| mS->first.Matches( wxS( "KICAD*_FOOTPRINT_DIR") ) )
|
||||
{
|
||||
++mS;
|
||||
continue;
|
||||
|
@ -810,14 +810,14 @@ bool FILENAME_RESOLVER::GetKicadPaths( std::list< wxString >& paths ) const
|
|||
//also add the path without the ${} to act as legacy alias support for older files
|
||||
paths.push_back( mS->first );
|
||||
|
||||
if( mS->first == wxS("KICAD6_3DMODEL_DIR") )
|
||||
if( mS->first.Matches( wxS("KICAD*_3DMODEL_DIR") ) )
|
||||
hasKisys3D = true;
|
||||
|
||||
++mS;
|
||||
}
|
||||
|
||||
if( !hasKisys3D )
|
||||
paths.emplace_back( wxS("KICAD6_3DMODEL_DIR") );
|
||||
paths.emplace_back( wxS("KICAD7_3DMODEL_DIR") );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -476,7 +476,7 @@ FOOTPRINT* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootp
|
|||
|
||||
const wxString FP_LIB_TABLE::GlobalPathEnvVariableName()
|
||||
{
|
||||
return wxS( "KICAD6_FOOTPRINT_DIR" );
|
||||
return wxS( "KICAD7_FOOTPRINT_DIR" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -500,12 +500,12 @@ public:
|
|||
wxFileName dir = wxFileName::DirName( dirPath );
|
||||
|
||||
// consider a directory to be a lib if it's name ends with .pretty and
|
||||
// it is under $KICAD6_3RD_PARTY/footprints/<pkgid>/ i.e. has nested level of at least +3
|
||||
// it is under $KICAD7_3RD_PARTY/footprints/<pkgid>/ i.e. has nested level of at least +3
|
||||
if( dirPath.EndsWith( wxS( ".pretty" ) ) && dir.GetDirCount() >= m_prefix_dir_count + 3 )
|
||||
{
|
||||
wxArrayString parts = dir.GetDirs();
|
||||
parts.RemoveAt( 0, m_prefix_dir_count );
|
||||
parts.Insert( wxS( "${KICAD6_3RD_PARTY}" ), 0 );
|
||||
parts.Insert( wxS( "${KICAD7_3RD_PARTY}" ), 0 );
|
||||
|
||||
wxString libPath = wxJoin( parts, '/' );
|
||||
|
||||
|
@ -563,7 +563,7 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable )
|
|||
SystemDirsAppend( &ss );
|
||||
|
||||
wxString templatePath =
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_TEMPLATE_DIR" ) ).GetValue();
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD7_TEMPLATE_DIR" ) ).GetValue();
|
||||
|
||||
if( !templatePath.IsEmpty() )
|
||||
ss.AddPaths( templatePath, 0 );
|
||||
|
@ -584,7 +584,7 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable )
|
|||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_3RD_PARTY" ) ).GetValue();
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD7_3RD_PARTY" ) ).GetValue();
|
||||
|
||||
if( settings->m_PcmLibAutoAdd )
|
||||
{
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
///! The following environment variables will never be migrated from a previous version
|
||||
const std::set<wxString> envVarBlacklist =
|
||||
{
|
||||
wxT( "KICAD6_SYMBOL_DIR" ),
|
||||
wxT( "KICAD6_FOOTPRINT_DIR" ),
|
||||
wxT( "KICAD6_TEMPLATES_DIR" ),
|
||||
wxT( "KICAD6_3DMODEL_DIR" )
|
||||
wxT( "KICAD7_SYMBOL_DIR" ),
|
||||
wxT( "KICAD7_FOOTPRINT_DIR" ),
|
||||
wxT( "KICAD7_TEMPLATES_DIR" ),
|
||||
wxT( "KICAD7_3DMODEL_DIR" )
|
||||
};
|
||||
|
||||
|
||||
|
@ -574,21 +574,21 @@ void COMMON_SETTINGS::InitializeEnvironment()
|
|||
|
||||
wxFileName path( basePath );
|
||||
path.AppendDir( wxT( "footprints" ) );
|
||||
addVar( wxT( "KICAD6_FOOTPRINT_DIR" ), path.GetFullPath() );
|
||||
addVar( wxT( "KICAD7_FOOTPRINT_DIR" ), path.GetFullPath() );
|
||||
|
||||
path = basePath;
|
||||
path.AppendDir( wxT( "3dmodels" ) );
|
||||
addVar( wxT( "KICAD6_3DMODEL_DIR" ), path.GetFullPath() );
|
||||
addVar( wxT( "KICAD7_3DMODEL_DIR" ), path.GetFullPath() );
|
||||
|
||||
addVar( wxT( "KICAD6_TEMPLATE_DIR" ), PATHS::GetStockTemplatesPath() );
|
||||
addVar( wxT( "KICAD7_TEMPLATE_DIR" ), PATHS::GetStockTemplatesPath() );
|
||||
|
||||
addVar( wxT( "KICAD_USER_TEMPLATE_DIR" ), PATHS::GetUserTemplatesPath() );
|
||||
|
||||
addVar( wxT( "KICAD6_3RD_PARTY" ), PATHS::GetDefault3rdPartyPath() );
|
||||
addVar( wxT( "KICAD7_3RD_PARTY" ), PATHS::GetDefault3rdPartyPath() );
|
||||
|
||||
path = basePath;
|
||||
path.AppendDir( wxT( "symbols" ) );
|
||||
addVar( wxT( "KICAD6_SYMBOL_DIR" ), path.GetFullPath() );
|
||||
addVar( wxT( "KICAD7_SYMBOL_DIR" ), path.GetFullPath() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -666,9 +666,9 @@ bool COMMON_SETTINGS::readLegacy3DResolverCfg( const wxString&
|
|||
if( !getLegacy3DHollerith( cfgLine, idx, al.m_Alias ) )
|
||||
continue;
|
||||
|
||||
// Don't add KICAD6_3DMODEL_DIR, one of its legacy equivalents, or KIPRJMOD from a
|
||||
// Don't add KICAD7_3DMODEL_DIR, one of its legacy equivalents, or KIPRJMOD from a
|
||||
// config file. They're system variables are are defined at runtime.
|
||||
if( al.m_Alias == wxS( "${KICAD6_3DMODEL_DIR}" ) || al.m_Alias == wxS( "${KIPRJMOD}" )
|
||||
if( al.m_Alias == wxS( "${KICAD7_3DMODEL_DIR}" ) || al.m_Alias == wxS( "${KIPRJMOD}" )
|
||||
|| al.m_Alias == wxS( "$(KIPRJMOD)" ) || al.m_Alias == wxS( "${KISYS3DMOD}" )
|
||||
|| al.m_Alias == wxS( "$(KISYS3DMOD)" ) )
|
||||
{
|
||||
|
|
|
@ -299,7 +299,7 @@ void SETTINGS_MANAGER::loadAllColorSettings()
|
|||
|
||||
wxFileName third_party_path;
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
auto it = env.find( wxS( "KICAD6_3RD_PARTY" ) );
|
||||
auto it = env.find( wxS( "KICAD7_3RD_PARTY" ) );
|
||||
|
||||
if( it != env.end() && !it->second.GetValue().IsEmpty() )
|
||||
third_party_path.SetPath( it->second.GetValue() );
|
||||
|
@ -553,6 +553,10 @@ bool SETTINGS_MANAGER::MigrateIfNeeded()
|
|||
wxT( "KICAD6_3DMODEL_DIR" ),
|
||||
wxT( "KICAD6_FOOTPRINT_DIR" ),
|
||||
wxT( "KICAD6_TEMPLATE_DIR" ), // Stores the default library table to be copied
|
||||
wxT( "KICAD7_SYMBOL_DIR" ),
|
||||
wxT( "KICAD7_3DMODEL_DIR" ),
|
||||
wxT( "KICAD7_FOOTPRINT_DIR" ),
|
||||
wxT( "KICAD7_TEMPLATE_DIR" ), // Stores the default library table to be copied
|
||||
|
||||
// Deprecated keys
|
||||
wxT( "KICAD_PTEMPLATES" ),
|
||||
|
|
|
@ -143,7 +143,7 @@ FOOTPRINT_LIST_IMPL GFootprintList;
|
|||
//!!!!!!!!!!!!!!! This code is obsolete because of the merge into Pcbnew, don't bother with it.
|
||||
|
||||
// A short lived implementation. cvpcb will get combine into Pcbnew shortly, so
|
||||
// we skip setting KICAD6_FOOTPRINT_DIR here for now. User should set the environment
|
||||
// we skip setting KICAD7_FOOTPRINT_DIR here for now. User should set the environment
|
||||
// variable.
|
||||
bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <gestfich.h>
|
||||
#include <id.h>
|
||||
#include <project.h> // For PROJECT_VAR_NAME definition
|
||||
#include <fp_lib_table.h> // For KICAD6_FOOTPRINT_DIR definition
|
||||
#include <fp_lib_table.h> // For KICAD7_FOOTPRINT_DIR definition
|
||||
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <dialog_config_equfiles.h>
|
||||
|
|
|
@ -520,7 +520,7 @@ LIB_SYMBOL* SYMBOL_LIB_TABLE::LoadSymbolWithOptionalNickname( const LIB_ID& aLib
|
|||
|
||||
const wxString SYMBOL_LIB_TABLE::GlobalPathEnvVariableName()
|
||||
{
|
||||
return "KICAD6_SYMBOL_DIR";
|
||||
return "KICAD7_SYMBOL_DIR";
|
||||
}
|
||||
|
||||
|
||||
|
@ -542,12 +542,12 @@ public:
|
|||
wxFileName file = wxFileName::FileName( aFilePath );
|
||||
|
||||
// consider a file to be a lib if it's name ends with .kicad_sym and
|
||||
// it is under $KICAD6_3RD_PARTY/symbols/<pkgid>/ i.e. has nested level of at least +2
|
||||
// it is under $KICAD7_3RD_PARTY/symbols/<pkgid>/ i.e. has nested level of at least +2
|
||||
if( file.GetExt() == wxT( "kicad_sym" ) && file.GetDirCount() >= m_prefix_dir_count + 2 )
|
||||
{
|
||||
wxArrayString parts = file.GetDirs();
|
||||
parts.RemoveAt( 0, m_prefix_dir_count );
|
||||
parts.Insert( "${KICAD6_3RD_PARTY}", 0 );
|
||||
parts.Insert( "${KICAD7_3RD_PARTY}", 0 );
|
||||
parts.Add( file.GetFullName() );
|
||||
|
||||
wxString libPath = wxJoin( parts, '/' );
|
||||
|
@ -608,7 +608,7 @@ bool SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE& aTable )
|
|||
SystemDirsAppend( &ss );
|
||||
|
||||
wxString templatePath =
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_TEMPLATE_DIR" ) ).GetValue();
|
||||
Pgm().GetLocalEnvVariables().at( wxT( "KICAD7_TEMPLATE_DIR" ) ).GetValue();
|
||||
|
||||
if( !templatePath.IsEmpty() )
|
||||
ss.AddPaths( templatePath, 0 );
|
||||
|
@ -629,7 +629,7 @@ bool SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE& aTable )
|
|||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
KICAD_SETTINGS* settings = mgr.GetAppSettings<KICAD_SETTINGS>();
|
||||
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD6_3RD_PARTY" ) ).GetValue();
|
||||
wxString packagesPath = Pgm().GetLocalEnvVariables().at( wxT( "KICAD7_3RD_PARTY" ) ).GetValue();
|
||||
|
||||
if( settings->m_PcmLibAutoAdd )
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ struct SEARCH_PATH
|
|||
* Provide an extensible class to resolve 3D model paths.
|
||||
*
|
||||
* Initially the legacy behavior will be implemented and an incomplete path would be checked
|
||||
* against the project directory or the KICAD6_3DMODEL_DIR environment variable. In the future a
|
||||
* against the project directory or the KICAD7_3DMODEL_DIR environment variable. In the future a
|
||||
* configurable set of search paths may be specified.
|
||||
*/
|
||||
class FILENAME_RESOLVER
|
||||
|
@ -136,13 +136,13 @@ public:
|
|||
/**
|
||||
* Return a list of path environment variables local to KiCad.
|
||||
*
|
||||
* This list always includes KICAD6_3DMODEL_DIR even if it is not defined locally.
|
||||
* This list always includes KICAD7_3DMODEL_DIR even if it is not defined locally.
|
||||
*/
|
||||
bool GetKicadPaths( std::list< wxString >& paths ) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Build the path list using available information such as KICAD6_3DMODEL_DIR and the 3d_path_list
|
||||
* Build the path list using available information such as KICAD7_3DMODEL_DIR and the 3d_path_list
|
||||
* configuration file.
|
||||
*
|
||||
* @warning Invalid paths are silently discarded and removed from the configuration file.
|
||||
|
|
|
@ -194,8 +194,8 @@ bool PGM_KICAD::OnPgmInit()
|
|||
m_bm.m_search.AddPaths( fn.GetPath() );
|
||||
}
|
||||
|
||||
// The KICAD6_TEMPLATE_DIR takes precedence over the search stack template path.
|
||||
ENV_VAR_MAP_CITER it = GetLocalEnvVariables().find( "KICAD6_TEMPLATE_DIR" );
|
||||
// The KICAD7_TEMPLATE_DIR takes precedence over the search stack template path.
|
||||
ENV_VAR_MAP_CITER it = GetLocalEnvVariables().find( "KICAD7_TEMPLATE_DIR" );
|
||||
|
||||
if( it != GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
|
||||
m_bm.m_search.Insert( it->second.GetValue(), 0 );
|
||||
|
|
|
@ -224,7 +224,7 @@ void PLUGIN_CONTENT_MANAGER::ReadEnvVar()
|
|||
{
|
||||
// Get 3rd party path
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
auto it = env.find( wxT( "KICAD6_3RD_PARTY" ) );
|
||||
auto it = env.find( wxT( "KICAD7_3RD_PARTY" ) );
|
||||
|
||||
if( it != env.end() && !it->second.GetValue().IsEmpty() )
|
||||
m_3rdparty_path = it->second.GetValue();
|
||||
|
|
|
@ -274,7 +274,7 @@ bool PCM_TASK_MANAGER::extract( const wxString& aFilePath, const wxString& aPack
|
|||
// Transform paths from
|
||||
// <PackageRoot>/$folder/$contents
|
||||
// To
|
||||
// $KICAD6_3RD_PARTY/$folder/$package_id/$contents
|
||||
// $KICAD7_3RD_PARTY/$folder/$package_id/$contents
|
||||
path_parts.Insert( clean_package_id, 1 );
|
||||
path_parts.Insert( m_pcm->Get3rdPartyPath(), 0 );
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
|
|||
wxFileName templatePath;
|
||||
|
||||
// KiCad system template path.
|
||||
ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD6_TEMPLATE_DIR" );
|
||||
ENV_VAR_MAP_CITER it = Pgm().GetLocalEnvVariables().find( "KICAD7_TEMPLATE_DIR" );
|
||||
|
||||
if( it != Pgm().GetLocalEnvVariables().end() && it->second.GetValue() != wxEmptyString )
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <wx/filedlg.h>
|
||||
|
||||
#include <project.h>
|
||||
#include <3d_viewer/eda_3d_viewer_frame.h> // for KICAD6_3DMODEL_DIR
|
||||
#include <3d_viewer/eda_3d_viewer_frame.h> // for KICAD7_3DMODEL_DIR
|
||||
#include <panel_fp_lib_table.h>
|
||||
#include <lib_id.h>
|
||||
#include <fp_lib_table.h>
|
||||
|
@ -1049,7 +1049,7 @@ void PANEL_FP_LIB_TABLE::populateEnvironReadOnlyTable()
|
|||
unique.insert( PROJECT_VAR_NAME );
|
||||
unique.insert( FP_LIB_TABLE::GlobalPathEnvVariableName() );
|
||||
// This special environment variable is used to locate 3d shapes
|
||||
unique.insert( KICAD6_3DMODEL_DIR );
|
||||
unique.insert( KICAD7_3DMODEL_DIR );
|
||||
|
||||
for( const wxString& evName : unique )
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(
|
|||
PCBNEW_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<PCBNEW_SETTINGS>();
|
||||
|
||||
if( cfg->m_lastFootprint3dDir.IsEmpty() )
|
||||
wxGetEnv( KICAD6_3DMODEL_DIR, &cfg->m_lastFootprint3dDir );
|
||||
wxGetEnv( KICAD7_3DMODEL_DIR, &cfg->m_lastFootprint3dDir );
|
||||
|
||||
// Icon showing warning/error information
|
||||
wxGridCellAttr* attr = new wxGridCellAttr;
|
||||
|
@ -144,7 +144,7 @@ bool PANEL_FP_PROPERTIES_3D_MODEL::TransferDataFromWindow()
|
|||
void PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint()
|
||||
{
|
||||
wxString default_path;
|
||||
wxGetEnv( KICAD6_3DMODEL_DIR, &default_path );
|
||||
wxGetEnv( KICAD7_3DMODEL_DIR, &default_path );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
default_path.Replace( wxT( "/" ), wxT( "\\" ) );
|
||||
|
@ -287,11 +287,11 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel( wxCommandEvent& )
|
|||
wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX );
|
||||
int filter = 0;
|
||||
|
||||
// If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the KICAD6_3DMODEL_DIR environment
|
||||
// If the PROJECT::VIEWER_3D_PATH hasn't been set yet, use the KICAD7_3DMODEL_DIR environment
|
||||
// variable and fall back to the project path if necessary.
|
||||
if( initialpath.IsEmpty() )
|
||||
{
|
||||
if( !wxGetEnv( wxT( "KICAD6_3DMODEL_DIR" ), &initialpath ) || initialpath.IsEmpty() )
|
||||
if( !wxGetEnv( wxT( "KICAD7_3DMODEL_DIR" ), &initialpath ) || initialpath.IsEmpty() )
|
||||
initialpath = prj.GetProjectPath();
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ std::string g_previewBoard =
|
|||
" (net 1 \"GND\") (tstamp 7920b7f9-55c4-4584-bf5c-436e8ef95e74))\n"
|
||||
" (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
|
||||
" (net 1 \"GND\") (tstamp e4c29d51-7825-48f6-aae3-5e0ea3eb6e7a))\n"
|
||||
" (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
|
||||
" (model \"${KICAD7_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
|
||||
" (offset (xyz 0 0 0))\n"
|
||||
" (scale (xyz 1 1 1))\n"
|
||||
" (rotate (xyz 0 0 0))\n"
|
||||
|
@ -155,7 +155,7 @@ std::string g_previewBoard =
|
|||
" (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
|
||||
" (net 1 \"GND\") (tstamp def83b42-5ec2-442a-8f2b-ffd7b14105ce))\n"
|
||||
" (pad \"2\" thru_hole circle (at 10.16 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp 6386fdb7-f3d1-4839-9830-ab733b3e8d94))\n"
|
||||
" (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (model \"${KICAD7_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (offset (xyz 0 0 0))\n"
|
||||
" (scale (xyz 0.393701 0.393701 0.393701))\n"
|
||||
" (rotate (xyz 0 0 0))\n"
|
||||
|
@ -193,7 +193,7 @@ std::string g_previewBoard =
|
|||
" (pad \"1\" thru_hole circle (at 0 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask)\n"
|
||||
" (net 1 \"GND\") (tstamp 5a702112-f16c-4b59-9902-914db0fa4360))\n"
|
||||
" (pad \"2\" thru_hole circle (at 10.16 0) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp b2b0d740-b086-433e-90f5-ffe119efdd07))\n"
|
||||
" (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (model \"${KICAD7_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (offset (xyz 0 0 0))\n"
|
||||
" (scale (xyz 0.393701 0.393701 0.393701))\n"
|
||||
" (rotate (xyz 0 0 0))\n"
|
||||
|
@ -230,7 +230,7 @@ std::string g_previewBoard =
|
|||
" (fp_line (start 8.23 -1.25) (end 1.93 -1.25) (layer \"F.Fab\") (width 0.1) (tstamp c0322b20-ac45-4f20-bbab-44368f60ac5d))\n"
|
||||
" (pad \"1\" thru_hole circle (at 0 0 180) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp 945fccb0-61fe-41e2-8f09-c8a33f294a3e))\n"
|
||||
" (pad \"2\" thru_hole circle (at 10.16 0 180) (size 1.8 1.8) (drill 0.85) (layers *.Cu *.Mask) (tstamp d8e786d3-14bf-403c-80db-810abc9eda53))\n"
|
||||
" (model \"${KICAD6_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (model \"${KICAD7_3DMODEL_DIR}/Resistors_THT.3dshapes/R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal.wrl\"\n"
|
||||
" (offset (xyz 0 0 0))\n"
|
||||
" (scale (xyz 0.393701 0.393701 0.393701))\n"
|
||||
" (rotate (xyz 0 0 0))\n"
|
||||
|
@ -265,7 +265,7 @@ std::string g_previewBoard =
|
|||
" (net 1 \"GND\") (tstamp 7ef87fdc-802f-4acb-9867-18732d4a7e7a))\n"
|
||||
" (pad \"2\" thru_hole circle (at 2 0) (size 1.6 1.6) (drill 0.8) (layers *.Cu *.Mask)\n"
|
||||
" (net 1 \"GND\") (tstamp 1ad1f5f9-68f6-4131-9e09-bd1d361fc282))\n"
|
||||
" (model \"${KICAD6_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
|
||||
" (model \"${KICAD7_3DMODEL_DIR}/Capacitors_THT.3dshapes/CP_Radial_D5.0mm_P2.00mm.wrl\"\n"
|
||||
" (offset (xyz 0 0 0))\n"
|
||||
" (scale (xyz 1 1 1))\n"
|
||||
" (rotate (xyz 0 0 0))\n"
|
||||
|
|
|
@ -537,7 +537,7 @@ wxString SCRIPTING::PyScriptingPath( PATH_TYPE aPathType )
|
|||
break;
|
||||
case THIRDPARTY:
|
||||
const ENV_VAR_MAP& env = Pgm().GetLocalEnvVariables();
|
||||
auto it = env.find( "KICAD6_3RD_PARTY" );
|
||||
auto it = env.find( "KICAD7_3RD_PARTY" );
|
||||
|
||||
if( it != env.end() && !it->second.GetValue().IsEmpty() )
|
||||
path = it->second.GetValue();
|
||||
|
|
Loading…
Reference in New Issue