Compare commits
125 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a9271f98e | |||
| 3c91b0c693 | |||
| 562bd7d564 | |||
| ad726dc6e4 | |||
| b2ecf097ed | |||
| 8dca61ce9c | |||
| e8e25fd732 | |||
| bd7841bf96 | |||
| 55020c2b89 | |||
| a74d1d9962 | |||
| 4d899d7820 | |||
| 4907b90215 | |||
| a399f799ad | |||
| 55cd2da432 | |||
| 096600ffc4 | |||
| b4bae29c02 | |||
| e4a5ce78aa | |||
| 522738284d | |||
| cc0d5ec46a | |||
| f2018a09d8 | |||
| 54952ca97e | |||
| a8543b1122 | |||
| 790ca19445 | |||
| f56b3bdd07 | |||
| 7d635d3d43 | |||
| 37f62e539b | |||
| 3196f4adb6 | |||
| b4d67b6b29 | |||
| f7d790598b | |||
| bbf00e0461 | |||
| a91f807e13 | |||
| 100cf757fe | |||
| 76f21d950d | |||
| 69469b254a | |||
| bfca928900 | |||
| 62f8603353 | |||
| 9a2332dfcf | |||
| 4bcfa8df1f | |||
| a0e424c2ac | |||
| f4b9a92b94 | |||
| 184a592f82 | |||
| 3e6bf7814b | |||
| 9864337914 | |||
| 78e737b9d8 | |||
| d014f0307b | |||
| 7c9340f855 | |||
| 3069b198b1 | |||
| 05d3dc533b | |||
| 1e05732f55 | |||
| 71e7b4b77b | |||
| b8a7a66a0a | |||
| 55087a9e82 | |||
| 444801ada6 | |||
| 7afe188a29 | |||
| 1ad1cf8374 | |||
| abaee94109 | |||
| d60e77176f | |||
| 7f1648934f | |||
| bef762e652 | |||
| a05ec04ee8 | |||
| 362eedc510 | |||
| 11402e2db1 | |||
| b1658fdf9a | |||
| f9d8ec6137 | |||
| e9b91b6fab | |||
| 873353d8d7 | |||
| a326d777f0 | |||
| dec310f7f8 | |||
| ca8cf14dff | |||
| ed9a3deb57 | |||
| 58b07efd99 | |||
| 1874ad2f7e | |||
| b115aec42b | |||
| 5e884d14c7 | |||
| e36381bdd2 | |||
| 45182febaf | |||
| ea99c42df6 | |||
| 0065036899 | |||
| bb388d47fc | |||
| 134b09004b | |||
| c52421869a | |||
| addc5574b4 | |||
| bd75cffff3 | |||
| 3453bf3f88 | |||
| f139cc2d9f | |||
| 6fd93eaa1e | |||
| cf8c614a02 | |||
| 9fd1ad9b7b | |||
| d45472adcd | |||
| f67c0ea8c7 | |||
| 3c2bb97eae | |||
| cbdfb5d396 | |||
| e19acb4632 | |||
| 11c967b259 | |||
| 517e44e917 | |||
| 0ec440805d | |||
| 67fe8904c0 | |||
| da850036e3 | |||
| b80595903c | |||
| c83880428c | |||
| cc84344499 | |||
| 32be48222a | |||
| b7ec594c0a | |||
| 2481b21d80 | |||
| ceb4d08ce9 | |||
| 6edc605cab | |||
| d913e6a8f7 | |||
| bde0c3e879 | |||
| b95032901e | |||
| 753e08a944 | |||
| ee1b327162 | |||
| da5f2366f9 | |||
| e7cc177d94 | |||
| 93c48b9d46 | |||
| 1b033d56a7 | |||
| ad583eab13 | |||
| 0d3246e3ab | |||
| 76fd029cd6 | |||
| 2efa878287 | |||
| 1dc78c4adc | |||
| 34d855cd53 | |||
| 9cb36e5bc5 | |||
| b6ff44cccf | |||
| e9e742816d | |||
| b403930601 |
@@ -3,6 +3,9 @@
|
||||
##########################################################################
|
||||
fedora_build_linux:
|
||||
stage: build
|
||||
tags:
|
||||
- kicad-fedora
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
|
||||
extends: .only_code
|
||||
interruptible: false
|
||||
cache:
|
||||
@@ -18,14 +21,14 @@ fedora_build_linux:
|
||||
- mkdir -p build/linux
|
||||
- cd build/linux
|
||||
- cmake
|
||||
-G Ninja
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
|
||||
../../
|
||||
- make 2>&1 | tee compilation_log.txt
|
||||
- ninja 2>&1 | tee compilation_log.txt
|
||||
- cd ../../
|
||||
artifacts:
|
||||
# Only save the artifacts that are needed for running the tests in the next stage
|
||||
|
||||
@@ -30,12 +30,7 @@ ubuntu20.04_build:
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
|
||||
@@ -18,12 +18,7 @@ win64_build:
|
||||
-G "Ninja" `
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:\build\vcpkg\scripts\buildsystems\vcpkg.cmake `
|
||||
-DCMAKE_BUILD_TYPE=Debug `
|
||||
-DKICAD_SCRIPTING=OFF `
|
||||
-DKICAD_SCRIPTING_MODULES=OFF `
|
||||
-DKICAD_SCRIPTING_PYTHON3=OFF `
|
||||
-DKICAD_SCRIPTING_WXPYTHON=OFF `
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF `
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=OFF `
|
||||
-DKICAD_USE_OCC=ON `
|
||||
-DKICAD_SPICE=ON `
|
||||
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON `
|
||||
|
||||
@@ -59,12 +59,7 @@ Coverity:
|
||||
- cmake
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
- coverity/bin/cov-build --dir cov-int make -j8
|
||||
|
||||
@@ -30,12 +30,7 @@ validate_linux_metadata:
|
||||
- cmake
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
|
||||
@@ -347,7 +347,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU ( seg->GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().B.y * m_biuTo3Dunits );
|
||||
const int width = seg->GetWidth() + clearance.x * 2;
|
||||
const double width = seg->GetWidth() + clearance.x * 2;
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
@@ -368,7 +368,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
case SH_CIRCLE:
|
||||
{
|
||||
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape;
|
||||
const int radius = circle->GetRadius() + clearance.x;
|
||||
const double radius = circle->GetRadius() + clearance.x;
|
||||
const SFVEC2F center( circle->GetCenter().x * m_biuTo3Dunits,
|
||||
-circle->GetCenter().y * m_biuTo3Dunits );
|
||||
|
||||
@@ -409,7 +409,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
-seg.GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU( seg.GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg.GetSeg().B.y * m_biuTo3Dunits );
|
||||
const int width = arc->GetWidth() + clearance.x * 2;
|
||||
const double width = arc->GetWidth() + clearance.x * 2;
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
@@ -459,7 +459,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
|
||||
if( drillSize.x == drillSize.y ) // usual round hole
|
||||
{
|
||||
const int radius = ( drillSize.x / 2 ) + aInflateValue;
|
||||
const double radius = ( drillSize.x / 2.0 ) + aInflateValue;
|
||||
|
||||
const SFVEC2F center( aPad->GetPosition().x * m_biuTo3Dunits,
|
||||
-aPad->GetPosition().y * m_biuTo3Dunits );
|
||||
@@ -470,7 +470,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
else // Oblong hole
|
||||
{
|
||||
const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
|
||||
float width = seg->GetWidth() + aInflateValue * 2;
|
||||
double width = seg->GetWidth() + aInflateValue * 2;
|
||||
|
||||
SFVEC2F start3DU( seg->GetSeg().A.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
@@ -567,7 +567,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
|
||||
const BOARD_ITEM& aBoardItem )
|
||||
{
|
||||
wxPoint arc_start, arc_end;
|
||||
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
|
||||
double delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
|
||||
|
||||
arc_end = arc_start = aStart;
|
||||
|
||||
@@ -586,7 +586,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
|
||||
wxPoint curr_end = arc_start;
|
||||
wxPoint curr_start = arc_start;
|
||||
|
||||
for( int ii = delta; ii < aArcAngle; ii += delta )
|
||||
for( double ii = delta; ii < aArcAngle; ii += delta )
|
||||
{
|
||||
curr_end = arc_start;
|
||||
RotatePoint( &curr_end, aCentre, -ii );
|
||||
@@ -636,7 +636,7 @@ void BOARD_ADAPTER::addShapeWithClearance( const PCB_SHAPE* aShape,
|
||||
{
|
||||
// The full width of the lines to create
|
||||
// The extra 1 protects the inner/outer radius values from degeneracy
|
||||
const int linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
|
||||
const double linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
|
||||
|
||||
switch( aShape->GetShape() )
|
||||
{
|
||||
@@ -831,9 +831,9 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BAS
|
||||
const SFVEC2F center3DU( aPad->ShapePos().x * m_biuTo3Dunits,
|
||||
-aPad->ShapePos().y * m_biuTo3Dunits );
|
||||
|
||||
const int radius = aPad->GetSize().x / 2;
|
||||
const float inner_radius = ( radius - aWidth / 2 ) * m_biuTo3Dunits;
|
||||
const float outer_radius = ( radius + aWidth / 2 ) * m_biuTo3Dunits;
|
||||
const double radius = aPad->GetSize().x / 2.0;
|
||||
const float inner_radius = ( radius - aWidth / 2.0 ) * m_biuTo3Dunits;
|
||||
const float outer_radius = ( radius + aWidth / 2.0 ) * m_biuTo3Dunits;
|
||||
|
||||
aDstContainer->Add( new RING_2D( center3DU, inner_radius, outer_radius, *aPad ) );
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
if( m_render_pivot )
|
||||
{
|
||||
const float scale = glm::min( m_camera.GetZoom(), 1.0f );
|
||||
render_pivot( curtime_delta_s, scale * scale );
|
||||
render_pivot( curtime_delta_s, scale );
|
||||
}
|
||||
|
||||
// "Swaps the double-buffer of this window, making the back-buffer the
|
||||
|
||||
@@ -102,7 +102,6 @@ void EDA_3D_CANVAS::render_pivot( float t , float aScale )
|
||||
glTranslatef( lookAtPos.x, lookAtPos.y, lookAtPos.z );
|
||||
|
||||
glScalef( aScale, aScale, aScale );
|
||||
|
||||
pivot_render_triangles( t * 0.5f );
|
||||
|
||||
t = t * 0.80f;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
///! Update the schema version whenever a migration is required
|
||||
const int viewer3dSchemaVersion = 1;
|
||||
const int viewer3dSchemaVersion = 2;
|
||||
|
||||
|
||||
EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
@@ -63,7 +63,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
|
||||
// OpenGL options
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_copper_thickness",
|
||||
&m_Render.opengl_copper_thickness, true ) );
|
||||
&m_Render.opengl_copper_thickness, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_show_model_bbox",
|
||||
&m_Render.opengl_show_model_bbox, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_highlight_on_rollover",
|
||||
@@ -202,6 +202,12 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
&m_Camera.projection_mode, 1 ) );
|
||||
|
||||
registerMigration( 0, 1, std::bind( &EDA_3D_VIEWER_SETTINGS::migrateSchema0to1, this ) );
|
||||
|
||||
registerMigration( 1, 2, [&]() -> bool
|
||||
{
|
||||
Set( "render.opengl_copper_thickness", false );
|
||||
return true;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -255,9 +255,11 @@ wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
|
||||
{
|
||||
// Convert from internal units (mm) to user units
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
aValue /= 25.4f;
|
||||
aValue /= 25.4;
|
||||
else if( m_userUnits == EDA_UNITS::MILS )
|
||||
aValue /= 25.4 / 1e3;
|
||||
|
||||
return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
|
||||
return wxString::Format( "%.6f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -397,18 +399,19 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
|
||||
else if( spinCtrl == m_spinZoffset )
|
||||
textCtrl = zoff;
|
||||
|
||||
double step = OFFSET_INCREMENT_MM;
|
||||
double step_mm = OFFSET_INCREMENT_MM;
|
||||
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
step = OFFSET_INCREMENT_MIL/1000.0;
|
||||
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
|
||||
{
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
|
||||
}
|
||||
|
||||
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
curr_value_mm += ( step_mm * aSign );
|
||||
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
|
||||
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
|
||||
|
||||
curr_value += ( step * aSign );
|
||||
curr_value = std::max( -MAX_OFFSET, curr_value );
|
||||
curr_value = std::min( curr_value, MAX_OFFSET );
|
||||
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value ) );
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -460,29 +463,29 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event )
|
||||
{
|
||||
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
|
||||
|
||||
double step = OFFSET_INCREMENT_MM;
|
||||
double step_mm = OFFSET_INCREMENT_MM;
|
||||
|
||||
if( event.ShiftDown( ) )
|
||||
step = OFFSET_INCREMENT_MM_FINE;
|
||||
step_mm = OFFSET_INCREMENT_MM_FINE;
|
||||
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
|
||||
{
|
||||
step = OFFSET_INCREMENT_MIL/1000.0;
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
|
||||
|
||||
if( event.ShiftDown( ) )
|
||||
step = OFFSET_INCREMENT_MIL_FINE/1000.0;
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000.0;
|
||||
}
|
||||
|
||||
if( event.GetWheelRotation() >= 0 )
|
||||
step = -step;
|
||||
step_mm = -step_mm;
|
||||
|
||||
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
|
||||
curr_value += step;
|
||||
curr_value = std::max( -MAX_OFFSET, curr_value );
|
||||
curr_value = std::min( curr_value, MAX_OFFSET );
|
||||
curr_value_mm += step_mm;
|
||||
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
|
||||
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
|
||||
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value ) );
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ German (DE) Rafael Sokolowski <Rafael.Sokolowski[at]web-dot-de
|
||||
Japanese (JA) Kenta Yonekura <yoneken[at]kicad-dot-jp>
|
||||
Simplified Chinese (zh_CN) taotieren <admin[at]taotieren-dot-com>
|
||||
|
||||
Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke
|
||||
Remy Halvick, David J S Briscoe, Dominique Laigle, Paul Burke
|
||||
|
||||
|
||||
== Programm credits for icons and others
|
||||
|
||||
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
|
||||
# Disabling the "search every possible place" code for now
|
||||
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
|
||||
|
||||
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
|
||||
if(PythonLibs_FIND_VERSION)
|
||||
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.0" )
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.1" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -26,11 +26,13 @@ set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES
|
||||
COMPILE_DEFINITIONS "COMPILING_DLL"
|
||||
)
|
||||
|
||||
if( MINGW )
|
||||
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( bitmap2component )
|
||||
else()
|
||||
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( bitmap2component )
|
||||
else()
|
||||
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
|
||||
@@ -269,8 +269,13 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
|
||||
pos.x = KiROUND( pos.x / GetScalingFactor() );
|
||||
pos.y = KiROUND( pos.y / GetScalingFactor() );
|
||||
size.x = KiROUND( size.x / GetScalingFactor() );
|
||||
size.y = KiROUND( size.y / GetScalingFactor() );
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
aDC->SetClippingRegion( pos, size );
|
||||
|
||||
if( GetGRForceBlackPenState() )
|
||||
{
|
||||
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
|
||||
@@ -288,6 +293,8 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
aDC->SetUserScale( scale, scale );
|
||||
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -861,6 +861,26 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
wxEmptyString,
|
||||
"Traditional Chinese (zh_TW)" ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Remy Halvick",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
"Other" ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "David J S Briscoe",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
"Other" ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Dominique Laigle",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
"Other" ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Paul Burke",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
"Other" ) );
|
||||
|
||||
|
||||
// Program credits for 3d models
|
||||
#define LIBRARIANS _( "KiCad Librarian Team" )
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <pgm_base.h>
|
||||
#include <base_units.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <bitmaps.h>
|
||||
#include <netclass.h>
|
||||
#include <confirm.h>
|
||||
@@ -69,11 +70,13 @@ std::vector<BITMAPS> g_lineStyleIcons;
|
||||
wxArrayString g_lineStyleNames;
|
||||
|
||||
|
||||
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
|
||||
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame,
|
||||
NETCLASSES* aNetclasses,
|
||||
const std::vector<wxString>& aNetNames,
|
||||
bool aIsEEschema ) :
|
||||
PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() ),
|
||||
m_Parent( aParent ),
|
||||
m_frame( aFrame ),
|
||||
m_parent( aParent ),
|
||||
m_netclasses( aNetclasses ),
|
||||
m_netNames( aNetNames ),
|
||||
m_hoveredCol( -1 )
|
||||
@@ -185,6 +188,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSE
|
||||
&PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent,
|
||||
this );
|
||||
|
||||
m_frame->Bind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
|
||||
m_netclassGrid->EndBatch();
|
||||
m_membershipGrid->EndBatch();
|
||||
Thaw();
|
||||
@@ -205,6 +210,24 @@ PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES()
|
||||
m_netclassGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
m_frame->Unbind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_SETUP_NETCLASSES::onUnitsChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
NETCLASSES tempNetClasses;
|
||||
NETCLASSES* saveNetClasses = m_netclasses;
|
||||
|
||||
m_netclasses = &tempNetClasses; // No, address of stack var does not escape function
|
||||
|
||||
TransferDataFromWindow();
|
||||
TransferDataToWindow();
|
||||
|
||||
m_netclasses = saveNetClasses;
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +274,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
|
||||
m_netclassGrid->AppendRows((int) m_netclasses->GetCount() + 1 ); // + 1 for default netclass
|
||||
|
||||
// enter the Default NETCLASS.
|
||||
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
|
||||
// make the Default NETCLASS name read-only
|
||||
wxGridCellAttr* cellAttr = m_netclassGrid->GetOrCreateCellAttr( 0, GRID_NAME );
|
||||
@@ -265,7 +288,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
|
||||
{
|
||||
NETCLASSPTR netclass = i->second;
|
||||
|
||||
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, row, netclass );
|
||||
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, row, netclass );
|
||||
|
||||
for( const wxString& net : *netclass )
|
||||
{
|
||||
@@ -373,7 +396,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
m_netclasses->Clear();
|
||||
|
||||
// Copy the default NetClass:
|
||||
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
|
||||
// Copy other NetClasses:
|
||||
for( int row = 1; row < m_netclassGrid->GetNumberRows(); ++row )
|
||||
@@ -382,7 +405,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
GRID_NAME ) );
|
||||
|
||||
if( m_netclasses->Add( nc ) )
|
||||
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, row, nc );
|
||||
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, row, nc );
|
||||
}
|
||||
|
||||
// Now read all nets and push them in the corresponding netclass net buffer
|
||||
@@ -415,7 +438,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
|
||||
if( tmp.IsEmpty() )
|
||||
{
|
||||
wxString msg = _( "Netclass must have a name." );
|
||||
m_Parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
|
||||
m_parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -424,7 +447,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
|
||||
if( ii != aRow && m_netclassGrid->GetCellValue( ii, GRID_NAME ).CmpNoCase( tmp ) == 0 )
|
||||
{
|
||||
wxString msg = _( "Netclass name already in use." );
|
||||
m_Parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
|
||||
m_parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,19 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
try
|
||||
{
|
||||
cntUpd.Start();
|
||||
m_view->UpdateItems();
|
||||
try
|
||||
{
|
||||
m_view->UpdateItems();
|
||||
}
|
||||
catch( std::out_of_range& err )
|
||||
{
|
||||
// Don't do anything here but don't fail
|
||||
// This can happen when we don't catch `at()` calls
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "Out of Range error: %s" ), err.what() );
|
||||
wxLogDebug( msg );
|
||||
}
|
||||
|
||||
cntUpd.Stop();
|
||||
|
||||
cntCtx.Start();
|
||||
|
||||
+25
-10
@@ -267,11 +267,20 @@ void EDA_DRAW_FRAME::unitsChangeRefresh()
|
||||
|
||||
void EDA_DRAW_FRAME::ToggleUserUnits()
|
||||
{
|
||||
SetUserUnits( m_userUnits == EDA_UNITS::INCHES ? EDA_UNITS::MILLIMETRES : EDA_UNITS::INCHES );
|
||||
unitsChangeRefresh();
|
||||
if( m_toolManager->GetTool<COMMON_TOOLS>() )
|
||||
{
|
||||
TOOL_EVENT dummy;
|
||||
m_toolManager->GetTool<COMMON_TOOLS>()->ToggleUnits( dummy );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetUserUnits( m_userUnits == EDA_UNITS::INCHES ? EDA_UNITS::MILLIMETRES
|
||||
: EDA_UNITS::INCHES );
|
||||
unitsChangeRefresh();
|
||||
|
||||
wxCommandEvent e( UNITS_CHANGED );
|
||||
ProcessEventLocally( e );
|
||||
wxCommandEvent e( UNITS_CHANGED );
|
||||
ProcessEventLocally( e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -514,7 +523,7 @@ void EDA_DRAW_FRAME::AddStandardSubMenus( TOOL_MENU& aToolMenu )
|
||||
gridMenu->SetTool( commonTools );
|
||||
aToolMenu.AddSubMenu( gridMenu );
|
||||
|
||||
aMenu.AddMenu( zoomMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
|
||||
aMenu.AddMenu( zoomMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
|
||||
aMenu.AddMenu( gridMenu.get(), SELECTION_CONDITIONS::ShowAlways, 1000 );
|
||||
}
|
||||
|
||||
@@ -979,18 +988,22 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
|
||||
wxString prompt = doOpen ? _( "Select Library" ) : _( "New Library" );
|
||||
aFilename.SetExt( ext );
|
||||
|
||||
wxString dir = aGlobalPath;
|
||||
wxString dir;
|
||||
|
||||
if( GetMruPath().IsEmpty() )
|
||||
dir = aGlobalPath;
|
||||
else
|
||||
dir = GetMruPath();
|
||||
|
||||
|
||||
if( isDirectory && doOpen )
|
||||
{
|
||||
if( !aIsGlobal )
|
||||
if( !aIsGlobal && GetMruPath().IsEmpty() )
|
||||
{
|
||||
dir = Prj().GetProjectPath();
|
||||
}
|
||||
|
||||
wxDirDialog dlg( this, prompt, dir,
|
||||
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
wxDirDialog dlg( this, prompt, dir, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
|
||||
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return false;
|
||||
@@ -1004,7 +1017,7 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
|
||||
if( aFilename.GetName().empty() )
|
||||
aFilename.SetName( "Library" );
|
||||
|
||||
if( !aIsGlobal )
|
||||
if( !aIsGlobal && GetMruPath().IsEmpty() )
|
||||
{
|
||||
dir = Prj().IsNullProject() ? aFilename.GetFullPath() : Prj().GetProjectPath();
|
||||
}
|
||||
@@ -1020,6 +1033,8 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename,
|
||||
aFilename.SetExt( ext );
|
||||
}
|
||||
|
||||
SetMruPath( aFilename.GetPath() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void EDA_SHAPE::calcEdit( const wxPoint& aPosition )
|
||||
}
|
||||
|
||||
|
||||
void EDA_SHAPE::endEdit()
|
||||
void EDA_SHAPE::endEdit( bool aClosed )
|
||||
{
|
||||
switch( GetShape() )
|
||||
{
|
||||
@@ -1407,7 +1407,7 @@ void EDA_SHAPE::endEdit()
|
||||
{
|
||||
if( poly.CPoint( poly.GetPointCount() - 2 ) == poly.CLastPoint() )
|
||||
{
|
||||
poly.SetClosed( true );
|
||||
poly.SetClosed( aClosed );
|
||||
poly.Remove( poly.GetPointCount() - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,8 @@ wxColour COLOR4D::ToColour() const
|
||||
return colour;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
COLOR4D COLOR4D::LegacyMix( const COLOR4D& aColor ) const
|
||||
{
|
||||
@@ -237,8 +239,6 @@ void COLOR4D::FromU32( unsigned int aPackedColor )
|
||||
a = c.Alpha() / 255.0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace KIGFX {
|
||||
|
||||
|
||||
@@ -204,8 +204,10 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
|
||||
m_cachedManager( nullptr ),
|
||||
m_nonCachedManager( nullptr ),
|
||||
m_overlayManager( nullptr ),
|
||||
m_tempManager( nullptr ),
|
||||
m_mainBuffer( 0 ),
|
||||
m_overlayBuffer( 0 ),
|
||||
m_tempBuffer( 0 ),
|
||||
m_isContextLocked( false ),
|
||||
m_lockClientCookie( 0 )
|
||||
{
|
||||
@@ -300,6 +302,7 @@ OPENGL_GAL::~OPENGL_GAL()
|
||||
delete m_cachedManager;
|
||||
delete m_nonCachedManager;
|
||||
delete m_overlayManager;
|
||||
delete m_tempManager;
|
||||
}
|
||||
|
||||
GL_CONTEXT_MANAGER::Get().UnlockCtx( m_glPrivContext );
|
||||
@@ -442,6 +445,7 @@ void OPENGL_GAL::BeginDrawing()
|
||||
// Prepare rendering target buffers
|
||||
m_compositor->Initialize();
|
||||
m_mainBuffer = m_compositor->CreateBuffer();
|
||||
m_tempBuffer = m_compositor->CreateBuffer();
|
||||
try
|
||||
{
|
||||
m_overlayBuffer = m_compositor->CreateBuffer();
|
||||
@@ -493,10 +497,12 @@ void OPENGL_GAL::BeginDrawing()
|
||||
// Remove all previously stored items
|
||||
m_nonCachedManager->Clear();
|
||||
m_overlayManager->Clear();
|
||||
m_tempManager->Clear();
|
||||
|
||||
m_cachedManager->BeginDrawing();
|
||||
m_nonCachedManager->BeginDrawing();
|
||||
m_overlayManager->BeginDrawing();
|
||||
m_tempManager->BeginDrawing();
|
||||
|
||||
if( !m_isBitmapFontInitialized )
|
||||
{
|
||||
@@ -1705,6 +1711,7 @@ void OPENGL_GAL::SetTarget( RENDER_TARGET aTarget )
|
||||
case TARGET_CACHED: m_currentManager = m_cachedManager; break;
|
||||
case TARGET_NONCACHED: m_currentManager = m_nonCachedManager; break;
|
||||
case TARGET_OVERLAY: m_currentManager = m_overlayManager; break;
|
||||
case TARGET_TEMP: m_currentManager = m_tempManager; break;
|
||||
}
|
||||
|
||||
m_currentTarget = aTarget;
|
||||
@@ -1731,6 +1738,10 @@ void OPENGL_GAL::ClearTarget( RENDER_TARGET aTarget )
|
||||
m_compositor->SetBuffer( m_mainBuffer );
|
||||
break;
|
||||
|
||||
case TARGET_TEMP:
|
||||
m_compositor->SetBuffer( m_tempBuffer );
|
||||
break;
|
||||
|
||||
case TARGET_OVERLAY:
|
||||
if( m_overlayBuffer )
|
||||
m_compositor->SetBuffer( m_overlayBuffer );
|
||||
@@ -1752,6 +1763,7 @@ bool OPENGL_GAL::HasTarget( RENDER_TARGET aTarget )
|
||||
switch( aTarget )
|
||||
{
|
||||
default:
|
||||
case TARGET_TEMP:
|
||||
case TARGET_CACHED:
|
||||
case TARGET_NONCACHED: return true;
|
||||
case TARGET_OVERLAY: return ( m_overlayBuffer != 0 );
|
||||
@@ -1762,14 +1774,18 @@ bool OPENGL_GAL::HasTarget( RENDER_TARGET aTarget )
|
||||
void OPENGL_GAL::StartDiffLayer()
|
||||
{
|
||||
m_currentManager->EndDrawing();
|
||||
SetTarget( TARGET_TEMP );
|
||||
ClearTarget( TARGET_TEMP );
|
||||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::EndDiffLayer()
|
||||
{
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||
glBlendEquation( GL_MAX );
|
||||
m_currentManager->EndDrawing();
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
glBlendEquation( GL_FUNC_ADD );
|
||||
|
||||
m_compositor->DrawBuffer( m_tempBuffer, m_mainBuffer );
|
||||
}
|
||||
|
||||
|
||||
@@ -2296,11 +2312,13 @@ void OPENGL_GAL::init()
|
||||
m_cachedManager = new VERTEX_MANAGER( true );
|
||||
m_nonCachedManager = new VERTEX_MANAGER( false );
|
||||
m_overlayManager = new VERTEX_MANAGER( false );
|
||||
m_tempManager = new VERTEX_MANAGER( false );
|
||||
|
||||
// Make VBOs use shaders
|
||||
m_cachedManager->SetShader( *m_shader );
|
||||
m_nonCachedManager->SetShader( *m_shader );
|
||||
m_overlayManager->SetShader( *m_shader );
|
||||
m_tempManager->SetShader( *m_shader );
|
||||
|
||||
m_isInitialized = true;
|
||||
}
|
||||
|
||||
@@ -63,30 +63,35 @@ static const struct
|
||||
{ "GRAY3", 9 },
|
||||
{ "WHITE", 7 },
|
||||
{ "LYELLOW", 51 },
|
||||
{ "LORANGE", 41 },
|
||||
{ "BLUE1", 178 },
|
||||
{ "GREEN1", 98 },
|
||||
{ "CYAN1", 138 },
|
||||
{ "RED1", 18 },
|
||||
{ "MAGENTA1", 228 },
|
||||
{ "BROWN1", 58 },
|
||||
{ "ORANGE1", 34 },
|
||||
{ "BLUE2", 5 },
|
||||
{ "GREEN2", 3 },
|
||||
{ "CYAN2", 4 },
|
||||
{ "RED2", 1 },
|
||||
{ "MAGENTA2", 6 },
|
||||
{ "BROWN2", 54 },
|
||||
{ "ORANGE2", 42 },
|
||||
{ "BLUE3", 171 },
|
||||
{ "GREEN3", 91 },
|
||||
{ "CYAN3", 131 },
|
||||
{ "RED3", 11 },
|
||||
{ "MAGENTA3", 221 },
|
||||
{ "YELLOW3", 2 },
|
||||
{ "ORANGE3", 32 },
|
||||
{ "BLUE4", 5 },
|
||||
{ "GREEN4", 3 },
|
||||
{ "CYAN4", 4 },
|
||||
{ "RED4", 1 },
|
||||
{ "MAGENTA4", 6 },
|
||||
{ "YELLOW4", 2 }
|
||||
{ "YELLOW4", 2 },
|
||||
{ "ORANGE4", 40 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -235,16 +235,22 @@ bool PROJECT_FILE::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
fromLegacy<int>( aCfg, "SubpartIdSeparator", "schematic.subpart_id_separator" );
|
||||
fromLegacy<int>( aCfg, "SubpartFirstId", "schematic.subpart_first_id" );
|
||||
|
||||
fromLegacy<int>( aCfg, "LineThickness", "schematic.drawing.default_line_thickness" );
|
||||
fromLegacy<int>( aCfg, "WireThickness", "schematic.drawing.default_wire_thickness" );
|
||||
fromLegacy<int>( aCfg, "BusThickness", "schematic.drawing.default_bus_thickness" );
|
||||
fromLegacy<int>( aCfg, "LabSize", "schematic.drawing.default_text_size" );
|
||||
fromLegacy<int>( aCfg, "PinSymbolSize", "schematic.drawing.pin_symbol_size" );
|
||||
fromLegacy<int>( aCfg, "JunctionSize", "schematic.drawing.default_junction_size" );
|
||||
fromLegacy<int>( aCfg, "LineThickness", "schematic.drawing.default_line_thickness" );
|
||||
fromLegacy<int>( aCfg, "WireThickness", "schematic.drawing.default_wire_thickness" );
|
||||
fromLegacy<int>( aCfg, "BusThickness", "schematic.drawing.default_bus_thickness" );
|
||||
fromLegacy<int>( aCfg, "LabSize", "schematic.drawing.default_text_size" );
|
||||
|
||||
fromLegacyString( aCfg, "FieldNameTemplates", "schematic.drawing.field_names" );
|
||||
if( !fromLegacy<int>( aCfg, "PinSymbolSize", "schematic.drawing.pin_symbol_size" ) )
|
||||
{
|
||||
// Use the default symbol size algorithm of Eeschema V5 (based on pin name/number size)
|
||||
Set( "schematic.drawing.pin_symbol_size", 0 );
|
||||
}
|
||||
|
||||
if( !fromLegacy<double>( aCfg, "TextOffsetRatio", "schematic.drawing.text_offset_ratio" ) )
|
||||
fromLegacy<int>( aCfg, "JunctionSize", "schematic.drawing.default_junction_size" );
|
||||
|
||||
fromLegacyString( aCfg, "FieldNameTemplates", "schematic.drawing.field_names" );
|
||||
|
||||
if( !fromLegacy<double>( aCfg, "TextOffsetRatio", "schematic.drawing.text_offset_ratio" ) )
|
||||
{
|
||||
// Use the spacing of Eeschema V5
|
||||
Set( "schematic.drawing.text_offset_ratio", 0.08 );
|
||||
|
||||
@@ -867,6 +867,8 @@ bool SETTINGS_MANAGER::LoadProject( const wxString& aFullPath, bool aSetActive )
|
||||
|
||||
if( aSetActive )
|
||||
settings = RegisterSettings( settings );
|
||||
else
|
||||
settings->LoadFromFile( path.GetPath() );
|
||||
|
||||
m_projects[fullPath]->setLocalSettings( settings );
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ typedef long time_t;
|
||||
|
||||
// Contains VECTOR2I
|
||||
%include math.i
|
||||
%template(VECTOR_VECTOR2I) std::vector<VECTOR2I>;
|
||||
|
||||
// ignore warning from nested classes
|
||||
#pragma SWIG nowarn=325
|
||||
@@ -174,6 +175,7 @@ typedef long time_t;
|
||||
#include <utf8.h>
|
||||
%include <utf8.h>
|
||||
|
||||
|
||||
%extend UTF8
|
||||
{
|
||||
const char* Cast_to_CChar() { return (self->c_str()); }
|
||||
|
||||
@@ -34,3 +34,35 @@
|
||||
#include <math/vector2d.h>
|
||||
%include <math/vector2d.h>
|
||||
%template(VECTOR2I) VECTOR2<int>;
|
||||
|
||||
%extend VECTOR2<int>
|
||||
{
|
||||
void Set(long x, long y) { self->x = x; self->y = y; }
|
||||
|
||||
PyObject* Get()
|
||||
{
|
||||
PyObject* tup = PyTuple_New(2);
|
||||
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x));
|
||||
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y));
|
||||
return tup;
|
||||
}
|
||||
|
||||
%pythoncode
|
||||
%{
|
||||
def __eq__(self,other): return (self.x==other.x and self.y==other.y)
|
||||
def __ne__(self,other): return not (self==other)
|
||||
def __str__(self): return str(self.Get())
|
||||
def __repr__(self): return 'VECTOR2I'+str(self.Get())
|
||||
def __len__(self): return len(self.Get())
|
||||
def __getitem__(self, index): return self.Get()[index]
|
||||
def __setitem__(self, index, val):
|
||||
if index == 0:
|
||||
self.x = val
|
||||
elif index == 1:
|
||||
self.y = val
|
||||
else:
|
||||
raise IndexError
|
||||
def __nonzero__(self): return self.Get() != (0,0)
|
||||
|
||||
%}
|
||||
}
|
||||
|
||||
+5
-11
@@ -679,19 +679,13 @@ void VIEW::ReorderLayerData( std::unordered_map<int, int> aReorderMap )
|
||||
std::vector<VIEW_LAYER> new_map;
|
||||
new_map.reserve( m_layers.size() );
|
||||
|
||||
for( int ii = 0; ii < VIEW_MAX_LAYERS; ++ii )
|
||||
new_map.emplace_back();
|
||||
|
||||
for( const VIEW_LAYER& layer : m_layers )
|
||||
new_map.push_back( layer );
|
||||
|
||||
for( auto& pair : aReorderMap )
|
||||
{
|
||||
int orig_idx = layer.id;
|
||||
int new_idx = orig_idx;
|
||||
|
||||
if( aReorderMap.count( orig_idx ) )
|
||||
new_idx = aReorderMap.at( orig_idx );
|
||||
|
||||
new_map[new_idx] = layer;
|
||||
new_map[new_idx].id = new_idx;
|
||||
new_map[pair.second] = m_layers[pair.first];
|
||||
new_map[pair.second].id = pair.second;
|
||||
}
|
||||
|
||||
m_layers = new_map;
|
||||
|
||||
@@ -46,12 +46,13 @@ set( CVPCB_SRCS
|
||||
tools/cvpcb_fpviewer_selection_tool.cpp
|
||||
)
|
||||
|
||||
|
||||
if( MINGW )
|
||||
# CVPCB_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( cvpcb )
|
||||
else()
|
||||
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# CVPCB_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( cvpcb-dll )
|
||||
else()
|
||||
set( CVPCB_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/cvpcb-dll.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -60,6 +61,7 @@ add_library( cvpcb_kiface MODULE
|
||||
cvpcb.cpp
|
||||
${CVPCB_SRCS}
|
||||
${CVPCB_DIALOGS}
|
||||
${CVPCB_RESOURCES}
|
||||
)
|
||||
|
||||
set_target_properties( cvpcb_kiface PROPERTIES
|
||||
|
||||
@@ -419,8 +419,11 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
|
||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
|
||||
// of available footprints which match the filter
|
||||
|
||||
long pos = m_tcFilterString->GetInsertionPoint();
|
||||
wxListEvent l_event;
|
||||
OnSelectComponent( l_event );
|
||||
m_tcFilterString->SetFocus();
|
||||
m_tcFilterString->SetInsertionPoint( pos );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class testundoredo1(ActionPlugin):
|
||||
for track in pcb.GetTracks():
|
||||
pcb.RemoveNative(track)
|
||||
|
||||
for draw in pcb.m_Drawings:
|
||||
for draw in pcb.GetDrawings():
|
||||
pcb.RemoveNative(draw)
|
||||
|
||||
|
||||
@@ -83,15 +83,15 @@ class testundoredo2(ActionPlugin):
|
||||
footprint.Add(pad_s0)
|
||||
footprint.Add(pad_s1)
|
||||
|
||||
e = EDGE_MODULE(footprint)
|
||||
e = FP_SHAPE(footprint)
|
||||
e.SetStart0(wxPointMM(-1,0))
|
||||
e.SetEnd0(wxPointMM(0,0))
|
||||
e.SetWidth(FromMM(0.2))
|
||||
e.SetLayer(F_SilkS)
|
||||
e.SetShape(S_SEGMENT)
|
||||
module.Add(e)
|
||||
module.SetPosition(wxPointMM(random.randint(20,200),random.randint(20,150)))
|
||||
return module
|
||||
footprint.Add(e)
|
||||
footprint.SetPosition(wxPointMM(random.randint(20,200),random.randint(20,150)))
|
||||
return footprint
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class testundoredo2(ActionPlugin):
|
||||
random.seed()
|
||||
|
||||
for i in range(10):
|
||||
seg = DRAWSEGMENT()
|
||||
seg = PCB_SHAPE()
|
||||
seg.SetLayer( random.choice([Edge_Cuts,Cmts_User,Eco1_User,Eco2_User]) )
|
||||
seg.SetStart( wxPointMM( random.randint(10,100),
|
||||
random.randint(10,100) ) )
|
||||
@@ -109,11 +109,11 @@ class testundoredo2(ActionPlugin):
|
||||
self.pcb.Add( seg )
|
||||
|
||||
if i%2 == 0:
|
||||
t = TRACK(None)
|
||||
t = PCB_TRACK(None)
|
||||
else:
|
||||
t = VIA(None)
|
||||
t = PCB_VIA(None)
|
||||
#t.SetLayerPair(segments['layerPair'][0],segments['layerPair'][1])
|
||||
t.SetViaType(VIA_THROUGH)
|
||||
t.SetViaType(VIATYPE_THROUGH)
|
||||
t.SetDrill(FromMM(random.randint(1,20)/10.0))
|
||||
t.SetStart(wxPointMM(random.randint(100,150),random.randint(100,150)))
|
||||
t.SetEnd(wxPointMM(random.randint(100,150),random.randint(100,150)))
|
||||
@@ -121,7 +121,7 @@ class testundoredo2(ActionPlugin):
|
||||
t.SetLayer(random.choice([F_Cu,B_Cu]))
|
||||
self.pcb.Add(t)
|
||||
|
||||
self.createFPCXModule(random.randint(2,40))
|
||||
self.createFPCXFootprint(random.randint(2,40))
|
||||
|
||||
|
||||
class testundoredo3(ActionPlugin):
|
||||
@@ -138,15 +138,15 @@ class testundoredo3(ActionPlugin):
|
||||
area = pcb.GetArea(i)
|
||||
area.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
|
||||
|
||||
for module in pcb.GetFootprints():
|
||||
module.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
|
||||
for footprint in pcb.GetFootprints():
|
||||
footprint.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
|
||||
if random.randint(0,10) > 5:
|
||||
module.Flip(module.GetPosition())
|
||||
footprint.Flip(footprint.GetPosition(), True)
|
||||
|
||||
for track in pcb.GetTracks():
|
||||
track.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
|
||||
|
||||
for draw in pcb.m_Drawings:
|
||||
for draw in pcb.GetDrawings():
|
||||
draw.Move(wxPointMM(random.randint(-20,20),random.randint(-20,20)))
|
||||
|
||||
|
||||
|
||||
@@ -119,7 +119,9 @@
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"track_widths": [
|
||||
0.0
|
||||
0.0,
|
||||
0.2,
|
||||
0.5
|
||||
],
|
||||
"via_dimensions": [
|
||||
{
|
||||
|
||||
+11
-6
@@ -299,12 +299,13 @@ if( KICAD_SPICE )
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if( MINGW )
|
||||
# EESCHEMA_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( eeschema )
|
||||
else()
|
||||
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# EESCHEMA_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( eeschema )
|
||||
else()
|
||||
set( EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/eeschema.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Create a C++ compilable string initializer containing markdown text into a *.h file:
|
||||
@@ -481,6 +482,10 @@ if( APPLE )
|
||||
DESTINATION "${OSX_BUNDLE_INSTALL_PLUGIN_DIR}/sim" )
|
||||
endif()
|
||||
else()
|
||||
if( MSVC )
|
||||
target_sources( eeschema_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/eeschema-dll.rc )
|
||||
endif()
|
||||
|
||||
install( TARGETS eeschema
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
|
||||
@@ -268,7 +268,7 @@ bool SCH_EDIT_FRAME::SchematicCleanUp( SCH_SCREEN* aScreen )
|
||||
|
||||
AddToScreen( mergedLine, aScreen );
|
||||
|
||||
if( firstLine->IsSelected() )
|
||||
if( firstLine->IsSelected() || secondLine->IsSelected() )
|
||||
selectionTool->AddItemToSel( mergedLine, true /*quiet mode*/ );
|
||||
|
||||
break;
|
||||
|
||||
@@ -32,18 +32,19 @@
|
||||
#include <bom_plugins.h>
|
||||
#include <confirm.h>
|
||||
#include <dialog_bom_base.h>
|
||||
#include <string_utils.h>
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <gestfich.h>
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <i18n_utility.h> // for _HKI definition used in dialog_bom_help_md.h
|
||||
#include <invoke_sch_dialog.h>
|
||||
#include <kiface_base.h>
|
||||
#include <netlist.h>
|
||||
#include <netlist_exporter_xml.h>
|
||||
#include <paths.h>
|
||||
#include <pgm_base.h>
|
||||
#include <reporter.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <paths.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/log.h>
|
||||
@@ -343,7 +344,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event )
|
||||
#endif
|
||||
|
||||
if( m_parent->ReadyToNetlist( _( "Generating BOM requires a fully annotated schematic." ) ) )
|
||||
m_parent->WriteNetListFile( -1, fullfilename, GNL_OPT_BOM, &reporter );
|
||||
m_parent->WriteNetListFile( NET_TYPE_BOM, fullfilename, GNL_OPT_BOM, &reporter );
|
||||
|
||||
m_Messages->SetValue( reportmsg );
|
||||
|
||||
|
||||
@@ -675,15 +675,22 @@ void DIALOG_ERC::NextMarker()
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_ERC::ExcludeMarker()
|
||||
void DIALOG_ERC::ExcludeMarker( SCH_MARKER* aMarker )
|
||||
{
|
||||
SCH_MARKER* marker = aMarker;
|
||||
|
||||
if( marker != nullptr )
|
||||
m_markerTreeModel->SelectMarker( marker );
|
||||
|
||||
if( m_notebook->GetSelection() != 1 )
|
||||
return;
|
||||
|
||||
RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( m_markerDataView->GetCurrentItem() );
|
||||
SCH_MARKER* marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() );
|
||||
|
||||
if( marker && !marker->IsExcluded() )
|
||||
if( node && node->m_RcItem )
|
||||
marker = dynamic_cast<SCH_MARKER*>( node->m_RcItem->GetParent() );
|
||||
|
||||
if( node && marker && !marker->IsExcluded() )
|
||||
{
|
||||
marker->SetExcluded( true );
|
||||
m_parent->GetCanvas()->GetView()->Update( marker );
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#define DIALOG_ERC_WINDOW_NAME "DialogErcWindowName"
|
||||
|
||||
|
||||
class SCH_MARKER;
|
||||
|
||||
|
||||
class DIALOG_ERC : public DIALOG_ERC_BASE, PROGRESS_REPORTER_BASE
|
||||
{
|
||||
public:
|
||||
@@ -50,7 +53,14 @@ public:
|
||||
|
||||
void PrevMarker();
|
||||
void NextMarker();
|
||||
void ExcludeMarker();
|
||||
|
||||
/**
|
||||
* Exclude aMarker from the ERC list. If aMarker is nullptr, exclude the selected marker
|
||||
* in this dialog.
|
||||
*
|
||||
* @param aMarker aMarker to exclude
|
||||
*/
|
||||
void ExcludeMarker( SCH_MARKER* aMarker = nullptr );
|
||||
|
||||
void UpdateAnnotationWarning();
|
||||
|
||||
|
||||
@@ -37,10 +37,27 @@
|
||||
class PIN_TABLE_DATA_MODEL : public wxGridTableBase
|
||||
{
|
||||
public:
|
||||
PIN_TABLE_DATA_MODEL( EDA_UNITS aUserUnits ) : m_userUnits( aUserUnits ), m_edited( false )
|
||||
PIN_TABLE_DATA_MODEL( SYMBOL_EDIT_FRAME* aFrame ) :
|
||||
m_frame( aFrame ),
|
||||
m_edited( false )
|
||||
{
|
||||
m_frame->Bind( UNITS_CHANGED, &PIN_TABLE_DATA_MODEL::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
~PIN_TABLE_DATA_MODEL()
|
||||
{
|
||||
m_frame->Unbind( UNITS_CHANGED, &PIN_TABLE_DATA_MODEL::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
void onUnitsChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( GetView() )
|
||||
GetView()->ForceRefresh();
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
||||
int GetNumberRows() override { return (int) m_rows.size(); }
|
||||
int GetNumberCols() override { return COL_COUNT; }
|
||||
|
||||
@@ -70,7 +87,7 @@ public:
|
||||
|
||||
wxString GetValue( int aRow, int aCol ) override
|
||||
{
|
||||
return GetValue( m_rows[ aRow ], aCol, m_userUnits );
|
||||
return GetValue( m_rows[ aRow ], aCol, m_frame->GetUserUnits() );
|
||||
}
|
||||
|
||||
static wxString GetValue( const LIB_PINS& pins, int aCol, EDA_UNITS aUserUnits )
|
||||
@@ -109,13 +126,13 @@ public:
|
||||
val = StringFromValue( aUserUnits, pin->GetNameTextSize(), true );
|
||||
break;
|
||||
case COL_LENGTH:
|
||||
val = StringFromValue( aUserUnits, pin->GetLength() );
|
||||
val = StringFromValue( aUserUnits, pin->GetLength(), true );
|
||||
break;
|
||||
case COL_POSX:
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().x );
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().x, true );
|
||||
break;
|
||||
case COL_POSY:
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().y );
|
||||
val = StringFromValue( aUserUnits, pin->GetPosition().y, true );
|
||||
break;
|
||||
case COL_VISIBLE:
|
||||
val = StringFromBool( pin->IsVisible() );
|
||||
@@ -181,25 +198,25 @@ public:
|
||||
break;
|
||||
|
||||
case COL_NUMBER_SIZE:
|
||||
pin->SetNumberTextSize( ValueFromString( m_userUnits, aValue ) );
|
||||
pin->SetNumberTextSize( ValueFromString( m_frame->GetUserUnits(), aValue ) );
|
||||
break;
|
||||
|
||||
case COL_NAME_SIZE:
|
||||
pin->SetNameTextSize( ValueFromString( m_userUnits, aValue ) );
|
||||
pin->SetNameTextSize( ValueFromString( m_frame->GetUserUnits(), aValue ) );
|
||||
break;
|
||||
|
||||
case COL_LENGTH:
|
||||
pin->SetLength( ValueFromString( m_userUnits, aValue ) );
|
||||
pin->SetLength( ValueFromString( m_frame->GetUserUnits(), aValue ) );
|
||||
break;
|
||||
|
||||
case COL_POSX:
|
||||
pin->SetPosition( wxPoint( ValueFromString( m_userUnits, aValue ),
|
||||
pin->SetPosition( wxPoint( ValueFromString( m_frame->GetUserUnits(), aValue ),
|
||||
pin->GetPosition().y ) );
|
||||
break;
|
||||
|
||||
case COL_POSY:
|
||||
pin->SetPosition( wxPoint( pin->GetPosition().x,
|
||||
ValueFromString( m_userUnits, aValue ) ) );
|
||||
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
|
||||
break;
|
||||
|
||||
case COL_VISIBLE:
|
||||
@@ -332,7 +349,7 @@ public:
|
||||
std::sort( m_rows.begin(), m_rows.end(),
|
||||
[ aSortCol, ascending, this ]( const LIB_PINS& lhs, const LIB_PINS& rhs ) -> bool
|
||||
{
|
||||
return compare( lhs, rhs, aSortCol, ascending, m_userUnits );
|
||||
return compare( lhs, rhs, aSortCol, ascending, m_frame->GetUserUnits() );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -406,13 +423,15 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
SYMBOL_EDIT_FRAME* m_frame;
|
||||
|
||||
// Because the rows of the grid can either be a single pin or a group of pins, the
|
||||
// data model is a 2D vector. If we're in the single pin case, each row's LIB_PINS
|
||||
// contains only a single pin.
|
||||
std::vector<LIB_PINS> m_rows;
|
||||
|
||||
EDA_UNITS m_userUnits;
|
||||
bool m_edited;
|
||||
bool m_edited;
|
||||
};
|
||||
|
||||
|
||||
@@ -422,7 +441,7 @@ DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE( SYMBOL_EDIT_FRAME* parent,
|
||||
m_editFrame( parent ),
|
||||
m_part( aSymbol )
|
||||
{
|
||||
m_dataModel = new PIN_TABLE_DATA_MODEL( GetUserUnits() );
|
||||
m_dataModel = new PIN_TABLE_DATA_MODEL( m_editFrame );
|
||||
|
||||
// Save original columns widths so we can do proportional sizing.
|
||||
for( int i = 0; i < COL_COUNT; ++i )
|
||||
|
||||
@@ -56,22 +56,22 @@ DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP( SCH_EDIT_FRAME* aFrame ) :
|
||||
|
||||
m_textVars = new PANEL_TEXT_VARIABLES( m_treebook, &Prj() );
|
||||
|
||||
m_netclasses = new PANEL_SETUP_NETCLASSES( this, &project.NetSettings().m_NetClasses,
|
||||
m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, &project.NetSettings().m_NetClasses,
|
||||
schematic.GetNetClassAssignmentCandidates(), true );
|
||||
|
||||
/*
|
||||
* WARNING: If you change page names you MUST update calls to ShowSchematicSetupDialog().
|
||||
*/
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "General" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "General" ) );
|
||||
m_treebook->AddSubPage( m_formatting, _( "Formatting" ) );
|
||||
m_treebook->AddSubPage( m_fieldNameTemplates, _( "Field Name Templates" ) );
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "Electrical Rules" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Electrical Rules" ) );
|
||||
m_treebook->AddSubPage( m_severities, _( "Violation Severity" ) );
|
||||
m_treebook->AddSubPage( m_pinMap, _( "Pin Conflicts Map" ) );
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "Project" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Project" ) );
|
||||
m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) );
|
||||
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2022 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
|
||||
@@ -123,8 +123,9 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataToGrid()
|
||||
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
|
||||
{
|
||||
m_grid->SetCellValue( row, 0, m_fields[row].m_Name );
|
||||
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxT( "1" ) : wxEmptyString );
|
||||
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? wxT( "1" ) : wxEmptyString );
|
||||
// columns 1 and 2 show a boolean value (in a check box):
|
||||
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? "1" : "0" );
|
||||
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? "1" : "0" );
|
||||
|
||||
// Set cell properties
|
||||
m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
|
||||
@@ -153,8 +154,8 @@ bool PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::TransferDataFromGrid()
|
||||
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
|
||||
{
|
||||
m_fields[row].m_Name = m_grid->GetCellValue( row, 0 );
|
||||
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) != wxEmptyString;
|
||||
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) != wxEmptyString;
|
||||
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == "1";
|
||||
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == "1";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -534,7 +534,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
if( aCfg->Read( key, &value ) )
|
||||
{
|
||||
std::string key_utf( key.ToUTF8() );
|
||||
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
|
||||
|
||||
try
|
||||
{
|
||||
js[key_utf] = value;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,7 +555,15 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
|
||||
if( aCfg->Read( key, &value ) )
|
||||
{
|
||||
std::string key_utf( key.ToUTF8() );
|
||||
js[JSON_SETTINGS_INTERNALS::PointerFromString( key_utf )] = value;
|
||||
|
||||
try
|
||||
{
|
||||
js[key_utf] = value;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
|
||||
WX_GRID* aGrid, LIB_SYMBOL* aSymbol ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_userUnits( aDialog->GetUserUnits() ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_SYMBOL_T ),
|
||||
m_mandatoryFieldCount( MANDATORY_FIELDS ),
|
||||
@@ -73,7 +72,6 @@ FIELDS_GRID_TABLE<T>::FIELDS_GRID_TABLE( DIALOG_SHIM* aDialog, SCH_BASE_FRAME* a
|
||||
WX_GRID* aGrid, SCH_SHEET* aSheet ) :
|
||||
m_frame( aFrame ),
|
||||
m_dialog( aDialog ),
|
||||
m_userUnits( aDialog->GetUserUnits() ),
|
||||
m_grid( aGrid ),
|
||||
m_parentType( SCH_SHEET_T ),
|
||||
m_mandatoryFieldCount( SHEET_MANDATORY_FIELDS ),
|
||||
@@ -170,6 +168,8 @@ void FIELDS_GRID_TABLE<T>::initGrid( WX_GRID* aGrid )
|
||||
m_orientationAttr = new wxGridCellAttr;
|
||||
m_orientationAttr->SetEditor( new wxGridCellChoiceEditor( orientationNames ) );
|
||||
m_orientationAttr->SetAlignment( wxALIGN_CENTER, wxALIGN_BOTTOM );
|
||||
|
||||
m_frame->Bind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
|
||||
@@ -188,6 +188,18 @@ FIELDS_GRID_TABLE<T>::~FIELDS_GRID_TABLE()
|
||||
m_vAlignAttr->DecRef();
|
||||
m_hAlignAttr->DecRef();
|
||||
m_orientationAttr->DecRef();
|
||||
|
||||
m_frame->Unbind( UNITS_CHANGED, &FIELDS_GRID_TABLE<T>::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void FIELDS_GRID_TABLE<T>::onUnitsChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
if( GetView() )
|
||||
GetView()->ForceRefresh();
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +428,7 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
|
||||
return StringFromBool( field.IsBold() );
|
||||
|
||||
case FDC_TEXT_SIZE:
|
||||
return StringFromValue( m_userUnits, field.GetTextSize().GetHeight() );
|
||||
return StringFromValue( m_frame->GetUserUnits(), field.GetTextSize().GetHeight(), true );
|
||||
|
||||
case FDC_ORIENTATION:
|
||||
switch ( (int) field.GetTextAngle() )
|
||||
@@ -428,10 +440,10 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
|
||||
break;
|
||||
|
||||
case FDC_POSX:
|
||||
return StringFromValue( m_userUnits, field.GetTextPos().x );
|
||||
return StringFromValue( m_frame->GetUserUnits(), field.GetTextPos().x, true );
|
||||
|
||||
case FDC_POSY:
|
||||
return StringFromValue( m_userUnits, field.GetTextPos().y );
|
||||
return StringFromValue( m_frame->GetUserUnits(), field.GetTextPos().y, true );
|
||||
|
||||
default:
|
||||
// we can't assert here because wxWidgets sometimes calls this without checking
|
||||
@@ -534,8 +546,8 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
|
||||
break;
|
||||
|
||||
case FDC_TEXT_SIZE:
|
||||
field.SetTextSize( wxSize( ValueFromString( m_userUnits, aValue ),
|
||||
ValueFromString( m_userUnits, aValue ) ) );
|
||||
field.SetTextSize( wxSize( ValueFromString( m_frame->GetUserUnits(), aValue ),
|
||||
ValueFromString( m_frame->GetUserUnits(), aValue ) ) );
|
||||
break;
|
||||
|
||||
case FDC_ORIENTATION:
|
||||
@@ -551,9 +563,9 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
|
||||
case FDC_POSY:
|
||||
pos = field.GetTextPos();
|
||||
if( aCol == FDC_POSX )
|
||||
pos.x = ValueFromString( m_userUnits, aValue );
|
||||
pos.x = ValueFromString( m_frame->GetUserUnits(), aValue );
|
||||
else
|
||||
pos.y = ValueFromString( m_userUnits, aValue );
|
||||
pos.y = ValueFromString( m_frame->GetUserUnits(), aValue );
|
||||
field.SetTextPos( pos );
|
||||
break;
|
||||
|
||||
|
||||
@@ -104,10 +104,11 @@ public:
|
||||
protected:
|
||||
void initGrid( WX_GRID* aGrid );
|
||||
|
||||
void onUnitsChanged( wxCommandEvent& aEvent );
|
||||
|
||||
private:
|
||||
SCH_BASE_FRAME* m_frame;
|
||||
DIALOG_SHIM* m_dialog;
|
||||
EDA_UNITS m_userUnits;
|
||||
WX_GRID* m_grid;
|
||||
KICAD_T m_parentType;
|
||||
int m_mandatoryFieldCount;
|
||||
|
||||
@@ -1417,7 +1417,7 @@ void SCH_EDIT_FRAME::CheckForAutoSaveFile( const wxFileName& aFileName )
|
||||
|
||||
// Attempt to back up the last schematic file before overwriting it with the auto
|
||||
// save file.
|
||||
if( !wxRenameFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
|
||||
if( !wxCopyFile( recoveredFn.GetFullPath(), backupFn.GetFullPath() ) )
|
||||
{
|
||||
unrecoveredFiles.Add( recoveredFn.GetFullPath() );
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ int HIERARCHY_TREE::OnCompareItems( const wxTreeItemId& item1, const wxTreeItemI
|
||||
SCH_SHEET_PATH* item1Path = &static_cast<TreeItemData*>( GetItemData( item1 ) )->m_SheetPath;
|
||||
SCH_SHEET_PATH* item2Path = &static_cast<TreeItemData*>( GetItemData( item2 ) )->m_SheetPath;
|
||||
|
||||
return item1Path->ComparePageNumAndName( *item2Path );
|
||||
return item1Path->ComparePageNum( *item2Path );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1036,6 +1036,8 @@ void LIB_PIN::Plot( PLOTTER* aPlotter, const wxPoint& aPffset, bool aFill,
|
||||
|
||||
void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
EDA_UNITS units = aFrame->GetUserUnits();
|
||||
|
||||
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
aList.emplace_back( _( "Name" ), UnescapeString( GetShownName() ) );
|
||||
@@ -1046,7 +1048,7 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
|
||||
aList.emplace_back( _( "Style" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
|
||||
|
||||
// Display pin length
|
||||
aList.emplace_back( _( "Length" ), StringFromValue( aFrame->GetUserUnits(), m_length ) );
|
||||
aList.emplace_back( _( "Length" ), MessageTextFromValue( units, m_length, true ) );
|
||||
|
||||
int i = PinOrientationIndex( m_orientation );
|
||||
aList.emplace_back( _( "Orientation" ), PinOrientationName( (unsigned) i ) );
|
||||
@@ -1054,8 +1056,8 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
|
||||
wxPoint pinpos = GetPosition();
|
||||
pinpos.y = -pinpos.y; // Display coords are top to bottom; lib item coords are bottom to top
|
||||
|
||||
aList.emplace_back( _( "Pos X" ), MessageTextFromValue( aFrame->GetUserUnits(), pinpos.x ) );
|
||||
aList.emplace_back( _( "Pos Y" ), MessageTextFromValue( aFrame->GetUserUnits(), pinpos.y ) );
|
||||
aList.emplace_back( _( "Pos X" ), MessageTextFromValue( units, pinpos.x, true ) );
|
||||
aList.emplace_back( _( "Pos Y" ), MessageTextFromValue( units, pinpos.y, true ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ public:
|
||||
void BeginEdit( const wxPoint& aStartPoint ) override { beginEdit( aStartPoint ); }
|
||||
bool ContinueEdit( const wxPoint& aPosition ) override { return continueEdit( aPosition ); }
|
||||
void CalcEdit( const wxPoint& aPosition ) override { calcEdit( aPosition ); }
|
||||
void EndEdit() override { endEdit(); }
|
||||
|
||||
void EndEdit() override { endEdit( false ); }
|
||||
void SetEditState( int aState ) { setEditState( aState ); }
|
||||
|
||||
void AddPoint( const wxPoint& aPosition );
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
/// netlist types
|
||||
enum NETLIST_TYPE_ID {
|
||||
NET_TYPE_UNINIT = 0,
|
||||
NET_TYPE_BOM, // Used by the BOM generator
|
||||
NET_TYPE_PCBNEW,
|
||||
NET_TYPE_ORCADPCB2,
|
||||
NET_TYPE_CADSTAR,
|
||||
|
||||
@@ -81,6 +81,15 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam
|
||||
helper = new NETLIST_EXPORTER_PSPICE( sch );
|
||||
break;
|
||||
|
||||
case NET_TYPE_BOM:
|
||||
// When generating the BOM, we have a bare filename so don't strip
|
||||
// the extension or you might string a '.' from the middle of the filename
|
||||
fileName += wxT( "." GENERIC_INTERMEDIATE_NETLIST_EXT );
|
||||
|
||||
helper = new NETLIST_EXPORTER_XML( sch );
|
||||
executeCommandLine = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
wxFileName tmpFile = fileName;
|
||||
|
||||
@@ -655,6 +655,16 @@ bool SCH_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
if( symbolViewer && !symbolViewer->Close() ) // Can close modal symbol viewer?
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto* symbolEditor = (SYMBOL_EDIT_FRAME*) Kiway().Player( FRAME_SCH_SYMBOL_EDITOR, false );
|
||||
|
||||
if( symbolEditor && symbolEditor->IsSymbolFromSchematic() )
|
||||
{
|
||||
if( !symbolEditor->CanCloseSymbolFromSchematic( true ) )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SIM_PLOT_FRAME* simFrame = (SIM_PLOT_FRAME*) Kiway().Player( FRAME_SIMULATOR, false );
|
||||
|
||||
|
||||
@@ -1251,7 +1251,7 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
|
||||
float width = getLineWidth( aLine, drawingShadows );
|
||||
PLOT_DASH_TYPE lineStyle = aLine->GetEffectiveLineStyle();
|
||||
|
||||
if( drawingDangling )
|
||||
if( drawingDangling || drawingShadows )
|
||||
{
|
||||
if( aLine->IsStartDangling() && aLine->IsWire() )
|
||||
{
|
||||
@@ -1265,7 +1265,8 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
|
||||
getLineWidth( aLine, drawingShadows ), drawingShadows );
|
||||
}
|
||||
|
||||
return;
|
||||
if( drawingDangling )
|
||||
return;
|
||||
}
|
||||
|
||||
m_gal->SetIsStroke( true );
|
||||
|
||||
@@ -188,7 +188,8 @@ wxString SCH_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
|
||||
void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
|
||||
{
|
||||
wxString msg;
|
||||
EDA_UNITS units = aFrame->GetUserUnits();
|
||||
wxString msg;
|
||||
|
||||
aList.emplace_back( _( "Type" ), _( "Pin" ) );
|
||||
|
||||
@@ -215,7 +216,7 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
|
||||
|
||||
aList.emplace_back( _( "Visible" ), IsVisible() ? _( "Yes" ) : _( "No" ) );
|
||||
|
||||
aList.emplace_back( _( "Length" ), StringFromValue( aFrame->GetUserUnits(), GetLength() ) );
|
||||
aList.emplace_back( _( "Length" ), MessageTextFromValue( units, GetLength() ), true );
|
||||
|
||||
int i = PinOrientationIndex( GetOrientation() );
|
||||
aList.emplace_back( _( "Orientation" ), PinOrientationName( (unsigned) i ) );
|
||||
|
||||
@@ -1325,7 +1325,10 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
|
||||
symbol->SetLibId( libId );
|
||||
symbol->SetUnit( unit );
|
||||
symbol->SetPosition( wxPoint( einstance.x.ToSchUnits(), -einstance.y.ToSchUnits() ) );
|
||||
symbol->GetField( FOOTPRINT_FIELD )->SetText( package );
|
||||
|
||||
// assume that footprint library is identical to project name
|
||||
wxString packageString = m_schematic->Prj().GetProjectName() + wxT( ":" ) + package;
|
||||
symbol->GetField( FOOTPRINT_FIELD )->SetText( packageString );
|
||||
|
||||
if( einstance.rot )
|
||||
{
|
||||
@@ -1579,6 +1582,10 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
|
||||
if( gates_count == 1 && ispower )
|
||||
libSymbol->SetPower();
|
||||
|
||||
// assume that footprint library is identical to project name
|
||||
wxString packageString = m_schematic->Prj().GetProjectName() + wxT( ":" ) + aEagleLibrary->package[symbolName];
|
||||
libSymbol->GetFootprintField().SetText( packageString );
|
||||
|
||||
wxString name = libSymbol->GetName();
|
||||
libSymbol->SetName( name );
|
||||
m_pi->SaveSymbol( getLibFileName().GetFullPath(), new LIB_SYMBOL( *libSymbol.get() ),
|
||||
|
||||
@@ -162,14 +162,13 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF
|
||||
wxString name;
|
||||
wxString error;
|
||||
LIB_ITEM* item;
|
||||
LIB_FIELD* field;
|
||||
std::unique_ptr<LIB_SYMBOL> symbol = std::make_unique<LIB_SYMBOL>( wxEmptyString );
|
||||
std::set<int> fieldIDsRead;
|
||||
|
||||
m_requiredVersion = aFileVersion;
|
||||
symbol->SetUnitCount( 1 );
|
||||
|
||||
m_fieldId = MANDATORY_FIELDS;
|
||||
m_fieldIDsRead.clear();
|
||||
|
||||
token = NextTok();
|
||||
|
||||
@@ -232,29 +231,7 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF
|
||||
break;
|
||||
|
||||
case T_property:
|
||||
field = parseProperty( symbol );
|
||||
|
||||
if( field )
|
||||
{
|
||||
// Due to an bug when in #LIB_SYMBOL::Flatten, duplicate ids slipped through
|
||||
// when writing files. This section replaces duplicate #LIB_FIELD indices on
|
||||
// load.
|
||||
if( fieldIDsRead.count( field->GetId() ) )
|
||||
{
|
||||
int nextAvailableId = field->GetId() + 1;
|
||||
|
||||
while( fieldIDsRead.count( nextAvailableId ) )
|
||||
nextAvailableId += 1;
|
||||
|
||||
fieldIDsRead.insert( nextAvailableId );
|
||||
field->SetId( nextAvailableId );
|
||||
}
|
||||
else if( field )
|
||||
{
|
||||
fieldIDsRead.insert( field->GetId() );
|
||||
}
|
||||
}
|
||||
|
||||
parseProperty( symbol );
|
||||
break;
|
||||
|
||||
case T_extends:
|
||||
@@ -836,6 +813,19 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
|
||||
}
|
||||
}
|
||||
|
||||
// Due to an bug when in #LIB_SYMBOL::Flatten, duplicate ids slipped through
|
||||
// when writing files. This section replaces duplicate #LIB_FIELD indices on
|
||||
// load.
|
||||
if( m_fieldIDsRead.count( field->GetId() ) )
|
||||
{
|
||||
int nextAvailableId = field->GetId() + 1;
|
||||
|
||||
while( m_fieldIDsRead.count( nextAvailableId ) )
|
||||
nextAvailableId += 1;
|
||||
|
||||
field->SetId( nextAvailableId );
|
||||
}
|
||||
|
||||
LIB_FIELD* existingField;
|
||||
|
||||
if( field->GetId() < MANDATORY_FIELDS )
|
||||
@@ -843,6 +833,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
|
||||
existingField = aSymbol->GetFieldById( field->GetId() );
|
||||
|
||||
*existingField = *field;
|
||||
m_fieldIDsRead.insert( field->GetId() );
|
||||
return existingField;
|
||||
}
|
||||
else if( name == "ki_keywords" )
|
||||
@@ -908,6 +899,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
|
||||
if( !existingField )
|
||||
{
|
||||
aSymbol->AddDrawItem( field.get(), false );
|
||||
m_fieldIDsRead.insert( field->GetId() );
|
||||
return field.release();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -81,6 +81,9 @@ class SCH_SEXPR_PARSER : public SCHEMATIC_LEXER
|
||||
int m_convert; ///< The current body style being parsed.
|
||||
wxString m_symbolName; ///< The current symbol name.
|
||||
|
||||
/// Field IDs that have been read so far for the current symbol.
|
||||
std::set<int> m_fieldIDsRead;
|
||||
|
||||
std::set<KIID> m_uuids;
|
||||
|
||||
PROGRESS_REPORTER* m_progressReporter; // optional; may be nullptr
|
||||
|
||||
@@ -648,8 +648,16 @@ void SCH_SEXPR_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
|
||||
m_error += ioe.What();
|
||||
}
|
||||
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( true );
|
||||
if( fileName.FileExists() )
|
||||
{
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsFileWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
aSheet->GetScreen()->SetFileReadOnly( !fileName.IsDirWritable() );
|
||||
aSheet->GetScreen()->SetFileExists( false );
|
||||
}
|
||||
|
||||
// This was moved out of the try{} block so that any sheets definitionsthat
|
||||
// the plugin fully parsed before the exception was raised will be loaded.
|
||||
|
||||
@@ -2727,7 +2727,6 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
|
||||
|
||||
aliasName = wxString::FromUTF8( line );
|
||||
aliasName.Trim();
|
||||
// aliasName = EscapeString( aliasName, CTX_LIBID );
|
||||
|
||||
LIB_SYMBOL_MAP::iterator it = m_symbols.find( aliasName );
|
||||
|
||||
@@ -2834,6 +2833,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
|
||||
wxString name, prefix, tmp;
|
||||
|
||||
name = tokens.GetNextToken();
|
||||
name = EscapeString( name, CTX_LIBID );
|
||||
pos += name.size() + 1;
|
||||
|
||||
prefix = tokens.GetNextToken();
|
||||
@@ -3071,6 +3071,11 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
|
||||
|
||||
parseQuotedString( text, aReader, line, &line, true );
|
||||
|
||||
// The value field needs to be "special" escaped. The other fields are
|
||||
// escaped normally and don't need special handling
|
||||
if( id == VALUE_FIELD )
|
||||
text = EscapeString( text, CTX_QUOTED_STR );
|
||||
|
||||
// Doctor the *.lib file field which has a "~" in blank fields. New saves will
|
||||
// not save like this.
|
||||
if( text.size() == 1 && text[0] == '~' )
|
||||
|
||||
@@ -163,7 +163,7 @@ int SCH_SHEET_PATH::Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const
|
||||
}
|
||||
|
||||
|
||||
int SCH_SHEET_PATH::ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTest ) const
|
||||
int SCH_SHEET_PATH::ComparePageNum( const SCH_SHEET_PATH& aSheetPathToTest ) const
|
||||
{
|
||||
wxString pageA = GetPageNumber();
|
||||
wxString pageB = aSheetPathToTest.GetPageNumber();
|
||||
@@ -172,10 +172,10 @@ int SCH_SHEET_PATH::ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTes
|
||||
|
||||
if( pageNumComp == 0 )
|
||||
{
|
||||
wxString nameA = Last()->GetName();
|
||||
wxString nameB = aSheetPathToTest.Last()->GetName();
|
||||
int virtualPageA = GetVirtualPageNumber();
|
||||
int virtualPageB = aSheetPathToTest.GetVirtualPageNumber();
|
||||
|
||||
return nameA.Cmp( nameB );
|
||||
return virtualPageA > virtualPageB ? 1 : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -588,7 +588,7 @@ void SCH_SHEET_LIST::SortByPageNumbers( bool aUpdateVirtualPageNums )
|
||||
std::sort( begin(), end(),
|
||||
[]( SCH_SHEET_PATH a, SCH_SHEET_PATH b ) -> bool
|
||||
{
|
||||
return a.ComparePageNumAndName( b ) < 0;
|
||||
return a.ComparePageNum( b ) < 0;
|
||||
} );
|
||||
|
||||
if( aUpdateVirtualPageNums )
|
||||
|
||||
@@ -215,14 +215,14 @@ public:
|
||||
int Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
||||
|
||||
/**
|
||||
* Compare sheets by their page number and then by their name. Finally
|
||||
* compare using #Cmp()
|
||||
* Compare sheets by their page number. If the actual page number is equal, use virtual page numbers
|
||||
* to compare.
|
||||
*
|
||||
* @return -1 if aSheetPathToTest is greater than this (should appear later in the sort order)
|
||||
* 0 if aSheetPathToTest is equal to this
|
||||
* 1 if aSheetPathToTest is less than this (should appear earlier in the sort order)
|
||||
*/
|
||||
int ComparePageNumAndName( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
||||
int ComparePageNum( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
||||
|
||||
/**
|
||||
* Check if this path is contained inside aSheetPathToTest.
|
||||
|
||||
@@ -104,7 +104,7 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||
&m_LabelSizeRatio, DEFAULT_LABEL_SIZE_RATIO, 0.0, 2.0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.pin_symbol_size",
|
||||
&m_PinSymbolSize, Mils2iu( defaultPinSymbolSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
&m_PinSymbolSize, Mils2iu( defaultPinSymbolSize ), Mils2iu( 0 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
// m_JunctionSize is only a run-time cache of the calculated size. Do not save it.
|
||||
|
||||
@@ -264,16 +264,16 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
{
|
||||
// Undo in the reverse order of list creation: (this can allow stacked changes like the
|
||||
// same item can be changed and deleted in the same complex command).
|
||||
for( int ii = aList->GetCount() - 1; ii >= 0; ii-- )
|
||||
// After hitting 0, subtracting 1 will roll the value over to its max representation
|
||||
for( unsigned ii = aList->GetCount() - 1; ii < std::numeric_limits<unsigned>::max(); ii-- )
|
||||
{
|
||||
UNDO_REDO status = aList->GetPickedItemStatus((unsigned) ii );
|
||||
EDA_ITEM* eda_item = aList->GetPickedItem( (unsigned) ii );
|
||||
SCH_SCREEN* screen =
|
||||
dynamic_cast< SCH_SCREEN* >( aList->GetScreenForItem( (unsigned) ii ) );
|
||||
UNDO_REDO status = aList->GetPickedItemStatus( ii );
|
||||
EDA_ITEM* eda_item = aList->GetPickedItem( ii );
|
||||
SCH_SCREEN* screen = dynamic_cast<SCH_SCREEN*>( aList->GetScreenForItem( ii ) );
|
||||
|
||||
wxCHECK( screen, /* void */ );
|
||||
|
||||
eda_item->SetFlags( aList->GetPickerFlags( (unsigned) ii ) );
|
||||
eda_item->SetFlags( aList->GetPickerFlags( ii ) );
|
||||
eda_item->ClearEditFlags();
|
||||
eda_item->ClearTempFlags();
|
||||
|
||||
@@ -285,27 +285,29 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
{
|
||||
// new items are deleted on undo
|
||||
RemoveFromScreen( eda_item, screen );
|
||||
aList->SetPickedItemStatus( UNDO_REDO::DELETED, (unsigned) ii );
|
||||
aList->SetPickedItemStatus( UNDO_REDO::DELETED, ii );
|
||||
}
|
||||
else if( status == UNDO_REDO::DELETED )
|
||||
{
|
||||
// deleted items are re-inserted on undo
|
||||
AddToScreen( eda_item, screen );
|
||||
aList->SetPickedItemStatus( UNDO_REDO::NEWITEM, (unsigned) ii );
|
||||
aList->SetPickedItemStatus( UNDO_REDO::NEWITEM, ii );
|
||||
}
|
||||
else if( status == UNDO_REDO::PAGESETTINGS )
|
||||
{
|
||||
SetCurrentSheet( *m_schematic->GetSheets().FindSheetForScreen( screen ) );
|
||||
DisplayCurrentSheet();
|
||||
|
||||
// swap current settings with stored settings
|
||||
DS_PROXY_UNDO_ITEM alt_item( this );
|
||||
DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
|
||||
item->Restore( this );
|
||||
*item = alt_item;
|
||||
}
|
||||
else if( dynamic_cast<SCH_ITEM*>( eda_item ) )
|
||||
else if( SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( eda_item ) )
|
||||
{
|
||||
// everything else is modified in place
|
||||
SCH_ITEM* item = (SCH_ITEM*) eda_item;
|
||||
SCH_ITEM* alt_item = (SCH_ITEM*) aList->GetPickedItemLink( (unsigned) ii );
|
||||
SCH_ITEM* alt_item = static_cast<SCH_ITEM*>( aList->GetPickedItemLink( ii ) );
|
||||
|
||||
// The root sheet is a pseudo object that owns the root screen object but is not on
|
||||
// the root screen so do not attempt to remove it from the screen it owns.
|
||||
@@ -319,17 +321,23 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
||||
break;
|
||||
|
||||
case UNDO_REDO::EXCHANGE_T:
|
||||
aList->SetPickedItem( alt_item, (unsigned) ii );
|
||||
aList->SetPickedItemLink( item, (unsigned) ii );
|
||||
aList->SetPickedItem( alt_item, ii );
|
||||
aList->SetPickedItemLink( item, ii );
|
||||
item = alt_item;
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxString::Format( wxT( "Unknown undo/redo command %d" ),
|
||||
aList->GetPickedItemStatus( (unsigned) ii ) ) );
|
||||
aList->GetPickedItemStatus( ii ) ) );
|
||||
break;
|
||||
}
|
||||
|
||||
if( item->Type() == SCH_SYMBOL_T )
|
||||
{
|
||||
SCH_SYMBOL* sym = static_cast<SCH_SYMBOL*>( item );
|
||||
sym->UpdatePins();
|
||||
}
|
||||
|
||||
if( item != &Schematic().Root() )
|
||||
AddToScreen( item, screen );
|
||||
}
|
||||
|
||||
@@ -502,41 +502,57 @@ void SYMBOL_EDIT_FRAME::setupUIConditions()
|
||||
}
|
||||
|
||||
|
||||
bool SYMBOL_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
bool SYMBOL_EDIT_FRAME::CanCloseSymbolFromSchematic( bool doClose )
|
||||
{
|
||||
// Shutdown blocks must be determined and vetoed as early as possible
|
||||
if( KIPLATFORM::APP::SupportsShutdownBlockReason() && aEvent.GetId() == wxEVT_QUERY_END_SESSION
|
||||
&& IsContentModified() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_isSymbolFromSchematic && IsContentModified() )
|
||||
if( IsContentModified() )
|
||||
{
|
||||
SCH_EDIT_FRAME* schframe = (SCH_EDIT_FRAME*) Kiway().Player( FRAME_SCH, false );
|
||||
wxString msg = _( "Save changes to '%s' before closing?" );
|
||||
|
||||
switch( UnsavedChangesDialog( this,
|
||||
_( "Save changes to schematic before closing?" ),
|
||||
nullptr ) )
|
||||
switch( UnsavedChangesDialog( this, wxString::Format( msg, m_reference ), nullptr ) )
|
||||
{
|
||||
case wxID_YES:
|
||||
if( schframe && GetCurSymbol() ) // Should be always the case
|
||||
schframe->SaveSymbolToSchematic( *GetCurSymbol(), m_schematicSymbolUUID );
|
||||
|
||||
return true;
|
||||
break;
|
||||
|
||||
case wxID_NO: return true;
|
||||
case wxID_NO:
|
||||
break;
|
||||
|
||||
default:
|
||||
case wxID_CANCEL: return false;
|
||||
case wxID_CANCEL:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( !saveAllLibraries( true ) )
|
||||
if( doClose )
|
||||
{
|
||||
GetInfoBar()->ShowMessageFor( wxEmptyString, 1 );
|
||||
SetCurSymbol( nullptr, false );
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SYMBOL_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
||||
{
|
||||
// Shutdown blocks must be determined and vetoed as early as possible
|
||||
if( KIPLATFORM::APP::SupportsShutdownBlockReason()
|
||||
&& aEvent.GetId() == wxEVT_QUERY_END_SESSION
|
||||
&& IsContentModified() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_isSymbolFromSchematic && !CanCloseSymbolFromSchematic( false ) )
|
||||
return false;
|
||||
|
||||
if( !saveAllLibraries( true ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
*/
|
||||
bool HasLibModifications() const;
|
||||
|
||||
bool CanCloseSymbolFromSchematic( bool doClose );
|
||||
|
||||
/**
|
||||
* The nickname of the current library being edited and empty string if none.
|
||||
*/
|
||||
|
||||
@@ -137,7 +137,7 @@ void SYMBOL_EDIT_FRAME::updateTitle()
|
||||
wxString lib = GetCurLib();
|
||||
wxString title;
|
||||
|
||||
if( IsSymbolFromSchematic() )
|
||||
if( GetCurSymbol() && IsSymbolFromSchematic() )
|
||||
{
|
||||
if( GetScreen() && GetScreen()->IsContentModified() )
|
||||
title = wxT( "*" );
|
||||
@@ -385,6 +385,8 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
|
||||
RebuildSymbolUnitsList();
|
||||
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
|
||||
|
||||
ClearUndoRedoList();
|
||||
|
||||
// Display the document information based on the entry selected just in
|
||||
// case the entry is an alias.
|
||||
UpdateMsgPanel();
|
||||
|
||||
@@ -70,14 +70,11 @@ bool EE_INSPECTION_TOOL::Init()
|
||||
{
|
||||
EE_TOOL_BASE::Init();
|
||||
|
||||
auto singleMarkerCondition = SELECTION_CONDITIONS::OnlyType( SCH_MARKER_T )
|
||||
&& SELECTION_CONDITIONS::Count( 1 );
|
||||
|
||||
// Add inspection actions to the selection tool menu
|
||||
//
|
||||
CONDITIONAL_MENU& selToolMenu = m_selectionTool->GetToolMenu().GetMenu();
|
||||
|
||||
selToolMenu.AddItem( EE_ACTIONS::excludeMarker, singleMarkerCondition, 100 );
|
||||
selToolMenu.AddItem( EE_ACTIONS::excludeMarker, EE_CONDITIONS::SingleNonExcludedMarker, 100 );
|
||||
|
||||
selToolMenu.AddItem( EE_ACTIONS::showDatasheet,
|
||||
EE_CONDITIONS::SingleSymbol && EE_CONDITIONS::Idle, 220 );
|
||||
@@ -171,25 +168,26 @@ int EE_INSPECTION_TOOL::NextMarker( const TOOL_EVENT& aEvent )
|
||||
|
||||
int EE_INSPECTION_TOOL::ExcludeMarker( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
|
||||
EE_SELECTION& selection = selTool->GetSelection();
|
||||
SCH_MARKER* marker = nullptr;
|
||||
|
||||
if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
|
||||
marker = static_cast<SCH_MARKER*>( selection.Front() );
|
||||
|
||||
if( m_ercDialog )
|
||||
{
|
||||
// Let the ERC dialog handle it since it has more update hassles to worry about
|
||||
m_ercDialog->ExcludeMarker();
|
||||
// Note that if marker is nullptr the dialog will exclude whichever marker is selected
|
||||
// in the dialog itself
|
||||
m_ercDialog->ExcludeMarker( marker );
|
||||
}
|
||||
else
|
||||
else if( marker != nullptr )
|
||||
{
|
||||
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
|
||||
EE_SELECTION& selection = selTool->GetSelection();
|
||||
|
||||
if( selection.GetSize() == 1 && selection.Front()->Type() == SCH_MARKER_T )
|
||||
{
|
||||
SCH_MARKER* marker = static_cast<SCH_MARKER*>( selection.Front() );
|
||||
|
||||
marker->SetExcluded( true );
|
||||
m_frame->GetCanvas()->GetView()->Update( marker );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
m_frame->OnModify();
|
||||
}
|
||||
marker->SetExcluded( true );
|
||||
m_frame->GetCanvas()->GetView()->Update( marker );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
m_frame->OnModify();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -385,6 +385,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
||||
|
||||
controls->SetAutoPan( false );
|
||||
controls->CaptureCursor( false );
|
||||
setEditedPoint( nullptr );
|
||||
|
||||
if( m_editPoints )
|
||||
{
|
||||
@@ -515,7 +516,10 @@ void EE_POINT_EDITOR::updateParentItem() const
|
||||
shape->GetPolyShape().NewOutline();
|
||||
|
||||
for( unsigned i = 0; i < m_editPoints->PointsSize(); ++i )
|
||||
shape->GetPolyShape().Append( mapCoords( m_editPoints->Point( i ).GetPosition() ) );
|
||||
{
|
||||
wxPoint pt = mapCoords( m_editPoints->Point( i ).GetPosition() );
|
||||
shape->GetPolyShape().Append( pt.x, pt.y, -1, -1, true );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -633,7 +637,7 @@ void EE_POINT_EDITOR::updateParentItem() const
|
||||
else if( connected.second == ENDPOINT )
|
||||
static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetPosition() );
|
||||
|
||||
getView()->Update( connected.first, KIGFX::GEOMETRY );
|
||||
updateItem( connected.first, true );
|
||||
}
|
||||
|
||||
connected = m_editPoints->Point( LINE_END ).GetConnected();
|
||||
@@ -645,7 +649,7 @@ void EE_POINT_EDITOR::updateParentItem() const
|
||||
else if( connected.second == ENDPOINT )
|
||||
static_cast<SCH_LINE*>( connected.first )->SetEndPoint( line->GetEndPoint() );
|
||||
|
||||
getView()->Update( connected.first, KIGFX::GEOMETRY );
|
||||
updateItem( connected.first, true );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -75,7 +75,7 @@ EDA_RECT EE_SELECTION::GetBoundingBox() const
|
||||
{
|
||||
bbox.Merge( static_cast<SCH_SYMBOL*>( item )->GetBoundingBox() );
|
||||
}
|
||||
catch( const boost::bad_pointer& exc )
|
||||
catch( const boost::bad_pointer& )
|
||||
{
|
||||
wxFAIL_MSG( "Invalid pointer." );
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <sch_item.h>
|
||||
#include <sch_line.h>
|
||||
#include <sch_junction.h>
|
||||
#include <sch_marker.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_sheet_pin.h>
|
||||
#include <lib_shape.h>
|
||||
@@ -107,6 +108,15 @@ SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = []( const SELECTION&
|
||||
};
|
||||
|
||||
|
||||
SELECTION_CONDITION EE_CONDITIONS::SingleNonExcludedMarker = []( const SELECTION& aSel )
|
||||
{
|
||||
if( aSel.CountType( SCH_MARKER_T ) != 1 )
|
||||
return false;
|
||||
|
||||
return !static_cast<SCH_MARKER*>( aSel.Front() )->IsExcluded();
|
||||
};
|
||||
|
||||
|
||||
#define HITTEST_THRESHOLD_PIXELS 5
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
static SELECTION_CONDITION SingleSymbolOrPower;
|
||||
static SELECTION_CONDITION SingleDeMorganSymbol;
|
||||
static SELECTION_CONDITION SingleMultiUnitSymbol;
|
||||
static SELECTION_CONDITION SingleNonExcludedMarker;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -469,13 +469,13 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
|
||||
std::sort( paths.begin(), paths.end(), [] ( const SCH_SHEET_PATH* lhs,
|
||||
const SCH_SHEET_PATH* rhs ) -> bool
|
||||
{
|
||||
int retval = lhs->ComparePageNumAndName( *rhs );
|
||||
int retval = lhs->ComparePageNum( *rhs );
|
||||
|
||||
if( retval < 0 )
|
||||
return true;
|
||||
else if( retval > 0 )
|
||||
return false;
|
||||
else /// Enforce strict ordering. If the name and number are the same, we use UUIDs
|
||||
else /// Enforce strict ordering. If the page numbers are the same, use UUIDs
|
||||
return lhs->GetCurrentHash() < rhs->GetCurrentHash();
|
||||
} );
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||
moveItem( item, delta );
|
||||
updateItem( item, false );
|
||||
|
||||
isPasted |= item->GetFlags() & IS_PASTED;
|
||||
isPasted |= ( item->GetFlags() & IS_PASTED ) != 0;
|
||||
item->ClearFlags( IS_PASTED );
|
||||
}
|
||||
|
||||
|
||||
@@ -339,6 +339,9 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
else if( evt->IsClick( BUT_LEFT ) && !item )
|
||||
{
|
||||
// Update in case the symbol was changed while the tool was running
|
||||
symbol = m_frame->GetCurSymbol();
|
||||
|
||||
if( !symbol )
|
||||
continue;
|
||||
|
||||
@@ -361,6 +364,12 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
|
||||
else if( item && ( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT )
|
||||
|| evt->IsAction( &EE_ACTIONS::finishDrawing ) ) )
|
||||
{
|
||||
if( symbol != m_frame->GetCurSymbol() )
|
||||
{
|
||||
symbol = m_frame->GetCurSymbol();
|
||||
item->SetParent( symbol );
|
||||
}
|
||||
|
||||
if( evt->IsDblClick( BUT_LEFT ) || evt->IsAction( &EE_ACTIONS::finishDrawing )
|
||||
|| !item->ContinueEdit( wxPoint( cursorPos.x, -cursorPos.y ) ) )
|
||||
{
|
||||
|
||||
+11
-5
@@ -82,11 +82,13 @@ set( GERBVIEW_EXTRA_SRCS
|
||||
${CMAKE_SOURCE_DIR}/common/page_info.cpp
|
||||
)
|
||||
|
||||
if( MINGW )
|
||||
# GERBVIEW_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( gerbview )
|
||||
else()
|
||||
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# GERBVIEW_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( gerbview )
|
||||
else()
|
||||
set( GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/gerbview.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
@@ -205,6 +207,10 @@ if( APPLE )
|
||||
" COMPONENT Runtime
|
||||
)
|
||||
else()
|
||||
if( MSVC )
|
||||
target_sources( gerbview_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/gerbview-dll.rc )
|
||||
endif()
|
||||
|
||||
install( TARGETS gerbview
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
|
||||
@@ -35,7 +35,7 @@ class NETCLASSES;
|
||||
class PANEL_SETUP_NETCLASSES : public PANEL_SETUP_NETCLASSES_BASE
|
||||
{
|
||||
public:
|
||||
PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
|
||||
PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame, NETCLASSES* aNetclasses,
|
||||
const std::vector<wxString>& aNetNames, bool isEEschema );
|
||||
~PANEL_SETUP_NETCLASSES( ) override;
|
||||
|
||||
@@ -60,6 +60,8 @@ private:
|
||||
void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); }
|
||||
void OnAssignSelected( wxCommandEvent& event ) override { doAssignments( false ); }
|
||||
|
||||
void onUnitsChanged( wxCommandEvent& aEvent );
|
||||
|
||||
bool validateNetclassName( int aRow, const wxString& aName, bool focusFirst = true );
|
||||
|
||||
void rebuildNetclassDropdowns();
|
||||
@@ -71,7 +73,8 @@ private:
|
||||
void AdjustNetclassGridColumns( int aWidth );
|
||||
void AdjustMembershipGridColumns( int aWidth );
|
||||
|
||||
PAGED_DIALOG* m_Parent;
|
||||
EDA_DRAW_FRAME* m_frame;
|
||||
PAGED_DIALOG* m_parent;
|
||||
NETCLASSES* m_netclasses;
|
||||
std::vector<wxString> m_netNames;
|
||||
|
||||
|
||||
+6
-1
@@ -288,7 +288,12 @@ protected:
|
||||
void beginEdit( const wxPoint& aStartPoint );
|
||||
bool continueEdit( const wxPoint& aPosition );
|
||||
void calcEdit( const wxPoint& aPosition );
|
||||
void endEdit();
|
||||
|
||||
/**
|
||||
* Finishes editing the shape.
|
||||
* @param aClosed Should polygon shapes be closed (yes for pcbnew/fpeditor, no for libedit)
|
||||
*/
|
||||
void endEdit( bool aClosed = true );
|
||||
void setEditState( int aState ) { m_editState = aState; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -331,11 +331,13 @@ private:
|
||||
VERTEX_MANAGER* m_cachedManager; ///< Container for storing cached VERTEX_ITEMs
|
||||
VERTEX_MANAGER* m_nonCachedManager; ///< Container for storing non-cached VERTEX_ITEMs
|
||||
VERTEX_MANAGER* m_overlayManager; ///< Container for storing overlaid VERTEX_ITEMs
|
||||
VERTEX_MANAGER* m_tempManager; ///< Container for storing temp (diff mode) VERTEX_ITEMs
|
||||
|
||||
// Framebuffer & compositing
|
||||
OPENGL_COMPOSITOR* m_compositor; ///< Handles multiple rendering targets
|
||||
unsigned int m_mainBuffer; ///< Main rendering target
|
||||
unsigned int m_overlayBuffer; ///< Auxiliary rendering target (for menus etc.)
|
||||
unsigned int m_tempBuffer; ///< Temporary rendering target (for diffing etc.)
|
||||
RENDER_TARGET m_currentTarget; ///< Current rendering target
|
||||
|
||||
// Shader
|
||||
|
||||
+8
-8
@@ -25,6 +25,7 @@
|
||||
#define GL_UTILS_H
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <wx/glcanvas.h>
|
||||
#include <wx/utils.h>
|
||||
|
||||
#include <limits>
|
||||
@@ -44,19 +45,18 @@ public:
|
||||
/// Windows would include <wglext.h> and call wglSwapIntervalEXT
|
||||
#if defined( __linux__ ) && !defined( KICAD_USE_EGL )
|
||||
|
||||
/// Do not try to set the swapping over remote connections
|
||||
/// Video drivers lie and then crash when they can't handle the adaptive swapping
|
||||
if( wxGetEnv( wxT( "SSH_CONNECTION"), nullptr ) )
|
||||
return 0;
|
||||
|
||||
Display *dpy = glXGetCurrentDisplay();
|
||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||
std::string vendor( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
|
||||
bool is_mesa = ( vendor.find( "Mesa" ) != std::string::npos );
|
||||
|
||||
if( glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
|
||||
if( !is_mesa && glXSwapIntervalEXT && glXQueryDrawable && dpy && drawable )
|
||||
{
|
||||
std::string exts( glXQueryExtensionsString( dpy, DefaultScreen( dpy ) ) );
|
||||
|
||||
if( aVal < 0 )
|
||||
{
|
||||
if( !GLX_EXT_swap_control_tear )
|
||||
if( exts.find( "GLX_EXT_swap_control_tear" ) == std::string::npos )
|
||||
{
|
||||
aVal = 0;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
// we need to be sure that late/adaptive swaps are
|
||||
// enabled on the drawable.
|
||||
|
||||
unsigned lateSwapsEnabled;
|
||||
unsigned lateSwapsEnabled = 0;
|
||||
glXQueryDrawable( dpy, drawable, GLX_LATE_SWAPS_TEAR_EXT, &lateSwapsEnabled );
|
||||
|
||||
if( !lateSwapsEnabled )
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
* The scaling factor to convert polygonal shape coordinates to internal units.
|
||||
*/
|
||||
int MarkerScale() const { return m_scalingFactor; }
|
||||
void SetMarkerScale( int aScale ) { m_scalingFactor = aScale; }
|
||||
|
||||
/**
|
||||
* Return the shape polygon in internal units in a #SHAPE_LINE_CHAIN the coordinates
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
void DoTraceUtf8( const wxString aWhat, const wxChar* aFmt, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
va_start( argptr, format );
|
||||
va_start( argptr, aFmt );
|
||||
traceV( aWhat, aFmt, argptr );
|
||||
va_end( argptr );
|
||||
}
|
||||
|
||||
@@ -38,11 +38,13 @@ set( KICAD_SRCS
|
||||
tools/kicad_manager_control.cpp
|
||||
)
|
||||
|
||||
if( MINGW )
|
||||
# KICAD_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( kicad )
|
||||
else()
|
||||
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# KICAD_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( kicad )
|
||||
else()
|
||||
set( KICAD_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/kicad.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
|
||||
@@ -297,6 +297,7 @@ void DIALOG_TEMPLATE_SELECTOR::replaceCurrentPage()
|
||||
buildPageContent( m_tcTemplatePath->GetValue(), page );
|
||||
|
||||
m_selectedWidget = nullptr;
|
||||
PostSizeEvent(); // A easy way to froce refresh displays
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -415,9 +415,6 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave )
|
||||
if( !Kiway().PlayersClose( false ) )
|
||||
return false;
|
||||
|
||||
// Give a timeslice for the save-changes? dialog (and for the project to actually close)
|
||||
wxSafeYield();
|
||||
|
||||
// Save the project file for the currently loaded project.
|
||||
if( m_active_project )
|
||||
{
|
||||
|
||||
@@ -561,7 +561,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
return -1;
|
||||
|
||||
wxFileName newProjectDir( dlg.GetPath() );
|
||||
wxFileName newProjectDir( dlg.GetPath(), wxEmptyString );
|
||||
|
||||
if( !newProjectDir.IsAbsolute() )
|
||||
newProjectDir.MakeAbsolute();
|
||||
@@ -592,7 +592,7 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent )
|
||||
}
|
||||
|
||||
const wxString& newProjectDirPath = newProjectDir.GetFullPath();
|
||||
const wxString& newProjectName = newProjectDir.GetName();
|
||||
const wxString& newProjectName = newProjectDir.GetDirs().Last();
|
||||
wxDir currentProjectDir( currentProjectDirPath );
|
||||
|
||||
SAVE_AS_TRAVERSER traverser( m_frame, currentProjectDirPath, currentProjectName,
|
||||
|
||||
@@ -21,6 +21,7 @@ set( KIMATH_SRCS
|
||||
src/geometry/shape_segment.cpp
|
||||
|
||||
|
||||
src/math/vector2.cpp
|
||||
src/math/util.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
return std::abs( dist1 ) <= 1 && std::abs( dist2 ) <= 1;
|
||||
}
|
||||
|
||||
bool ApproxParallel ( const SEG& aSeg, int aDistanceThreshold = 1 ) const
|
||||
bool ApproxParallel( const SEG& aSeg, int aDistanceThreshold = 1 ) const
|
||||
{
|
||||
ecoord p, q, r;
|
||||
CanonicalCoefs( p, q, r );
|
||||
|
||||
@@ -617,12 +617,29 @@ std::ostream& operator<<( std::ostream& aStream, const VECTOR2<T>& aVector )
|
||||
return aStream;
|
||||
}
|
||||
|
||||
|
||||
/* Default specializations */
|
||||
typedef VECTOR2<double> VECTOR2D;
|
||||
typedef VECTOR2<int> VECTOR2I;
|
||||
typedef VECTOR2<unsigned int> VECTOR2U;
|
||||
|
||||
/* STL specializations */
|
||||
namespace std
|
||||
{
|
||||
// Required to enable correct use in std::map/unordered_map
|
||||
template <>
|
||||
struct hash<VECTOR2I>
|
||||
{
|
||||
size_t operator()( const VECTOR2I& k ) const;
|
||||
};
|
||||
|
||||
// Required to enable use of std::hash with maps
|
||||
template <>
|
||||
struct less<VECTOR2I>
|
||||
{
|
||||
bool operator()( const VECTOR2I& aA, const VECTOR2I& aB ) const;
|
||||
};
|
||||
}
|
||||
|
||||
/* Compatibility typedefs */
|
||||
// FIXME should be removed to avoid multiple typedefs for the same type
|
||||
typedef VECTOR2<double> DPOINT;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <math/vector2d.h>
|
||||
|
||||
|
||||
size_t std::hash<VECTOR2I>::operator()( const VECTOR2I& k ) const
|
||||
{
|
||||
auto xhash = std::hash<int>()( k.x );
|
||||
|
||||
// 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) )
|
||||
// Adding this value ensures that consecutive bits of y will not be close to each other
|
||||
// decreasing the likelihood of hash collision in similar values of x and y
|
||||
return xhash ^ ( std::hash<int>()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) );
|
||||
}
|
||||
|
||||
|
||||
bool std::less<VECTOR2I>::operator()( const VECTOR2I& aA, const VECTOR2I& aB ) const
|
||||
{
|
||||
if( aA.x == aB.x )
|
||||
return aA.y < aB.y;
|
||||
|
||||
return aA.x < aB.x;
|
||||
}
|
||||
@@ -51,12 +51,13 @@ set( PL_EDITOR_EXTRA_SRCS
|
||||
${CMAKE_SOURCE_DIR}/common/page_info.cpp
|
||||
)
|
||||
|
||||
|
||||
if( MINGW )
|
||||
# PL_EDITOR_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pl_editor )
|
||||
else()
|
||||
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# PL_EDITOR_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pl_editor )
|
||||
else()
|
||||
set( PL_EDITOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -157,6 +158,10 @@ if( APPLE )
|
||||
" COMPONENT Runtime
|
||||
)
|
||||
else()
|
||||
if( MSVC )
|
||||
target_sources( pl_editor_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pl_editor-dll.rc )
|
||||
endif()
|
||||
|
||||
install( TARGETS pl_editor
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
|
||||
@@ -49,11 +49,13 @@ set( PCB_CALCULATOR_SRCS
|
||||
../common/env_vars.cpp # needed on MSW to avoid a link issue (a symbol not found)
|
||||
)
|
||||
|
||||
if( MINGW )
|
||||
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pcb_calculator )
|
||||
else()
|
||||
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# PCB_CALCULATOR_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pcb_calculator )
|
||||
else()
|
||||
set( PCB_CALCULATOR_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
@@ -92,6 +94,7 @@ add_library( pcb_calculator_kiface MODULE
|
||||
pcb_calculator.cpp
|
||||
${PCB_CALCULATOR_SRCS}
|
||||
)
|
||||
|
||||
set_target_properties( pcb_calculator_kiface PROPERTIES
|
||||
OUTPUT_NAME pcb_calculator
|
||||
PREFIX ${KIFACE_PREFIX}
|
||||
@@ -145,6 +148,10 @@ if( APPLE )
|
||||
" COMPONENT Runtime
|
||||
)
|
||||
else()
|
||||
if( MSVC )
|
||||
target_sources( pcb_calculator_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcb_calculator-dll.rc )
|
||||
endif()
|
||||
|
||||
install( TARGETS pcb_calculator
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
|
||||
@@ -7,12 +7,12 @@ _HKI( "If you specify the maximum current, then the trace widths will be calcula
|
||||
"\n"
|
||||
"The calculations are valid for currents up to 35 A (external) or 17.5 A (internal), temperature rises up to 100 °C, and widths of up to 400 mils (10 mm).\n"
|
||||
"\n"
|
||||
"The formula, from IPC 2221, is \n"
|
||||
"<center>___I = K ⋅ ΔT<sup>0.44</sup> ⋅ (W ⋅ H)<sup>0.725</sup>___</center> \n"
|
||||
"where: \n"
|
||||
"___I___ is maximum current in A \n"
|
||||
"___ΔT___ is temperature rise above ambient in °C \n"
|
||||
"___W___ is width in mils \n"
|
||||
"___H___ is thickness (height) in mils \n"
|
||||
"___K___ is 0.024 for internal traces or 0.048 for external traces \n"
|
||||
"The formula, from IPC 2221, is\n"
|
||||
"<center>___I = K · ΔT<sup>0.44</sup> · (W · H)<sup>0.725</sup>___</center>\n"
|
||||
"where:<br>\n"
|
||||
"___I___ is maximum current in A<br>\n"
|
||||
"___ΔT___ is temperature rise above ambient in °C<br>\n"
|
||||
"___W___ is width in mils<br>\n"
|
||||
"___H___ is thickness (height) in mils<br>\n"
|
||||
"___K___ is 0.024 for internal traces or 0.048 for external traces\n"
|
||||
"" );
|
||||
|
||||
@@ -6,11 +6,11 @@ The controlling value is shown in bold.
|
||||
|
||||
The calculations are valid for currents up to 35 A (external) or 17.5 A (internal), temperature rises up to 100 °C, and widths of up to 400 mils (10 mm).
|
||||
|
||||
The formula, from IPC 2221, is
|
||||
<center>___I = K ⋅ ΔT<sup>0.44</sup> ⋅ (W ⋅ H)<sup>0.725</sup>___</center>
|
||||
where:
|
||||
___I___ is maximum current in A
|
||||
___ΔT___ is temperature rise above ambient in °C
|
||||
___W___ is width in mils
|
||||
___H___ is thickness (height) in mils
|
||||
___K___ is 0.024 for internal traces or 0.048 for external traces
|
||||
The formula, from IPC 2221, is
|
||||
<center>___I = K · ΔT<sup>0.44</sup> · (W · H)<sup>0.725</sup>___</center>
|
||||
where:<br>
|
||||
___I___ is maximum current in A<br>
|
||||
___ΔT___ is temperature rise above ambient in °C<br>
|
||||
___W___ is width in mils<br>
|
||||
___H___ is thickness (height) in mils<br>
|
||||
___K___ is 0.024 for internal traces or 0.048 for external traces
|
||||
|
||||
+11
-6
@@ -547,12 +547,13 @@ if( DOXYGEN_FOUND )
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if( MINGW )
|
||||
# PCBNEW_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pcbnew )
|
||||
else()
|
||||
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# PCBNEW_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( pcbnew )
|
||||
else()
|
||||
set( PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew.rc )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -766,6 +767,10 @@ if( APPLE )
|
||||
" COMPONENT Runtime
|
||||
)
|
||||
else()
|
||||
if( MSVC )
|
||||
target_sources( pcbnew_kiface PRIVATE ${CMAKE_SOURCE_DIR}/resources/msw/pcbnew-dll.rc )
|
||||
endif()
|
||||
|
||||
install( TARGETS pcbnew
|
||||
DESTINATION ${KICAD_BIN}
|
||||
COMPONENT binary
|
||||
|
||||
@@ -119,12 +119,17 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
||||
int changeFlags = ent.m_type & CHT_FLAGS;
|
||||
BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
|
||||
|
||||
wxASSERT( ent.m_item );
|
||||
|
||||
// Module items need to be saved in the undo buffer before modification
|
||||
if( m_isFootprintEditor )
|
||||
{
|
||||
// Be sure that we are storing a footprint
|
||||
if( ent.m_item->Type() != PCB_FOOTPRINT_T )
|
||||
{
|
||||
ent.m_item = ent.m_item->GetParent();
|
||||
wxASSERT( ent.m_item );
|
||||
}
|
||||
|
||||
// We have not saved the footprint yet, so let's create an entry
|
||||
if( savedModules.count( ent.m_item ) == 0 )
|
||||
|
||||
@@ -215,12 +215,12 @@ void PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness( wxCommandEvent& eve
|
||||
if( items_candidate.size() )
|
||||
{
|
||||
int thickness_layer = ( iu_thickness - min_thickness ) / items_candidate.size();
|
||||
wxString txt = StringFromValue( m_frame->GetUserUnits(), thickness_layer );
|
||||
wxString txt = StringFromValue( m_frame->GetUserUnits(), thickness_layer, true );
|
||||
|
||||
for( BOARD_STACKUP_ROW_UI_ITEM* ui_item : items_candidate )
|
||||
{
|
||||
wxTextCtrl* textCtrl = static_cast<wxTextCtrl*>( ui_item->m_ThicknessCtrl );
|
||||
textCtrl->SetValue( txt );
|
||||
textCtrl->ChangeValue( txt );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -461,7 +461,7 @@ void PANEL_SETUP_BOARD_STACKUP::computeBoardThickness()
|
||||
|
||||
// The text in the event will translate to the value for the text control
|
||||
// and is only updated if it changed
|
||||
m_tcCTValue->SetValue( thicknessStr );
|
||||
m_tcCTValue->ChangeValue( thicknessStr );
|
||||
}
|
||||
|
||||
|
||||
@@ -516,9 +516,9 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
|
||||
if( matName )
|
||||
{
|
||||
if( IsPrmSpecified( item->GetMaterial( sub_item ) ) )
|
||||
matName->SetValue( item->GetMaterial( sub_item ) );
|
||||
matName->ChangeValue( item->GetMaterial( sub_item ) );
|
||||
else
|
||||
matName->SetValue( wxGetTranslation( NotSpecifiedPrm() ) );
|
||||
matName->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
|
||||
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_ThicknessCtrl );
|
||||
|
||||
if( textCtrl )
|
||||
textCtrl->SetValue( StringFromValue( m_units,
|
||||
textCtrl->ChangeValue( StringFromValue( m_units,
|
||||
item->GetThickness( sub_item ), true ) );
|
||||
|
||||
if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC )
|
||||
@@ -582,7 +582,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
|
||||
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_EpsilonCtrl );
|
||||
|
||||
if( textCtrl )
|
||||
textCtrl->SetValue( txt );
|
||||
textCtrl->ChangeValue( txt );
|
||||
}
|
||||
|
||||
if( item->HasLossTangentValue() )
|
||||
@@ -591,7 +591,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync )
|
||||
wxTextCtrl* textCtrl = dynamic_cast<wxTextCtrl*>( ui_row_item.m_LossTgCtrl );
|
||||
|
||||
if( textCtrl )
|
||||
textCtrl->SetValue( txt );
|
||||
textCtrl->ChangeValue( txt );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,9 +655,9 @@ void PANEL_SETUP_BOARD_STACKUP::addMaterialChooser( wxWindowID aId, const wxStri
|
||||
if( aMaterialName )
|
||||
{
|
||||
if( IsPrmSpecified( *aMaterialName ) )
|
||||
textCtrl->SetValue( *aMaterialName );
|
||||
textCtrl->ChangeValue( *aMaterialName );
|
||||
else
|
||||
textCtrl->SetValue( wxGetTranslation( NotSpecifiedPrm() ) );
|
||||
textCtrl->ChangeValue( wxGetTranslation( NotSpecifiedPrm() ) );
|
||||
}
|
||||
|
||||
textCtrl->SetMinSize( m_numericTextCtrlSize );
|
||||
@@ -769,7 +769,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
|
||||
{
|
||||
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, ID_ITEM_THICKNESS+row );
|
||||
textCtrl->SetMinSize( m_numericTextCtrlSize );
|
||||
textCtrl->SetValue( StringFromValue( m_units, item->GetThickness( aSublayerIdx ), true ) );
|
||||
textCtrl->ChangeValue( StringFromValue( m_units, item->GetThickness( aSublayerIdx ), true ) );
|
||||
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
|
||||
m_controlItemsList.push_back( textCtrl );
|
||||
textCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED,
|
||||
@@ -838,7 +838,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
|
||||
wxString txt = Double2Str( item->GetEpsilonR( aSublayerIdx ) );
|
||||
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, m_numericFieldsSize );
|
||||
textCtrl->SetValue( txt );
|
||||
textCtrl->ChangeValue( txt );
|
||||
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
|
||||
ui_row_item.m_EpsilonCtrl = textCtrl;
|
||||
}
|
||||
@@ -852,7 +852,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow,
|
||||
wxString txt = Double2Str( item->GetLossTangent( aSublayerIdx ) );;
|
||||
wxTextCtrl* textCtrl = new wxTextCtrl( m_scGridWin, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, m_numericFieldsSize );
|
||||
textCtrl->SetValue( txt );
|
||||
textCtrl->ChangeValue( txt );
|
||||
m_fgGridSizer->Add( textCtrl, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 2 );
|
||||
ui_row_item.m_LossTgCtrl = textCtrl;
|
||||
}
|
||||
@@ -1358,7 +1358,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
|
||||
|
||||
wxTextCtrl* textCtrl;
|
||||
textCtrl = static_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_MaterialCtrl );
|
||||
textCtrl->SetValue( item->GetMaterial( sub_item ) );
|
||||
textCtrl->ChangeValue( item->GetMaterial( sub_item ) );
|
||||
|
||||
// some layers have a material choice but not EpsilonR ctrl
|
||||
if( item->HasEpsilonRValue() )
|
||||
@@ -1366,7 +1366,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
|
||||
textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_EpsilonCtrl );
|
||||
|
||||
if( textCtrl )
|
||||
textCtrl->SetValue( item->FormatEpsilonR( sub_item ) );
|
||||
textCtrl->ChangeValue( item->FormatEpsilonR( sub_item ) );
|
||||
}
|
||||
|
||||
// some layers have a material choice but not loss tg ctrl
|
||||
@@ -1375,7 +1375,7 @@ void PANEL_SETUP_BOARD_STACKUP::onMaterialChange( wxCommandEvent& event )
|
||||
textCtrl = dynamic_cast<wxTextCtrl*>( m_rowUiItemsList[row].m_LossTgCtrl );
|
||||
|
||||
if( textCtrl )
|
||||
textCtrl->SetValue( item->FormatLossTangent( sub_item ) );
|
||||
textCtrl->ChangeValue( item->FormatLossTangent( sub_item ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1438,12 +1438,14 @@ wxColor PANEL_SETUP_BOARD_STACKUP::getColorIconItem( int aRow )
|
||||
|
||||
void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow )
|
||||
{
|
||||
// explicit depth important under MSW. We use R,V,B 24 bits/pixel bitmap
|
||||
const int bitmap_depth = 24;
|
||||
|
||||
if( aRow >= 0 )
|
||||
{
|
||||
wxStaticBitmap* st_bitmap = m_rowUiItemsList[aRow].m_Icon;
|
||||
|
||||
// explicit depth important under MSW
|
||||
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 );
|
||||
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
|
||||
drawBitmap( bmp, getColorIconItem( aRow ) );
|
||||
st_bitmap->SetBitmap( bmp );
|
||||
return;
|
||||
@@ -1451,8 +1453,7 @@ void PANEL_SETUP_BOARD_STACKUP::updateIconColor( int aRow )
|
||||
|
||||
for( unsigned row = 0; row < m_rowUiItemsList.size(); row++ )
|
||||
{
|
||||
// explicit depth important under MSW
|
||||
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, 28 );
|
||||
wxBitmap bmp( m_colorIconsSize.x, m_colorIconsSize.y / 2, bitmap_depth );
|
||||
drawBitmap( bmp, getColorIconItem( row ) );
|
||||
m_rowUiItemsList[row].m_Icon->SetBitmap( bmp );
|
||||
}
|
||||
|
||||
@@ -121,6 +121,9 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
|
||||
|
||||
for( FOOTPRINT* footprint : GetBoard()->Footprints() )
|
||||
{
|
||||
if( footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM )
|
||||
continue;
|
||||
|
||||
bool valExist = false;
|
||||
|
||||
// try to find component in existing list
|
||||
|
||||
@@ -431,7 +431,7 @@ void reportProgress( PROGRESS_REPORTER* aReporter, int aCount, int aSize, int aD
|
||||
|
||||
void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
||||
{
|
||||
int delta = 100; // Number of additions between 2 calls to the progress bar
|
||||
int delta = 200; // Number of additions between 2 calls to the progress bar
|
||||
int ii = 0;
|
||||
int size = 0;
|
||||
|
||||
@@ -443,7 +443,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
||||
|
||||
size *= 2; // Our caller us gets the other half of the progress bar
|
||||
|
||||
delta = std::max( delta, size / 50 );
|
||||
delta = std::max( delta, size / 10 );
|
||||
|
||||
for( ZONE* zone : aBoard->Zones() )
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <connectivity/from_to_cache.h>
|
||||
|
||||
#include <ratsnest/ratsnest_data.h>
|
||||
#include <progress_reporter.h>
|
||||
#include <trigo.h>
|
||||
|
||||
CONNECTIVITY_DATA::CONNECTIVITY_DATA()
|
||||
@@ -99,7 +100,19 @@ void CONNECTIVITY_DATA::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
||||
if( net->GetNetClass()->GetName() != NETCLASS::Default )
|
||||
m_netclassMap[ net->GetNetCode() ] = net->GetNetClass()->GetName();
|
||||
|
||||
if( aReporter )
|
||||
{
|
||||
aReporter->SetCurrentProgress( 0.75 );
|
||||
aReporter->KeepRefreshing( false );
|
||||
}
|
||||
|
||||
RecalculateRatsnest();
|
||||
|
||||
if( aReporter )
|
||||
{
|
||||
aReporter->SetCurrentProgress( 1.0 );
|
||||
aReporter->KeepRefreshing( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
|
||||
m_severities = new PANEL_SETUP_SEVERITIES( this, DRC_ITEM::GetItemsWithSeverities(),
|
||||
bds.m_DRCSeverities );
|
||||
|
||||
m_netclasses = new PANEL_SETUP_NETCLASSES( this, &bds.GetNetClasses(),
|
||||
m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, &bds.GetNetClasses(),
|
||||
board->GetNetClassAssignmentCandidates(), false );
|
||||
|
||||
m_textVars = new PANEL_TEXT_VARIABLES( m_treebook, &Prj() );
|
||||
@@ -77,7 +77,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
|
||||
* WARNING: If you change page names you MUST update calls to ShowBoardSetupDialog().
|
||||
*/
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "Board Stackup" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Board Stackup" ) );
|
||||
|
||||
m_currentPage = -1;
|
||||
|
||||
@@ -97,11 +97,11 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
|
||||
m_treebook->AddSubPage( m_boardFinish, _( "Board Finish" ) );
|
||||
m_treebook->AddSubPage( m_maskAndPaste, _( "Solder Mask/Paste" ) );
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "Text & Graphics" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Text & Graphics" ) );
|
||||
m_treebook->AddSubPage( m_textAndGraphics, _( "Defaults" ) );
|
||||
m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) );
|
||||
|
||||
m_treebook->AddPage( new wxPanel( this ), _( "Design Rules" ) );
|
||||
m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Design Rules" ) );
|
||||
m_treebook->AddSubPage( m_constraints, _( "Constraints" ) );
|
||||
m_treebook->AddSubPage( m_tracksAndVias, _( "Pre-defined Sizes" ) );
|
||||
m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) );
|
||||
|
||||
@@ -81,7 +81,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
|
||||
for( size_t i = 0; i < m_NoteBook->GetPageCount(); ++i )
|
||||
m_macHack.push_back( true );
|
||||
|
||||
m_texts = new FP_TEXT_GRID_TABLE( m_units, m_frame );
|
||||
m_texts = new FP_TEXT_GRID_TABLE( m_frame );
|
||||
|
||||
m_delayedErrorMessage = wxEmptyString;
|
||||
m_delayedFocusGrid = nullptr;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user