genFeatures (version 1.4.1, 18 August 2004)
index
m:\projects\genesis-python\1.4.1\genfeatures.py

Modules for joining Genesis 2000 scripting and the Python scripting language.
 
NEED: genClasses.py and genCommands.py
 
THIS MODULE *REQUIRES* ITSELF TO BE EMBEDDED IN CLASSES FROM THE genCommands.py 
and genClasses.py MODULES - IT WILL NOT WORK ON ITS OWN!!!
 
This module is used to define features.  It provides classes to represent Genesis
features.  Currently can represent PadLineArcText, and Barcode - no surface
support yet.  Slower, of course, than the DFM environment, but great for small jobs.
functionality over and above the basic Genesis commands. 
 
SEE parseFeatureInfo method in class Genesis, module genClasses
SEE featOut and featSelOut methods in class LayerCmds in genCommands

 
Modules
       
math
os
string
sys
time

 
Classes
       
Feature
Arc
Barcode
Line
Pad
Text

 
class Arc(Feature)
    This class defines an object which describes an Arc.  It is subclassed 
from Feature.  It gets passed the line from the INFO command (-d FEATURES)
        Variables in Arc (access by class.<var>)
                xs, ys, xe, ye - start and end points
                xc, yc - center of arc
                symbol - Symbol used in drawing line
                polarity - Polarity of line
                dcode - dcode of symbol used
                direction - clockwise/counterclockwise
 
  Methods defined here:
__init__(self, line)
parse(self)

Methods inherited from Feature:
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
class Barcode(Feature)
    This class defines an object which describes a Barcode.  It is subclassed 
from Feature.  It gets passed the line from the INFO command (-d FEATURES)
        Variables in Barcode Feature (access by class.<var>)
                x, y - location
                barcode - barcode type
                font - font name for under code
                polarity - Polarity of line
                rotation - rotation in degrees
                constant - Don't know
                width - mils of code in x direction
                heigt - mils of code in the y direction
                full_ascii - don't know
                cksum - checksum?
                invert_bg - invert the barcode yes/no
                add_text - add text to bottom of code yes/no
                text_loc - top/bot of the code
                text - text encoded in the barcode
 
  Methods defined here:
__init__(self, line)
parse(self)

Methods inherited from Feature:
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
class Feature
    This class defines an object which describes an individual feature.
Gets passed in the line from the INFO command (-d FEATURES)
 
  Methods defined here:
__init__(self, line)
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
class Line(Feature)
    This class defines an object which describes a Line.  It is subclassed 
from Feature.  It gets passed the line from the INFO command (-d FEATURES)
        Variables in Line (access by class.<var>)
                xs, ys, xe, ye - start and end points
                symbol - Symbol used in drawing line
                polarity - Polarity of line
                dcode - dcode of symbol used
                len - length of the line
 
  Methods defined here:
__init__(self, line)
parse(self)

Methods inherited from Feature:
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
class Pad(Feature)
    This class defines an object which describes a Pad.  It is subclassed 
from Feature.  It gets passed the line from the INFO command (-d FEATURES)
        Variables in Pad (access by class.<var>)
                x, y - location
                symbol - Symbol used in drawing line
                polarity - Polarity of line
                dcode - dcode of symbol used
                rotation - rotation in degrees of Pad
                mirror - yes if mirrored
 
  Methods defined here:
__init__(self, line)
parse(self)

Methods inherited from Feature:
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
class Text(Feature)
    This class defines an object which describes a Text feature.  It is subclassed 
from Feature.  It gets passed the line from the INFO command (-d FEATURES)
        Variables in Text Feature (access by class.<var>)
                x, y - location
                font - font name
                polarity - Polarity of line
                rotation - rotation in degrees
                mirror - yes/no is it mirrored
                xsize - mils of letter in x direction
                ysize - mils of a letter in the y direction
                wfactor - scaling factor or width factor larger = thicker lines
                text - the text in the object
                version - not quite sure what the version means
 
  Methods defined here:
__init__(self, line)
parse(self)

Methods inherited from Feature:
__repr__(self)
getAttrs(self)
Gets atributes of self by parsing the line passed
leaves self.line intact except that everything after ';' is gone.

 
Functions
       
create(line)
Part of the module - creates a class for the given line of the input file
line - line of text from output file
parse(lines)
Part of the module - parses the lines from an input file and submits lines to create
features.  Adds the features to a featureList.  Not used by any of the classes - not 
necessary to use module

 
Data
        __author__ = 'Mike J. Hopkins'
__credits__ = ' Daniel R. Gowans, for contributions to content.... an excellent scripting interface to Genesis 2000'
__date__ = '18 August 2004'
__version__ = '$Revision: 1.4.1 $'
example_data = "\n### Layer - 01sp features data ###\n#L 11.575 16...' 1;.nomenclature,.canned_text,.drill=non_plated\n"

 
Author
        Mike J. Hopkins

 
Credits
         Daniel R. Gowans, for contributions to content.
Frontline PCB, for an excellent scripting interface to Genesis 2000