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

Re: gEDA-user: PCB+GL testing



On Mon, 2009-10-26 at 10:04 +0100, michalwd1979 wrote:
> Hello,
> 
> Today I've done all possible tests with new, freshly compiled 3d pcb
> using available PCs and these are the results:
> 
> 1) I can not reproduce "strange" crash with drc window on any machine.
> Was it secret testing of new electromagnetic weapon? I'm living close
> to military shipyard by the way.
> 
> 2) On intel graphics card (composite enabled) I also can not reproduce
> crash in pinout window. Here everything works OK (dri2 in use).
> 
> 3) On intel graphics with composite disabled pcb does not start at
> all: Can not set up gl context, then segmantation fault. Strange, but
> rather related to driver not pcb itself.
> 
> 4) On radeon (composite disabled) there are problems when closing
> pinout window.
> 
> 5) On radeon with composite some drawing errors occur, but this is
> rather problem with driver because I can see similar problems with
> other apps. This is also quite complicated system with 2 graphics
> cards and 3 screens (my favorite).


Sounds like GL drivers are going to cause me grief!

> I've also tried to run teardrops() during these test but this did not
> change anything.

Ok, that is good at least. (Although only running under valgrind would
reliably catch if this causes problems).

> And one question: is there any "plugins documentation" for pcb? In my
> wish list there is something that automatically add thermals tools to
> vias on given net and set "don't clear polygons" flag on tracks. I
> think that I will try to write it myself. I've been looking around for
> a while and did not find anything yet.

No documentation, sorry. I've coded up a very hacky start for what you
want to do.. Unfortunately, the APIs I wanted to use to make PCB "find"
the connected objects are burried in find.c and not exposed sufficiently
for me to call them. I could probably have ripped out and duplicated a
load of the find.c code in the plugin, but I think it is useful as is.

Find the net you want to join. Hit "F" to "find" the connected objects.
(Highlighting them in green).

Run action "JoinFound". Presto.

You might want to hack the plugin's code to change the thermal style
number. IIRC:

1,2 = square ish thermals
3   = solid join thermal
4,5 = rounded thermals

************************************
SAVE WORK BEFORE RUNNING THIS ONE ;)
************************************

Best wishes,

Peter C.
/* Join found plug-in for PCB
 *
 * Copyright (C) 2009 Peter Clifton <pcjc2@xxxxxxxxx>
 *
 * Licensed under the terms of the GNU General Public License, version
 * 2 or later.
 *
 * Compile like this:

 * gcc -Wall -I$HOME/pcbsrc/pcb.clean/src -I$HOME/pcbsrc/pcb.clean -O2 -shared join-found.c -o join-found.so
 *
 *  The resulting join-found.so goes in $HOME/.pcb/plugins/join-found.so
 *
 */

#include <stdio.h>
#include <math.h>

#include "global.h"
#include "data.h"
#include "change.h"
#include "undo.h"

#define THERMAL_STYLE 4

static int changed = 0;


/* FIXME: PCB API STOPS ME DOING THIS */
#if 0
static void *
init_line (LayerTypePtr Layer, LineTypePtr Line)
{
  ListStart (LINE_TYPE, NULL, Line, NULL);
  return Line;
}

static void *
init_via (PinTypePtr Via)
{
  ListStart (VIA_TYPE, NULL, Via, NULL);
  return Via;
}

static void *
init_pin (ElementTypePtr Element, PinTypePtr Pin)
{
  ListStart (PIN_TYPE, Element, Pin, NULL);
  return Pin;
}

static void *
init_pad (ElementTypePtr Element, PadTypePtr Pad)
{
  ListStart (PAD_TYPE, Element, Pad, NULL);
  return Pad;
}

static void *
init_arc (LayerTypePtr Layer, ArcTypePtr Arc)
{
  ListStart (ARC_TYPE, Layer, Arc, NULL);
  return Arc;
}

static ObjectFunctionType init_funcs = {
  init_line,
  NULL,
  NULL,
  init_via,
  NULL,
  NULL,
  init_pin,
  init_pad,
  NULL,
  NULL,
  init_arc,
  NULL
};
#endif

static int
joinfound (int argc, char **argv, int x, int y)
{
  int TheFlag = FOUNDFLAG;

  changed = 0;

  /* FIXME: PCB API STOPS ME DOING THIS */
#if 0
  TheFlag = FOUNDFLAG; // | DRCFLAG;
  SaveFindFlag (TheFlag);
  InitConnectionLookup ();
  ResetConnections (False);
  SelectedOperation (init_funcs, False, LINE_TYPE | ARC_TYPE | PIN_TYPE | VIA_TYPE | PAD_TYPE);
  DoIt (True, False);
#endif

  VISIBLELINE_LOOP (PCB->Data);
  {
    if (TEST_FLAG (TheFlag, line))
      {
        ChangeObjectJoin (LINE_TYPE, layer, line, line);
        changed = True;
      }
  }
  ENDALL_LOOP;

  VISIBLEARC_LOOP (PCB->Data);
  {
    if (TEST_FLAG (TheFlag, arc))
      {
        ChangeObjectJoin (ARC_TYPE, layer, arc, arc);
        changed = True;
      }
  }
  ENDALL_LOOP;

  if (PCB->PinOn)
    ELEMENT_LOOP (PCB->Data);
  {
    PIN_LOOP (element);
    {
      if (TEST_FLAG (TheFlag, pin))
        {
          ChangeObjectThermal (PIN_TYPE, element, pin, pin, THERMAL_STYLE);
          changed = True;
        }
    }
    END_LOOP;
  }
  END_LOOP;

  if (PCB->ViaOn)
    VIA_LOOP (PCB->Data);
  {
    if (TEST_FLAG (TheFlag, via))
      {
        ChangeObjectThermal (VIA_TYPE, via, via, via, THERMAL_STYLE);
        changed = True;
      }
  }
  END_LOOP;

  /* FIXME: PCB API STOPS ME DOING THIS */
#if 0
  ResetConnections (False);
  FreeConnectionLookupMemory ();
  RestoreFindFlag ();
#endif

  gui->invalidate_all ();

  if (changed)
    IncrementUndoSerialNumber ();

  return 0;
}

static HID_Action joinfound_action_list[] = {
  {"JoinFound", NULL, joinfound,
   NULL, NULL}
};

REGISTER_ACTIONS (joinfound_action_list)

void
pcb_plugin_init()
{
  register_joinfound_action_list();
}

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