pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include "change.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "global.h"
#include "resource.h"
#include "set.h"
#include "undo.h"
#include "vendor.h"
Go to the source code of this file.
Defines | |
#define | CLOSEST 1 |
#define | ROUND_UP 0 |
#define | FREE(x) if((x) != NULL) { free (x) ; (x) = NULL; } |
Functions | |
static void | add_to_drills (char *sval) |
Add a drill size to the vendor drill list. | |
static void | apply_vendor_map (void) |
static void | process_skips (Resource *res) |
Deal with the "skip" subresource. | |
static bool | rematch (const char *, const char *) |
int | ActionApplyVendor (int argc, char **argv, Coord x, Coord y) |
int | ActionToggleVendor (int argc, char **argv, Coord x, Coord y) |
int | ActionEnableVendor (int argc, char **argv, Coord x, Coord y) |
int | ActionDisableVendor (int argc, char **argv, Coord x, Coord y) |
int | ActionUnloadVendor (int argc, char **argv, Coord x, Coord y) |
int | ActionLoadVendorFrom (int argc, char **argv, Coord x, Coord y) |
int | vendorDrillMap (int in) |
For a given drill size, find the closest vendor drill size. | |
bool | vendorIsElementMappable (ElementType *element) |
static int | vendor_get_enabled (void *data) |
Variables | |
static int * | vendor_drills = NULL |
static int | n_vendor_drills = 0 |
static int | cached_drill = -1 |
static int | cached_map = -1 |
static char ** | ignore_refdes = NULL |
static int | n_refdes = 0 |
static char ** | ignore_value = NULL |
static int | n_value = 0 |
static char ** | ignore_descr = NULL |
static int | n_descr = 0 |
static char * | vendor_name = NULL |
Vendor name. | |
static double | sf |
Resource file to PCB units scale factor. | |
static bool | vendorMapEnable = false |
Enable/disable mapping. | |
static int | rounding_method = ROUND_UP |
static const char | apply_vendor_syntax [] = N_("ApplyVendor()") |
static const char | apply_vendor_help [] |
static const char | toggle_vendor_syntax [] = N_("ToggleVendor()") |
static const char | toggle_vendor_help [] |
static const char | enable_vendor_syntax [] = N_("EnableVendor()") |
static const char | enable_vendor_help [] |
static const char | disable_vendor_syntax [] = N_("DisableVendor()") |
static const char | disable_vendor_help [] |
static const char | unload_vendor_syntax [] = N_("UnloadVendor()") |
static const char | unload_vendor_help [] |
static const char | load_vendor_syntax [] = N_("LoadVendorFrom(filename)") |
static const char | load_vendor_help [] |
HID_Action | vendor_action_list [] |
HID_Flag | vendor_flag_list [] |
PCB, interactive printed circuit board design
Copyright (C) 2004, 2007 Dan McMahill
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file vendor.c.
#define CLOSEST 1 |
Definition at line 108 of file vendor.c.
Referenced by ActionLoadVendorFrom(), and vendorDrillMap().
Definition at line 112 of file vendor.c.
Referenced by ActionLoadVendorFrom(), and ActionUnloadVendor().
#define ROUND_UP 0 |
Definition at line 109 of file vendor.c.
Referenced by ActionLoadVendorFrom().
Definition at line 131 of file vendor.c.
References apply_vendor_map(), and hid_action().
Definition at line 217 of file vendor.c.
References vendorMapEnable.
Definition at line 191 of file vendor.c.
References vendorMapEnable.
Definition at line 277 of file vendor.c.
References _, add_to_drills(), AFAIL, apply_vendor_map(), PCBType::Bloat, Resource::c, cached_drill, CLOSEST, hid_st::fileselect, FREE, gui, HID_FILESELECT_READ, ignore_descr, ignore_refdes, ignore_value, INCH_TO_COORD, Message(), MIL_TO_COORD, PCBType::minDrill, PCBType::minRing, PCBType::minSlk, PCBType::minWid, MM_TO_COORD, n_descr, n_refdes, n_value, n_vendor_drills, NSTRCMP, PCB, process_skips(), resource_parse(), resource_subres(), resource_type, resource_value(), ROUND_UP, rounding_method, sf, PCBType::Shrink, UNKNOWN, Resource::v, ResourceVal::value, vendor_drills, vendor_name, and vendorMapEnable.
Definition at line 160 of file vendor.c.
References vendorMapEnable.
Definition at line 239 of file vendor.c.
References cached_drill, FREE, ignore_descr, ignore_refdes, ignore_value, n_descr, n_refdes, n_value, n_vendor_drills, and vendor_drills.
static void add_to_drills | ( | char * | sval | ) | [static] |
Add a drill size to the vendor drill list.
Definition at line 703 of file vendor.c.
References _, n_vendor_drills, realloc(), sf, and vendor_drills.
Referenced by ActionLoadVendorFrom().
static void apply_vendor_map | ( | void | ) | [static] |
Definition at line 472 of file vendor.c.
References _, ChangeObject2ndSize(), PCBType::Data, DESCRIPTION_NAME, RouteStyleType::Diameter, pin_st::DrillingHole, vector_struct::element, ELEMENT_LOOP, END_LOOP, RouteStyleType::Hole, IncrementUndoSerialNumber(), Message(), n_vendor_drills, RouteStyleType::Name, pin_st::Name, NAMEONPCB_NAME, pin_st::Number, PCB, pin, PIN_LOOP, Redraw(), PCBType::RouteStyle, SetChangedFlag(), Settings, TEST_FLAG, UNKNOWN, VALUE_NAME, vendorDrillMap(), vendorIsElementMappable(), vendorMapEnable, VIA_LOOP, SettingType::ViaDrillingHole, pin_st::X, and pin_st::Y.
Referenced by ActionApplyVendor(), and ActionLoadVendorFrom().
static void process_skips | ( | Resource * | res | ) | [static] |
Deal with the "skip" subresource.
Definition at line 754 of file vendor.c.
References _, Resource::c, cnt, ignore_descr, ignore_refdes, ignore_value, Message(), n_descr, n_refdes, n_value, NSTRCMP, realloc(), resource_type, ResourceVal::subres, Resource::v, and ResourceVal::value.
Referenced by ActionLoadVendorFrom().
static bool rematch | ( | const char * | re, |
const char * | s | ||
) | [static] |
static int vendor_get_enabled | ( | void * | data | ) | [static] |
Definition at line 983 of file vendor.c.
References vendorMapEnable.
int vendorDrillMap | ( | int | in | ) |
For a given drill size, find the closest vendor drill size.
Definition at line 629 of file vendor.c.
References _, cached_drill, cached_map, CLOSEST, max, Message(), min, n_vendor_drills, rounding_method, vendor_drills, and vendorMapEnable.
Referenced by apply_vendor_map(), CreateNewPin(), and CreateNewVia().
bool vendorIsElementMappable | ( | ElementType * | element | ) |
Definition at line 831 of file vendor.c.
References _, DESCRIPTION_NAME, ignore_descr, ignore_refdes, ignore_value, Message(), n_descr, n_refdes, n_value, NAMEONPCB_NAME, NSTRCMP, rematch(), TEST_FLAG, UNKNOWN, VALUE_NAME, and vendorMapEnable.
Referenced by apply_vendor_map(), and CreateNewPin().
const char apply_vendor_help[] [static] |
const char apply_vendor_syntax[] = N_("ApplyVendor()") [static] |
int cached_drill = -1 [static] |
Definition at line 80 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), and vendorDrillMap().
int cached_map = -1 [static] |
Definition at line 81 of file vendor.c.
Referenced by vendorDrillMap().
const char disable_vendor_help[] [static] |
const char disable_vendor_syntax[] = N_("DisableVendor()") [static] |
const char enable_vendor_help[] [static] |
const char enable_vendor_syntax[] = N_("EnableVendor()") [static] |
char** ignore_descr = NULL [static] |
Definition at line 88 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
char** ignore_refdes = NULL [static] |
Definition at line 84 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
char** ignore_value = NULL [static] |
Definition at line 86 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
const char load_vendor_help[] [static] |
const char load_vendor_syntax[] = N_("LoadVendorFrom(filename)") [static] |
int n_descr = 0 [static] |
Definition at line 89 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
int n_refdes = 0 [static] |
Definition at line 85 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
int n_value = 0 [static] |
Definition at line 87 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), process_skips(), and vendorIsElementMappable().
int n_vendor_drills = 0 [static] |
Definition at line 78 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), add_to_drills(), apply_vendor_map(), and vendorDrillMap().
int rounding_method = ROUND_UP [static] |
Definition at line 110 of file vendor.c.
Referenced by ActionLoadVendorFrom(), and vendorDrillMap().
double sf [static] |
Resource file to PCB units scale factor.
Definition at line 99 of file vendor.c.
Referenced by ActionLoadVendorFrom(), and add_to_drills().
const char toggle_vendor_help[] [static] |
const char toggle_vendor_syntax[] = N_("ToggleVendor()") [static] |
const char unload_vendor_help[] [static] |
const char unload_vendor_syntax[] = N_("UnloadVendor()") [static] |
{ {"ApplyVendor", 0, ActionApplyVendor, apply_vendor_help, apply_vendor_syntax} , {"ToggleVendor", 0, ActionToggleVendor, toggle_vendor_help, toggle_vendor_syntax} , {"EnableVendor", 0, ActionEnableVendor, enable_vendor_help, enable_vendor_syntax} , {"DisableVendor", 0, ActionDisableVendor, disable_vendor_help, disable_vendor_syntax} , {"UnloadVendor", 0, ActionUnloadVendor, unload_vendor_help, unload_vendor_syntax} , {"LoadVendorFrom", 0, ActionLoadVendorFrom, load_vendor_help, load_vendor_syntax} }
int* vendor_drills = NULL [static] |
Definition at line 77 of file vendor.c.
Referenced by ActionLoadVendorFrom(), ActionUnloadVendor(), add_to_drills(), and vendorDrillMap().
{ {"VendorMapOn", vendor_get_enabled, NULL} }
char* vendor_name = NULL [static] |
bool vendorMapEnable = false [static] |
Enable/disable mapping.
Definition at line 105 of file vendor.c.
Referenced by ActionDisableVendor(), ActionEnableVendor(), ActionLoadVendorFrom(), ActionToggleVendor(), apply_vendor_map(), vendor_get_enabled(), vendorDrillMap(), and vendorIsElementMappable().