def check_safe_states(iDevIdx, iSlotID, connection): intensity,frequency_number,pulse_mode,head_id = sepiaUser.get_laser_parameters(iDevIdx) ls_channel = rs.GetActiveChannel() # Check the active channel on the laserSwitch if (intensity != 0): print 'Simple TCP/IP Run (Check Safe States) - The laser Intensity is not at SAFE value (0%)' sepiaUser.set_laser_intensity(0, iDevIdx) connection.send(sepia_wrong_set_intensity_flag) main() # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (frequency_number != 6): print 'Simple TCP/IP Run (Check Safe States) - The laser Frequency is not at SAFE value (6 - external rising edge)' sepiaUser.set_laser_frequency(6, iDevIdx) connection.send(sepia_wrong_freq_flag) main() # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (pulse_mode != 1): print 'Simple TCP/IP Run (Check Safe States) - The laser Pulse Mode is not set correctly (1 - pulse mode, NOT continuous)' connection.send(sepia_wrong_pulse_mode_flag) main() # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (ls_channel != 0): print "Simple TCP/IP Run (Check Safe States) - The Laser Switch channel is not set to SAFE value (0)" rs.SetSelectedChannel(0) rs.Execute() connection.send(relay_switch_wrong_default_flag) main() else: print "Simple TCP/IP Run (Check Safe States) - All Safe States are Correctly Set" connection.send(continue_flag) return
def check_safe_states(iDevIdx, iSlotID, connection): intensity, frequency_number, pulse_mode, head_id = sepiaUser.get_laser_parameters( iDevIdx) ls_channel = rs.GetActiveChannel( ) # Check the active channel on the laserSwitch if (intensity != 0): print 'Simple TCP/IP Run (Check Safe States) - The laser Intensity is not at SAFE value (0%)' sepiaUser.set_laser_intensity(0, iDevIdx) connection.send(sepia_wrong_set_intensity_flag) main( ) # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (frequency_number != 6): print 'Simple TCP/IP Run (Check Safe States) - The laser Frequency is not at SAFE value (6 - external rising edge)' sepiaUser.set_laser_frequency(6, iDevIdx) connection.send(sepia_wrong_freq_flag) main( ) # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (pulse_mode != 1): print 'Simple TCP/IP Run (Check Safe States) - The laser Pulse Mode is not set correctly (1 - pulse mode, NOT continuous)' connection.send(sepia_wrong_pulse_mode_flag) main( ) # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent if (ls_channel != 0): print "Simple TCP/IP Run (Check Safe States) - The Laser Switch channel is not set to SAFE value (0)" rs.SetSelectedChannel(0) rs.Execute() connection.send(relay_switch_wrong_default_flag) main() else: print "Simple TCP/IP Run (Check Safe States) - All Safe States are Correctly Set" connection.send(continue_flag) return
def check_current_states(iDevIdx, iSlotID, input_intensity, input_frequency): intensity,frequency_number,pulse_mode,head_id = sepiaUser.get_laser_parameters(iDevIdx) if (intensity != input_intensity or frequency_number != input_frequency): ## TODO: Send command to ORCA to cancel the run sys.exit('Simple TCP/IP Run (Check Current States) - Laser States have not been correctly set to your specified values ... aborting run!') return
def check_current_states(iDevIdx, iSlotID, input_intensity, input_frequency): intensity, frequency_number, pulse_mode, head_id = sepiaUser.get_laser_parameters( iDevIdx) if (intensity != input_intensity or frequency_number != input_frequency): ## TODO: Send command to ORCA to cancel the run sys.exit( 'Simple TCP/IP Run (Check Current States) - Laser States have not been correctly set to your specified values ... aborting run!' ) return
def check_safe_states(iDevIdx, iSlotID): # Get the current states of Sepia and the LaserSwitch intensity,frequency_number,pulse_mode,head_id = sepiaUser.get_laser_parameters(iDevIdx) ls_channel = rs.GetActiveChannel() if (intensity != 0): sepiaUser.set_laser_intensity(0, iDevIdx) sys.exit('Simple Run (Check Safe States) - The laser Intensity is not at SAFE value (0%)') if (frequency_number != 6): sepiaUser.set_laser_frequency(6, iDevIdx) sys.exit('Simple Run (Check Safe States) - The laser Frequency is not at SAFE value (6 - external rising edge)') if (pulse_mode != 1): sys.exit('Simple Run (Check Safe States) - The laser Pulse Mode is not set correctly (1 - pulse mode, NOT continuous)') if (ls_channel != 0): rs.SetSelectedChannel(0) rs.Execute() sepiaUser.close(iDevIdx) sys.exit('Simple Run (Check Safe States) - The Laser Switch safe-state is not correctly set ... aborting run!') # Check the laser soft-lock status lock_check = sepiaUser.get_laser_lock_status(iDevIdx, iSlotID) if (laser_lock_on_check != 1): sepiaUser.laser_soft_lock_on(iDevIdx, iSlotID) sys.exit('Simple Run (Check Safe States) - Laser Soft-lock is not enabled ... aborting run!') return