Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion py/orbit/py_linac/lattice/LinacAccNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
"""
Expand Down
3 changes: 3 additions & 0 deletions py/orbit/py_linac/linac_parsers/sns_linac_lattice_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading