FILM Plotting Configuration from XML files

Creates FILM configurations from LgFormat XML files.

Created on Dec 14, 2011

exception TotalDepth.util.plot.FILMCfgXML.ExceptionFILMCfgXML

Specialisation of exception for FILMCfgXML module.

exception TotalDepth.util.plot.FILMCfgXML.ExceptionFILMCfgXMLRead

Specialisation of exception for FILMCfgXMLRead module.

exception TotalDepth.util.plot.FILMCfgXML.ExceptionFILMCfgXMLReadLookUp

Specialisation of exception for FILMCfgXMLRead module when a lookup fails that would normally raise a KeyError.

class TotalDepth.util.plot.FILMCfgXML.PhysFilmCfgXMLRead(root)

Extracts FILM information from a single XML file root element.

TRAC_STANDARD_SPAN = 2

Default number of half-tracks to span

TRAC_UNIQUEID_TO_NON_STANDARD_SPAN = {'TrackFC3': 1, 'trackLHT1': 1, 'track12': 4, 'TrackFC1': 1, 'TrackFC2': 1, 'track23': 4, 'TrackFC4': 1, 'trackRHT1': 1}

Map of track IDs to start track location in half-tracks

TRAC_UNIQUEID_TO_NON_STANDARD_START = {'TrackFC3': 6, 'trackLHT1': 0, 'track12': 2, 'TrackFC1': 4, 'TrackFC2': 5, 'track23': 4, 'TrackFC4': 7, 'trackRHT1': 1}

Number of half-tracks of the start of the track, this is a fudge around deciding this from the order of the LgTrack elements

interpretTrac(theTracStr)

Turns TRAC information into left/right positions as Cooord.Dim() objects and the number of half-tracks of the start and half-tracks covered. The later two values are used for stacking and packing the plot header and footer scales so that they take the minimum space. e.g. b’T23 ‘ returns: (the left position of T2, right of T3, 4, 4). e.g. b’T2 ‘ returns: (the left position of T2, right of T2, 4, 2). Note: There is some fudging going on here

class TotalDepth.util.plot.FILMCfgXML.FilmCfgXMLRead(dir=None)

Contains the configuration equivalent to a complete FILM table from a set of XML files.

__init__(dir=None)

Constructor with a directory, all files in the directory (non-recursive) are read as LGFormat XML files. If dir is None then the “formats/” directory relative to this module is searched. If dir is an empty string then no search will be done - useful for testing with addXMLRoot(etree.fromstring(..)).

readDir(d=None)

Read a directory of XML files (not recursive).

addXMLRoot(theRoot)

Adds a parsed LgFormat XML document to the IR.

chOutpMnemInFilmId(chOutp, filmID)

Returns True if this curve appears in the film.

longStr(verbose=1)

Returns a long string of the XML UniqueIds and their description.

uniqueIdS()

Returns the UniqueId values that I know about.

description(theUID)

Returns the XML description corresponding to the Unique ID or None if unknown.

rootNode(theUID)

Returns the XML root node corresponding to the Unique ID.

retAllFILMDestS(curveDestID)

Returns an unordered list of FILM destinations for a curve destination. For example if curveDestID is b’BOTH’ this might return [b‘2 ‘, b‘1 ‘]

retFILMDest(filmDestID, curveDestID)

Returns a PhysFilmCfgXMLRead object by matching curveDestID to the filmDestID. Returns None on failure. filmDestID and curveDestID are implementation specific e.g. for LIS the curveDestID can be 1, BOTH, ALL, NEIT etc. This is commonly used by the PRESCfg module so that interpretTrac() can be called on the result and thus build up a map of track positions for all possible logical film outputs.

Previous topic

FILM Plotting Configuration

Next topic

PRES Plotting Configuration

This Page