Commit 7b799e75 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Adds pwr_state on tx to switch dps on and off

Showing with 24 additions and 24 deletions
+24 -24
...@@ -99,30 +99,30 @@ class Tx(Tx_mb_2023): ...@@ -99,30 +99,30 @@ class Tx(Tx_mb_2023):
Tx_mb_2023.inject(self, polarity=polarity, injection_duration=injection_duration) Tx_mb_2023.inject(self, polarity=polarity, injection_duration=injection_duration)
self.pin6.value = False self.pin6.value = False
@property # @property
def pwr_state(self): # def pwr_state(self):
return self._pwr_state # return self._pwr_state
#
@pwr_state.setter # @pwr_state.setter
def pwr_state(self, state, latency=4.): # def pwr_state(self, state, latency=4.):
"""Switches pwr on or off. # """Switches pwr on or off.
#
Parameters # Parameters
---------- # ----------
state : str # state : str
'on', 'off' # 'on', 'off'
""" # """
if state == 'on': # if state == 'on':
self.pin2.value = True # self.pin2.value = True
self.pin3.value = True # self.pin3.value = True
self.exec_logger.debug(f'Switching DPS on') # self.exec_logger.debug(f'Switching DPS on')
self._pwr_state = 'on' # self._pwr_state = 'on'
time.sleep(latency) # from pwr specs # time.sleep(latency) # from pwr specs
elif state == 'off': # elif state == 'off':
self.pin2.value = False # self.pin2.value = False
self.pin3.value = False # self.pin3.value = False
self.exec_logger.debug(f'Switching DPS off') # self.exec_logger.debug(f'Switching DPS off')
self._pwr_state = 'off' # self._pwr_state = 'off'
class Rx(Rx_mb_2023): class Rx(Rx_mb_2023):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment