Commit 14fd5bd1 authored by Matias Guijarro's avatar Matias Guijarro
Browse files

Merge branch 'mcce' into 'master'

Change range, gain, frequency functions to properties

See merge request bliss/bliss!1139
parents 162fbee4 60e85342
......@@ -198,7 +198,8 @@ class McceController:
return self._send_cmd("MEASURE", value)
def get_range(self):
def range(self):
""" Read the electrometer range
(int): Current range
......@@ -209,7 +210,8 @@ class McceController:
_range = self._send_cmd(McceReadCommands.RANGE)
return self.mcce_range[_range],
def set_range(self, value):
def range(self, value):
""" Set the range
(int): The desired range
......@@ -219,8 +221,9 @@ class McceController:
self._send_cmd(self.range_cmd, _range)
def get_frequency(self):
""" Set the frequency filter of the fotovoltaic electrometers.
def frequency(self):
""" Read the frequency filter of the fotovoltaic electrometers.
(int): The value
......@@ -232,7 +235,8 @@ class McceController:
value = self._send_cmd(McceReadCommands.FREQUENCY)
return MCCE_FREQUENCY[value]
def set_frequency(self, value):
def frequency(self, value):
""" Set the frequency filter of the photovoltaic electrometers.
value(int): Filter value
......@@ -247,7 +251,8 @@ class McceController:
self._send_cmd(McceProgCommands.FREQUENCY, _filter)
def get_gain(self):
def gain(self):
""" Read the gain of the photoconductive electrometers.
(int): The gain value
......@@ -260,7 +265,8 @@ class McceController:
value = self._send_cmd(McceReadCommands.GAIN)
return pow(10, value)
def set_gain(self, value):
def gain(self, value):
""" Set the gain of the fotoconductive electrometers
(int): The value
......@@ -303,12 +309,12 @@ class McceController:
def status(self):
""" Status of the electrometer """
_range, _unit = self.get_range()
_range, _unit = self.range
_ret = "Range: %g %s\n" % (_range, _unit)
if self.mcce_type in (4, 5):
_ret += "Gain: %d\n" % self.get_gain()
_ret += "Gain: %d\n" % self.gain
_ret += "Frequency: %d Hz\n" % self.get_frequency()
_ret += "Frequency: %d Hz\n" % self.frequency
_ret += "Polarity: %s\n" % self.polarity
return _ret
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