예제 #1
0
 def validate_options(self):
     """Check that the option fields are appropriate
     """
     message = None
     messages = []
     pn = int(self.get_pn())
     td = float(self.get_td())
     fd = float(self.get_fd())
     #ensure ability to pulse more than 65025 pulses
     n_max_pn, final_pn = self.get_pn_sequence(pn)
     adjusted_pn, actual_pn, _, _ = parameters.pulse_number(final_pn)
     total_pn = n_max_pn * parameters.max_pulse_number + actual_pn
     adjusted_td, actual_td, _ = parameters.trigger_delay(td)
     adjusted_fd, actual_fd, _ = parameters.fibre_delay(fd)
     if adjusted_pn is True:
         self.pn_tkstr.set(total_pn)
         messages += ["Pulse number adjusted from %d to %s" % (pn, total_pn)]
     if adjusted_td is True:
         self.td_tkstr.set(actual_td)
         messages += ["Trigger delay adjusted from %s to %s" % (td, actual_td)]
     if adjusted_fd is True:
         self.fd_tkstr.set(actual_fd)
         messages += ["Fibre delay adjusted from %s to %s" % (fd, actual_fd)]
     if messages!=[]:
         message = ", ".join(m for m in messages)
     return message
예제 #2
0
 def validate_options(self):
     """Check that the option fields are appropriate
     """
     message = None
     messages = []
     pn = int(self.get_pn())
     td = float(self.get_td())
     fd = float(self.get_fd())
     adjusted_pn,actual_pn,_,_ = parameters.pulse_number(pn)
     adjusted_td,actual_td,_ = parameters.trigger_delay(td)
     adjusted_fd,actual_fd,_ = parameters.fibre_delay(fd)
     if adjusted_pn==True:            
         self.pn_tkstr.set(actual_pn)
         messages += ["Pulse number adjusted from %d to %s"%(pn,actual_pn)]
     if adjusted_td==True:
         self.td_tkstr.set(actual_td)
         messages += ["Trigger delay adjusted from %s to %s"%(td,actual_td)]
     if adjusted_fd==True:
         self.fd_tkstr.set(actual_fd)
         messages += ["Fibre delay adjusted from %s to %s"%(fd,actual_fd)]
     if messages!=[]:
         message = ", ".join(m for m in messages)
     return message