Compare commits
173 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c000d70a51 | |||
| 234b01905d | |||
| a5bdee747a | |||
| 9977d0d737 | |||
| 46f7011463 | |||
| 876232aa7a | |||
| 39c38fb386 | |||
| 99f25b0895 | |||
| a43ec3e3f0 | |||
| 7b596f0365 | |||
| dd22c73666 | |||
| d15b34988d | |||
| 5e0ef36719 | |||
| 6994291997 | |||
| 9837d1624f | |||
| 13a41f11eb | |||
| 59723ce3ab | |||
| 79d19d9055 | |||
| 115f318976 | |||
| 51a74b53cb | |||
| f591f8741a | |||
| f56ea6bf3c | |||
| e3f12ec0d9 | |||
| c26311918e | |||
| 1f19903e7e | |||
| 1e223b9027 | |||
| 036288d18f | |||
| 8efdcbfaf1 | |||
| 6c3b4e5824 | |||
| 9831a14ef3 | |||
| f3400e03c6 | |||
| 04e699f789 | |||
| 9e61ebfb0b | |||
| 9e355c29f1 | |||
| 5ce0c2065c | |||
| 3f58dce1de | |||
| c5c89fd216 | |||
| 1820e81f5e | |||
| 4fcd80eda1 | |||
| e7a9643b37 | |||
| 3e28ac9c7c | |||
| 4c37defd35 | |||
| a4564db082 | |||
| dd3c24faf8 | |||
| 0a9aedda8b | |||
| 48b4a897af | |||
| 4c409fbac9 | |||
| b4fc7575a5 | |||
| 4560d4ef69 | |||
| 3a03c79255 | |||
| fca0785754 | |||
| 30d398b108 | |||
| dd7ce9f00a | |||
| 4f2f8e7f67 | |||
| c7e511c919 | |||
| d769d1649a | |||
| 2ae8f6337d | |||
| 97c5e0a835 | |||
| c722ea7a0c | |||
| 5c600e992a | |||
| a055916f92 | |||
| e3d5734f76 | |||
| 3d0915a33e | |||
| a67bfa6207 | |||
| a454adb3ba | |||
| 5019fd0aab | |||
| 2c6d0ffe27 | |||
| 0ff84865ca | |||
| 36746a0941 | |||
| 22df4e301b | |||
| ac0c7441b4 | |||
| 2196959539 | |||
| 06ac172c27 | |||
| e7c51a6a6c | |||
| 079d6b2009 | |||
| 8cbe5c2184 | |||
| a7d7ab32c6 | |||
| 61715a8df5 | |||
| a149960faa | |||
| 650ff5e5fe | |||
| 0c42d988f7 | |||
| a84de7cccf | |||
| e9b1552b16 | |||
| 27b88be61f | |||
| 280573e9af | |||
| 14e42fec7e | |||
| 7e8c5b9574 | |||
| 500abd0ac4 | |||
| e29e7ff95d | |||
| fb580d3694 | |||
| b987126b7d | |||
| 3919345003 | |||
| 1df99c264f | |||
| 4d094da2fa | |||
| 2c5154c630 | |||
| f85dc57642 | |||
| 3da86dc24b | |||
| 5e9b4dd6a5 | |||
| 1f60d8fdbf | |||
| 7012226284 | |||
| 48bbde65b3 | |||
| bdcae5f593 | |||
| b7b125d83c | |||
| 9eec296b0a | |||
| ec81f3267f | |||
| f0e9e3b9d5 | |||
| ee12fe6eff | |||
| d6b95236a4 | |||
| fbe677e46e | |||
| f84bd0d836 | |||
| 25b6604fc5 | |||
| fbd6654f9a | |||
| b8ae4e0195 | |||
| 9527034e0f | |||
| 6754aa8a74 | |||
| 0c659eda78 | |||
| 20ea486378 | |||
| 0c94b3239d | |||
| d8e276bc4f | |||
| b7a321d143 | |||
| f6d9c3a733 | |||
| 7ed07cae70 | |||
| 8bb0fabcba | |||
| da4d9ee392 | |||
| a4ddbff321 | |||
| 3c87ab94a2 | |||
| e424f29bbb | |||
| 3587789ae2 | |||
| 8cb389d95c | |||
| 0f78fe5a5a | |||
| 333ba4b9a2 | |||
| 7e2e39ce30 | |||
| b167c41d1b | |||
| dc022dcdae | |||
| e2c6422838 | |||
| 182b8a32df | |||
| 831978293f | |||
| 64f46448ea | |||
| ca1f50a023 | |||
| 626f5ac45a | |||
| a45a8e8797 | |||
| c7d39d22db | |||
| b764bb1d6d | |||
| 64eaaa4f58 | |||
| 0e946dad1a | |||
| 1c2f06106d | |||
| edbf34c2b2 | |||
| 26cbdbf103 | |||
| f163d9ff2a | |||
| 9230189f62 | |||
| 9d241ba812 | |||
| 57c3e98f8c | |||
| 349d1562af | |||
| d81bcee10d | |||
| 016c02a42d | |||
| 80e7a83fb0 | |||
| d2aa976017 | |||
| 9476b53533 | |||
| 5e19ed29b8 | |||
| aa340e6b85 | |||
| 9a80ebf387 | |||
| df1fa37fd8 | |||
| 370a412f49 | |||
| d63c1a2118 | |||
| 35576adb73 | |||
| 4ff426275f | |||
| 7dc9f99165 | |||
| 30da1a3b02 | |||
| 3dcf04fdb8 | |||
| 6fbc7bb4ce | |||
| 3af2026061 | |||
| 6bd8cb9b8f | |||
| b23b48b9a7 |
+56
-117
@@ -2,6 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -34,7 +35,13 @@
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 106800
|
||||
#include <boost/uuid/detail/sha1.hpp>
|
||||
#else
|
||||
#include <boost/uuid/sha1.hpp>
|
||||
#endif
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/ext.hpp>
|
||||
@@ -52,6 +59,7 @@
|
||||
|
||||
static wxCriticalSection lock3D_cache;
|
||||
|
||||
|
||||
static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB )
|
||||
{
|
||||
for( int i = 0; i < 20; ++i )
|
||||
@@ -61,6 +69,7 @@ static bool isSHA1Same( const unsigned char* shaA, const unsigned char* shaB )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool checkTag( const char* aTag, void* aPluginMgrPtr )
|
||||
{
|
||||
if( NULL == aTag || NULL == aPluginMgrPtr )
|
||||
@@ -71,6 +80,7 @@ static bool checkTag( const char* aTag, void* aPluginMgrPtr )
|
||||
return pp->CheckTag( aTag );
|
||||
}
|
||||
|
||||
|
||||
static const wxString sha1ToWXString( const unsigned char* aSHA1Sum )
|
||||
{
|
||||
unsigned char uc;
|
||||
@@ -151,14 +161,8 @@ void S3D_CACHE_ENTRY::SetSHA1( const unsigned char* aSHA1Sum )
|
||||
{
|
||||
if( NULL == aSHA1Sum )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] NULL passed for aSHA1Sum";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] NULL passed for aSHA1Sum",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -186,6 +190,7 @@ S3D_CACHE::S3D_CACHE()
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
S3D_CACHE::~S3D_CACHE()
|
||||
{
|
||||
FlushCache();
|
||||
@@ -210,8 +215,8 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, S3D_CACHE_ENTRY** aCach
|
||||
if( full3Dpath.empty() )
|
||||
{
|
||||
// the model cannot be found; we cannot proceed
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] could not find model '%s'\n",
|
||||
aModelFile.GetData() );
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [3D model] could not find model '%s'\n",
|
||||
__FILE__, __FUNCTION__, __LINE__, aModelFile );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -294,15 +299,8 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
|
||||
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
|
||||
( aFileName, ep ) ).second == false )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] duplicate entry in map file; key = '";
|
||||
ostr << aFileName.ToUTF8() << "'";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
m_CacheList.pop_back();
|
||||
delete ep;
|
||||
@@ -325,15 +323,8 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
|
||||
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
|
||||
( aFileName, ep ) ).second == false )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] duplicate entry in map file; key = '";
|
||||
ostr << aFileName.ToUTF8() << "'";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
m_CacheList.pop_back();
|
||||
delete ep;
|
||||
@@ -364,28 +355,16 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
|
||||
{
|
||||
if( aFileName.empty() )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] empty filename";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] empty filename",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( NULL == aSHA1Sum )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] NULL pointer passed for aMD5Sum";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n * [BUG] NULL pointer passed for aMD5Sum",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -434,17 +413,16 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
|
||||
if( bname.empty() )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] cannot load cached model; no file hash available\n" );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
" * [3D model] cannot load cached model; no file hash available" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_CacheDir.empty() )
|
||||
{
|
||||
wxString errmsg = "cannot load cached model; config directory unknown";
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s\n", errmsg.GetData() );
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
" * [3D model] cannot load cached model; config directory unknown" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -454,8 +432,7 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
if( !wxFileName::FileExists( fname ) )
|
||||
{
|
||||
wxString errmsg = "cannot open file";
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'\n",
|
||||
errmsg.GetData(), fname.GetData() );
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'", errmsg.GetData(), fname.GetData() );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -475,28 +452,16 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
{
|
||||
if( NULL == aCacheItem )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * NULL passed for aCacheItem";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * NULL passed for aCacheItem",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( NULL == aCacheItem->sceneData )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * aCacheItem has no valid scene data";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * aCacheItem has no valid scene data",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -505,17 +470,16 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
|
||||
if( bname.empty() )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] cannot load cached model; no file hash available\n" );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
" * [3D model] cannot load cached model; no file hash available" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_CacheDir.empty() )
|
||||
{
|
||||
wxString errmsg = "cannot load cached model; config directory unknown";
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s\n", errmsg.GetData() );
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
" * [3D model] cannot load cached model; config directory unknown" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -526,9 +490,8 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
{
|
||||
if( !wxFileName::FileExists( fname ) )
|
||||
{
|
||||
wxString errmsg = _( "path exists but is not a regular file" );
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'\n", errmsg.GetData(),
|
||||
fname.ToUTF8() );
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] path exists but is not a regular file '%s'",
|
||||
fname );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -559,14 +522,9 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
|
||||
if( !cfgdir.DirExists() )
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
wxString errmsg = _( "failed to create 3D configuration directory" );
|
||||
ostr << " * " << errmsg.ToUTF8() << "\n";
|
||||
errmsg = _( "config directory" );
|
||||
ostr << " * " << errmsg.ToUTF8() << " '";
|
||||
ostr << cfgdir.GetPath().ToUTF8() << "'";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
"%s:%s:%d\n * failed to create 3D configuration directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, cfgdir.GetPath() );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -577,15 +535,10 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
// inform the file resolver of the config directory
|
||||
if( !m_FNResolver->Set3DConfigDir( m_ConfigDir ) )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * could not set 3D Config Directory on filename resolver\n";
|
||||
ostr << " * config directory: '" << m_ConfigDir.ToUTF8() << "'";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
"%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n"
|
||||
" * config directory: '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, m_ConfigDir );
|
||||
}
|
||||
|
||||
// 3D cache data must go to a user's cache directory;
|
||||
@@ -597,20 +550,20 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
// 3. MSWin: AppData\Local\kicad\3d
|
||||
wxString cacheDir;
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32)
|
||||
wxStandardPaths::Get().UseAppInfo( wxStandardPaths::AppInfo_None );
|
||||
cacheDir = wxStandardPaths::Get().GetUserLocalDataDir();
|
||||
cacheDir.append( "\\kicad\\3d" );
|
||||
#elif defined(__APPLE)
|
||||
#elif defined(__APPLE)
|
||||
cacheDir = "${HOME}/Library/Caches/kicad/3d";
|
||||
#else // assume Linux
|
||||
#else // assume Linux
|
||||
cacheDir = ExpandEnvVarSubstitutions( "${XDG_CACHE_HOME}" );
|
||||
|
||||
if( cacheDir.empty() || cacheDir == "${XDG_CACHE_HOME}" )
|
||||
cacheDir = "${HOME}/.cache";
|
||||
|
||||
cacheDir.append( "/kicad/3d" );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
cacheDir = ExpandEnvVarSubstitutions( cacheDir );
|
||||
cfgdir.Assign( cacheDir, "" );
|
||||
@@ -621,14 +574,8 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
|
||||
if( !cfgdir.DirExists() )
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
wxString errmsg = "failed to create 3D cache directory";
|
||||
ostr << " * " << errmsg.ToUTF8() << "\n";
|
||||
errmsg = "cache directory";
|
||||
ostr << " * " << errmsg.ToUTF8() << " '";
|
||||
ostr << cfgdir.GetPath().ToUTF8() << "'";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * failed to create 3D cache directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, cfgdir.GetPath() );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -681,11 +628,8 @@ wxString S3D_CACHE::Get3DConfigDir( bool createDefault )
|
||||
|
||||
if( !cfgpath.DirExists() )
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
wxString errmsg = "failed to create 3D configuration directory";
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * " << errmsg.ToUTF8();
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * failed to create 3D configuration directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, cfgpath.GetPath() );
|
||||
|
||||
return wxT( "" );
|
||||
}
|
||||
@@ -788,14 +732,9 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName )
|
||||
|
||||
if( !cp )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
do {
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [BUG] model loaded with no associated S3D_CACHE_ENTRY";
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n", ostr.str().c_str() );
|
||||
} while( 0 );
|
||||
#endif
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
"%s:%s:%d\n * [BUG] model loaded with no associated S3D_CACHE_ENTRY",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "../3d_rendering/3d_render_raytracing/accelerators/ccontainer2d.h"
|
||||
#include "../3d_rendering/3d_render_raytracing/shapes3D/ccylinder.h"
|
||||
#include "../3d_rendering/3d_render_raytracing/shapes3D/clayeritem.h"
|
||||
#include <openmp_mutex.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_pad.h>
|
||||
@@ -418,27 +418,24 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
|
||||
*aPad ) );
|
||||
|
||||
// Add the PAD contours
|
||||
// !TODO: check the corners because it cannot add
|
||||
// roundsegments that are in the same start and end position
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[0],
|
||||
corners3DU[1],
|
||||
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[1],
|
||||
corners3DU[2],
|
||||
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[2],
|
||||
corners3DU[3],
|
||||
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[3],
|
||||
corners3DU[0],
|
||||
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
// Round segments cannot have 0-length elements, so we approximate them
|
||||
// as a small circle
|
||||
for( int i = 1; i <= 4; i++ )
|
||||
{
|
||||
if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) )
|
||||
{
|
||||
aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1],
|
||||
aClearanceValue.x * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1],
|
||||
corners3DU[i & 3],
|
||||
aClearanceValue.x * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -473,27 +470,24 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
|
||||
*aPad ) );
|
||||
|
||||
// Add the PAD contours
|
||||
// !TODO: check the corners because it cannot add
|
||||
// roundsegments that are in the same start and end position
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[0],
|
||||
corners3DU[1],
|
||||
rounding_radius * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[1],
|
||||
corners3DU[2],
|
||||
rounding_radius * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[2],
|
||||
corners3DU[3],
|
||||
rounding_radius * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[3],
|
||||
corners3DU[0],
|
||||
rounding_radius * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
// Round segments cannot have 0-length elements, so we approximate them
|
||||
// as a small circle
|
||||
for( int i = 1; i <= 4; i++ )
|
||||
{
|
||||
if( Is_segment_a_circle( corners3DU[i - 1], corners3DU[i & 3] ) )
|
||||
{
|
||||
aDstContainer->Add( new CFILLEDCIRCLE2D( corners3DU[i - 1],
|
||||
rounding_radius * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
aDstContainer->Add( new CROUNDSEGMENT2D( corners3DU[i - 1],
|
||||
corners3DU[i & 3],
|
||||
rounding_radius * 2.0f * m_biuTo3Dunits,
|
||||
*aPad ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -506,10 +500,6 @@ void CINFO3D_VISU::createNewPadWithClearance( const D_PAD* aPad,
|
||||
if( aClearanceValue.x )
|
||||
polyList.Inflate( aClearanceValue.x, 32 );
|
||||
|
||||
// This convert the poly in outline and holes
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Add the PAD polygon
|
||||
Convert_shape_line_polygon_to_triangles( polyList, *aDstContainer, m_biuTo3Dunits, *aPad );
|
||||
|
||||
@@ -829,11 +819,8 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg
|
||||
|
||||
aDrawSegment->TransformShapeWithClearanceToPolygon( polyList, aClearanceValue,
|
||||
segcountforcircle, correctionFactor );
|
||||
// This convert the poly in outline and holes
|
||||
// Note: This two sequencial calls are need in order to get
|
||||
// the triangulation function to work properly.
|
||||
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
if( polyList.IsEmpty() ) // Just for caution
|
||||
break;
|
||||
@@ -860,24 +847,14 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
|
||||
PCB_LAYER_ID aLayerId )
|
||||
{
|
||||
// Copy the polys list because we have to simplify it
|
||||
SHAPE_POLY_SET polyList = SHAPE_POLY_SET(aZoneContainer->GetFilledPolysList());
|
||||
SHAPE_POLY_SET polyList = SHAPE_POLY_SET( aZoneContainer->GetFilledPolysList(), true );
|
||||
|
||||
// This convert the poly in outline and holes
|
||||
|
||||
// Note: This two sequencial calls are need in order to get
|
||||
// the triangulation function to work properly.
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
polyList.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
if( polyList.IsEmpty() )
|
||||
return;
|
||||
|
||||
Convert_shape_line_polygon_to_triangles( polyList,
|
||||
*aDstContainer,
|
||||
m_biuTo3Dunits,
|
||||
*aZoneContainer );
|
||||
|
||||
|
||||
// add filled areas outlines, which are drawn with thick lines segments
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
for( int i = 0; i < polyList.OutlineCount(); ++i )
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "../3d_rendering/3d_render_raytracing/accelerators/ccontainer2d.h"
|
||||
#include "../3d_rendering/3d_render_raytracing/shapes3D/ccylinder.h"
|
||||
#include "../3d_rendering/3d_render_raytracing/shapes3D/clayeritem.h"
|
||||
#include <openmp_mutex.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_pad.h>
|
||||
@@ -52,6 +52,9 @@
|
||||
#include <trigo.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
|
||||
#include <profile.h>
|
||||
|
||||
@@ -788,36 +791,43 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
|
||||
|
||||
// Add zones objects
|
||||
// /////////////////////////////////////////////////////////////////////
|
||||
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
|
||||
std::atomic<size_t> nextZone( 0 );
|
||||
std::atomic<size_t> threadsFinished( 0 );
|
||||
|
||||
size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
|
||||
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
|
||||
{
|
||||
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
|
||||
|
||||
if( aStatusTextReporter )
|
||||
aStatusTextReporter->Report( wxString::Format( _( "Create zones of layer %s" ),
|
||||
LSET::Name( curr_layer_id ) ) );
|
||||
|
||||
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
|
||||
|
||||
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
|
||||
|
||||
// ADD COPPER ZONES
|
||||
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
|
||||
std::thread t = std::thread( [&]()
|
||||
{
|
||||
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
|
||||
const PCB_LAYER_ID zonelayer = zone->GetLayer();
|
||||
|
||||
if( zonelayer == curr_layer_id )
|
||||
for( size_t areaId = nextZone.fetch_add( 1 );
|
||||
areaId < static_cast<size_t>( m_board->GetAreaCount() );
|
||||
areaId = nextZone.fetch_add( 1 ) )
|
||||
{
|
||||
AddSolidAreasShapesToContainer( zone,
|
||||
layerContainer,
|
||||
curr_layer_id );
|
||||
const ZONE_CONTAINER* zone = m_board->GetArea( areaId );
|
||||
|
||||
if( zone == nullptr )
|
||||
break;
|
||||
|
||||
auto layerContainer = m_layers_container2D.find( zone->GetLayer() );
|
||||
|
||||
if( layerContainer != m_layers_container2D.end() )
|
||||
AddSolidAreasShapesToContainer( zone, layerContainer->second,
|
||||
zone->GetLayer() );
|
||||
}
|
||||
}
|
||||
|
||||
threadsFinished++;
|
||||
} );
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
while( threadsFinished < parallelThreadCount )
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
printf( "T13: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
printf( "fill zones T13: %.3f ms\n", (float)( GetRunningMicroSecs() - start_Time ) / 1e3 );
|
||||
start_Time = GetRunningMicroSecs();
|
||||
#endif
|
||||
|
||||
@@ -825,29 +835,18 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
|
||||
GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) &&
|
||||
(m_render_engine == RENDER_ENGINE_OPENGL_LEGACY) )
|
||||
{
|
||||
// Add zones poly contourns
|
||||
// /////////////////////////////////////////////////////////////////////
|
||||
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
|
||||
// ADD COPPER ZONES
|
||||
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
|
||||
{
|
||||
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
|
||||
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
|
||||
|
||||
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
|
||||
if( zone == nullptr )
|
||||
break;
|
||||
|
||||
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
|
||||
auto layerContainer = m_layers_poly.find( zone->GetLayer() );
|
||||
|
||||
// ADD COPPER ZONES
|
||||
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
|
||||
{
|
||||
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
|
||||
const LAYER_NUM zonelayer = zone->GetLayer();
|
||||
|
||||
if( zonelayer == curr_layer_id )
|
||||
{
|
||||
zone->TransformSolidAreasShapesToPolygonSet( *layerPoly,
|
||||
segcountforcircle,
|
||||
correctionFactor );
|
||||
}
|
||||
}
|
||||
if( layerContainer != m_layers_poly.end() )
|
||||
zone->TransformSolidAreasShapesToPolygonSet( *layerContainer->second, segcountforcircle, correctionFactor );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -865,22 +864,35 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
|
||||
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS ) &&
|
||||
(m_render_engine == RENDER_ENGINE_OPENGL_LEGACY) )
|
||||
{
|
||||
const int nLayers = layer_id.size();
|
||||
std::atomic<size_t> nextItem( 0 );
|
||||
std::atomic<size_t> threadsFinished( 0 );
|
||||
|
||||
#pragma omp parallel for
|
||||
for( signed int lIdx = 0; lIdx < nLayers; ++lIdx )
|
||||
size_t parallelThreadCount = std::min<size_t>(
|
||||
std::max<size_t>( std::thread::hardware_concurrency(), 2 ),
|
||||
layer_id.size() );
|
||||
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
|
||||
{
|
||||
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
|
||||
std::thread t = std::thread( [&nextItem, &threadsFinished, &layer_id, this]()
|
||||
{
|
||||
for( size_t i = nextItem.fetch_add( 1 );
|
||||
i < layer_id.size();
|
||||
i = nextItem.fetch_add( 1 ) )
|
||||
{
|
||||
auto layerPoly = m_layers_poly.find( layer_id[i] );
|
||||
|
||||
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
|
||||
if( layerPoly != m_layers_poly.end() )
|
||||
// This will make a union of all added contours
|
||||
layerPoly->second->Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
SHAPE_POLY_SET *layerPoly = m_layers_poly[curr_layer_id];
|
||||
threadsFinished++;
|
||||
} );
|
||||
|
||||
wxASSERT( layerPoly != NULL );
|
||||
|
||||
// This will make a union of all added contourns
|
||||
layerPoly->Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
t.detach();
|
||||
}
|
||||
|
||||
while( threadsFinished < parallelThreadCount )
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
}
|
||||
|
||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||
|
||||
@@ -1052,7 +1052,7 @@ bool EDA_3D_CANVAS::SetView3D( int aKeycode )
|
||||
m_settings.CameraGet().SetInterpolateMode( INTERPOLATION_BEZIER );
|
||||
m_settings.CameraGet().SetT0_and_T1_current_T();
|
||||
m_settings.CameraGet().Reset_T1();
|
||||
m_settings.CameraGet().RotateX_T1( glm::radians( -180.0f ) );
|
||||
m_settings.CameraGet().RotateY_T1( glm::radians( 180.0f ) );
|
||||
request_start_moving_camera(
|
||||
glm::min( glm::max( m_settings.CameraGet().ZoomGet(), 0.5f ), 1.125f ) );
|
||||
return true;
|
||||
|
||||
@@ -369,7 +369,8 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CCONTAINER2D boardContainer;
|
||||
Convert_shape_line_polygon_to_triangles( m_settings.GetBoardPoly(),
|
||||
SHAPE_POLY_SET tmpBoard = m_settings.GetBoardPoly();
|
||||
Convert_shape_line_polygon_to_triangles( tmpBoard,
|
||||
boardContainer,
|
||||
m_settings.BiuTo3Dunits(),
|
||||
(const BOARD_ITEM &)*m_settings.GetBoard() );
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
|
||||
#include "clayer_triangles.h"
|
||||
#include <wx/debug.h> // For the wxASSERT
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
|
||||
|
||||
CLAYER_TRIANGLE_CONTAINER::CLAYER_TRIANGLE_CONTAINER( unsigned int aNrReservedTriangles,
|
||||
@@ -219,8 +222,8 @@ void CLAYER_TRIANGLES::AddToMiddleContourns( const std::vector< SFVEC2F > &aCont
|
||||
const SFVEC2F &v0 = aContournPoints[i + 0];
|
||||
const SFVEC2F &v1 = aContournPoints[i + 1];
|
||||
|
||||
#pragma omp critical
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_middle_layer_lock );
|
||||
m_layer_middle_contourns_quads->AddQuad( SFVEC3F( v0.x, v0.y, zTop ),
|
||||
SFVEC3F( v1.x, v1.y, zTop ),
|
||||
SFVEC3F( v1.x, v1.y, zBot ),
|
||||
@@ -305,21 +308,41 @@ void CLAYER_TRIANGLES::AddToMiddleContourns( const SHAPE_POLY_SET &aPolySet,
|
||||
m_layer_middle_contourns_quads->Reserve_More( nrContournPointsToReserve * 2,
|
||||
true );
|
||||
|
||||
#pragma omp parallel for
|
||||
for( signed int i = 0; i < aPolySet.OutlineCount(); ++i )
|
||||
std::atomic<int> nextItem( 0 );
|
||||
std::atomic<size_t> threadsFinished( 0 );
|
||||
|
||||
size_t parallelThreadCount = std::min<size_t>(
|
||||
std::max<size_t>( std::thread::hardware_concurrency(), 2 ),
|
||||
static_cast<size_t>( aPolySet.OutlineCount() ) );
|
||||
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
|
||||
{
|
||||
// Add outline
|
||||
const SHAPE_LINE_CHAIN& pathOutline = aPolySet.COutline( i );
|
||||
|
||||
AddToMiddleContourns( pathOutline, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
|
||||
|
||||
// Add holes for this outline
|
||||
for( int h = 0; h < aPolySet.HoleCount( i ); ++h )
|
||||
std::thread t = std::thread( [&]()
|
||||
{
|
||||
const SHAPE_LINE_CHAIN &hole = aPolySet.CHole( i, h );
|
||||
AddToMiddleContourns( hole, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
|
||||
}
|
||||
for( int i = nextItem.fetch_add( 1 );
|
||||
i < aPolySet.OutlineCount();
|
||||
i = nextItem.fetch_add( 1 ) )
|
||||
{
|
||||
// Add outline
|
||||
const SHAPE_LINE_CHAIN& pathOutline = aPolySet.COutline( i );
|
||||
|
||||
AddToMiddleContourns( pathOutline, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
|
||||
|
||||
// Add holes for this outline
|
||||
for( int h = 0; h < aPolySet.HoleCount( i ); ++h )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN &hole = aPolySet.CHole( i, h );
|
||||
AddToMiddleContourns( hole, zBot, zTop, aBiuTo3Du, aInvertFaceDirection );
|
||||
}
|
||||
}
|
||||
|
||||
threadsFinished++;
|
||||
} );
|
||||
|
||||
t.detach();
|
||||
}
|
||||
|
||||
while( threadsFinished < parallelThreadCount )
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <geometry/shape_line_chain.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
|
||||
|
||||
typedef std::vector< SFVEC3F > SFVEC3F_VECTOR;
|
||||
@@ -174,6 +175,8 @@ public:
|
||||
float zTop,
|
||||
bool aInvertFaceDirection );
|
||||
|
||||
std::mutex m_middle_layer_lock;
|
||||
|
||||
CLAYER_TRIANGLE_CONTAINER *m_layer_top_segment_ends;
|
||||
CLAYER_TRIANGLE_CONTAINER *m_layer_top_triangles;
|
||||
CLAYER_TRIANGLE_CONTAINER *m_layer_middle_contourns_quads;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "ccontainer2d.h"
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <boost/range/algorithm/partition.hpp>
|
||||
#include <boost/range/algorithm/nth_element.hpp>
|
||||
#include <wx/debug.h>
|
||||
@@ -46,6 +47,7 @@ CGENERICCONTAINER2D::CGENERICCONTAINER2D( OBJECT2D_TYPE aObjType )
|
||||
|
||||
void CGENERICCONTAINER2D::Clear()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
m_bbox.Reset();
|
||||
|
||||
for( LIST_OBJECT2D::iterator ii = m_objects.begin();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "../shapes2D/cobject2d.h"
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
|
||||
typedef std::list<COBJECT2D *> LIST_OBJECT2D;
|
||||
typedef std::list<const COBJECT2D *> CONST_LIST_OBJECT2D;
|
||||
@@ -52,6 +53,7 @@ public:
|
||||
{
|
||||
if( aObject ) // Only add if it is a valid pointer
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
m_objects.push_back( aObject );
|
||||
m_bbox.Union( aObject->GetBBox() );
|
||||
}
|
||||
@@ -70,6 +72,7 @@ public:
|
||||
CONST_LIST_OBJECT2D &aOutList ) const = 0;
|
||||
|
||||
private:
|
||||
std::mutex m_lock;
|
||||
};
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -131,7 +131,7 @@ private:
|
||||
unsigned long int m_stats_start_rendering_time;
|
||||
|
||||
/// Save the number of blocks progress of the render
|
||||
long m_nrBlocksRenderProgress;
|
||||
size_t m_nrBlocksRenderProgress;
|
||||
|
||||
CPOSTSHADER_SSAO m_postshader_ssao;
|
||||
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
std::vector< SFVEC2UI > m_blockPositions;
|
||||
|
||||
/// this flags if a position was already processed (cleared each new render)
|
||||
std::vector< bool > m_blockPositionsWasProcessed;
|
||||
std::vector< int > m_blockPositionsWasProcessed;
|
||||
|
||||
/// this encodes the Morton code positions (on fast preview mode)
|
||||
std::vector< SFVEC2UI > m_blockPositionsFast;
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
|
||||
#include <wx/glcanvas.h> // CALLBACK definition, needed on Windows
|
||||
// alse needed on OSX to define __DARWIN__
|
||||
|
||||
#include <geometry/polygon_triangulation.h>
|
||||
#include "../../../3d_fastmath.h"
|
||||
#include <poly2tri/poly2tri.h>
|
||||
|
||||
|
||||
|
||||
CTRIANGLE2D::CTRIANGLE2D ( const SFVEC2F &aV1,
|
||||
@@ -126,172 +126,28 @@ bool CTRIANGLE2D::IsPointInside( const SFVEC2F &aPoint ) const
|
||||
const float c = 1.0f - a - b;
|
||||
|
||||
return 0.0f <= c && c <= 1.0f;
|
||||
/*
|
||||
return 0.0f <= a && a <= 1.0f &&
|
||||
0.0f <= b && b <= 1.0f &&
|
||||
0.0f <= c && c <= 1.0f;*/
|
||||
}
|
||||
|
||||
|
||||
template <class C> void FreeClear( C & cntr )
|
||||
{
|
||||
for( typename C::iterator it = cntr.begin();
|
||||
it != cntr.end();
|
||||
++it )
|
||||
{
|
||||
delete * it;
|
||||
}
|
||||
|
||||
cntr.clear();
|
||||
}
|
||||
|
||||
// Note: Please check edgeshrink.cpp in order to learn the EdgeShrink propose
|
||||
|
||||
#define APPLY_EDGE_SHRINK
|
||||
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
extern void EdgeShrink( std::vector<SFVEC2I64> &aPath );
|
||||
|
||||
#define POLY_SCALE_FACT 256
|
||||
#define POLY_SCALE_FACT_INVERSE (1.0 / (double)(POLY_SCALE_FACT))
|
||||
#endif
|
||||
|
||||
void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
|
||||
void Convert_shape_line_polygon_to_triangles( SHAPE_POLY_SET &aPolyList,
|
||||
CGENERICCONTAINER2D &aDstContainer,
|
||||
float aBiuTo3DunitsScale ,
|
||||
const BOARD_ITEM &aBoardItem )
|
||||
{
|
||||
unsigned int nOutlines = aPolyList.OutlineCount();
|
||||
|
||||
aPolyList.CacheTriangulation();
|
||||
const double conver_d = (double)aBiuTo3DunitsScale;
|
||||
|
||||
for( unsigned int idx = 0; idx < nOutlines; ++idx )
|
||||
for( unsigned int i = 0; i < aPolyList.TriangulatedPolyCount(); i++ )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN &outlinePath = aPolyList.COutline( idx );
|
||||
auto triPoly = aPolyList.TriangulatedPolygon( i );
|
||||
|
||||
wxASSERT( outlinePath.PointCount() >= 3 );
|
||||
|
||||
std::vector<SFVEC2I64> scaledOutline;
|
||||
scaledOutline.resize( outlinePath.PointCount() );
|
||||
|
||||
// printf("\nidx: %u\n", idx);
|
||||
|
||||
// Apply a scale to the points
|
||||
for( unsigned int i = 0;
|
||||
i < (unsigned int)outlinePath.PointCount();
|
||||
++i )
|
||||
for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
|
||||
{
|
||||
const VECTOR2I& a = outlinePath.CPoint( i );
|
||||
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
scaledOutline[i] = SFVEC2I64( (glm::int64)a.x * POLY_SCALE_FACT,
|
||||
(glm::int64)a.y * POLY_SCALE_FACT );
|
||||
#else
|
||||
scaledOutline[i] = SFVEC2I64( (glm::int64)a.x,
|
||||
(glm::int64)a.y );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
// Apply a modification to the points
|
||||
EdgeShrink( scaledOutline );
|
||||
#endif
|
||||
// Copy to a array of pointers
|
||||
std::vector<p2t::Point*> polyline;
|
||||
polyline.resize( outlinePath.PointCount() );
|
||||
|
||||
for( unsigned int i = 0;
|
||||
i < (unsigned int)scaledOutline.size();
|
||||
++i )
|
||||
{
|
||||
const SFVEC2I64 &a = scaledOutline[i];
|
||||
|
||||
//printf("%lu %lu\n", a.x, a.y);
|
||||
|
||||
polyline[i] = new p2t::Point( (double)a.x,
|
||||
(double)a.y );
|
||||
}
|
||||
|
||||
// Start creating the structured to be triangulated
|
||||
p2t::CDT* cdt = new p2t::CDT( polyline );
|
||||
|
||||
// Add holes for this outline
|
||||
unsigned int nHoles = aPolyList.HoleCount( idx );
|
||||
|
||||
std::vector< std::vector<p2t::Point*> > polylineHoles;
|
||||
|
||||
polylineHoles.resize( nHoles );
|
||||
|
||||
for( unsigned int idxHole = 0; idxHole < nHoles; ++idxHole )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN &outlineHoles = aPolyList.CHole( idx,
|
||||
idxHole );
|
||||
|
||||
wxASSERT( outlineHoles.PointCount() >= 3 );
|
||||
|
||||
std::vector<SFVEC2I64> scaledHole;
|
||||
scaledHole.resize( outlineHoles.PointCount() );
|
||||
|
||||
// Apply a scale to the points
|
||||
for( unsigned int i = 0;
|
||||
i < (unsigned int)outlineHoles.PointCount();
|
||||
++i )
|
||||
{
|
||||
const VECTOR2I &h = outlineHoles.CPoint( i );
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
scaledHole[i] = SFVEC2I64( (glm::int64)h.x * POLY_SCALE_FACT,
|
||||
(glm::int64)h.y * POLY_SCALE_FACT );
|
||||
#else
|
||||
scaledHole[i] = SFVEC2I64( (glm::int64)h.x,
|
||||
(glm::int64)h.y );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
// Apply a modification to the points
|
||||
EdgeShrink( scaledHole );
|
||||
#endif
|
||||
|
||||
// Resize and reserve space
|
||||
polylineHoles[idxHole].resize( outlineHoles.PointCount() );
|
||||
|
||||
for( unsigned int i = 0;
|
||||
i < (unsigned int)outlineHoles.PointCount();
|
||||
++i )
|
||||
{
|
||||
const SFVEC2I64 &h = scaledHole[i];
|
||||
|
||||
polylineHoles[idxHole][i] = new p2t::Point( h.x, h.y );
|
||||
}
|
||||
|
||||
cdt->AddHole( polylineHoles[idxHole] );
|
||||
}
|
||||
|
||||
// Triangulate
|
||||
cdt->Triangulate();
|
||||
|
||||
// Hint: if you find any crashes on the triangulation poly2tri library,
|
||||
// you can use the following site to debug the points and it will mark
|
||||
// the errors in the polygon:
|
||||
// http://r3mi.github.io/poly2tri.js/
|
||||
|
||||
|
||||
// Get and add triangles
|
||||
std::vector<p2t::Triangle*> triangles;
|
||||
triangles = cdt->GetTriangles();
|
||||
|
||||
#ifdef APPLY_EDGE_SHRINK
|
||||
const double conver_d = (double)aBiuTo3DunitsScale *
|
||||
POLY_SCALE_FACT_INVERSE;
|
||||
#else
|
||||
const double conver_d = (double)aBiuTo3DunitsScale;
|
||||
#endif
|
||||
for( unsigned int i = 0; i < triangles.size(); ++i )
|
||||
{
|
||||
p2t::Triangle& t = *triangles[i];
|
||||
|
||||
p2t::Point& a = *t.GetPoint( 0 );
|
||||
p2t::Point& b = *t.GetPoint( 1 );
|
||||
p2t::Point& c = *t.GetPoint( 2 );
|
||||
VECTOR2I a;
|
||||
VECTOR2I b;
|
||||
VECTOR2I c;
|
||||
triPoly->GetTriangle( i, a, b, c );
|
||||
|
||||
aDstContainer.Add( new CTRIANGLE2D( SFVEC2F( a.x * conver_d,
|
||||
-a.y * conver_d ),
|
||||
@@ -302,15 +158,5 @@ void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
|
||||
aBoardItem ) );
|
||||
}
|
||||
|
||||
// Delete created data
|
||||
delete cdt;
|
||||
|
||||
// Free points
|
||||
FreeClear(polyline);
|
||||
|
||||
for( unsigned int idxHole = 0; idxHole < nHoles; ++idxHole )
|
||||
{
|
||||
FreeClear( polylineHoles[idxHole] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
void Convert_shape_line_polygon_to_triangles( const SHAPE_POLY_SET &aPolyList,
|
||||
void Convert_shape_line_polygon_to_triangles( SHAPE_POLY_SET &aPolyList,
|
||||
CGENERICCONTAINER2D &aDstContainer,
|
||||
float aBiuTo3DunitsScale,
|
||||
const BOARD_ITEM &aBoardItem );
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 2
|
||||
* 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, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file edgeshrink.cpp
|
||||
* @brief The edgeShrink function was found in the project clip2tri by the:
|
||||
* Bitfighter project (http://bitfighter.org)
|
||||
* https://github.com/raptor/clip2tri
|
||||
* https://github.com/raptor/clip2tri/blob/f62a734d22733814b8a970ed8a68a4d94c24fa5f/clip2tri/clip2tri.cpp#L150
|
||||
*/
|
||||
|
||||
#include <plugins/3dapi/xv3d_types.h>
|
||||
#include <vector>
|
||||
|
||||
// clip2tri is Licenced under:
|
||||
|
||||
// The MIT License (MIT)
|
||||
|
||||
// Copyright (c) 2014 Bitfighter developers
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
|
||||
// Shrink large polygons by reducing each coordinate by 1 in the
|
||||
// general direction of the last point as we wind around
|
||||
//
|
||||
// This normally wouldn't work in every case, but our upscaled-by-1000 polygons
|
||||
// have little chance to create new duplicate points with this method.
|
||||
//
|
||||
// For information on why this was needed, see:
|
||||
//
|
||||
// https://github.com/greenm01/poly2tri/issues/90
|
||||
//
|
||||
|
||||
#define S_INC 1
|
||||
|
||||
void EdgeShrink( std::vector<SFVEC2I64> &aPath )
|
||||
{
|
||||
unsigned int prev = aPath.size() - 1;
|
||||
|
||||
for( unsigned int i = 0; i < aPath.size(); i++ )
|
||||
{
|
||||
// Adjust coordinate by 1 depending on the direction
|
||||
(aPath[i].x - aPath[prev].x) > 0 ? aPath[i].x -= S_INC :
|
||||
aPath[i].x += S_INC;
|
||||
|
||||
(aPath[i].y - aPath[prev].y) > 0 ? aPath[i].y -= S_INC :
|
||||
aPath[i].y += S_INC;
|
||||
|
||||
prev = i;
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,10 @@
|
||||
#include "buffers_debug.h"
|
||||
#include <string.h> // For memcpy
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(n, min, max) {if( n < min ) n=min; else if( n > max ) n = max;}
|
||||
#endif
|
||||
@@ -469,34 +473,51 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
|
||||
aInImg->m_wraping = WRAP_CLAMP;
|
||||
m_wraping = WRAP_CLAMP;
|
||||
|
||||
#pragma omp parallel for
|
||||
for( int iy = 0; iy < (int)m_height; iy++)
|
||||
std::atomic<size_t> nextRow( 0 );
|
||||
std::atomic<size_t> threadsFinished( 0 );
|
||||
|
||||
size_t parallelThreadCount = std::max<size_t>( std::thread::hardware_concurrency(), 2 );
|
||||
|
||||
for( size_t ii = 0; ii < parallelThreadCount; ++ii )
|
||||
{
|
||||
for( int ix = 0; ix < (int)m_width; ix++ )
|
||||
std::thread t = std::thread( [&]()
|
||||
{
|
||||
int v = 0;
|
||||
|
||||
for( int sy = 0; sy < 5; sy++ )
|
||||
for( size_t iy = nextRow.fetch_add( 1 );
|
||||
iy < m_height;
|
||||
iy = nextRow.fetch_add( 1 ) )
|
||||
{
|
||||
for( int sx = 0; sx < 5; sx++ )
|
||||
for( size_t ix = 0; ix < m_width; ix++ )
|
||||
{
|
||||
int factor = filter.kernel[sx][sy];
|
||||
unsigned char pixelv = aInImg->Getpixel( ix + sx - 2,
|
||||
iy + sy - 2 );
|
||||
int v = 0;
|
||||
|
||||
v += pixelv * factor;
|
||||
for( size_t sy = 0; sy < 5; sy++ )
|
||||
{
|
||||
for( size_t sx = 0; sx < 5; sx++ )
|
||||
{
|
||||
int factor = filter.kernel[sx][sy];
|
||||
unsigned char pixelv = aInImg->Getpixel( ix + sx - 2,
|
||||
iy + sy - 2 );
|
||||
|
||||
v += pixelv * factor;
|
||||
}
|
||||
}
|
||||
|
||||
v /= filter.div;
|
||||
v += filter.offset;
|
||||
CLAMP(v, 0, 255);
|
||||
//TODO: This needs to write to a separate buffer
|
||||
m_pixels[ix + iy * m_width] = v;
|
||||
}
|
||||
}
|
||||
|
||||
v /= filter.div;
|
||||
threadsFinished++;
|
||||
} );
|
||||
|
||||
v += filter.offset;
|
||||
|
||||
CLAMP(v, 0, 255);
|
||||
|
||||
m_pixels[ix + iy * m_width] = v;
|
||||
}
|
||||
t.detach();
|
||||
}
|
||||
|
||||
while( threadsFinished < parallelThreadCount )
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,11 +40,6 @@ set(3D-VIEWER_SRCS
|
||||
${DIR_DLG}/dlg_select_3dmodel.cpp
|
||||
${DIR_DLG}/panel_prev_3d_base.cpp
|
||||
${DIR_DLG}/panel_prev_model.cpp
|
||||
../polygon/poly2tri/common/shapes.cc
|
||||
../polygon/poly2tri/sweep/advancing_front.cc
|
||||
../polygon/poly2tri/sweep/cdt.cc
|
||||
../polygon/poly2tri/sweep/sweep.cc
|
||||
../polygon/poly2tri/sweep/sweep_context.cc
|
||||
3d_canvas/cinfo3d_visu.cpp
|
||||
3d_canvas/create_layer_items.cpp
|
||||
3d_canvas/create_3Dgraphic_brd_items.cpp
|
||||
@@ -79,7 +74,6 @@ set(3D-VIEWER_SRCS
|
||||
${DIR_RAY_2D}/cring2d.cpp
|
||||
${DIR_RAY_2D}/croundsegment2d.cpp
|
||||
${DIR_RAY_2D}/ctriangle2d.cpp
|
||||
${DIR_RAY_2D}/edgeshrink.cpp
|
||||
${DIR_RAY_3D}/cbbox.cpp
|
||||
${DIR_RAY_3D}/cbbox_ray.cpp
|
||||
${DIR_RAY_3D}/ccylinder.cpp
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 2
|
||||
* 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, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file openmp_mutex.h
|
||||
* @brief a mutex for openmp got from the website:
|
||||
* http://bisqwit.iki.fi/story/howto/openmp/
|
||||
* by Joel Yliluoma <bisqwit@iki.fi>
|
||||
*/
|
||||
|
||||
#ifndef _OPENMP_MUTEX_H
|
||||
#define _OPENMP_MUTEX_H
|
||||
|
||||
#ifdef _OPENMP
|
||||
|
||||
# include <omp.h>
|
||||
|
||||
struct MutexType
|
||||
{
|
||||
MutexType() { omp_init_lock( &lock ); }
|
||||
~MutexType() { omp_destroy_lock( &lock ); }
|
||||
void Lock() { omp_set_lock( &lock ); }
|
||||
void Unlock() { omp_unset_lock( &lock ); }
|
||||
|
||||
MutexType( const MutexType& ) { omp_init_lock( &lock ); }
|
||||
MutexType& operator= ( const MutexType& ) { return *this; }
|
||||
public:
|
||||
omp_lock_t lock;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
/// A dummy mutex that doesn't actually exclude anything,
|
||||
/// but as there is no parallelism either, no worries.
|
||||
struct MutexType
|
||||
{
|
||||
void Lock() {}
|
||||
void Unlock() {}
|
||||
};
|
||||
#endif
|
||||
|
||||
/// An exception-safe scoped lock-keeper.
|
||||
struct ScopedLock
|
||||
{
|
||||
explicit ScopedLock( MutexType& m ) : mut( m ), locked( true ) { mut.Lock(); }
|
||||
~ScopedLock() { Unlock(); }
|
||||
void Unlock() { if( !locked ) return; locked = false; mut.Unlock(); }
|
||||
void LockAgain() { if( locked ) return; mut.Lock(); locked = true; }
|
||||
|
||||
private:
|
||||
MutexType& mut;
|
||||
bool locked;
|
||||
|
||||
private: // prevent copying the scoped lock.
|
||||
void operator=(const ScopedLock&);
|
||||
ScopedLock(const ScopedLock&);
|
||||
};
|
||||
|
||||
#endif // _OPENMP_MUTEX_H
|
||||
+25
-25
@@ -30,8 +30,6 @@ if(POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW) # CMake 3.0
|
||||
endif()
|
||||
|
||||
project( kicad )
|
||||
|
||||
# Default to CMAKE_BUILD_TYPE = Release unless overridden on command line
|
||||
# http://www.cmake.org/pipermail/cmake/2008-September/023808.html
|
||||
if( DEFINED CMAKE_BUILD_TYPE )
|
||||
@@ -40,11 +38,20 @@ else()
|
||||
set( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" )
|
||||
endif()
|
||||
|
||||
project( kicad )
|
||||
|
||||
include( GNUInstallDirs )
|
||||
|
||||
# Path to local CMake modules.
|
||||
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
|
||||
|
||||
# On Windows, binaries created by link option -g3 are very large (more than 1Gb for pcbnew,
|
||||
# and more than 3Gb for the full kicad suite)
|
||||
# This option create binaries using link option -g1 that create much smaller files, but
|
||||
# there are less info in debug (but the file names and line numbers are available)
|
||||
option( BUILD_SMALL_DEBUG_FILES "In debug build: create smaller binaries." OFF )
|
||||
|
||||
|
||||
#
|
||||
# KiCad build options should be added below.
|
||||
#
|
||||
@@ -72,8 +79,8 @@ option( KICAD_SCRIPTING_WXPYTHON
|
||||
ON )
|
||||
|
||||
option( KICAD_SCRIPTING_ACTION_MENU
|
||||
"Build a tools menu with registred python plugins: actions plugins (default OFF)."
|
||||
)
|
||||
"Build a tools menu with registered python plugins: actions plugins (default ON)."
|
||||
ON )
|
||||
|
||||
option( KICAD_USE_OCE
|
||||
"Build tools and plugins related to OpenCascade Community Edition (default ON)"
|
||||
@@ -274,8 +281,18 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
set( CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}" )
|
||||
|
||||
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations" )
|
||||
# Link flags in Debug: -g1 and -ggdb1 or -g1 and -ggdb3 can be used.
|
||||
# Level 1 produces minimal information, enough for making basic backtraces.
|
||||
# This includes descriptions of functions and external variables, and line number tables,
|
||||
# but no information about local variables.
|
||||
# Level 3 includes full information, but binaries are much larger.
|
||||
if( BUILD_SMALL_DEBUG_FILES )
|
||||
set( CMAKE_C_FLAGS_DEBUG "-g1 -ggdb1 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-g1 -ggdb1 -DDEBUG -Wno-deprecated-declarations" )
|
||||
else()
|
||||
set( CMAKE_C_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG -Wno-deprecated-declarations" )
|
||||
endif()
|
||||
|
||||
if( MINGW )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||
@@ -526,24 +543,6 @@ include( ExternalProject )
|
||||
#================================================
|
||||
include( CheckFindPackageResult )
|
||||
|
||||
#
|
||||
# Find OpenMP support, optional
|
||||
#
|
||||
|
||||
find_package( OpenMP )
|
||||
|
||||
if( OPENMP_FOUND )
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
|
||||
add_definitions( -DUSE_OPENMP )
|
||||
|
||||
# MinGW does not include the OpenMP link library and FindOpenMP.cmake does not
|
||||
# set it either. Not sure this is the most elegant solution but it works.
|
||||
if( MINGW )
|
||||
set( OPENMP_LIBRARIES gomp )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Find wxWidgets library, required
|
||||
#
|
||||
@@ -579,7 +578,7 @@ endif()
|
||||
#
|
||||
# Find OpenGL library, required
|
||||
#
|
||||
set( OpenGL_GL_PREFERENCE "GLVND" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
|
||||
set( OpenGL_GL_PREFERENCE "LEGACY" ) # CMake 3.11+ setting; see 'cmake --help-policy CMP0072'
|
||||
find_package( OpenGL REQUIRED )
|
||||
|
||||
#
|
||||
@@ -912,6 +911,7 @@ if( UNIX AND NOT APPLE )
|
||||
endif()
|
||||
|
||||
#include( CTest )
|
||||
enable_testing()
|
||||
|
||||
if( UNIX AND NOT APPLE )
|
||||
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
# be set after each version tag is added to the git repo. This will
|
||||
# give developers a reasonable idea where which branch was used to build
|
||||
# KiCad.
|
||||
set( KICAD_VERSION "5.0.0" )
|
||||
set( KICAD_VERSION "5.0.1" )
|
||||
|
||||
@@ -72,4 +72,7 @@
|
||||
#define KIFACE_SUFFIX "@KIFACE_SUFFIX@"
|
||||
#define KIFACE_PREFIX "@KIFACE_PREFIX@"
|
||||
|
||||
/// Allows scripts install directory to be referenced by the program code.
|
||||
#define PYTHON_DEST "@PYTHON_DEST@"
|
||||
|
||||
#endif // CONFIG_H_
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -119,12 +119,12 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
|
||||
brightSizer->Add( sbSizerInfo, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_buttonLoad = new wxButton( m_panelRight, wxID_ANY, _("Load Bitmap"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
brightSizer->Add( m_buttonLoad, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_buttonExport = new wxButton( m_panelRight, wxID_ANY, _("Export"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonExport->SetToolTip( _("Create a library file for Eeschema\nThis library contains only one component: logo") );
|
||||
|
||||
brightSizer->Add( m_buttonExport, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
brightSizer->Add( m_buttonExport, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxString m_radioBoxFormatChoices[] = { _("Eeschema (.lib file)"), _("Pcbnew (.kicad_mod file)"), _("Postscript (.ps file)"), _("Logo for title block (.kicad_wks file)") };
|
||||
int m_radioBoxFormatNChoices = sizeof( m_radioBoxFormatChoices ) / sizeof( wxString );
|
||||
@@ -142,7 +142,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
|
||||
m_sliderThreshold = new wxSlider( sbSizer2->GetStaticBox(), wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS );
|
||||
m_sliderThreshold->SetToolTip( _("Adjust the level to convert the greyscale picture to a black and white picture.") );
|
||||
|
||||
sbSizer2->Add( m_sliderThreshold, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
sbSizer2->Add( m_sliderThreshold, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_checkNegative = new wxCheckBox( sbSizer2->GetStaticBox(), wxID_ANY, _("Negative"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizer2->Add( m_checkNegative, 0, wxBOTTOM|wxTOP, 10 );
|
||||
@@ -153,7 +153,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS
|
||||
wxString m_radio_PCBLayerChoices[] = { _("Front silk screen"), _("Front solder mask"), _("User layer Eco1"), _("User layer Eco2") };
|
||||
int m_radio_PCBLayerNChoices = sizeof( m_radio_PCBLayerChoices ) / sizeof( wxString );
|
||||
m_radio_PCBLayer = new wxRadioBox( m_panelRight, wxID_ANY, _("Board Layer for Outline:"), wxDefaultPosition, wxDefaultSize, m_radio_PCBLayerNChoices, m_radio_PCBLayerChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_radio_PCBLayer->SetSelection( 3 );
|
||||
m_radio_PCBLayer->SetSelection( 0 );
|
||||
m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value are always placed on the silk screen layer.") );
|
||||
|
||||
brightSizer->Add( m_radio_PCBLayer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
@@ -1813,7 +1813,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1901,7 +1901,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -2175,7 +2175,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxSlider" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -2421,7 +2421,7 @@
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">3</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxRA_SPECIFY_COLS</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -305,8 +305,7 @@ set( BMAPS_MID
|
||||
label2glabel
|
||||
label2text
|
||||
label
|
||||
lang_catalan
|
||||
lang_chinese
|
||||
lang_ca
|
||||
lang_bg
|
||||
lang_cs
|
||||
lang_def
|
||||
@@ -327,6 +326,7 @@ set( BMAPS_MID
|
||||
lang_sk
|
||||
lang_sl
|
||||
lang_lt
|
||||
lang_zh
|
||||
language
|
||||
layers_manager
|
||||
leave_sheet
|
||||
|
||||
@@ -25,6 +25,6 @@ static const unsigned char png[] = {
|
||||
0x2b, 0xeb, 0x17, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE lang_chinese_xpm[1] = {{ png, sizeof( png ), "lang_chinese_xpm" }};
|
||||
const BITMAP_OPAQUE lang_zh_xpm[1] = {{ png, sizeof( png ), "lang_zh_xpm" }};
|
||||
|
||||
//EOF
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -13,7 +13,7 @@
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="lang_chinese.svg">
|
||||
sodipodi:docname="lang_zh.svg">
|
||||
<metadata
|
||||
id="metadata21">
|
||||
<rdf:RDF>
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -19,6 +19,7 @@ include_directories(
|
||||
${INC_AFTER}
|
||||
${OCE_INCLUDE_DIRS}
|
||||
${OCC_INCLUDE_DIR}
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -66,9 +66,9 @@ LOCALE_IO::LOCALE_IO()
|
||||
if( m_c_count++ == 0 )
|
||||
{
|
||||
// Store the user locale name, to restore this locale later, in dtor
|
||||
m_user_locale = setlocale( LC_ALL, 0 );
|
||||
m_user_locale = setlocale( LC_NUMERIC, nullptr );
|
||||
// Switch the locale to C locale, to read/write files with fp numbers
|
||||
setlocale( LC_ALL, "C" );
|
||||
setlocale( LC_NUMERIC, "C" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ LOCALE_IO::~LOCALE_IO()
|
||||
if( --m_c_count == 0 )
|
||||
{
|
||||
// revert to the user locale
|
||||
setlocale( LC_ALL, m_user_locale.c_str() );
|
||||
setlocale( LC_NUMERIC, m_user_locale.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-6
@@ -72,13 +72,17 @@ void KIDIALOG::ForceShowAgain()
|
||||
|
||||
bool KIDIALOG::Show( bool aShow )
|
||||
{
|
||||
// Check if this dialog should be shown to the user
|
||||
auto it = doNotShowAgainDlgs.find( m_hash );
|
||||
// We should check the do-not-show-again setting only when the dialog is displayed
|
||||
if( aShow )
|
||||
{
|
||||
// Check if this dialog should be shown to the user
|
||||
auto it = doNotShowAgainDlgs.find( m_hash );
|
||||
|
||||
if( it != doNotShowAgainDlgs.end() )
|
||||
return it->second;
|
||||
if( it != doNotShowAgainDlgs.end() )
|
||||
return it->second;
|
||||
}
|
||||
|
||||
bool ret = wxRichMessageDialog::Show();
|
||||
bool ret = wxRichMessageDialog::Show( aShow );
|
||||
|
||||
// Has the user asked not to show the dialog again
|
||||
if( IsCheckBoxChecked() )
|
||||
@@ -233,7 +237,7 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
|
||||
bool IsOK( wxWindow* aParent, const wxString& aMessage )
|
||||
{
|
||||
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
|
||||
wxYES_NO | wxCENTRE | wxICON_QUESTION );
|
||||
wxYES_NO | wxCENTRE | wxICON_QUESTION | wxSTAY_ON_TOP );
|
||||
|
||||
return dlg.ShowModal() == wxID_YES;
|
||||
}
|
||||
|
||||
@@ -369,6 +369,11 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
wxEmptyString,
|
||||
"Bulgarian (BG)",
|
||||
aInfo.CreateKiBitmap( lang_bg_xpm ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Liu Guang",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
"Simplified Chinese (zh_CN)",
|
||||
aInfo.CreateKiBitmap( lang_zh_xpm ) ) );
|
||||
|
||||
// Maintainer who helper in translations, but not in a specific translation
|
||||
#define OTHERS_IN_TRANSLATION _( "Others" )
|
||||
|
||||
@@ -255,13 +255,18 @@ static void fixOSXCancelButtonIssue( wxWindow *aWindow )
|
||||
// copying the text if a button with wxID_CANCEL is used in a
|
||||
// wxStdDialogButtonSizer created by wxFormBuilder: the label is &Cancel, and
|
||||
// this accelerator key has priority over the standard copy accelerator.
|
||||
// Note: problem also exists in other languages; for instance cmd+a closes
|
||||
// dialogs in German because the button is &Abbrechen.
|
||||
wxButton* button = dynamic_cast<wxButton*>( wxWindow::FindWindowById( wxID_CANCEL, aWindow ) );
|
||||
|
||||
if( button )
|
||||
{
|
||||
static const wxString placeholder = wxT( "{amp}" );
|
||||
|
||||
wxString buttonLabel = button->GetLabel();
|
||||
buttonLabel.Replace( wxT( "&C" ), wxT( "C" ) );
|
||||
buttonLabel.Replace( wxT( "&c" ), wxT( "c" ) );
|
||||
buttonLabel.Replace( wxT( "&&" ), placeholder );
|
||||
buttonLabel.Replace( wxT( "&" ), wxEmptyString );
|
||||
buttonLabel.Replace( placeholder, wxT( "&" ) );
|
||||
button->SetLabel( buttonLabel );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ bool DIALOG_ENV_VAR_CONFIG::GetPathAtIndex( unsigned int aIndex, wxString& aEnvV
|
||||
|
||||
void DIALOG_ENV_VAR_CONFIG::OnAddButton( wxCommandEvent& event )
|
||||
{
|
||||
DIALOG_ENV_VAR_SINGLE dlg( nullptr, wxEmptyString, wxEmptyString );
|
||||
DIALOG_ENV_VAR_SINGLE dlg( this, wxEmptyString, wxEmptyString );
|
||||
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
{
|
||||
@@ -230,7 +230,7 @@ void DIALOG_ENV_VAR_CONFIG::EditSelectedEntry()
|
||||
|
||||
if( GetPathAtIndex( m_pathIndex, envName, envPath ) )
|
||||
{
|
||||
auto dlg = new DIALOG_ENV_VAR_SINGLE( nullptr, envName, envPath );
|
||||
auto dlg = new DIALOG_ENV_VAR_SINGLE( this, envName, envPath );
|
||||
|
||||
if( IsEnvVarImmutable( envName ) )
|
||||
{
|
||||
@@ -432,7 +432,7 @@ void DIALOG_ENV_VAR_SINGLE::OnSelectPath( wxCommandEvent& event )
|
||||
wxString title = _( "Select Path for Environment Variable" );
|
||||
wxString path; // Currently the first opened path is not initialized
|
||||
|
||||
wxDirDialog dlg( nullptr, title, path, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
wxDirDialog dlg( this, title, path, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() == wxID_OK )
|
||||
m_envVarPath->SetValue( dlg.GetPath() );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -43,15 +43,14 @@ HOTKEYS_EDITOR_DIALOG_BASE::HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWind
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
b_buttonsSizer->Add( m_sdbSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
b_buttonsSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_mainSizer->Add( b_buttonsSizer, 0, wxALIGN_RIGHT|wxEXPAND, 5 );
|
||||
m_mainSizer->Add( b_buttonsSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( m_mainSizer );
|
||||
this->Layout();
|
||||
m_mainSizer->Fit( this );
|
||||
|
||||
// Connect Events
|
||||
m_resetButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HOTKEYS_EDITOR_DIALOG_BASE::ResetClicked ), NULL, this );
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_hotkeys_editor_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_hotkeys_editor_base</property>
|
||||
<property name="namespace"></property>
|
||||
@@ -44,7 +45,7 @@
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">HOTKEYS_EDITOR_DIALOG_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">-1,-1</property>
|
||||
<property name="size">513,445</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Hotkeys Editor</property>
|
||||
@@ -88,7 +89,7 @@
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_mainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
@@ -256,11 +257,11 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="0">
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">b_buttonsSizer</property>
|
||||
<property name="orient">wxHORIZONTAL</property>
|
||||
@@ -453,7 +454,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="0">
|
||||
<property name="Apply">0</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -50,7 +50,7 @@ class HOTKEYS_EDITOR_DIALOG_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
HOTKEYS_EDITOR_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Hotkeys Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 513,445 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~HOTKEYS_EDITOR_DIALOG_BASE();
|
||||
|
||||
};
|
||||
|
||||
@@ -1395,6 +1395,7 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
|
||||
wxLogTrace( kicadTraceKeyEvent, "EDA_DRAW_PANEL::OnKeyEvent %s", dump( event ) );
|
||||
|
||||
localkey = event.GetKeyCode();
|
||||
bool keyWasHandled = false;
|
||||
|
||||
switch( localkey )
|
||||
{
|
||||
@@ -1408,6 +1409,8 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
|
||||
EndMouseCapture();
|
||||
else
|
||||
EndMouseCapture( ID_NO_TOOL_SELECTED, m_defaultCursor, wxEmptyString );
|
||||
|
||||
keyWasHandled = true; // The key is captured: the key event must not be skipped
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1446,8 +1449,8 @@ void EDA_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
|
||||
|
||||
GetParent()->SetMousePosition( pos );
|
||||
|
||||
if( !GetParent()->GeneralControl( &DC, pos, localkey ) )
|
||||
event.Skip();
|
||||
if( !GetParent()->GeneralControl( &DC, pos, localkey ) && !keyWasHandled )
|
||||
event.Skip(); // Skip this event only when the key was not handled
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -147,6 +147,12 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
|
||||
|
||||
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
{
|
||||
m_viewControls->UpdateScrollbars();
|
||||
|
||||
// Drawing to a zero-width or zero-height GAL is fraught with peril.
|
||||
if( GetClientRect().IsEmpty() )
|
||||
return;
|
||||
|
||||
m_pendingRefresh = false;
|
||||
|
||||
if( m_drawing )
|
||||
@@ -161,8 +167,6 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
m_drawing = true;
|
||||
KIGFX::RENDER_SETTINGS* settings = static_cast<KIGFX::RENDER_SETTINGS*>( m_painter->GetSettings() );
|
||||
|
||||
m_viewControls->UpdateScrollbars();
|
||||
|
||||
try
|
||||
{
|
||||
m_view->UpdateItems();
|
||||
|
||||
@@ -56,17 +56,16 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString& aFootprintName )
|
||||
if( aFootprintName.IsEmpty() )
|
||||
return NULL;
|
||||
|
||||
LIB_ID fpid;
|
||||
|
||||
wxCHECK_MSG( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0, NULL,
|
||||
wxString::Format( wxT( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
|
||||
|
||||
wxString libNickname = fpid.GetLibNickname();
|
||||
wxString footprintName = fpid.GetLibItemName();
|
||||
|
||||
for( auto& fp : m_list )
|
||||
{
|
||||
LIB_ID fpid;
|
||||
|
||||
wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL,
|
||||
wxString::Format(
|
||||
wxT( "\"%s\" is not a valid LIB_ID." ), GetChars( aFootprintName ) ) );
|
||||
|
||||
wxString libNickname = fpid.GetLibNickname();
|
||||
wxString footprintName = fpid.GetLibItemName();
|
||||
|
||||
if( libNickname == fp->GetNickname() && footprintName == fp->GetFootprintName() )
|
||||
return &*fp;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <gal/cairo/cairo_compositor.h>
|
||||
#include <gal/definitions.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <bitmap_base.h>
|
||||
|
||||
#include <limits>
|
||||
|
||||
@@ -347,6 +348,61 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl
|
||||
}
|
||||
|
||||
|
||||
void CAIRO_GAL::DrawBitmap( const BITMAP_BASE& aBitmap )
|
||||
{
|
||||
int ppi = aBitmap.GetPPI();
|
||||
double worldIU_per_mm = 1/(worldUnitLength/2.54)/1000;
|
||||
double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi );
|
||||
int w = aBitmap.GetSizePixels().x;
|
||||
int h = aBitmap.GetSizePixels().y;
|
||||
|
||||
cairo_save( currentContext );
|
||||
|
||||
// Set the pixel scaling factor:
|
||||
cairo_scale( currentContext, pix_size_iu, pix_size_iu );
|
||||
// The position of the bitmap is the bitmap center.
|
||||
// move the draw origin to the top left bitmap corner:
|
||||
cairo_translate( currentContext, -w/2, -h/2 );
|
||||
|
||||
cairo_new_path( currentContext );
|
||||
cairo_surface_t *image;
|
||||
image = cairo_image_surface_create( CAIRO_FORMAT_RGB24, w, h );
|
||||
cairo_surface_flush( image );
|
||||
|
||||
unsigned char* pix_buffer = cairo_image_surface_get_data( image );
|
||||
// The pixel buffer of the initial bitmap:
|
||||
auto bm_pix_buffer = (( BITMAP_BASE&)aBitmap).GetImageData();
|
||||
|
||||
// Copy the source bitmap to the cairo bitmap buffer.
|
||||
// In cairo bitmap buffer, a RGB24 bitmap is a RGB pixel packed into a uint_32
|
||||
// 24 low bits only are used.
|
||||
for( int row = 0; row < h; row++ )
|
||||
{
|
||||
for( int col = 0; col < w; col++ )
|
||||
{
|
||||
// Build the RGB24 pixel:
|
||||
uint32_t pixel = bm_pix_buffer->GetRed( col, row ) << 16;
|
||||
pixel += bm_pix_buffer->GetGreen( col, row ) << 8;
|
||||
pixel += bm_pix_buffer->GetBlue( col, row );
|
||||
|
||||
// Write the pixel to the cairo image buffer:
|
||||
uint32_t* pix_ptr = (uint32_t*) pix_buffer;
|
||||
*pix_ptr = pixel;
|
||||
pix_buffer += 4;
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_mark_dirty( image );
|
||||
cairo_set_source_surface( currentContext, image, 0, 0 );
|
||||
cairo_paint( currentContext );
|
||||
cairo_surface_destroy( image );
|
||||
|
||||
isElementAdded = true;
|
||||
|
||||
cairo_restore( currentContext );
|
||||
}
|
||||
|
||||
|
||||
void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
|
||||
{
|
||||
screenSize = VECTOR2I( aWidth, aHeight );
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <gl_context_mgr.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
#include <text_utils.h>
|
||||
#include <bitmap_base.h>
|
||||
|
||||
#include <macros.h>
|
||||
|
||||
@@ -63,6 +64,101 @@ GLuint OPENGL_GAL::fontTexture = 0;
|
||||
bool OPENGL_GAL::isBitmapFontLoaded = false;
|
||||
SHADER* OPENGL_GAL::shader = NULL;
|
||||
|
||||
namespace KIGFX {
|
||||
class GL_BITMAP_CACHE
|
||||
{
|
||||
public:
|
||||
GL_BITMAP_CACHE()
|
||||
{
|
||||
}
|
||||
|
||||
~GL_BITMAP_CACHE();
|
||||
|
||||
GLuint RequestBitmap( const BITMAP_BASE* aBitmap );
|
||||
|
||||
private:
|
||||
|
||||
struct CACHED_BITMAP
|
||||
{
|
||||
GLuint id;
|
||||
int w, h;
|
||||
};
|
||||
|
||||
GLuint cacheBitmap( const BITMAP_BASE* aBitmap );
|
||||
|
||||
std::map<const BITMAP_BASE*, CACHED_BITMAP> m_bitmaps;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
GL_BITMAP_CACHE::~GL_BITMAP_CACHE()
|
||||
{
|
||||
for ( auto b = m_bitmaps.begin(); b != m_bitmaps.end(); ++b )
|
||||
{
|
||||
glDeleteTextures( 1, &b->second.id );
|
||||
}
|
||||
}
|
||||
|
||||
GLuint GL_BITMAP_CACHE::RequestBitmap( const BITMAP_BASE* aBitmap )
|
||||
{
|
||||
auto it = m_bitmaps.find( aBitmap) ;
|
||||
|
||||
if ( it != m_bitmaps.end() )
|
||||
{
|
||||
return it->second.id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return cacheBitmap( aBitmap );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLuint GL_BITMAP_CACHE::cacheBitmap( const BITMAP_BASE* aBitmap )
|
||||
{
|
||||
CACHED_BITMAP bmp;
|
||||
|
||||
bmp.w = aBitmap->GetSizePixels().x;
|
||||
bmp.h = aBitmap->GetSizePixels().y;
|
||||
|
||||
// There are draw issues (incorrect rendering) with some w values.
|
||||
// It happens when the w value is not a multiple of 4
|
||||
// so we use only a sub image with a modified width
|
||||
bmp.w -= bmp.w % 4;
|
||||
|
||||
GLuint textureID;
|
||||
glGenTextures(1, &textureID);
|
||||
|
||||
uint8_t *buf = new uint8_t [ bmp.w * bmp.h * 3];
|
||||
auto imgData = const_cast<BITMAP_BASE*>( aBitmap )->GetImageData();
|
||||
|
||||
for( int y = 0; y < bmp.h; y++ )
|
||||
{
|
||||
for( int x = 0; x < bmp.w; x++ )
|
||||
{
|
||||
uint8_t *p = buf + ( bmp.w * y + x ) * 3;
|
||||
|
||||
p[0] = imgData->GetRed( x, y );
|
||||
p[1] = imgData->GetGreen( x, y );
|
||||
p[2] = imgData->GetBlue( x, y );
|
||||
}
|
||||
}
|
||||
|
||||
glBindTexture( GL_TEXTURE_2D, textureID );
|
||||
|
||||
glTexImage2D( GL_TEXTURE_2D, 0,GL_RGB, bmp.w, bmp.h, 0, GL_RGB, GL_UNSIGNED_BYTE, buf );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
|
||||
delete [] buf;
|
||||
|
||||
bmp.id = textureID;
|
||||
|
||||
m_bitmaps[ aBitmap ] = bmp;
|
||||
|
||||
return textureID;
|
||||
}
|
||||
|
||||
OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
|
||||
wxEvtHandler* aMouseListener, wxEvtHandler* aPaintListener,
|
||||
@@ -102,6 +198,8 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
|
||||
|
||||
++instanceCounter;
|
||||
|
||||
bitmapCache.reset( new GL_BITMAP_CACHE );
|
||||
|
||||
compositor = new OPENGL_COMPOSITOR;
|
||||
compositor->SetAntialiasingMode( options.gl_antialiasing_mode );
|
||||
|
||||
@@ -222,7 +320,7 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
|
||||
|
||||
void OPENGL_GAL::BeginDrawing()
|
||||
{
|
||||
if( !IsShownOnScreen() )
|
||||
if( !IsShownOnScreen() || GetClientRect().IsEmpty() )
|
||||
return;
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
@@ -393,7 +491,7 @@ void OPENGL_GAL::EndDrawing()
|
||||
|
||||
void OPENGL_GAL::BeginUpdate()
|
||||
{
|
||||
if( !IsShownOnScreen() )
|
||||
if( !IsShownOnScreen() || GetClientRect().IsEmpty() )
|
||||
return;
|
||||
|
||||
if( !isInitialized )
|
||||
@@ -809,10 +907,10 @@ void OPENGL_GAL::drawTriangulatedPolyset( const SHAPE_POLY_SET& aPolySet )
|
||||
{
|
||||
auto triPoly = aPolySet.TriangulatedPolygon( j );
|
||||
|
||||
for( int i = 0; i < triPoly->GetTriangleCount(); i++ )
|
||||
for( size_t i = 0; i < triPoly->GetTriangleCount(); i++ )
|
||||
{
|
||||
VECTOR2I a, b, c;
|
||||
triPoly->GetTriangle( i ,a,b,c);
|
||||
triPoly->GetTriangle( i, a, b, c );
|
||||
currentManager->Vertex( a.x, a.y, layerDepth );
|
||||
currentManager->Vertex( b.x, b.y, layerDepth );
|
||||
currentManager->Vertex( c.x, c.y, layerDepth );
|
||||
@@ -899,6 +997,55 @@ void OPENGL_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aContro
|
||||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::DrawBitmap( const BITMAP_BASE& aBitmap )
|
||||
{
|
||||
int ppi = aBitmap.GetPPI();
|
||||
double worldIU_per_mm = 1.0 / ( worldUnitLength / 2.54 )/ 1000;
|
||||
double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi );
|
||||
|
||||
double w = aBitmap.GetSizePixels().x * pix_size_iu;
|
||||
double h = aBitmap.GetSizePixels().y * pix_size_iu;
|
||||
|
||||
auto xform = currentManager->GetTransformation();
|
||||
|
||||
glm::vec4 v0 = xform * glm::vec4( -w/2, -h/2, 0.0, 0.0 );
|
||||
glm::vec4 v1 = xform * glm::vec4( w/2, h/2, 0.0, 0.0 );
|
||||
glm::vec4 trans = xform[3];
|
||||
|
||||
auto id = bitmapCache->RequestBitmap( &aBitmap );
|
||||
|
||||
auto oldTarget = GetTarget();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslated( trans.x, trans.y, trans.z );
|
||||
|
||||
SetTarget( TARGET_NONCACHED );
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glActiveTexture( GL_TEXTURE0 );
|
||||
glBindTexture( GL_TEXTURE_2D, id );
|
||||
|
||||
glBegin( GL_QUADS );
|
||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
||||
glTexCoord2f(0.0, 0.0);
|
||||
glVertex3f( v0.x, v0.y, layerDepth );
|
||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
||||
glTexCoord2f(1.0, 0.0);
|
||||
glVertex3f( v1.x, v0.y, layerDepth );
|
||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
||||
glTexCoord2f(1.0, 1.0);
|
||||
glVertex3f( v1.x, v1.y, layerDepth );
|
||||
glColor4f(1.0, 1.0, 1.0, 1.0);
|
||||
glTexCoord2f(0.0, 1.0);
|
||||
glVertex3f( v0.x, v1.y, layerDepth );
|
||||
glEnd();
|
||||
|
||||
SetTarget( oldTarget );
|
||||
glBindTexture( GL_TEXTURE_2D, 0 );
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::BitmapText( const wxString& aText, const VECTOR2D& aPosition,
|
||||
double aRotationAngle )
|
||||
{
|
||||
@@ -1288,19 +1435,22 @@ void OPENGL_GAL::EndGroup()
|
||||
|
||||
void OPENGL_GAL::DrawGroup( int aGroupNumber )
|
||||
{
|
||||
cachedManager->DrawItem( *groups[aGroupNumber] );
|
||||
if( groups[aGroupNumber] )
|
||||
cachedManager->DrawItem( *groups[aGroupNumber] );
|
||||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor )
|
||||
{
|
||||
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
|
||||
if( groups[aGroupNumber] )
|
||||
cachedManager->ChangeItemColor( *groups[aGroupNumber], aNewColor );
|
||||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::ChangeGroupDepth( int aGroupNumber, int aDepth )
|
||||
{
|
||||
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
|
||||
if( groups[aGroupNumber] )
|
||||
cachedManager->ChangeItemDepth( *groups[aGroupNumber], aDepth );
|
||||
}
|
||||
|
||||
|
||||
@@ -1313,6 +1463,8 @@ void OPENGL_GAL::DeleteGroup( int aGroupNumber )
|
||||
|
||||
void OPENGL_GAL::ClearCache()
|
||||
{
|
||||
bitmapCache.reset( new GL_BITMAP_CACHE );
|
||||
|
||||
groups.clear();
|
||||
|
||||
if( isInitialized )
|
||||
|
||||
@@ -27,6 +27,25 @@
|
||||
#include <common.h>
|
||||
#include <geometry/shape_line_chain.h>
|
||||
#include <geometry/shape_circle.h>
|
||||
#include "clipper.hpp"
|
||||
|
||||
|
||||
ClipperLib::Path SHAPE_LINE_CHAIN::convertToClipper( bool aRequiredOrientation ) const
|
||||
{
|
||||
ClipperLib::Path c_path;
|
||||
|
||||
for( int i = 0; i < PointCount(); i++ )
|
||||
{
|
||||
const VECTOR2I& vertex = CPoint( i );
|
||||
c_path.push_back( ClipperLib::IntPoint( vertex.x, vertex.y ) );
|
||||
}
|
||||
|
||||
if( Orientation( c_path ) != aRequiredOrientation )
|
||||
ReversePath( c_path );
|
||||
|
||||
return c_path;
|
||||
}
|
||||
|
||||
|
||||
bool SHAPE_LINE_CHAIN::Collide( const VECTOR2I& aP, int aClearance ) const
|
||||
{
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
#include <geometry/shape.h>
|
||||
#include <geometry/shape_line_chain.h>
|
||||
#include <geometry/shape_poly_set.h>
|
||||
|
||||
#include "poly2tri/poly2tri.h"
|
||||
#include <geometry/polygon_triangulation.h>
|
||||
|
||||
using namespace ClipperLib;
|
||||
|
||||
@@ -53,9 +52,18 @@ SHAPE_POLY_SET::SHAPE_POLY_SET() :
|
||||
}
|
||||
|
||||
|
||||
SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther ) :
|
||||
SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther, bool aDeepCopy ) :
|
||||
SHAPE( SH_POLY_SET ), m_polys( aOther.m_polys )
|
||||
{
|
||||
if( aOther.IsTriangulationUpToDate() )
|
||||
{
|
||||
for( unsigned i = 0; i < aOther.TriangulatedPolyCount(); i++ )
|
||||
m_triangulatedPolys.push_back(
|
||||
std::make_unique<TRIANGULATED_POLYGON>( *aOther.TriangulatedPolygon( i ) ) );
|
||||
|
||||
m_hash = aOther.GetHash();
|
||||
m_triangulationValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -456,62 +464,10 @@ int SHAPE_POLY_SET::AddHole( const SHAPE_LINE_CHAIN& aHole, int aOutline )
|
||||
}
|
||||
|
||||
|
||||
const Path SHAPE_POLY_SET::convertToClipper( const SHAPE_LINE_CHAIN& aPath,
|
||||
bool aRequiredOrientation )
|
||||
{
|
||||
Path c_path;
|
||||
|
||||
for( int i = 0; i < aPath.PointCount(); i++ )
|
||||
{
|
||||
const VECTOR2I& vertex = aPath.CPoint( i );
|
||||
c_path.push_back( IntPoint( vertex.x, vertex.y ) );
|
||||
}
|
||||
|
||||
if( Orientation( c_path ) != aRequiredOrientation )
|
||||
ReversePath( c_path );
|
||||
|
||||
return c_path;
|
||||
}
|
||||
|
||||
|
||||
const SHAPE_LINE_CHAIN SHAPE_POLY_SET::convertFromClipper( const Path& aPath )
|
||||
{
|
||||
SHAPE_LINE_CHAIN lc;
|
||||
|
||||
for( unsigned int i = 0; i < aPath.size(); i++ )
|
||||
lc.Append( aPath[i].X, aPath[i].Y );
|
||||
|
||||
lc.SetClosed( true );
|
||||
|
||||
return lc;
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET& aOtherShape,
|
||||
POLYGON_MODE aFastMode )
|
||||
{
|
||||
Clipper c;
|
||||
|
||||
if( aFastMode == PM_STRICTLY_SIMPLE )
|
||||
c.StrictlySimple( true );
|
||||
|
||||
for( const POLYGON& poly : m_polys )
|
||||
{
|
||||
for( unsigned int i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
|
||||
}
|
||||
|
||||
for( const POLYGON& poly : aOtherShape.m_polys )
|
||||
{
|
||||
for( unsigned int i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
|
||||
}
|
||||
|
||||
PolyTree solution;
|
||||
|
||||
c.Execute( aType, solution, pftNonZero, pftNonZero );
|
||||
|
||||
importTree( &solution );
|
||||
booleanOp( aType, *this, aOtherShape, aFastMode );
|
||||
}
|
||||
|
||||
|
||||
@@ -522,19 +478,18 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType,
|
||||
{
|
||||
Clipper c;
|
||||
|
||||
if( aFastMode == PM_STRICTLY_SIMPLE )
|
||||
c.StrictlySimple( true );
|
||||
c.StrictlySimple( aFastMode == PM_STRICTLY_SIMPLE );
|
||||
|
||||
for( const POLYGON& poly : aShape.m_polys )
|
||||
for( auto poly : aShape.m_polys )
|
||||
{
|
||||
for( unsigned int i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptSubject, true );
|
||||
for( size_t i = 0 ; i < poly.size(); i++ )
|
||||
c.AddPath( poly[i].convertToClipper( i == 0 ), ptSubject, true );
|
||||
}
|
||||
|
||||
for( const POLYGON& poly : aOtherShape.m_polys )
|
||||
for( auto poly : aOtherShape.m_polys )
|
||||
{
|
||||
for( unsigned int i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), ptClip, true );
|
||||
for( size_t i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( poly[i].convertToClipper( i == 0 ), ptClip, true );
|
||||
}
|
||||
|
||||
PolyTree solution;
|
||||
@@ -599,9 +554,8 @@ void SHAPE_POLY_SET::Inflate( int aFactor, int aCircleSegmentsCount )
|
||||
|
||||
for( const POLYGON& poly : m_polys )
|
||||
{
|
||||
for( unsigned int i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( convertToClipper( poly[i], i > 0 ? false : true ), jtRound,
|
||||
etClosedPolygon );
|
||||
for( size_t i = 0; i < poly.size(); i++ )
|
||||
c.AddPath( poly[i].convertToClipper( i == 0 ), jtRound, etClosedPolygon );
|
||||
}
|
||||
|
||||
PolyTree solution;
|
||||
@@ -644,10 +598,10 @@ void SHAPE_POLY_SET::importTree( PolyTree* tree )
|
||||
{
|
||||
POLYGON paths;
|
||||
paths.reserve( n->Childs.size() + 1 );
|
||||
paths.push_back( convertFromClipper( n->Contour ) );
|
||||
paths.push_back( n->Contour );
|
||||
|
||||
for( unsigned int i = 0; i < n->Childs.size(); i++ )
|
||||
paths.push_back( convertFromClipper( n->Childs[i]->Contour ) );
|
||||
paths.push_back( n->Childs[i]->Contour );
|
||||
|
||||
m_polys.push_back( paths );
|
||||
}
|
||||
@@ -1862,164 +1816,6 @@ SHAPE_POLY_SET &SHAPE_POLY_SET::operator=( const SHAPE_POLY_SET& aOther )
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
class SHAPE_POLY_SET::TRIANGULATION_CONTEXT
|
||||
{
|
||||
public:
|
||||
|
||||
TRIANGULATION_CONTEXT( TRIANGULATED_POLYGON* aResultPoly ) :
|
||||
m_triPoly( aResultPoly )
|
||||
{
|
||||
}
|
||||
|
||||
void AddOutline( const SHAPE_LINE_CHAIN& outl, bool aIsHole = false )
|
||||
{
|
||||
m_points.reserve( outl.PointCount() );
|
||||
m_points.clear();
|
||||
|
||||
for( int i = 0; i < outl.PointCount(); i++ )
|
||||
{
|
||||
m_points.push_back( addPoint( outl.CPoint( i ) ) );
|
||||
}
|
||||
|
||||
if ( aIsHole )
|
||||
m_cdt->AddHole( m_points );
|
||||
else
|
||||
m_cdt.reset( new p2t::CDT( m_points ) );
|
||||
}
|
||||
|
||||
void Triangulate()
|
||||
{
|
||||
m_cdt->Triangulate();
|
||||
|
||||
m_triPoly->AllocateTriangles( m_cdt->GetTriangles().size() );
|
||||
|
||||
int i = 0;
|
||||
|
||||
for( auto tri : m_cdt->GetTriangles() )
|
||||
{
|
||||
TRIANGULATED_POLYGON::TRI t;
|
||||
|
||||
t.a = tri->GetPoint( 0 )->id;
|
||||
t.b = tri->GetPoint( 1 )->id;
|
||||
t.c = tri->GetPoint( 2 )->id;
|
||||
|
||||
m_triPoly->SetTriangle(i, t);
|
||||
i++;
|
||||
}
|
||||
|
||||
for( auto p : m_uniquePoints )
|
||||
delete p;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
class comparePoints
|
||||
{
|
||||
public:
|
||||
bool operator()( p2t::Point* a, p2t::Point* b ) const
|
||||
{
|
||||
if (a->x < b->x)
|
||||
return true;
|
||||
|
||||
if( a->x == b->x )
|
||||
return ( a->y > b->y );
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
p2t::Point* addPoint( const VECTOR2I& aP )
|
||||
{
|
||||
p2t::Point check( aP.x, aP.y );
|
||||
auto it = m_uniquePoints.find( &check );
|
||||
|
||||
if( it != m_uniquePoints.end() )
|
||||
{
|
||||
return *it;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto lastId = m_triPoly->GetVertexCount();
|
||||
auto p = new p2t::Point( aP.x, aP.y, lastId );
|
||||
m_triPoly->AddVertex( aP );
|
||||
m_uniquePoints.insert ( p );
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
typedef std::set<p2t::Point*, comparePoints> P2T_SET;
|
||||
typedef std::vector<p2t::Point*> P2T_VEC;
|
||||
|
||||
P2T_VEC m_points;
|
||||
P2T_SET m_uniquePoints;
|
||||
TRIANGULATED_POLYGON *m_triPoly;
|
||||
std::unique_ptr<p2t::CDT> m_cdt;
|
||||
};
|
||||
|
||||
SHAPE_POLY_SET::TRIANGULATED_POLYGON::~TRIANGULATED_POLYGON()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::Clear()
|
||||
{
|
||||
if( m_vertices )
|
||||
delete[] m_vertices;
|
||||
|
||||
if( m_triangles )
|
||||
delete[] m_triangles;
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AllocateVertices( int aSize )
|
||||
{
|
||||
m_vertices = new VECTOR2I[aSize];
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::TRIANGULATED_POLYGON::AllocateTriangles( int aSize )
|
||||
{
|
||||
m_triangles = new TRI[aSize];
|
||||
m_triangleCount = aSize;
|
||||
}
|
||||
|
||||
|
||||
static int totalVertexCount( const SHAPE_POLY_SET::POLYGON& aPoly )
|
||||
{
|
||||
int cnt = 0;
|
||||
|
||||
for( const auto& outl : aPoly )
|
||||
{
|
||||
cnt += outl.PointCount();
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
void SHAPE_POLY_SET::triangulateSingle( const POLYGON& aPoly,
|
||||
SHAPE_POLY_SET::TRIANGULATED_POLYGON& aResult )
|
||||
{
|
||||
if( aPoly.size() == 0 )
|
||||
return;
|
||||
|
||||
TRIANGULATION_CONTEXT ctx ( &aResult );
|
||||
|
||||
aResult.AllocateVertices( totalVertexCount( aPoly ) );
|
||||
ctx.AddOutline( aPoly[0], false );
|
||||
|
||||
for( unsigned i = 1; i < aPoly.size(); i++ )
|
||||
{
|
||||
ctx.AddOutline( aPoly[i], true ); // add holes
|
||||
}
|
||||
|
||||
ctx.Triangulate();
|
||||
}
|
||||
|
||||
|
||||
MD5_HASH SHAPE_POLY_SET::GetHash() const
|
||||
{
|
||||
if( !m_hash.IsValid() )
|
||||
@@ -2067,22 +1863,17 @@ void SHAPE_POLY_SET::CacheTriangulation()
|
||||
|
||||
SHAPE_POLY_SET tmpSet = *this;
|
||||
|
||||
if( !tmpSet.HasHoles() )
|
||||
tmpSet.Unfracture( PM_FAST );
|
||||
if( tmpSet.HasHoles() )
|
||||
tmpSet.Fracture( PM_FAST );
|
||||
|
||||
m_triangulatedPolys.clear();
|
||||
|
||||
if( tmpSet.HasTouchingHoles() )
|
||||
{
|
||||
// temporary workaround for overlapping hole vertices that poly2tri doesn't handle
|
||||
m_triangulationValid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
for( int i = 0; i < tmpSet.OutlineCount(); i++ )
|
||||
{
|
||||
m_triangulatedPolys.push_back( std::make_unique<TRIANGULATED_POLYGON>() );
|
||||
triangulateSingle( tmpSet.Polygon( i ), *m_triangulatedPolys.back() );
|
||||
PolygonTriangulation tess( *m_triangulatedPolys.back() );
|
||||
|
||||
tess.TesselatePolygon( tmpSet.Polygon( i ).front() );
|
||||
}
|
||||
|
||||
m_triangulationValid = true;
|
||||
@@ -2134,20 +1925,20 @@ bool SHAPE_POLY_SET::HasTouchingHoles() const
|
||||
|
||||
bool SHAPE_POLY_SET::hasTouchingHoles( const POLYGON& aPoly ) const
|
||||
{
|
||||
std::vector< VECTOR2I > pts;
|
||||
std::set< long long > ptHashes;
|
||||
|
||||
for( const auto& lc : aPoly )
|
||||
{
|
||||
for( int i = 0; i < lc.PointCount(); i++ )
|
||||
for( const VECTOR2I& pt : lc.CPoints() )
|
||||
{
|
||||
const auto p = lc.CPoint( i );
|
||||
const long long ptHash = (long long) pt.x << 32 | pt.y;
|
||||
|
||||
if( std::find( pts.begin(), pts.end(), p ) != pts.end() )
|
||||
if( ptHashes.count( ptHash ) > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
pts.push_back( p );
|
||||
ptHashes.insert( ptHash );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -358,7 +358,7 @@ bool OpenPDF( const wxString& file )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxLaunchDefaultApplication( file ) )
|
||||
if( wxLaunchDefaultApplication( filename ) )
|
||||
return true;
|
||||
|
||||
// If launching the system default PDF viewer fails, fall through with empty command
|
||||
|
||||
+15
-11
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, j-p.charras at wanadoo.fr
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2010-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -94,6 +94,7 @@ struct hotkey_name_descr
|
||||
* "Space","Ctrl+Space","Alt+Space" or
|
||||
* "Alt+A","Ctrl+F1", ...
|
||||
*/
|
||||
#define KEY_NON_FOUND -1
|
||||
static struct hotkey_name_descr hotkeyNameList[] =
|
||||
{
|
||||
{ wxT( "F1" ), WXK_F1 },
|
||||
@@ -112,7 +113,7 @@ static struct hotkey_name_descr hotkeyNameList[] =
|
||||
{ wxT( "Esc" ), WXK_ESCAPE },
|
||||
{ wxT( "Del" ), WXK_DELETE },
|
||||
{ wxT( "Tab" ), WXK_TAB },
|
||||
{ wxT( "BkSp" ), WXK_BACK },
|
||||
{ wxT( "Back" ), WXK_BACK },
|
||||
{ wxT( "Ins" ), WXK_INSERT },
|
||||
|
||||
{ wxT( "Home" ), WXK_HOME },
|
||||
@@ -129,8 +130,10 @@ static struct hotkey_name_descr hotkeyNameList[] =
|
||||
|
||||
{ wxT( "Space" ), WXK_SPACE },
|
||||
|
||||
{ wxT( "<unassigned>" ), 0 },
|
||||
|
||||
// Do not change this line: end of list
|
||||
{ wxT( "" ), 0 }
|
||||
{ wxT( "" ), KEY_NON_FOUND }
|
||||
};
|
||||
|
||||
// name of modifier keys.
|
||||
@@ -169,9 +172,6 @@ wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
|
||||
bool found = false;
|
||||
|
||||
// Assume keycode of 0 is "unassigned"
|
||||
if( aKeycode == 0 )
|
||||
return wxT( "<unassigned>");
|
||||
|
||||
if( (aKeycode & GR_KB_CTRL) != 0 )
|
||||
modifier << MODIFIER_CTRL;
|
||||
|
||||
@@ -192,7 +192,7 @@ wxString KeyNameFromKeyCode( int aKeycode, bool* aIsFound )
|
||||
{
|
||||
for( ii = 0; ; ii++ )
|
||||
{
|
||||
if( hotkeyNameList[ii].m_KeyCode == 0 ) // End of list
|
||||
if( hotkeyNameList[ii].m_KeyCode == KEY_NON_FOUND ) // End of list
|
||||
{
|
||||
keyname = wxT( "<unknown>" );
|
||||
break;
|
||||
@@ -377,7 +377,7 @@ wxString KeyNameFromCommandId( EDA_HOTKEY** aList, int aCommandId )
|
||||
*/
|
||||
int KeyCodeFromKeyName( const wxString& keyname )
|
||||
{
|
||||
int ii, keycode = 0;
|
||||
int ii, keycode = KEY_NON_FOUND;
|
||||
|
||||
// Search for modifiers: Ctrl+ Alt+ and Shift+
|
||||
// Note: on Mac OSX, the Cmd key is equiv here to Ctrl
|
||||
@@ -425,7 +425,7 @@ int KeyCodeFromKeyName( const wxString& keyname )
|
||||
return keycode;
|
||||
}
|
||||
|
||||
for( ii = 0; hotkeyNameList[ii].m_KeyCode != 0; ii++ )
|
||||
for( ii = 0; hotkeyNameList[ii].m_KeyCode != KEY_NON_FOUND; ii++ )
|
||||
{
|
||||
if( key.CmpNoCase( hotkeyNameList[ii].m_Name ) == 0 )
|
||||
{
|
||||
@@ -734,7 +734,11 @@ void ParseHotkeyConfig( const wxString& data,
|
||||
|
||||
if( hk_decr->m_InfoMsg == fctname )
|
||||
{
|
||||
hk_decr->m_KeyCode = KeyCodeFromKeyName( keyname );
|
||||
int keycode = KeyCodeFromKeyName( keyname );
|
||||
|
||||
if( keycode != KEY_NON_FOUND ) // means the key name is found in list or unassigned
|
||||
hk_decr->m_KeyCode = keycode;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+28
-47
@@ -119,7 +119,7 @@ void LIB_ID::clear()
|
||||
}
|
||||
|
||||
|
||||
int LIB_ID::Parse( const UTF8& aId )
|
||||
int LIB_ID::Parse( const UTF8& aId, LIB_ID_TYPE aType, bool aFix )
|
||||
{
|
||||
clear();
|
||||
|
||||
@@ -127,7 +127,7 @@ int LIB_ID::Parse( const UTF8& aId )
|
||||
const char* rev = EndsWithRev( buffer, buffer+aId.length(), '/' );
|
||||
size_t revNdx;
|
||||
size_t partNdx;
|
||||
int offset;
|
||||
int offset = -1;
|
||||
|
||||
//=====<revision>=========================================
|
||||
// in a LIB_ID like discret:R3/rev4
|
||||
@@ -150,9 +150,7 @@ int LIB_ID::Parse( const UTF8& aId )
|
||||
offset = SetLibNickname( aId.substr( 0, partNdx ) );
|
||||
|
||||
if( offset > -1 )
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
++partNdx; // skip ':'
|
||||
}
|
||||
@@ -165,48 +163,24 @@ int LIB_ID::Parse( const UTF8& aId )
|
||||
if( partNdx >= revNdx )
|
||||
return partNdx; // Error: no library item name.
|
||||
|
||||
UTF8 fpname = aId.substr( partNdx, revNdx-partNdx );
|
||||
|
||||
// Be sure the item name is valid.
|
||||
// Some chars can be found in legacy files converted files from other EDA tools.
|
||||
std::string fpname = aId.substr( partNdx, revNdx-partNdx );
|
||||
ReplaceIllegalFileNameChars( &fpname, '_' );
|
||||
SetLibItemName( UTF8( fpname ) );
|
||||
if( aFix )
|
||||
fpname = FixIllegalChars( fpname, aType, false );
|
||||
else
|
||||
offset = HasIllegalChars( fpname, aType );
|
||||
|
||||
if( offset > -1 )
|
||||
return offset;
|
||||
|
||||
SetLibItemName( fpname );
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
LIB_ID::LIB_ID( const UTF8& aId )
|
||||
{
|
||||
int offset = Parse( aId );
|
||||
|
||||
if( offset != -1 )
|
||||
{
|
||||
THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
|
||||
wxString::FromUTF8( aId.c_str() ),
|
||||
aId.c_str(),
|
||||
0,
|
||||
offset );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIB_ID::LIB_ID( const wxString& aId )
|
||||
{
|
||||
UTF8 id = aId;
|
||||
|
||||
int offset = Parse( id );
|
||||
|
||||
if( offset != -1 )
|
||||
{
|
||||
THROW_PARSE_ERROR( _( "Illegal character found in LIB_ID string" ),
|
||||
aId,
|
||||
id.c_str(),
|
||||
0,
|
||||
offset );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIB_ID::LIB_ID( const wxString& aLibName, const wxString& aLibItemName,
|
||||
const wxString& aRevision ) :
|
||||
nickname( aLibName ),
|
||||
@@ -359,15 +333,19 @@ int LIB_ID::compare( const LIB_ID& aLibId ) const
|
||||
}
|
||||
|
||||
|
||||
bool LIB_ID::HasIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType )
|
||||
int LIB_ID::HasIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType )
|
||||
{
|
||||
int offset = 0;
|
||||
|
||||
for( auto ch : aLibItemName )
|
||||
{
|
||||
if( !isLegalChar( ch, aType ) )
|
||||
return true;
|
||||
return offset;
|
||||
else
|
||||
++offset;
|
||||
}
|
||||
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -390,20 +368,23 @@ UTF8 LIB_ID::FixIllegalChars( const UTF8& aLibItemName, LIB_ID_TYPE aType, bool
|
||||
|
||||
bool LIB_ID::isLegalChar( unsigned aUniChar, LIB_ID_TYPE aType )
|
||||
{
|
||||
bool const colon_allowed = ( aType == ID_ALIAS );
|
||||
bool const space_allowed = ( aType != ID_SCH );
|
||||
bool const space_allowed = ( aType == ID_PCB );
|
||||
bool const illegal_filename_chars_allowed = ( aType == ID_SCH );
|
||||
|
||||
if( aUniChar < ' ' )
|
||||
return false;
|
||||
|
||||
switch( aUniChar )
|
||||
{
|
||||
case ':':
|
||||
case '/':
|
||||
case '\\':
|
||||
return false;
|
||||
|
||||
case ':':
|
||||
return colon_allowed;
|
||||
case '\\':
|
||||
case '<':
|
||||
case '>':
|
||||
case '"':
|
||||
return illegal_filename_chars_allowed;
|
||||
|
||||
case ' ':
|
||||
return space_allowed;
|
||||
|
||||
@@ -53,15 +53,7 @@ ORIGIN_VIEWITEM* ORIGIN_VIEWITEM::Clone() const
|
||||
const BOX2I ORIGIN_VIEWITEM::ViewBBox() const
|
||||
{
|
||||
BOX2I bbox;
|
||||
|
||||
// The origin item doesn't have a fixed size. It is constant on the screen but
|
||||
// changes the effective BBox size based on the zoom level.
|
||||
// But we can't simply set it to the maximum size as this causes a splitting degeneracy
|
||||
// when compiling for Debian i386. By modestly adjusting the bbox, we avoid the degeneracy
|
||||
// while keeping the origin visible at all zoom levels
|
||||
bbox.SetSize( VECTOR2I( INT_MAX - 2, INT_MAX - 2 ) );
|
||||
bbox.SetOrigin( VECTOR2I( INT_MIN / 2 + 1, INT_MIN / 2 + 1 ) );
|
||||
|
||||
bbox.SetMaximum();
|
||||
return bbox;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -237,7 +237,7 @@ static LANGUAGE_DESCR s_Languages[] =
|
||||
{
|
||||
wxLANGUAGE_CHINESE_SIMPLIFIED,
|
||||
ID_LANGUAGE_CHINESE_SIMPLIFIED,
|
||||
lang_chinese_xpm,
|
||||
lang_zh_xpm,
|
||||
_( "Chinese simplified" )
|
||||
},
|
||||
|
||||
@@ -831,7 +831,7 @@ bool PGM_BASE::SetLanguage( bool first_time )
|
||||
if( result != dtst )
|
||||
// string to double encode/decode does not work! Bug detected:
|
||||
// Disable floating point localization:
|
||||
setlocale( LC_ALL, "C" );
|
||||
setlocale( LC_NUMERIC, "C" );
|
||||
|
||||
if( !m_locale->IsLoaded( dictionaryName ) )
|
||||
m_locale->AddCatalog( dictionaryName );
|
||||
|
||||
@@ -135,6 +135,13 @@ typedef long time_t;
|
||||
#include <geometry/shape.h>
|
||||
%include <geometry/shape.h>
|
||||
|
||||
// Contains VECTOR2I
|
||||
%include math.i
|
||||
|
||||
%ignore SHAPE_LINE_CHAIN::convertFromClipper;
|
||||
#include <geometry/shape_line_chain.h>
|
||||
%include <geometry/shape_line_chain.h>
|
||||
|
||||
#include <geometry/shape_poly_set.h>
|
||||
%include <geometry/shape_poly_set.h>
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* 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 2
|
||||
* 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, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file math.i
|
||||
* @brief wrappers for math helper classes
|
||||
*/
|
||||
|
||||
%ignore VECTOR2<int>::ECOORD_MAX;
|
||||
%ignore VECTOR2<int>::ECOORD_MIN;
|
||||
|
||||
#include <math/vector2d.h>
|
||||
%include <math/vector2d.h>
|
||||
%template(VECTOR2I) VECTOR2<int>;
|
||||
@@ -399,6 +399,32 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
|
||||
key += 'A' - 1;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
if( mods & MD_ALT )
|
||||
{
|
||||
// OSX maps a bunch of commonly used extended-ASCII characters onto the keyboard
|
||||
// using the ALT key. Since we use ALT for some of our hotkeys, we need to map back
|
||||
// to the underlying keys. The kVK_ANSI_* values come from Apple and are said to be
|
||||
// hardware independant.
|
||||
switch( ke->GetRawKeyCode() )
|
||||
{
|
||||
case /* kVK_ANSI_1 */ 0x12: key = '1'; break;
|
||||
case /* kVK_ANSI_2 */ 0x13: key = '2'; break;
|
||||
case /* kVK_ANSI_3 */ 0x14: key = '3'; break;
|
||||
case /* kVK_ANSI_4 */ 0x15: key = '4'; break;
|
||||
case /* kVK_ANSI_6 */ 0x16: key = '6'; break;
|
||||
case /* kVK_ANSI_5 */ 0x17: key = '5'; break;
|
||||
case /* kVK_ANSI_Equal */ 0x18: key = '='; break;
|
||||
case /* kVK_ANSI_9 */ 0x19: key = '9'; break;
|
||||
case /* kVK_ANSI_7 */ 0x1A: key = '7'; break;
|
||||
case /* kVK_ANSI_Minus */ 0x1B: key = '-'; break;
|
||||
case /* kVK_ANSI_8 */ 0x1C: key = '8'; break;
|
||||
case /* kVK_ANSI_0 */ 0x1D: key = '0'; break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if( key == WXK_ESCAPE ) // ESC is the special key for canceling tools
|
||||
evt = TOOL_EVENT( TC_COMMAND, TA_CANCEL_TOOL );
|
||||
else
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
using namespace KIGFX;
|
||||
|
||||
VIEW_GROUP::VIEW_GROUP( VIEW* aView ) :
|
||||
m_layer( LAYER_GP_OVERLAY )
|
||||
m_layer( LAYER_SELECT_OVERLAY )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -100,10 +100,10 @@ const BOX2I VIEW_GROUP::ViewBBox() const
|
||||
|
||||
void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
|
||||
{
|
||||
auto gal = aView->GetGAL();
|
||||
PAINTER* painter = aView->GetPainter();
|
||||
|
||||
const auto drawList = updateDrawList();
|
||||
KIGFX::GAL* gal = aView->GetGAL();
|
||||
PAINTER* painter = aView->GetPainter();
|
||||
bool isSelection = m_layer == LAYER_SELECT_OVERLAY;
|
||||
const auto drawList = updateDrawList();
|
||||
|
||||
std::unordered_map<int, std::vector<VIEW_ITEM*>> layer_item_map;
|
||||
|
||||
@@ -140,7 +140,25 @@ void VIEW_GROUP::ViewDraw( int aLayer, VIEW* aView ) const
|
||||
|
||||
for( int i = 0; i < layers_count; i++ )
|
||||
{
|
||||
if( aView->IsLayerVisible( layers[i] ) )
|
||||
int layer = layers[i];
|
||||
bool draw = aView->IsLayerVisible( layer );
|
||||
|
||||
if( isSelection )
|
||||
{
|
||||
switch( layer )
|
||||
{
|
||||
case LAYER_PADS_TH:
|
||||
case LAYER_PADS_PLATEDHOLES:
|
||||
case LAYER_PAD_FR:
|
||||
case LAYER_PAD_BK:
|
||||
draw = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( draw )
|
||||
{
|
||||
gal->AdvanceDepth();
|
||||
|
||||
|
||||
@@ -253,6 +253,18 @@ WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::GetSelHKClientData()
|
||||
}
|
||||
|
||||
|
||||
WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getExpectedHkClientData( wxTreeListItem aItem )
|
||||
{
|
||||
const auto hkdata = GetHKClientData( aItem );
|
||||
|
||||
// This probably means a hotkey-only action is being attempted on
|
||||
// a row that is not a hotkey (like a section heading)
|
||||
wxASSERT_MSG( hkdata != nullptr, "No hotkey data found for list item" );
|
||||
|
||||
return hkdata;
|
||||
}
|
||||
|
||||
|
||||
void WIDGET_HOTKEY_LIST::UpdateFromClientData()
|
||||
{
|
||||
for( wxTreeListItem i = GetFirstItem(); i.IsOk(); i = GetNextItem( i ) )
|
||||
@@ -285,13 +297,10 @@ void WIDGET_HOTKEY_LIST::LoadSection( EDA_HOTKEY_CONFIG* aSection )
|
||||
|
||||
void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
|
||||
|
||||
if( !hkdata )
|
||||
{
|
||||
// Activated item was not a hotkey row
|
||||
return;
|
||||
}
|
||||
|
||||
wxString name = GetItemText( aItem, 0 );
|
||||
wxString current_key = GetItemText( aItem, 1 );
|
||||
@@ -299,7 +308,7 @@ void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
|
||||
wxKeyEvent key_event = HK_PROMPT_DIALOG::PromptForKey( GetParent(), name, current_key );
|
||||
long key = MapKeypressToKeycode( key_event );
|
||||
|
||||
if( hkdata && key )
|
||||
if( key )
|
||||
{
|
||||
// See if this key code is handled in hotkeys names list
|
||||
bool exists;
|
||||
@@ -327,7 +336,11 @@ void WIDGET_HOTKEY_LIST::EditItem( wxTreeListItem aItem )
|
||||
|
||||
void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
|
||||
|
||||
if( !hkdata )
|
||||
return;
|
||||
|
||||
EDA_HOTKEY* hk = &hkdata->GetHotkey();
|
||||
|
||||
for( size_t sec_index = 0; sec_index < m_sections.size(); ++sec_index )
|
||||
@@ -356,9 +369,14 @@ void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem )
|
||||
|
||||
void WIDGET_HOTKEY_LIST::ResetItemToDefault( wxTreeListItem aItem )
|
||||
{
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( aItem );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem );
|
||||
|
||||
if( !hkdata )
|
||||
return;
|
||||
|
||||
EDA_HOTKEY* hk = &hkdata->GetHotkey();
|
||||
hk->ResetKeyCodeToDefault();
|
||||
|
||||
UpdateFromClientData();
|
||||
}
|
||||
|
||||
@@ -376,10 +394,17 @@ void WIDGET_HOTKEY_LIST::OnContextMenu( wxTreeListEvent& aEvent )
|
||||
|
||||
wxMenu menu;
|
||||
|
||||
menu.Append( ID_EDIT, _( "Edit..." ) );
|
||||
menu.Append( ID_RESET, _( "Undo Changes" ) );
|
||||
menu.Append( ID_DEFAULT, _( "Restore Default" ) );
|
||||
menu.Append( wxID_SEPARATOR );
|
||||
WIDGET_HOTKEY_CLIENT_DATA* hkdata = GetHKClientData( m_context_menu_item );
|
||||
|
||||
// Some actions only apply if the row is hotkey data
|
||||
if( hkdata )
|
||||
{
|
||||
menu.Append( ID_EDIT, _( "Edit..." ) );
|
||||
menu.Append( ID_RESET, _( "Undo Changes" ) );
|
||||
menu.Append( ID_DEFAULT, _( "Restore Default" ) );
|
||||
menu.Append( wxID_SEPARATOR );
|
||||
}
|
||||
|
||||
menu.Append( ID_RESET_ALL, _( "Undo All Changes" ) );
|
||||
menu.Append( ID_DEFAULT_ALL, _( "Restore All to Default" ) );
|
||||
|
||||
|
||||
@@ -68,40 +68,40 @@ static wxString FormatWildcardExt( const wxString& aWildcard )
|
||||
}
|
||||
|
||||
|
||||
const wxString SchematicSymbolFileExtension( "sym" );
|
||||
const wxString SchematicLibraryFileExtension( "lib" );
|
||||
const wxString SchematicBackupFileExtension( "bak" );
|
||||
const std::string SchematicSymbolFileExtension( "sym" );
|
||||
const std::string SchematicLibraryFileExtension( "lib" );
|
||||
const std::string SchematicBackupFileExtension( "bak" );
|
||||
|
||||
const wxString VrmlFileExtension( "wrl" );
|
||||
const std::string VrmlFileExtension( "wrl" );
|
||||
|
||||
const wxString ProjectFileExtension( "pro" );
|
||||
const wxString SchematicFileExtension( "sch" );
|
||||
const wxString NetlistFileExtension( "net" );
|
||||
const wxString ComponentFileExtension( "cmp" );
|
||||
const wxString GerberFileExtension( "gbr" );
|
||||
const wxString GerberJobFileExtension( "gbrjob" );
|
||||
const wxString HtmlFileExtension( wxT( "html" ) );
|
||||
const std::string ProjectFileExtension( "pro" );
|
||||
const std::string SchematicFileExtension( "sch" );
|
||||
const std::string NetlistFileExtension( "net" );
|
||||
const std::string ComponentFileExtension( "cmp" );
|
||||
const std::string GerberFileExtension( "gbr" );
|
||||
const std::string GerberJobFileExtension( "gbrjob" );
|
||||
const std::string HtmlFileExtension( "html" );
|
||||
|
||||
const wxString LegacyPcbFileExtension( "brd" );
|
||||
const wxString KiCadPcbFileExtension( "kicad_pcb" );
|
||||
const wxString PageLayoutDescrFileExtension( "kicad_wks" );
|
||||
const std::string LegacyPcbFileExtension( "brd" );
|
||||
const std::string KiCadPcbFileExtension( "kicad_pcb" );
|
||||
const std::string PageLayoutDescrFileExtension( "kicad_wks" );
|
||||
|
||||
const wxString PdfFileExtension( "pdf" );
|
||||
const wxString MacrosFileExtension( "mcr" );
|
||||
const wxString DrillFileExtension( "drl" );
|
||||
const wxString SVGFileExtension( "svg" );
|
||||
const wxString ReportFileExtension( "rpt" );
|
||||
const wxString FootprintPlaceFileExtension( "pos" );
|
||||
const wxString KiCadLib3DShapesPathExtension( "3dshapes" ); ///< 3D shapes default libpath
|
||||
const std::string PdfFileExtension( "pdf" );
|
||||
const std::string MacrosFileExtension( "mcr" );
|
||||
const std::string DrillFileExtension( "drl" );
|
||||
const std::string SVGFileExtension( "svg" );
|
||||
const std::string ReportFileExtension( "rpt" );
|
||||
const std::string FootprintPlaceFileExtension( "pos" );
|
||||
const std::string KiCadLib3DShapesPathExtension( "3dshapes" ); ///< 3D shapes default libpath
|
||||
|
||||
const wxString KiCadFootprintLibPathExtension( "pretty" ); ///< KICAD PLUGIN libpath
|
||||
const wxString LegacyFootprintLibPathExtension( "mod" );
|
||||
const wxString EagleFootprintLibPathExtension( "lbr" );
|
||||
const std::string KiCadFootprintLibPathExtension( "pretty" ); ///< KICAD PLUGIN libpath
|
||||
const std::string LegacyFootprintLibPathExtension( "mod" );
|
||||
const std::string EagleFootprintLibPathExtension( "lbr" );
|
||||
|
||||
const wxString KiCadFootprintFileExtension( "kicad_mod" );
|
||||
const wxString GedaPcbFootprintLibFileExtension( "fp" );
|
||||
const wxString SpecctraDsnFileExtension( "dsn" );
|
||||
const wxString IpcD356FileExtension( "d356" );
|
||||
const std::string KiCadFootprintFileExtension( "kicad_mod" );
|
||||
const std::string GedaPcbFootprintLibFileExtension( "fp" );
|
||||
const std::string SpecctraDsnFileExtension( "dsn" );
|
||||
const std::string IpcD356FileExtension( "d356" );
|
||||
|
||||
|
||||
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <worksheet_viewitem.h>
|
||||
#include <worksheet_shape_builder.h>
|
||||
#include <worksheet_dataitem.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <painter.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
@@ -119,6 +120,7 @@ void WORKSHEET_VIEWITEM::ViewDraw( int aLayer, VIEW* aView ) const
|
||||
break;
|
||||
|
||||
case WS_DRAW_ITEM_BASE::wsg_bitmap:
|
||||
draw( static_cast<const WS_DRAW_ITEM_BITMAP*>( item ), gal );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -198,6 +200,17 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
|
||||
}
|
||||
|
||||
|
||||
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_BITMAP* aItem, GAL* aGal ) const
|
||||
{
|
||||
aGal->Save();
|
||||
VECTOR2D position = aItem->GetPosition();
|
||||
aGal->Translate( position );
|
||||
WORKSHEET_DATAITEM_BITMAP* parent = static_cast<WORKSHEET_DATAITEM_BITMAP*>( aItem->GetParent() );
|
||||
aGal->DrawBitmap( *parent->m_ImageBitmap );
|
||||
aGal->Restore();
|
||||
}
|
||||
|
||||
|
||||
void WORKSHEET_VIEWITEM::drawBorder( GAL* aGal ) const
|
||||
{
|
||||
VECTOR2D origin = VECTOR2D( 0.0, 0.0 );
|
||||
|
||||
@@ -149,7 +149,6 @@ target_link_libraries( cvpcb_kiface
|
||||
gal
|
||||
${wxWidgets_LIBRARIES}
|
||||
${GDI_PLUS_LIBRARIES}
|
||||
${OPENMP_LIBRARIES} # used by 3d viewer
|
||||
)
|
||||
|
||||
if( BUILD_GITHUB_PLUGIN )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -34,16 +34,16 @@ DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE( wxWindow* parent, wxWi
|
||||
bSizerButtons = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonAddEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_ADD_EQU, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonAddEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerButtons->Add( m_buttonAddEqu, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_buttonRemoveEqu = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_REMOVE_EQU, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerButtons->Add( m_buttonRemoveEqu, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_buttonMoveUp = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_UP, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonMoveUp, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerButtons->Add( m_buttonMoveUp, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_buttonMoveDown = new wxButton( sbEquivChoiceSizer->GetStaticBox(), ID_EQU_DOWN, _("Move Down"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonMoveDown, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
bSizerButtons->Add( m_buttonMoveDown, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_buttonEdit = new wxButton( sbEquivChoiceSizer->GetStaticBox(), wxID_ANY, _("Edit File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonEdit, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<property name="file">dialog_config_equfiles_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_cvpcb_config_equfile_base</property>
|
||||
<property name="namespace"></property>
|
||||
@@ -216,7 +217,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -304,7 +305,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -392,7 +393,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -480,7 +481,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 22 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -87,6 +87,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, CVPCB_MAINFRA
|
||||
SetBoard( new BOARD() );
|
||||
SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
|
||||
|
||||
// Don't show the default board solder mask clearance. Only the
|
||||
// footprint or pad clearance setting should be shown if it is not 0.
|
||||
GetBoard()->GetDesignSettings().m_SolderMaskMargin = 0;
|
||||
|
||||
LoadSettings( config() );
|
||||
|
||||
// Initialize grid id to a default value if not found in config or incorrect:
|
||||
@@ -430,7 +434,7 @@ MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName )
|
||||
{
|
||||
LIB_ID fpid;
|
||||
|
||||
if( fpid.Parse( aFootprintName ) >= 0 )
|
||||
if( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) >= 0 )
|
||||
{
|
||||
DisplayInfoMessage( this, wxString::Format( _( "Footprint ID \"%s\" is not valid." ),
|
||||
GetChars( aFootprintName ) ) );
|
||||
|
||||
@@ -99,9 +99,8 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName, int aIndex )
|
||||
|
||||
if( !aFootprintName.IsEmpty() )
|
||||
{
|
||||
wxCHECK_RET( fpid.Parse( aFootprintName ) < 0,
|
||||
wxString::Format( _( "\"%s\" is not a valid LIB_ID." ),
|
||||
GetChars( aFootprintName ) ) );
|
||||
wxCHECK_RET( fpid.Parse( aFootprintName, LIB_ID::ID_PCB ) < 0,
|
||||
wxString::Format( _( "\"%s\" is not a valid LIB_ID." ), aFootprintName ) );
|
||||
}
|
||||
|
||||
component->SetFPID( fpid );
|
||||
|
||||
+18
-7
@@ -2,8 +2,8 @@
|
||||
* 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) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -104,10 +104,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||
{
|
||||
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
|
||||
|
||||
if( !m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
|
||||
}
|
||||
wxCHECK_RET( m_canvas->IsMouseCaptured(), "No block mouse capture callback is set" );
|
||||
|
||||
if( block->GetCount() == 0 )
|
||||
{
|
||||
@@ -478,7 +475,12 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
|
||||
destFn.MakeAbsolute( Prj().GetProjectPath() );
|
||||
|
||||
// Make sure any sheets in the block to be pasted will not cause recursion in
|
||||
// the destination sheet.
|
||||
// the destination sheet. Moreover new sheets create new sheetpaths, and component
|
||||
// alternante references must be created and cleared
|
||||
bool hasSheetPasted = false;
|
||||
// Keep trace of existing sheet paths. Paste block can modify this list
|
||||
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
|
||||
|
||||
for( i = 0; i < m_blockItems.GetCount(); i++ )
|
||||
{
|
||||
item = (SCH_ITEM*) m_blockItems.GetItem( i );
|
||||
@@ -512,6 +514,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
|
||||
|
||||
sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)timeStamp ) );
|
||||
sheet->SetTimeStamp( timeStamp );
|
||||
hasSheetPasted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,6 +553,14 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
|
||||
|
||||
MoveItemsInList( picklist, GetScreen()->m_BlockLocate.GetMoveVector() );
|
||||
|
||||
if( hasSheetPasted )
|
||||
{
|
||||
// We clear annotation of new sheet paths.
|
||||
// Annotation of new components added in current sheet is already cleared.
|
||||
SCH_SCREENS screensList( g_RootSheet );
|
||||
screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
|
||||
}
|
||||
|
||||
// Clear flags for all items.
|
||||
GetScreen()->ClearDrawingState();
|
||||
|
||||
|
||||
@@ -332,6 +332,27 @@ void SCH_EDIT_FRAME::EndSegment()
|
||||
|
||||
// Correct and remove segments that need to be merged.
|
||||
SchematicCleanUp( true );
|
||||
|
||||
for( auto item = GetScreen()->GetDrawItems(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() != SCH_COMPONENT_T )
|
||||
continue;
|
||||
|
||||
std::vector< wxPoint > pts;
|
||||
item->GetConnectionPoints( pts );
|
||||
|
||||
if( pts.size() > 2 )
|
||||
continue;
|
||||
|
||||
// Do not trim wires that connect directly to an endpoint
|
||||
pts.erase( std::remove_if( pts.begin(), pts.end(), [ &segment ]( const wxPoint& aPt )
|
||||
{ return segment->IsEndPoint( aPt ); } ), pts.end() );
|
||||
|
||||
for( auto i = pts.begin(); i != pts.end(); i++ )
|
||||
for( auto j = i + 1; j != pts.end(); j++ )
|
||||
TrimWire( *i, *j, true );
|
||||
}
|
||||
|
||||
for( auto i : new_ends )
|
||||
{
|
||||
if( screen->IsJunctionNeeded( i, true ) )
|
||||
@@ -486,10 +507,9 @@ bool SCH_EDIT_FRAME::TrimWire( const wxPoint& aStart, const wxPoint& aEnd, bool
|
||||
{
|
||||
next_item = item->Next();
|
||||
|
||||
// Don't remove wires that are already deleted, are currently being
|
||||
// dragged or are just created
|
||||
// Don't remove wires that are already deleted or are currently being dragged
|
||||
if( item->GetFlags() &
|
||||
( STRUCT_DELETED | IS_DRAGGED | IS_NEW | IS_MOVED | SKIP_STRUCT ) )
|
||||
( STRUCT_DELETED | IS_DRAGGED | IS_MOVED | SKIP_STRUCT ) )
|
||||
continue;
|
||||
|
||||
if( item->Type() != SCH_LINE_T || item->GetLayer() != LAYER_WIRE )
|
||||
@@ -777,6 +797,7 @@ SCH_NO_CONNECT* SCH_EDIT_FRAME::AddNoConnect( const wxPoint& aPosition )
|
||||
SetRepeatItem( no_connect );
|
||||
GetScreen()->Append( no_connect );
|
||||
SchematicCleanUp();
|
||||
GetScreen()->TestDanglingEnds();
|
||||
OnModify();
|
||||
m_canvas->Refresh();
|
||||
SaveCopyInUndoList( no_connect, UR_NEW );
|
||||
|
||||
@@ -119,7 +119,7 @@ PART_LIB* LIB_ALIAS::GetLib()
|
||||
|
||||
void LIB_ALIAS::SetName( const wxString& aName )
|
||||
{
|
||||
name = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_ALIAS );
|
||||
name = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
}
|
||||
|
||||
|
||||
@@ -287,8 +287,7 @@ void LIB_PART::SetName( const wxString& aName )
|
||||
else
|
||||
m_aliases[0]->SetName( aName );
|
||||
|
||||
// LIB_ALIAS validates the name, reuse it instead of validating the name again
|
||||
wxString validatedName( m_aliases[0]->GetName() );
|
||||
wxString validatedName = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
m_libId.SetLibItemName( validatedName, false );
|
||||
|
||||
LIB_FIELD& valueField = GetValueField();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -159,7 +159,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
|
||||
bButtonsSizer->Add( m_btnClose, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerDldOptions->Add( bButtonsSizer, 0, wxALIGN_RIGHT, 5 );
|
||||
bSizerDldOptions->Add( bButtonsSizer, 0, 0, 5 );
|
||||
|
||||
|
||||
bupperSizer->Add( bSizerDldOptions, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
@@ -1418,7 +1418,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT</property>
|
||||
<property name="flag"></property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size">160,-1</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -301,7 +301,7 @@ void DIALOG_CHOOSE_COMPONENT::ShowFootprint( wxString const& aName )
|
||||
{
|
||||
LIB_ID lib_id;
|
||||
|
||||
if( lib_id.Parse( aName ) == -1 && lib_id.IsValid() )
|
||||
if( lib_id.Parse( aName, LIB_ID::ID_PCB ) == -1 && lib_id.IsValid() )
|
||||
{
|
||||
m_fp_view_ctrl->ClearStatus();
|
||||
m_fp_view_ctrl->CacheFootprint( lib_id );
|
||||
|
||||
@@ -258,7 +258,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName( wxCommandEvent& event )
|
||||
wxString msg;
|
||||
wxString partname = chipnameTextCtrl->GetValue();
|
||||
|
||||
if( id.Parse( partname ) != -1 || !id.IsValid() )
|
||||
id.Parse( partname, LIB_ID::ID_SCH );
|
||||
|
||||
if( !id.IsValid() )
|
||||
{
|
||||
msg.Printf( _( "\"%s\" is not a valid library symbol identifier." ), partname );
|
||||
DisplayError( this, msg );
|
||||
@@ -363,7 +365,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
||||
|
||||
tmp.Replace( wxT( " " ), wxT( "_" ) );
|
||||
|
||||
id.Parse( tmp );
|
||||
id.Parse( tmp, LIB_ID::ID_SCH );
|
||||
|
||||
// Save current flags which could be modified by next change settings
|
||||
STATUS_FLAGS flags = m_cmp->GetFlags();
|
||||
|
||||
@@ -358,7 +358,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::validateLibIds()
|
||||
|
||||
// a new lib id is found. validate this new value
|
||||
LIB_ID id;
|
||||
id.Parse( new_libid );
|
||||
id.Parse( new_libid, LIB_ID::ID_SCH );
|
||||
|
||||
if( !id.IsValid() )
|
||||
{
|
||||
@@ -430,7 +430,8 @@ void DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton( wxCommandEvent& event )
|
||||
wxString orphanLibid = m_grid->GetCellValue( m_OrphansRowIndexes[ii], COL_CURR_LIBID );
|
||||
int grid_row_idx = m_OrphansRowIndexes[ii]; //row index in m_grid for the current item
|
||||
|
||||
LIB_ID curr_libid( orphanLibid );
|
||||
LIB_ID curr_libid;
|
||||
curr_libid.Parse( orphanLibid, LIB_ID::ID_SCH, true );
|
||||
wxString symbName = curr_libid.GetLibItemName();
|
||||
// number of full LIB_ID candidates (because we search for a symbol name
|
||||
// inside all avaiable libraries, perhaps the same symbol name can be found
|
||||
@@ -438,7 +439,7 @@ void DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton( wxCommandEvent& event )
|
||||
int libIdCandidateCount = 0;
|
||||
candidateSymbNames.Clear();
|
||||
|
||||
// now try to fin a candidate
|
||||
// now try to find a candidate
|
||||
for( auto &lib : libs )
|
||||
{
|
||||
aliasNames.Clear();
|
||||
@@ -555,7 +556,7 @@ bool DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow()
|
||||
// a new lib id is found and was already validated.
|
||||
// set this new value
|
||||
LIB_ID id;
|
||||
id.Parse( new_libid );
|
||||
id.Parse( new_libid, LIB_ID::ID_SCH, true );
|
||||
|
||||
for( CMP_CANDIDATE& cmp : m_components )
|
||||
{
|
||||
@@ -592,7 +593,7 @@ void DIALOG_EDIT_COMPONENTS_LIBID::revertChanges()
|
||||
continue;
|
||||
|
||||
LIB_ID id;
|
||||
id.Parse( cmp.m_InitialLibId );
|
||||
id.Parse( cmp.m_InitialLibId, LIB_ID::ID_SCH, true );
|
||||
|
||||
if( cmp.m_Component->GetLibId() != id )
|
||||
{
|
||||
|
||||
@@ -174,13 +174,14 @@ void DIALOG_LABEL_EDITOR::InitDialog()
|
||||
{
|
||||
m_textLabel = m_textLabelMultiLine;
|
||||
m_textLabelSingleLine->Show( false );
|
||||
m_textControlSizer->AddGrowableRow( 0 );
|
||||
m_staticTextLabel->Show( false );
|
||||
multiLine = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_textLabel = m_textLabelSingleLine;
|
||||
m_textLabelMultiLine->Show( false );
|
||||
m_staticTextText->Show( false );
|
||||
wxTextValidator* validator = (wxTextValidator*) m_textLabel->GetValidator();
|
||||
|
||||
// Add invalid label characters to this list.
|
||||
|
||||
@@ -16,32 +16,33 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_textControlSizer = new wxFlexGridSizer( 2, 2, 3, 3 );
|
||||
m_textControlSizer = new wxFlexGridSizer( 3, 2, 3, 3 );
|
||||
m_textControlSizer->AddGrowableCol( 1 );
|
||||
m_textControlSizer->AddGrowableRow( 1 );
|
||||
m_textControlSizer->SetFlexibleDirection( wxBOTH );
|
||||
m_textControlSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("&Text:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->Wrap( -1 );
|
||||
m_staticText1->SetToolTip( _("Enter the text to be used within the schematic") );
|
||||
m_staticTextLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextLabel->Wrap( -1 );
|
||||
m_staticTextLabel->SetToolTip( _("Enter the text to be used within the schematic") );
|
||||
|
||||
m_textControlSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 );
|
||||
|
||||
wxBoxSizer* bSizeText;
|
||||
bSizeText = new wxBoxSizer( wxVERTICAL );
|
||||
m_textControlSizer->Add( m_staticTextLabel, 0, wxRIGHT, 3 );
|
||||
|
||||
m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RICH );
|
||||
m_textLabelSingleLine->SetValidator( wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, &m_labelText ) );
|
||||
|
||||
bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
|
||||
m_textControlSizer->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
|
||||
|
||||
m_staticTextText = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextText->Wrap( -1 );
|
||||
m_staticTextText->SetToolTip( _("Enter the text to be used within the schematic") );
|
||||
|
||||
m_textControlSizer->Add( m_staticTextText, 0, wxRIGHT, 5 );
|
||||
|
||||
m_textLabelMultiLine = new wxTextCtrl( this, wxID_VALUEMULTI, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
|
||||
m_textLabelMultiLine->SetMinSize( wxSize( -1,60 ) );
|
||||
|
||||
bSizeText->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
|
||||
|
||||
|
||||
m_textControlSizer->Add( bSizeText, 1, wxEXPAND, 3 );
|
||||
m_textControlSizer->Add( m_textLabelMultiLine, 1, wxEXPAND|wxLEFT, 3 );
|
||||
|
||||
m_SizeTitle = new wxStaticText( this, wxID_ANY, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_SizeTitle->Wrap( -1 );
|
||||
@@ -51,7 +52,7 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
|
||||
bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_TextSize = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizeCtrlSizer->Add( m_TextSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 3 );
|
||||
bSizeCtrlSizer->Add( m_TextSize, 0, wxLEFT|wxRIGHT|wxEXPAND, 3 );
|
||||
|
||||
m_staticSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticSizeUnits->Wrap( -1 );
|
||||
|
||||
@@ -102,17 +102,17 @@
|
||||
<property name="cols">2</property>
|
||||
<property name="flexible_direction">wxBOTH</property>
|
||||
<property name="growablecols">1</property>
|
||||
<property name="growablerows"></property>
|
||||
<property name="growablerows">1</property>
|
||||
<property name="hgap">3</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_textControlSizer</property>
|
||||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="rows">2</property>
|
||||
<property name="rows">3</property>
|
||||
<property name="vgap">3</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
<property name="flag">wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -142,7 +142,7 @@
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">&Text:</property>
|
||||
<property name="label">Text:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -150,7 +150,7 @@
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText1</property>
|
||||
<property name="name">m_staticTextLabel</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
@@ -195,195 +195,267 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_VALUESINGLE</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textLabelSingleLine</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_PROCESS_ENTER|wxTE_RICH</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type">wxString</property>
|
||||
<property name="validator_style">wxFILTER_EXCLUDE_CHAR_LIST</property>
|
||||
<property name="validator_type">wxTextValidator</property>
|
||||
<property name="validator_variable">m_labelText</property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter">OnEnterKey</event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxRIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Text:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextText</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Enter the text to be used within the schematic</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="name">bSizeText</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_VALUESINGLE</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textLabelSingleLine</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_PROCESS_ENTER|wxTE_RICH</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type">wxString</property>
|
||||
<property name="validator_style">wxFILTER_EXCLUDE_CHAR_LIST</property>
|
||||
<property name="validator_type">wxTextValidator</property>
|
||||
<property name="validator_variable">m_labelText</property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter">OnEnterKey</event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxEXPAND|wxLEFT</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_VALUEMULTI</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,60</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textLabelMultiLine</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_MULTILINE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_VALUEMULTI</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,60</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_textLabelMultiLine</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxTE_MULTILINE</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnTextMaxLen"></event>
|
||||
<event name="OnTextURL"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -480,7 +552,7 @@
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -43,8 +43,9 @@ class DIALOG_LABEL_EDITOR_BASE : public DIALOG_SHIM
|
||||
};
|
||||
|
||||
wxFlexGridSizer* m_textControlSizer;
|
||||
wxStaticText* m_staticText1;
|
||||
wxStaticText* m_staticTextLabel;
|
||||
wxTextCtrl* m_textLabelSingleLine;
|
||||
wxStaticText* m_staticTextText;
|
||||
wxTextCtrl* m_textLabelMultiLine;
|
||||
wxStaticText* m_SizeTitle;
|
||||
wxTextCtrl* m_TextSize;
|
||||
|
||||
@@ -699,8 +699,10 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::LoadFieldNames()
|
||||
for( auto fieldName : userFieldNames )
|
||||
AddField( fieldName, true, false );
|
||||
|
||||
// Add any templateFieldNames which aren't already present in the userFieldNames
|
||||
for( auto templateFieldName : m_parent->GetTemplateFieldNames() )
|
||||
AddField( templateFieldName.m_Name, false, false );
|
||||
if( userFieldNames.count( templateFieldName.m_Name ) == 0 )
|
||||
AddField( templateFieldName.m_Name, false, false );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jul 11 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -81,10 +81,10 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
|
||||
sbSizerPinSharing = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Sharing:") ), wxVERTICAL );
|
||||
|
||||
m_checkApplyToAllParts = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all &units in symbol"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALL, 3 );
|
||||
|
||||
m_checkApplyToAllConversions = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all body &styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
|
||||
sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALL, 3 );
|
||||
|
||||
|
||||
boarderSizer->Add( sbSizerPinSharing, 0, wxEXPAND|wxALL, 5 );
|
||||
@@ -172,7 +172,7 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
|
||||
|
||||
bRightSizer->Add( fgSizerTextsSizes, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
|
||||
m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL|wxBORDER_SUNKEN );
|
||||
m_panelShowPin->SetMinSize( wxSize( 150,150 ) );
|
||||
|
||||
bRightSizer->Add( m_panelShowPin, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<FileVersion major="1" minor="14" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
@@ -55,13 +55,20 @@
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneActivated"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnClose">OnCloseDialog</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
@@ -76,17 +83,23 @@
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMaximize"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnMove"></event>
|
||||
<event name="OnMoveEnd"></event>
|
||||
<event name="OnMoveStart"></event>
|
||||
<event name="OnMoving"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnShow"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
@@ -161,6 +174,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Pin &name:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -186,7 +200,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -273,7 +294,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -335,6 +363,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICTEXTPADNAME</property>
|
||||
<property name="label">Pin n&umber:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -360,7 +389,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -447,7 +483,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -509,6 +552,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">&Orientation:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -534,7 +578,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -622,7 +673,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCombobox">OnPropertiesChange</event>
|
||||
<event name="OnComboboxCloseup"></event>
|
||||
<event name="OnComboboxDropdown"></event>
|
||||
@@ -685,6 +743,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">&Electrical type:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -710,7 +769,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -798,7 +864,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCombobox">OnPropertiesChange</event>
|
||||
<event name="OnComboboxCloseup"></event>
|
||||
<event name="OnComboboxDropdown"></event>
|
||||
@@ -861,6 +934,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Graphic &Style:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -886,7 +960,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -974,7 +1055,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCombobox">OnPropertiesChange</event>
|
||||
<event name="OnComboboxCloseup"></event>
|
||||
<event name="OnComboboxDropdown"></event>
|
||||
@@ -1030,7 +1118,7 @@
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1090,7 +1178,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCheckBox">OnPropertiesChange</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
@@ -1118,7 +1213,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">3</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1178,7 +1273,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCheckBox">OnPropertiesChange</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
@@ -1281,7 +1383,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnCheckBox">OnPropertiesChange</event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
@@ -1371,6 +1480,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICTEXTNAMESIZE</property>
|
||||
<property name="label">N&ame text size:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1396,7 +1506,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1483,7 +1600,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1545,6 +1669,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICNAMETEXTSIZEUNITS</property>
|
||||
<property name="label">units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1570,7 +1695,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1628,6 +1760,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICTEXTPADNAMESIZE</property>
|
||||
<property name="label">Number te&xt size:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1653,7 +1786,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1740,7 +1880,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1802,6 +1949,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICNUMBERTEXTSIZEUNITS</property>
|
||||
<property name="label">units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1827,7 +1975,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1885,6 +2040,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICTEXTPINLEN</property>
|
||||
<property name="label">&Length:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -1910,7 +2066,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -1997,7 +2160,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2059,6 +2229,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">ID_M_STATICLENGTHUNITS</property>
|
||||
<property name="label">units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -2084,7 +2255,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2142,6 +2320,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Pin Pos X:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -2167,7 +2346,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2254,7 +2440,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2316,6 +2509,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -2341,7 +2535,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2399,6 +2600,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Pin Pos Y:</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -2424,7 +2626,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2511,7 +2720,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2573,6 +2789,7 @@
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">units</property>
|
||||
<property name="markup">0</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
@@ -2598,7 +2815,14 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2679,8 +2903,15 @@
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER|wxTAB_TRAVERSAL</property>
|
||||
<property name="window_style">wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL|wxBORDER_SUNKEN</property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
@@ -2765,7 +2996,14 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnAux1DClick"></event>
|
||||
<event name="OnAux1Down"></event>
|
||||
<event name="OnAux1Up"></event>
|
||||
<event name="OnAux2DClick"></event>
|
||||
<event name="OnAux2Down"></event>
|
||||
<event name="OnAux2Up"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCharHook"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jul 11 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -84,7 +84,7 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
|
||||
sOptionsSizer->Add( m_CommonUnit, 0, wxALL, 5 );
|
||||
|
||||
m_CommonConvert = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Common to all body styles"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_CommonConvert, 0, wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT, 5 );
|
||||
sOptionsSizer->Add( m_CommonConvert, 0, wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_Invisible = new wxCheckBox( sOptionsSizer->GetStaticBox(), wxID_ANY, _("Invisible"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
sOptionsSizer->Add( m_Invisible, 0, wxALIGN_LEFT|wxBOTTOM|wxLEFT, 5 );
|
||||
@@ -123,7 +123,7 @@ DIALOG_LIB_EDIT_TEXT_BASE::DIALOG_LIB_EDIT_TEXT_BASE( wxWindow* parent, wxWindow
|
||||
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
|
||||
m_sdbSizerButtons->Realize();
|
||||
|
||||
bMainSizer->Add( m_sdbSizerButtons, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
|
||||
bMainSizer->Add( m_sdbSizerButtons, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
|
||||
@@ -947,7 +947,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT</property>
|
||||
<property name="flag">wxBOTTOM|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1399,7 +1399,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND|wxTOP</property>
|
||||
<property name="flag">wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="0">
|
||||
<property name="Apply">0</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 19 2018)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
|
||||
@@ -194,9 +194,12 @@ void SCH_EDIT_FRAME::EditImage( SCH_BITMAP* aItem )
|
||||
|
||||
// save old image in undo list if not already in edit
|
||||
// or the image to be edited is part of a block
|
||||
if( aItem->GetFlags() == 0 ||
|
||||
GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
|
||||
int mask = EDA_ITEM_ALL_FLAGS - ( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
||||
if( ( aItem->GetFlags() & mask ) == 0
|
||||
|| GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
|
||||
{
|
||||
SaveCopyInUndoList( aItem, UR_CHANGED );
|
||||
}
|
||||
|
||||
dlg.TransfertToImage( aItem->GetImage() );
|
||||
OnModify();
|
||||
|
||||
@@ -54,7 +54,8 @@ void SCH_EDIT_FRAME::EditComponentFieldText( SCH_FIELD* aField )
|
||||
wxT( "Invalid schematic field parent item." ) );
|
||||
|
||||
// Save old component in undo list if not already in edit, or moving.
|
||||
if( aField->GetFlags() == 0 )
|
||||
int mask = EDA_ITEM_ALL_FLAGS - ( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
||||
if( ( aField->GetFlags() & mask ) == 0 ) // i.e. not edited, or moved
|
||||
SaveCopyInUndoList( component, UR_CHANGED );
|
||||
|
||||
// Don't use GetText() here. If the field is the reference designator and it's parent
|
||||
@@ -100,7 +101,8 @@ void SCH_EDIT_FRAME::RotateField( SCH_FIELD* aField )
|
||||
SCH_COMPONENT* component = (SCH_COMPONENT*) aField->GetParent();
|
||||
|
||||
// Save old component in undo list if not already in edit, or moving.
|
||||
if( aField->GetFlags() == 0 )
|
||||
int mask = EDA_ITEM_ALL_FLAGS - ( SELECTED | HIGHLIGHTED | BRIGHTENED );
|
||||
if( ( aField->GetFlags() & mask ) == 0 )
|
||||
SaveCopyInUndoList( component, UR_CHANGED );
|
||||
|
||||
if( aField->GetTextAngle() == TEXT_ANGLE_HORIZ )
|
||||
|
||||
@@ -147,9 +147,12 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, bool aSaveUnderNewName,
|
||||
wxRemoveFile( autoSaveFileName.GetFullPath() );
|
||||
}
|
||||
|
||||
// Update the screen and frame info.
|
||||
// Update the screen and frame info and reset the lock file.
|
||||
if( aSaveUnderNewName )
|
||||
{
|
||||
aScreen->SetFileName( schematicFileName.GetFullPath() );
|
||||
LockFile( schematicFileName.GetFullPath() );
|
||||
}
|
||||
|
||||
aScreen->ClrSave();
|
||||
aScreen->ClrModify();
|
||||
@@ -844,7 +847,8 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
|
||||
|
||||
if( !fpField->GetText().IsEmpty() )
|
||||
{
|
||||
LIB_ID fpId( fpField->GetText() );
|
||||
LIB_ID fpId;
|
||||
fpId.Parse( fpField->GetText(), LIB_ID::ID_SCH, true );
|
||||
fpId.SetLibNickname( newfilename.GetName() );
|
||||
fpField->SetText( fpId.Format() );
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ SCH_BASE_FRAME::COMPONENT_SELECTION SCH_BASE_FRAME::SelectComponentFromLibBrowse
|
||||
{
|
||||
LIB_ID id;
|
||||
|
||||
if( id.Parse( symbol ) == -1 )
|
||||
if( id.Parse( symbol, LIB_ID::ID_SCH ) == -1 )
|
||||
sel.LibId = id;
|
||||
|
||||
sel.Unit = viewlibFrame->GetUnit();
|
||||
|
||||
@@ -594,7 +594,9 @@ void LIB_EDIT_FRAME::OnUpdateSaveAll( wxUpdateUIEvent& event )
|
||||
break;
|
||||
}
|
||||
|
||||
event.SetText( modified > 1 ? _( "Save All &Libraries..." ) : _( "Save All &Libraries" ) );
|
||||
wxString text = modified > 1 ? _( "Save All &Libraries..." ) : _( "Save All &Libraries" );
|
||||
|
||||
event.SetText( AddHotkeyName( text, g_Libedit_Hokeys_Descr, HK_SAVE_ALL_LIBS ) );
|
||||
event.Enable( modified > 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -379,6 +379,7 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||
const SCH_SHEET_LIST& sheetList = g_RootSheet;
|
||||
|
||||
m_directives.clear();
|
||||
bool controlBlock = false;
|
||||
|
||||
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||
{
|
||||
@@ -392,29 +393,63 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||
if( text.IsEmpty() )
|
||||
continue;
|
||||
|
||||
if( text.GetChar( 0 ) == '.' )
|
||||
// Analyze each line of a text field
|
||||
wxStringTokenizer tokenizer( text, "\r\n" );
|
||||
|
||||
while( tokenizer.HasMoreTokens() )
|
||||
{
|
||||
wxStringTokenizer tokenizer( text, "\r\n" );
|
||||
wxString line( tokenizer.GetNextToken() );
|
||||
|
||||
while( tokenizer.HasMoreTokens() )
|
||||
// Convert to lower-case and remove preceding
|
||||
// and trailing white-space characters
|
||||
line.MakeLower().Trim( true ).Trim( false );
|
||||
|
||||
// 'Include' directive stores the library file name, so it
|
||||
// can be later resolved using a list of paths
|
||||
if( line.StartsWith( ".inc" ) )
|
||||
{
|
||||
wxString directive( tokenizer.GetNextToken() );
|
||||
wxString lib = line.AfterFirst( ' ' );
|
||||
|
||||
if( directive.StartsWith( ".inc" ) )
|
||||
{
|
||||
wxString lib = directive.AfterFirst( ' ' );
|
||||
if( lib.IsEmpty() )
|
||||
continue;
|
||||
|
||||
if( !lib.IsEmpty() )
|
||||
m_libraries.insert( lib );
|
||||
}
|
||||
else if( directive.StartsWith( ".title " ) )
|
||||
// Strip quotes if present
|
||||
if( ( lib.StartsWith( "\"" ) && lib.EndsWith( "\"" ) )
|
||||
|| ( lib.StartsWith( "'" ) && lib.EndsWith( "'" ) ) )
|
||||
{
|
||||
m_title = directive.AfterFirst( ' ' );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_directives.push_back( directive );
|
||||
lib = lib.Mid( 1, lib.Length() - 2 );
|
||||
}
|
||||
|
||||
m_libraries.insert( lib );
|
||||
}
|
||||
|
||||
// Store the title to be sure it appears
|
||||
// in the first line of output
|
||||
else if( line.StartsWith( ".title " ) )
|
||||
{
|
||||
m_title = line.AfterFirst( ' ' );
|
||||
}
|
||||
|
||||
// Handle .control .. .endc blocks
|
||||
else if( line.IsSameAs( ".control" ) && ( !controlBlock ) )
|
||||
{
|
||||
controlBlock = true;
|
||||
}
|
||||
else if( line.IsSameAs( ".endc" ) && controlBlock )
|
||||
{
|
||||
controlBlock = false;
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
|
||||
// Usual one-line directives
|
||||
else if( line.StartsWith( '.' ) )
|
||||
{
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
|
||||
if( controlBlock )
|
||||
{
|
||||
m_directives.push_back( line );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +287,8 @@ void SCH_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
||||
case ID_SCH_PLACE_COMPONENT:
|
||||
if( (item == NULL) || (item->GetFlags() == 0) )
|
||||
{
|
||||
// ERC dialog interferes with moving items so we close it before starting
|
||||
CloseErc();
|
||||
GetScreen()->SetCurItem( Load_Component( aDC, NULL,
|
||||
s_CmpNameList, true ) );
|
||||
m_canvas->SetAutoPanRequest( true );
|
||||
|
||||
@@ -278,6 +278,8 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
||||
AddMenuItem( PopMenu, ID_POPUP_END_LINE, _( "End Drawing" ),
|
||||
KiBitmap( checked_ok_xpm ) );
|
||||
|
||||
AddMenuItem( PopMenu, ID_SCH_EDIT_ITEM, _( "Edit..." ),
|
||||
KiBitmap( edit_xpm ) );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, _( "Delete Drawing" ),
|
||||
KiBitmap( delete_xpm ) );
|
||||
break;
|
||||
|
||||
@@ -239,6 +239,11 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
|
||||
if( aItemsList.GetCount() == 0 )
|
||||
return;
|
||||
|
||||
// Keep trace of existing sheet paths. Duplicate block can modify this list
|
||||
bool hasSheetCopied = false;
|
||||
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
|
||||
|
||||
|
||||
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
|
||||
{
|
||||
newitem = DuplicateStruct( (SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
|
||||
@@ -270,6 +275,7 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
|
||||
|
||||
sheet->SetName( wxString::Format( wxT( "sheet%8.8lX" ), (unsigned long)timeStamp ) );
|
||||
sheet->SetTimeStamp( timeStamp );
|
||||
hasSheetCopied = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -285,6 +291,14 @@ void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
|
||||
}
|
||||
|
||||
MoveItemsInList( aItemsList, aMoveVector );
|
||||
|
||||
if( hasSheetCopied )
|
||||
{
|
||||
// We clear annotation of new sheet paths.
|
||||
// Annotation of new components added in current sheet is already cleared.
|
||||
SCH_SCREENS screensList( g_RootSheet );
|
||||
screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+17
-10
@@ -258,10 +258,15 @@ void RESCUE_CACHE_CANDIDATE::FindRescues( RESCUER& aRescuer,
|
||||
|
||||
// Test whether there is a conflict or if the symbol can only be found in the cache
|
||||
// and the symbol name does not have any illegal characters.
|
||||
if( ( ( cache_match && lib_match
|
||||
&& !cache_match->PinsConflictWith( *lib_match, true, true, true, true, false ) )
|
||||
|| (!cache_match && lib_match ) ) && !LIB_ID::HasIllegalChars( part_name, LIB_ID::ID_SCH ) )
|
||||
continue;
|
||||
if( LIB_ID::HasIllegalChars( part_name, LIB_ID::ID_SCH ) == -1 )
|
||||
{
|
||||
if( cache_match && lib_match &&
|
||||
!cache_match->PinsConflictWith( *lib_match, true, true, true, true, false ) )
|
||||
continue;
|
||||
|
||||
if( !cache_match && lib_match )
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the symbol has already been rescued.
|
||||
wxString new_name = LIB_ID::FixIllegalChars( part_name, LIB_ID::ID_SCH );
|
||||
@@ -333,7 +338,7 @@ RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::RESCUE_SYMBOL_LIB_TABLE_CANDIDATE(
|
||||
LIB_PART* aLibCandidate ) : RESCUE_CANDIDATE()
|
||||
{
|
||||
m_requested_id = aRequestedId;
|
||||
m_requested_name = aRequestedId.GetLibItemName();
|
||||
m_requested_name = aRequestedId.Format();
|
||||
m_new_id = aNewId;
|
||||
m_lib_candidate = aLibCandidate;
|
||||
m_cache_candidate = aCacheCandidate;
|
||||
@@ -379,12 +384,14 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
|
||||
continue;
|
||||
|
||||
// Test whether there is a conflict or if the symbol can only be found in the cache.
|
||||
if( ( ( cache_match && lib_match
|
||||
&& !cache_match->PinsConflictWith( *lib_match, true, true, true, true, false ) )
|
||||
|| (!cache_match && lib_match ) )
|
||||
&& !LIB_ID::HasIllegalChars( part_id.GetLibItemName(), LIB_ID::ID_SCH ) )
|
||||
if( LIB_ID::HasIllegalChars( part_id.GetLibItemName(), LIB_ID::ID_SCH ) == -1 )
|
||||
{
|
||||
continue;
|
||||
if( cache_match && lib_match &&
|
||||
!cache_match->PinsConflictWith( *lib_match, true, true, true, true, false ) )
|
||||
continue;
|
||||
|
||||
if( !cache_match && lib_match )
|
||||
continue;
|
||||
}
|
||||
|
||||
// Fix illegal LIB_ID name characters.
|
||||
|
||||
@@ -1111,6 +1111,33 @@ void SCH_COMPONENT::ClearAnnotation( SCH_SHEET_PATH* aSheetPath )
|
||||
}
|
||||
|
||||
|
||||
bool SCH_COMPONENT::AddSheetPathReferenceEntryIfMissing( const wxString& aSheetPathName )
|
||||
{
|
||||
// a empty sheet path is illegal:
|
||||
wxCHECK( !aSheetPathName.IsEmpty(), false );
|
||||
|
||||
wxString reference_path;
|
||||
|
||||
// The full component reference path is aSheetPathName + the component time stamp itself
|
||||
// full_AR_path is the alternate reference path to search
|
||||
wxString full_AR_path = aSheetPathName + wxString::Format( "%8.8X", GetTimeStamp() );
|
||||
|
||||
for( unsigned int ii = 0; ii < m_PathsAndReferences.GetCount(); ii++ )
|
||||
{
|
||||
// Break hierarchical reference in path, ref and multi selection:
|
||||
reference_path = m_PathsAndReferences[ii].BeforeFirst( ' ' );
|
||||
|
||||
// if aSheetPath is found, nothing to do:
|
||||
if( reference_path.Cmp( full_AR_path ) == 0 )
|
||||
return false;
|
||||
}
|
||||
|
||||
// This entry does not exist: add it, with a (temporary?) reference (last ref used for display)
|
||||
AddHierarchicalReference( full_AR_path, m_Fields[REFERENCE].GetText(), m_unit );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void SCH_COMPONENT::SetOrientation( int aOrientation )
|
||||
{
|
||||
TRANSFORM temp = TRANSFORM();
|
||||
|
||||
@@ -299,6 +299,19 @@ public:
|
||||
*/
|
||||
void ClearAnnotation( SCH_SHEET_PATH* aSheetPath );
|
||||
|
||||
/**
|
||||
* Add aSheetPath in m_PathsAndReferences alternate references list,
|
||||
* if this entry does not exist
|
||||
* Do nothing if already exists.
|
||||
* In component lists shared by more than one sheet path, an entry for each
|
||||
* sheet path must exist to manage references
|
||||
* @param aSheetPathName is the candidate sheet path name
|
||||
* this sheet path is the sheet path of the sheet containing the component,
|
||||
* not the full component sheet path
|
||||
* @return false if the alternate reference was existing, true if added.
|
||||
*/
|
||||
bool AddSheetPathReferenceEntryIfMissing( const wxString& aSheetPathName );
|
||||
|
||||
/**
|
||||
* Change the time stamp to \a aNewTimeStamp and updates the reference path.
|
||||
*
|
||||
|
||||
@@ -469,9 +469,10 @@ void SCH_EAGLE_PLUGIN::loadDrawing( wxXmlNode* aDrawingNode )
|
||||
|
||||
// wxXmlNode* grid = drawingChildren["grid"]
|
||||
|
||||
wxXmlNode* layers = drawingChildren["layers"];
|
||||
auto layers = drawingChildren["layers"];
|
||||
|
||||
loadLayerDefs( layers );
|
||||
if( layers )
|
||||
loadLayerDefs( layers );
|
||||
|
||||
// wxXmlNode* library = drawingChildren["library"]
|
||||
|
||||
@@ -479,7 +480,9 @@ void SCH_EAGLE_PLUGIN::loadDrawing( wxXmlNode* aDrawingNode )
|
||||
|
||||
|
||||
// Load schematic
|
||||
loadSchematic( drawingChildren["schematic"] );
|
||||
auto schematic = drawingChildren["schematic"];
|
||||
if( schematic )
|
||||
loadSchematic( schematic );
|
||||
}
|
||||
|
||||
|
||||
@@ -488,7 +491,8 @@ void SCH_EAGLE_PLUGIN::countNets( wxXmlNode* aSchematicNode )
|
||||
// Map all children into a readable dictionary
|
||||
NODE_MAP schematicChildren = MapChildren( aSchematicNode );
|
||||
// Loop through all the sheets
|
||||
wxXmlNode* sheetNode = schematicChildren["sheets"]->GetChildren();
|
||||
|
||||
wxXmlNode* sheetNode = getChildrenNodes( schematicChildren, "sheets" );
|
||||
|
||||
while( sheetNode )
|
||||
{
|
||||
@@ -519,8 +523,12 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
|
||||
{
|
||||
// Map all children into a readable dictionary
|
||||
NODE_MAP schematicChildren = MapChildren( aSchematicNode );
|
||||
auto partNode = getChildrenNodes( schematicChildren, "parts" );
|
||||
auto libraryNode = getChildrenNodes( schematicChildren, "libraries" );
|
||||
auto sheetNode = getChildrenNodes( schematicChildren, "sheets" );
|
||||
|
||||
wxXmlNode* partNode = schematicChildren["parts"]->GetChildren();
|
||||
if( !partNode || !libraryNode || !sheetNode )
|
||||
return;
|
||||
|
||||
while( partNode )
|
||||
{
|
||||
@@ -529,10 +537,7 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
|
||||
partNode = partNode->GetNext();
|
||||
}
|
||||
|
||||
|
||||
// Loop through all the libraries
|
||||
wxXmlNode* libraryNode = schematicChildren["libraries"]->GetChildren();
|
||||
|
||||
while( libraryNode )
|
||||
{
|
||||
// Read the library name
|
||||
@@ -553,9 +558,7 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
|
||||
countNets( aSchematicNode );
|
||||
|
||||
// Loop through all the sheets
|
||||
wxXmlNode* sheetNode = schematicChildren["sheets"]->GetChildren();
|
||||
|
||||
int sheet_count = countChildren( schematicChildren["sheets"], "sheet" );
|
||||
int sheet_count = countChildren( sheetNode->GetParent(), "sheet" );
|
||||
|
||||
// If eagle schematic has multiple sheets then create corresponding subsheets on the root sheet
|
||||
if( sheet_count > 1 )
|
||||
@@ -1064,7 +1067,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
|
||||
wxString gatename = epart->deviceset + epart->device + einstance.gate;
|
||||
wxString symbolname = wxString( epart->deviceset + epart->device );
|
||||
symbolname.Replace( "*", "" );
|
||||
wxString kisymbolname = LIB_ID::FixIllegalChars( symbolname, LIB_ID::ID_SCH );
|
||||
wxString kisymbolname = fixSymbolName( symbolname );
|
||||
|
||||
int unit = m_eagleLibs[libraryname].GateUnit[gatename];
|
||||
|
||||
@@ -1228,7 +1231,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
|
||||
NODE_MAP libraryChildren = MapChildren( aLibraryNode );
|
||||
|
||||
// Loop through the symbols and load each of them
|
||||
wxXmlNode* symbolNode = libraryChildren["symbols"]->GetChildren();
|
||||
wxXmlNode* symbolNode = getChildrenNodes( libraryChildren, "symbols" );
|
||||
|
||||
while( symbolNode )
|
||||
{
|
||||
@@ -1238,7 +1241,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
|
||||
}
|
||||
|
||||
// Loop through the devicesets and load each of them
|
||||
wxXmlNode* devicesetNode = libraryChildren["devicesets"]->GetChildren();
|
||||
wxXmlNode* devicesetNode = getChildrenNodes( libraryChildren, "devicesets" );
|
||||
|
||||
while( devicesetNode )
|
||||
{
|
||||
@@ -1260,7 +1263,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
|
||||
wxString symbolName = edeviceset.name + edevice.name;
|
||||
symbolName.Replace( "*", "" );
|
||||
wxASSERT( !symbolName.IsEmpty() );
|
||||
symbolName = LIB_ID::FixIllegalChars( symbolName, LIB_ID::ID_SCH );
|
||||
symbolName = fixSymbolName( symbolName );
|
||||
|
||||
if( edevice.package )
|
||||
aEagleLibrary->package[symbolName] = edevice.package.Get();
|
||||
@@ -1304,7 +1307,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
|
||||
if( gates_count == 1 && ispower )
|
||||
kpart->SetPower();
|
||||
|
||||
wxString name = LIB_ID::FixIllegalChars( kpart->GetName(), LIB_ID::ID_SCH );
|
||||
wxString name = fixSymbolName( kpart->GetName() );
|
||||
kpart->SetName( name );
|
||||
m_pi->SaveSymbol( getLibFileName().GetFullPath(), new LIB_PART( *kpart.get() ),
|
||||
m_properties.get() );
|
||||
@@ -2576,3 +2579,11 @@ void SCH_EAGLE_PLUGIN::addImplicitConnections( SCH_COMPONENT* aComponent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxString SCH_EAGLE_PLUGIN::fixSymbolName( const wxString& aName )
|
||||
{
|
||||
wxString ret = LIB_ID::FixIllegalChars( aName, LIB_ID::ID_SCH );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -250,6 +250,15 @@ private:
|
||||
* @param aUpdateSet decides whether the missing units data should be updated.
|
||||
*/
|
||||
void addImplicitConnections( SCH_COMPONENT* aComponent, SCH_SCREEN* aScreen, bool aUpdateSet );
|
||||
|
||||
/**
|
||||
* Fixes invalid characters in Eagle symbol names. It changes invalid characters
|
||||
* to underscores.
|
||||
*
|
||||
* @param aName is the symbol name to be fixed.
|
||||
* @return Fixed symbol name.
|
||||
*/
|
||||
static wxString fixSymbolName( const wxString& aName );
|
||||
};
|
||||
|
||||
#endif // _SCH_EAGLE_PLUGIN_H_
|
||||
|
||||
@@ -171,7 +171,7 @@ PART_LIBS* PROJECT::SchLibs()
|
||||
catch( const PARSE_ERROR& pe )
|
||||
{
|
||||
wxString lib_list = UTF8( pe.inputLine );
|
||||
wxWindow* parent = 0; // Pgm().App().GetTopWindow();
|
||||
wxWindow* parent = Pgm().App().GetTopWindow();
|
||||
|
||||
// parent of this dialog cannot be NULL since that breaks the Kiway() chain.
|
||||
HTML_MESSAGE_BOX dlg( parent, _( "Not Found" ) );
|
||||
@@ -186,7 +186,9 @@ PART_LIBS* PROJECT::SchLibs()
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( NULL, ioe.What() );
|
||||
wxWindow* parent = Pgm().App().GetTopWindow();
|
||||
|
||||
DisplayError( parent, ioe.What() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -846,6 +848,16 @@ void SCH_EDIT_FRAME::OnErc( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::CloseErc()
|
||||
{
|
||||
// Find the ERC dialog if it's open and close it
|
||||
wxWindow* erc = FindWindowById( ID_DIALOG_ERC, this );
|
||||
|
||||
if( erc )
|
||||
erc->Close( false );
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::OnUpdatePCB( wxCommandEvent& event )
|
||||
{
|
||||
doUpdatePcb( "" );
|
||||
@@ -1392,13 +1404,19 @@ void SCH_EDIT_FRAME::addCurrentItemToList( bool aRedraw )
|
||||
|
||||
if( item->IsNew() )
|
||||
{
|
||||
// When a new sheet is added to the hierarchy, a clear annotation can be needed
|
||||
// for all new sheet paths added by the new sheet (if this sheet is loaded from
|
||||
// and existing sheet or a existing file, it can also contain subsheets)
|
||||
bool doClearAnnotation = false;
|
||||
SCH_SHEET_LIST initial_sheetpathList( g_RootSheet );
|
||||
|
||||
if( item->Type() == SCH_SHEET_T )
|
||||
{
|
||||
// Fix the size and position of the new sheet using the last values set by
|
||||
// the m_mouseCaptureCallback function.
|
||||
m_canvas->SetMouseCapture( NULL, NULL );
|
||||
|
||||
if( !EditSheet( (SCH_SHEET*)item, m_CurrentSheet ) )
|
||||
if( !EditSheet( (SCH_SHEET*)item, m_CurrentSheet, &doClearAnnotation ) )
|
||||
{
|
||||
screen->SetCurItem( NULL );
|
||||
delete item;
|
||||
@@ -1436,6 +1454,14 @@ void SCH_EDIT_FRAME::addCurrentItemToList( bool aRedraw )
|
||||
wxLogMessage( wxT( "addCurrentItemToList: expected type = SCH_SHEET_PIN_T, actual type = %d" ),
|
||||
item->Type() );
|
||||
}
|
||||
|
||||
if( doClearAnnotation )
|
||||
{
|
||||
// Clear annotation of new sheet paths: the new sheet and its sub-sheets
|
||||
// If needed the missing alternate references of components will be created
|
||||
SCH_SCREENS screensList( g_RootSheet );
|
||||
screensList.ClearAnnotationOfNewSheetPaths( initial_sheetpathList );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -922,6 +922,11 @@ private:
|
||||
void OnUpdateHierarchySheet( wxUpdateUIEvent& aEvent );
|
||||
void OnUpdateRemapSymbols( wxUpdateUIEvent& aEvent );
|
||||
|
||||
/**
|
||||
* Close the ERC dialog if it is open.
|
||||
*/
|
||||
void CloseErc();
|
||||
|
||||
/**
|
||||
* Set the main window title bar text.
|
||||
*
|
||||
@@ -1106,8 +1111,15 @@ public:
|
||||
* the current associated screen file name is changed and saved to disk.
|
||||
*
|
||||
* Note: the screen is not refresh. The caller is responsible to do that
|
||||
*
|
||||
* @param aSheet is the sheet to edit
|
||||
* @param aHierarchy is the current hierarchy containing aSheet
|
||||
* @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.
|
||||
* it can happens when the edited sheet used an existying file, or becomes a new instance
|
||||
* of a already existing sheet.
|
||||
*/
|
||||
bool EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
||||
bool EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy, bool* aClearAnnotationNewItems );
|
||||
|
||||
wxPoint GetLastSheetPinPosition() const { return m_lastSheetPinPosition; }
|
||||
|
||||
|
||||
@@ -1363,13 +1363,17 @@ SCH_TEXT* SCH_LEGACY_PLUGIN::loadText( FILE_LINE_READER& aReader )
|
||||
|
||||
int thickness = 0;
|
||||
|
||||
// The following tokens do not exist in version 1 schematic files.
|
||||
// The following tokens do not exist in version 1 schematic files,
|
||||
// and not always in version 2 for HLabels and GLabels
|
||||
if( m_version > 1 )
|
||||
{
|
||||
if( strCompare( "Italic", line, &line ) )
|
||||
text->SetItalic( true );
|
||||
else if( !strCompare( "~", line, &line ) )
|
||||
SCH_PARSE_ERROR( _( "expected 'Italics' or '~'" ), aReader, line );
|
||||
if( m_version > 2 || *line >= ' ' )
|
||||
{
|
||||
if( strCompare( "Italic", line, &line ) )
|
||||
text->SetItalic( true );
|
||||
else if( !strCompare( "~", line, &line ) )
|
||||
SCH_PARSE_ERROR( _( "expected 'Italics' or '~'" ), aReader, line );
|
||||
}
|
||||
|
||||
// The thickness token does not exist in older versions of the schematic file format
|
||||
// so calling parseInt will be made only if the EOL is not reached.
|
||||
@@ -1428,7 +1432,7 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( FILE_LINE_READER& aReader )
|
||||
// parsing the symbol name with LIB_ID::Parse() would break symbol library links
|
||||
// that contained '/' and ':' characters.
|
||||
if( m_version > 3 )
|
||||
libId.Parse( libName );
|
||||
libId.Parse( libName, LIB_ID::ID_SCH, true );
|
||||
else
|
||||
libId.SetLibItemName( libName, false );
|
||||
|
||||
@@ -2417,7 +2421,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
||||
SCH_PARSE_ERROR( "$CMP command expected", reader, line );
|
||||
|
||||
parseUnquotedString( aliasName, reader, line, &line ); // Alias name.
|
||||
LIB_ID::FixIllegalChars( aliasName, LIB_ID::ID_ALIAS );
|
||||
aliasName = LIB_ID::FixIllegalChars( aliasName, LIB_ID::ID_SCH );
|
||||
LIB_ALIAS_MAP::iterator it = m_aliases.find( aliasName );
|
||||
|
||||
if( it == m_aliases.end() )
|
||||
|
||||
+107
-5
@@ -117,7 +117,13 @@ SCH_SCREEN::SCH_SCREEN( KIWAY* aKiway ) :
|
||||
SCH_SCREEN::~SCH_SCREEN()
|
||||
{
|
||||
ClearUndoRedoList();
|
||||
FreeDrawList();
|
||||
|
||||
// Now delete items in draw list. We do that only if the list is not empty,
|
||||
// because if the list was appended to another list (see SCH_SCREEN::Append( SCH_SCREEN* aScreen )
|
||||
// it is empty but as no longer the ownership (m_drawList.meOwner == false) of items, and calling
|
||||
// FreeDrawList() with m_drawList.meOwner == false will generate a debug alert in debug mode
|
||||
if( GetDrawItems() )
|
||||
FreeDrawList();
|
||||
}
|
||||
|
||||
|
||||
@@ -529,21 +535,33 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, GR_DRAWMODE aDrawMode
|
||||
* their SCH_SCREEN::Draw() draws nothing
|
||||
*/
|
||||
std::vector< SCH_ITEM* > junctions;
|
||||
std::vector< SCH_ITEM* > middlez;
|
||||
|
||||
// Ensure links are up to date, even if a library was reloaded for some reason:
|
||||
UpdateSymbolLinks();
|
||||
|
||||
// BITMAPs are drawn first, junctions are drawn last
|
||||
// All other items are drawn in the order they were placed in the schematic
|
||||
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
||||
{
|
||||
if( item->IsMoving() || item->IsResized() )
|
||||
continue;
|
||||
|
||||
// TODO: clean this draw routine with a well-defined drawing order (maybe 5.1?)
|
||||
if( item->Type() == SCH_JUNCTION_T )
|
||||
junctions.push_back( item );
|
||||
else
|
||||
// uncomment line below when there is a virtual EDA_ITEM::GetBoundingBox()
|
||||
// if( panel->GetClipBox().Intersects( item->GetBoundingBox() ) )
|
||||
else if( item->Type() == SCH_BITMAP_T )
|
||||
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), aDrawMode, aColor );
|
||||
else
|
||||
middlez.push_back( item );
|
||||
}
|
||||
|
||||
|
||||
for( auto item : middlez )
|
||||
{
|
||||
// uncomment line below when there is a virtual EDA_ITEM::GetBoundingBox()
|
||||
// if( panel->GetClipBox().Intersects( item->GetBoundingBox() ) )
|
||||
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), aDrawMode, aColor );
|
||||
}
|
||||
|
||||
for( auto item : junctions )
|
||||
@@ -716,6 +734,23 @@ void SCH_SCREEN::ClearAnnotation( SCH_SHEET_PATH* aSheetPath )
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREEN::EnsureAlternateReferencesExist()
|
||||
{
|
||||
if( GetClientSheetPathsCount() <= 1 ) // No need for alternate reference
|
||||
return;
|
||||
|
||||
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
||||
{
|
||||
if( item->Type() != SCH_COMPONENT_T )
|
||||
continue;
|
||||
|
||||
// Add (when not existing) all sheet path entries
|
||||
for( unsigned int ii = 0; ii < m_clientSheetPathList.GetCount(); ii++ )
|
||||
((SCH_COMPONENT*)item)->AddSheetPathReferenceEntryIfMissing( m_clientSheetPathList[ii] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREEN::GetHierarchicalItems( EDA_ITEMS& aItems )
|
||||
{
|
||||
SCH_ITEM* item = m_drawList.begin();
|
||||
@@ -887,7 +922,8 @@ int SCH_SCREEN::UpdatePickList()
|
||||
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
|
||||
{
|
||||
// An item is picked if its bounding box intersects the reference area.
|
||||
if( item->HitTest( area ) )
|
||||
if( item->HitTest( area ) &&
|
||||
( !m_BlockLocate.IsDragging() || item->IsType( SCH_COLLECTOR::DraggableItems ) ) )
|
||||
{
|
||||
picker.SetItem( item );
|
||||
m_BlockLocate.PushItem( picker );
|
||||
@@ -1329,6 +1365,47 @@ void SCH_SCREENS::ClearAnnotation()
|
||||
m_screens[i]->ClearAnnotation( NULL );
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREENS::ClearAnnotationOfNewSheetPaths( SCH_SHEET_LIST& aInitialSheetPathList )
|
||||
{
|
||||
// Clear the annotation for the components inside new sheetpaths
|
||||
// not already in aInitialSheetList
|
||||
SCH_SCREENS screensList( g_RootSheet ); // The list of screens, shared by sheet paths
|
||||
screensList.BuildClientSheetPathList(); // build the shared by sheet paths, by screen
|
||||
|
||||
// Search for new sheet paths, not existing in aInitialSheetPathList
|
||||
// and existing in sheetpathList
|
||||
SCH_SHEET_LIST sheetpathList( g_RootSheet );
|
||||
|
||||
for( SCH_SHEET_PATH& sheetpath: sheetpathList )
|
||||
{
|
||||
bool path_exists = false;
|
||||
|
||||
for( const SCH_SHEET_PATH& existing_sheetpath: aInitialSheetPathList )
|
||||
{
|
||||
if( existing_sheetpath.Path() == sheetpath.Path() )
|
||||
{
|
||||
path_exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !path_exists )
|
||||
{
|
||||
// A new sheet path is found: clear the annotation corresponding to this new path:
|
||||
SCH_SCREEN* curr_screen = sheetpath.LastScreen();
|
||||
|
||||
// Clear annotation and create the AR for this path, if not exists,
|
||||
// when the screen is shared by sheet paths.
|
||||
// Otherwise ClearAnnotation do nothing, because the F1 field is used as
|
||||
// reference default value and takes the latest displayed value
|
||||
curr_screen->EnsureAlternateReferencesExist();
|
||||
curr_screen->ClearAnnotation( &sheetpath );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int SCH_SCREENS::ReplaceDuplicateTimeStamps()
|
||||
{
|
||||
EDA_ITEMS items;
|
||||
@@ -1537,3 +1614,28 @@ int SCH_SCREENS::ChangeSymbolLibNickname( const wxString& aFrom, const wxString&
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SCH_SCREENS::BuildClientSheetPathList()
|
||||
{
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||
|
||||
for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
|
||||
curr_screen->GetClientSheetPaths().Clear();
|
||||
|
||||
for( SCH_SHEET_PATH& sheetpath: sheetList )
|
||||
{
|
||||
SCH_SCREEN* used_screen = sheetpath.LastScreen();
|
||||
|
||||
// SEarch for the used_screen in list and add this unique sheet path:
|
||||
for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
|
||||
{
|
||||
if( used_screen == curr_screen )
|
||||
{
|
||||
curr_screen->GetClientSheetPaths().Add( sheetpath.Path() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user