# File Name:    lyr_rule
# File Purpose: This file is used by the application for assigning the layer
#               names, layer context, layer type, and layer polarity. It will
#               also ensure that the layers are placed in the correct sequence
#               in the matrix.
# Written by:   Ian Ticehurst (Autom8 Ltd.)
# Version 1A.:  Date: 09.08.00 - Initial design and development.
############################# Start of notes ###############################
# This file is called at two places within the system. The first is during the
# identification process at input stage. If the system finds a viable rule set
# (i.e. a rule set that is not filtered out due to a fixed attribute) then, if
# the system can match an input file name to a naming convention provided in the
# rule sets below, that input layer will be translated using the named specified
# on the second line of that rule. It will also be given the context, layer type,
# polarity and matrix position settings specified on this line. The second time
# the function can be used is during the matrix set-up stage, by using the function
# actions -> rearrange rows. This action will look only for lines with a genesis
# format, and again will try to match the layer name to a naming convention in one
# of the rule sets. As before the parmeters on the second line of the rule are
# applied to this layer. It should be noted, however, that when using the function
# in this way, it is not possible to change layer names.
#
# The file is divided into a series of sections, the attribute definition section
# and the naming rule sets. At the beginning of the file there is an attribute
# definition section. The purpose of this section is to set up attributes (up to
# five different ones) that can be used as additional filters to the format and
# file name. The format for the sttribute section is:-
#
#  .atr name  - where the "name" is an attribute within the system (as a default
#               the first attribute is set to .customer, the others are not set.
#
# The other sections are the naming rules and these are typically grouped together
# in customer or CAD system models. Each entry in these sections contains the
# following fields:-
#
#  (first line of rule - what to look for)
#  format     - format name or '*' for all formats (e.g. genesis, 274X etc.)
#  * * * * *  - the values for up to 5 attribute values (according to the
#               .atr declarations)
#  input_name - regular expression (or fixed string) for matching the input
#               file names (or the layer names if using genesis format)
#  (second line of rule - what settings to apply to this file / layer)
#  name       - layer name that is required in Genesis.
#  context    - layer context (board, misc)
#  type       - layer type (signal, drill, rout,,,,,etc)
#  polarity   - layer polarity (positive, negative)
#  side       - top, bottom or none
#  serial     - layer's serial number (0 - don't care)
############################# End of notes ###############################

# Attribute Setting Section.
.atr .customer

#
#  Default Genesis Standard Names (Genesis Format).
#
genesis * * * * * drill(0-9*)-(0-9*)
->drillred\1-\2 board drill positive none 0
genesis * * * * * drill
->drill board drill positive none 0
genesis * * * * * rout
->rout board rout positive none 0
genesis * * * * * spt
->spt board solder_paste positive top 0
genesis * * * * * spb
->spb board solder_paste positive bottom 0
genesis * * * * * smt
->smt board solder_mask positive top 0
genesis * * * * * smb
->smb board solder_mask positive bottom 0
genesis * * * * * sst
->sst board silk_screen positive top 0
genesis * * * * * ssb
->ssb board silk_screen positive bottom 0
genesis * * * * * olt
->olt board signal positive top 0
genesis * * * * * olb
->olb board signal positive bottom 0
genesis * * * * * pg-([0-9]*)
->pg-\1 board power_ground negative none \1
genesis * * * * * sig-([0-9]*)
->sig-\1 board signal positive none \1
