pcb

Route style selection error

Bug #699299 reported by nobody
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Medium
Andrew Poelstra

Bug Description

Using pcb-20081128, if I change the route sytle using the 'a' key, the 'route style' selection at the bottom left is not updated. So, if I:

Select route style "signal"
Place the cursor over a track routed with style "fat" and press 'a'
Select route style "signal" again

Then the route style displayed at the bottom left stays at "signal" throughout, and despite reselecting "signal", I end up drawing "fat" tracks.

Revision history for this message
Ineiev (ineiev) wrote :

This action (SetSame) changes current style settings; it does not select the style that matches (which would be generally impossible, because the track may not match any route style).

In other words, you do route with "signal" style, but it has become similar to "fat".

HTH

Revision history for this message
Ineiev (ineiev) wrote :

Sorry for misinformation. there is a misfeature in GTK RouteStylesChanged() function.
can you try this patch?

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index cbdd104..5600eb0 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -1707,6 +1707,7 @@ RouteStylesChanged (int argc, char **argv, int x, int y)
   if (PCB && PCB->RouteStyle[0].Name)
     for (n = 0; n < NUM_STYLES; ++n)
       ghid_route_style_set_button_label ((&PCB->RouteStyle[n])->Name, n);
+ ghid_route_style_buttons_update ();
   return 0;
 }

diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index ca17446..6803d76 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1902,6 +1902,9 @@ ghid_route_style_buttons_update (void)
   RouteStyleType *rst;
   gint i;

+ if (NULL == PCB)
+ return;
+
   for (i = 0; i < NUM_STYLES + 2; ++i)
     {
       if (i < NUM_STYLES)

Revision history for this message
nobody (nobody-users) wrote :

Sorry, been away. You are quite correct, I did this:

diff -r pcb-20081128/src/hid/gtk/gtkhid-main.c pcb-20081128-patched/src/hid/gtk/gtkhid-main.c
1712,1713c1712,1716
< for (n = 0; n < NUM_STYLES; ++n)
< ghid_route_style_set_button_label ((&PCB->RouteStyle[n])->Name, n);
---
> {
> for (n = 0; n < NUM_STYLES; ++n)
> ghid_route_style_set_button_label ((&PCB->RouteStyle[n])->Name, n);
> ghid_route_style_buttons_update();
> }
diff -r pcb-20081128/src/hid/gtk/gui-top-window.c pcb-20081128-patched/src/hid/gtk/gui-top-window.c
247c247
< static GtkWidget *route_style_edit_button;
---
> static GtkWidget *route_style_edit_button=0;
1887c1887
< if (n < 0 || n >= N_ROUTE_STYLES)
---
> if (n < 0 || n >= N_ROUTE_STYLES || !route_style_button[n].button)
1926,1927c1926,1927
<
< gtk_widget_set_sensitive (route_style_edit_button,
---
> if (route_style_edit_button)
> gtk_widget_set_sensitive (route_style_edit_button,

Which is much the same. Personally I think (without much consideration, I admit) that it would be better if SetSame DID try to match a route style. If I hit 'a' over a signal track, I would like to be able then to draw a new track which, if I use number keys to switch layer, uses the right size via. Currently if I've been using 'fat', then his 'a' over a signal track, I'll end up with silly via sizes. Surely if a track width matches a defined route style, SetSame could assume you want all of that style (including via sizes); if it doesn't match any style then do as it does now ?

Revision history for this message
Ineiev (ineiev) wrote :

> Personally I think (without much consideration, I
> admit) that it would be better if SetSame DID try to match a route style...
...
> ...Surely if a track width matches a
> defined route style, SetSame could assume you want all of that style
> (including via sizes); if it doesn't match any style then do as it does now?

Probably, yes. I have no strong preference, though. perhaps, it's worth to be discussed on geda-users mailing list.

Revision history for this message
Peter TB Brett (peter-b) wrote :

My gut feeling is that the Right Thing in this case is to:

if (find style by track width)
    set style to found style and update radio buttons
else
    deselect all style radio buttons
endif

Felix Ruoff (felixruoff)
tags: added: accelerators
Andrew Poelstra (asp11)
Changed in pcb:
assignee: nobody → Andrew Poelstra (asp11)
status: New → Confirmed
Revision history for this message
gpleda.org commit robot (gpleda-launchpad-robot) wrote :

Bug was fixed by a commit
git master commit 4e241279907be0bc3d7753fb6d499b8551a13cda
http://git.gpleda.org/?p=pcb.git;a=commit;h=4e241279907be0bc3d7753fb6d499b8551a13cda

commit 4e241279907be0bc3d7753fb6d499b8551a13cda
Author: Andrew Poelstra <email address hidden>
Commit: Andrew Poelstra <email address hidden>

    gtk: allow route style selector to have nothing selected

    The affects the the function ghid_route_style_selector_sync() function,
    which is called from the RouteStylesChanged action to keep the GUI in
    sync with pcb's state. It selects the route style that matches pcb's
    state, or if none exists, does nothing.

    This patch replaces "does nothing" with "deselects all styles", so that
    the GUI will not be misleading.

    Closes-bug: lp-699299

Changed in pcb:
status: Confirmed → Fix Committed
Changed in pcb:
status: Fix Committed → Fix Released
Changed in pcb:
milestone: next-bug-release → pcb-20140316
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.