Skip to content
Snippets Groups Projects
Commit de0143bd authored by Lloyd Carothers's avatar Lloyd Carothers
Browse files

Fix DLtype getting overwritten by dl_gain setter.

parent 8cf708ae
No related branches found
No related tags found
No related merge requests found
......@@ -281,7 +281,7 @@ class StationNode(InventoryNode):
for chan in (chan for chan in channels
if chan.code[1] in ('H', 'L', 'G', 'N')):
try:
gain = chan.response.response_stages[1].stage_gain
gain = chan.response.response_stages[1].stage_gain
except (AttributeError, IndexError):
continue
self.set_dl_gain(gain, keep_response=True)
......@@ -294,14 +294,16 @@ class StationNode(InventoryNode):
except ValueError:
return
for chan in self._inv_obj.channels:
try:
# If the used clicks in and out ignore
old_gain = chan.data_logger.gain
if old_gain == value:
return False
except AttributeError:
if isinstance(chan.data_logger, Equipment):
try:
old_gain = chan.data_logger.gain
if old_gain == value:
continue
except AttributeError:
pass
else:
chan.data_logger = Equipment()
chan.data_logger.gain = value
chan.data_logger.gain = value
if not keep_response:
chan.response = None
return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment