Example #1
0
	def initChannels(self):
		if(not self.fake_scan):
			if(self.beamTriggerWPV == null or self.testPV == null):
				self.beamTriggerWPV = WrappedChannel("ICS_Tim:Gate_BeamOn:SSTrigger")
				self.testPV = WrappedChannel("MEBT_Diag:BPM01:amplitudeAvg")
				self.testPV.startMonitor()	
				time.sleep(2.0)
Example #2
0
 def initChannels(self):
     if (not self.fake_scan):
         if (self.beamTriggerWPV == null or self.testPV == null):
             self.beamTriggerWPV = WrappedChannel(
                 "ICS_Tim:Gate_BeamOn:SSTrigger")
             self.testPV = WrappedChannel("MEBT_Diag:BPM01:amplitudeAvg")
             self.testPV.startMonitor()
             time.sleep(2.0)
Example #3
0
class Trigger:
    def __init__(self):
        self.beamTriggerWPV = WrappedChannel("ICS_Tim:Gate_BeamOn:SSTrigger")
        self.testPV = WrappedChannel("Target_Diag:TIS:xMean")
        self.testPV.startMonitor()
        self.sleepMeasureTime = 1.5
        self.run = 1

    def makeShot(self):
        #return
        self.testPV.setValueChanged(false)
        self.beamTriggerWPV.setValue(1.0)
        time.sleep(self.sleepMeasureTime)
        count = 0
        time_init = self.sleepMeasureTime
        while (self.testPV.valueChanged() == false):
            count = count + 1
            time_init = time_init + 1.
            time.sleep(time_init)
            print "Attention!!! Something wrong. count=", count

    def setRun(self, runVar):
        self.run = runVar

    def wait(self):
        while (self.run == 0):
            time.sleep(self.sleepMeasureTime)
Example #4
0
 def __init__(self):
     self.beamTriggerWPV = WrappedChannel("ICS_Tim:Gate_BeamOn:SSTrigger")
     self.testPV = WrappedChannel("Target_Diag:TIS:xMean")
     self.testPV.startMonitor()
     self.sleepMeasureTime = 1.5
     self.run = 1
Example #5
0
 def __init__(self, outF):
     self.outF = outF
     self.ch_arr = []
     ch = WrappedChannel("Target_Diag:TIS:xMean")
     self.ch_arr.append(ch)
     ch = WrappedChannel("Target_Diag:TIS:yMean")
     self.ch_arr.append(ch)
     ch = WrappedChannel("Target_Diag:TIS:xAmp")
     self.ch_arr.append(ch)
     ch = WrappedChannel("Target_Diag:TIS:yAmp")
     self.ch_arr.append(ch)
     ch = WrappedChannel("Target_Diag:TIS:imgPD")
     self.ch_arr.append(ch)
     ch = WrappedChannel("Target_Diag:TIS:fitPD")
     self.ch_arr.append(ch)
     time.sleep(3.0)
     s = ""
     for ch in self.ch_arr:
         s = s + ch.getChannelName() + "  "
     self.outF.write(s + "\n")
Example #6
0
dcv_pv_names.append("RTBT_Mag:PS_DCV30:I_Set")
dcv_pv_names.append("RTBT_Mag:PS_DCV28:I_Set")
dcv_pv_names.append("RTBT_Mag:PS_DCV21:I_Set")

dch_pv_names = []
dch_pv_names.append("RTBT_Mag:PS_DCH30:I_Set")
dch_pv_names.append("RTBT_Mag:PS_DCH28:I_Set")
dch_pv_names.append("RTBT_Mag:PS_DCH22:I_Set")
dch_pv_names.append("RTBT_Mag:PS_DCH20:I_Set")
#dch_pv_names.append("RTBT_Mag:PS_DCH16:I_Set")

name_to_ch_dict = {}

dcv_ch_arr = []
for name in dcv_pv_names:
    ch = WrappedChannel(name)
    dcv_ch_arr.append(ch)
    name_to_ch_dict[name] = ch

dch_ch_arr = []
for name in dch_pv_names:
    ch = WrappedChannel(name)
    dch_ch_arr.append(ch)
    name_to_ch_dict[name] = ch

time.sleep(2.0)

dcv_curr_dict = {}
dcv_curr_dict[name_to_ch_dict["RTBT_Mag:PS_DCV30:I_Set"]] = 120.0
dcv_curr_dict[name_to_ch_dict["RTBT_Mag:PS_DCV28:I_Set"]] = 120.0
dcv_curr_dict[name_to_ch_dict["RTBT_Mag:PS_DCV21:I_Set"]] = -10.0
Example #7
0
class BeamTrigger:
    """
	It will trigger the beam once.
	"""
    def __init__(self, top_level_cotroller=null):
        self.top_level_cotroller = top_level_cotroller
        self.beamTriggerWPV = null
        self.testPV = null
        self.sleepMeasureTime = 0.1
        self.scan_state_controller = null
        self.fake_scan = false
        self.use_trigger = false

    def initChannels(self):
        if (not self.fake_scan):
            if (self.beamTriggerWPV == null or self.testPV == null):
                self.beamTriggerWPV = WrappedChannel(
                    "ICS_Tim:Gate_BeamOn:SSTrigger")
                self.testPV = WrappedChannel("MEBT_Diag:BPM01:amplitudeAvg")
                self.testPV.startMonitor()
                time.sleep(2.0)

    def setScanStateController(self, scan_state_controller):
        self.scan_state_controller = scan_state_controller

    def setSleepTime(self, tm):
        self.sleepMeasureTime = tm

    def getSleepTime(self):
        return self.sleepMeasureTime

    def setFakeScan(self, bool_val):
        self.fake_scan = bool_val

    def getFakeScan(self):
        return self.fake_scan

    def setUseTrigger(self, bool_val):
        self.use_trigger = bool_val

    def getUseTrigger(self):
        return self.use_trigger

    def makeShot(self):
        self.initChannels()
        state_cntrl = self.scan_state_controller
        messageTextField = null
        if (self.top_level_cotroller != null):
            messageTextField = self.top_level_cotroller.getMessageTextField()
        if (not self.fake_scan):
            self.testPV.setValueChanged(false)
            time.sleep(0.02)
            if (self.use_trigger): self.beamTriggerWPV.setValue(1.0)
        if (state_cntrl != null and state_cntrl.getShouldStop() == true):
            return false
        time.sleep(self.sleepMeasureTime)
        if (state_cntrl != null and state_cntrl.getShouldStop() == true):
            return false
        count = 0
        time_sleep = 0.05
        if (not self.fake_scan):
            while (self.testPV.valueChanged() == false):
                count = count + 1
                if (state_cntrl != null
                        and state_cntrl.getShouldStop() == true):
                    return false
                time.sleep(time_sleep)
                if (state_cntrl != null
                        and state_cntrl.getShouldStop() == true):
                    return false
                if (count % 25 == 0):
                    time_sleep = time_sleep + 3.0
                if (count > 25):
                    if (messageTextField != null):
                        messageTextField.setText(
                            "Attention!!! Something wrong. Please fire the beam manually! Bad count="
                            + str(count))
            if (messageTextField != null):
                messageTextField.setText("")
        return true
Example #8
0
class BeamTrigger:
	"""
	It will trigger the beam once.
	"""
	def __init__(self,top_level_cotroller = null):
		self.top_level_cotroller = top_level_cotroller
		self.beamTriggerWPV = null
		self.testPV = null
		self.sleepMeasureTime = 0.1
		self.scan_state_controller = null
		self.fake_scan = false
		self.use_trigger = false
		
	def initChannels(self):
		if(not self.fake_scan):
			if(self.beamTriggerWPV == null or self.testPV == null):
				self.beamTriggerWPV = WrappedChannel("ICS_Tim:Gate_BeamOn:SSTrigger")
				self.testPV = WrappedChannel("MEBT_Diag:BPM01:amplitudeAvg")
				self.testPV.startMonitor()	
				time.sleep(2.0)
		
	def setScanStateController(self,scan_state_controller):
		self.scan_state_controller = scan_state_controller
		
	def setSleepTime(self, tm):
		self.sleepMeasureTime = tm
		
	def getSleepTime(self):
		return self.sleepMeasureTime
		
	def setFakeScan(self, bool_val):
		self.fake_scan = bool_val
		
	def getFakeScan(self):
		return self.fake_scan
		
	def setUseTrigger(self, bool_val):
		self.use_trigger = bool_val
		
	def getUseTrigger(self):
		return self.use_trigger
		
	def makeShot(self):
		self.initChannels()
		state_cntrl = self.scan_state_controller 
		messageTextField = null
		if(self.top_level_cotroller != null):
			messageTextField = self.top_level_cotroller.getMessageTextField()
		if(not self.fake_scan):
			self.testPV.setValueChanged(false) 
			time.sleep(0.02)
			if(self.use_trigger): self.beamTriggerWPV.setValue(1.0)
		if(state_cntrl != null and state_cntrl.getShouldStop() == true): return false
		time.sleep(self.sleepMeasureTime)
		if(state_cntrl != null and state_cntrl.getShouldStop() == true): return false		
		count = 0
		time_sleep = 0.05
		if(not self.fake_scan):
			while(self.testPV.valueChanged() == false):
				count = count + 1
				if(state_cntrl != null and state_cntrl.getShouldStop() == true): return false			
				time.sleep(time_sleep)
				if(state_cntrl != null and state_cntrl.getShouldStop() == true): return false			
				if(count % 25 == 0): 
					time_sleep = time_sleep + 3.0
				if(count > 25):
					if(messageTextField != null):
						messageTextField.setText("Attention!!! Something wrong. Please fire the beam manually! Bad count="+str(count))			
			if(messageTextField != null):
				messageTextField.setText("")
		return true