diff --git a/py/orbit/py_linac/lattice/LinacAccNodes.py b/py/orbit/py_linac/lattice/LinacAccNodes.py index 7a0c193f..5bc5ec16 100755 --- a/py/orbit/py_linac/lattice/LinacAccNodes.py +++ b/py/orbit/py_linac/lattice/LinacAccNodes.py @@ -41,9 +41,25 @@ def __init__(self, name="none"): self.setType("baseLinacNode") self.setParam("pos", 0.0) self.__linacSeqence = None + #------------------------------------------------- + # XML data adaptor of this node. + #------------------------------------------------- + self.data_adaptor = None # by default we use the TEAPOT tracker module self.tracking_module = TPB - + + def setDataAdaptor(self,data_adaptor): + """ + Sets the XML data adaptor of this node. + """ + self.data_adaptor = data_adaptor + + def getDataAdaptor(self): + """ + Returns the XML data adaptor of this node. + """ + return self.data_adaptor + def setLinacTracker(self, switch=True): """ This method will switch tracker module to the linac specific traker by default @@ -64,6 +80,9 @@ def setSequence(self, seq): Sets the seqence. """ self.__linacSeqence = seq + #---- set up Sequence for all children + for child_node in self.getAllChildren(): + child_node.setSequence(seq) def setPosition(self, pos): """ diff --git a/py/orbit/py_linac/linac_parsers/sns_linac_lattice_factory.py b/py/orbit/py_linac/linac_parsers/sns_linac_lattice_factory.py index d311750c..8d5ff039 100644 --- a/py/orbit/py_linac/linac_parsers/sns_linac_lattice_factory.py +++ b/py/orbit/py_linac/linac_parsers/sns_linac_lattice_factory.py @@ -301,6 +301,9 @@ def positionComp(node_da): accNode = MarkerLinacNode(node_da.stringValue("name")) accNode.setParam("pos", node_pos) thinNodes.append(accNode) + #-------------------------------------- + #---- sets up copy of XML data adaptor of this node + accNode.setDataAdaptor(node_da.getDeepCopy()) # ----- assign the thin nodes that are inside the thick nodes unusedThinNodes = [] for thinNode in thinNodes: