geda-pcb/pcjc2.git
6 years agoDebug polygon stuffpcb+gl_experimental/debug-polygon-stuff
Peter Clifton [Sat, 7 Nov 2009 10:34:59 +0000 (7 10:34 +0000)]
Debug polygon stuff

6 years agoBenchmark on loadpcb+gl_experimental/benchmark-on-load
Peter Clifton [Tue, 9 Nov 2010 20:43:39 +0000 (9 20:43 +0000)]
Benchmark on load

6 years agoDisable DRC checks on "outline" and "route" layerspcb+gl_experimental/disable-drc-checks-on-outline-
Peter Clifton [Tue, 23 Nov 2010 15:32:47 +0000 (23 15:32 +0000)]
Disable DRC checks on "outline" and "route" layers

6 years agoPlay with render to texture stuffpcb+gl_experimental/play-with-render-to-texture-st
Peter Clifton [Fri, 26 Nov 2010 16:50:13 +0000 (26 16:50 +0000)]
Play with render to texture stuff

6 years agoAdd VRML model rendering support
Peter Clifton [Sun, 13 Nov 2011 00:19:21 +0000 (13 00:19 +0000)]
Add VRML model rendering support

XXX: Why did we change various double typed parameters to float in this patch??

6 years agoRevert "Just make a black background."
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Revert "Just make a black background."

This reverts commit cf6c95ade3be149a5a8659bd13a80eedc4092fd2.

6 years agoDisable texturing the board's soldermask
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Disable texturing the board's soldermask

6 years agoAdd a load more hacky models for test rendering
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Add a load more hacky models for test rendering

6 years agoAdd a demonstration model for rendering ACY series resistors
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Add a demonstration model for rendering ACY series resistors

Play with some lighting effects (SLOW!!!)
Play with shaders and lighting goodness

Oops, nasty hack due to unknown code changes on merge. Left merge comments commented out for now.

6 years agoJust make a black background.
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Just make a black background.

6 years agoRe-write ghid_set_layer() for some reason (can't recall why!)
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Re-write ghid_set_layer() for some reason (can't recall why!)

6 years agoWin32: Fix build for win32
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
Win32: Fix build for win32

6 years agohidgl: Attempt at fixing ORTHO view
Peter Clifton [Wed, 6 Jan 2016 23:28:35 +0000 (6 23:28 +0000)]
hidgl: Attempt at fixing ORTHO view

6 years agoPlay with perspective
Peter Clifton [Wed, 6 Jan 2016 23:28:34 +0000 (6 23:28 +0000)]
Play with perspective

NB: Edit to hidgl.c:

+#if 0
+  glPushAttrib (GL_CURRENT_BIT);
+  glColor4f (1., 1., 1., 1.);
+  glDrawArrays (GL_LINE_STRIP, 0, priv->buffer.vertex_count);
+  glPopAttrib ();
+#endif

Is probably bogus. (Leftover debug?)

6 years agoDraw polygons in a more intelligent order
Peter Clifton [Wed, 6 Jan 2016 23:28:34 +0000 (6 23:28 +0000)]
Draw polygons in a more intelligent order

A sub-compositing stencil bit "S" is used to avoid overlapping polygons.

PASS 1a. Draw all non holed "SOLID" polygons which don't clear other
         geometry.

PASS 1b. Draw all "SOLID" polygons with holes.
         --
         In addition to "S", A second stencil bit, "H" is required for
         each of these polygons. Both are masked against. After each
         polygon drawn, a new "S" stencil bit is required.

PASS 2.  Mask out all clearance holes from other geometry.
         --
         As this is a polygon ONLY layer being subcomposited, this masking
         can be done directly on the "S" bit-plane.

PASS 3a. Draw all polygons which only feature clearance holes
PASS 3b. Draw all polygons which have user-defined holes.
         --
         In addition to "S", a second stencil bit, "H" is required for
         each of these polygons. Both are masked against. After each
         polygon drawn, a new "S" stencil bit is required.

NB: In this version. PASS 2 and 3 are carried out concurrently, although
    for boards with heavily overlapping polygons, it may be faster to
    mask out clearance for everything at once.

V2: We have to force a new stencil bit for each piece of a "fullpoly" polygon
as a hole in the first POLYAREA should not prevent a second POLYAREA of the
same polygon being drawn inside that hole. In this regard, we need to treat
"fullpoly" polygons as if they contained user holes.

6 years agoTry a new, different sized VBO buffer for each upload.
Peter Clifton [Wed, 6 Jan 2016 23:28:34 +0000 (6 23:28 +0000)]
Try a new, different sized VBO buffer for each upload.

6 years agoCache polygon contour tri-strip tesselations (HACK: IN THE CORE!)
Peter Clifton [Wed, 6 Jan 2016 23:28:34 +0000 (6 23:28 +0000)]
Cache polygon contour tri-strip tesselations (HACK: IN THE CORE!)

This is a bit of a KLUDGE really, we should not push data
into the core like this.

6 years agoPlay with GLSL shader for rendering line caps and circles
Peter Clifton [Wed, 6 Jan 2016 23:28:34 +0000 (6 23:28 +0000)]
Play with GLSL shader for rendering line caps and circles

And of course.. typically, a million other little fixes:

 - Primitive rendering object changed from GL_TRIANGLES to GL_TRIANGLE_STRIP
 - Cache of tristrip data per contour (HACK: in the core)
 - Rendering using mapped VBOs rather than just arrays
 - Updated layer depth code, so we render with "z" in world coordinates
 - Space navigator joystick support fixes against later kernels

Bugs:
 - Layer depths will be wrong for reversed layer group numbering
 - Pixel shader ought to be switched off for polygon fill?
 - hidgl_draw_rect stubbed out (for benchmarking)
 - Draw Element mark stubbed out (for benchmarking)
 - Draw crosshair stubbed out (for benchmarking)
 - Draw crosshair not updated to render in world coordinates

Notes:
 - Apparently it can be better to do glVertexPointer last (so we do):
    From: http://sdickinson.com/wordpress/?p=122
    ""
    Make sure you put glVertexPointer at the end as there is a lot of work that
    goes on behind the scenes with it, and if it's set at the start, it has to
    do all that work for each gl*Pointer call, rather than once at the end.
    ""

 - We set up the array pointers before calling glEnableClientState():
    I'm not sure, but if we do this the other way around, it might cause
    the driver to hang onto our old buffers longer, or perform state setup,
    only to have to discard that work shortly after.

 - DARN: Seems that using VBOs is not a win, even on Intel 965:
    Certainly seems to fail miserably (v. low FPS) on my NVidia card.

    On Intel, sysprof shows a huge amount of time spent clflushing
    buffers, or copying to the graphics card (uncached).

    Set to use glBufferSubData by default for now.

6 years agohid/gtk (GL): I think the polygon renderer works in mask mode now
Peter Clifton [Wed, 6 Jan 2016 23:27:16 +0000 (6 23:27 +0000)]
hid/gtk (GL): I think the polygon renderer works in mask mode now

6 years agoPut back layer opacity to its old behaviour
Peter Clifton [Wed, 6 Jan 2016 23:27:16 +0000 (6 23:27 +0000)]
Put back layer opacity to its old behaviour

The exact details of this setting aren't right yet,
so revert them so I can build a release.

6 years agoPCB+GL: Fix GL headers for Win32
Peter Clifton [Wed, 6 Jan 2016 23:27:16 +0000 (6 23:27 +0000)]
PCB+GL: Fix GL headers for Win32

6 years agohid/common/hidgl: Debug out of context rendering
Peter Clifton [Wed, 6 Jan 2016 23:27:16 +0000 (6 23:27 +0000)]
hid/common/hidgl: Debug out of context rendering

6 years agoHack to avoid GL calls when we're out of context
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Hack to avoid GL calls when we're out of context

6 years agoAdd cache for board-outline
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Add cache for board-outline

This adds a cache of the board outline, to improve rendering speed
when plotting the board with an outline.

The cache is invalidated when the "outline" or "route" layer is
updated. We catch this by bodging the ClearFromPolygon() routine,
which is called for almost all layer geometry changes which might
affect us.

XXX: We really need to add a nicer place to be notified of board
layer changes!

6 years agoBoard outline polygon generation
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Board outline polygon generation

FIXME: Make this work with the GL masking polygon drawing routines, rather
       than relying on the dicer.

6 years agoAdd routines to render just a single contour
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Add routines to render just a single contour

Use them rather than the GLU tessellator

6 years agoBORAST: Fixup to only draw the passed POLYAREA, not walk the linked list of POLYAREA...
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
BORAST: Fixup to only draw the passed POLYAREA, not walk the linked list of POLYAREA and draw them all!

6 years agoborast: Win32: Comment #define in borast-compiler-private.h
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
borast: Win32: Comment #define in borast-compiler-private.h

6 years agoFix borast not to build for non-GL enabled builds
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Fix borast not to build for non-GL enabled builds

6 years agoBentley-Ottann test implementation
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Bentley-Ottann test implementation

Code from cairo - intersection routines stripped out

XXX: Appears to be some breakage in demo.pcb (See top LHS component layer polygons)

6 years agoSilly space navigator interface to allow funky views
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Silly space navigator interface to allow funky views

6 years agoDraw pin / pad names first, so they don't get masked by the pad
Peter Clifton [Wed, 6 Jan 2016 23:27:15 +0000 (6 23:27 +0000)]
Draw pin / pad names first, so they don't get masked by the pad

Since we use stencil masking to ensure we don't redraw an area
multiple times, confusingly, we need to draw the text first to
ensure it isn't occluded by the pad its-self.

HACK:

We probably draw the names multiple times - as we still use the
common draw.c code which assumes it can draw labels on top of
the pads.

6 years agogtk/gl: Play with layer translucency
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
gtk/gl: Play with layer translucency

6 years agoAdd support for drawing objects from the soldermask layer
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Add support for drawing objects from the soldermask layer

6 years agoFixup code to determine whether we draw pins/vias on a given layer
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Fixup code to determine whether we draw pins/vias on a given layer

The net change of this patch is that we consider whether to draw pins/vias
for each layer within the layer group. Previously, if we encoundered a layer
named "outline" or "route" within the layer group, all _subsequent_ layers
within that group would not have their pins/vias rendered.

As ordering of the layers within the group should not be important like this,
change behaviour to apply test on a per-layer basis.

6 years agodraw_funcs.c: Don't draw pins/vias in layer for non GUI exporters
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
draw_funcs.c: Don't draw pins/vias in layer for non GUI exporters

The non-gui paths render pins and vias with draw_ppv, so no need to
also render them for each layer.

6 years agoAdd HID_DRAW * parameters to various Draw*() function called from the GTK hid
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Add HID_DRAW * parameters to various Draw*() function called from the GTK hid

6 years agoFixup gtkhid-gl to build
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Fixup gtkhid-gl to build

6 years agoMajor re-write to drawing routines
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Major re-write to drawing routines

FIXME: FULLY OF NASTY API HACKS TO draw.c

Notes from squashed patches:
  Pin and via hole cores are drawn in the appropriate colour
  Playing with stack rendering order
  Fix mask display in 3D (Allow both side masks to display at once)
  Fix rendering depths for silk and mask layers
  Fixup depth for layers and element marks
  Move more rendering to world coordinates
  Fix get_coords function
  Re-write parts of the PCB+GL set_layer function
  Fix layer on/off rendering after commit 9768e060fad7bc3dfc366da76ea1db8154005018
  Only assign stencil planes where sub-compositing is required - that is, not the far-side, mask, rat or switched off layers.
  Pass an explicit graphics context to DrawAttached and DrawMark

6 years agoTMP FIXES
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
TMP FIXES

6 years agoDRAW_FUNCS: Attempt at different render order for PCB+GL
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
DRAW_FUNCS: Attempt at different render order for PCB+GL

6 years agoFixup gtkhid-gl.c to accomodate depth being set per hidgl context
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Fixup gtkhid-gl.c to accomodate depth being set per hidgl context

6 years agoShiny 3D eye-candy
Peter Clifton [Wed, 6 Jan 2016 23:27:14 +0000 (6 23:27 +0000)]
Shiny 3D eye-candy

Experiments in progress - don't expect this to work yet!

Squashed:
  Fix grid extents in 3D view

6 years agoCrasy test
Peter Clifton [Wed, 6 Jan 2016 23:27:13 +0000 (6 23:27 +0000)]
Crasy test

6 years agoTidy up range check in misc.c
Peter Clifton [Wed, 6 Jan 2016 23:18:13 +0000 (6 23:18 +0000)]
Tidy up range check in misc.c

For consistnecy with other range checks involving max_copper_layer, and to
drive home the fact we are checking for exceeding max_copper_layer + 2.
NB: The +2 relates to the bottom silk and top-silk layers, whose numbers
are used to denote the bottom and top layer groups respectively.

re-write:
  layer > max_copper_layer + 1

to become:
  layer >= max_copper_layer + 2

6 years agoFixup some bugs from the added soldermask layers
Peter Clifton [Wed, 6 Jan 2016 23:18:13 +0000 (6 23:18 +0000)]
Fixup some bugs from the added soldermask layers

(TODO: Finish this fixup and merge it down into the relevant patches)

6 years agodraw.c: Opencode the mask layer object drawing functions
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
draw.c: Opencode the mask layer object drawing functions

Calling DrawLayer() did not render using the correct graphics context / colors.
NB: We're still using the "wrong" GC, but we now avoid selecting inappropriate
colors which prevent (say) PS export working correctly for mask layer objects.

6 years agoAdd support for a two soldermask layers, defining regions of removed mask
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Add support for a two soldermask layers, defining regions of removed mask

File-format wise, these work similarly to how silk layers are supported now:

Layer (1 to n "[NAME]")            # "ordinary" design layers
Layer (n+1 "silk")                 # bottom side silk
Layer (n+2 "silk")                 # top side silk
Layer (n+3 "bottom soldermask")    # bottom side soldermask
Layer (n+4 "top soldermask")       # top side soldermask

6 years agoAvoid hard-coding the number of extra layers in use (for 2x silkscreen)
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Avoid hard-coding the number of extra layers in use (for 2x silkscreen)

We will shorty add support for soldermask layers, so this will need changing

NOTE....... IF THE parse_y.y patch in the stg series before this gets
dropped, there is one more case where + 2 needs to be replaced with EXTRA_LAYERS

6 years agofind.c: The User varaible needs to die...
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
find.c: The User varaible needs to die...

Reduce its usage to where absolutely necessary... oh, what a surprise,
another variable passing state down into add_object_to_list ()

6 years agoAdd the drc flag as a parameter
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Add the drc flag as a parameter

Ok, this is nasty.. I'm obscuring setting of the global varaible... be careful!

6 years agoAdd the bloat as a parameter
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Add the bloat as a parameter

Ok, this is nasty.. I'm obscuring setting of the global varaible... be careful!

6 years agofind.c: Refactor some common sequences into a helper function
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
find.c: Refactor some common sequences into a helper function

6 years agoparse_y.y: Try to avoid two shift/reduce and reduce/reduce warnings
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
parse_y.y: Try to avoid two shift/reduce and reduce/reduce warnings

TODO: Check this matches up against our expected behavior.

Removing the parsedata section ("I think") has no effect, as elements
hit the alternative | element clause within parsepcb.

HOWEVER... I need to check whether there is any other valid syntax
inside an element file, or any backwards compatibility with old formats
which we may miss with the loss of parsedata.

6 years agoPlay with grid snapping heuristics a little
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Play with grid snapping heuristics a little

Require the pointer to be inside the bounding box of a pin / pad / via before snapping.
This makse it MUCH easier to place vias in a regular grid spaced at the PCB grid spacing.

6 years agoAdd hysteresis to grid-snapping
Peter Clifton [Wed, 6 Jan 2016 23:18:12 +0000 (6 23:18 +0000)]
Add hysteresis to grid-snapping

6 years agoRemove graphics pointer from HID structure
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Remove graphics pointer from HID structure

6 years agoPass a HID_DRAW * instance to hid_expose_callback() rather than a HID * pointer
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Pass a HID_DRAW * instance to hid_expose_callback() rather than a HID * pointer

Drawing should eventually be independent of the HID

6 years agoFixup draw.c not to special case based on HID name, use flags instead
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Fixup draw.c not to special case based on HID name, use flags instead

6 years agohidgl: Provide more explicit management of rendering instances
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
hidgl: Provide more explicit management of rendering instances

Provide an (hidgl_instance *) pointer which is used to refer to a hidgl
instance when caling hidgl_* APIs that are instance, but not hidGC specific.

Various hidgl APIs now take the hidgl_instance as a parameter, or in the case
of hidgl_new_instance(), return a new instance.

Graphics APIs which previously had a hidGC parameter remain the same, as the
hidglGC structure now contains a link to the hidgl instance which created it.

This change paves the way to potentially having multiple hidgl instances active
simultaneously, and removes various global variables (such as "buffer" and
"global_depth") which were previously accessible to allow the gtk-gl HID to
draw using the hidgl internals.

The gtk-gl HID_DRAW graphics API now subclasses the hidgl HID_DRAW API, so the
gtk-gl HID can access the (non-private) gtk_gc->hidgl_gc.* fields.

6 years agoTEMP: Fixup fallout from nogui change
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
TEMP: Fixup fallout from nogui change

*** Might be nicer to just implement a no-op end_layer function for each HID_DRAW?

6 years agoMove some fields from the HID* structure to HID_DRAW* and HID_DRAW_CLASS*
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Move some fields from the HID* structure to HID_DRAW* and HID_DRAW_CLASS*

The parameters gui, poly_before, poly_after only effect rendering, so
belong in either the HID_DRAW_CLASS or HID_DRAW instance structure.

The set_layer() and end_layer() APIs also belong in the HID_DRAW_CLASS

We leave a copy of the "gui" flag in the HID structure, as main.c uses
this to count up each type of exporter.

XXX: THIS BREAKS SOME EXPORERS WHICH RELY ON THE NO-OP end_layer function
previously initialised in common_nogui_init()

6 years agomain.c: Initialise crosshair unconditionally
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
main.c: Initialise crosshair unconditionally

Since we no longer generate graphics contexts from InitCrosshair(),
there is no need to check gui->gui before calling it.

6 years agoMake HID_DRAW * an instance of the HID_DRAW class, not the API vfunc table
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Make HID_DRAW * an instance of the HID_DRAW class, not the API vfunc table

This allows us to store per-instance parameters in a clean structure.

6 years agoUse calling wrappers rather than accessing HID_DRAW* vfunc tables directly
Peter Clifton [Wed, 6 Jan 2016 23:17:41 +0000 (6 23:17 +0000)]
Use calling wrappers rather than accessing HID_DRAW* vfunc tables directly

6 years agoAdd calling wrappers for HID_DRAW virtual functions
Peter Clifton [Wed, 6 Jan 2016 23:17:40 +0000 (6 23:17 +0000)]
Add calling wrappers for HID_DRAW virtual functions

NB: hid_draw_make_gc() and hid_draw_use_mask() take a HID_DRAW * pointer,
    not a hidGC pointer like all the other hid_draw_*() functions..

Ugly inconsistency, but avoids making the change too disruptive.

6 years agoAdd a pointer in hid_gc_struct to link a gc and the relevant HID_DRAW vfunc table
Peter Clifton [Wed, 6 Jan 2016 23:17:40 +0000 (6 23:17 +0000)]
Add a pointer in hid_gc_struct to link a gc and the relevant HID_DRAW vfunc table

6 years agoRename hidGC "me_pointer" to "hid"
Peter Clifton [Wed, 6 Jan 2016 23:17:40 +0000 (6 23:17 +0000)]
Rename hidGC "me_pointer" to "hid"

The pointer provides a link between a HID specific graphics context and HID
in question, name it accordingly.

6 years agoExpose a base hidGC structure for HIDs to inherit from.
Peter Clifton [Wed, 6 Jan 2016 23:17:40 +0000 (6 23:17 +0000)]
Expose a base hidGC structure for HIDs to inherit from.

Have each HID inherit from a common base structure, which will later allow us
to store enough reference to the HID / HID_DRAW code owning the hidGC to
wrap up the API calls (rather than calling directly into the vfunc table).

6 years agoRemove src/command.h.
Markus Hitter [Mon, 31 Aug 2015 19:54:48 +0000 (31 21:54 +0200)]
Remove src/command.h.

Just old cruft, nowhere used.

6 years agopcbtest.sh: allow spaces in file paths.
Markus Hitter [Mon, 31 Aug 2015 18:13:46 +0000 (31 20:13 +0200)]
pcbtest.sh: allow spaces in file paths.

6 years agopcbtest.sh: simplify, fix running with gdb.
Markus Hitter [Mon, 31 Aug 2015 17:35:53 +0000 (31 19:35 +0200)]
pcbtest.sh: simplify, fix running with gdb.

6 years agoRefine the move from pcb_sprintf() to pcb_snprintf().
Markus Hitter [Mon, 31 Aug 2015 12:48:28 +0000 (31 14:48 +0200)]
Refine the move from pcb_sprintf() to pcb_snprintf().

Using 'const' variables to define buffer sizes wasn't a good idea,
such variables aren't really constant in C. It works for stack-
allocated buffers, but not 'static' ones. Changed all of them to
have one strategy for all cases.

Code builds now fine with --with-gui=gtk, --with-gui=lesstif and
--with-gui=batch.

6 years agoFix action SetThermal(), implement GetUnitlessValue().
Markus Hitter [Sun, 30 Aug 2015 19:58:47 +0000 (30 21:58 +0200)]
Fix action SetThermal(), implement GetUnitlessValue().

The situation before was double-broken. In opposition to the
documentation in the commandline window, SetThermal() required
a second parameter.

The other broken thing was parsing that value, which is just an
index into a list, but was interpreted like a coordinate given in
centimil.

Both are fixed and on top of this, 'style' is now omittable.
There's a default style in every layout, so no need to stress the
user with finding the number of the wanted style.

6 years agoGtk GUI: get help message for (un)loadvendor right.
Markus Hitter [Sun, 30 Aug 2015 16:51:38 +0000 (30 18:51 +0200)]
Gtk GUI: get help message for (un)loadvendor right.

6 years agoRenaming SOT325 footprint to SOT353, adding SC88A footprint.
Bert Timmerman [Sat, 15 Jan 2011 10:58:32 +0000 (15 11:58 +0100)]
Renaming SOT325 footprint to SOT353, adding SC88A footprint.

The current SOT325 footprint (as included in pcb 20100929) gives a wrong footprint w.r.t. pin orientation:

1 |  | 5
  |  | 4
2 |  | 3

this should have been:

1 |  | 5
2 |  |
3 |  | 4

Furthermore, googling for "SOT325" gives:

1) footprints in gedasymbols.org created by DJ.
2) according to www.nxp.com SOT-325-1 is a SDIP20 package (300 mil DIP).

IMO SOT325 should be renamed to SOT-353-1 --> SOT353, or SC-88A (JEITA standard) -->SC88A, or MO-203 (JEDEC standard).
The latter is not a regular name designation in pcb (yet).
All names to be converted without dashes, as not to frustrate M4.

Signed-off-by: Bert Timmerman <bert.timmerman@xs4all.nl>
6 years agoAdd "Report net length" to Menu -> Info in Gtk.
Markus Hitter [Sun, 30 Aug 2015 11:05:31 +0000 (30 13:05 +0200)]
Add "Report net length" to Menu -> Info in Gtk.

Such a useful feature and the Gtk GUI hided it :-/ Lesstif had it
already.

6 years agoAdded translatable tooltips for toolbar buttons.
bert [Tue, 20 May 2014 05:28:36 +0000 (20 07:28 +0200)]
Added translatable tooltips for toolbar buttons.

Signed-off-by: bert <bert.timmerman@xs4all.nl>
6 years agoUse drillsize in ALF packages.
Bert Timmerman [Mon, 12 Dec 2011 06:38:25 +0000 (12 07:38 +0100)]
Use drillsize in ALF packages.

Drillsizes copied from radial can type.
Test for pitch sizes from ALF packages reused.

6 years agoCorrections on the infinite loop in the SIL m4 macro.
Bert Timmerman [Fri, 14 Sep 2012 15:19:04 +0000 (14 17:19 +0200)]
Corrections on the infinite loop in the SIL m4 macro.

Signed-off-by: Bert Timmerman <bert.timmerman@xs4all.nl>
6 years agoImplement regression tests for actions.
Markus Hitter [Tue, 25 Aug 2015 19:37:09 +0000 (25 21:37 +0200)]
Implement regression tests for actions.

First test candidate is MinMaskGap().

Reference files of actions aren't automatically added to
distribution files on --regen, because they're pretty identical
to the original. If it was me, I'd remove all these test result
references from the distribution. They're pointless, too trivial
to learn from.

6 years agoAdd a regression test file for action MinMaskGap().
Markus Hitter [Mon, 24 Aug 2015 15:24:52 +0000 (24 17:24 +0200)]
Add a regression test file for action MinMaskGap().

Unfortunately the test suite doesn't support running actions, yet,
so it's added for later usage.

6 years agoWrite grid size with units.
Markus Hitter [Sat, 29 Aug 2015 18:48:09 +0000 (29 20:48 +0200)]
Write grid size with units.

Apparently this was forgotten earlier.

Reading/parsing code unchanged, so no compatibility issues
expected. Also not considered to be a file format change,
because values are ordered the same, are of the same number
and versions reading this file format must be capable of
reading units already.

This was found when hand-editing a testcase for LP1022076, the
grid size was saved to "funny" numbers, breaking regression tests.

6 years agosrc/action.c: make Rolands patch for MinMaskGap() complete.
Markus Hitter [Mon, 24 Aug 2015 15:05:40 +0000 (24 17:05 +0200)]
src/action.c: make Rolands patch for MinMaskGap() complete.

Moved to a more general solution. Instead of looking at the Hole
flag, the mask offset is now always related to the bigger of
Thickness and DrillingHole.

Also applied the same for vias, which are the GUI way of defining
holes.

Last, all this in only applied if a mask hole existed before at
all. Typical non-mounting-hole vias are fully covered by solder
resist.

6 years agoMinMaskGap() should care about holes.
Robert Drehmel [Thu, 13 Sep 2012 17:16:48 +0000 (13 19:16 +0200)]
MinMaskGap() should care about holes.

MinMaskGap() should care about holes as it does about pins, pads,
and vias. Otherwise, fab houses might complain because the solder
mask doesn't have enough distance to holes.

The problem in detail:

ActionMinMaskGap() checks whether the hole's thickness plus the
specified minimum mask gap is larger than the currently set mask
value. If so, it sets the new mask to be the hole's thickness
plus the specified minimum mask gap value. ActionMinMaskGap()
should check a hole's drilling diameter and base the mask
calculation upon that.

This patch fixes the issue.

... only for pins declared as hole. --Traumflug

6 years agoAntifork: more ignores for bert.
Markus Hitter [Thu, 27 Aug 2015 17:50:31 +0000 (27 19:50 +0200)]
Antifork: more ignores for bert.

6 years agoAntifork: another small speedup.
Markus Hitter [Sat, 29 Aug 2015 15:59:16 +0000 (29 17:59 +0200)]
Antifork: another small speedup.

Also avoids a message "deleting branch" when the branch is
actually only replaced.

6 years agoAntifork: get away without checkouts.
Markus Hitter [Sat, 29 Aug 2015 15:35:04 +0000 (29 17:35 +0200)]
Antifork: get away without checkouts.

This is not only faster and leaves less garbage behind, it also
solves an important point: checking out an older branch means
that the whole directory antifork/ vanishes, so the script's
working directory gets lost. Git relies on having an existing
working directory.

6 years agoEnforce LC_NUMERIC = "C" on the command line, too.
Markus Hitter [Sat, 29 Aug 2015 11:43:38 +0000 (29 13:43 +0200)]
Enforce LC_NUMERIC = "C" on the command line, too.

This was set in the GUI already, but this is too late for command
line processing and not happening at all if there is not GUI.

Finally(!) all tests pass, 'make check' succeeds even with NLS
enabled.

6 years agogcode.c: fix file name creation.
Markus Hitter [Sat, 29 Aug 2015 11:36:53 +0000 (29 13:36 +0200)]
gcode.c: fix file name creation.

Here we want file mode names, too. '.' instead of ','.

Regression tests no almost pass, even with NLS enabled:

  Passed 19, failed 2, skipped 0 out of 21 tests.

6 years agoRemove ascii-printf.c/.h.
Markus Hitter [Sat, 29 Aug 2015 11:14:00 +0000 (29 13:14 +0200)]
Remove ascii-printf.c/.h.

Fare well, ascii_printf() ! You were coded and documented very
carefully. Doing so I learned enough to finally enhance
pcb_printf() to write floats/doubles in file mode, too.

6 years agoReplace/remove of ascii_fprintf() in favour of pcb_fprintf().
Markus Hitter [Sat, 29 Aug 2015 11:09:02 +0000 (29 13:09 +0200)]
Replace/remove of ascii_fprintf() in favour of pcb_fprintf().

Now that pcb_vprintf() respects file mode for generic floats, too,
this works just as fine.

6 years agopcb-printf: replace pcb_sprintf() with pcb_snprintf().
Markus Hitter [Sat, 29 Aug 2015 10:33:40 +0000 (29 12:33 +0200)]
pcb-printf: replace pcb_sprintf() with pcb_snprintf().

Using the types without 'n' is just asking for buffer overflows.

6 years agopcb-printf: teach float/double specifiers to respect `.
Markus Hitter [Sat, 29 Aug 2015 08:50:43 +0000 (29 10:50 +0200)]
pcb-printf: teach float/double specifiers to respect `.

Not too complicated and works quite fine.

6 years agopcb-printf: remove impossible case.
Markus Hitter [Fri, 28 Aug 2015 22:45:33 +0000 (29 00:45 +0200)]
pcb-printf: remove impossible case.

'*' is handled directly, never added to the spec string.

6 years agopcb-printf: allow arbitrary order of sub-specifiers.
Markus Hitter [Fri, 28 Aug 2015 22:20:52 +0000 (29 00:20 +0200)]
pcb-printf: allow arbitrary order of sub-specifiers.

It was simply too confusing to sort all these modifier characters
in the right order. It should make code more robust.

Yes, '#' is a duplicate, but it was one before, too.

6 years agogcode.c, bom.c: adjust more pcb_fprintf() usage for NLS.
Markus Hitter [Fri, 28 Aug 2015 19:09:46 +0000 (28 21:09 +0200)]
gcode.c, bom.c: adjust more pcb_fprintf() usage for NLS.

We slowly get closer to tests passing:

  Passed 12, failed 2, skipped 7 out of 21 tests.

6 years agoImplement ascii-printf.c/.h.
Markus Hitter [Fri, 28 Aug 2015 00:46:25 +0000 (28 02:46 +0200)]
Implement ascii-printf.c/.h.

Main purpose of this is formatting independent from a users
locale, e.g. when writing G-code file contents.

This commit includes application to the G-code exporter. It
doesn't make the tests pass with NLS enabled, but the diffs
became much smaller. 'make check' passes as before with NLS
disabled.

6 years agoStop experimenting with LC_ALL, LC_NUMERIC & Co.
Markus Hitter [Thu, 27 Aug 2015 10:16:00 +0000 (27 12:16 +0200)]
Stop experimenting with LC_ALL, LC_NUMERIC & Co.

Adjusting printf(), fprintf() output via environment variables
can't ever work, because there is only one such variable globally.
How should this work if the exporter and some GUI part wants to
printf() something at the same time? Clash.

The standards comittees very apparently simply forgot or ignored
that not all printf() output is meant to be human readable. Bummer.

I almost imported an older printf() implementation to have one
ignoring the locale, but then I found g_ascii_formatd() on Glib.
This line works independently from the locale:

  char b[100];
  fputs(g_ascii_formatd(b, 100, "%3.2f\n", 125.646), stdout);

Fine. Now we know on how to go ahead.

Regarding regression tests: 'make check' passes now without NLS
(it didn't before), but fails even uglier with NLS enabled.
Both on a system with de_DE locale.

6 years agomain.c: include gettext.h in favour of libintl.h.
Markus Hitter [Thu, 27 Aug 2015 17:14:49 +0000 (27 19:14 +0200)]
main.c: include gettext.h in favour of libintl.h.

gettext.h handles ENABLE_NLS already and likely does it better.