Compare commits
136 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f36c670ff | |||
| d701c3a480 | |||
| cd7f3375b2 | |||
| 46cd185524 | |||
| e04d82e940 | |||
| 26d0863921 | |||
| 37f23fa537 | |||
| 167d408b5e | |||
| d4a8ff4872 | |||
| fb9b12a982 | |||
| 88a03f1a1d | |||
| ba7e400e13 | |||
| 57f0f88552 | |||
| 42a0cf6283 | |||
| b67acd5ea1 | |||
| 5e2721d2f5 | |||
| 2cd43aee0a | |||
| fb1570d290 | |||
| 79972ad4db | |||
| 61934c285c | |||
| a7d554971c | |||
| e54ea90607 | |||
| fda403a079 | |||
| f2e75c96be | |||
| 322eb2b8a8 | |||
| 6f71183d0e | |||
| 5d852cf6ae | |||
| 2d1ea1618b | |||
| 50723d07a6 | |||
| 1161562bc8 | |||
| 0c8b3aaced | |||
| b81b7decf6 | |||
| e5463330ef | |||
| 17c0b3e460 | |||
| 3bc3193805 | |||
| d6db6dedca | |||
| d931bc72c7 | |||
| 6506f77689 | |||
| 0d64b38dbc | |||
| 7856061cf0 | |||
| 0210e414d2 | |||
| 41231e8ae2 | |||
| ba2e34682e | |||
| b234ff9234 | |||
| 3442cc3d1a | |||
| e618e34c94 | |||
| 105c3b0a4c | |||
| 69d0446019 | |||
| 078045f73b | |||
| 78af1daa2e | |||
| 0bd0d57a81 | |||
| 9dd5b6ce37 | |||
| d862cdaa72 | |||
| 4f57de9688 | |||
| 92b6e05909 | |||
| 2bd0bae2f7 | |||
| 69b5d24f28 | |||
| e5dcb9d9da | |||
| 4db8638f7e | |||
| cec885daf9 | |||
| 90fbf27114 | |||
| f1436cec9b | |||
| cf968cb6b5 | |||
| 2278f40051 | |||
| 18a76d3a87 | |||
| 6a65461ec7 | |||
| a5a0a7c4f3 | |||
| f1e6f8042c | |||
| 848873d87e | |||
| 75bb864237 | |||
| d5275b16aa | |||
| 15d1b6cef0 | |||
| 6d4dd3e17a | |||
| 649c22a34e | |||
| 8d04d39036 | |||
| 0e90c719b0 | |||
| a79526cad8 | |||
| d05d8b6100 | |||
| 9856867954 | |||
| 19064b680e | |||
| 95265c765b | |||
| 1ed8912f57 | |||
| 82a0eb4413 | |||
| be7215402b | |||
| 4500b064d8 | |||
| 93d191d7c9 | |||
| 1607ceaf3e | |||
| 5b24ea9dd9 | |||
| c879dcaf7d | |||
| 86691dabbf | |||
| fe71a66bb9 | |||
| 80e0d848f2 | |||
| 8b3a2984bf | |||
| fccce265aa | |||
| a43a228f78 | |||
| dd8610fd5c | |||
| b991beb712 | |||
| 25f6483488 | |||
| efc0325e14 | |||
| d19ec021fe | |||
| b34a307936 | |||
| fb565caf7b | |||
| 6796e8fff6 | |||
| 213547f545 | |||
| 73851e962b | |||
| de22204514 | |||
| ebba15fe67 | |||
| c1cd3339fa | |||
| 713a296a59 | |||
| 06bde527d5 | |||
| dcd31f5701 | |||
| 65f2af5849 | |||
| 2dd7a8637c | |||
| 211d056728 | |||
| dc0aed5b16 | |||
| 5064df4ba2 | |||
| 469c31da97 | |||
| 5fb41e6ecc | |||
| a68a442bbb | |||
| 84db5644d6 | |||
| fc1fb7a590 | |||
| dc91d4eca8 | |||
| f6a42a36d6 | |||
| 2a769dc0b0 | |||
| 3475bfb2aa | |||
| f9f8fade89 | |||
| e404fb772b | |||
| 2a9412042c | |||
| e8ab661504 | |||
| 3f91db25d4 | |||
| 300381ba4d | |||
| 4363e6a213 | |||
| 450dac4b1e | |||
| 278127fe29 | |||
| 23d71de75f | |||
| d86789898d |
@@ -66,7 +66,6 @@ CINFO3D_VISU::CINFO3D_VISU() :
|
||||
m_boardCenter = SFVEC3F( 0.0f );
|
||||
|
||||
m_boardBoudingBox.Reset();
|
||||
m_board2dBBox3DU.Reset();
|
||||
|
||||
m_layers_container2D.clear();
|
||||
m_layers_holes2D.clear();
|
||||
@@ -462,8 +461,6 @@ void CINFO3D_VISU::createBoardPolygon()
|
||||
errmsg.append( _( "Cannot determine the board outline." ) );
|
||||
wxLogMessage( errmsg );
|
||||
}
|
||||
|
||||
Polygon_Calc_BBox_3DU( m_board_poly, m_board2dBBox3DU, m_biuTo3Dunits );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -550,9 +550,6 @@ class CINFO3D_VISU
|
||||
/// 3d bouding box of the pcb board in 3d units
|
||||
CBBOX m_boardBoudingBox;
|
||||
|
||||
/// 2d bouding box of the pcb board in 3d units
|
||||
CBBOX2D m_board2dBBox3DU;
|
||||
|
||||
/// It contains polygon contours for each layer
|
||||
MAP_POLY m_layers_poly;
|
||||
|
||||
|
||||
@@ -62,13 +62,11 @@
|
||||
static int s_textWidth;
|
||||
static CGENERICCONTAINER2D *s_dstcontainer = NULL;
|
||||
static float s_biuTo3Dunits;
|
||||
static const CBBOX2D *s_boardBBox3DU = NULL;
|
||||
static const BOARD_ITEM *s_boardItem = NULL;
|
||||
|
||||
// This is a call back function, used by DrawGraphicText to draw the 3D text shape:
|
||||
void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData )
|
||||
{
|
||||
wxASSERT( s_boardBBox3DU != NULL );
|
||||
wxASSERT( s_dstcontainer != NULL );
|
||||
|
||||
const SFVEC2F start3DU( x0 * s_biuTo3Dunits, -y0 * s_biuTo3Dunits );
|
||||
@@ -76,7 +74,7 @@ void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData )
|
||||
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
s_dstcontainer->Add( new CFILLEDCIRCLE2D( start3DU,
|
||||
s_textWidth * s_biuTo3Dunits,
|
||||
( s_textWidth / 2 ) * s_biuTo3Dunits,
|
||||
*s_boardItem) );
|
||||
else
|
||||
s_dstcontainer->Add( new CROUNDSEGMENT2D( start3DU,
|
||||
@@ -103,7 +101,6 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB,
|
||||
s_dstcontainer = aDstContainer;
|
||||
s_textWidth = aTextPCB->GetThickness() + ( 2 * aClearanceValue );
|
||||
s_biuTo3Dunits = m_biuTo3Dunits;
|
||||
s_boardBBox3DU = &m_board2dBBox3DU;
|
||||
|
||||
// not actually used, but needed by DrawGraphicText
|
||||
const COLOR4D dummy_color = COLOR4D::BLACK;
|
||||
@@ -228,7 +225,6 @@ void CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMod
|
||||
s_boardItem = (const BOARD_ITEM *)&aModule->Value();
|
||||
s_dstcontainer = aDstContainer;
|
||||
s_biuTo3Dunits = m_biuTo3Dunits;
|
||||
s_boardBBox3DU = &m_board2dBBox3DU;
|
||||
|
||||
for( unsigned ii = 0; ii < texts.size(); ++ii )
|
||||
{
|
||||
|
||||
@@ -198,6 +198,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
0.00f, 0.30f );
|
||||
|
||||
m_materials.m_Copper.m_Shininess = shininessfactor * 128.0f;
|
||||
m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
||||
// Paste material mixed with paste color
|
||||
@@ -213,6 +214,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
m_settings.m_SolderPasteColor.b );
|
||||
|
||||
m_materials.m_Paste.m_Shininess = 0.1f * 128.0f;
|
||||
m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
||||
// Silk screen material mixed with silk screen color
|
||||
@@ -228,6 +230,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
m_settings.m_SilkScreenColor.b + 0.10f );
|
||||
|
||||
m_materials.m_SilkS.m_Shininess = 0.078125f * 128.0f;
|
||||
m_materials.m_SilkS.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
||||
// Solder mask material mixed with solder mask color
|
||||
@@ -244,6 +247,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
|
||||
m_materials.m_SolderMask.m_Shininess = 0.8f * 128.0f;
|
||||
m_materials.m_SolderMask.m_Transparency = 0.17f;
|
||||
m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
|
||||
// Epoxy material
|
||||
@@ -258,6 +262,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
20.0f / 255.0f );
|
||||
|
||||
m_materials.m_EpoxyBoard.m_Shininess = 0.1f * 128.0f;
|
||||
m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
}
|
||||
else // Technical Mode
|
||||
{
|
||||
@@ -269,34 +274,40 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
|
||||
m_materials.m_Copper.m_Ambient = matAmbientColor;
|
||||
m_materials.m_Copper.m_Specular = matSpecularColor;
|
||||
m_materials.m_Copper.m_Shininess = matShininess;
|
||||
m_materials.m_Copper.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
// Paste material
|
||||
m_materials.m_Paste.m_Ambient = matAmbientColor;
|
||||
m_materials.m_Paste.m_Specular = matSpecularColor;
|
||||
m_materials.m_Paste.m_Shininess = matShininess;
|
||||
m_materials.m_Paste.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
// Silk screen material
|
||||
m_materials.m_SilkS.m_Ambient = matAmbientColor;
|
||||
m_materials.m_SilkS.m_Specular = matSpecularColor;
|
||||
m_materials.m_SilkS.m_Shininess = matShininess;
|
||||
m_materials.m_SilkS.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
// Solder mask material
|
||||
m_materials.m_SolderMask.m_Ambient = matAmbientColor;
|
||||
m_materials.m_SolderMask.m_Specular = matSpecularColor;
|
||||
m_materials.m_SolderMask.m_Shininess = matShininess;
|
||||
m_materials.m_SolderMask.m_Transparency = 0.17f;
|
||||
m_materials.m_SolderMask.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
// Epoxy material
|
||||
m_materials.m_EpoxyBoard.m_Ambient = matAmbientColor;
|
||||
m_materials.m_EpoxyBoard.m_Diffuse = m_settings.m_BoardBodyColor;
|
||||
m_materials.m_EpoxyBoard.m_Specular = matSpecularColor;
|
||||
m_materials.m_EpoxyBoard.m_Shininess = matShininess;
|
||||
m_materials.m_EpoxyBoard.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
// Gray material (used for example in technical vias and pad holes)
|
||||
m_materials.m_GrayMaterial.m_Ambient = SFVEC3F( 0.8f, 0.8f, 0.8f );
|
||||
m_materials.m_GrayMaterial.m_Diffuse = SFVEC3F( 0.3f, 0.3f, 0.3f );
|
||||
m_materials.m_GrayMaterial.m_Specular = SFVEC3F( 0.4f, 0.4f, 0.4f );
|
||||
m_materials.m_GrayMaterial.m_Shininess = 0.01f * 128.0f;
|
||||
m_materials.m_GrayMaterial.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,6 +358,7 @@ void C3D_RENDER_OGL_LEGACY::set_layer_material( PCB_LAYER_ID aLayerID )
|
||||
m_materials.m_Plastic.m_Diffuse.b * 0.7f );
|
||||
|
||||
m_materials.m_Plastic.m_Shininess = 0.078125f * 128.0f;
|
||||
m_materials.m_Plastic.m_Emissive = SFVEC3F( 0.0f, 0.0f, 0.0f );
|
||||
OGL_SetMaterial( m_materials.m_Plastic );
|
||||
break;
|
||||
|
||||
|
||||
@@ -711,35 +711,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks(
|
||||
}
|
||||
|
||||
|
||||
void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList,
|
||||
CBBOX2D &aOutBBox ,
|
||||
float aBiuTo3DunitsScale )
|
||||
{
|
||||
aOutBBox.Reset();
|
||||
|
||||
for( int idx = 0; idx < aPolysList.OutlineCount(); ++idx )
|
||||
{
|
||||
// Each polygon in aPolysList is a polygon with holes
|
||||
const SHAPE_POLY_SET::POLYGON& curr_polywithholes = aPolysList.CPolygon( idx );
|
||||
|
||||
for( unsigned ipoly = 0; ipoly < curr_polywithholes.size(); ++ipoly )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN& path = curr_polywithholes[ipoly]; // a simple polygon
|
||||
|
||||
for( int jj = 0; jj < path.PointCount(); jj++ )
|
||||
{
|
||||
const VECTOR2I& a = path.CPoint( jj );
|
||||
|
||||
aOutBBox.Union( SFVEC2F( (float) a.x * aBiuTo3DunitsScale,
|
||||
(float)-a.y * aBiuTo3DunitsScale ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aOutBBox.ScaleNextUp();
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
static void polygon_Convert( const ClipperLib::Path &aPath,
|
||||
SEGMENTS &aOutSegment,
|
||||
|
||||
@@ -150,10 +150,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks(
|
||||
float aDivFactor,
|
||||
const BOARD_ITEM &aBoardItem );
|
||||
|
||||
void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList,
|
||||
CBBOX2D &aOutBBox,
|
||||
float aBiuTo3DunitsScale );
|
||||
|
||||
void Polygon2d_TestModule();
|
||||
|
||||
#endif // _CPOLYGON2D_H_
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
bool IsPointInside( const SFVEC2F &aPoint ) const override;
|
||||
};
|
||||
|
||||
static const float s_min_dot = (FLT_EPSILON * 4.0f) ;
|
||||
static const float s_min_dot = (FLT_EPSILON * 4.0f * FLT_EPSILON * 4.0f) ;
|
||||
|
||||
/**
|
||||
* @brief Segment_is_a_circle - check if segment start and end is very close to each other
|
||||
|
||||
@@ -761,7 +761,7 @@ void EDA_3D_VIEWER::LoadSettings( wxConfigBase *aCfg )
|
||||
aCfg->Read( keyRenderRAY_Shadows, &tmp, true );
|
||||
m_settings.SetFlag( FL_RENDER_RAYTRACING_SHADOWS, tmp );
|
||||
|
||||
aCfg->Read( keyRenderRAY_Backfloor, &tmp, true );
|
||||
aCfg->Read( keyRenderRAY_Backfloor, &tmp, false );
|
||||
m_settings.SetFlag( FL_RENDER_RAYTRACING_BACKFLOOR, tmp );
|
||||
|
||||
aCfg->Read( keyRenderRAY_Refractions, &tmp, true );
|
||||
|
||||
@@ -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.1.4" )
|
||||
set( KICAD_VERSION "5.1.5" )
|
||||
|
||||
@@ -8,14 +8,20 @@
|
||||
static const unsigned char png[] = {
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
|
||||
0x61, 0x00, 0x00, 0x00, 0x60, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0x90, 0x92, 0x92, 0xfa,
|
||||
0x0f, 0xc2, 0x0c, 0xe4, 0x02, 0xaa, 0x19, 0x20, 0x2e, 0x2e, 0x2e, 0x46, 0x91, 0x01, 0xd2, 0xd2,
|
||||
0xd2, 0x97, 0xc9, 0x32, 0x04, 0x66, 0x00, 0x14, 0x5f, 0x97, 0x97, 0x97, 0x97, 0x24, 0xd7, 0x80,
|
||||
0x4b, 0x64, 0x19, 0x02, 0x33, 0x40, 0x42, 0x42, 0x42, 0x94, 0x2c, 0x43, 0x90, 0x63, 0x01, 0x14,
|
||||
0x06, 0xa0, 0xb0, 0x40, 0xf3, 0x16, 0x5e, 0x4c, 0x3d, 0x03, 0xd0, 0xbd, 0x20, 0x2a, 0x2a, 0x2a,
|
||||
0x41, 0x76, 0x20, 0x12, 0xad, 0x19, 0x5b, 0x34, 0x92, 0xa4, 0x99, 0xaa, 0x09, 0x89, 0xe2, 0xa4,
|
||||
0x3c, 0x60, 0xb9, 0x11, 0x00, 0xd8, 0xbd, 0x63, 0x3e, 0x86, 0xe5, 0x97, 0x0f, 0x00, 0x00, 0x00,
|
||||
0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
|
||||
0x61, 0x00, 0x00, 0x00, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0x60, 0x40, 0x03, 0x52,
|
||||
0x52, 0x52, 0xff, 0x41, 0x98, 0x01, 0x0b, 0x10, 0x11, 0x11, 0xe1, 0x95, 0x94, 0x94, 0xdc, 0xca,
|
||||
0x80, 0x0f, 0xe0, 0x32, 0x40, 0x5a, 0x5a, 0x5a, 0x06, 0x28, 0x7e, 0x1e, 0x97, 0xe1, 0x70, 0x1b,
|
||||
0xb0, 0x19, 0x20, 0x23, 0x23, 0x63, 0x06, 0x14, 0x7b, 0x81, 0xcf, 0x75, 0x20, 0xc0, 0x08, 0xb4,
|
||||
0x65, 0x2d, 0xba, 0x22, 0xa0, 0x93, 0x83, 0x80, 0xfc, 0xaf, 0x30, 0x71, 0x9c, 0x06, 0x00, 0x35,
|
||||
0xd7, 0xa0, 0x2b, 0x02, 0xd2, 0x65, 0x40, 0xfc, 0x17, 0x2a, 0x36, 0x0b, 0xa7, 0x01, 0x40, 0x41,
|
||||
0x37, 0x20, 0xfe, 0x83, 0xa4, 0x18, 0x84, 0xa7, 0x42, 0xe9, 0x7f, 0x40, 0xdc, 0x80, 0x33, 0x7c,
|
||||
0x80, 0xfe, 0x53, 0x05, 0x0a, 0xbe, 0x07, 0x49, 0x00, 0x9d, 0x5b, 0x85, 0xec, 0x0a, 0x20, 0xfe,
|
||||
0x0e, 0xc4, 0x11, 0x78, 0x03, 0x18, 0x28, 0x70, 0x05, 0x24, 0x08, 0xf2, 0x3f, 0x28, 0x1c, 0xd0,
|
||||
0x0c, 0x20, 0x88, 0x29, 0x37, 0x40, 0x5c, 0x5c, 0x5c, 0x11, 0xc8, 0x78, 0x03, 0x35, 0xa4, 0x9a,
|
||||
0x50, 0x54, 0xe1, 0x4a, 0x3c, 0xae, 0xe8, 0x81, 0xc8, 0x40, 0x2a, 0x40, 0xb6, 0x9d, 0x2c, 0x03,
|
||||
0x70, 0x25, 0x24, 0x92, 0x00, 0xae, 0xa4, 0x4c, 0x6a, 0x78, 0xd0, 0xd7, 0x00, 0x00, 0xe0, 0x1c,
|
||||
0x80, 0xeb, 0x37, 0x41, 0x6c, 0xd9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
|
||||
0x60, 0x82,
|
||||
};
|
||||
|
||||
const BITMAP_OPAQUE pinshape_clock_fall_xpm[1] = {{ png, sizeof( png ), "pinshape_clock_fall_xpm" }};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
width="16"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="pinshape_clock_active_low.svg">
|
||||
<metadata
|
||||
id="metadata22">
|
||||
@@ -21,8 +21,23 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
@@ -36,15 +51,15 @@
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1033"
|
||||
id="namedview18"
|
||||
showgrid="true"
|
||||
inkscape:zoom="24.969708"
|
||||
inkscape:cx="4.4578733"
|
||||
inkscape:cy="9.2981956"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-x="-4"
|
||||
inkscape:window-y="-4"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2">
|
||||
<inkscape:grid
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -11,8 +11,8 @@
|
||||
width="16"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="pinshape_clock_fall.svg">
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="pinshape_clock_active_low.svg">
|
||||
<metadata
|
||||
id="metadata22">
|
||||
<rdf:RDF>
|
||||
@@ -21,8 +21,23 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
@@ -36,15 +51,15 @@
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1033"
|
||||
id="namedview18"
|
||||
showgrid="true"
|
||||
inkscape:zoom="24.969708"
|
||||
inkscape:cx="4.4578733"
|
||||
inkscape:cy="9.2981956"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-x="-4"
|
||||
inkscape:window-y="-4"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2">
|
||||
<inkscape:grid
|
||||
@@ -56,19 +71,25 @@
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<path
|
||||
d="M 1,0 1,16"
|
||||
d="M 5,0 5,16"
|
||||
id="path12"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
d="M 6,8 16,8"
|
||||
d="M 5,8 16,8"
|
||||
id="path14"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
d="M 1,13 6,8 1,3"
|
||||
sodipodi:nodetypes="ccc"
|
||||
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4010"
|
||||
d="m 5,8 7,-6 0,6" />
|
||||
<path
|
||||
d="M 5,13 1,8 5,3"
|
||||
id="path4094"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#1a1a1a;stroke-width:2;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -11,8 +11,8 @@
|
||||
width="16"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="pinshape_clock_normal.svg">
|
||||
inkscape:version="0.92.0 r15299"
|
||||
sodipodi:docname="pinshape_clock_invert.svg">
|
||||
<metadata
|
||||
id="metadata22">
|
||||
<rdf:RDF>
|
||||
@@ -22,7 +22,22 @@
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
@@ -36,15 +51,15 @@
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1033"
|
||||
id="namedview18"
|
||||
showgrid="true"
|
||||
inkscape:zoom="24.969708"
|
||||
inkscape:cx="18.434809"
|
||||
inkscape:cy="9.4183412"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-x="-4"
|
||||
inkscape:window-y="-4"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2">
|
||||
<inkscape:grid
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -405,6 +405,9 @@ bool EDA_RECT::Intersects( const wxPoint& aPoint1, const wxPoint& aPoint2 ) cons
|
||||
|
||||
bool EDA_RECT::Intersects( const EDA_RECT& aRect ) const
|
||||
{
|
||||
if( !m_init )
|
||||
return false;
|
||||
|
||||
// this logic taken from wxWidgets' geometry.cpp file:
|
||||
bool rc;
|
||||
EDA_RECT me(*this);
|
||||
@@ -433,6 +436,9 @@ bool EDA_RECT::Intersects( const EDA_RECT& aRect ) const
|
||||
|
||||
bool EDA_RECT::Intersects( const EDA_RECT& aRect, double aRot ) const
|
||||
{
|
||||
if( !m_init )
|
||||
return false;
|
||||
|
||||
/* Most rectangles will be axis aligned.
|
||||
* It is quicker to check for this case and pass the rect
|
||||
* to the simpler intersection test
|
||||
@@ -565,6 +571,9 @@ const wxPoint EDA_RECT::FarthestPointTo( const wxPoint& aPoint ) const
|
||||
|
||||
bool EDA_RECT::IntersectsCircle( const wxPoint& aCenter, const int aRadius ) const
|
||||
{
|
||||
if( !m_init )
|
||||
return false;
|
||||
|
||||
wxPoint closest = ClosestPointTo( aCenter );
|
||||
|
||||
double dx = aCenter.x - closest.x;
|
||||
@@ -578,6 +587,9 @@ bool EDA_RECT::IntersectsCircle( const wxPoint& aCenter, const int aRadius ) con
|
||||
|
||||
bool EDA_RECT::IntersectsCircleEdge( const wxPoint& aCenter, const int aRadius, const int aWidth ) const
|
||||
{
|
||||
if( !m_init )
|
||||
return false;
|
||||
|
||||
EDA_RECT me( *this );
|
||||
me.Normalize(); // ensure size is >= 0
|
||||
|
||||
@@ -675,6 +687,17 @@ EDA_RECT& EDA_RECT::Inflate( wxCoord dx, wxCoord dy )
|
||||
|
||||
void EDA_RECT::Merge( const EDA_RECT& aRect )
|
||||
{
|
||||
if( !m_init )
|
||||
{
|
||||
if( aRect.IsValid() )
|
||||
{
|
||||
m_Pos = aRect.GetPosition();
|
||||
m_Size = aRect.GetSize();
|
||||
m_init = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Normalize(); // ensure width and height >= 0
|
||||
EDA_RECT rect = aRect;
|
||||
rect.Normalize(); // ensure width and height >= 0
|
||||
@@ -692,6 +715,13 @@ void EDA_RECT::Merge( const EDA_RECT& aRect )
|
||||
|
||||
void EDA_RECT::Merge( const wxPoint& aPoint )
|
||||
{
|
||||
if( !m_init )
|
||||
{
|
||||
m_Pos = aPoint;
|
||||
m_Size = wxSize( 0, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
Normalize(); // ensure width and height >= 0
|
||||
|
||||
wxPoint end = GetEnd();
|
||||
|
||||
@@ -167,11 +167,6 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
<< HtmlHyperlink( "https://forum.kicad.info" )
|
||||
<< "</li>";
|
||||
|
||||
description << "<li>"
|
||||
<<_( "KiCad user's group - " )
|
||||
<< HtmlHyperlink( "https://groups.yahoo.com/neo/groups/kicad-users/info" )
|
||||
<< "</li>";
|
||||
|
||||
description << "</ul></p>";
|
||||
|
||||
aInfo.SetDescription( description );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -12,33 +12,36 @@
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* bMainSizer;
|
||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_htmlWindow = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
|
||||
m_htmlWindow->SetMinSize( wxSize( 400,250 ) );
|
||||
|
||||
|
||||
bMainSizer->Add( m_htmlWindow, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonClose = new wxButton( this, wxID_CANCEL, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonClose->SetDefault();
|
||||
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
||||
m_sdbSizer1->Realize();
|
||||
|
||||
bMainSizer->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bMainSizer );
|
||||
this->Layout();
|
||||
bMainSizer->Fit( this );
|
||||
|
||||
|
||||
// Connect Events
|
||||
m_htmlWindow->Connect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
|
||||
m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this );
|
||||
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
|
||||
}
|
||||
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_htmlWindow->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
|
||||
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this );
|
||||
|
||||
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnOKButtonClick ), NULL, this );
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<FileVersion major="1" minor="15" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
@@ -14,6 +14,8 @@
|
||||
<property name="file">dialog_display_info_HTML_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_display_info_HTML</property>
|
||||
<property name="namespace"></property>
|
||||
@@ -24,6 +26,7 @@
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
@@ -52,52 +55,16 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></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 class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="name">bMainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxHtmlWindow" expanded="1">
|
||||
<object class="wxHtmlWindow" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
@@ -149,120 +116,26 @@
|
||||
<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="OnHtmlCellClicked"></event>
|
||||
<event name="OnHtmlCellHover"></event>
|
||||
<event name="OnHtmlLinkClicked">OnHTMLLinkClicked</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">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="flag">wxBOTTOM|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" 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">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_CANCEL</property>
|
||||
<property name="label">OK</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>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">0</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_buttonClose</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="name">m_sdbSizer1</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"></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="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnCloseButtonClick</event>
|
||||
<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>
|
||||
<event name="OnOKButtonClick">OnOKButtonClick</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_DISPLAY_INFO_HTML_BASE_H__
|
||||
#define __DIALOG_DISPLAY_INFO_HTML_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@@ -18,8 +17,8 @@
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -31,21 +30,21 @@
|
||||
class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
wxButton* m_buttonClose;
|
||||
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); }
|
||||
virtual void OnCloseButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
wxHtmlWindow* m_htmlWindow;
|
||||
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_DISPLAY_HTML_TEXT_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_DISPLAY_INFO_HTML_BASE_H__
|
||||
|
||||
@@ -148,8 +148,6 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
|
||||
|
||||
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
{
|
||||
m_viewControls->UpdateScrollbars();
|
||||
|
||||
// Update current zoom settings if the canvas is managed by a EDA frame
|
||||
// (i.e. not by a preview panel in a dialog)
|
||||
if( GetParentEDAFrame() && GetParentEDAFrame()->GetScreen() )
|
||||
@@ -160,6 +158,8 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
GetParentEDAFrame()->SetScrollCenterPosition( wxPoint( center.x, center.y ) );
|
||||
}
|
||||
|
||||
m_viewControls->UpdateScrollbars();
|
||||
|
||||
if( !m_gal->IsVisible() )
|
||||
return;
|
||||
|
||||
|
||||
@@ -259,11 +259,12 @@ long long FP_LIB_TABLE::GenerateTimestamp( const wxString* aNickname )
|
||||
}
|
||||
|
||||
|
||||
void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname )
|
||||
void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname,
|
||||
bool aBestEfforts )
|
||||
{
|
||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname );
|
||||
wxASSERT( (PLUGIN*) row->plugin );
|
||||
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ),
|
||||
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ), aBestEfforts,
|
||||
row->GetProperties() );
|
||||
}
|
||||
|
||||
|
||||
@@ -63,11 +63,13 @@ CAIRO_PRINT_CTX::CAIRO_PRINT_CTX( wxDC* aDC )
|
||||
#ifdef __WXGTK__
|
||||
m_ctx = static_cast<cairo_t*>( gctx->GetNativeContext() );
|
||||
m_surface = cairo_get_target( m_ctx );
|
||||
// On linux, cairo printers are 72 DPI by default. This is an ususable resolution for us.
|
||||
// A reasonable resolution is 600 DPI
|
||||
// On linux, cairo printers have 72 DPI by default.
|
||||
// This is an unusable resolution for us.
|
||||
// A better resolution could be 4800 DPI (at 600 DPI, we still have minor
|
||||
// but visible artifacts, for instance with arcs, but not at 4800 DPI)
|
||||
// so modify the default:
|
||||
#define DEFAULT_DPI 72.0
|
||||
#define KICAD_PRINTER_DPI 600.0
|
||||
#define KICAD_PRINTER_DPI 4800.0
|
||||
// our device scale is DEFAULT_DPI / KICAD_PRINTER_DPI
|
||||
cairo_surface_set_device_scale( m_surface, DEFAULT_DPI/KICAD_PRINTER_DPI, DEFAULT_DPI/KICAD_PRINTER_DPI );
|
||||
m_dpi = KICAD_PRINTER_DPI;
|
||||
|
||||
@@ -60,7 +60,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
|
||||
double glyphEndX = 0.0;
|
||||
VECTOR2D glyphBoundingX;
|
||||
|
||||
std::deque<VECTOR2D>* pointList = nullptr;
|
||||
std::vector<VECTOR2D>* pointList = nullptr;
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -105,7 +105,7 @@ bool STROKE_FONT::LoadNewStrokeFont( const char* const aNewStrokeFont[], int aNe
|
||||
|
||||
if( !pointList )
|
||||
{
|
||||
glyph.emplace_back( std::deque<VECTOR2D>() );
|
||||
glyph.emplace_back( std::vector<VECTOR2D>() );
|
||||
pointList = &glyph.back();
|
||||
}
|
||||
|
||||
@@ -140,17 +140,16 @@ BOX2D STROKE_FONT::computeBoundingBox( const GLYPH& aGLYPH, const VECTOR2D& aGLY
|
||||
{
|
||||
BOX2D boundingBox;
|
||||
|
||||
std::deque<VECTOR2D> boundingPoints;
|
||||
std::vector<VECTOR2D> boundingPoints;
|
||||
|
||||
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.x, 0 ) );
|
||||
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.y, 0 ) );
|
||||
|
||||
for( GLYPH::const_iterator pointListIt = aGLYPH.begin(); pointListIt != aGLYPH.end(); ++pointListIt )
|
||||
for( const auto& pointList : aGLYPH )
|
||||
{
|
||||
for( std::deque<VECTOR2D>::const_iterator pointIt = pointListIt->begin();
|
||||
pointIt != pointListIt->end(); ++pointIt )
|
||||
for( const auto& pt : pointList )
|
||||
{
|
||||
boundingPoints.emplace_back( VECTOR2D( aGLYPHBoundingX.x, pointIt->y ) );
|
||||
boundingPoints.emplace_back( aGLYPHBoundingX.x, pt.y );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,15 +340,13 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText )
|
||||
last_had_overbar = false;
|
||||
}
|
||||
|
||||
for( GLYPH::iterator pointListIt = glyph.begin(); pointListIt != glyph.end();
|
||||
++pointListIt )
|
||||
for( const auto& pointList : glyph )
|
||||
{
|
||||
std::deque<VECTOR2D> pointListScaled;
|
||||
|
||||
for( std::deque<VECTOR2D>::iterator pointIt = pointListIt->begin();
|
||||
pointIt != pointListIt->end(); ++pointIt )
|
||||
for( const auto& pt : pointList )
|
||||
{
|
||||
VECTOR2D pointPos( pointIt->x * glyphSize.x + xOffset, pointIt->y * glyphSize.y );
|
||||
VECTOR2D pointPos( pt.x * glyphSize.x + xOffset, pt.y * glyphSize.y );
|
||||
|
||||
if( m_gal->IsFontItalic() )
|
||||
{
|
||||
|
||||
@@ -170,8 +170,8 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
||||
attribute_string = "TA.AperFunction,Conductor";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_CUTOUT: // print info associated to a outline
|
||||
attribute_string = "TA.AperFunction,CutOut";
|
||||
case GBR_APERTURE_ATTRIB_EDGECUT: // print info associated to a board outline (edge.cut layer)
|
||||
attribute_string = "TA.AperFunction,Profile";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_VIAPAD: // print info associated to a flashed via
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <trigo.h>
|
||||
#include <common.h>
|
||||
#include <math_for_graphics.h>
|
||||
#include <geometry/seg.h>
|
||||
|
||||
// Returns true if the point P is on the segment S.
|
||||
// faster than TestSegmentHit() because P should be exactly on S
|
||||
@@ -151,32 +152,8 @@ bool TestSegmentHit( const wxPoint &aRefPoint, wxPoint aStart, wxPoint aEnd, int
|
||||
if( aStart.y == aEnd.y && aRefPoint.x > xmin && aRefPoint.x < xmax )
|
||||
return std::abs( delta.y ) <= aDist;
|
||||
|
||||
// Special case for a segment with start == end (equal to a circle)
|
||||
if ( aStart == aEnd )
|
||||
{
|
||||
long double length_square = (long double) delta.x * delta.x + (long double) delta.y * delta.y;
|
||||
long double dist_square = (long double) aDist * aDist;
|
||||
|
||||
return ( length_square <= dist_square );
|
||||
}
|
||||
|
||||
wxPoint len = aEnd - aStart;
|
||||
// Precision note here:
|
||||
// These are 32-bit integers, so squaring requires 64 bits to represent
|
||||
// exactly. 64-bit Doubles have only 52 bits in the mantissa, so we start to lose
|
||||
// precision at 2^53, which corresponds to ~ ±1nm @ 9.5cm, 2nm at 90cm, etc...
|
||||
// Long doubles avoid this ambiguity as well as the more expensive denormal double calc
|
||||
// Long doubles usually (sometimes more if SIMD) have at least 64 bits in the mantissa
|
||||
long double length_square = (long double) len.x * len.x + (long double) len.y * len.y;
|
||||
long double cross = std::abs( (long double) len.x * delta.y - (long double) len.y * delta.x );
|
||||
long double dist_square = (long double) aDist * aDist;
|
||||
|
||||
// The perpendicular distance to a line is the vector magnitude of the line from
|
||||
// a test point to the test line. That is the 2d determinant. Because we handled
|
||||
// the zero length case above, so we are guaranteed a unique solution.
|
||||
|
||||
return ( ( length_square >= cross && dist_square >= cross ) ||
|
||||
( length_square * dist_square >= cross * cross ) );
|
||||
SEG segment( aStart, aEnd );
|
||||
return segment.PointCloserThan( aRefPoint, aDist + 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-5
@@ -347,27 +347,27 @@ bool OpenPDF( const wxString& file )
|
||||
wxString command;
|
||||
wxString filename = file;
|
||||
|
||||
// Quote in case there are spaces in the file name.
|
||||
AddDelimiterString( filename );
|
||||
|
||||
Pgm().ReadPdfBrowserInfos();
|
||||
|
||||
if( !Pgm().UseSystemPdfBrowser() ) // Run the preferred PDF Browser
|
||||
{
|
||||
command = Pgm().GetPdfBrowserName() + wxT( " " ) + filename;
|
||||
command = Pgm().GetPdfBrowserName() + wxT( " '" ) + filename + wxT( "'" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( wxLaunchDefaultApplication( filename ) )
|
||||
return true;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
command = wxT( "/usr/bin/open -a '" ) + filename + wxT( "'" );
|
||||
#endif
|
||||
// If launching the system default PDF viewer fails, fall through with empty command
|
||||
// string so the error message is displayed.
|
||||
}
|
||||
|
||||
if( !command.IsEmpty() )
|
||||
{
|
||||
if( ProcessExecute( command ) )
|
||||
if( ProcessExecute( command ) != -1 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
+50
-50
@@ -39,7 +39,7 @@ static inline size_t hash_board_item( const BOARD_ITEM* aItem, int aFlags )
|
||||
size_t ret = 0;
|
||||
|
||||
if( aFlags & LAYER )
|
||||
ret ^= hash<unsigned long long>{}( aItem->GetLayerSet().to_ullong() );
|
||||
ret = hash<unsigned long long>{}( aItem->GetLayerSet().to_ullong() );
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -55,57 +55,57 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
|
||||
{
|
||||
const MODULE* module = static_cast<const MODULE*>( aItem );
|
||||
|
||||
ret ^= hash_board_item( module, aFlags );
|
||||
ret += hash_board_item( module, aFlags );
|
||||
|
||||
if( aFlags & POSITION )
|
||||
{
|
||||
ret ^= hash<int>{}( module->GetPosition().x );
|
||||
ret ^= hash<int>{}( module->GetPosition().y );
|
||||
ret += hash<int>{}( module->GetPosition().x );
|
||||
ret += hash<int>{}( module->GetPosition().y );
|
||||
}
|
||||
|
||||
if( aFlags & ROTATION )
|
||||
ret ^= hash<double>{}( module->GetOrientation() );
|
||||
ret += hash<double>{}( module->GetOrientation() );
|
||||
|
||||
for( const BOARD_ITEM* i = module->GraphicalItemsList(); i; i = i->Next() )
|
||||
ret ^= hash_eda( i, aFlags );
|
||||
ret += hash_eda( i, aFlags );
|
||||
|
||||
for( const D_PAD* i = module->PadsList(); i; i = i->Next() )
|
||||
ret ^= hash_eda( i, aFlags );
|
||||
ret += hash_eda( i, aFlags );
|
||||
}
|
||||
break;
|
||||
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
const D_PAD* pad = static_cast<const D_PAD*>( aItem );
|
||||
ret ^= hash_board_item( pad, aFlags );
|
||||
ret ^= hash<int>{}( pad->GetShape() << 16 );
|
||||
ret ^= hash<int>{}( pad->GetDrillShape() << 18 );
|
||||
ret ^= hash<int>{}( pad->GetSize().x << 8 );
|
||||
ret ^= hash<int>{}( pad->GetSize().y << 9 );
|
||||
ret ^= hash<int>{}( pad->GetOffset().x << 6 );
|
||||
ret ^= hash<int>{}( pad->GetOffset().y << 7 );
|
||||
ret ^= hash<int>{}( pad->GetDelta().x << 4 );
|
||||
ret ^= hash<int>{}( pad->GetDelta().y << 5 );
|
||||
ret += hash_board_item( pad, aFlags );
|
||||
ret += hash<int>{}( pad->GetShape() << 16 );
|
||||
ret += hash<int>{}( pad->GetDrillShape() << 18 );
|
||||
ret += hash<int>{}( pad->GetSize().x << 8 );
|
||||
ret += hash<int>{}( pad->GetSize().y << 9 );
|
||||
ret += hash<int>{}( pad->GetOffset().x << 6 );
|
||||
ret += hash<int>{}( pad->GetOffset().y << 7 );
|
||||
ret += hash<int>{}( pad->GetDelta().x << 4 );
|
||||
ret += hash<int>{}( pad->GetDelta().y << 5 );
|
||||
|
||||
if( aFlags & POSITION )
|
||||
{
|
||||
if( aFlags & REL_COORD )
|
||||
{
|
||||
ret ^= hash<int>{}( pad->GetPos0().x );
|
||||
ret ^= hash<int>{}( pad->GetPos0().y );
|
||||
ret += hash<int>{}( pad->GetPos0().x );
|
||||
ret += hash<int>{}( pad->GetPos0().y );
|
||||
}
|
||||
else
|
||||
{
|
||||
ret ^= hash<int>{}( pad->GetPosition().x );
|
||||
ret ^= hash<int>{}( pad->GetPosition().y );
|
||||
ret += hash<int>{}( pad->GetPosition().x );
|
||||
ret += hash<int>{}( pad->GetPosition().y );
|
||||
}
|
||||
}
|
||||
|
||||
if( aFlags & ROTATION )
|
||||
ret ^= hash<double>{}( pad->GetOrientation() );
|
||||
ret += hash<double>{}( pad->GetOrientation() );
|
||||
|
||||
if( aFlags & NET )
|
||||
ret ^= hash<int>{}( pad->GetNetCode() << 6 );
|
||||
ret += hash<int>{}( pad->GetNetCode() << 6 );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -119,64 +119,64 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags )
|
||||
if( !( aFlags & VALUE ) && text->GetType() == TEXTE_MODULE::TEXT_is_VALUE )
|
||||
break;
|
||||
|
||||
ret ^= hash_board_item( text, aFlags );
|
||||
ret ^= hash<string>{}( text->GetText().ToStdString() );
|
||||
ret ^= hash<bool>{}( text->IsItalic() );
|
||||
ret ^= hash<bool>{}( text->IsBold() );
|
||||
ret ^= hash<bool>{}( text->IsMirrored() );
|
||||
ret ^= hash<int>{}( text->GetTextWidth() );
|
||||
ret ^= hash<int>{}( text->GetTextHeight() );
|
||||
ret ^= hash<int>{}( text->GetHorizJustify() );
|
||||
ret ^= hash<int>{}( text->GetVertJustify() );
|
||||
ret += hash_board_item( text, aFlags );
|
||||
ret += hash<string>{}( text->GetText().ToStdString() );
|
||||
ret += hash<bool>{}( text->IsItalic() );
|
||||
ret += hash<bool>{}( text->IsBold() );
|
||||
ret += hash<bool>{}( text->IsMirrored() );
|
||||
ret += hash<int>{}( text->GetTextWidth() );
|
||||
ret += hash<int>{}( text->GetTextHeight() );
|
||||
ret += hash<int>{}( text->GetHorizJustify() );
|
||||
ret += hash<int>{}( text->GetVertJustify() );
|
||||
|
||||
if( aFlags & POSITION )
|
||||
{
|
||||
if( aFlags & REL_COORD )
|
||||
{
|
||||
ret ^= hash<int>{}( text->GetPos0().x );
|
||||
ret ^= hash<int>{}( text->GetPos0().y );
|
||||
ret += hash<int>{}( text->GetPos0().x );
|
||||
ret += hash<int>{}( text->GetPos0().y );
|
||||
}
|
||||
else
|
||||
{
|
||||
ret ^= hash<int>{}( text->GetPosition().x );
|
||||
ret ^= hash<int>{}( text->GetPosition().y );
|
||||
ret += hash<int>{}( text->GetPosition().x );
|
||||
ret += hash<int>{}( text->GetPosition().y );
|
||||
}
|
||||
}
|
||||
|
||||
if( aFlags & ROTATION )
|
||||
ret ^= hash<double>{}( text->GetTextAngle() );
|
||||
ret += hash<double>{}( text->GetTextAngle() );
|
||||
}
|
||||
break;
|
||||
|
||||
case PCB_MODULE_EDGE_T:
|
||||
{
|
||||
const EDGE_MODULE* segment = static_cast<const EDGE_MODULE*>( aItem );
|
||||
ret ^= hash_board_item( segment, aFlags );
|
||||
ret ^= hash<int>{}( segment->GetType() );
|
||||
ret ^= hash<int>{}( segment->GetShape() );
|
||||
ret ^= hash<int>{}( segment->GetWidth() );
|
||||
ret ^= hash<int>{}( segment->GetRadius() );
|
||||
ret += hash_board_item( segment, aFlags );
|
||||
ret += hash<int>{}( segment->GetType() );
|
||||
ret += hash<int>{}( segment->GetShape() );
|
||||
ret += hash<int>{}( segment->GetWidth() );
|
||||
ret += hash<int>{}( segment->GetRadius() );
|
||||
|
||||
if( aFlags & POSITION )
|
||||
{
|
||||
if( aFlags & REL_COORD )
|
||||
{
|
||||
ret ^= hash<int>{}( segment->GetStart0().x );
|
||||
ret ^= hash<int>{}( segment->GetStart0().y );
|
||||
ret ^= hash<int>{}( segment->GetEnd0().x );
|
||||
ret ^= hash<int>{}( segment->GetEnd0().y );
|
||||
ret += hash<int>{}( segment->GetStart0().x );
|
||||
ret += hash<int>{}( segment->GetStart0().y );
|
||||
ret += hash<int>{}( segment->GetEnd0().x );
|
||||
ret += hash<int>{}( segment->GetEnd0().y );
|
||||
}
|
||||
else
|
||||
{
|
||||
ret ^= hash<int>{}( segment->GetStart().x );
|
||||
ret ^= hash<int>{}( segment->GetStart().y );
|
||||
ret ^= hash<int>{}( segment->GetEnd().x );
|
||||
ret ^= hash<int>{}( segment->GetEnd().y );
|
||||
ret += hash<int>{}( segment->GetStart().x );
|
||||
ret += hash<int>{}( segment->GetStart().y );
|
||||
ret += hash<int>{}( segment->GetEnd().x );
|
||||
ret += hash<int>{}( segment->GetEnd().y );
|
||||
}
|
||||
}
|
||||
|
||||
if( aFlags & ROTATION )
|
||||
ret ^= hash<double>{}( segment->GetAngle() );
|
||||
ret += hash<double>{}( segment->GetAngle() );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -28,16 +28,20 @@
|
||||
#include <common.h>
|
||||
|
||||
|
||||
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle) :
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle )
|
||||
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle,
|
||||
const wxPoint& aPosition, const wxSize& aSize ) :
|
||||
DIALOG_DISPLAY_HTML_TEXT_BASE( aParent, wxID_ANY, aTitle, aPosition, aSize )
|
||||
{
|
||||
m_htmlWindow->SetLayoutDirection( wxLayout_LeftToRight );
|
||||
ListClear();
|
||||
|
||||
// Gives a default logical size (the actual size depends on the display definition)
|
||||
SetSizeInDU( 320, 120 );
|
||||
if( aSize != wxDefaultSize )
|
||||
SetSizeInDU( aSize.x, aSize.y );
|
||||
|
||||
Center();
|
||||
|
||||
m_sdbSizer1OK->SetDefault();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,12 +53,14 @@ HTML_MESSAGE_BOX::~HTML_MESSAGE_BOX()
|
||||
}
|
||||
|
||||
|
||||
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
|
||||
void HTML_MESSAGE_BOX::OnOKButtonClick( wxCommandEvent& event )
|
||||
{
|
||||
// the dialog can be shown modal or not modal.
|
||||
// the dialog can be shown quasi-model, modal, or not modeless.
|
||||
// therefore, use the right way to close it.
|
||||
if( IsModal() )
|
||||
EndModal( 0 );
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_OK );
|
||||
else if( IsModal() )
|
||||
EndModal( wxID_OK );
|
||||
else
|
||||
Destroy();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ void KIWAY::SetTop( wxFrame* aTop )
|
||||
const wxString KIWAY::dso_search_path( FACE_T aFaceId )
|
||||
{
|
||||
const char* name;
|
||||
const char* dirName;
|
||||
|
||||
switch( aFaceId )
|
||||
{
|
||||
@@ -110,6 +111,13 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
// The subdirectories usually have the same name as the kiface
|
||||
switch( aFaceId )
|
||||
{
|
||||
case FACE_PL_EDITOR: dirName = "pagelayout_editor"; break;
|
||||
default: dirName = name + 1; break;
|
||||
}
|
||||
|
||||
#ifndef __WXMAC__
|
||||
wxString path;
|
||||
|
||||
@@ -131,6 +139,25 @@ const wxString KIWAY::dso_search_path( FACE_T aFaceId )
|
||||
|
||||
fn.SetName( name );
|
||||
|
||||
#ifdef DEBUG
|
||||
// To speed up development, it's sometimes nice to run kicad from inside
|
||||
// the build path. In that case, each program will be in a subdirectory.
|
||||
// To find the DSOs, we need to go up one directory and then enter a subdirectory.
|
||||
|
||||
if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
fn = wxStandardPaths::Get().GetExecutablePath();
|
||||
fn.RemoveLastDir();
|
||||
fn.AppendDir( wxT( "PlugIns" ) );
|
||||
fn.SetName( name );
|
||||
#else
|
||||
fn.RemoveLastDir();
|
||||
fn.AppendDir( dirName );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Here a "suffix" == an extension with a preceding '.',
|
||||
// so skip the preceding '.' to get an extension
|
||||
fn.SetExt( KIFACE_SUFFIX + 1 ); // + 1 => &KIFACE_SUFFIX[1]
|
||||
|
||||
@@ -613,7 +613,7 @@ void EDA_DRAW_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||
|
||||
void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg )
|
||||
{
|
||||
SetStatusText( msg, 5 );
|
||||
SetStatusText( msg, 6 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -621,7 +621,7 @@ void EDA_DRAW_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
|
||||
|
||||
void EDA_DRAW_FRAME::DisplayToolMsg( const wxString& msg )
|
||||
{
|
||||
SetStatusText( msg, 5 );
|
||||
SetStatusText( msg, 6 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -398,6 +398,12 @@ std::vector<wxString> LIB_TABLE::GetLogicalLibs()
|
||||
ret.push_back( *it );
|
||||
}
|
||||
|
||||
// We want to allow case-sensitive duplicates but sort by case-insensitive ordering
|
||||
std::sort( ret.begin(), ret.end(), []( const wxString& lhs, const wxString& rhs )
|
||||
{
|
||||
return lhs.CmpNoCase( rhs ) < 0;
|
||||
} );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +498,45 @@ void GERBER_PLOTTER::Arc( const wxPoint& aCenter, double aStAngle, double aEndAn
|
||||
}
|
||||
|
||||
|
||||
void GERBER_PLOTTER:: PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||
void GERBER_PLOTTER::PlotGerberRegion( const std::vector< wxPoint >& aCornerList,
|
||||
void * aData )
|
||||
{
|
||||
if( aCornerList.size() <= 2 )
|
||||
return;
|
||||
|
||||
GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
|
||||
|
||||
bool clearTA_AperFunction = false; // true if a TA.AperFunction is used
|
||||
|
||||
if( gbr_metadata )
|
||||
{
|
||||
std::string attrib = gbr_metadata->m_ApertureMetadata.FormatAttribute( !m_useX2format );
|
||||
|
||||
if( !attrib.empty() )
|
||||
{
|
||||
fputs( attrib.c_str(), outputFile );
|
||||
clearTA_AperFunction = true;
|
||||
}
|
||||
}
|
||||
|
||||
PlotPoly( aCornerList, FILLED_SHAPE, 0 , gbr_metadata );
|
||||
|
||||
// Clear the TA attribute, to avoid the next item to inherit it:
|
||||
if( clearTA_AperFunction )
|
||||
{
|
||||
if( m_useX2format )
|
||||
{
|
||||
fputs( "%TD.AperFunction*%\n", outputFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs( "G04 #@! TD.AperFunction*\n", outputFile );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||
FILL_T aFill, int aWidth, void * aData )
|
||||
{
|
||||
if( aCornerList.size() <= 1 )
|
||||
@@ -524,7 +562,10 @@ void GERBER_PLOTTER:: PlotPoly( const std::vector< wxPoint >& aCornerList,
|
||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||
LineTo( aCornerList[ii] );
|
||||
|
||||
FinishTo( aCornerList[0] );
|
||||
// If the polygon is not closed, close it:
|
||||
if( aCornerList[0] != aCornerList[aCornerList.size()-1] )
|
||||
FinishTo( aCornerList[0] );
|
||||
|
||||
fputs( "G37*\n", outputFile );
|
||||
}
|
||||
|
||||
@@ -676,7 +717,7 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, doub
|
||||
wxSize size( aSize );
|
||||
GBR_METADATA* gbr_metadata = static_cast<GBR_METADATA*>( aData );
|
||||
|
||||
/* Plot a flashed shape. */
|
||||
// Flash a vertical or horizontal shape (this is a basic aperture).
|
||||
if( ( orient == 0 || orient == 900 || orient == 1800 || orient == 2700 )
|
||||
&& trace_mode == FILLED )
|
||||
{
|
||||
@@ -692,7 +733,8 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, doub
|
||||
|
||||
emitDcode( pos_dev, 3 );
|
||||
}
|
||||
else /* Plot pad as a segment. */
|
||||
else // Plot pad as region.
|
||||
// Only regions and flashed items accept a object attribute TO.P for the pin name
|
||||
{
|
||||
if( size.x > size.y )
|
||||
{
|
||||
@@ -707,43 +749,20 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, doub
|
||||
if( trace_mode == FILLED )
|
||||
{
|
||||
// TODO: use an aperture macro to declare the rotated pad
|
||||
|
||||
// Flash a pad anchor, if a netlist attribute is set
|
||||
if( aData )
|
||||
FlashPadCircle( pos, size.x, trace_mode, aData );
|
||||
// to be able to flash the shape
|
||||
// For now, the pad is drawn as segment
|
||||
|
||||
// The pad is reduced to an segment with dy > dx
|
||||
int delta = size.y - size.x;
|
||||
int x0 = 0;
|
||||
int y0 = -delta / 2;
|
||||
int x1 = 0;
|
||||
int y1 = delta / 2;
|
||||
RotatePoint( &x0, &y0, orient );
|
||||
RotatePoint( &x1, &y1, orient );
|
||||
GBR_METADATA metadata;
|
||||
wxPoint p0( 0, -delta / 2 );
|
||||
wxPoint p1( 0, delta / 2 );
|
||||
RotatePoint( &p0.x, &p0.y, orient );
|
||||
RotatePoint( &p1.x, &p1.y, orient );
|
||||
|
||||
if( gbr_metadata )
|
||||
{
|
||||
metadata = *gbr_metadata;
|
||||
|
||||
// If the pad is drawn on a copper layer,
|
||||
// set attribute to GBR_APERTURE_ATTRIB_CONDUCTOR
|
||||
if( metadata.IsCopper() )
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
|
||||
// Clear .P attribute, only allowed for flashed items
|
||||
wxString attrname( ".P" );
|
||||
metadata.m_NetlistMetadata.ClearAttribute( &attrname );
|
||||
}
|
||||
|
||||
ThickSegment( wxPoint( pos.x + x0, pos.y + y0 ),
|
||||
wxPoint( pos.x + x1, pos.y + y1 ),
|
||||
size.x, trace_mode, &metadata );
|
||||
ThickSegment( pos + p0, pos + p1, size.x, trace_mode, gbr_metadata );
|
||||
}
|
||||
else
|
||||
{
|
||||
sketchOval( pos, size, orient, -1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,22 +840,7 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
|
||||
EDA_DRAW_MODE_T aTraceMode, void* aData )
|
||||
|
||||
{
|
||||
GBR_METADATA gbr_metadata;
|
||||
|
||||
if( aData )
|
||||
{
|
||||
gbr_metadata = *static_cast<GBR_METADATA*>( aData );
|
||||
// If the pad is drawn on a copper layer,
|
||||
// set attribute to GBR_APERTURE_ATTRIB_CONDUCTOR
|
||||
if( gbr_metadata.IsCopper() )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
|
||||
wxString attrname( ".P" );
|
||||
gbr_metadata.m_NetlistMetadata.ClearAttribute( &attrname ); // not allowed on inner layers
|
||||
}
|
||||
|
||||
if( aTraceMode != FILLED )
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
|
||||
GBR_METADATA *gbr_metadata = static_cast<GBR_METADATA*>( aData );
|
||||
|
||||
// Currently, a Pad RoundRect is plotted as polygon.
|
||||
// TODO: use Aperture macro and flash it
|
||||
@@ -846,7 +850,10 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
|
||||
aCornerRadius, segmentToCircleCount );
|
||||
|
||||
if( aTraceMode != FILLED )
|
||||
{
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &gbr_metadata );
|
||||
outline.Inflate( -GetCurrentLineWidth()/2, 16 );
|
||||
}
|
||||
|
||||
std::vector< wxPoint > cornerList;
|
||||
// TransformRoundRectToPolygon creates only one convex polygon
|
||||
@@ -859,45 +866,24 @@ void GERBER_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aS
|
||||
// Close polygon
|
||||
cornerList.push_back( cornerList[0] );
|
||||
|
||||
PlotPoly( cornerList, aTraceMode == FILLED ? FILLED_SHAPE : NO_FILL,
|
||||
aTraceMode == FILLED ? 0 : GetCurrentLineWidth(), &gbr_metadata );
|
||||
|
||||
// Now, flash a pad anchor, if a netlist attribute is set
|
||||
// (remove me when a Aperture macro will be used)
|
||||
if( aData && aTraceMode == FILLED )
|
||||
{
|
||||
int diameter = std::min( aSize.x, aSize.y );
|
||||
FlashPadCircle( aPadPos, diameter, aTraceMode , aData );
|
||||
}
|
||||
if( aTraceMode == SKETCH )
|
||||
PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), gbr_metadata );
|
||||
else
|
||||
PlotGerberRegion( cornerList, gbr_metadata );
|
||||
}
|
||||
|
||||
|
||||
void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize,
|
||||
SHAPE_POLY_SET* aPolygons,
|
||||
EDA_DRAW_MODE_T aTraceMode, void* aData )
|
||||
|
||||
{
|
||||
// A Pad custom is plotted as polygon.
|
||||
|
||||
// A flashed circle @aPadPos is added (anchor pad)
|
||||
// However, because the anchor pad can be circle or rect, we use only
|
||||
// a circle not bigger than the rect.
|
||||
// the main purpose is to print a flashed DCode as pad anchor
|
||||
if( aTraceMode == FILLED )
|
||||
FlashPadCircle( aPadPos, std::min( aSize.x, aSize.y ), aTraceMode, aData );
|
||||
// A Pad custom is plotted as Gerber region.
|
||||
|
||||
GBR_METADATA gbr_metadata;
|
||||
|
||||
if( aData )
|
||||
{
|
||||
gbr_metadata = *static_cast<GBR_METADATA*>( aData );
|
||||
// If the pad is drawn on a copper layer,
|
||||
// set attribute to GBR_APERTURE_ATTRIB_CONDUCTOR
|
||||
if( gbr_metadata.IsCopper() )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
|
||||
wxString attrname( ".P" );
|
||||
gbr_metadata.m_NetlistMetadata.ClearAttribute( &attrname ); // not allowed on inner layers
|
||||
}
|
||||
|
||||
SHAPE_POLY_SET polyshape = *aPolygons;
|
||||
|
||||
@@ -921,9 +907,10 @@ void GERBER_PLOTTER::FlashPadCustom( const wxPoint& aPadPos, const wxSize& aSize
|
||||
// Close polygon
|
||||
cornerList.push_back( cornerList[0] );
|
||||
|
||||
PlotPoly( cornerList,
|
||||
aTraceMode == FILLED ? FILLED_SHAPE : NO_FILL,
|
||||
aTraceMode == FILLED ? 0 : GetCurrentLineWidth(), &gbr_metadata );
|
||||
if( aTraceMode == SKETCH )
|
||||
PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), &gbr_metadata );
|
||||
else
|
||||
PlotGerberRegion( cornerList, &gbr_metadata );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,25 +928,6 @@ void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCo
|
||||
for( int ii = 0; ii < 4; ii++ )
|
||||
cornerList.push_back( aCorners[ii] );
|
||||
|
||||
// Now, flash a pad anchor, if a netlist attribute is set
|
||||
// (remove me when a Aperture macro will be used)
|
||||
if( aData && ( aTrace_Mode == FILLED ) )
|
||||
{
|
||||
// Calculate the radius of the circle inside the shape
|
||||
// It is the smaller dist from shape pos to edges
|
||||
int radius = INT_MAX;
|
||||
|
||||
for( unsigned ii = 0, jj = cornerList.size()-1; ii < cornerList.size();
|
||||
jj = ii, ii++ )
|
||||
{
|
||||
SEG segment( aCorners[ii], aCorners[jj] );
|
||||
int dist = segment.LineDistance( VECTOR2I( 0, 0) );
|
||||
radius = std::min( radius, dist );
|
||||
}
|
||||
|
||||
FlashPadCircle( aPadPos, radius*2, aTrace_Mode, aData );
|
||||
}
|
||||
|
||||
// Draw the polygon and fill the interior as required
|
||||
for( unsigned ii = 0; ii < 4; ii++ )
|
||||
{
|
||||
@@ -974,21 +942,12 @@ void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCo
|
||||
GBR_METADATA metadata;
|
||||
|
||||
if( gbr_metadata )
|
||||
{
|
||||
metadata = *gbr_metadata;
|
||||
// If the pad is drawn on a copper layer,
|
||||
// set attribute to GBR_APERTURE_ATTRIB_CONDUCTOR
|
||||
if( metadata.IsCopper() )
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
|
||||
wxString attrname( ".P" );
|
||||
metadata.m_NetlistMetadata.ClearAttribute( &attrname ); // not allowed on inner layers
|
||||
}
|
||||
|
||||
SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, &metadata );
|
||||
PlotPoly( cornerList, aTrace_Mode == FILLED ? FILLED_SHAPE : NO_FILL,
|
||||
aTrace_Mode == FILLED ? 0 : GetCurrentLineWidth(),
|
||||
&metadata );
|
||||
if( aTrace_Mode == SKETCH )
|
||||
PlotPoly( cornerList, NO_FILL, USE_DEFAULT_LINE_WIDTH, &metadata );
|
||||
else
|
||||
PlotGerberRegion( cornerList, &metadata );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -424,9 +424,6 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
|
||||
if( StAngle > EndAngle )
|
||||
std::swap( StAngle, EndAngle );
|
||||
|
||||
setFillMode( fill );
|
||||
SetCurrentLineWidth( width );
|
||||
|
||||
// Calculate start point.
|
||||
DPOINT centre_dev = userToDeviceCoordinates( centre );
|
||||
double radius_dev = userToDeviceSize( radius );
|
||||
@@ -487,6 +484,21 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i
|
||||
// flag arc size (0 = small arc > 180 deg, 1 = large arc > 180 deg),
|
||||
// sweep arc ( 0 = CCW, 1 = CW),
|
||||
// end point
|
||||
if( fill != NO_FILL )
|
||||
{
|
||||
// Filled arcs (in eeschema) consist of the pie wedge and a stroke only on the arc
|
||||
// This needs to be drawn in two steps.
|
||||
setFillMode( fill );
|
||||
SetCurrentLineWidth( 0 );
|
||||
|
||||
fprintf( outputFile, "<path d=\"M%g %g A%g %g 0.0 %d %d %g %g L %g %g Z\" />\n",
|
||||
start.x, start.y, radius_dev, radius_dev,
|
||||
flg_arc, flg_sweep,
|
||||
end.x, end.y, centre_dev.x, centre_dev.y );
|
||||
}
|
||||
|
||||
setFillMode( NO_FILL );
|
||||
SetCurrentLineWidth( width );
|
||||
fprintf( outputFile, "<path d=\"M%g %g A%g %g 0.0 %d %d %g %g \" />\n",
|
||||
start.x, start.y, radius_dev, radius_dev,
|
||||
flg_arc, flg_sweep,
|
||||
@@ -517,15 +529,22 @@ void SVG_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList,
|
||||
}
|
||||
|
||||
DPOINT pos = userToDeviceCoordinates( aCornerList[0] );
|
||||
fprintf( outputFile, "d=\"M %d,%d\n", (int) pos.x, (int) pos.y );
|
||||
fprintf( outputFile, "d=\"M %g,%g\n", pos.x, pos.y );
|
||||
|
||||
for( unsigned ii = 1; ii < aCornerList.size(); ii++ )
|
||||
for( unsigned ii = 1; ii < aCornerList.size() - 1; ii++ )
|
||||
{
|
||||
pos = userToDeviceCoordinates( aCornerList[ii] );
|
||||
fprintf( outputFile, "%d,%d\n", (int) pos.x, (int) pos.y );
|
||||
fprintf( outputFile, "%g,%g\n", pos.x, pos.y );
|
||||
}
|
||||
|
||||
fprintf( outputFile, "Z\" /> \n" );
|
||||
// If the cornerlist ends where it begins, then close the poly
|
||||
if( aCornerList.front() == aCornerList.back() )
|
||||
fprintf( outputFile, "Z\" /> \n" );
|
||||
else
|
||||
{
|
||||
pos = userToDeviceCoordinates( aCornerList.back() );
|
||||
fprintf( outputFile, "%g,%g\n\" /> \n", pos.x, pos.y );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -674,7 +693,69 @@ void SVG_PLOTTER::Text( const wxPoint& aPos,
|
||||
SetColor( aColor );
|
||||
SetCurrentLineWidth( aWidth );
|
||||
|
||||
// TODO: see if the postscript native text code can be used in SVG plotter
|
||||
int width = currentPenWidth;
|
||||
|
||||
if( aWidth <= 0 && aBold )
|
||||
width = GetPenSizeForBold( std::min( aSize.x, aSize.y ) );
|
||||
|
||||
if( aWidth <= 0 )
|
||||
width = currentPenWidth;
|
||||
|
||||
wxPoint text_pos = aPos;
|
||||
const char *hjust = "start";
|
||||
|
||||
switch( aH_justify )
|
||||
{
|
||||
case GR_TEXT_HJUSTIFY_CENTER:
|
||||
hjust = "middle";
|
||||
break;
|
||||
|
||||
case GR_TEXT_HJUSTIFY_RIGHT:
|
||||
hjust = "end";
|
||||
break;
|
||||
|
||||
case GR_TEXT_HJUSTIFY_LEFT:
|
||||
hjust = "start";
|
||||
break;
|
||||
}
|
||||
|
||||
switch( aV_justify )
|
||||
{
|
||||
case GR_TEXT_VJUSTIFY_CENTER:
|
||||
text_pos.y += aSize.y / 2;
|
||||
break;
|
||||
|
||||
case GR_TEXT_VJUSTIFY_TOP:
|
||||
text_pos.y += aSize.y;
|
||||
break;
|
||||
|
||||
case GR_TEXT_VJUSTIFY_BOTTOM:
|
||||
break;
|
||||
}
|
||||
|
||||
wxSize text_size;
|
||||
text_size.x = GraphicTextWidth( aText, aSize, aItalic, width );
|
||||
text_size.y = aSize.x * 4/3; // Hershey font height to em size conversion
|
||||
DPOINT anchor_pos_dev = userToDeviceCoordinates( aPos );
|
||||
DPOINT text_pos_dev = userToDeviceCoordinates( text_pos );
|
||||
DPOINT sz_dev = userToDeviceSize( text_size );
|
||||
|
||||
if( aOrient != 0 ) {
|
||||
fprintf( outputFile,
|
||||
"<g transform=\"rotate(%g %g %g)\">\n",
|
||||
- aOrient * 0.1, anchor_pos_dev.x, anchor_pos_dev.y );
|
||||
}
|
||||
|
||||
fprintf( outputFile,
|
||||
"<text x=\"%g\" y=\"%g\"\n"
|
||||
"textLength=\"%g\" font-size=\"%g\" lengthAdjust=\"spacingAndGlyphs\"\n"
|
||||
"text-anchor=\"%s\" opacity=\"0\">%s</text>\n",
|
||||
text_pos_dev.x, text_pos_dev.y,
|
||||
sz_dev.x, sz_dev.y,
|
||||
hjust, TO_UTF8( XmlEsc( aText ) ) );
|
||||
|
||||
if( aOrient != 0 )
|
||||
fputs( "</g>\n", outputFile );
|
||||
|
||||
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
|
||||
aWidth, aItalic, aBold, aMultilineAllowed );
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <vector>
|
||||
|
||||
#include <trigo.h>
|
||||
#include <eda_base_frame.h>
|
||||
@@ -164,7 +165,17 @@ void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int r
|
||||
/* Please NOTE the different sign due to Y-axis flip */
|
||||
start.x = centre.x + KiROUND( cosdecideg( radius, -StAngle ) );
|
||||
start.y = centre.y + KiROUND( sindecideg( radius, -StAngle ) );
|
||||
MoveTo( start );
|
||||
|
||||
if( fill != NO_FILL )
|
||||
{
|
||||
MoveTo( centre );
|
||||
LineTo( start );
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveTo( start );
|
||||
}
|
||||
|
||||
for( int ii = StAngle + delta; ii < EndAngle; ii += delta )
|
||||
{
|
||||
end.x = centre.x + KiROUND( cosdecideg( radius, -ii ) );
|
||||
@@ -174,7 +185,16 @@ void PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, int r
|
||||
|
||||
end.x = centre.x + KiROUND( cosdecideg( radius, -EndAngle ) );
|
||||
end.y = centre.y + KiROUND( sindecideg( radius, -EndAngle ) );
|
||||
FinishTo( end );
|
||||
|
||||
if( fill != NO_FILL )
|
||||
{
|
||||
LineTo( end );
|
||||
FinishTo( centre );
|
||||
}
|
||||
else
|
||||
{
|
||||
FinishTo( end );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -530,6 +550,9 @@ void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
|
||||
for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
|
||||
cornerList.push_back( wxPoint( aCornerList.CPoint( ii ) ) );
|
||||
|
||||
if( aCornerList.IsClosed() && cornerList.front() != cornerList.back() )
|
||||
cornerList.push_back( wxPoint( aCornerList.CPoint( 0 ) ) );
|
||||
|
||||
PlotPoly( cornerList , aFill, aWidth, aData );
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
#include <limits>
|
||||
|
||||
#include <preview_items/polygon_geom_manager.h>
|
||||
|
||||
@@ -67,6 +68,7 @@ bool POLYGON_GEOM_MANAGER::AddPoint( const VECTOR2I& aPt )
|
||||
|
||||
void POLYGON_GEOM_MANAGER::SetFinished()
|
||||
{
|
||||
|
||||
m_client.OnComplete( *this );
|
||||
}
|
||||
|
||||
@@ -95,9 +97,9 @@ bool POLYGON_GEOM_MANAGER::IsSelfIntersecting( bool aIncludeLeaderPts ) const
|
||||
}
|
||||
|
||||
|
||||
void POLYGON_GEOM_MANAGER::SetCursorPosition( const VECTOR2I& aPos, LEADER_MODE aModifier )
|
||||
void POLYGON_GEOM_MANAGER::SetCursorPosition( const VECTOR2I& aPos )
|
||||
{
|
||||
updateLeaderPoints( aPos, aModifier );
|
||||
updateLeaderPoints( aPos );
|
||||
}
|
||||
|
||||
|
||||
@@ -143,17 +145,58 @@ void POLYGON_GEOM_MANAGER::Reset()
|
||||
void POLYGON_GEOM_MANAGER::updateLeaderPoints( const VECTOR2I& aEndPoint, LEADER_MODE aModifier )
|
||||
{
|
||||
wxCHECK( m_lockedPoints.PointCount() > 0, /*void*/ );
|
||||
const VECTOR2I& lastPt = m_lockedPoints.CLastPoint();
|
||||
auto newEnd = VECTOR2I( aEndPoint );
|
||||
const VECTOR2I& last_pt = m_lockedPoints.CLastPoint();
|
||||
|
||||
if( m_leaderMode == LEADER_MODE::DEG45 || aModifier == LEADER_MODE::DEG45 )
|
||||
{
|
||||
const VECTOR2I lineVector( aEndPoint - lastPt );
|
||||
const VECTOR2I line_vec( aEndPoint - last_pt );
|
||||
// get a restricted 45/H/V line from the last fixed point to the cursor
|
||||
newEnd = lastPt + GetVectorSnapped45( lineVector );
|
||||
auto new_end = last_pt + GetVectorSnapped45( line_vec );
|
||||
OPT_VECTOR2I pt;
|
||||
|
||||
if( m_lockedPoints.SegmentCount() > 1 )
|
||||
{
|
||||
const VECTOR2I& start_pt = m_lockedPoints.CPoint( 0 );
|
||||
VECTOR2I completed_vec( start_pt - new_end );
|
||||
|
||||
if( completed_vec != GetVectorSnapped45( completed_vec ) )
|
||||
{
|
||||
SEG v_first( new_end, VECTOR2I( new_end.x, start_pt.y ) );
|
||||
SEG h_first( new_end, VECTOR2I( start_pt.x, new_end.y ) );
|
||||
|
||||
SHAPE_LINE_CHAIN::INTERSECTIONS intersections;
|
||||
auto v_hits = m_lockedPoints.Intersect( v_first, intersections );
|
||||
v_hits += m_lockedPoints.Intersect( SEG( v_first.B, start_pt ), intersections );
|
||||
pt = v_first.B;
|
||||
|
||||
if( v_hits > 0 )
|
||||
{
|
||||
intersections.clear();
|
||||
auto h_hits = m_lockedPoints.Intersect( h_first, intersections );
|
||||
h_hits += m_lockedPoints.Intersect( SEG( h_first.B, start_pt ), intersections );
|
||||
|
||||
if( h_hits < v_hits )
|
||||
pt = h_first.B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_leaderPts = SHAPE_LINE_CHAIN( last_pt, new_end );
|
||||
|
||||
if( pt )
|
||||
{
|
||||
// This checks for backtracking from the point to intersection
|
||||
if( SEG( last_pt, new_end ).Collinear( SEG( new_end, *pt ) ) )
|
||||
m_leaderPts = SHAPE_LINE_CHAIN( last_pt, *pt );
|
||||
else
|
||||
m_leaderPts.Append( *pt );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// direct segment
|
||||
m_leaderPts = SHAPE_LINE_CHAIN( last_pt, aEndPoint );
|
||||
}
|
||||
|
||||
// direct segment
|
||||
m_leaderPts = SHAPE_LINE_CHAIN( lastPt, newEnd );
|
||||
m_client.OnGeometryChange( *this );
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
using namespace KIGFX::PREVIEW;
|
||||
|
||||
const double POLYGON_ITEM::POLY_LINE_WIDTH = 150000.0;
|
||||
|
||||
POLYGON_ITEM::POLYGON_ITEM():
|
||||
SIMPLE_OVERLAY_ITEM()
|
||||
@@ -60,12 +61,14 @@ void POLYGON_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const
|
||||
auto& gal = *aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
gal.SetLineWidth( POLY_LINE_WIDTH );
|
||||
gal.DrawPolyline( m_lockedChain );
|
||||
gal.DrawPolygon( m_polyfill );
|
||||
|
||||
// draw the leader line in a different color
|
||||
gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) );
|
||||
gal.DrawPolyline( m_leaderChain );
|
||||
|
||||
gal.DrawPolygon( m_polyfill );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -209,8 +209,12 @@ int ReadDelimitedText( char* aDest, const char* aSource, int aDestSize )
|
||||
}
|
||||
|
||||
|
||||
std::string EscapedUTF8( const wxString& aString )
|
||||
std::string EscapedUTF8( wxString aString )
|
||||
{
|
||||
// No new-lines allowed in quoted strings
|
||||
aString.Replace( "\r\n", "\r" );
|
||||
aString.Replace( "\n", "\r" );
|
||||
|
||||
std::string utf8 = TO_UTF8( aString );
|
||||
|
||||
std::string ret;
|
||||
|
||||
@@ -1040,36 +1040,36 @@ __asm (
|
||||
# endif
|
||||
#endif
|
||||
" # reserve space on stack\n"
|
||||
" subi %r1, %r1, 328\n"
|
||||
" subi %r1, %r1, 320\n"
|
||||
#if _CALL_ELF != 2
|
||||
" std %r2, 152(%r1) # save TOC\n"
|
||||
" std %r2, 144(%r1) # save TOC\n"
|
||||
#endif
|
||||
" std %r14, 160(%r1) # save R14\n"
|
||||
" std %r15, 168(%r1) # save R15\n"
|
||||
" std %r16, 176(%r1) # save R16\n"
|
||||
" std %r17, 184(%r1) # save R17\n"
|
||||
" std %r18, 192(%r1) # save R18\n"
|
||||
" std %r19, 200(%r1) # save R19\n"
|
||||
" std %r20, 208(%r1) # save R20\n"
|
||||
" std %r21, 216(%r1) # save R21\n"
|
||||
" std %r22, 224(%r1) # save R22\n"
|
||||
" std %r23, 232(%r1) # save R23\n"
|
||||
" std %r24, 240(%r1) # save R24\n"
|
||||
" std %r25, 248(%r1) # save R25\n"
|
||||
" std %r26, 256(%r1) # save R26\n"
|
||||
" std %r27, 264(%r1) # save R27\n"
|
||||
" std %r28, 272(%r1) # save R28\n"
|
||||
" std %r29, 280(%r1) # save R29\n"
|
||||
" std %r30, 288(%r1) # save R30\n"
|
||||
" std %r31, 296(%r1) # save R31\n"
|
||||
" std %r14, 152(%r1) # save R14\n"
|
||||
" std %r15, 160(%r1) # save R15\n"
|
||||
" std %r16, 168(%r1) # save R16\n"
|
||||
" std %r17, 176(%r1) # save R17\n"
|
||||
" std %r18, 184(%r1) # save R18\n"
|
||||
" std %r19, 192(%r1) # save R19\n"
|
||||
" std %r20, 200(%r1) # save R20\n"
|
||||
" std %r21, 208(%r1) # save R21\n"
|
||||
" std %r22, 216(%r1) # save R22\n"
|
||||
" std %r23, 224(%r1) # save R23\n"
|
||||
" std %r24, 232(%r1) # save R24\n"
|
||||
" std %r25, 240(%r1) # save R25\n"
|
||||
" std %r26, 248(%r1) # save R26\n"
|
||||
" std %r27, 256(%r1) # save R27\n"
|
||||
" std %r28, 264(%r1) # save R28\n"
|
||||
" std %r29, 272(%r1) # save R29\n"
|
||||
" std %r30, 280(%r1) # save R30\n"
|
||||
" std %r31, 288(%r1) # save R31\n"
|
||||
" # save CR\n"
|
||||
" mfcr %r0\n"
|
||||
" std %r0, 304(%r1)\n"
|
||||
" std %r0, 296(%r1)\n"
|
||||
" # save LR\n"
|
||||
" mflr %r0\n"
|
||||
" std %r0, 312(%r1)\n"
|
||||
" std %r0, 304(%r1)\n"
|
||||
" # save LR as PC\n"
|
||||
" std %r0, 320(%r1)\n"
|
||||
" std %r0, 312(%r1)\n"
|
||||
" # test if fpu env should be preserved\n"
|
||||
" cmpwi cr7, %r6, 0\n"
|
||||
" beq cr7, 1f\n"
|
||||
@@ -1091,8 +1091,6 @@ __asm (
|
||||
" stfd %f29, 120(%r1) # save F29\n"
|
||||
" stfd %f30, 128(%r1) # save F30\n"
|
||||
" stfd %f31, 136(%r1) # save F31\n"
|
||||
" mffs %f0 # load FPSCR\n"
|
||||
" stfd %f0, 144(%r1) # save FPSCR\n"
|
||||
"1:\n"
|
||||
" # store RSP (pointing to context-data) in R3\n"
|
||||
" std %r1, 0(%r3)\n"
|
||||
@@ -1119,42 +1117,40 @@ __asm (
|
||||
" lfd %f29, 120(%r1) # restore F29\n"
|
||||
" lfd %f30, 128(%r1) # restore F30\n"
|
||||
" lfd %f31, 136(%r1) # restore F31\n"
|
||||
" lfd %f0, 144(%r1) # load FPSCR\n"
|
||||
" mtfsf 0xff, %f0 # restore FPSCR\n"
|
||||
"2:\n"
|
||||
#if _CALL_ELF != 2
|
||||
" ld %r2, 152(%r1) # restore TOC\n"
|
||||
" ld %r2, 144(%r1) # restore TOC\n"
|
||||
#endif
|
||||
" ld %r14, 160(%r1) # restore R14\n"
|
||||
" ld %r15, 168(%r1) # restore R15\n"
|
||||
" ld %r16, 176(%r1) # restore R16\n"
|
||||
" ld %r17, 184(%r1) # restore R17\n"
|
||||
" ld %r18, 192(%r1) # restore R18\n"
|
||||
" ld %r19, 200(%r1) # restore R19\n"
|
||||
" ld %r20, 208(%r1) # restore R20\n"
|
||||
" ld %r21, 216(%r1) # restore R21\n"
|
||||
" ld %r22, 224(%r1) # restore R22\n"
|
||||
" ld %r23, 232(%r1) # restore R23\n"
|
||||
" ld %r24, 240(%r1) # restore R24\n"
|
||||
" ld %r25, 248(%r1) # restore R25\n"
|
||||
" ld %r26, 256(%r1) # restore R26\n"
|
||||
" ld %r27, 264(%r1) # restore R27\n"
|
||||
" ld %r28, 272(%r1) # restore R28\n"
|
||||
" ld %r29, 280(%r1) # restore R29\n"
|
||||
" ld %r30, 288(%r1) # restore R30\n"
|
||||
" ld %r31, 296(%r1) # restore R31\n"
|
||||
" ld %r14, 152(%r1) # restore R14\n"
|
||||
" ld %r15, 160(%r1) # restore R15\n"
|
||||
" ld %r16, 168(%r1) # restore R16\n"
|
||||
" ld %r17, 176(%r1) # restore R17\n"
|
||||
" ld %r18, 184(%r1) # restore R18\n"
|
||||
" ld %r19, 192(%r1) # restore R19\n"
|
||||
" ld %r20, 200(%r1) # restore R20\n"
|
||||
" ld %r21, 208(%r1) # restore R21\n"
|
||||
" ld %r22, 216(%r1) # restore R22\n"
|
||||
" ld %r23, 224(%r1) # restore R23\n"
|
||||
" ld %r24, 232(%r1) # restore R24\n"
|
||||
" ld %r25, 240(%r1) # restore R25\n"
|
||||
" ld %r26, 248(%r1) # restore R26\n"
|
||||
" ld %r27, 256(%r1) # restore R27\n"
|
||||
" ld %r28, 264(%r1) # restore R28\n"
|
||||
" ld %r29, 272(%r1) # restore R29\n"
|
||||
" ld %r30, 280(%r1) # restore R30\n"
|
||||
" ld %r31, 288(%r1) # restore R31\n"
|
||||
" # restore CR\n"
|
||||
" ld %r0, 304(%r1)\n"
|
||||
" ld %r0, 296(%r1)\n"
|
||||
" mtcr %r0\n"
|
||||
" # restore LR\n"
|
||||
" ld %r0, 312(%r1)\n"
|
||||
" ld %r0, 304(%r1)\n"
|
||||
" mtlr %r0\n"
|
||||
" # load PC\n"
|
||||
" ld %r12, 320(%r1)\n"
|
||||
" ld %r12, 312(%r1)\n"
|
||||
" # restore CTR\n"
|
||||
" mtctr %r12\n"
|
||||
" # adjust stack\n"
|
||||
" addi %r1, %r1, 328\n"
|
||||
" addi %r1, %r1, 320\n"
|
||||
" # use third arg as return value after jump\n"
|
||||
" # use third arg as first arg in context function\n"
|
||||
" mr %r3, %r5\n"
|
||||
@@ -1212,19 +1208,19 @@ __asm (
|
||||
" clrrdi %r3, %r3, 4\n"
|
||||
" # reserve space for context-data on context-stack\n"
|
||||
" # including 64 byte of linkage + parameter area (R1 % 16 == 0)\n"
|
||||
" subi %r3, %r3, 392\n"
|
||||
" subi %r3, %r3, 384\n"
|
||||
" # third arg of make_fcontext() == address of context-function\n"
|
||||
" # entry point (ELFv2) or descriptor (ELFv1)\n"
|
||||
#if _CALL_ELF == 2
|
||||
" # save address of context-function entry point\n"
|
||||
" std %r5, 320(%r3)\n"
|
||||
" std %r5, 312(%r3)\n"
|
||||
#else
|
||||
" # save address of context-function entry point\n"
|
||||
" ld %r4, 0(%r5)\n"
|
||||
" std %r4, 320(%r3)\n"
|
||||
" std %r4, 312(%r3)\n"
|
||||
" # save TOC of context-function\n"
|
||||
" ld %r4, 8(%r5)\n"
|
||||
" std %r4, 152(%r3)\n"
|
||||
" std %r4, 144(%r3)\n"
|
||||
#endif
|
||||
" # load LR\n"
|
||||
" mflr %r0\n"
|
||||
@@ -1239,7 +1235,7 @@ __asm (
|
||||
" mtlr %r0\n"
|
||||
" # save address of finish as return-address for context-function\n"
|
||||
" # will be entered after context-function returns\n"
|
||||
" std %r4, 312(%r3)\n"
|
||||
" std %r4, 304(%r3)\n"
|
||||
" # restore return address from R6\n"
|
||||
" mtlr %r6\n"
|
||||
" blr # return pointer to context-data\n"
|
||||
|
||||
@@ -1526,7 +1526,7 @@ bool VIEW::IsVisible( const VIEW_ITEM* aItem ) const
|
||||
{
|
||||
const auto viewData = aItem->viewPrivData();
|
||||
|
||||
return viewData->m_flags & VISIBLE;
|
||||
return viewData && ( viewData->m_flags & VISIBLE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -326,10 +326,8 @@ void WX_VIEW_CONTROLS::onTimer( wxTimerEvent& aEvent )
|
||||
return;
|
||||
}
|
||||
|
||||
#if wxCHECK_VERSION( 3, 0, 0 )
|
||||
if( !m_parentPanel->HasFocus() )
|
||||
break;
|
||||
#endif
|
||||
|
||||
double borderSize = std::min( m_settings.m_autoPanMargin * m_view->GetScreenPixelSize().x,
|
||||
m_settings.m_autoPanMargin * m_view->GetScreenPixelSize().y );
|
||||
@@ -626,16 +624,9 @@ void WX_VIEW_CONTROLS::refreshMouse()
|
||||
moveEvent.SetY( msp.y );
|
||||
|
||||
// Set the modifiers state
|
||||
#if wxCHECK_VERSION( 3, 0, 0 )
|
||||
moveEvent.SetControlDown( wxGetKeyState( WXK_CONTROL ) );
|
||||
moveEvent.SetShiftDown( wxGetKeyState( WXK_SHIFT ) );
|
||||
moveEvent.SetAltDown( wxGetKeyState( WXK_ALT ) );
|
||||
#else
|
||||
// wx <3.0 do not have accessors, but the fields are exposed
|
||||
moveEvent.m_controlDown = wxGetKeyState( WXK_CONTROL );
|
||||
moveEvent.m_shiftDown = wxGetKeyState( WXK_SHIFT );
|
||||
moveEvent.m_altDown = wxGetKeyState( WXK_ALT );
|
||||
#endif
|
||||
|
||||
m_cursorPos = m_view->ToWorld( VECTOR2D( msp.x, msp.y ) );
|
||||
wxPostEvent( m_parentPanel, moveEvent );
|
||||
@@ -660,30 +651,28 @@ void WX_VIEW_CONTROLS::UpdateScrollbars()
|
||||
VECTOR2I newScroll( ( viewport.Centre().x - boundary.GetLeft() ) * m_scrollScale.x,
|
||||
( viewport.Centre().y - boundary.GetTop() ) * m_scrollScale.y );
|
||||
|
||||
// We add the width of the scroll bar thumb to the range because the scroll range is given by
|
||||
// the full bar while the position is given by the left/top position of the thumb
|
||||
VECTOR2I newRange( m_scrollScale.x * boundary.GetWidth() + m_parentPanel->GetScrollThumb( wxSB_HORIZONTAL ),
|
||||
m_scrollScale.y * boundary.GetHeight() + m_parentPanel->GetScrollThumb( wxSB_VERTICAL ) );
|
||||
|
||||
// Flip scroll direction in flipped view
|
||||
if( m_view->IsMirroredX() )
|
||||
newScroll.x = ( boundary.GetRight() - viewport.Centre().x ) * m_scrollScale.x;
|
||||
|
||||
// Adjust scrollbars only if it is needed. Otherwise there are cases when canvas is continuosly
|
||||
// Adjust scrollbars only if it is needed. Otherwise there are cases when canvas is continuously
|
||||
// refreshed (Windows)
|
||||
if( m_scrollPos != newScroll )
|
||||
if( m_scrollPos != newScroll || newRange.x != m_parentPanel->GetScrollRange( wxSB_HORIZONTAL )
|
||||
|| newRange.y != m_parentPanel->GetScrollRange( wxSB_VERTICAL ) )
|
||||
{
|
||||
// Another example of wxWidgets being broken by design: scroll position is determined by the
|
||||
// left (or top, if vertical) edge of the slider. Fortunately, slider size seems to be constant
|
||||
// (at least for wxGTK and wxMSW), so we have to add its size to allow user to scroll the workspace
|
||||
// till the end.
|
||||
|
||||
m_parentPanel->SetScrollbars( 1, 1,
|
||||
#if defined(__LINUX__)
|
||||
m_scrollScale.x * boundary.GetWidth() + 1623, m_scrollScale.y * boundary.GetHeight() + 1623,
|
||||
#elif defined(__WIN32__) || defined(__WIN64__)
|
||||
m_scrollScale.x * boundary.GetWidth() + 1377, m_scrollScale.y * boundary.GetHeight() + 741,
|
||||
#else
|
||||
m_scrollScale.x * boundary.GetWidth(), m_scrollScale.y * boundary.GetHeight(),
|
||||
#endif
|
||||
newScroll.x, newScroll.y, false );
|
||||
|
||||
m_parentPanel->SetScrollbars( 1, 1, newRange.x, newRange.y, newScroll.x, newScroll.y, true );
|
||||
m_scrollPos = newScroll;
|
||||
|
||||
#ifndef __APPLE__
|
||||
// Trigger a mouse refresh to get the canvas update in GTK (re-draws the scrollbars).
|
||||
// Note that this causes an infinite loop on OSX as it generates a paint event.
|
||||
refreshMouse();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -715,8 +715,11 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w )
|
||||
continue;
|
||||
}
|
||||
|
||||
if( x0 == x1 ) // continue until a new X coordinate is reached
|
||||
continue;
|
||||
// This gives disastrous results with very high-frequency plots where the
|
||||
// X coordinate may not increment until several waves later
|
||||
//
|
||||
// if( x0 == x1 ) // continue until a new X coordinate is reached
|
||||
// continue;
|
||||
|
||||
bool outDown = ( y0 > maxYpx ) && ( y1 > maxYpx );
|
||||
bool outUp = ( y0 < minYpx ) && ( y1 < minYpx );
|
||||
@@ -2168,9 +2171,11 @@ void mpWindow::AdjustLimitedView()
|
||||
if( !m_enableLimitedView )
|
||||
return;
|
||||
|
||||
// m_min and m_max are plot limits for curves
|
||||
// xMin, xMax, yMin, yMax are the full limits (plot limit + margin)
|
||||
const double xMin = m_minX - m_marginLeft / m_scaleX;
|
||||
const double xMax = m_maxX - m_marginRight / m_scaleX;
|
||||
const double yMin = m_minY + m_marginTop / m_scaleY;
|
||||
const double xMax = m_maxX + m_marginRight / m_scaleX;
|
||||
const double yMin = m_minY - m_marginTop / m_scaleY;
|
||||
const double yMax = m_maxY + m_marginBottom / m_scaleY;
|
||||
|
||||
if( m_desiredXmin < xMin )
|
||||
|
||||
@@ -114,7 +114,6 @@ WX_PROGRESS_REPORTER::WX_PROGRESS_REPORTER( wxWindow* aParent, const wxString& a
|
||||
|
||||
WX_PROGRESS_REPORTER::~WX_PROGRESS_REPORTER()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/textentry.h>
|
||||
#include <limits>
|
||||
@@ -46,6 +47,8 @@ UNIT_BINDER::UNIT_BINDER( EDA_DRAW_FRAME* aParent,
|
||||
m_useMils = aUseMils;
|
||||
m_allowEval = allowEval && dynamic_cast<wxTextEntry*>( m_value );
|
||||
m_needsEval = false;
|
||||
m_selStart = 0;
|
||||
m_selEnd = 0;
|
||||
|
||||
auto textEntry = dynamic_cast<wxTextEntry*>( m_value );
|
||||
if( textEntry )
|
||||
@@ -79,7 +82,10 @@ void UNIT_BINDER::onSetFocus( wxFocusEvent& aEvent )
|
||||
wxString oldStr = m_eval.OriginalText();
|
||||
|
||||
if( oldStr.length() )
|
||||
{
|
||||
textEntry->SetValue( oldStr );
|
||||
textEntry->SetSelection( m_selStart, m_selEnd );
|
||||
}
|
||||
|
||||
m_needsEval = true;
|
||||
}
|
||||
@@ -95,8 +101,25 @@ void UNIT_BINDER::onKillFocus( wxFocusEvent& aEvent )
|
||||
if( m_allowEval && textEntry )
|
||||
{
|
||||
if( m_eval.Process( textEntry->GetValue() ) )
|
||||
{
|
||||
textEntry->GetSelection( &m_selStart, &m_selEnd );
|
||||
wxString sel = textEntry->GetStringSelection();
|
||||
|
||||
textEntry->ChangeValue( m_eval.Result() );
|
||||
|
||||
#ifdef __WXGTK__
|
||||
// Manually copy the selected text to the primary selection clipboard
|
||||
if( wxTheClipboard->Open() )
|
||||
{
|
||||
bool clipTarget = wxTheClipboard->IsUsingPrimarySelection();
|
||||
wxTheClipboard->UsePrimarySelection( true );
|
||||
wxTheClipboard->SetData( new wxTextDataObject( sel ) );
|
||||
wxTheClipboard->UsePrimarySelection( clipTarget );
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
m_needsEval = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -599,12 +599,10 @@ void WIDGET_HOTKEY_LIST::initializeElements()
|
||||
|
||||
// Add the bitmap image for invalid hotkey warning
|
||||
// bitmap size is not know (depending on it is built). So get it:
|
||||
wxSize iconsize;
|
||||
wxBitmap bm_invalid = KiBitmap( cancel_xpm );
|
||||
iconsize.x = bm_invalid.GetWidth();
|
||||
iconsize.y = bm_invalid.GetHeight();
|
||||
m_imgList = new wxImageList( iconsize.x, iconsize.y, true, 1);
|
||||
m_imgList->Add( bm_invalid );
|
||||
wxIcon icon;
|
||||
icon.CopyFromBitmap( KiBitmap( cancel_xpm ) );
|
||||
m_imgList = new wxImageList( icon.GetSize().x, icon.GetSize().y, true, 1 );
|
||||
m_imgList->Add( icon );
|
||||
AssignImageList( m_imgList );
|
||||
|
||||
if( !m_readOnly )
|
||||
|
||||
@@ -148,7 +148,12 @@ void WX_GRID::DrawColLabel( wxDC& dc, int col )
|
||||
|
||||
// It is reported that we need to erase the background to avoid display
|
||||
// artefacts, see #12055.
|
||||
// wxWidgets renamed this variable between 3.1.2 and 3.1.3 ...
|
||||
#if wxCHECK_VERSION( 3, 1, 3 )
|
||||
wxDCBrushChanger setBrush( dc, m_colLabelWin->GetBackgroundColour() );
|
||||
#else
|
||||
wxDCBrushChanger setBrush( dc, m_colWindow->GetBackgroundColour() );
|
||||
#endif
|
||||
dc.DrawRectangle(rect);
|
||||
|
||||
rend.DrawBorder( *this, dc, rect );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2019 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
|
||||
@@ -27,9 +27,34 @@
|
||||
* @file wildcards_and_files_ext.cpp
|
||||
* Definition of file extensions used in Kicad.
|
||||
*/
|
||||
#include <regex>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
|
||||
bool compareFileExtensions( const std::string& aExtension,
|
||||
const std::vector<std::string>& aReference, bool aCaseSensitive )
|
||||
{
|
||||
// Form the regular expression string by placing all possible extensions into it as alternatives
|
||||
std::string regexString = "(";
|
||||
bool first = true;
|
||||
for( auto ext : aReference )
|
||||
{
|
||||
// The | separate goes between the extensions
|
||||
if( !first )
|
||||
regexString += "|";
|
||||
else
|
||||
first = false;
|
||||
|
||||
regexString += ext;
|
||||
}
|
||||
regexString += ")";
|
||||
|
||||
// Create the regex and see if it matches
|
||||
std::regex extRegex( regexString, aCaseSensitive ? std::regex::ECMAScript : std::regex::icase );
|
||||
return std::regex_match( aExtension, extRegex );
|
||||
}
|
||||
|
||||
|
||||
wxString formatWildcardExt( const wxString& aWildcard )
|
||||
{
|
||||
wxString wc;
|
||||
|
||||
@@ -140,7 +140,7 @@ static int guessNickname( FP_LIB_TABLE* aTbl, LIB_ID* aFootprintId )
|
||||
{
|
||||
wxArrayString fpnames;
|
||||
|
||||
aTbl->FootprintEnumerate( fpnames, nicks[libNdx] );
|
||||
aTbl->FootprintEnumerate( fpnames, nicks[libNdx], true );
|
||||
|
||||
for( unsigned nameNdx = 0; nameNdx<fpnames.size(); ++nameNdx )
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
||||
KiScaledBitmap( module_filtered_list_xpm, this ),
|
||||
wxNullBitmap,
|
||||
true, NULL,
|
||||
_( "Filter footprint list by schematic symbol keywords" ),
|
||||
_( "Use schematic symbol footprint filters" ),
|
||||
wxEmptyString );
|
||||
|
||||
m_mainToolBar->AddTool( ID_CVPCB_FOOTPRINT_DISPLAY_PIN_FILTERED_LIST,
|
||||
|
||||
+6
-1
@@ -63,9 +63,14 @@ int SCH_EDIT_FRAME::BlockCommand( EDA_KEY key )
|
||||
switch( key )
|
||||
{
|
||||
default:
|
||||
cmd = key & 0xFF;
|
||||
cmd = key & 0xFFFF;
|
||||
|
||||
if( cmd == 0 ) // All not handled values are seen as block move
|
||||
cmd = BLOCK_MOVE;
|
||||
|
||||
break;
|
||||
|
||||
case GR_KB_ALT: // Should be BLOCK_ROTATE. Not suported: fall into move
|
||||
case 0:
|
||||
cmd = BLOCK_MOVE;
|
||||
break;
|
||||
|
||||
@@ -745,7 +745,6 @@ void SCH_EDIT_FRAME::DeleteJunction( SCH_ITEM* aJunction, bool aAppend )
|
||||
{
|
||||
aItem->SetFlags( STRUCT_DELETED );
|
||||
itemList.PushItem( ITEM_PICKER( aItem, UR_DELETED ) );
|
||||
RemoveFromScreen( aItem );
|
||||
};
|
||||
|
||||
remove_item( aJunction );
|
||||
|
||||
@@ -64,9 +64,7 @@ int LIB_PART::m_subpartFirstId = 'A';
|
||||
|
||||
LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) :
|
||||
EDA_ITEM( LIB_ALIAS_T ),
|
||||
shared( aRootPart ),
|
||||
tmpUnit( 0 ),
|
||||
tmpConversion( 0 )
|
||||
shared( aRootPart )
|
||||
{
|
||||
SetName( aName );
|
||||
}
|
||||
@@ -74,9 +72,7 @@ LIB_ALIAS::LIB_ALIAS( const wxString& aName, LIB_PART* aRootPart ) :
|
||||
|
||||
LIB_ALIAS::LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootPart ) :
|
||||
EDA_ITEM( aAlias ),
|
||||
shared( aRootPart ),
|
||||
tmpUnit( 0 ),
|
||||
tmpConversion( 0 )
|
||||
shared( aRootPart )
|
||||
{
|
||||
name = aAlias.name;
|
||||
|
||||
@@ -534,7 +530,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||
}
|
||||
|
||||
// Not filled items and filled shapes are now plotted
|
||||
// (plot only items which are not already plotted)
|
||||
// Items that have BG fills only get re-stroked to ensure the edges are in the foreground
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
if( item.Type() == LIB_FIELD_T )
|
||||
@@ -546,8 +542,7 @@ void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert,
|
||||
if( aConvert && item.m_Convert && ( item.m_Convert != aConvert ) )
|
||||
continue;
|
||||
|
||||
if( item.m_Fill != FILLED_WITH_BG_BODYCOLOR )
|
||||
item.Plot( aPlotter, aOffset, fill, aTransform );
|
||||
item.Plot( aPlotter, aOffset, fill && ( item.m_Fill != FILLED_WITH_BG_BODYCOLOR ), aTransform );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -931,45 +926,6 @@ LIB_FIELD& LIB_PART::GetFootprintField()
|
||||
}
|
||||
|
||||
|
||||
bool LIB_PART::SaveDateAndTime( OUTPUTFORMATTER& aFormatter )
|
||||
{
|
||||
int year, mon, day, hour, min, sec;
|
||||
|
||||
if( m_dateLastEdition == 0 )
|
||||
return true;
|
||||
|
||||
sec = m_dateLastEdition & 63;
|
||||
min = ( m_dateLastEdition >> 6 ) & 63;
|
||||
hour = ( m_dateLastEdition >> 12 ) & 31;
|
||||
day = ( m_dateLastEdition >> 17 ) & 31;
|
||||
mon = ( m_dateLastEdition >> 22 ) & 15;
|
||||
year = ( m_dateLastEdition >> 26 ) + 1990;
|
||||
|
||||
aFormatter.Print( 0, "Ti %d/%d/%d %d:%d:%d\n", year, mon, day, hour, min, sec );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool LIB_PART::LoadDateAndTime( char* aLine )
|
||||
{
|
||||
int year, mon, day, hour, min, sec;
|
||||
|
||||
year = mon = day = hour = min = sec = 0;
|
||||
strtok( aLine, " \r\t\n" );
|
||||
strtok( NULL, " \r\t\n" );
|
||||
|
||||
if( sscanf( aLine, "%d/%d/%d %d:%d:%d", &year, &mon, &day, &hour, &min, &sec ) != 6 )
|
||||
return false;
|
||||
|
||||
m_dateLastEdition = ( sec & 63 ) + ( ( min & 63 ) << 6 ) +
|
||||
( ( hour & 31 ) << 12 ) + ( ( day & 31 ) << 17 ) +
|
||||
( ( mon & 15 ) << 22 ) + ( ( year - 1990 ) << 26 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LIB_PART::SetOffset( const wxPoint& aOffset )
|
||||
{
|
||||
for( LIB_ITEM& item : m_drawings )
|
||||
|
||||
@@ -87,9 +87,6 @@ protected:
|
||||
wxString keyWords; ///< keyword list (used for search for parts by keyword)
|
||||
wxString docFileName; ///< Associate doc file name
|
||||
|
||||
int tmpUnit; ///< Temporary unit designator (used for rendering)
|
||||
int tmpConversion; ///< Temporary conversion designator (used for rendering)
|
||||
|
||||
public:
|
||||
LIB_ALIAS( const wxString& aName, LIB_PART* aRootComponent );
|
||||
LIB_ALIAS( const LIB_ALIAS& aAlias, LIB_PART* aRootComponent = NULL );
|
||||
@@ -174,12 +171,6 @@ public:
|
||||
*/
|
||||
wxString GetUnitReference( int aUnit ) override;
|
||||
|
||||
/**
|
||||
* A temporary conversion (deMorgan) designation for rendering, preview, etc.
|
||||
*/
|
||||
void SetTmpConversion( int aConversion ) { tmpConversion = aConversion; }
|
||||
int GetTmpConversion() { return tmpConversion; }
|
||||
|
||||
/**
|
||||
* KEEPCASE sensitive comparison of the part entry name.
|
||||
*/
|
||||
@@ -272,8 +263,6 @@ class LIB_PART : public EDA_ITEM
|
||||
private:
|
||||
void deleteAllFields();
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
LIB_PART( const wxString& aName, PART_LIB* aLibrary = NULL );
|
||||
@@ -377,26 +366,6 @@ public:
|
||||
return GetUnitBoundingBox( 0, 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Write the date and time of part to \a aFile in the format:
|
||||
* "Ti yy/mm/jj hh:mm:ss"
|
||||
*
|
||||
* @param aFormatter A reference to an #OUTPUTFORMATTER object containing the
|
||||
* output format to write to.
|
||||
* @return True if the date and time were successfully written to \a aFormatter.
|
||||
*/
|
||||
bool SaveDateAndTime( OUTPUTFORMATTER& aFormatter );
|
||||
|
||||
bool LoadDateAndTime( char* aLine );
|
||||
|
||||
/**
|
||||
* Write the data structures out to \a aFormatter in the part library "*.lib" format.
|
||||
*
|
||||
* @param aFormatter A reference to an OUTPUTFORMATTER to write to.
|
||||
* @return True if success writing else false.
|
||||
*/
|
||||
bool Save( OUTPUTFORMATTER& aFormatter );
|
||||
|
||||
bool IsPower() const { return m_options == ENTRY_POWER; }
|
||||
bool IsNormal() const { return m_options == ENTRY_NORMAL; }
|
||||
|
||||
|
||||
@@ -456,20 +456,8 @@ void DIALOG_EDIT_COMPONENTS_LIBID::initDlg()
|
||||
candidate.m_Screen = item.GetSheetPath().LastScreen();
|
||||
SCH_SHEET_PATH sheetpath = item.GetSheetPath();
|
||||
candidate.m_Reference = candidate.m_Component->GetRef( &sheetpath );
|
||||
// For multi units per package , add unit id.
|
||||
// however, there is a problem: the unit id stored is always >= 1
|
||||
// and 1 for no multi units.
|
||||
// so add unit id only if unit > 1 if the unit count is > 1
|
||||
// (can be 0 if the symbol is not found)
|
||||
int unit = candidate.m_Component->GetUnitSelection( &sheetpath );
|
||||
int unitcount = candidate.m_Component->GetUnitCount();
|
||||
candidate.m_IsOrphan = ( unitcount == 0 );
|
||||
|
||||
if( unitcount > 1 || unit > 1 )
|
||||
{
|
||||
candidate.m_Reference << wxChar( ('A' + unit -1) );
|
||||
}
|
||||
|
||||
m_components.push_back( candidate );
|
||||
}
|
||||
#endif
|
||||
@@ -484,14 +472,12 @@ void DIALOG_EDIT_COMPONENTS_LIBID::initDlg()
|
||||
wxString last_str_libid = m_components.front().GetStringLibId();
|
||||
int row = 0;
|
||||
wxString refs;
|
||||
wxString last_ref;
|
||||
bool mark_cell = m_components.front().m_IsOrphan;
|
||||
CMP_CANDIDATE* cmp = nullptr;
|
||||
|
||||
for( unsigned ii = 0; ii < m_components.size(); ii++ )
|
||||
for( auto& cmp : m_components )
|
||||
{
|
||||
cmp = &m_components[ii];
|
||||
|
||||
wxString str_libid = cmp->GetStringLibId();
|
||||
wxString str_libid = cmp.GetStringLibId();
|
||||
|
||||
if( last_str_libid != str_libid )
|
||||
{
|
||||
@@ -499,17 +485,24 @@ void DIALOG_EDIT_COMPONENTS_LIBID::initDlg()
|
||||
AddRowToGrid( mark_cell, refs, last_str_libid );
|
||||
|
||||
// prepare next entry
|
||||
mark_cell = cmp->m_IsOrphan;
|
||||
mark_cell = cmp.m_IsOrphan;
|
||||
last_str_libid = str_libid;
|
||||
refs.Empty();
|
||||
row++;
|
||||
}
|
||||
else if( cmp.GetSchematicReference() == last_ref )
|
||||
{
|
||||
cmp.m_Row = row;
|
||||
continue;
|
||||
}
|
||||
|
||||
last_ref = cmp.GetSchematicReference();
|
||||
|
||||
if( !refs.IsEmpty() )
|
||||
refs += wxT( ", " );
|
||||
|
||||
refs += cmp->GetSchematicReference();
|
||||
cmp->m_Row = row;
|
||||
refs += cmp.GetSchematicReference();
|
||||
cmp.m_Row = row;
|
||||
}
|
||||
|
||||
// Add last component group:
|
||||
|
||||
@@ -151,10 +151,15 @@ void DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick( wxCommandEvent& aEvent
|
||||
|
||||
void DIALOG_EDIT_ONE_FIELD::OnSetFocusText( wxFocusEvent& event )
|
||||
{
|
||||
|
||||
#ifdef __WXGTK__
|
||||
// Force an update of the text control before setting the text selection
|
||||
// This is needed because GTK seems to ignore the selection on first update
|
||||
//
|
||||
// Note that we can't do this on OSX as it tends to provoke Apple's
|
||||
// "[NSAlert runModal] may not be invoked inside of transaction begin/commit pair"
|
||||
// bug. See: https://bugs.launchpad.net/kicad/+bug/1837225
|
||||
m_TextValue->Update();
|
||||
#endif
|
||||
|
||||
if( m_fieldId == REFERENCE )
|
||||
SelectReferenceNumber( static_cast<wxTextEntry*>( m_TextValue ) );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jul 11 2018)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -16,186 +16,186 @@
|
||||
DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
|
||||
wxBoxSizer* mainSizer;
|
||||
mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* bUpperSizer;
|
||||
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
|
||||
wxBoxSizer* bLeftSizer;
|
||||
bLeftSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxGridBagSizer* gbSizer1;
|
||||
gbSizer1 = new wxGridBagSizer( 1, 0 );
|
||||
gbSizer1 = new wxGridBagSizer( 5, 5 );
|
||||
gbSizer1->SetFlexibleDirection( wxBOTH );
|
||||
gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
|
||||
m_pinNameLabel = new wxStaticText( this, wxID_ANY, _("Pin &name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pinNameLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_pinNameLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_textPinName = new wxTextCtrl( this, ID_M_TEXTPINNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_textPinName, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_pinNumberLabel = new wxStaticText( this, ID_M_STATICTEXTPADNAME, _("Pin n&umber:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_pinNameLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textPinName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_textPinName, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_pinNumberLabel = new wxStaticText( this, wxID_ANY, _("Pin num&ber:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pinNumberLabel->Wrap( -1 );
|
||||
m_pinNumberLabel->SetToolTip( _("Pin number: 1 to 4 ASCII letters and/or digits") );
|
||||
|
||||
gbSizer1->Add( m_pinNumberLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_textPinNumber = new wxTextCtrl( this, ID_M_TEXTPADNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_textPinNumber, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextEType = new wxStaticText( this, wxID_ANY, _("&Electrical type:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextEType->Wrap( -1 );
|
||||
m_staticTextEType->SetToolTip( _("Used by the ERC.") );
|
||||
|
||||
gbSizer1->Add( m_staticTextEType, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_choiceElectricalType = new PinTypeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceElectricalType, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_staticTextGstyle = new wxStaticText( this, wxID_ANY, _("Graphic style:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextGstyle->Wrap( -1 );
|
||||
gbSizer1->Add( m_staticTextGstyle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_choiceStyle = new PinShapeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceStyle, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_posXLabel = new wxStaticText( this, wxID_ANY, _("X position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
gbSizer1->Add( m_pinNumberLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_textPinNumber = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_textPinNumber, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_posXLabel = new wxStaticText( this, wxID_ANY, _("&X position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posXLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_posXLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
gbSizer1->Add( m_posXLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_posXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posXCtrl->SetMinSize( wxSize( 110,-1 ) );
|
||||
|
||||
gbSizer1->Add( m_posXCtrl, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
|
||||
gbSizer1->Add( m_posXCtrl, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_posYLabel = new wxStaticText( this, wxID_ANY, _("&Y position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posYLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_posYLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_posYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_posYCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_pinLengthLabel = new wxStaticText( this, wxID_ANY, _("&Pin length:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pinLengthLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_pinLengthLabel, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_pinLengthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_pinLengthCtrl, wxGBPosition( 7, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_nameSizeLabel = new wxStaticText( this, wxID_ANY, _("N&ame text size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_nameSizeLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_nameSizeLabel, wxGBPosition( 8, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_nameSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_nameSizeCtrl, wxGBPosition( 8, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_numberSizeLabel = new wxStaticText( this, wxID_ANY, _("Number text si&ze:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_numberSizeLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_numberSizeLabel, wxGBPosition( 9, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_numberSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_numberSizeCtrl, wxGBPosition( 9, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextEType = new wxStaticText( this, wxID_ANY, _("Electrical type:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextEType->Wrap( -1 );
|
||||
m_staticTextEType->SetToolTip( _("Used by the ERC.") );
|
||||
|
||||
gbSizer1->Add( m_staticTextEType, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_choiceElectricalType = new PinTypeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceElectricalType, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextGstyle = new wxStaticText( this, wxID_ANY, _("Graphic style:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextGstyle->Wrap( -1 );
|
||||
gbSizer1->Add( m_staticTextGstyle, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_choiceStyle = new PinShapeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceStyle, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_staticTextOrient = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextOrient->Wrap( -1 );
|
||||
gbSizer1->Add( m_staticTextOrient, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_choiceOrientation = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN|wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceOrientation, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
|
||||
|
||||
m_posXUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posXUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_posXUnits, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
m_posYLabel = new wxStaticText( this, wxID_ANY, _("Y position:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posYLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_posYLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_posYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_posYCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
gbSizer1->Add( m_posXUnits, wxGBPosition( 4, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_posYUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_posYUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_posYUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
m_staticTextOrient = new wxStaticText( this, wxID_ANY, _("&Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextOrient->Wrap( -1 );
|
||||
gbSizer1->Add( m_staticTextOrient, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_choiceOrientation = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
|
||||
gbSizer1->Add( m_choiceOrientation, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_pinLengthLabel = new wxStaticText( this, ID_M_STATICTEXTPINLEN, _("Pin length:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pinLengthLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_pinLengthLabel, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_pinLengthCtrl = new wxTextCtrl( this, ID_M_TEXTLENGTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_pinLengthCtrl, wxGBPosition( 7, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_pinLengthUnits = new wxStaticText( this, ID_M_STATICLENGTHUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_posYUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_pinLengthUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_pinLengthUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_pinLengthUnits, wxGBPosition( 7, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
m_nameSizeLabel = new wxStaticText( this, ID_M_STATICTEXTNAMESIZE, _("N&ame text size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_nameSizeLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_nameSizeLabel, wxGBPosition( 8, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 );
|
||||
|
||||
m_nameSizeCtrl = new wxTextCtrl( this, ID_M_TEXTPINNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_nameSizeCtrl, wxGBPosition( 8, 1 ), wxGBSpan( 1, 1 ), wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_nameSizeUnits = new wxStaticText( this, ID_M_STATICNAMETEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_pinLengthUnits, wxGBPosition( 7, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_nameSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_nameSizeUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_nameSizeUnits, wxGBPosition( 8, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
|
||||
|
||||
m_numberSizeLabel = new wxStaticText( this, ID_M_STATICTEXTPADNAMESIZE, _("Number te&xt size:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_numberSizeLabel->Wrap( -1 );
|
||||
gbSizer1->Add( m_numberSizeLabel, wxGBPosition( 9, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_numberSizeCtrl = new wxTextCtrl( this, ID_M_TEXTPADNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_numberSizeCtrl, wxGBPosition( 9, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_numberSizeUnits = new wxStaticText( this, ID_M_STATICNUMBERTEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
gbSizer1->Add( m_nameSizeUnits, wxGBPosition( 8, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
m_numberSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_numberSizeUnits->Wrap( -1 );
|
||||
gbSizer1->Add( m_numberSizeUnits, wxGBPosition( 9, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
|
||||
gbSizer1->Add( m_numberSizeUnits, wxGBPosition( 9, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
|
||||
|
||||
|
||||
gbSizer1->AddGrowableCol( 1 );
|
||||
|
||||
bLeftSizer->Add( gbSizer1, 1, wxEXPAND|wxTOP, 5 );
|
||||
|
||||
|
||||
|
||||
bLeftSizer->Add( gbSizer1, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bUpperSizer->Add( bLeftSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
wxBoxSizer* bRightSizer;
|
||||
bRightSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
wxBoxSizer* checkboxesSizer;
|
||||
checkboxesSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_checkApplyToAllParts = new wxCheckBox( this, wxID_ANY, _("Common to all &units in symbol"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
checkboxesSizer->Add( m_checkApplyToAllParts, 0, wxALL, 3 );
|
||||
|
||||
checkboxesSizer->Add( m_checkApplyToAllParts, 0, wxBOTTOM, 3 );
|
||||
|
||||
m_checkApplyToAllConversions = new wxCheckBox( this, wxID_ANY, _("Common to all body &styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
checkboxesSizer->Add( m_checkApplyToAllConversions, 0, wxALL, 3 );
|
||||
|
||||
|
||||
checkboxesSizer->Add( m_checkApplyToAllConversions, 0, wxBOTTOM, 3 );
|
||||
|
||||
|
||||
checkboxesSizer->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
|
||||
|
||||
|
||||
m_checkShow = new wxCheckBox( this, wxID_ANY, _("&Visible"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_checkShow->SetValue(true);
|
||||
checkboxesSizer->Add( m_checkShow, 0, wxALL, 3 );
|
||||
|
||||
|
||||
m_checkShow->SetValue(true);
|
||||
checkboxesSizer->Add( m_checkShow, 0, wxBOTTOM, 3 );
|
||||
|
||||
|
||||
bRightSizer->Add( checkboxesSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
|
||||
m_panelShowPin->SetMinSize( wxSize( 150,150 ) );
|
||||
|
||||
bRightSizer->Add( m_panelShowPin, 1, wxEXPAND | wxALL, 5 );
|
||||
|
||||
|
||||
|
||||
bRightSizer->Add( m_panelShowPin, 1, wxEXPAND|wxLEFT, 5 );
|
||||
|
||||
|
||||
bUpperSizer->Add( bRightSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
mainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
||||
mainSizer->Add( bUpperSizer, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
mainSizer->Add( m_staticline1, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_sdbSizerButtons = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK );
|
||||
m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
|
||||
m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel );
|
||||
m_sdbSizerButtons->Realize();
|
||||
|
||||
|
||||
mainSizer->Add( m_sdbSizerButtons, 0, wxALL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
|
||||
|
||||
|
||||
this->SetSizer( mainSizer );
|
||||
this->Layout();
|
||||
mainSizer->Fit( this );
|
||||
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
|
||||
// Connect Events
|
||||
m_textPinName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_textPinNumber->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceElectricalType->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceStyle->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceOrientation->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_pinLengthCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_nameSizeCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_numberSizeCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceElectricalType->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceStyle->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceOrientation->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkApplyToAllParts->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkApplyToAllConversions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkShow->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
@@ -207,15 +207,15 @@ DIALOG_LIB_EDIT_PIN_BASE::~DIALOG_LIB_EDIT_PIN_BASE()
|
||||
// Disconnect Events
|
||||
m_textPinName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_textPinNumber->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceElectricalType->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceStyle->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceOrientation->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_pinLengthCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_nameSizeCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_numberSizeCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceElectricalType->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceStyle->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_choiceOrientation->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkApplyToAllParts->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkApplyToAllConversions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_checkShow->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
|
||||
m_panelShowPin->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPaintShowPanel ), NULL, this );
|
||||
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jul 11 2018)
|
||||
// C++ code generated with wxFormBuilder (version Aug 15 2019)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_LIB_EDIT_PIN_BASE_H__
|
||||
#define __DIALOG_LIB_EDIT_PIN_BASE_H__
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
@@ -40,48 +39,32 @@ class wxBitmapComboBox;
|
||||
class DIALOG_LIB_EDIT_PIN_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
ID_M_TEXTPINNAME = 1000,
|
||||
ID_M_STATICTEXTPADNAME,
|
||||
ID_M_TEXTPADNAME,
|
||||
ID_M_STATICTEXTPINLEN,
|
||||
ID_M_TEXTLENGTH,
|
||||
ID_M_STATICLENGTHUNITS,
|
||||
ID_M_STATICTEXTNAMESIZE,
|
||||
ID_M_TEXTPINNAMETEXTSIZE,
|
||||
ID_M_STATICNAMETEXTSIZEUNITS,
|
||||
ID_M_STATICTEXTPADNAMESIZE,
|
||||
ID_M_TEXTPADNAMETEXTSIZE,
|
||||
ID_M_STATICNUMBERTEXTSIZEUNITS
|
||||
};
|
||||
|
||||
wxStaticText* m_pinNameLabel;
|
||||
wxTextCtrl* m_textPinName;
|
||||
wxStaticText* m_pinNumberLabel;
|
||||
wxTextCtrl* m_textPinNumber;
|
||||
wxStaticText* m_posXLabel;
|
||||
wxTextCtrl* m_posXCtrl;
|
||||
wxStaticText* m_posYLabel;
|
||||
wxTextCtrl* m_posYCtrl;
|
||||
wxStaticText* m_pinLengthLabel;
|
||||
wxTextCtrl* m_pinLengthCtrl;
|
||||
wxStaticText* m_nameSizeLabel;
|
||||
wxTextCtrl* m_nameSizeCtrl;
|
||||
wxStaticText* m_numberSizeLabel;
|
||||
wxTextCtrl* m_numberSizeCtrl;
|
||||
wxStaticText* m_staticTextEType;
|
||||
PinTypeComboBox* m_choiceElectricalType;
|
||||
wxStaticText* m_staticTextGstyle;
|
||||
PinShapeComboBox* m_choiceStyle;
|
||||
wxStaticText* m_posXLabel;
|
||||
wxTextCtrl* m_posXCtrl;
|
||||
wxStaticText* m_posXUnits;
|
||||
wxStaticText* m_posYLabel;
|
||||
wxTextCtrl* m_posYCtrl;
|
||||
wxStaticText* m_posYUnits;
|
||||
wxStaticText* m_staticTextOrient;
|
||||
wxBitmapComboBox* m_choiceOrientation;
|
||||
wxStaticText* m_pinLengthLabel;
|
||||
wxTextCtrl* m_pinLengthCtrl;
|
||||
wxStaticText* m_posXUnits;
|
||||
wxStaticText* m_posYUnits;
|
||||
wxStaticText* m_pinLengthUnits;
|
||||
wxStaticText* m_nameSizeLabel;
|
||||
wxTextCtrl* m_nameSizeCtrl;
|
||||
wxStaticText* m_nameSizeUnits;
|
||||
wxStaticText* m_numberSizeLabel;
|
||||
wxTextCtrl* m_numberSizeCtrl;
|
||||
wxStaticText* m_numberSizeUnits;
|
||||
wxCheckBox* m_checkApplyToAllParts;
|
||||
wxCheckBox* m_checkApplyToAllConversions;
|
||||
@@ -91,17 +74,16 @@ class DIALOG_LIB_EDIT_PIN_BASE : public DIALOG_SHIM
|
||||
wxStdDialogButtonSizer* m_sdbSizerButtons;
|
||||
wxButton* m_sdbSizerButtonsOK;
|
||||
wxButton* m_sdbSizerButtonsCancel;
|
||||
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void OnPropertiesChange( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pin Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pin Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
~DIALOG_LIB_EDIT_PIN_BASE();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_LIB_EDIT_PIN_BASE_H__
|
||||
|
||||
@@ -309,6 +309,9 @@ public:
|
||||
ascending = GetView()->IsSortOrderAscending();
|
||||
}
|
||||
|
||||
for( LIB_PINS& row : m_rows )
|
||||
SortPins( row );
|
||||
|
||||
SortRows( sortCol, ascending );
|
||||
|
||||
if ( GetView() )
|
||||
@@ -321,8 +324,19 @@ public:
|
||||
void SortRows( int aSortCol, bool ascending )
|
||||
{
|
||||
std::sort( m_rows.begin(), m_rows.end(),
|
||||
[ aSortCol, ascending, this ]( LIB_PINS lhs, LIB_PINS rhs ) -> bool
|
||||
{ return compare( lhs, rhs, aSortCol, ascending, m_userUnits ); } );
|
||||
[ aSortCol, ascending, this ]( LIB_PINS& lhs, LIB_PINS& rhs ) -> bool
|
||||
{
|
||||
return compare( lhs, rhs, aSortCol, ascending, m_userUnits );
|
||||
} );
|
||||
}
|
||||
|
||||
void SortPins( LIB_PINS& aRow )
|
||||
{
|
||||
std::sort( aRow.begin(), aRow.end(),
|
||||
[]( LIB_PIN* lhs, LIB_PIN* rhs ) -> bool
|
||||
{
|
||||
return PinNumbers::Compare( lhs->GetNumber(), rhs->GetNumber() ) < 0;
|
||||
} );
|
||||
}
|
||||
|
||||
void AppendRow( LIB_PIN* aPin )
|
||||
|
||||
@@ -226,7 +226,8 @@ void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent )
|
||||
book->AddPage( new PANEL_EESCHEMA_SETTINGS( this, book ), _( "Eeschema" ) );
|
||||
book->AddSubPage( new PANEL_EESCHEMA_DISPLAY_OPTIONS( this, book ), _( "Display Options" ) );
|
||||
book->AddSubPage( new PANEL_EESCHEMA_COLOR_CONFIG( this, book ), _( "Colors" ) );
|
||||
book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ), _( "Field Name Templates" ) );
|
||||
book->AddSubPage( new PANEL_EESCHEMA_TEMPLATE_FIELDNAMES( this, book ),
|
||||
_( "Field Name Templates" ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -355,6 +356,7 @@ static const wxString PrintSheetRefEntry = "PrintSheetReferenceAndTitle
|
||||
static const wxString RepeatStepXEntry = "RepeatStepX";
|
||||
static const wxString RepeatStepYEntry = "RepeatStepY";
|
||||
static const wxString RepeatLabelIncrementEntry = "RepeatLabelIncrement";
|
||||
static const wxString ShowIllegalSymboLibDialog = "ShowIllegalSymbolLibDialog";
|
||||
|
||||
// Library editor wxConfig entry names.
|
||||
static const wxChar defaultLibWidthEntry[] = wxT( "LibeditLibWidth" );
|
||||
@@ -395,8 +397,11 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings()
|
||||
-REPEAT_OFFSET_MAX,
|
||||
REPEAT_OFFSET_MAX ) );
|
||||
m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry,
|
||||
&m_repeatDeltaLabel,
|
||||
DEFAULT_REPEAT_LABEL_INC, -10, +10 ) );
|
||||
&m_repeatDeltaLabel, DEFAULT_REPEAT_LABEL_INC,
|
||||
-10, +10 ) );
|
||||
m_configSettings.push_back( new PARAM_CFG_BOOL( true, ShowIllegalSymboLibDialog,
|
||||
&m_showIllegalSymbolLibDialog, true ) );
|
||||
|
||||
return m_configSettings;
|
||||
}
|
||||
|
||||
@@ -551,7 +556,8 @@ void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
||||
|
||||
ReadHotkeyConfig( LIB_EDIT_FRAME_NAME, g_Libedit_Hotkeys_Descr );
|
||||
|
||||
SetDefaultLineThickness( (int) aCfg->Read( DefaultDrawLineWidthEntry, DEFAULTDRAWLINETHICKNESS ) );
|
||||
SetDefaultLineThickness( (int) aCfg->Read( DefaultDrawLineWidthEntry,
|
||||
DEFAULTDRAWLINETHICKNESS ) );
|
||||
SetDefaultPinLength( (int) aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) );
|
||||
m_textPinNumDefaultSize = (int) aCfg->Read( defaultPinNumSizeEntry, DEFAULTPINNUMSIZE );
|
||||
m_textPinNameDefaultSize = (int) aCfg->Read( defaultPinNameSizeEntry, DEFAULTPINNAMESIZE );
|
||||
|
||||
+31
-224
@@ -351,6 +351,36 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
}
|
||||
else
|
||||
{
|
||||
// Double check to ensure no legacy library list entries have been
|
||||
// added to the projec file symbol library list.
|
||||
wxString paths;
|
||||
wxArrayString libNames;
|
||||
|
||||
PART_LIBS::LibNamesAndPaths( &Prj(), false, &paths, &libNames );
|
||||
|
||||
if( !libNames.IsEmpty() )
|
||||
{
|
||||
if( m_showIllegalSymbolLibDialog )
|
||||
{
|
||||
wxRichMessageDialog invalidLibDlg(
|
||||
this,
|
||||
_( "Illegal entry found in project file symbol library list." ),
|
||||
_( "Project Load Warning" ),
|
||||
wxOK | wxCENTER | wxICON_EXCLAMATION );
|
||||
invalidLibDlg.SetExtendedMessage(
|
||||
_( "Symbol libraries defined in the project file symbol library list "
|
||||
"are no longer supported and will be\nremoved. This may cause "
|
||||
"broken symbol library links under certain conditions." ) );
|
||||
invalidLibDlg.ShowCheckBox( _( "Do not show this dialog again." ) );
|
||||
invalidLibDlg.ShowModal();
|
||||
m_showIllegalSymbolLibDialog = !invalidLibDlg.IsCheckBoxChecked();
|
||||
}
|
||||
|
||||
libNames.Clear();
|
||||
paths.Clear();
|
||||
PART_LIBS::LibNamesAndPaths( &Prj(), true, &paths, &libNames );
|
||||
}
|
||||
|
||||
// Check to see whether some old library parts need to be rescued
|
||||
// Only do this if RescueNeverShow was not set.
|
||||
wxConfigBase *config = Kiface().KifaceSettings();
|
||||
@@ -386,7 +416,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||
|
||||
bool SCH_EDIT_FRAME::AppendSchematic()
|
||||
{
|
||||
wxString msg;
|
||||
wxString fullFileName;
|
||||
SCH_SCREEN* screen = GetScreen();
|
||||
|
||||
@@ -407,232 +436,10 @@ bool SCH_EDIT_FRAME::AppendSchematic()
|
||||
|
||||
fullFileName = dlg.GetPath();
|
||||
|
||||
wxFileName fn = fullFileName;
|
||||
|
||||
if( fn.IsRelative() )
|
||||
{
|
||||
fn.MakeAbsolute();
|
||||
fullFileName = fn.GetFullPath();
|
||||
}
|
||||
|
||||
wxString cache_name = PART_LIBS::CacheName( fullFileName );
|
||||
|
||||
if( !!cache_name )
|
||||
{
|
||||
PART_LIBS* libs = Prj().SchLibs();
|
||||
|
||||
try
|
||||
{
|
||||
if( PART_LIB* lib = libs->AddLibrary( cache_name ) )
|
||||
lib->SetCache();
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this, ioe.What() );
|
||||
}
|
||||
}
|
||||
|
||||
wxLogDebug( wxT( "Importing schematic " ) + fullFileName );
|
||||
|
||||
// Load the schematic into a temporary sheet.
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
|
||||
std::unique_ptr< SCH_SHEET> newSheet( new SCH_SHEET );
|
||||
|
||||
newSheet->SetFileName( fullFileName );
|
||||
|
||||
try
|
||||
{
|
||||
pi->Load( fullFileName, &Kiway(), newSheet.get() );
|
||||
|
||||
if( !pi->GetError().IsEmpty() )
|
||||
{
|
||||
DisplayErrorMessage( this,
|
||||
_( "The entire schematic could not be loaded. Errors "
|
||||
"occurred attempting to load hierarchical sheet "
|
||||
"schematics." ),
|
||||
pi->GetError() );
|
||||
}
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "Error occurred loading schematic file \"%s\"." ), fullFileName );
|
||||
DisplayErrorMessage( this, msg, ioe.What() );
|
||||
|
||||
msg.Printf( _( "Failed to load schematic \"%s\"" ), fullFileName );
|
||||
AppendMsgPanel( wxEmptyString, msg, CYAN );
|
||||
|
||||
if( !LoadSheetFromFile( GetCurrentSheet().Last(), &GetCurrentSheet(), fullFileName ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure any new sheet changes do not cause any recursion issues.
|
||||
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the schematic sheet hierarchy.
|
||||
SCH_SHEET_LIST sheetHierarchy( newSheet.get() ); // This is the hierarchy of the import.
|
||||
|
||||
wxFileName destFile = screen->GetFileName();
|
||||
|
||||
if( destFile.IsRelative() )
|
||||
destFile.MakeAbsolute( Prj().GetProjectPath() );
|
||||
|
||||
if( hierarchy.TestForRecursion( sheetHierarchy, destFile.GetFullPath( wxPATH_UNIX ) ) )
|
||||
{
|
||||
msg.Printf( _( "The sheet changes cannot be made because the destination sheet already "
|
||||
"has the sheet \"%s\" or one of it's subsheets as a parent somewhere in "
|
||||
"the schematic hierarchy." ),
|
||||
destFile.GetFullPath() );
|
||||
DisplayError( this, msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
wxArrayString names;
|
||||
|
||||
// Make sure the imported schematic has been remapped to the symbol library table.
|
||||
SCH_SCREENS newScreens( newSheet.get() ); // All screens associated with the import.
|
||||
|
||||
if( newScreens.HasNoFullyDefinedLibIds() )
|
||||
{
|
||||
DisplayInfoMessage( this,
|
||||
"This schematic has not been remapped to the symbol library\n"
|
||||
"table. The project this schematic belongs to must first be\n"
|
||||
"remapped before it can be imported into the current project." );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If there are symbol libraries in the imported schematic that are not in the
|
||||
// symbol library table of this project, there could be a lot of broken symbol
|
||||
// library links. Attempt to add the missing libraries to the project symbol
|
||||
// library table.
|
||||
newScreens.GetLibNicknames( names );
|
||||
wxArrayString newLibNames;
|
||||
|
||||
for( const auto& name : names )
|
||||
{
|
||||
if( !Prj().SchSymbolLibTable()->HasLibrary( name ) )
|
||||
newLibNames.Add( name );
|
||||
}
|
||||
|
||||
wxFileName symLibTableFn( fn.GetPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
|
||||
|
||||
if( !newLibNames.IsEmpty() && symLibTableFn.Exists() && symLibTableFn.IsFileReadable() )
|
||||
{
|
||||
SYMBOL_LIB_TABLE table;
|
||||
|
||||
try
|
||||
{
|
||||
table.Load( symLibTableFn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "An error occurred loading the symbol library table \"%s\"." ),
|
||||
symLibTableFn.GetFullPath() );
|
||||
DisplayErrorMessage( NULL, msg, ioe.What() );
|
||||
}
|
||||
|
||||
if( !table.IsEmpty() )
|
||||
{
|
||||
for( const auto& libName : newLibNames )
|
||||
{
|
||||
if( !table.HasLibrary( libName ) )
|
||||
continue;
|
||||
|
||||
// Don't expand environment variable because KIPRJMOD will not be correct
|
||||
// for a different project.
|
||||
wxString uri = table.GetFullURI( libName, false );
|
||||
wxFileName newLib;
|
||||
|
||||
if( uri.Contains( "${KIPRJMOD}" ) )
|
||||
{
|
||||
newLib.SetPath( fn.GetPath() );
|
||||
newLib.SetFullName( uri.AfterLast( '}' ) );
|
||||
uri = newLib.GetFullPath();
|
||||
}
|
||||
else if( uri.Contains( "$(KIPRJMOD)" ) )
|
||||
{
|
||||
newLib.SetPath( fn.GetPath() );
|
||||
newLib.SetFullName( uri.AfterLast( ')' ) );
|
||||
uri = newLib.GetFullPath();
|
||||
}
|
||||
else
|
||||
{
|
||||
uri = table.GetFullURI( libName );
|
||||
}
|
||||
|
||||
// Add the library from the imported project to the current project
|
||||
// symbol library table.
|
||||
const SYMBOL_LIB_TABLE_ROW* row = table.FindRow( libName );
|
||||
|
||||
wxCHECK2_MSG( row, continue, "Library '" + libName +
|
||||
"' missing from symbol library table '" +
|
||||
symLibTableFn.GetFullPath() + "'." );
|
||||
|
||||
wxString newLibName = libName;
|
||||
int libNameCnt = 1;
|
||||
|
||||
// Rename the imported symbol library if it already exists.
|
||||
while( Prj().SchSymbolLibTable()->HasLibrary( newLibName ) )
|
||||
newLibName = wxString::Format( "%s%d", libName, libNameCnt );
|
||||
|
||||
auto newRow = new SYMBOL_LIB_TABLE_ROW( newLibName, uri, row->GetType(),
|
||||
row->GetOptions(), row->GetDescr() );
|
||||
Prj().SchSymbolLibTable()->InsertRow( newRow );
|
||||
|
||||
if( libName != newLibName )
|
||||
newScreens.ChangeSymbolLibNickname( libName, newLibName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newScreens.ClearAnnotation();
|
||||
|
||||
// Check for duplicate sheet names in the current page.
|
||||
wxArrayString duplicateSheetNames;
|
||||
SCH_TYPE_COLLECTOR sheets;
|
||||
|
||||
sheets.Collect( screen->GetDrawItems(), SCH_COLLECTOR::SheetsOnly );
|
||||
|
||||
for( int i = 0; i < sheets.GetCount(); ++i )
|
||||
{
|
||||
if( newSheet->GetScreen()->GetSheet( ( ( SCH_SHEET* ) sheets[i] )->GetName() ) )
|
||||
duplicateSheetNames.Add( ( ( SCH_SHEET* ) sheets[i] )->GetName() );
|
||||
}
|
||||
|
||||
if( !duplicateSheetNames.IsEmpty() )
|
||||
{
|
||||
msg.Printf( "Duplicate sheet names exist on the current page. Do you want to "
|
||||
"automatically rename the duplicate sheet names?" );
|
||||
if( !IsOK( this, msg ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
SCH_SCREEN* newScreen = newSheet->GetScreen();
|
||||
wxCHECK_MSG( newScreen, false, "No screen defined for imported sheet." );
|
||||
|
||||
for( const auto& duplicateName : duplicateSheetNames )
|
||||
{
|
||||
SCH_SHEET* renamedSheet = newScreen->GetSheet( duplicateName );
|
||||
|
||||
wxCHECK2_MSG( renamedSheet, continue,
|
||||
"Sheet " + duplicateName + " not found in imported schematic." );
|
||||
|
||||
timestamp_t newtimestamp = GetNewTimeStamp();
|
||||
renamedSheet->SetTimeStamp( newtimestamp );
|
||||
renamedSheet->SetName( wxString::Format( "Sheet%8.8lX", (unsigned long) newtimestamp ) );
|
||||
}
|
||||
|
||||
// It is finally safe to add the imported schematic.
|
||||
screen->Append( newScreen );
|
||||
|
||||
SCH_SCREENS allScreens;
|
||||
allScreens.ReplaceDuplicateTimeStamps();
|
||||
|
||||
SCH_SCREENS screens( GetCurrentSheet().Last() );
|
||||
screens.UpdateSymbolLinks( true );
|
||||
|
||||
// Clear all annotation in the imported schematic to prevent clashes with existing annotation.
|
||||
// Must be done after updating the symbol links as we need to know about multi-unit parts.
|
||||
// screens.ClearAnnotation();
|
||||
|
||||
screens.TestDanglingEnds();
|
||||
|
||||
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
|
||||
|
||||
+6
-23
@@ -729,34 +729,15 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
||||
MapY1 * radius * 2 + y1 );
|
||||
GRLineTo( clipbox, aDC, posX, posY, width, color );
|
||||
}
|
||||
else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK ) /* an alternative for Inverted Clock */
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
{
|
||||
GRMoveTo( x1, y1 + clock_size );
|
||||
GRLineTo( clipbox, aDC, x1 + MapX1 * clock_size * 2, y1,
|
||||
width, color );
|
||||
GRLineTo( clipbox, aDC, x1, y1 - clock_size, width, color );
|
||||
}
|
||||
else /* MapX1 = 0 */
|
||||
{
|
||||
GRMoveTo( x1 + clock_size, y1 );
|
||||
GRLineTo( clipbox, aDC, x1, y1 + MapY1 * clock_size * 2,
|
||||
width, color );
|
||||
GRLineTo( clipbox, aDC, x1 - clock_size, y1,
|
||||
width, color );
|
||||
}
|
||||
GRMoveTo( MapX1 * clock_size * 2 + x1, MapY1 * clock_size * 2 + y1 );
|
||||
GRLineTo( clipbox, aDC, posX, posY, width, color );
|
||||
}
|
||||
else
|
||||
{
|
||||
GRMoveTo( x1, y1 );
|
||||
GRLineTo( clipbox, aDC, posX, posY, width, color );
|
||||
}
|
||||
|
||||
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
// Draw the clock shape (>)inside the symbol
|
||||
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK ||
|
||||
m_shape == PINSHAPE_FALLING_EDGE_CLOCK || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
{
|
||||
const int clock_size = InternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
@@ -777,7 +758,9 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel,
|
||||
}
|
||||
}
|
||||
|
||||
if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
// Draw the active low (or H to L active transition)
|
||||
if( m_shape == PINSHAPE_INPUT_LOW ||
|
||||
m_shape == PINSHAPE_FALLING_EDGE_CLOCK || m_shape == PINSHAPE_CLOCK_LOW )
|
||||
{
|
||||
const int symbol_size = ExternalPinDecoSize( *this );
|
||||
if( MapY1 == 0 ) /* MapX1 = +- 1 */
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras ar wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2019 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
|
||||
@@ -126,7 +126,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName )
|
||||
component->GetLibId().GetUniStringLibId() );
|
||||
}
|
||||
|
||||
if( !tmp.empty() )
|
||||
if( !tmp.empty() && !errorMsg.Contains( component->GetLibId().GetUniStringLibId() ) )
|
||||
{
|
||||
if( errorMsg.empty() )
|
||||
errorMsg += tmp;
|
||||
|
||||
@@ -171,7 +171,11 @@ int LIB_EDIT_FRAME::BlockCommand( EDA_KEY key )
|
||||
switch( key )
|
||||
{
|
||||
default:
|
||||
cmd = key & 0xFF;
|
||||
cmd = key & 0xFFFF;
|
||||
|
||||
if( cmd == 0 ) // All not handled values are seen as block move
|
||||
cmd = BLOCK_MOVE;
|
||||
|
||||
break;
|
||||
|
||||
case EDA_KEY_C( 0xffffffff ): // -1
|
||||
@@ -185,6 +189,8 @@ int LIB_EDIT_FRAME::BlockCommand( EDA_KEY key )
|
||||
cmd = BLOCK_PRESELECT_MOVE;
|
||||
break;
|
||||
|
||||
case GR_KB_ALT: // Should be BLOCK_ROTATE. Not suported: fall into move
|
||||
case GR_KB_CTRL: // Should be BLOCK_MIRROR_Y. Not suported: fall into move
|
||||
case GR_KEY_NONE:
|
||||
cmd = BLOCK_MOVE;
|
||||
break;
|
||||
@@ -193,18 +199,10 @@ int LIB_EDIT_FRAME::BlockCommand( EDA_KEY key )
|
||||
cmd = BLOCK_DUPLICATE;
|
||||
break;
|
||||
|
||||
case GR_KB_ALT:
|
||||
cmd = BLOCK_ROTATE;
|
||||
break;
|
||||
|
||||
case GR_KB_SHIFTCTRL:
|
||||
cmd = BLOCK_DELETE;
|
||||
break;
|
||||
|
||||
case GR_KB_CTRL:
|
||||
cmd = BLOCK_MIRROR_Y;
|
||||
break;
|
||||
|
||||
case MOUSE_MIDDLE:
|
||||
cmd = BLOCK_ZOOM;
|
||||
break;
|
||||
|
||||
@@ -1084,7 +1084,19 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event )
|
||||
m_libMgr->UpdatePart( GetCurPart(), GetCurLib() );
|
||||
|
||||
if( oldAliases != GetCurPart()->GetAliasNames( false ) )
|
||||
{
|
||||
// If the number of aliases (or their names) have changed, do a full re-sync
|
||||
SyncLibraries( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise just update each alias
|
||||
for( LIB_ALIAS* alias : GetCurPart()->GetAliases() )
|
||||
{
|
||||
wxDataViewItem item = m_libMgr->GetAdapter()->FindItem( alias->GetLibId() );
|
||||
static_cast<LIB_TREE_NODE_LIB_ID*>( item.GetID() )->Update( alias );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdatePartSelectList();
|
||||
|
||||
@@ -454,7 +454,9 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
|
||||
|| couplingK.Matches( line ) // K## L## L## coupling constant
|
||||
|| ( directiveStarted && line.StartsWith( '+' ) ) ) // multiline directives
|
||||
{
|
||||
m_directives.push_back( line );
|
||||
// Pad the directive to ensure we distinguish between short directives
|
||||
// and the start of a longer directive
|
||||
m_directives.emplace_back( line + " " );
|
||||
}
|
||||
|
||||
// Mark directive as started or continued in case it is a multi-line one
|
||||
|
||||
@@ -148,9 +148,6 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu )
|
||||
// If the clarify item selection context menu is aborted, don't show the context menu.
|
||||
if( item == NULL && actionCancelled )
|
||||
return false;
|
||||
|
||||
if( item )
|
||||
SetCrossHairPosition( item->GetPosition(), false );
|
||||
}
|
||||
|
||||
// If a command is in progress: add "cancel" and "end tool" menu
|
||||
@@ -676,10 +673,6 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
|
||||
{
|
||||
if( m_collectedItems.IsDraggableJunction() )
|
||||
AddMenuItem( aMenu, ID_SCH_DRAG_ITEM, _( "Drag Junction" ), KiBitmap( drag_xpm ) );
|
||||
|
||||
if( screen->GetWire( aJunction->GetPosition(), EXCLUDE_END_POINTS_T ) )
|
||||
AddMenuItem( aMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ),
|
||||
KiBitmap( break_line_xpm ) );
|
||||
}
|
||||
|
||||
if( screen->GetWireOrBus( aJunction->GetPosition() ) )
|
||||
@@ -694,7 +687,6 @@ void SCH_EDIT_FRAME::addJunctionMenuEntries( wxMenu* aMenu, SCH_JUNCTION* aJunct
|
||||
|
||||
void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
|
||||
{
|
||||
SCH_SCREEN* screen = frame->GetScreen();
|
||||
wxPoint pos = frame->GetCrossHairPosition();
|
||||
wxString msg;
|
||||
|
||||
@@ -721,12 +713,7 @@ void AddMenusForWire( wxMenu* PopMenu, SCH_LINE* Wire, SCH_EDIT_FRAME* frame )
|
||||
KiBitmap( delete_node_xpm ) );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE_CONNECTION, _( "Delete Connection" ),
|
||||
KiBitmap( delete_connection_xpm ) );
|
||||
|
||||
SCH_LINE* line = screen->GetWireOrBus( frame->GetCrossHairPosition() );
|
||||
|
||||
if( line && !line->IsEndPoint( frame->GetCrossHairPosition() ) )
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ),
|
||||
KiBitmap( break_line_xpm ) );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Wire" ), KiBitmap( break_line_xpm ) );
|
||||
|
||||
PopMenu->AppendSeparator();
|
||||
|
||||
@@ -763,7 +750,6 @@ void AddMenusForBus( wxMenu* PopMenu, SCH_LINE* Bus, SCH_EDIT_FRAME* frame )
|
||||
|
||||
msg = AddHotkeyName( _( "Delete Bus" ), g_Schematic_Hotkeys_Descr, HK_DELETE );
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_DELETE, msg, KiBitmap( delete_bus_xpm ) );
|
||||
|
||||
AddMenuItem( PopMenu, ID_POPUP_SCH_BREAK_WIRE, _( "Break Bus" ), KiBitmap( break_bus_xpm ) );
|
||||
|
||||
PopMenu->AppendSeparator();
|
||||
|
||||
@@ -672,10 +672,11 @@ class netlist():
|
||||
for t in re.split( '(\d+)', str ) ]
|
||||
|
||||
for g in groups:
|
||||
g = sorted(g, key=lambda g: sortKey(g.getRef()))
|
||||
#g = sorted(g, key=lambda g: sortKey(g.getRef()))
|
||||
g.sort(key=lambda g: sortKey(g.getRef()))
|
||||
|
||||
# Finally, sort the groups to order the references alphabetically
|
||||
groups = sorted(groups, key=lambda group: sortKey(group[0].getRef()))
|
||||
groups.sort(key=lambda group: sortKey(group[0].getRef()))
|
||||
|
||||
return groups
|
||||
|
||||
|
||||
@@ -259,6 +259,7 @@ void SCH_BASE_FRAME::UpdateStatusBar()
|
||||
locformatter = "dx %f dy %f dist %f";
|
||||
break;
|
||||
|
||||
case PERCENT:
|
||||
case DEGREES:
|
||||
wxASSERT( false );
|
||||
break;
|
||||
@@ -525,6 +526,7 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a
|
||||
case BLOCK_DELETE: // Delete
|
||||
case BLOCK_COPY: // Copy
|
||||
case BLOCK_FLIP: // Flip
|
||||
case BLOCK_ROTATE: // Rotate
|
||||
case BLOCK_ZOOM: // Window Zoom
|
||||
case BLOCK_MIRROR_X:
|
||||
case BLOCK_MIRROR_Y: // mirror
|
||||
@@ -574,7 +576,7 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxString::Format( "SCH_BASE_FRAME::HandleBlockBegin() unknown command: %s",
|
||||
wxFAIL_MSG( wxString::Format( "SCH_BASE_FRAME::HandleBlockBegin() unknown command: %d",
|
||||
block->GetCommand() ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -472,13 +472,12 @@ void SCH_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event )
|
||||
{
|
||||
auto cmd = (GetParent()->GetToolId() == ID_ZOOM_SELECTION) ? BLOCK_ZOOM : 0;
|
||||
|
||||
DBG(printf("start block\n");)
|
||||
// DBG(printf("start block\n"); fflush(0);)
|
||||
|
||||
if( !GetParent()->HandleBlockBegin( nullptr, cmd_type, m_CursorStartPos, cmd ) )
|
||||
{
|
||||
// should not occur: error
|
||||
GetParent()->DisplayToolMsg(
|
||||
wxT( "EDA_DRAW_PANEL::OnMouseEvent() Block Error" ) );
|
||||
GetParent()->DisplayToolMsg( "SCH_DRAW_PANEL: Block Error" );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -386,6 +386,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
||||
m_findReplaceStatus = new wxString( wxEmptyString );
|
||||
m_undoItem = NULL;
|
||||
m_hasAutoSave = true;
|
||||
m_showIllegalSymbolLibDialog = true;
|
||||
m_FrameSize = ConvertDialogToPixels( wxSize( 500, 350 ) ); // default in case of no prefs
|
||||
m_AboutTitle = "Eeschema";
|
||||
|
||||
|
||||
+80
-37
@@ -126,7 +126,7 @@ private:
|
||||
wxPageSetupDialogData m_pageSetupData;
|
||||
wxFindReplaceData* m_findReplaceData;
|
||||
wxString* m_findReplaceStatus;
|
||||
bool m_printMonochrome; ///< Print monochrome instead of grey scale.
|
||||
bool m_printMonochrome; ///< Print monochrome instead of grey scale.
|
||||
bool m_printSheetReference;
|
||||
DIALOG_SCH_FIND* m_dlgFindReplace;
|
||||
wxArrayString m_findStringHistoryList;
|
||||
@@ -150,6 +150,7 @@ private:
|
||||
bool m_autoplaceJustify; ///< allow autoplace to change justification
|
||||
bool m_autoplaceAlign; ///< align autoplaced fields to the grid
|
||||
bool m_footprintPreview; ///< whether to show footprint previews
|
||||
bool m_showIllegalSymbolLibDialog;
|
||||
|
||||
/// An index to the last find item in the found items list #m_foundItems.
|
||||
int m_foundItemIndex;
|
||||
@@ -703,33 +704,9 @@ public:
|
||||
bool OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl = 0 ) override;
|
||||
|
||||
/**
|
||||
* Import a KiCad schematic into the current page.
|
||||
* Import a KiCad schematic into the current sheet.
|
||||
*
|
||||
* In order to import a schematic a lot of things have to happen to before the contents
|
||||
* of the imported schematic can be appended to the current page. The following list
|
||||
* describes this process:
|
||||
*
|
||||
* - Load the schematic into a temporary SCH_SHEET object.
|
||||
* - Make sure the imported schematic does not cause any hierarchy recursion issues.
|
||||
* - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table).
|
||||
* - Check to see if any symbol libraries need to be added to the current project's symbol
|
||||
* library table. This includes:
|
||||
* - Check if the symbol library already exists in the project or global symbol library
|
||||
* table.
|
||||
* - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute
|
||||
* paths. ${KIPRJMOD} will not be the same for this project.
|
||||
* - Check for duplicate symbol library nicknames and change the new symbol library nickname
|
||||
* to prevent library name clashes.
|
||||
* - Update all schematic symbol LIB_ID object library nicknames when the library nickname
|
||||
* was changed to prevent clashes.
|
||||
* - Check for duplicate sheet names which is illegal and automatically rename any duplicate
|
||||
* sheets in the imported schematic.
|
||||
* - Clear all of the annotation in the imported schematic to prevent clashes.
|
||||
* - Append the objects from the temporary sheet to the current page.
|
||||
* - Replace any duplicate time stamps.
|
||||
* - Refresh the symbol library links.
|
||||
*
|
||||
* @return True if the project was imported properly.
|
||||
* @return True if the schematic was imported properly.
|
||||
*/
|
||||
bool AppendSchematic();
|
||||
|
||||
@@ -980,6 +957,35 @@ private:
|
||||
void EditSchematicText( SCH_TEXT* TextStruct );
|
||||
void ChangeTextOrient( SCH_TEXT* aTextItem );
|
||||
|
||||
/**
|
||||
* Verify that \a aSheet will not cause a recursion error in \a aHierarchy.
|
||||
*
|
||||
* @param aSheet is the #SCH_SHEET object to test.
|
||||
* @param aHierarchy is the #SCH_SHEET_PATH where \a aSheet is going to reside.
|
||||
*
|
||||
* @return true if \a aSheet will cause a resursion error in \a aHierarchy.
|
||||
*/
|
||||
bool checkSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
||||
|
||||
/**
|
||||
* Verify that the symbol library links \a aSheet and all of it's child sheets have
|
||||
* been remapped to the symbol library table.
|
||||
*
|
||||
* @param aSheet is the #SCH_SHEET object to test.
|
||||
*
|
||||
* @return true if \a aSheet and it's child sheets have not been remapped.
|
||||
*/
|
||||
bool checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet );
|
||||
|
||||
/**
|
||||
* Load the given filename but sets the path to the current project path.
|
||||
*
|
||||
* @param full filepath of file to be imported.
|
||||
* @param aFileType SCH_FILE_T value for file type
|
||||
*/
|
||||
bool importFile( const wxString& aFileName, int aFileType );
|
||||
|
||||
public:
|
||||
/**
|
||||
* Command event handler to change a text type to another one.
|
||||
*
|
||||
@@ -1102,15 +1108,54 @@ public:
|
||||
wxPoint GetLastSheetPinPosition() const { return m_lastSheetPinPosition; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* Load the given filename but sets the path to the current project path.
|
||||
*
|
||||
* @param full filepath of file to be imported.
|
||||
* @param aFileType SCH_FILE_T value for file type
|
||||
*/
|
||||
bool importFile( const wxString& aFileName, int aFileType );
|
||||
void InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename );
|
||||
|
||||
bool validateSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy );
|
||||
/**
|
||||
* Load a the KiCad schematic file \a aFileName into the sheet \a aSheet.
|
||||
*
|
||||
* If \a aSheet does not have a valid #SCH_SCREEN object, the schematic is loaded into
|
||||
* \a Sheet. Otherwise, it is appended to the current #SCH_SCREEN object.
|
||||
*
|
||||
* In order to import a schematic a lot of things have to happen to before the contents
|
||||
* of the imported schematic can be appended to the current page. The following list
|
||||
* describes this process:
|
||||
*
|
||||
* - Load the schematic into a temporary #SCH_SHEET object.
|
||||
* - Make sure the imported schematic does not cause any hierarchy recursion issues.
|
||||
* - Verify the imported schematic uses fully qualified #LIB_ID objects (symbol library table).
|
||||
* - Check all of the possible combinations that could cause broken symbol library links
|
||||
* and give the user the option to cancel the append process. The following conditions
|
||||
* are check but they still do not guarantee that there will not be any broken symbol
|
||||
* library links:
|
||||
* - The source schematic is in the current project path and contains symbol library
|
||||
* nicknames not found in the project symbol library table. This can happen if the
|
||||
* schematic is copied to the current project path from another project.
|
||||
* - The source schematic is in a different path and there are symbol library link nicknames
|
||||
* that do not exist in either the current symbol library table or the source project
|
||||
* symbol library table if it exists in the source path.
|
||||
* - The source schematic is in a different path and contains duplicate symbol library
|
||||
* nicknames that point to different libraries.
|
||||
* - Check to see if any symbol libraries need to be added to the current project's symbol
|
||||
* library table. This includes:
|
||||
* - Check if the symbol library already exists in the project or global symbol library
|
||||
* table.
|
||||
* - Convert symbol library URLS that use the ${KIPRJMOD} environment variable to absolute
|
||||
* paths. ${KIPRJMOD} will not be the same for this project.
|
||||
* - Clear all of the annotation in the imported schematic to prevent clashes.
|
||||
* - Append the objects from the temporary sheet to the current page.
|
||||
* - Replace any duplicate time stamps.
|
||||
* - Refresh the symbol library links.
|
||||
*
|
||||
* @param aSheet is the sheet to either append or load the schematic.
|
||||
* @param aHierarchy is the current position in the schematic hierarchy used to test for
|
||||
* possible file recursion issues.
|
||||
* @param aFileName is the file name to load. The file name is expected to have an absolute
|
||||
* path.
|
||||
*
|
||||
* @return True if the schematic was imported properly.
|
||||
*/
|
||||
bool LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
const wxString& aFileName );
|
||||
|
||||
/**
|
||||
* Create a new SCH_SHEET_PIN object and add it to \a aSheet at the current cursor position.
|
||||
@@ -1210,7 +1255,6 @@ public:
|
||||
*/
|
||||
void OrientComponent( COMPONENT_ORIENTATION_T aOrientation = CMP_NORMAL );
|
||||
|
||||
private:
|
||||
void OnSelectUnit( wxCommandEvent& aEvent );
|
||||
void ConvertPart( SCH_COMPONENT* DrawComponent );
|
||||
|
||||
@@ -1229,7 +1273,6 @@ private:
|
||||
void PasteListOfItems( wxDC* DC );
|
||||
|
||||
/* Undo - redo */
|
||||
public:
|
||||
|
||||
/**
|
||||
* Create a copy of the current schematic item, and put it in the undo list.
|
||||
|
||||
@@ -1754,10 +1754,6 @@ void SCH_LEGACY_PLUGIN::Format( SCH_SCREEN* aScreen )
|
||||
// Write the header
|
||||
m_out->Print( 0, "%s %s %d\n", "EESchema", SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION );
|
||||
|
||||
// Write the project libraries.
|
||||
for( const PART_LIB& lib : *m_kiway->Prj().SchLibs() )
|
||||
m_out->Print( 0, "LIBS:%s\n", TO_UTF8( lib.GetName() ) );
|
||||
|
||||
// This section is not used, but written for file compatibility
|
||||
m_out->Print( 0, "EELAYER %d %d\n", SCH_LAYER_ID_COUNT, 0 );
|
||||
m_out->Print( 0, "EELAYER END\n" );
|
||||
|
||||
+19
-1
@@ -30,6 +30,7 @@
|
||||
#include <fctsys.h>
|
||||
#include <gr_basic.h>
|
||||
#include <macros.h>
|
||||
#include <trigo.h>
|
||||
#include <sch_draw_panel.h>
|
||||
#include <plotter.h>
|
||||
#include <base_units.h>
|
||||
@@ -299,7 +300,7 @@ int SCH_LINE::GetPenSize() const
|
||||
{
|
||||
if( m_size > 0 )
|
||||
return m_size;
|
||||
|
||||
|
||||
return GetDefaultWidth();
|
||||
}
|
||||
|
||||
@@ -487,6 +488,19 @@ EDA_ITEM* SCH_LINE::MergeOverlap( SCH_LINE* aLine )
|
||||
}
|
||||
|
||||
|
||||
wxPoint SCH_LINE::GetClosestPoint( const wxPoint& aPoint )
|
||||
{
|
||||
// Compute the euclidean distance between the reference and the ends
|
||||
double startDis = GetLineLength( aPoint, m_start );
|
||||
double endDis = GetLineLength( aPoint, m_end );
|
||||
|
||||
if( startDis < endDis )
|
||||
return m_start;
|
||||
else
|
||||
return m_end;
|
||||
}
|
||||
|
||||
|
||||
void SCH_LINE::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
|
||||
{
|
||||
if( GetLayer() == LAYER_NOTES )
|
||||
@@ -705,6 +719,10 @@ bool SCH_LINE::operator <( const SCH_ITEM& aItem ) const
|
||||
|
||||
bool SCH_LINE::HitTest( const wxPoint& aPosition, int aAccuracy ) const
|
||||
{
|
||||
// Performance enhancement for connection-building
|
||||
if( aPosition == m_start || aPosition == m_end )
|
||||
return true;
|
||||
|
||||
return TestSegmentHit( aPosition, m_start, m_end, aAccuracy );
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,15 @@ public:
|
||||
|
||||
void SetEndPoint( const wxPoint& aPosition ) { m_end = aPosition; }
|
||||
|
||||
/**
|
||||
* Find the end point of the line (either start or end) that is closest
|
||||
* to the provided point.
|
||||
*
|
||||
* @param aPoint the point to compare against
|
||||
* @return The coordinates of the closest end point
|
||||
*/
|
||||
wxPoint GetClosestPoint( const wxPoint& aPoint );
|
||||
|
||||
int GetDefaultStyle() const;
|
||||
|
||||
void SetLineStyle( const int aStyle );
|
||||
|
||||
+102
-68
@@ -558,7 +558,6 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer, bool aIsDangling, bool isMovi
|
||||
VECTOR2I p0, dir;
|
||||
int len = aPin->GetLength();
|
||||
int width = aPin->GetPenSize();
|
||||
int shape = aPin->GetShape();
|
||||
int orient = aPin->GetOrientation();
|
||||
|
||||
switch( orient )
|
||||
@@ -594,76 +593,10 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer, bool aIsDangling, bool isMovi
|
||||
const int diam = radius*2;
|
||||
const int clock_size = InternalPinDecoSize( *aPin );
|
||||
|
||||
if( shape == PINSHAPE_INVERTED )
|
||||
{
|
||||
m_gal->DrawCircle( p0 + dir * radius, radius );
|
||||
m_gal->DrawLine( p0 + dir * ( diam ), pos );
|
||||
}
|
||||
else if( shape == PINSHAPE_FALLING_EDGE_CLOCK )
|
||||
{
|
||||
pc = p0 + dir * clock_size ;
|
||||
|
||||
triLine( p0 + VECTOR2D( dir.y, -dir.x) * clock_size,
|
||||
pc,
|
||||
p0 + VECTOR2D( -dir.y, dir.x) * clock_size );
|
||||
|
||||
m_gal->DrawLine( pos, pc );
|
||||
}
|
||||
else
|
||||
if( aPin->GetType() == PIN_NC ) // Draw a N.C. symbol
|
||||
{
|
||||
m_gal->DrawLine( p0, pos );
|
||||
}
|
||||
|
||||
if( shape == PINSHAPE_CLOCK )
|
||||
{
|
||||
if (!dir.y)
|
||||
{
|
||||
triLine( p0 + VECTOR2D( 0, clock_size ),
|
||||
p0 + VECTOR2D( -dir.x * clock_size, 0 ),
|
||||
p0 + VECTOR2D( 0, -clock_size ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
triLine( p0 + VECTOR2D( clock_size, 0 ),
|
||||
p0 + VECTOR2D( 0, -dir.y * clock_size ),
|
||||
p0 + VECTOR2D( -clock_size, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( shape == PINSHAPE_INPUT_LOW )
|
||||
{
|
||||
if(!dir.y)
|
||||
{
|
||||
triLine( p0 + VECTOR2D(dir.x, 0) * diam,
|
||||
p0 + VECTOR2D(dir.x, -1) * diam,
|
||||
p0 );
|
||||
}
|
||||
else /* MapX1 = 0 */
|
||||
{
|
||||
triLine( p0 + VECTOR2D( 0, dir.y) * diam,
|
||||
p0 + VECTOR2D(-1, dir.y) * diam,
|
||||
p0 );
|
||||
}
|
||||
}
|
||||
|
||||
if( shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */
|
||||
{
|
||||
if( !dir.y ) // Horizontal pin
|
||||
m_gal->DrawLine( p0 - VECTOR2D( 0, diam ), p0 + VECTOR2D( dir.x, 0 ) * diam );
|
||||
else // Vertical pin
|
||||
m_gal->DrawLine( p0 - VECTOR2D( diam, 0 ), p0 + VECTOR2D( 0, dir.y ) * diam );
|
||||
}
|
||||
|
||||
if( shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */
|
||||
{
|
||||
m_gal->DrawLine( p0 - VECTOR2D( dir.x + dir.y, dir.y - dir.x ) * radius,
|
||||
p0 + VECTOR2D( dir.x + dir.y, dir.y - dir.x ) * radius );
|
||||
m_gal->DrawLine( p0 - VECTOR2D( dir.x - dir.y, dir.x + dir.y ) * radius,
|
||||
p0 + VECTOR2D( dir.x - dir.y, dir.x + dir.y ) * radius );
|
||||
}
|
||||
|
||||
if( aPin->GetType() == PIN_NC ) // Draw a N.C. symbol
|
||||
{
|
||||
m_gal->DrawLine( pos + VECTOR2D( -1, -1 ) * TARGET_PIN_RADIUS,
|
||||
pos + VECTOR2D( 1, 1 ) * TARGET_PIN_RADIUS );
|
||||
m_gal->DrawLine( pos + VECTOR2D( 1, -1 ) * TARGET_PIN_RADIUS ,
|
||||
@@ -671,6 +604,107 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer, bool aIsDangling, bool isMovi
|
||||
|
||||
aIsDangling = false; // PIN_NC pin type is always not connected and dangling.
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( aPin->GetShape() )
|
||||
{
|
||||
case PINSHAPE_LINE:
|
||||
m_gal->DrawLine( p0, pos );
|
||||
break;
|
||||
|
||||
case PINSHAPE_INVERTED:
|
||||
m_gal->DrawCircle( p0 + dir * radius, radius );
|
||||
m_gal->DrawLine( p0 + dir * ( diam ), pos );
|
||||
break;
|
||||
|
||||
case PINSHAPE_INVERTED_CLOCK:
|
||||
pc = p0 - dir * clock_size ;
|
||||
|
||||
triLine( p0 + VECTOR2D( dir.y, -dir.x) * clock_size,
|
||||
pc,
|
||||
p0 + VECTOR2D( -dir.y, dir.x) * clock_size );
|
||||
|
||||
m_gal->DrawCircle( p0 + dir * radius, radius );
|
||||
m_gal->DrawLine( p0 + dir * ( diam ), pos );
|
||||
break;
|
||||
|
||||
case PINSHAPE_CLOCK_LOW:
|
||||
case PINSHAPE_FALLING_EDGE_CLOCK:
|
||||
pc = p0 - dir * clock_size ;
|
||||
|
||||
triLine( p0 + VECTOR2D( dir.y, -dir.x) * clock_size,
|
||||
pc,
|
||||
p0 + VECTOR2D( -dir.y, dir.x) * clock_size );
|
||||
|
||||
if(!dir.y)
|
||||
{
|
||||
triLine( p0 + VECTOR2D(dir.x, 0) * diam,
|
||||
p0 + VECTOR2D(dir.x, -1) * diam,
|
||||
p0 );
|
||||
}
|
||||
else /* MapX1 = 0 */
|
||||
{
|
||||
triLine( p0 + VECTOR2D( 0, dir.y) * diam,
|
||||
p0 + VECTOR2D(-1, dir.y) * diam,
|
||||
p0 );
|
||||
}
|
||||
|
||||
m_gal->DrawLine( p0, pos );
|
||||
break;
|
||||
|
||||
case PINSHAPE_CLOCK:
|
||||
m_gal->DrawLine( p0, pos );
|
||||
|
||||
if (!dir.y)
|
||||
{
|
||||
triLine( p0 + VECTOR2D( 0, clock_size ),
|
||||
p0 + VECTOR2D( -dir.x * clock_size, 0 ),
|
||||
p0 + VECTOR2D( 0, -clock_size ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
triLine( p0 + VECTOR2D( clock_size, 0 ),
|
||||
p0 + VECTOR2D( 0, -dir.y * clock_size ),
|
||||
p0 + VECTOR2D( -clock_size, 0 ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case PINSHAPE_INPUT_LOW:
|
||||
m_gal->DrawLine( p0, pos );
|
||||
|
||||
if(!dir.y)
|
||||
{
|
||||
triLine( p0 + VECTOR2D(dir.x, 0) * diam,
|
||||
p0 + VECTOR2D(dir.x, -1) * diam,
|
||||
p0 );
|
||||
}
|
||||
else /* MapX1 = 0 */
|
||||
{
|
||||
triLine( p0 + VECTOR2D( 0, dir.y) * diam,
|
||||
p0 + VECTOR2D(-1, dir.y) * diam,
|
||||
p0 );
|
||||
}
|
||||
break;
|
||||
|
||||
case PINSHAPE_OUTPUT_LOW: // IEEE symbol "Active Low Output"
|
||||
m_gal->DrawLine( p0, pos );
|
||||
|
||||
if( !dir.y ) // Horizontal pin
|
||||
m_gal->DrawLine( p0 - VECTOR2D( 0, diam ), p0 + VECTOR2D( dir.x, 0 ) * diam );
|
||||
else // Vertical pin
|
||||
m_gal->DrawLine( p0 - VECTOR2D( diam, 0 ), p0 + VECTOR2D( 0, dir.y ) * diam );
|
||||
break;
|
||||
|
||||
case PINSHAPE_NONLOGIC: // NonLogic pin symbol
|
||||
m_gal->DrawLine( p0, pos );
|
||||
|
||||
m_gal->DrawLine( p0 - VECTOR2D( dir.x + dir.y, dir.y - dir.x ) * radius,
|
||||
p0 + VECTOR2D( dir.x + dir.y, dir.y - dir.x ) * radius );
|
||||
m_gal->DrawLine( p0 - VECTOR2D( dir.x - dir.y, dir.x + dir.y ) * radius,
|
||||
p0 + VECTOR2D( dir.x - dir.y, dir.x + dir.y ) * radius );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( aIsDangling && ( aPin->IsVisible() || aPin->IsPowerConnection() ) )
|
||||
drawPinDanglingSymbol( m_gal, pos, color );
|
||||
|
||||
@@ -1607,6 +1607,18 @@ int SCH_SCREENS::ChangeSymbolLibNickname( const wxString& aFrom, const wxString&
|
||||
}
|
||||
|
||||
|
||||
bool SCH_SCREENS::HasSchematic( const wxString& aSchematicFileName )
|
||||
{
|
||||
for( const SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
|
||||
{
|
||||
if( screen->GetFileName() == aSchematicFileName )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SCH_SCREENS::BuildClientSheetPathList()
|
||||
{
|
||||
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||
|
||||
@@ -622,6 +622,17 @@ public:
|
||||
*/
|
||||
int ChangeSymbolLibNickname( const wxString& aFrom, const wxString& aTo );
|
||||
|
||||
/**
|
||||
* Check if one of the schematics in the list of screens is \a aSchematicFileName.
|
||||
*
|
||||
* Schematic file names in SCH_SCREEN object are stored with the absolute path to
|
||||
* the schematic file.
|
||||
*
|
||||
* @param aSchematicFileName is the schematic file name to search.
|
||||
* @return true if the a schematic matching the file name has been found.
|
||||
*/
|
||||
bool HasSchematic( const wxString& aSchematicFileName );
|
||||
|
||||
/**
|
||||
* built the list of sheet paths sharing a screen for each screen in use
|
||||
*/
|
||||
|
||||
+12
-1
@@ -45,6 +45,8 @@
|
||||
#include <netlist_object.h>
|
||||
#include <trace_helpers.h>
|
||||
|
||||
#include <wx/debug.h>
|
||||
|
||||
|
||||
extern void IncrementLabelMember( wxString& name, int aIncrement );
|
||||
|
||||
@@ -251,7 +253,10 @@ void SCH_TEXT::SetLabelSpinStyle( int aSpinStyle )
|
||||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
case 0: // Horiz Normal Orientation (left justified)
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
@@ -773,7 +778,10 @@ void SCH_GLOBALLABEL::SetLabelSpinStyle( int aSpinStyle )
|
||||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
@@ -1037,7 +1045,10 @@ void SCH_HIERLABEL::SetLabelSpinStyle( int aSpinStyle )
|
||||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
|
||||
@@ -203,7 +203,10 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||
case ID_POPUP_SCH_BREAK_WIRE:
|
||||
SaveWireImage();
|
||||
m_canvas->MoveCursorToCrossHair();
|
||||
BreakSegments( GetCrossHairPosition() );
|
||||
|
||||
if( BreakSegments( GetCrossHairPosition() ) &&
|
||||
screen->IsJunctionNeeded( GetCrossHairPosition(), true ) )
|
||||
AddJunction( GetCrossHairPosition(), true );
|
||||
|
||||
TestDanglingEnds();
|
||||
m_canvas->Refresh();
|
||||
|
||||
+525
-67
@@ -38,8 +38,484 @@
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_sheet_path.h>
|
||||
#include <sch_view.h>
|
||||
|
||||
#include <symbol_lib_table.h>
|
||||
#include <dialogs/dialog_sch_sheet_props.h>
|
||||
#include <dialogs/dialog_sch_edit_sheet_pin.h>
|
||||
#include <tool/actions.h>
|
||||
|
||||
|
||||
bool SCH_EDIT_FRAME::checkSheetForRecursion( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy )
|
||||
{
|
||||
wxASSERT( aSheet && aHierarchy );
|
||||
|
||||
wxString msg;
|
||||
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the full schematic sheet hierarchy.
|
||||
SCH_SHEET_LIST sheetHierarchy( aSheet ); // This is the hierarchy of the loaded file.
|
||||
|
||||
wxFileName destFile = aHierarchy->LastScreen()->GetFileName();
|
||||
|
||||
// SCH_SCREEN object file paths are expected to be absolute. If this assert fires,
|
||||
// something is seriously broken.
|
||||
wxASSERT( destFile.IsAbsolute() );
|
||||
|
||||
if( hierarchy.TestForRecursion( sheetHierarchy, destFile.GetFullPath() ) )
|
||||
{
|
||||
msg.Printf( _( "The sheet changes cannot be made because the destination sheet already "
|
||||
"has the sheet \"%s\" or one of it's subsheets as a parent somewhere in "
|
||||
"the schematic hierarchy." ),
|
||||
destFile.GetFullPath() );
|
||||
DisplayError( this, msg );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool SCH_EDIT_FRAME::checkForNoFullyDefinedLibIds( SCH_SHEET* aSheet )
|
||||
{
|
||||
wxASSERT( aSheet && aSheet->GetScreen() );
|
||||
|
||||
wxString msg;
|
||||
SCH_SCREENS newScreens( aSheet );
|
||||
|
||||
if( newScreens.HasNoFullyDefinedLibIds() )
|
||||
{
|
||||
msg.Printf( _( "The schematic \"%s\" has not had it's symbol library links remapped "
|
||||
"to the symbol library table. The project this schematic belongs to "
|
||||
"must first be remapped before it can be imported into the current "
|
||||
"project." ), aSheet->GetScreen()->GetFileName() );
|
||||
DisplayInfoMessage( this, msg );
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SCH_EDIT_FRAME::InitSheet( SCH_SHEET* aSheet, const wxString& aNewFilename )
|
||||
{
|
||||
aSheet->SetScreen( new SCH_SCREEN( &Kiway() ) );
|
||||
aSheet->GetScreen()->SetModify();
|
||||
aSheet->GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
|
||||
aSheet->GetScreen()->SetFileName( aNewFilename );
|
||||
}
|
||||
|
||||
|
||||
bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
const wxString& aFileName )
|
||||
{
|
||||
wxASSERT( aSheet && aHierarchy );
|
||||
|
||||
int i;
|
||||
wxString msg;
|
||||
wxString topLevelSheetPath;
|
||||
wxFileName tmp;
|
||||
wxFileName currentSheetFileName;
|
||||
bool libTableChanged = false;
|
||||
SCH_SCREEN* currentScreen = aHierarchy->LastScreen();
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
|
||||
std::unique_ptr< SCH_SHEET> newSheet( new SCH_SHEET );
|
||||
|
||||
wxFileName fileName( aFileName );
|
||||
|
||||
if( !fileName.IsAbsolute() )
|
||||
{
|
||||
wxCHECK_MSG( fileName.MakeAbsolute(), false,
|
||||
wxString::Format( "Cannot make file name \"%s\" path absolute.",
|
||||
aFileName ) );
|
||||
}
|
||||
|
||||
wxString fullFilename = fileName.GetFullPath();
|
||||
|
||||
try
|
||||
{
|
||||
if( aSheet->GetScreen() != nullptr )
|
||||
{
|
||||
newSheet.reset( pi->Load( fullFilename, &Kiway() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
newSheet->SetFileName( fullFilename );
|
||||
pi->Load( fullFilename, &Kiway(), newSheet.get() );
|
||||
}
|
||||
|
||||
if( !pi->GetError().IsEmpty() )
|
||||
{
|
||||
msg = _( "The entire schematic could not be loaded. Errors occurred attempting "
|
||||
"to load hierarchical sheet schematics." );
|
||||
|
||||
wxMessageDialog msgDlg1( this, msg, _( "Schematic Load Error" ),
|
||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
|
||||
wxCENTER | wxICON_QUESTION );
|
||||
msgDlg1.SetOKLabel( wxMessageDialog::ButtonLabel( _( "Use partial schematic" ) ) );
|
||||
msgDlg1.SetExtendedMessage( pi->GetError() );
|
||||
|
||||
if( msgDlg1.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "Error occurred loading schematic file \"%s\"." ), fullFilename );
|
||||
DisplayErrorMessage( this, msg, ioe.What() );
|
||||
|
||||
msg.Printf( _( "Failed to load schematic \"%s\"" ), fullFilename );
|
||||
AppendMsgPanel( wxEmptyString, msg, CYAN );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
tmp = fileName;
|
||||
|
||||
// If the loaded schematic is in a different folder from the current project and
|
||||
// it contains hierarchical sheets, the hierarchical sheet paths need to be updated.
|
||||
if( fileName.GetPath( wxPATH_GET_SEPARATOR ) != Prj().GetProjectPath()
|
||||
&& newSheet->CountSheets() )
|
||||
{
|
||||
// Give the user the option to choose relative path if possible.
|
||||
if( tmp.MakeRelativeTo( Prj().GetProjectPath() ) )
|
||||
{
|
||||
wxMessageDialog msgDlg2(
|
||||
this,
|
||||
"Do you want to use a relative path to the loaded "
|
||||
"schematic?", "Select Path Type",
|
||||
wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_QUESTION | wxCENTER );
|
||||
msgDlg2.SetYesNoLabels( wxMessageDialog::ButtonLabel( "Use Relative Path" ),
|
||||
wxMessageDialog::ButtonLabel( "Use Absolute Path" ) );
|
||||
int rsp = msgDlg2.ShowModal();
|
||||
|
||||
if( rsp == wxID_CANCEL )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if( rsp == wxID_NO )
|
||||
{
|
||||
topLevelSheetPath = fileName.GetPathWithSep();
|
||||
}
|
||||
else
|
||||
{
|
||||
topLevelSheetPath = tmp.GetPathWithSep();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
topLevelSheetPath = tmp.GetPathWithSep();
|
||||
}
|
||||
|
||||
if( wxFileName::GetPathSeparator() == '\\' )
|
||||
topLevelSheetPath.Replace( "\\", "/" );
|
||||
}
|
||||
|
||||
// Make sure any new sheet changes do not cause any recursion issues.
|
||||
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the schematic sheet hierarchy.
|
||||
SCH_SHEET_LIST sheetHierarchy( newSheet.get() ); // This is the hierarchy of the loaded file.
|
||||
|
||||
if( checkSheetForRecursion( newSheet.get(), aHierarchy )
|
||||
|| checkForNoFullyDefinedLibIds( newSheet.get() ) )
|
||||
return false;
|
||||
|
||||
// Make a valiant attempt to warn the user of all possible scenarios where there could
|
||||
// be broken symbol library links.
|
||||
wxArrayString names;
|
||||
wxArrayString newLibNames;
|
||||
SCH_SCREENS newScreens( newSheet.get() ); // All screens associated with the import.
|
||||
SCH_SCREENS prjScreens( g_RootSheet );
|
||||
|
||||
newScreens.GetLibNicknames( names );
|
||||
|
||||
wxMessageDialog::ButtonLabel okButtonLabel( _( "Continue Load" ) );
|
||||
wxMessageDialog::ButtonLabel cancelButtonLabel( _( "Cancel Load" ) );
|
||||
|
||||
if( fileName.GetPath( wxPATH_GET_SEPARATOR ) == Prj().GetProjectPath()
|
||||
&& !prjScreens.HasSchematic( fullFilename ) )
|
||||
{
|
||||
// A schematic in the current project path that isn't part of the current project.
|
||||
// It's possible the user copied this schematic from another project so the library
|
||||
// links may not be avaible. Even this is check is no guarantee that all symbol
|
||||
// library links are valid but it's better than nothing.
|
||||
for( const auto& name : names )
|
||||
{
|
||||
if( !Prj().SchSymbolLibTable()->HasLibrary( name ) )
|
||||
newLibNames.Add( name );
|
||||
}
|
||||
|
||||
if( !newLibNames.IsEmpty() )
|
||||
{
|
||||
msg = _( "There are library names in the loaded schematic that are missing "
|
||||
"from the project library table. This may result in broken symbol "
|
||||
"library links for the loaded schematic. Do you wish to continue?" );
|
||||
wxMessageDialog msgDlg3( this, msg, _( "Continue Load Schematic" ),
|
||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
|
||||
wxCENTER | wxICON_QUESTION );
|
||||
msgDlg3.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
|
||||
|
||||
if( msgDlg3.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if( fileName.GetPath( wxPATH_GET_SEPARATOR ) != Prj().GetProjectPath() )
|
||||
{
|
||||
// A schematic loaded from a path other than the current project path.
|
||||
|
||||
// If there are symbol libraries in the imported schematic that are not in the
|
||||
// symbol library table of this project, there could be a lot of broken symbol
|
||||
// library links. Attempt to add the missing libraries to the project symbol
|
||||
// library table.
|
||||
wxArrayString duplicateLibNames;
|
||||
|
||||
for( const auto& name : names )
|
||||
{
|
||||
if( !Prj().SchSymbolLibTable()->HasLibrary( name ) )
|
||||
newLibNames.Add( name );
|
||||
else
|
||||
duplicateLibNames.Add( name );
|
||||
}
|
||||
|
||||
SYMBOL_LIB_TABLE table;
|
||||
wxFileName symLibTableFn( fileName.GetPath(),
|
||||
SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
|
||||
|
||||
// If there are any new or duplicate libraries, check to see if it's possible that
|
||||
// there could be any missing libraries that would cause broken symbol library links.
|
||||
if( !newLibNames.IsEmpty() || !duplicateLibNames.IsEmpty() )
|
||||
{
|
||||
if( !symLibTableFn.Exists() || !symLibTableFn.IsFileReadable() )
|
||||
{
|
||||
msg.Printf( _( "The project library table \"%s\" does not exist or cannot "
|
||||
"be read. This may result in broken symbol links for the "
|
||||
"schematic. Do you wish to continue?" ),
|
||||
fileName.GetFullPath() );
|
||||
wxMessageDialog msgDlg4( this, msg, _( "Continue Load Schematic" ),
|
||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
|
||||
wxCENTER | wxICON_QUESTION );
|
||||
msgDlg4.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
|
||||
|
||||
if( msgDlg4.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
table.Load( symLibTableFn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
msg.Printf( _( "An error occurred loading the symbol library table "
|
||||
"\"%s\"." ),
|
||||
symLibTableFn.GetFullPath() );
|
||||
DisplayErrorMessage( NULL, msg, ioe.What() );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if any of the symbol libraries found in the appended schematic do
|
||||
// not exist in the current project are missing from the appended project symbol
|
||||
// library table.
|
||||
if( !newLibNames.IsEmpty() )
|
||||
{
|
||||
bool missingLibNames = table.IsEmpty();
|
||||
|
||||
if( !missingLibNames )
|
||||
{
|
||||
for( const auto& newLibName : newLibNames )
|
||||
{
|
||||
if( !table.HasLibrary( newLibName ) )
|
||||
{
|
||||
missingLibNames = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( missingLibNames )
|
||||
{
|
||||
msg = _( "There are library names in the loaded schematic that are missing "
|
||||
"from the loaded schematic project library table. This may result "
|
||||
"in broken symbol library links for the schematic. "
|
||||
"Do you wish to continue?" );
|
||||
wxMessageDialog msgDlg5( this, msg, _( "Continue Load Schematic" ),
|
||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
|
||||
wxCENTER | wxICON_QUESTION );
|
||||
msgDlg5.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
|
||||
|
||||
if( msgDlg5.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// The library name already exists in the current project. Check to see if the
|
||||
// duplicate name is the same library in the current project. If it's not, it's
|
||||
// most likely that the symbol library links will be broken.
|
||||
if( !duplicateLibNames.IsEmpty() && !table.IsEmpty() )
|
||||
{
|
||||
bool libNameConflict = false;
|
||||
|
||||
for( const auto& duplicateLibName : duplicateLibNames )
|
||||
{
|
||||
const SYMBOL_LIB_TABLE_ROW* thisRow = nullptr;
|
||||
const SYMBOL_LIB_TABLE_ROW* otherRow = nullptr;
|
||||
|
||||
if( Prj().SchSymbolLibTable()->HasLibrary( duplicateLibName ) )
|
||||
thisRow = Prj().SchSymbolLibTable()->FindRow( duplicateLibName );
|
||||
|
||||
if( table.HasLibrary( duplicateLibName ) )
|
||||
otherRow = table.FindRow( duplicateLibName );
|
||||
|
||||
// It's in the global library table so there is no conflict.
|
||||
if( thisRow && !otherRow )
|
||||
continue;
|
||||
|
||||
if( !thisRow || !otherRow )
|
||||
continue;
|
||||
|
||||
wxFileName otherUriFileName;
|
||||
wxString thisURI = thisRow->GetFullURI( true );
|
||||
wxString otherURI = otherRow->GetFullURI( false);
|
||||
|
||||
if( otherURI.Contains( "${KIPRJMOD}" ) || otherURI.Contains( "$(KIPRJMOD)" ) )
|
||||
{
|
||||
// Cannot use relative paths here, "${KIPRJMOD}../path-to-cache-lib" does
|
||||
// not expand to a valid symbol library path.
|
||||
otherUriFileName.SetPath( fileName.GetPath() );
|
||||
otherUriFileName.SetFullName( otherURI.AfterLast( '}' ) );
|
||||
otherURI = otherUriFileName.GetFullPath();
|
||||
}
|
||||
|
||||
if( thisURI != otherURI )
|
||||
{
|
||||
libNameConflict = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( libNameConflict )
|
||||
{
|
||||
msg = _( "A duplicate library name that references a different library exists "
|
||||
"in the current library table. This conflict cannot be resolved and "
|
||||
"may result in broken symbol library links for the schematic. "
|
||||
"Do you wish to continue?" );
|
||||
wxMessageDialog msgDlg6( this, msg, _( "Continue Load Schematic" ),
|
||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
|
||||
wxCENTER | wxICON_QUESTION );
|
||||
msgDlg6.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
|
||||
|
||||
if( msgDlg6.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// All (most?) of the possible broken symbol library link cases are covered. Map the
|
||||
// new appended schematic project symbol library table entries to the current project
|
||||
// symbol library table.
|
||||
if( !newLibNames.IsEmpty() && !table.IsEmpty() )
|
||||
{
|
||||
for( const auto& libName : newLibNames )
|
||||
{
|
||||
if( !table.HasLibrary( libName )
|
||||
|| Prj().SchSymbolLibTable()->HasLibrary( libName ) )
|
||||
continue;
|
||||
|
||||
// Don't expand environment variable because KIPRJMOD will not be correct
|
||||
// for a different project.
|
||||
wxString uri = table.GetFullURI( libName, false );
|
||||
wxFileName newLib;
|
||||
|
||||
if( uri.Contains( "${KIPRJMOD}" ) || uri.Contains( "$(KIPRJMOD)" ) )
|
||||
{
|
||||
// Cannot use relative paths here, "${KIPRJMOD}../path-to-cache-lib" does
|
||||
// not expand to a valid symbol library path.
|
||||
newLib.SetPath( fileName.GetPath() );
|
||||
newLib.SetFullName( uri.AfterLast( '}' ) );
|
||||
uri = newLib.GetFullPath();
|
||||
}
|
||||
else
|
||||
{
|
||||
uri = table.GetFullURI( libName );
|
||||
}
|
||||
|
||||
// Add the library from the imported project to the current project
|
||||
// symbol library table.
|
||||
const SYMBOL_LIB_TABLE_ROW* row = table.FindRow( libName );
|
||||
|
||||
auto newRow = new SYMBOL_LIB_TABLE_ROW( libName, uri, row->GetType(),
|
||||
row->GetOptions(), row->GetDescr() );
|
||||
|
||||
Prj().SchSymbolLibTable()->InsertRow( newRow );
|
||||
libTableChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for duplicate sheet names in the current page.
|
||||
wxArrayString duplicateSheetNames;
|
||||
SCH_TYPE_COLLECTOR sheets;
|
||||
|
||||
sheets.Collect( currentScreen->GetDrawItems(), SCH_COLLECTOR::SheetsOnly );
|
||||
|
||||
for( i = 0; i < sheets.GetCount(); ++i )
|
||||
{
|
||||
if( newSheet->GetScreen()->GetSheet( ( ( SCH_SHEET* ) sheets[i] )->GetName() ) )
|
||||
duplicateSheetNames.Add( ( ( SCH_SHEET* ) sheets[i] )->GetName() );
|
||||
}
|
||||
|
||||
if( !duplicateSheetNames.IsEmpty() )
|
||||
{
|
||||
msg.Printf( "Duplicate sheet names exist on the current page. Do you want to "
|
||||
"automatically rename the duplicate sheet names?" );
|
||||
|
||||
if( !IsOK( this, msg ) )
|
||||
return false;
|
||||
}
|
||||
|
||||
// Rename all duplicate sheet names.
|
||||
SCH_SCREEN* newScreen = newSheet->GetScreen();
|
||||
wxCHECK_MSG( newScreen, false, "No screen defined for sheet." );
|
||||
|
||||
for( const auto& duplicateName : duplicateSheetNames )
|
||||
{
|
||||
SCH_SHEET* renamedSheet = newScreen->GetSheet( duplicateName );
|
||||
|
||||
wxCHECK2_MSG( renamedSheet, continue,
|
||||
"Sheet " + duplicateName + " not found in imported schematic." );
|
||||
|
||||
timestamp_t newtimestamp = GetNewTimeStamp();
|
||||
renamedSheet->SetTimeStamp( newtimestamp );
|
||||
renamedSheet->SetName( wxString::Format( "Sheet%8.8lX", (unsigned long) newtimestamp ) );
|
||||
}
|
||||
|
||||
// Set all sheets loaded into the correct sheet file paths.
|
||||
SCH_TYPE_COLLECTOR newTopLevelSheets;
|
||||
|
||||
newTopLevelSheets.Collect( newSheet->GetScreen()->GetDrawItems(), SCH_COLLECTOR::SheetsOnly );
|
||||
|
||||
for( i = 0; i < newTopLevelSheets.GetCount(); ++i )
|
||||
{
|
||||
SCH_SHEET* tmpSheet = dynamic_cast< SCH_SHEET* >( newTopLevelSheets[i] );
|
||||
wxCHECK2( tmpSheet != nullptr, continue );
|
||||
tmpSheet->SetFileName( topLevelSheetPath + tmpSheet->GetFileName() );
|
||||
}
|
||||
|
||||
if( libTableChanged )
|
||||
Prj().SchSymbolLibTable()->Save( Prj().GetProjectPath() +
|
||||
SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
|
||||
|
||||
// It is finally safe to add or append the imported schematic.
|
||||
if( aSheet->GetScreen() == nullptr )
|
||||
aSheet->SetScreen( newScreen );
|
||||
else
|
||||
aSheet->GetScreen()->Append( newScreen );
|
||||
|
||||
SCH_SCREENS allScreens;
|
||||
allScreens.ReplaceDuplicateTimeStamps();
|
||||
|
||||
SCH_SCREENS screens( aSheet );
|
||||
screens.UpdateSymbolLinks( true );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
@@ -48,8 +524,6 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
if( aSheet == NULL || aHierarchy == NULL )
|
||||
return false;
|
||||
|
||||
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the schematic sheet hierarchy.
|
||||
|
||||
// Get the new texts
|
||||
DIALOG_SCH_SHEET_PROPS dlg( this, aSheet );
|
||||
|
||||
@@ -60,8 +534,11 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
fileName.SetExt( SchematicFileExtension );
|
||||
|
||||
wxString msg;
|
||||
bool renameFile = false;
|
||||
bool loadFromFile = false;
|
||||
bool clearAnnotation = false;
|
||||
bool restoreSheet = false;
|
||||
bool isExistingSheet = false;
|
||||
SCH_SCREEN* useScreen = NULL;
|
||||
|
||||
// Relative file names are relative to the path of the current sheet. This allows for
|
||||
@@ -95,9 +572,9 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
|
||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_LEGACY ) );
|
||||
|
||||
if( aSheet->GetScreen() == NULL ) // New sheet.
|
||||
if( aSheet->GetScreen() == NULL ) // New sheet.
|
||||
{
|
||||
if( useScreen || loadFromFile ) // Load from existing file.
|
||||
if( useScreen || loadFromFile ) // Load from existing file.
|
||||
{
|
||||
clearAnnotation = true;
|
||||
|
||||
@@ -111,7 +588,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
return false;
|
||||
|
||||
}
|
||||
else // New file.
|
||||
else // New file.
|
||||
{
|
||||
aSheet->SetScreen( new SCH_SCREEN( &Kiway() ) );
|
||||
aSheet->GetScreen()->SetModify();
|
||||
@@ -119,14 +596,15 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
aSheet->GetScreen()->SetFileName( newFilename );
|
||||
}
|
||||
}
|
||||
else // Existing sheet.
|
||||
else // Existing sheet.
|
||||
{
|
||||
bool isUndoable = true;
|
||||
bool renameFile = false;
|
||||
wxString replaceMsg;
|
||||
wxString newMsg;
|
||||
wxString noUndoMsg;
|
||||
|
||||
isExistingSheet = true;
|
||||
|
||||
// Changing the filename of a sheet can modify the full hierarchy structure
|
||||
// and can be not always undoable.
|
||||
// So prepare messages for user notifications:
|
||||
@@ -154,7 +632,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
// Sheet file name changes cannot be undone.
|
||||
isUndoable = false;
|
||||
|
||||
if( useScreen || loadFromFile ) // Load from existing file.
|
||||
if( useScreen || loadFromFile ) // Load from existing file.
|
||||
{
|
||||
clearAnnotation = true;
|
||||
|
||||
@@ -166,7 +644,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
if( loadFromFile )
|
||||
aSheet->SetScreen( NULL );
|
||||
}
|
||||
else // Save to new file name.
|
||||
else // Save to new file name.
|
||||
{
|
||||
if( aSheet->GetScreenCount() > 1 )
|
||||
{
|
||||
@@ -222,43 +700,55 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
|
||||
wxFileName userFileName = dlg.GetFileName();
|
||||
userFileName.SetExt( SchematicFileExtension );
|
||||
aSheet->SetFileName( userFileName.GetFullPath( wxPATH_UNIX ) );
|
||||
|
||||
if( useScreen )
|
||||
{
|
||||
aSheet->SetScreen( useScreen );
|
||||
}
|
||||
else if( loadFromFile )
|
||||
{
|
||||
try
|
||||
{
|
||||
aSheet = pi->Load( newFilename, &Kiway(), aSheet );
|
||||
// Create a temporary sheet for recursion testing to prevent a possible recursion error.
|
||||
std::unique_ptr< SCH_SHEET> tmpSheet( new SCH_SHEET );
|
||||
tmpSheet->SetName( dlg.GetSheetName() );
|
||||
tmpSheet->SetFileName( userFileName.GetFullPath() );
|
||||
tmpSheet->SetScreen( useScreen );
|
||||
|
||||
if( !pi->GetError().IsEmpty() )
|
||||
{
|
||||
DisplayErrorMessage( this,
|
||||
_( "The entire schematic could not be loaded.\n"
|
||||
"Errors occurred loading hierarchical sheets." ),
|
||||
pi->GetError() );
|
||||
}
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
// No need to check for valid library IDs if we are using an existing screen.
|
||||
if( checkSheetForRecursion( tmpSheet.get(), aHierarchy ) )
|
||||
{
|
||||
msg.Printf( _( "Error occurred loading schematic file \"%s\"." ), newFilename );
|
||||
DisplayErrorMessage( this, msg, ioe.What() );
|
||||
|
||||
msg.Printf( _( "Failed to load schematic \"%s\"" ), newFilename );
|
||||
AppendMsgPanel( wxEmptyString, msg, CYAN );
|
||||
if( restoreSheet )
|
||||
aHierarchy->LastScreen()->Append( aSheet );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
SCH_SCREEN* screen = aSheet->GetScreen();
|
||||
// It's safe to set the sheet screen now.
|
||||
aSheet->SetScreen( useScreen );
|
||||
}
|
||||
else if( loadFromFile )
|
||||
{
|
||||
if( isExistingSheet )
|
||||
{
|
||||
// Temporarily remove the sheet from the current schematic page so that recursion
|
||||
// and symbol library link tests can be performed with the modified sheet settings.
|
||||
restoreSheet = true;
|
||||
aHierarchy->LastScreen()->Remove( aSheet );
|
||||
}
|
||||
|
||||
if( screen )
|
||||
screen->UpdateSymbolLinks( true );
|
||||
if( !LoadSheetFromFile( aSheet, aHierarchy, newFilename ) )
|
||||
{
|
||||
if( restoreSheet )
|
||||
aHierarchy->LastScreen()->Append( aSheet );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( restoreSheet )
|
||||
aHierarchy->LastScreen()->Append( aSheet );
|
||||
}
|
||||
|
||||
wxString tmpFn = userFileName.GetFullPath();
|
||||
|
||||
if( wxFileName::GetPathSeparator() == '\\' )
|
||||
tmpFn.Replace( "\\", "/" );
|
||||
|
||||
aSheet->SetFileName( tmpFn );
|
||||
aSheet->SetFileNameSize( dlg.GetFileNameTextSize() );
|
||||
aSheet->SetName( dlg.GetSheetName() );
|
||||
aSheet->SetSheetNameSize( dlg.GetSheetNameTextSize() );
|
||||
@@ -267,38 +757,6 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
||||
aSheet->SetName( wxString::Format( wxT( "Sheet%8.8lX" ),
|
||||
(long unsigned) aSheet->GetTimeStamp() ) );
|
||||
|
||||
// Make sure the sheet changes do not cause any recursion.
|
||||
SCH_SHEET_LIST sheetHierarchy( aSheet );
|
||||
|
||||
// Make sure files have fully qualified path and file name.
|
||||
wxFileName destFn = aHierarchy->Last()->GetFileName();
|
||||
|
||||
if( destFn.IsRelative() )
|
||||
destFn.MakeAbsolute( Prj().GetProjectPath() );
|
||||
|
||||
if( hierarchy.TestForRecursion( sheetHierarchy, destFn.GetFullPath( wxPATH_UNIX ) ) )
|
||||
{
|
||||
msg.Printf( _( "The sheet changes cannot be made because the destination sheet already "
|
||||
"has the sheet \"%s\" or one of it's subsheets as a parent somewhere in "
|
||||
"the schematic hierarchy." ),
|
||||
newFilename );
|
||||
DisplayError( this, msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check to make sure the symbols have been remapped to the symbol library table.
|
||||
SCH_SCREENS newScreens( aSheet );
|
||||
|
||||
if( newScreens.HasNoFullyDefinedLibIds() )
|
||||
{
|
||||
msg.Printf(_( "The schematic \"%s\" has not been remapped to the symbol\nlibrary table. "
|
||||
" The project this schematic belongs to must first be remapped\nbefore it "
|
||||
"can be imported into the current project." ), fileName.GetFullName() );
|
||||
|
||||
DisplayInfoMessage( this, msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( aClearAnnotationNewItems )
|
||||
*aClearAnnotationNewItems = clearAnnotation;
|
||||
|
||||
|
||||
@@ -117,9 +117,9 @@ SIM_TYPE NETLIST_EXPORTER_PSPICE_SIM::GetSimType()
|
||||
SIM_TYPE NETLIST_EXPORTER_PSPICE_SIM::CommandToSimType( const wxString& aCmd )
|
||||
{
|
||||
const std::map<wxString, SIM_TYPE> simCmds = {
|
||||
{ ".ac", ST_AC }, { ".dc", ST_DC }, { ".disto", ST_DISTORTION }, { ".noise", ST_NOISE },
|
||||
{ ".op", ST_OP }, { ".pz", ST_POLE_ZERO }, { ".sens", ST_SENSITIVITY }, { ".tf", ST_TRANS_FUNC },
|
||||
{ ".tran", ST_TRANSIENT }
|
||||
{ ".ac ", ST_AC }, { ".dc ", ST_DC }, { ".disto ", ST_DISTORTION }, { ".noise ", ST_NOISE },
|
||||
{ ".op ", ST_OP }, { ".pz ", ST_POLE_ZERO }, { ".sens ", ST_SENSITIVITY }, { ".tf ", ST_TRANS_FUNC },
|
||||
{ ".tran ", ST_TRANSIENT }
|
||||
};
|
||||
wxString lcaseCmd = aCmd.Lower();
|
||||
|
||||
|
||||
@@ -423,10 +423,11 @@ string NGSPICE::findCmPath() const
|
||||
"/Applications/ngspice/lib/ngspice",
|
||||
"Contents/Frameworks",
|
||||
wxStandardPaths::Get().GetPluginsDir() + "/sim/ngspice",
|
||||
wxFileName( wxStandardPaths::Get().GetExecutablePath() ).GetPath() + "/../../../../../Contents/PlugIns/sim/ngspice"
|
||||
wxFileName( wxStandardPaths::Get().GetExecutablePath() ).GetPath() + "/../../../../../Contents/PlugIns/sim/ngspice",
|
||||
"../Plugins/sim/ngspice",
|
||||
#endif /* __WXMAC__ */
|
||||
"../lib/ngspice",
|
||||
"../../lib/ngspice"
|
||||
"../../lib/ngspice",
|
||||
"lib/ngspice",
|
||||
"ngspice"
|
||||
};
|
||||
|
||||
@@ -232,22 +232,7 @@ void SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataVie
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if( node->LibId == m_libMgr->GetCurrentLibId() )
|
||||
{
|
||||
LIB_ALIAS* alias = nullptr;
|
||||
|
||||
// When the node parent name is empty, the node is a lib name, not a symbol name
|
||||
// However should not happen, but happens.
|
||||
if( !node->Parent->Name.IsEmpty() )
|
||||
alias = m_libMgr->GetAlias( node->Name, node->Parent->Name );
|
||||
|
||||
if( alias )
|
||||
aVariant = alias->GetDescription();
|
||||
else
|
||||
aVariant = node->Desc;
|
||||
}
|
||||
else
|
||||
aVariant = node->Desc;
|
||||
aVariant = node->Desc;
|
||||
break;
|
||||
|
||||
default: // column == -1 is used for default Compare function
|
||||
@@ -284,7 +269,10 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, un
|
||||
#else
|
||||
// mark the current library with background color
|
||||
if( node->Name == m_libMgr->GetCurrentLib() )
|
||||
{
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -303,7 +291,10 @@ bool SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr( wxDataViewItem const& aItem, un
|
||||
#else
|
||||
// mark the current part with background color
|
||||
if( node->LibId == m_libMgr->GetCurrentLibId() )
|
||||
{
|
||||
aAttr.SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
|
||||
aAttr.SetColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
@@ -691,14 +691,27 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PAN
|
||||
msg = ShowGBRShape();
|
||||
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
|
||||
|
||||
// Display D_Code value with its attributes:
|
||||
msg.Printf( _( "D Code %d" ), m_DCode );
|
||||
D_CODE* apertDescr = GetDcodeDescr();
|
||||
|
||||
if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
|
||||
text = _( "No attribute" );
|
||||
// Display D_Code value with its attributes for items using a DCode:
|
||||
if( m_Shape == GBR_POLYGON ) // Has no DCode, but can have an attribute
|
||||
{
|
||||
msg = _( "Attribute" );
|
||||
|
||||
if( m_AperFunction.IsEmpty() )
|
||||
text = _( "No attribute" );
|
||||
else
|
||||
text = m_AperFunction;
|
||||
}
|
||||
else
|
||||
text = apertDescr->m_AperFunction;
|
||||
{
|
||||
msg.Printf( _( "D Code %d" ), m_DCode );
|
||||
D_CODE* apertDescr = GetDcodeDescr();
|
||||
|
||||
if( !apertDescr || apertDescr->m_AperFunction.IsEmpty() )
|
||||
text = _( "No attribute" );
|
||||
else
|
||||
text = apertDescr->m_AperFunction;
|
||||
}
|
||||
|
||||
aList.push_back( MSG_PANEL_ITEM( msg, text, RED ) );
|
||||
|
||||
|
||||
@@ -88,9 +88,14 @@ public:
|
||||
// Lines : m_Size.x = m_Size.y = line width
|
||||
bool m_Flashed; // True for flashed items
|
||||
int m_DCode; // DCode used to draw this item.
|
||||
// 0 for items that do not use DCodes (polygons)
|
||||
// or when unknown and normal values are 10 to 999
|
||||
// Allowed values are >= 10. 0 when unknown
|
||||
// values 0 to 9 can be used for special purposes
|
||||
// Regions (polygons) doo not use DCode,
|
||||
// so it is set to 0
|
||||
wxString m_AperFunction; // the aperture function set by a %TA.AperFunction, xxx
|
||||
// (stores thre xxx value).
|
||||
// used for regions that do not have a attached DCode, but
|
||||
// have a TA.AperFunction defined
|
||||
GERBER_FILE_IMAGE* m_GerberImageFile; /* Gerber file image source of this item
|
||||
* Note: some params stored in this class are common
|
||||
* to the whole gerber file (i.e) the whole graphic
|
||||
|
||||
@@ -226,6 +226,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
m_canvasType = GetGalCanvas()->GetBackend();
|
||||
|
||||
// Enable the axes to match legacy draw style
|
||||
auto& galOptions = GetGalDisplayOptions();
|
||||
galOptions.m_axesEnabled = true;
|
||||
|
||||
@@ -74,6 +74,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
#if 0 // Outdated warning
|
||||
/* if the gerber file is only a RS274D file
|
||||
* (i.e. without any aperture information, but with items), warn the user:
|
||||
*/
|
||||
@@ -84,6 +85,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
|
||||
"Therefore the size of items is undefined");
|
||||
wxMessageBox( msg );
|
||||
}
|
||||
#endif
|
||||
|
||||
auto canvas = GetGalCanvas();
|
||||
|
||||
|
||||
@@ -619,6 +619,14 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
|
||||
m_Drawings.Append( gbritem );
|
||||
gbritem->m_Shape = GBR_POLYGON;
|
||||
gbritem->m_Flashed = false;
|
||||
gbritem->m_DCode = 0; // No DCode for a Polygon (Region in Gerber dialect)
|
||||
|
||||
|
||||
if( gbritem->m_GerberImageFile )
|
||||
{
|
||||
gbritem->SetNetAttributes( gbritem->m_GerberImageFile->m_NetAttributeDict );
|
||||
gbritem->m_AperFunction = gbritem->m_GerberImageFile->m_AperFunction;
|
||||
}
|
||||
}
|
||||
|
||||
switch( m_Iterpolation )
|
||||
@@ -676,6 +684,7 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande )
|
||||
m_Exposure = true;
|
||||
|
||||
tool = GetDCODE( m_Current_Tool );
|
||||
|
||||
if( tool )
|
||||
{
|
||||
size = tool->m_Size;
|
||||
|
||||
@@ -726,7 +726,7 @@ void GERBVIEW_SELECTION_TOOL::select( EDA_ITEM* aItem )
|
||||
}
|
||||
|
||||
m_selection.Add( aItem );
|
||||
getView()->Add( &m_selection );
|
||||
getView()->Add( &m_selection, std::numeric_limits<int>::max() );
|
||||
selectVisually( aItem );
|
||||
|
||||
if( m_selection.Size() == 1 )
|
||||
|
||||
+80
-15
@@ -46,13 +46,15 @@ class EDA_RECT
|
||||
private:
|
||||
wxPoint m_Pos; // Rectangle Origin
|
||||
wxSize m_Size; // Rectangle Size
|
||||
bool m_init; // Is the rectangle initialized
|
||||
|
||||
public:
|
||||
EDA_RECT() { };
|
||||
EDA_RECT() : m_init( false ) { };
|
||||
|
||||
EDA_RECT( const wxPoint& aPos, const wxSize& aSize ) :
|
||||
m_Pos( aPos ),
|
||||
m_Size( aSize )
|
||||
m_Size( aSize ),
|
||||
m_init( true )
|
||||
{ }
|
||||
|
||||
virtual ~EDA_RECT() { };
|
||||
@@ -121,20 +123,83 @@ public:
|
||||
int GetTop() const { return m_Pos.y; }
|
||||
int GetBottom() const { return m_Pos.y + m_Size.y; } // Y axis from top to bottom
|
||||
|
||||
void SetOrigin( const wxPoint& pos ) { m_Pos = pos; }
|
||||
void SetOrigin( int x, int y ) { m_Pos.x = x; m_Pos.y = y; }
|
||||
void SetSize( const wxSize& size ) { m_Size = size; }
|
||||
void SetSize( int w, int h ) { m_Size.x = w; m_Size.y = h; }
|
||||
void Offset( int dx, int dy ) { m_Pos.x += dx; m_Pos.y += dy; }
|
||||
void Offset( const wxPoint& offset ) { m_Pos += offset; }
|
||||
void SetX( int val ) { m_Pos.x = val; }
|
||||
void SetY( int val ) { m_Pos.y = val; }
|
||||
void SetWidth( int val ) { m_Size.x = val; }
|
||||
void SetHeight( int val ) { m_Size.y = val; }
|
||||
void SetEnd( int x, int y ) { SetEnd( wxPoint( x, y ) ); }
|
||||
void SetEnd( const wxPoint& pos )
|
||||
bool IsValid() const
|
||||
{
|
||||
m_Size.x = pos.x - m_Pos.x; m_Size.y = pos.y - m_Pos.y;
|
||||
return m_init;
|
||||
}
|
||||
|
||||
void SetOrigin( const wxPoint &pos )
|
||||
{
|
||||
m_Pos = pos;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetOrigin( int x, int y )
|
||||
{
|
||||
m_Pos.x = x;
|
||||
m_Pos.y = y;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetSize( const wxSize &size )
|
||||
{
|
||||
m_Size = size;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetSize( int w, int h )
|
||||
{
|
||||
m_Size.x = w;
|
||||
m_Size.y = h;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void Offset( int dx, int dy )
|
||||
{
|
||||
m_Pos.x += dx;
|
||||
m_Pos.y += dy;
|
||||
}
|
||||
|
||||
void Offset( const wxPoint &offset )
|
||||
{
|
||||
m_Pos += offset;
|
||||
}
|
||||
|
||||
void SetX( int val )
|
||||
{
|
||||
m_Pos.x = val;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetY( int val )
|
||||
{
|
||||
m_Pos.y = val;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetWidth( int val )
|
||||
{
|
||||
m_Size.x = val;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetHeight( int val )
|
||||
{
|
||||
m_Size.y = val;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetEnd( int x, int y )
|
||||
{
|
||||
SetEnd( wxPoint( x, y ) );
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
void SetEnd( const wxPoint &pos )
|
||||
{
|
||||
m_Size.x = pos.x - m_Pos.x;
|
||||
m_Size.y = pos.y - m_Pos.y;
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -147,10 +147,12 @@ public:
|
||||
* @param aFootprintNames is the list to fill with the footprint names found in \a aNickname
|
||||
*
|
||||
* @param aNickname is a locator for the "library", it is a "name" in LIB_TABLE_ROW.
|
||||
* @param aBestEfforts if true, don't throw on errors
|
||||
*
|
||||
* @throw IO_ERROR if the library cannot be found, or footprint cannot be loaded.
|
||||
*/
|
||||
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname );
|
||||
void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aNickname,
|
||||
bool aBestEfforts );
|
||||
|
||||
/**
|
||||
* Generate a hashed timestamp representing the last-mod-times of the library indicated
|
||||
|
||||
@@ -39,16 +39,6 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#define SCREEN_DEPTH 24
|
||||
#else
|
||||
#if wxCHECK_VERSION( 2, 9, 0 )
|
||||
#define SCREEN_DEPTH wxBITMAP_SCREEN_DEPTH
|
||||
#else
|
||||
#define SCREEN_DEPTH 32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
|
||||
*
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace KIGFX
|
||||
{
|
||||
class GAL;
|
||||
|
||||
typedef std::deque< std::deque<VECTOR2D> > GLYPH;
|
||||
typedef std::vector<std::vector<VECTOR2D>> GLYPH;
|
||||
typedef std::vector<GLYPH> GLYPH_LIST;
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
GBR_APERTURE_ATTRIB_NONE, ///< uninitialized attribute
|
||||
GBR_APERTURE_ATTRIB_ETCHEDCMP, ///< aperture used for etched components
|
||||
GBR_APERTURE_ATTRIB_CONDUCTOR, ///< aperture used for connected items like tracks (not vias)
|
||||
GBR_APERTURE_ATTRIB_CUTOUT, ///< aperture used for board cutout
|
||||
GBR_APERTURE_ATTRIB_EDGECUT, ///< aperture used for board outlines (edge.cut layer)
|
||||
GBR_APERTURE_ATTRIB_NONCONDUCTOR, ///< aperture used for not connected items (texts, outlines on copper)
|
||||
GBR_APERTURE_ATTRIB_VIAPAD, ///< aperture used for vias
|
||||
GBR_APERTURE_ATTRIB_COMPONENTPAD, ///< aperture used for through hole component on outer layer
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ enum HASH_FLAGS
|
||||
ALL = 0xff
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Calculates hash of an EDA_ITEM.
|
||||
* @param aItem is the item for which the hash will be computed.
|
||||
* @return Hash value.
|
||||
|
||||
+15
-12
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2011-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 1992-2019 KiCad Developers, see CHANGELOG.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
|
||||
@@ -27,9 +27,10 @@
|
||||
|
||||
|
||||
/**
|
||||
@file
|
||||
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
|
||||
*/
|
||||
* @file include/html_messagebox.h
|
||||
*
|
||||
* Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
|
||||
*/
|
||||
|
||||
#include <../common/dialogs/dialog_display_info_HTML_base.h>
|
||||
|
||||
@@ -41,10 +42,12 @@ class HTML_MESSAGE_BOX : public DIALOG_DISPLAY_HTML_TEXT_BASE
|
||||
{
|
||||
protected:
|
||||
// Handlers for HTML_MESSAGE_BOX_BASE events.
|
||||
void OnCloseButtonClick( wxCommandEvent& event ) override;
|
||||
void OnOKButtonClick( wxCommandEvent& event ) override;
|
||||
|
||||
public:
|
||||
HTML_MESSAGE_BOX( wxWindow* parent, const wxString& aTitle );
|
||||
HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle = wxEmptyString,
|
||||
const wxPoint& aPosition = wxDefaultPosition,
|
||||
const wxSize& aSize = wxDefaultSize );
|
||||
~HTML_MESSAGE_BOX() override;
|
||||
|
||||
/**
|
||||
@@ -61,15 +64,15 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function ListSet
|
||||
* Add a list of items.
|
||||
*
|
||||
* @param aList = a string containing items. Items are separated by '\n'
|
||||
*/
|
||||
void ListSet( const wxString& aList );
|
||||
|
||||
/**
|
||||
* Function ListSet
|
||||
* Add a list of items.
|
||||
*
|
||||
* @param aList = a wxArrayString containing items.
|
||||
*/
|
||||
void ListSet( const wxArrayString& aList );
|
||||
@@ -77,15 +80,15 @@ public:
|
||||
void ListClear();
|
||||
|
||||
/**
|
||||
* Function MessageSet
|
||||
* adds a message (in bold) to message list.
|
||||
* Add a message (in bold) to message list.
|
||||
*
|
||||
* @param message = the message
|
||||
*/
|
||||
void MessageSet( const wxString& message );
|
||||
|
||||
/**
|
||||
* Function AddHTML_Text
|
||||
* adds html text (without any change) to message list.
|
||||
* Add HTML text (without any change) to message list.
|
||||
*
|
||||
* @param message = the text to add
|
||||
*/
|
||||
void AddHTML_Text( const wxString& message );
|
||||
|
||||
@@ -81,7 +81,7 @@ int ReadDelimitedText( wxString* aDest, const char* aSource );
|
||||
* @param aString is the input string to convert.
|
||||
* @return std::string - the escaped input text, without the wrapping double quotes.
|
||||
*/
|
||||
std::string EscapedUTF8( const wxString& aString );
|
||||
std::string EscapedUTF8( wxString aString );
|
||||
|
||||
/**
|
||||
* Return a new wxString escaped for embedding in HTML.
|
||||
|
||||
@@ -1135,6 +1135,14 @@ public:
|
||||
virtual void FlashPadTrapez( const wxPoint& aPadPos, const wxPoint *aCorners,
|
||||
double aPadOrient, EDA_DRAW_MODE_T aTraceMode, void* aData ) override;
|
||||
|
||||
/**
|
||||
* Plot a Gerber region: similar to PlotPoly but plot only filled polygon,
|
||||
* and add the TA.AperFunction if aData contains this attribute, and clear it
|
||||
* after plotting
|
||||
*/
|
||||
void PlotGerberRegion( const std::vector< wxPoint >& aCornerList,
|
||||
void * aData = NULL );
|
||||
|
||||
/**
|
||||
* Change the plot polarity and begin a new layer
|
||||
* Used to 'scratch off' silk screen away from solder mask
|
||||
@@ -1171,6 +1179,7 @@ public:
|
||||
*/
|
||||
virtual void EndBlock( void* aData ) override;
|
||||
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Pick an existing aperture or create a new one, matching the
|
||||
|
||||
@@ -95,6 +95,11 @@ public:
|
||||
*/
|
||||
void SetLeaderMode( LEADER_MODE aMode );
|
||||
|
||||
LEADER_MODE GetLeaderMode() const
|
||||
{
|
||||
return m_leaderMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables self-intersecting polygons.
|
||||
* @param aEnabled true if self-intersecting polygons are enabled.
|
||||
@@ -123,7 +128,7 @@ public:
|
||||
/**
|
||||
* Set the current cursor position
|
||||
*/
|
||||
void SetCursorPosition( const VECTOR2I& aPos, LEADER_MODE aModifier );
|
||||
void SetCursorPosition( const VECTOR2I& aPos );
|
||||
|
||||
/**
|
||||
* @return true if the polygon in "in progress", i.e. it has at least
|
||||
|
||||
@@ -75,6 +75,8 @@ private:
|
||||
|
||||
///> polygon fill
|
||||
SHAPE_POLY_SET m_polyfill;
|
||||
|
||||
static const double POLY_LINE_WIDTH;
|
||||
};
|
||||
|
||||
} // PREVIEW
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user