mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
instrument: Add sample_rate_hz attribute for CONTINUOUS instruments
This commit is contained in:
parent
f7d1b0fb13
commit
49b547a7f6
@ -170,6 +170,7 @@ class Instrument(object):
|
|||||||
self.logger = logging.getLogger(self.__class__.__name__)
|
self.logger = logging.getLogger(self.__class__.__name__)
|
||||||
self.channels = collections.OrderedDict()
|
self.channels = collections.OrderedDict()
|
||||||
self.active_channels = []
|
self.active_channels = []
|
||||||
|
self.sample_rate_hz = None
|
||||||
|
|
||||||
# channel management
|
# channel management
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class DaqInstrument(Instrument):
|
|||||||
resistor_values=resistor_values,
|
resistor_values=resistor_values,
|
||||||
channel_map=channel_map,
|
channel_map=channel_map,
|
||||||
labels=labels)
|
labels=labels)
|
||||||
|
self.sample_rate_hz = sampling_rate
|
||||||
|
|
||||||
for label in labels:
|
for label in labels:
|
||||||
for kind in ['power', 'voltage']:
|
for kind in ['power', 'voltage']:
|
||||||
|
@ -51,6 +51,7 @@ class EnergyProbeInstrument(Instrument):
|
|||||||
self.command = None
|
self.command = None
|
||||||
self.raw_output_directory = None
|
self.raw_output_directory = None
|
||||||
self.process = None
|
self.process = None
|
||||||
|
self.sample_rate_hz = 10000 # Determined empirically
|
||||||
|
|
||||||
for label in self.labels:
|
for label in self.labels:
|
||||||
for kind in self.attributes:
|
for kind in self.attributes:
|
||||||
|
@ -236,6 +236,7 @@ class JunoEnergyInstrument(Instrument):
|
|||||||
for chan in self._channels:
|
for chan in self._channels:
|
||||||
self.channels[chan.name] = chan
|
self.channels[chan.name] = chan
|
||||||
self.on_target_file = self.target.tempfile('energy', '.csv')
|
self.on_target_file = self.target.tempfile('energy', '.csv')
|
||||||
|
self.sample_rate_hz = 10 # DEFAULT_PERIOD is 100[ms] in readenergy.c
|
||||||
self.command = '{} -o {}'.format(self.binary, self.on_target_file)
|
self.command = '{} -o {}'.format(self.binary, self.on_target_file)
|
||||||
self.command2 = '{}'.format(self.binary)
|
self.command2 = '{}'.format(self.binary)
|
||||||
|
|
||||||
|
@ -146,6 +146,12 @@ Instrument
|
|||||||
.. note:: This method is only implemented by :class:`Instrument`\ s that
|
.. note:: This method is only implemented by :class:`Instrument`\ s that
|
||||||
support ``CONTINUOUS`` measurment.
|
support ``CONTINUOUS`` measurment.
|
||||||
|
|
||||||
|
.. attribute:: Instrument.sample_rate_hz
|
||||||
|
|
||||||
|
Sample rate of the instrument in Hz. Assumed to be the same for all channels.
|
||||||
|
|
||||||
|
.. note:: This attribute is only provided by :class:`Instrument`\ s that
|
||||||
|
support ``CONTINUOUS`` measurment.
|
||||||
|
|
||||||
Instrument Channel
|
Instrument Channel
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user