pcb 4.1.1
An interactive printed circuit board layout editor.

ipcd356.c File Reference

IPC-D-356 Netlist export. More...

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "data.h"
#include "config.h"
#include "global.h"
#include "rats.h"
#include "error.h"
#include "find.h"
#include "misc.h"
#include "pcb-printf.h"
#include "hid.h"
#include "hid/common/hidnogui.h"
#include "../hidint.h"
Include dependency graph for ipcd356.c:

Go to the source code of this file.

Data Structures

struct  IPCD356_Alias
struct  IPCD356_AliasList

Functions

void IPCD356_WriteNet (FILE *fd, char *net)
 Writes a net to the file provided.
void IPCD356_WriteHeader (FILE *fd)
 Writes the IPC-D-356 Header to the file provided.
void IPCD356_End (FILE *)
int IPCD356_Netlist (void)
 The main IPC-D-356 function.
int IPCD356_WriteAliases (FILE *, IPCD356_AliasList *)
void ResetVisitPinsViasAndPads (void)
void CheckNetLength (char *, IPCD356_AliasList *)
IPCD356_AliasListCreateAliasList (void)
IPCD356_AliasListAddAliasToList (IPCD356_AliasList *)
int IPCD356_SanityCheck (void)
static HID_AttributeIPCD356_get_export_options (int *n)
static void IPCD356_do_export (HID_Attr_Val *options)
static void IPCD356_parse_arguments (int *argc, char ***argv)
void hid_ipcd356_init ()

Variables

static HID_Attribute IPCD356_options []
static HID_Attr_Val IPCD356_values [NUM_OPTIONS]
const char * IPCD356_filename
HID IPCD356_hid

Detailed Description

IPC-D-356 Netlist export.

Author:
Copyright (C) 2012 Jerome Marchand (Jerome.Marchand@gmail.com)

Copyright.


PCB, interactive printed circuit board design

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.

Contact addresses for paper mail and Email:

Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany

Thomas.Nau@rz.uni-ulm.de

Definition in file ipcd356.c.


Function Documentation

IPCD356_AliasList * AddAliasToList ( IPCD356_AliasList aliaslist)

Definition at line 622 of file ipcd356.c.

References IPCD356_AliasList::Alias, IPCD356_AliasList::AliasN, and realloc().

Referenced by IPCD356_WriteAliases().

Here is the call graph for this function:

void CheckNetLength ( char *  net,
IPCD356_AliasList aliaslist 
)
IPCD356_AliasList * CreateAliasList ( void  )

Definition at line 612 of file ipcd356.c.

References IPCD356_AliasList::AliasN, and malloc().

Referenced by IPCD356_Netlist().

Here is the call graph for this function:

static void IPCD356_do_export ( HID_Attr_Val options) [static]

Definition at line 665 of file ipcd356.c.

References IPCD356_filename, IPCD356_get_export_options(), IPCD356_Netlist(), IPCD356_values, and HID_Attr_Val::str_value.

Referenced by hid_ipcd356_init().

Here is the call graph for this function:

void IPCD356_End ( FILE *  fd)

Definition at line 554 of file ipcd356.c.

Referenced by IPCD356_Netlist().

static HID_Attribute* IPCD356_get_export_options ( int *  n) [static]

Definition at line 111 of file ipcd356.c.

References derive_default_filename(), PCBType::Filename, IPCD356_options, and PCB.

Referenced by hid_ipcd356_init(), and IPCD356_do_export().

Here is the call graph for this function:

static void IPCD356_parse_arguments ( int *  argc,
char ***  argv 
) [static]

Definition at line 687 of file ipcd356.c.

References hid_parse_command_line(), and hid_register_attributes().

Referenced by hid_ipcd356_init().

Here is the call graph for this function:

int IPCD356_SanityCheck ( void  )

Definition at line 652 of file ipcd356.c.

References PCBType::Data, ELEMENT_LOOP, END_LOOP, Message(), and PCB.

Referenced by IPCD356_Netlist().

Here is the call graph for this function:

int IPCD356_WriteAliases ( FILE *  fd,
IPCD356_AliasList aliaslist 
)
void IPCD356_WriteHeader ( FILE *  fd)

Writes the IPC-D-356 Header to the file provided.

The JOB name is the PCB Name (if set), otherwise the filename (including the path) is used.

The units used for the netlist depends on what is set (mils or mm).

Definition at line 135 of file ipcd356.c.

References PCBType::Filename, SettingType::grid_unit, PCBType::Name, PCB, Settings, and unit::suffix.

Referenced by IPCD356_Netlist().

void IPCD356_WriteNet ( FILE *  fd,
char *  net 
)

Writes a net to the file provided.

The net name is passed through the "net" and should be 14 characters max.
The function scans through pads, pins and vias and looks for the FOUNDFLAG.
Once the object has been added to the net list the VISITFLAG is set on that object.

Todo:
1) The bottom layer is always written as layer #2 (A02).
It could output the actual layer number (example: A06 on a 6 layer board).
But I could not find an easy way to do this...
Todo:
2) Objects with mutiple connections could have the "M" (column 32) field written to indicate a Mid Net Point.

Todo:
Midpoint indicator (M).
Todo:
Put actual layer # for bottom side.
Todo:
Midpoint indicator (M).
Todo:
Midpoint indicator (M).

Definition at line 189 of file ipcd356.c.

References PCBType::Data, pin_st::DrillingHole, ELEMENT_LOOP, END_LOOP, SettingType::grid_unit, pin_st::Mask, PCBType::MaxHeight, pin_st::Number, PAD_LOOP, PCB, pin, PIN_LOOP, SET_FLAG, Settings, unit::suffix, TEST_FLAG, pin_st::Thickness, VIA_LOOP, pin_st::X, and pin_st::Y.

Referenced by IPCD356_Netlist().

void ResetVisitPinsViasAndPads ( void  )

Definition at line 560 of file ipcd356.c.

References CLEAR_FLAG, PCBType::Data, ELEMENT_LOOP, END_LOOP, PAD_LOOP, PCB, pin, PIN_LOOP, and VIA_LOOP.

Referenced by IPCD356_Netlist().


Variable Documentation

const char* IPCD356_filename

Definition at line 85 of file ipcd356.c.

Referenced by IPCD356_do_export(), and IPCD356_Netlist().

Definition at line 694 of file ipcd356.c.

Initial value:
{

  {
    "netlistfile",
    "Name of the IPC-D-356 Netlist output file",
    HID_String,
    0, 0, {0, 0, 0}, 0, 0
  },
#define HA_IPCD356_filename 0
}

Definition at line 62 of file ipcd356.c.

Referenced by IPCD356_get_export_options().

HID_Attr_Val IPCD356_values[NUM_OPTIONS] [static]

Definition at line 83 of file ipcd356.c.

Referenced by IPCD356_do_export().