Creates FILM configurations from LgFormat XML files.
Created on Dec 14, 2011
Specialisation of exception for FILMCfgXML module.
Specialisation of exception for FILMCfgXMLRead module.
Specialisation of exception for FILMCfgXMLRead module when a lookup fails that would normally raise a KeyError.
Extracts FILM information from a single XML file root element.
Default number of half-tracks to span
Map of track IDs to start track location in half-tracks
Number of half-tracks of the start of the track, this is a fudge around deciding this from the order of the LgTrack elements
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
Contains the configuration equivalent to a complete FILM table from a set of XML files.
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(..)).
Read a directory of XML files (not recursive).
Adds a parsed LgFormat XML document to the IR.
Returns True if this curve appears in the film.
Returns a long string of the XML UniqueIds and their description.
Returns the UniqueId values that I know about.
Returns the XML description corresponding to the Unique ID or None if unknown.
Returns the XML root node corresponding to the Unique ID.
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 ‘]
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.