thanks for merging. I have a complementary patch that fixes problem with selecting hidden tracks.


On 02/21/2018 08:40 PM, Wayne Stambaugh wrote:

I merged your patches.  Hopefully this will tamp down some of the layer
visibility complaints.  Thank you for your contribution to KiCad.



On 2/21/2018 12:44 PM, Andrzej Wolski wrote:

in attachment all 3 patches I have, rebased.


On 02/21/2018 05:45 PM, Wayne Stambaugh wrote:

This patch does not apply cleanly.  Please rebase and resubmit it when
you get a chance.



On 2/21/2018 11:27 AM, Andrzej Wolski wrote:

I have attached that patch to bug report whom which you messaged me,
thought you will see it.

I'm attaching it again in this email.


On 02/21/2018 05:20 PM, Wayne Stambaugh wrote:

You have not replied to my last message about your original patch that
you sent to the developers mailing list[1].  I need that one so I can
apply and test the rest of your layer visibility patches.  If you want
these to make it into rc1, please send me this patch as an attachment
soon.  I am planning to branch rc1 by Friday at the latest.



[1]: https://lists.launchpad.net/kicad-developers/msg34009.html

On 2/19/2018 10:05 AM, Andrzej Wolski wrote:
Patch (in attachment) for "Tracks" turned out to be very simple.
If it gets accepted, I could make more of these.


On 02/19/2018 02:12 PM, Andrzej Wolski wrote:
It would be also nice to have separate controls for:
1. Tracks
2. Drawing primitives (graphic lines, arcs, and circles)
3. Zones
4. Polygons
5. Text (now there is control only for footprint text)
6. Dimensions
7. Plated holes

That would make Render tab (almost) complete.


W dniu 2018-02-18 o 21:00, Jon Evans pisze:
Hi all,

Right now the behavior of the "Layer" and "Render" tabs of the
widget are confusing to users, resulting in complaints on the forum
and some bug reports:


I could take a crack at fixing this (before or after 5.0
depending on
what the complexity ends up being) but before I write any code I
wanted to propose how I think it should work.

I think the visibility of any object should be the AND of layer
visibility and render visibility.

To get there:

1) In the Render tab, get rid of the distinction between front/back.
For example "Pads Back" and "Pads Front" becomes just "Pads"

2) Change the visibility code so that an object is visible if (a)
associated Render setting is turned on for the type of object, and
(b) at least one of the layers the object is on is enabled in the
Layers tab.

3) (optionally) Rename "Render" to something more friendly like
"Items" or "Item Types" to make it more clear to the user that this
is where they can turn off the display of various types of items as
opposed to various layerse

If this plan is OK, I will start working out the details of how to
get there.  Right now the Render tab is directly controlling the
visibility of certain "GAL Layers" but unfortunately the set of
objects that appears on one GAL layer is not always equal to the set
of objects that the user would expect to turn on and off, as seen by
the bug reports.  So, there will have to be some additional logic
created to manage these settings beyond just turning on and off
layers in the GAL.


Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

>From 225e8641fbeffd39f7e2e17cff397a0a70cf22cf Mon Sep 17 00:00:00 2001
From: Andrzej Wolski <awolski.ki...@gmail.com>
Date: Thu, 22 Feb 2018 07:53:16 +0100
Subject: [PATCH 1/2] Do not allow selecting tracks if they are hidden
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.7.4"

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

This is a complementary patch to dbafdd39.
 pcbnew/collectors.cpp           |  2 ++
 pcbnew/collectors.h             | 10 ++++++++++
 pcbnew/pcb_base_frame.cpp       |  1 +
 pcbnew/tools/selection_tool.cpp |  8 ++++++++
 4 files changed, 21 insertions(+)

Content-Type: text/x-patch; name="0001-Do-not-allow-selecting-tracks-if-they-are-hidden.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Do-not-allow-selecting-tracks-if-they-are-hidden.patch"

diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp
index cd692ad..2219886 100644
--- a/pcbnew/collectors.cpp
+++ b/pcbnew/collectors.cpp
@@ -254,6 +254,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
     case PCB_TRACE_T:
+        if( m_Guide->IgnoreTracks() )
+            goto exit;
     case PCB_ZONE_T:
diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h
index 1205fb3..baece4d 100644
--- a/pcbnew/collectors.h
+++ b/pcbnew/collectors.h
@@ -179,6 +179,11 @@ public:
     virtual     bool IgnoreMicroVias() const = 0;
+     * @return true if should ignore tracks
+     */
+    virtual     bool IgnoreTracks() const = 0;
+    /**
      * @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
      *             or false if Inspect() should use BOARD_ITEM::BoundsTest().
     virtual     bool UseHitTesting() const = 0;
@@ -393,6 +398,7 @@ private:
     bool    m_IgnoreThroughVias;
     bool    m_IgnoreBlindBuriedVias;
     bool    m_IgnoreMicroVias;
+    bool    m_IgnoreTracks;
@@ -434,6 +440,7 @@ public:
         m_IgnoreThroughVias         = false;
         m_IgnoreBlindBuriedVias     = false;
         m_IgnoreMicroVias           = false;
+        m_IgnoreTracks              = false;
@@ -564,6 +571,9 @@ public:
     bool IgnoreMicroVias() const override { return m_IgnoreMicroVias; }
     void SetIgnoreMicroVias( bool ignore ) { m_IgnoreMicroVias = ignore; }
+    bool IgnoreTracks() const override { return m_IgnoreTracks; }
+    void SetIgnoreTracks( bool ignore ) { m_IgnoreTracks = ignore; }
diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp
index bebba21..e3b0ff4 100644
--- a/pcbnew/pcb_base_frame.cpp
+++ b/pcbnew/pcb_base_frame.cpp
@@ -688,6 +688,7 @@ GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
     guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIA_THROUGH ) );
     guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIA_BBLIND ) );
     guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIA_MICROVIA ) );
+    guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
     return guide;
diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp
index 65f73d1..527d69a 100644
--- a/pcbnew/tools/selection_tool.cpp
+++ b/pcbnew/tools/selection_tool.cpp
@@ -444,6 +444,7 @@ const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const
     guide.SetIgnoreThroughVias( ! board()->IsElementVisible( LAYER_VIA_THROUGH ) );
     guide.SetIgnoreBlindBuriedVias( ! board()->IsElementVisible( LAYER_VIA_BBLIND ) );
     guide.SetIgnoreMicroVias( ! board()->IsElementVisible( LAYER_VIA_MICROVIA ) );
+    guide.SetIgnoreTracks( ! board()->IsElementVisible( LAYER_TRACKS ) );
     return guide;
@@ -1543,6 +1544,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
+    case PCB_TRACE_T:
+        {
+            if( !board()->IsElementVisible( LAYER_TRACKS ) )
+                return false;
+        }
+        break;
     case PCB_VIA_T:
             const VIA* via = static_cast<const VIA*>( aItem );


Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to