[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (ec9a0db5fdefe76066f367f8338498001ccf0b6f)



The branch, master has been updated
       via  ec9a0db5fdefe76066f367f8338498001ccf0b6f (commit)
      from  3edbf8c94a811c9d073910934bc9c676d1225f78 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/autoroute.c |   58 ++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 17 deletions(-)


=================
 Commit Messages
=================

commit ec9a0db5fdefe76066f367f8338498001ccf0b6f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    autoroute.c: Utilise new HID interface for debug drawing
    
    This gives the HID an opportunity to refuse the autorouter's drawing.
    Both the GTK/GDK and Lesstif GUIs accept this drawing, so either should
    be suitable for use whilst debugging workings of the auto-router.
    
    The PCB+GL renderer (not yet landed) needs quite a lot of setup calls to
    be made before it can allow the core do draw, hence the need for this
    notification / permissioning.

:100644 100644 d752231... d419031... M	src/autoroute.c

=========
 Changes
=========

commit ec9a0db5fdefe76066f367f8338498001ccf0b6f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    autoroute.c: Utilise new HID interface for debug drawing
    
    This gives the HID an opportunity to refuse the autorouter's drawing.
    Both the GTK/GDK and Lesstif GUIs accept this drawing, so either should
    be suitable for use whilst debugging workings of the auto-router.
    
    The PCB+GL renderer (not yet landed) needs quite a lot of setup calls to
    be made before it can allow the core do draw, hence the need for this
    notification / permissioning.

diff --git a/src/autoroute.c b/src/autoroute.c
index d752231..d419031 100644
--- a/src/autoroute.c
+++ b/src/autoroute.c
@@ -140,6 +140,7 @@ return dir;
 }
 
 #ifdef ROUTE_DEBUG
+HID *ddraw = NULL;
 static hidGC ar_gc = 0;
 #endif
 
@@ -1470,16 +1471,17 @@ showbox (BoxType b, Dimension thickness, int group)
   if (showboxen != -1 && showboxen != group)
     return;
 
-
-  gui->set_line_width (ar_gc, thickness);
-  gui->set_line_cap (ar_gc, Trace_Cap);
-  gui->set_color (ar_gc, SLayer->Color);
-
-  gui->draw_line (ar_gc, b.X1, b.Y1, b.X2, b.Y1);
-  gui->draw_line (ar_gc, b.X1, b.Y2, b.X2, b.Y2);
-  gui->draw_line (ar_gc, b.X1, b.Y1, b.X1, b.Y2);
-  gui->draw_line (ar_gc, b.X2, b.Y1, b.X2, b.Y2);
-  gui->use_mask (HID_FLUSH_DRAW_Q);
+  if (ddraw != NULL)
+    {
+      ddraw->set_line_width (ar_gc, thickness);
+      ddraw->set_line_cap (ar_gc, Trace_Cap);
+      ddraw->set_color (ar_gc, SLayer->Color);
+
+      ddraw->draw_line (ar_gc, b.X1, b.Y1, b.X2, b.Y1);
+      ddraw->draw_line (ar_gc, b.X1, b.Y2, b.X2, b.Y2);
+      ddraw->draw_line (ar_gc, b.X1, b.Y1, b.X1, b.Y2);
+      ddraw->draw_line (ar_gc, b.X2, b.Y1, b.X2, b.Y2);
+    }
 
 #if 1
   if (b.Y1 == b.Y2 || b.X1 == b.X2)
@@ -1524,23 +1526,26 @@ showedge (edge_t * e)
 {
   BoxType *b = (BoxType *) e->rb;
 
-  gui->set_line_cap (ar_gc, Trace_Cap);
-  gui->set_line_width (ar_gc, 1);
-  gui->set_color (ar_gc, Settings.MaskColor);
+  if (ddraw == NULL)
+    return;
+
+  ddraw->set_line_cap (ar_gc, Trace_Cap);
+  ddraw->set_line_width (ar_gc, 1);
+  ddraw->set_color (ar_gc, Settings.MaskColor);
 
   switch (e->expand_dir)
     {
     case NORTH:
-      gui->draw_line (ar_gc, b->X1, b->Y1, b->X2, b->Y1);
+      ddraw->draw_line (ar_gc, b->X1, b->Y1, b->X2, b->Y1);
       break;
     case SOUTH:
-      gui->draw_line (ar_gc, b->X1, b->Y2, b->X2, b->Y2);
+      ddraw->draw_line (ar_gc, b->X1, b->Y2, b->X2, b->Y2);
       break;
     case WEST:
-      gui->draw_line (ar_gc, b->X1, b->Y1, b->X1, b->Y2);
+      ddraw->draw_line (ar_gc, b->X1, b->Y1, b->X1, b->Y2);
       break;
     case EAST:
-      gui->draw_line (ar_gc, b->X2, b->Y1, b->X2, b->Y2);
+      ddraw->draw_line (ar_gc, b->X2, b->Y1, b->X2, b->Y2);
       break;
     default:
       break;
@@ -3667,6 +3672,11 @@ TracePath (routedata_t * rd, routebox_t * path, const routebox_t * target,
 
   if (TEST_FLAG (LIVEROUTEFLAG, PCB))
     Draw ();
+
+#ifdef ROUTE_DEBUG
+  if (ddraw != NULL)
+    ddraw->flush_debug_draw ();
+#endif
 }
 
 /* create a fake "edge" used to defer via site searching. */
@@ -5111,6 +5121,15 @@ AutoRoute (bool selected)
   total_wire_length = 0;
   total_via_count = 0;
 
+#ifdef ROUTE_DEBUG
+  ddraw = gui->request_debug_draw ();
+  if (ddraw != NULL)
+    {
+      ar_gc = ddraw->make_gc ();
+      ddraw->set_line_cap (ar_gc, Round_Cap);
+    }
+#endif
+
   for (i = 0; i < NUM_STYLES; i++)
     {
       if (PCB->RouteStyle[i].Thick == 0 ||
@@ -5273,6 +5292,11 @@ donerouting:
 	  r_search (rd->layergrouptree[i], &big, NULL, ripout_livedraw_obj_cb, NULL);
 	}
     }
+#ifdef ROUTE_DEBUG
+  if (ddraw != NULL)
+    ddraw->finish_debug_draw ();
+#endif
+
   if (changed)
     changed = IronDownAllUnfixedPaths (rd);
   Message ("Total added wire length = %f inches, %d vias added\n",




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs