mirror of
git://projects.qi-hardware.com/fped.git
synced 2025-04-21 12:27:27 +03:00
- the set of layers of a pad is now maintained in the instance, so that we can
make adjustments when removing layers provided by specialized pads - gui_inst.c: moved gc construction from gui_draw_pad and gui_draw_rpad to shared pad_gc - layer.h: new home of all definitions related to pads and layers - layer.c: - overlap.c: functions to test for overlaps of pad shapes (in progress) git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5634 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
56
layer.c
Normal file
56
layer.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* layer.c - PCB layers on a pad
|
||||
*
|
||||
* Written 2009 by Werner Almesberger
|
||||
* Copyright 2009 by Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "layer.h"
|
||||
|
||||
|
||||
layer_type pad_type_to_layers(enum pad_type type)
|
||||
{
|
||||
layer_type layers = 0;
|
||||
|
||||
switch (type) {
|
||||
case pt_normal:
|
||||
layers = LAYER_PASTE;
|
||||
/* fall through */
|
||||
case pt_bare:
|
||||
layers |= LAYER_COPPER | LAYER_MASK;
|
||||
break;
|
||||
case pt_paste:
|
||||
layers = LAYER_PASTE;
|
||||
break;
|
||||
case pt_mask:
|
||||
layers = LAYER_MASK;
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
return layers;
|
||||
}
|
||||
|
||||
|
||||
enum pad_type layers_to_pad_type(layer_type layers)
|
||||
{
|
||||
if (layers & LAYER_COPPER) {
|
||||
if (layers & LAYER_PASTE)
|
||||
return pt_normal;
|
||||
return pt_bare;
|
||||
} else {
|
||||
if (layers & LAYER_PASTE)
|
||||
return pt_paste;
|
||||
if (layers & LAYER_MASK)
|
||||
return pt_mask;
|
||||
abort();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user