예제 #1
0
 def __init__(self, ip_hostname='pulsestreamer'):
     print("Connect to Pulse Streamer via google-RPC.")
     print("IP / Hostname:", ip_hostname)
     self.ip_address = ip_hostname
     try:
         channel = insecure_channel(ip_hostname + ':50051')
         self.stub = PulseStreamerStub(channel)
         try:
             void = VoidMessage()
             self.stub.getSerial(void, timeout=PulseStreamer.TIMEOUT)
         except:
             try:
                 void = VoidMessage()
                 self.stub.isRunning(void, timeout=PulseStreamer.TIMEOUT)
                 assert False, "Pulse Streamer class not compatible with current firmware. Please update your firmware." \
                     "For detailed information visit https://www.swabianinstruments.com/pulse-streamer-8-2-firmware/ " \
                     "or contact [email protected]"
             except AssertionError:
                 raise
             except:
                 assert False, "No Pulse Streamer found at IP/Host-address: " + ip_hostname
     except AssertionError:
         raise
     except:
         assert False, "No Pulse Streamer found at IP/Host-address: " + ip_hostname
     void = VoidMessage()
     firmware_version = self.stub.getFirmwareVersion(
         void, timeout=PulseStreamer.TIMEOUT).string_value
     self.__version_1_1_or_higher = True if _compare_version_number(
         firmware_version, '1.1.0') >= 0 else False
     print("Pulse Streamer 8/2 firmware: v" + firmware_version)
     print("Client software: v" + __CLIENT_VERSION__)
     if (_compare_version_number(firmware_version) >= 0):
         print(
             "The Pulse Streamer 8/2 firmware is more up to date than your client software. We recommend to update your client software."
         )
         print(
             "For detailed information visit https://www.swabianinstruments.com/support/downloads/ or contact [email protected]"
         )
     elif (_compare_version_number(
             '.'.join(__CLIENT_VERSION__.split('.')[0:2] + ['0']),
             '.'.join(firmware_version.split('.')[0:2] + ['0'])) > 0):
         print(
             "Your client software is more up to date than the Pulse Streamer 8/2 firmware. We recommend to update the firmware of your Pulse Streamer 8/2."
         )
         print(
             "For detailed information visit https://www.swabianinstruments.com/support/downloads/ or contact [email protected]"
         )
예제 #2
0
 def getAnalogCalibration(self):
     void = VoidMessage()
     response = self.stub.getAnalogCalibration(
         void, timeout=PulseStreamer.TIMEOUT)
     key_list = ['dc_offset_a0', 'dc_offset_a1', 'slope_a0', 'slope_a1']
     return dict(
         zip(key_list, [
             response.dc_offset_a0, response.dc_offset_a1,
             response.slope_a0, response.slope_a1
         ]))
예제 #3
0
 def getFPGAID(self):
     if (self.__version_1_1_or_higher):
         void = VoidMessage()
         return self.stub.getFPGAID(
             void, timeout=PulseStreamer.TIMEOUT).string_value
     else:
         s = GetSerialMessage()
         s.serial = 0
         return self.stub.getSerial(
             s, timeout=PulseStreamer.TIMEOUT).string_value
예제 #4
0
 def getDebugRegister(self):
     void = VoidMessage()
     return self.stub.getDebugRegister(
         void, timeout=PulseStreamer.PulseStreamer.TIMEOUT).value
예제 #5
0
 def getUnderflow(self):
     void = VoidMessage()
     return self.stub.getUnderflow(void,
                                   timeout=PulseStreamer.TIMEOUT).value
예제 #6
0
 def getTemperature(self):
     void = VoidMessage()
     return self.stub.getTemperature(
         void, timeout=PulseStreamer.TIMEOUT).string_value
예제 #7
0
 def testNetworkConf(self):
     void = VoidMessage()
     return self.stub.testNetworkConf(void,
                                      timeout=PulseStreamer.TIMEOUT).value
예제 #8
0
 def getNetworkConf(self):
     void = VoidMessage()
     return self.stub.getNetworkConf(
         void, timeout=PulseStreamer.TIMEOUT).string_value
예제 #9
0
 def isStreaming(self):
     void = VoidMessage()
     return self.stub.isStreaming(void, timeout=PulseStreamer.TIMEOUT).value
예제 #10
0
 def flash_lic(self):
     void = VoidMessage()
     return self.stub.flash_lic(void,
                                timeout=PulseStreamer.TIMEOUT).string_value
예제 #11
0
 def getFirmwareVersion(self):
     void = VoidMessage()
     return self.stub.getFirmwareVersion(
         void, timeout=PulseStreamer.TIMEOUT).string_value
예제 #12
0
 def getClock(self):
     void = VoidMessage()
     return ClockSource(
         self.stub.getClock(void, timeout=PulseStreamer.TIMEOUT).value)
예제 #13
0
 def startNow(self):
     void = VoidMessage()
     return self.stub.startNow(void, timeout=PulseStreamer.TIMEOUT).value
예제 #14
0
 def hasFinished(self):
     void = VoidMessage()
     return self.stub.hasFinished(void, timeout=PulseStreamer.TIMEOUT).value
예제 #15
0
 def hasSequence(self):
     void = VoidMessage()
     return self.stub.hasSequence(void, timeout=PulseStreamer.TIMEOUT).value
예제 #16
0
 def getTriggerRearm(self):
     void = VoidMessage()
     return TriggerRearm(
         self.stub.getTriggerRearm(void,
                                   timeout=PulseStreamer.TIMEOUT).value)
예제 #17
0
 def reset(self):
     void = VoidMessage()
     return self.stub.reset(void, timeout=PulseStreamer.TIMEOUT).value
예제 #18
0
 def forceFinal(self):
     void = VoidMessage()
     return self.stub.forceFinal(void, timeout=PulseStreamer.TIMEOUT).value