pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prints a centroid file in a format which includes data needed by a pick and place machine. More...
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "global.h"
#include "data.h"
#include "error.h"
#include "misc.h"
#include "pcb-printf.h"
#include "hid.h"
#include "hid/common/hidnogui.h"
#include "../hidint.h"
Go to the source code of this file.
Data Structures | |
struct | _StringList |
struct | _BomList |
Typedefs | |
typedef struct _StringList | StringList |
typedef struct _BomList | BomList |
Functions | |
static HID_Attribute * | bom_get_export_options (int *n) |
static char * | CleanBOMString (char *in) |
static double | xyToAngle (double x, double y, bool morethan2pins) |
static StringList * | string_insert (char *str, StringList *list) |
static BomList * | bom_insert (char *refdes, char *descr, char *value, BomList *bom) |
static void | print_and_free (FILE *fp, BomList *bom) |
If fp is not NULL then print out the bill of materials contained in bom . Either way, free all memory which has been allocated for bom. | |
static int | PrintBOM (void) |
static void | bom_do_export (HID_Attr_Val *options) |
static void | bom_parse_arguments (int *argc, char ***argv) |
void | hid_bom_init () |
Variables | |
static HID_Attribute | bom_options [] |
static HID_Attr_Val | bom_values [NUM_OPTIONS] |
static const char * | bom_filename |
static const char * | xy_filename |
static const Unit * | xy_unit |
static char * | reference_pin_names [] = {"1", "2", "A1", "A2", "B1", "B2", 0} |
Includes numbered and BGA pins. | |
HID | bom_hid |
Prints a centroid file in a format which includes data needed by a pick and place machine.
Further formatting for a particular factory setup can easily be generated with awk or perl. In addition, a bill of materials file is generated which can be used for checking stock and purchasing needed materials. returns != zero on error.
PCB, interactive printed circuit board design
Copyright (C) 2006 DJ Delorie
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 St, Fifth Floor, Boston, MA 02110-1301 USA
Contact addresses for paper mail and Email: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de
Definition in file bom.c.
typedef struct _StringList StringList |
static void bom_do_export | ( | HID_Attr_Val * | options | ) | [static] |
Definition at line 617 of file bom.c.
References bom_filename, bom_get_export_options(), bom_values, get_unit_list(), get_unit_struct(), HID_Attr_Val::int_value, PrintBOM(), HID_Attr_Val::str_value, and xy_filename.
Referenced by hid_bom_init().
static HID_Attribute* bom_get_export_options | ( | int * | n | ) | [static] |
Definition at line 132 of file bom.c.
References bom_options, HID_Attribute::default_val, derive_default_filename(), PCBType::Filename, get_unit_struct(), SettingType::grid_unit, unit::index, HID_Attr_Val::int_value, PCB, and Settings.
Referenced by bom_do_export(), and hid_bom_init().
Definition at line 259 of file bom.c.
References _BomList::descr, malloc(), _BomList::next, NSTRCMP, _BomList::num, _BomList::refdes, string_insert(), and _BomList::value.
Referenced by PrintBOM().
static void bom_parse_arguments | ( | int * | argc, |
char *** | argv | ||
) | [static] |
Definition at line 645 of file bom.c.
References hid_parse_command_line(), and hid_register_attributes().
Referenced by hid_bom_init().
static char* CleanBOMString | ( | char * | in | ) | [static] |
Definition at line 157 of file bom.c.
References malloc().
Referenced by print_and_free(), and PrintBOM().
void hid_bom_init | ( | ) |
Definition at line 655 of file bom.c.
References bom_do_export(), bom_get_export_options(), bom_parse_arguments(), common_nogui_init(), hid_st::description, hid_st::do_export, hid_st::exporter, hid_st::get_export_options, hid_register_hid(), hid_st::name, hid_st::parse_arguments, and hid_st::struct_size.
static void print_and_free | ( | FILE * | fp, |
BomList * | bom | ||
) | [static] |
If fp
is not NULL then print out the bill of materials contained in bom
. Either way, free all memory which has been allocated for bom.
Definition at line 323 of file bom.c.
References CleanBOMString(), _BomList::descr, _BomList::next, _StringList::next, _BomList::num, _BomList::refdes, _StringList::str, and _BomList::value.
Referenced by PrintBOM().
static int PrintBOM | ( | void | ) | [static] |
Definition at line 375 of file bom.c.
References unit::allow, AttributeGetFromList(), bom_filename, bom_insert(), CleanBOMString(), PCBType::Data, _BomList::descr, DESCRIPTION_NAME, ELEMENT_LOOP, END_LOOP, fp, FRONT, gui, hid_st::log, M_PI, PCBType::MaxHeight, MAXREFPINS, Message(), PCBType::Name, NAMEONPCB_NAME, NSTRCMP, pin_st::Number, PAD_LOOP, PCB, pcb_author(), pcb_fprintf(), pin, PIN_LOOP, print_and_free(), reference_pin_names, unit::suffix, UNKNOWN, _BomList::value, VALUE_NAME, pin_st::X, x, xy_filename, xyToAngle(), pin_st::Y, and y.
Referenced by bom_do_export().
static StringList* string_insert | ( | char * | str, |
StringList * | list | ||
) | [static] |
Definition at line 233 of file bom.c.
References malloc(), _StringList::next, and _StringList::str.
Referenced by bom_insert().
static double xyToAngle | ( | double | x, |
double | y, | ||
bool | morethan2pins | ||
) | [static] |
const char* bom_filename [static] |
Definition at line 112 of file bom.c.
Referenced by bom_do_export(), and PrintBOM().
HID_Attribute bom_options[] [static] |
{ {"bomfile", "Name of the BOM output file", HID_String, 0, 0, {0, 0, 0}, 0, 0}, #define HA_bomfile 0 {"xyfile", "Name of the XY output file", HID_String, 0, 0, {0, 0, 0}, 0, 0}, #define HA_xyfile 1 {"xy-unit", "XY units", HID_Unit, 0, 0, {-1, 0, 0}, NULL, 0}, #define HA_unit 2 {"xy-in-mm", ATTR_UNDOCUMENTED, HID_Boolean, 0, 0, {0, 0, 0}, 0, 0}, #define HA_xymm 3 }
Definition at line 66 of file bom.c.
Referenced by bom_get_export_options().
HID_Attr_Val bom_values[NUM_OPTIONS] [static] |
Definition at line 110 of file bom.c.
Referenced by bom_do_export().
char* reference_pin_names[] = {"1", "2", "A1", "A2", "B1", "B2", 0} [static] |
Includes numbered and BGA pins.
In order of preference. Possibly BGA pins can be missing, so we add a few to try.
Definition at line 372 of file bom.c.
Referenced by PrintBOM().
const char* xy_filename [static] |
Definition at line 113 of file bom.c.
Referenced by bom_do_export(), and PrintBOM().