Beispiel #1
0
	def __init__(self, name = "no name", type_in = "generic"):
		"""
		Constructor. Creates an empty accelerator node.
		"""
		NamedObject.__init__(self, name)
		TypedObject.__init__(self, type_in)
		ParamsDictObject.__init__(self)
		self.AccNode = orbit.lattice.AccNode
		#------------------------------------------------
		# nParts - number of parts in the body of node
		#------------------------------------------------
		self.__nParts = 1
		self.__lengthArr = [0.]
		self.__length = 0.
		self.__activePartIndex = 0
		#------------------------------------------------
		# Child nodes are placed at the entrance, inside the body,
		# or at the exit of this node. In the body, child nodes
		# can be added before or after any part. 
		# Child nodes may be diagnostics, collective effects, 
		# apertures, etc. 
		# Body child nodes - list containing lists of two lists 
		# (before and after each part) of nodes
		#------------------------------------------------
		self.__childNodesArr = [[],[[[],[]]],[]]
		self._setPartsLengthEvenly(self.__nParts)
Beispiel #2
0
    def __init__(self, name="no name", type_in="generic"):
        """
		Constructor. Creates an empty accelerator node.
		"""
        NamedObject.__init__(self, name)
        TypedObject.__init__(self, type_in)
        ParamsDictObject.__init__(self)
        self.AccNode = orbit.lattice.AccNode
        #------------------------------------------------
        # nParts - number of parts in the body of node
        #------------------------------------------------
        self.__nParts = 1
        self.__lengthArr = [0.]
        self.__length = 0.
        self.__activePartIndex = 0
        #------------------------------------------------
        # Child nodes are placed at the entrance, inside the body,
        # or at the exit of this node. In the body, child nodes
        # can be added before or after any part.
        # Child nodes may be diagnostics, collective effects,
        # apertures, etc.
        # Body child nodes - list containing lists of two lists
        # (before and after each part) of nodes
        #------------------------------------------------
        self.__childNodesArr = [[], [[[], []]], []]
        self._setPartsLengthEvenly(self.__nParts)
Beispiel #3
0
	def __init__(self, name = "none"):
		NamedObject.__init__(self, name)
		ParamsDictObject.__init__(self)
		self.__linacNodes = []
		self.addParam("position",0.)	
		self.addParam("length",0.)
		self.addParam("linacAccLattice",None)
Beispiel #4
0
	def __init__(self, name = "root"):
		"""
		The XmlDataAdaptor constructor. The default name is 'root'. 
		It is an analog of the XAL XmlDataAdaptor class. The Attributes are replaced by parameters.
		"""
		NamedObject.__init__(self,name)
		ParamsDictObject.__init__(self)	
		self.data_adaptors = []
	def __init__(self, name = "root"):
		"""
		The XmlDataAdaptor constructor. The default name is 'root'. 
		It is an analog of the XAL XmlDataAdaptor class. The Attributes are replaced by parameters.
		"""
		NamedObject.__init__(self,name)
		ParamsDictObject.__init__(self)	
		self.data_adaptors = []
	def __init__(self, name = "no_name", type_in = "Base_Error_Controller"):
		NamedObject.__init__(self, name)
		TypedObject.__init__(self, type_in)
		ParamsDictObject.__init__(self)
		#--------------------------------------
		#---- entrance and exit Error AccNodes
		self.entranceAccNode = None
		self.exitAccNode = None
		self.entranceAccNodeParent = None
		self.exitAccNodeParent = None
		self.accLattice = None
Beispiel #7
0
	def __init__(self, name = "none"):
		NamedObject.__init__(self, name)
		ParamsDictObject.__init__(self)
		self.__rfGaps = []
		self.addParam("frequency",0.)
		self.addParam("phase",0.)
		self.addParam("amp",0.)		
		self.addParam("designPhase",0.)
		self.addParam("designAmp",0.)		
		self.addParam("designArrivalTime",0.)
		self.addParam("isDesignSetUp",False)
Beispiel #8
0
 def __init__(self, name="none"):
     NamedObject.__init__(self, name)
     ParamsDictObject.__init__(self)
     self.__rfGaps = []
     #---- firstGapEntrancePhase is used by gaps instead of phase in the case
     #---- of non-zero length gaps
     self.__firstGapEntrancePhase = 0.
     self.__firstGapEntranceDesignPhase = 0.
     self.addParam("frequency", 0.)
     self.addParam("phase", 0.)
     self.addParam("amp", 1.)
     self.addParam("designPhase", 0.)
     self.addParam("designAmp", 1.)
     self.addParam("designArrivalTime", 0.)
     self.addParam("isDesignSetUp", False)
     self.addParam("pos", 0.)
Beispiel #9
0
	def clean(self):
		""" Remove all data. """
		ParamsDictObject.__init__(self)	
		self.data_adaptors = []	
	def clean(self):
		""" Remove all data. """
		ParamsDictObject.__init__(self)	
		self.data_adaptors = []	
Beispiel #11
0
	def __init__(self, name = "None"):
		NamedObject.__init__(self,name)
		TypedObject.__init__(self,type_in = "linac")
		ParamsDictObject.__init__(self)		
		self.seqs = []
		self.length = 0.
Beispiel #12
0
	def __init__(self,name = "node"):
		NamedObject.__init__(self,name)
		TypedObject.__init__(self,type_in = "none")
		ParamsDictObject.__init__(self)	
		self.setParam("length",0.)
Beispiel #13
0
	def __init__(self, *arg, **kwargs):
		"""
		The constructor of the VariableProxy class should have the following signatures
		VariableProxy(parameterProxy_in)
		VariableProxy(name, value, step)
		VariableProxy(name = ""???"", value = ???, step = ???)
		"""
		ParamsDictObject.__init__(self)
		self.setName("unknown")
		self.value = 0.
		self.step = 0.
		self.useInSolver = True
		
		self.lowerLimit = - 0.00000001*sys.float_info.max
		self.upperLimit = + 0.00000001*sys.float_info.max
		
		#print "debug len(arg)=",len(arg)," arg=",arg
		#print "debug len(kwargs)=",len(kwargs)," kwargs=",kwargs
		
		if(not (len(arg) != 1 and len(arg) != 2 and len(arg) != 3)):	
			if(len(arg) == 1):
				varProxy = arg[0]
				if(isinstance(varProxy,VariableProxy)):
					self.setName(varProxy.getName())
					self.value = varProxy.getValue()
					self.step = varProxy.getStep()
					self.useInSolver = varProxy.getUseInSolver()
					self.lowerLimit = varProxy.getLowerLimit()
					self.upperLimit = varProxy.getUpperLimit()
					self.updateParamsDict(varProxy.getParamsDict())
				else:
					msg = "VariableProxy constructor. If there is only one argument it should be only VariableProxy."
					msg = msg + os.linesep
					msg = "This argument is not!"
					msg = msg + os.linesep			
					msg = msg + "Stop."
					msg = msg + os.linesep
					orbitFinalize(msg)
			elif(len(arg) == 2):
				self.setName(arg[0])
				self.value = arg[1]
				self.step = 0.			
			else:
				self.setName(arg[0])
				self.value = arg[1]
				self.step = arg[2]
		elif(len(arg) == 0 and len(kwargs) == 3 and kwargs.has_key("name") and kwargs.has_key("value") and  kwargs.has_key("step")):
			self.setName(kwargs["name"])
			self.value = kwargs["value"]
			self.step = kwargs["step"]
		else:
			msg  = "VariableProxy constructor. It should have one of the forms:"
			msg += os.linesep
			msg += "1. Copy constructor: VariableProxy(parameterProxy_in)"
			msg += os.linesep
			msg += "2. VariableProxy(name, value)"
			msg += os.linesep			
			msg += "3. VariableProxy(name, value, step)"
			msg += os.linesep			
			msg += "4. VariableProxy(name = ""???"", value = ???, step = ???)"
			msg += os.linesep			
			msg += "Stop."
			msg += os.linesep
			orbitFinalize(msg)			
Beispiel #14
0
 def __init__(self, name="None"):
     NamedObject.__init__(self, name)
     TypedObject.__init__(self, type_in="linac")
     ParamsDictObject.__init__(self)
     self.seqs = []
     self.length = 0.
Beispiel #15
0
 def __init__(self, name="node"):
     NamedObject.__init__(self, name)
     TypedObject.__init__(self, type_in="none")
     ParamsDictObject.__init__(self)
     self.setParam("length", 0.)