Commit 91239103 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Removes reference to tx_module.TX_CONFIG and rx_module.RX_CONFIG

Showing with 7 additions and 5 deletions
+7 -5
...@@ -108,8 +108,9 @@ def _gain_auto(channel): ...@@ -108,8 +108,9 @@ def _gain_auto(channel):
class Tx(TxAbstract): class Tx(TxAbstract):
def __init__(self, **kwargs): def __init__(self, **kwargs):
for key in SPECS['tx']: for key in kwargs.keys():
kwargs = enforce_specs(kwargs, SPECS['tx'], key) if key in SPECS['tx'].keys():
kwargs = enforce_specs(kwargs, SPECS['tx'], key)
kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')}) kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')})
super().__init__(**kwargs) super().__init__(**kwargs)
assert isinstance(self.connection, I2C) assert isinstance(self.connection, I2C)
...@@ -119,7 +120,7 @@ class Tx(TxAbstract): ...@@ -119,7 +120,7 @@ class Tx(TxAbstract):
assert kwargs['pwr'] in SPECS['tx'] assert kwargs['pwr'] in SPECS['tx']
#self.pwr = None # TODO: set a list of compatible power system with the tx #self.pwr = None # TODO: set a list of compatible power system with the tx
self.exec_logger.event(f'{self.board_name}\ttx_init\tbegin\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.board_name}\ttx_init\tbegin\t{datetime.datetime.utcnow()}')
self.voltage_max = kwargs['voltage_max'] # self.voltage_max = kwargs['voltage_max'] # TODO: check if used
self.voltage_adjustable = False self.voltage_adjustable = False
self.current_adjustable = False self.current_adjustable = False
...@@ -252,8 +253,9 @@ class Tx(TxAbstract): ...@@ -252,8 +253,9 @@ class Tx(TxAbstract):
class Rx(RxAbstract): class Rx(RxAbstract):
def __init__(self, **kwargs): def __init__(self, **kwargs):
for key in kwargs: for key in kwargs.keys():
kwargs = enforce_specs(kwargs, SPECS['rx'], key) if key in SPECS['rx'].keys():
kwargs = enforce_specs(kwargs, SPECS['rx'], key)
kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')}) kwargs.update({'board_name': os.path.basename(__file__).rstrip('.py')})
super().__init__(**kwargs) super().__init__(**kwargs)
assert isinstance(self.connection, I2C) assert isinstance(self.connection, I2C)
......
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