Esempio n. 1
0
def check_safe_states(iDevIdx,iSlotID):
	intensity,frequency_number,pulse_mode,head_id = sepia.get_laser_states(iDevIdx)
        print intensity,frequency_number,pulse_mode,head_id
	if (intensity != 0 or frequency_number != 6 or pulse_mode != 1):
		##TODO: Send command to ORCA to cancel the run
        	sepia.set_laser_intensity(0,iDevIdx)
		sys.exit('Safe states are not correctly set! Aborting run! (1)')
	##Check relay switch channel status 	
	relay_switch_default_channel = rs.GetDisplayChannel()
	if (relay_switch_default_channel != 0):
		##TODO: Send command to ORCA to cancel the run
                print "Stuff going wrong"
                #sepia.close(iDevIdx)
		#sys.exit('Safe states are not correctly set! Aborting run! (2)')
	##Check the laser soft lock status 	
	#laser_lock_on_check = sepia.get_laser_lock_status(iDevIdx,iSlotID)
	#print laser_lock_on_check 
	#if (laser_lock_on_check != 1):
		##TODO: Send command to ORCA to cancel the run
        #	sepia.laser_soft_lock_on(iDevIdx,iSlotID)
        #	print sepia.get_laser_lock_status(iDevIdx,iSlotID)
 	#	sys.exit('Safe states are not correctly set! Aborting run! (3)')
	return 	
Esempio n. 2
0
def check_set_states(iDevIdx,iSlotID,input_intensity,input_frequency):
	intensity2,frequency_number2,pulse_mode2,head_id2 = sepia.get_laser_states(iDevIdx)
	if (intensity2 != input_intensity or frequency_number2 != input_frequency):
		##TODO: Send command to ORCA to cancel the run 		
		sys.exit('States have not been correctly set! Aborting run!')
	return