1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

daq: fix resistor_values and sample_rate_hz parameters list

resistor_values is an array of float and not int as the shunt resistors
are most of the time lower than 1 Ohm.
With kind=list_of_ints, all resistor values are rounded to 0. Replace it
by list_of_numbers

sample_rate_hz is an int used to get sample period and to compute energy.
Changes its type from str to int

With these 2 fixes, the daq instrument has been successfully tested with
NI DAQ6211

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
This commit is contained in:
Vincent Guittot 2018-03-30 09:10:06 +02:00 committed by setrofim
parent 117f0f9fc4
commit 741193c441

View File

@ -20,6 +20,8 @@ from collections import defaultdict
import os
import shutil
from wa.utils.types import list_of_numbers
from devlib import DerivedEnergyMeasurements
from devlib.instrument import CONTINUOUS
from devlib.instrument.energy_probe import EnergyProbeInstrument
@ -65,7 +67,7 @@ class DAQBackend(EnergyInstrumentBackend):
name = 'daq'
parameters = [
Parameter('resistor_values', kind=list_of_ints,
Parameter('resistor_values', kind=list_of_numbers,
global_alias='daq_resistor_values',
description="""
The values of resistors (in Ohms) across which the voltages
@ -106,7 +108,7 @@ class DAQBackend(EnergyInstrumentBackend):
Specifies the voltage range for the resistor voltage channel
on the DAQ (please refer to :ref:`daq_setup` for details).
"""),
Parameter('sample_rate_hz', kind=str, default=10000,
Parameter('sample_rate_hz', kind=int, default=10000,
global_alias='daq_sampling_rate',
description="""
Specify the sample rate in Hz.