def channelOff(self, chan=None): if chan is not None and chan in self.__channels: time.sleep(self.__waitTime) cmd = str(':OUTP' + str(chan) + ' OFF') self.setConfigParam(cmd, None, True) else: logger.exception('Please choose Channel 1 or 2!')
def setDataMemory(self, chan=None, startAddr=None, bit=None, data=None): if chan is not None and chan in self.__channels: time.sleep(self.__waitTime) cmd = str(':DIG' + str(chan) + ':PATT:DATA ' + str(startAddr) + ',' + str(bit) + ',' + str(data)) self.setConfigParam(cmd, None, True) else: logger.exception('Please choose Channel 1 or 2!')
def setClockDivider(self, div=None): if div is not None: if (div in self.__ClockDivider): time.sleep(self.__waitTime) cmd = str(':OUTP:CLOC:DIV ' + str(div)) self.setConfigParam(cmd, None, True) else: logger.exception('Wrong Clock Divider Value!')
def setMainParam(self, chan=None, amp=None, offset=None, ptype=None): ''' One function to set all parameters on the main window ''' if chan is None: logger.exception('Please Specify Channel Number!') else: self.__setVoltage(chan, amp, offset) self.__setPatternType(chan, ptype)
def setDataRate(self, rate=None): ''' Set the data rate of the PPG. Data rate can only be in the range of 1.5 Gb/s to 32 Gb/s ''' if rate is not None: if rate < 1.5 or rate > 32: logger.exception('Invalid Data Rate!') else: time.sleep(self.__waitTime) cmd = str(':FREQ ' + str(rate) + 'e9') self.setConfigParam(cmd, None, True)
def __setPatternType(self, chan=None, ptype=None): ''' Set the data pattern on the specified channel. Type can only be 'PRBS' or 'DATA' ''' if ptype is not None and chan in self.__channels: if ptype not in self.__patternType: logger.exception('Wrong Pattern Type!') else: time.sleep(self.__waitTime) cmd = str(':DIG' + str(chan) + ':PATT:TYPE ' + str(ptype)) self.setConfigParam(cmd, None, True)