Module smuview
The SmuView 0.0.5 Python bindings.
The Python bindings are a scripting extension for SmuView to automate, setup and control complex or repetitive measurements, to process the incoming data and to create a standardized user interface for those measurements.
The smuview module offers two default object instances: Session
and UiProxy
.
The Session
object gives access to already connected devices or connects new devices. The returned device object can then be used to read data from the device or control the device.
The UiProxy
object instance is used to modify the user interface, for example adding tabs or views.
Here is a short example that connects the HP 3378A DMM via GPIB, reads a sample and creates the default tab for the device:
import smuview
import time
# Connect device.
dmm_dev = Session.connect_device("hp-3478a:conn=libgpib/hp3478a")[0]
# Sleep 1s to give the devices the chance to create signals.
time.sleep(1)
# Get last sample from channel P1.
sample = dmm_dev.channels()["P1"].actual_signal().get_last_sample(True)
print(sample)
# Add default tab for the DMM device.
UiProxy.add_device_tab(dmm_dev)
For more example scripts, please have a look into the smuscript
folder.
Classes
class AnalogSampleSignal (*args, **kwargs)
-
A signal with key-value pairs.
Ancestors
- BaseSignal
- pybind11_builtins.pybind11_object
Methods
def get_sample(self: AnalogSampleSignal, pos: int) ‑> Tuple[int, float]
-
Return the sample for the given position.
Parameters
pos
:int
- The position/number of the sample.
Returns
Tuple[int, float]
- The sample with 1. the key and 2. the sample value.
def push_sample(self: AnalogSampleSignal, sample: None, pos: int, unit_size: int, digits: int, decimal_places: int)
-
Push a new sample to the signal.
Parameters
sample
:float
ordouble
- The sample value.
pos
:int
- The key (position) of the new sample.
unit_size
:int
- The size of the floating point data type (float=4, double=8) for the
sample
argument. digits
:int
- The total number of digits.
decimal_places
:int
- The number of decimal places.
Inherited members
class AnalogTimeSignal (*args, **kwargs)
-
A signal with time-value pairs.
Ancestors
- BaseSignal
- pybind11_builtins.pybind11_object
Methods
def get_last_sample(self: AnalogTimeSignal, relative_time: bool) ‑> Tuple[float, float]
-
Return the last sample of the signal.
Parameters
relative_time
:bool
- When
True
, the returned timestamp is relative to the start of the SmuView session.
Returns
Tuple[float, float]
- The sample with 1. timestamp in milliseconds and 2. the sample value.
def get_sample(self: AnalogTimeSignal, pos: int, relative_time: bool) ‑> Tuple[float, float]
-
Return the sample at the given position.
Parameters
pos
:int
- The position/number of the sample.
relative_time
:bool
- When
True
, the returned timestamp is relative to the start of the SmuView session.
Returns
Tuple[float, float]
- The sample with 1. timestamp in milliseconds and 2. the sample value.
def push_sample(self: AnalogTimeSignal, sample: None, timestamp: float, unit_size: int, digits: int, decimal_places: int)
-
Push a new sample to the signal.
Parameters
sample
:float
ordouble
- The sample value.
timestamp
:float
- The absolute timestamp in milliseconds.
unit_size
:int
- The size of the floating point data type (float=4, double=8) for the
sample
argument. digits
:int
- The total number of digits.
decimal_places
:int
- The number of decimal places.
Inherited members
class BaseChannel (*args, **kwargs)
-
The base class for all channel types.
Ancestors
- pybind11_builtins.pybind11_object
Subclasses
Methods
def actual_signal(self: BaseChannel) ‑> BaseSignal
def add_signal(self: BaseChannel, quantity: Quantity, quantity_flags: Set[QuantityFlag], unit: Unit, custom_name: str = '') ‑> BaseSignal
-
Add a new signal to the channel.
Parameters
quantity
:Quantity
- The
Quantity
of the new signal. quantity_flags
:Set[QuantityFlag]
- The
QuantityFlag
s of the new signal. unit
:Unit
- The
Unit
of the new signal. custom_name
:str
- A custom name for the new signal. If empty (default), the signal name will be automatically generated.
Returns
BaseSignal
- The new signal object.
def name(self: BaseChannel) ‑> str
-
Return the name of the channel.
Returns
str
- The name of the channel.
def signals(self: BaseChannel) ‑> List[BaseSignal]
class BaseDevice (*args, **kwargs)
-
The base class for all device types.
Ancestors
- pybind11_builtins.pybind11_object
Subclasses
Methods
def add_user_channel(self: BaseDevice, channel_name: str, channel_group_name: str) ‑> UserChannel
-
Add a new user channel to the device.
Parameters
channel_name
:str
- The name of the new user channel.
channel_group_name
:str
- The name of the channel group where to create the user channel. Can be empty.
Returns
UserChannel
- The new user channel object.
def channels(self: BaseDevice) ‑> Dict[str, BaseChannel]
-
Return all channels of the device.
Returns
Dict[str, BaseChannel]
- A Dict where the key is the id of the channel and the value is the channel object.
def configurables(self: BaseDevice) ‑> Dict[str, Configurable]
-
Return all configurables of the device.
Returns
Dict[str, Configurable]
- A Dict where the key is the id of the
Configurable
and the value is theConfigurable
object.
def id(self: BaseDevice) ‑> str
-
Return the unique id of the device.
Returns
str
- The id of the device.
def name(self: BaseDevice) ‑> str
-
Return the name of the device.
Returns
str
- The name of the device.
class BaseSignal (*args, **kwargs)
-
The base class for all signal types.
Ancestors
- pybind11_builtins.pybind11_object
Subclasses
Methods
def name(self: BaseSignal) ‑> str
-
Return the name of the signal.
Returns
str
- The name of the signal.
def sample_count(self: BaseSignal) ‑> int
-
Return the number of samples of the signal.
Returns
int
- The number of samples.
def set_name(self: BaseSignal, arg0: str)
-
Set a custom name for the signal.
Parameters
custom_name
:str
- A custom name for the signal. If empty, the signal name will be automatically generated.
class ConfigKey (...)
-
Enum of all available config keys for controlling a device.
init(self: smuview.ConfigKey, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var ADCPowerlineCycles
-
Number of powerline cycles for ADC integration time.
var Amplitude
-
Amplitude of a source without strictly-defined
ConfigKey.MeasuredQuantity
. var Averaging
-
Averaging.
var AvgSamples
-
The number of samples to be averaged over.
var BufferSize
-
Buffer size.
var CaptureFile
-
The capturefile to inject.
var CaptureRatio
-
The pre/post-trigger capture ratio.
var CaptureUnitSize
-
The capturefile unit size.
var CenterFrequency
-
Center frequency.
var ChannelConfig
-
Channel configuration.
var ClockEdge
-
Choice of clock edge for external clock (
r
orf
). var Coupling
-
Coupling.
var Current
-
Current current.
var CurrentLimit
-
Current limit.
var DataLog
-
The device has internal storage, into which data is logged.
var DataSource
-
Data source for acquisition.
var DeviceMode
-
Device mode for multi-function devices.
var Digits
-
The number of digits (e.g. for a DMM).
var Enabled
-
Enabling/disabling a channel (group).
var EquivCircuitModel
-
Equivalent circuit model.
var ExternalClock
-
Using an external clock.
var ExternalClockSource
-
Which external clock source to use if the device supports multiple external clock channels.
var Filter
-
Filter.
var HighResolution
-
High resolution mode.
var HoldMax
-
Max hold mode.
var HoldMin
-
Min hold mode.
var HorizTriggerPos
-
Horizontal trigger position.
var LogicThreshold
-
Logic threshold: predefined levels (
TTL
,ECL
,CMOS
, etc). var LogicThresholdCustom
-
Logic threshold: custom numerical value.
var MeasuredQuantity
-
Measured quantity.
var NumAnalogChannels
-
The number of analog channels.
var NumHDiv
-
Number of horizontal divisions, as related to
ConfigKey.TimeBase
. var NumLogicChannels
-
The number of logic channels.
var NumVDiv
-
Number of vertical divisions, as related to
ConfigKey.VDiv
. var Offset
-
Offset of a source without strictly-defined
ConfigKey.MeasuredQuantity
. var OutputFrequency
-
Output frequency in Hz.
var OutputFrequencyTarget
-
Output frequency target in Hz.
var OverCurrentProtectionActive
-
Status of over current protection (OCP).
var OverCurrentProtectionEnabled
-
Enabling/disable over current protection (OCP) feature.
var OverCurrentProtectionThreshold
-
Over current protection (OCP) threshold.
var OverTemperatureProtectionActive
-
Status of over temperature protection (OTP).
var OverTemperatureProtectionEnabled
-
Enabling/disable over temperature protection (OTP) feature.
var OverVoltageProtectionActive
-
Status of over voltage protection (OVP).
var OverVoltageProtectionEnabled
-
Enabling/disable over voltage protection (OVP) feature.
var OverVoltageProtectionThreshold
-
Over voltage protection (OVP) threshold.
var PatternMode
-
A pattern (pattern generator mode).
var PeakDetection
-
Peak detection.
var PowerOff
-
Power off the device.
var ProbeFactor
-
The probe factor.
var RLE
-
Run-length encoding (RLE).
var Range
-
The measurement range of a DMM or the output range of a power supply.
var Regulation
-
Channel regulation.
CV
,CC
orUR
, denoting constant voltage, constant current or unregulated.CC-
denotes a power supply in current sink mode (e.g. HP 66xxB). An empty string is used when there is no regulation, e.g. the output is disabled. var SampleInterval
-
The sample interval, in ms.
var Samplerate
-
The samplerate, in Hz.
var SessionFile
-
Session filename.
var SplMeasurementRange
-
Sound pressure level measurement range.
var SplWeightFreq
-
Sound pressure level frequency weighting.
var SplWeightTime
-
Sound pressure level time weighting.
var Swap
-
Swapping channels.
var TestMode
-
Self test mode.
var TimeBase
-
Time base.
var TriggerLevel
-
Trigger level.
var TriggerMatch
-
Trigger matches.
var TriggerPattern
-
The pattern for the logic trigger.
var TriggerSlope
-
The trigger slope.
var TriggerSource
-
Trigger source.
var UnderVoltageConditionActive
-
Status of under voltage condition (UVC).
var UnderVoltageConditionEnabled
-
Enabling/disable under voltage condition (UVC) feature.
var UnderVoltageConditionThreshold
-
Under voltage condition threshold (UVC).
var Unknown
-
Unknown config key.
var VDiv
-
Volts/div.
var Voltage
-
Current voltage.
var VoltageTarget
-
Maximum target voltage.
var VoltageThreshold
-
Logic low-high threshold range.
Static methods
def get_data_type(config_key: ConfigKey) ‑> DataType
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.ConfigKey) -> int
class Configurable (*args, **kwargs)
-
A configurable for controlling a device with config keys.
Ancestors
- pybind11_builtins.pybind11_object
Methods
def get_bool_config(self: Configurable, config_key: ConfigKey) ‑> bool
def get_double_config(self: Configurable, config_key: ConfigKey) ‑> float
def get_int_config(self: Configurable, config_key: ConfigKey) ‑> int
def get_string_config(self: Configurable, config_key: ConfigKey) ‑> str
def get_uint_config(self: Configurable, config_key: ConfigKey) ‑> int
def getable_configs(self: Configurable) ‑> Set[ConfigKey]
def listable_configs(self: Configurable) ‑> Set[ConfigKey]
def name(self: Configurable) ‑> str
-
Return the name of the configurable.
Returns
str
- The name of the configurable.
def set_config(*args, **kwargs)
-
Overloaded function.
- set_config(self: smuview.Configurable, config_key: smuview.ConfigKey, value: bool) -> None
Set a boolean value to the given config key.
Parameters
- set_config(self: smuview.Configurable, config_key: smuview.ConfigKey, value: int) -> None
Set an integer value to the given config key.
Parameters
- set_config(self: smuview.Configurable, config_key: smuview.ConfigKey, value: int) -> None
Set an unsigned integer value to the given config key.
Parameters
- set_config(self: smuview.Configurable, config_key: smuview.ConfigKey, value: float) -> None
Set a double value to the given config key.
Parameters
- set_config(self: smuview.Configurable, config_key: smuview.ConfigKey, value: str) -> None
Set a string value to the given config key.
Parameters
def setable_configs(self: Configurable) ‑> Set[ConfigKey]
class DataType (...)
-
Enum of all available data types.
init(self: smuview.DataType, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var Bool
-
Bool
var Double
-
Double
var DoubleRange
-
DoubleRange
var Int32
-
Int32
var KeyValue
-
KeyValue
var MQ
-
MQ
var RationalPeriod
-
RationalPeriod
var RationalVolt
-
RationalVolt
var String
-
String
var UInt64
-
UInt64
var UInt64Range
-
UInt64Range
var Unknown
-
Unknown
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.DataType) -> int
class DockArea (...)
-
Enum of all possible docking locations for a view.
init(self: smuview.DockArea, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var BottomDockArea
-
Dock to the bottom dock area.
var LeftDocktArea
-
Dock to the left dock area.
var RightDockArea
-
Dock to the right dock area.
var TopDockArea
-
Dock to the top dock area.
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.DockArea) -> int
class HardwareChannel (*args, **kwargs)
-
An actual hardware channel
Ancestors
- BaseChannel
- pybind11_builtins.pybind11_object
Inherited members
class HardwareDevice (*args, **kwargs)
-
An actual hardware device.
Ancestors
- BaseDevice
- pybind11_builtins.pybind11_object
Inherited members
class PyStreamBuf (...)
-
Redirect all Python output to a SmuView console. This class is for internal SmuView use only!
init(self: smuview.PyStreamBuf, arg0: str, arg1: str) -> None
Ancestors
- pybind11_builtins.pybind11_object
Instance variables
var closed
-
True
if the stream is closed. var encoding
-
The name of the encoding that is used.
var errors
-
The error setting of the decoder or encoder.
Methods
def close(self: PyStreamBuf)
-
Flush and close this stream.
def fileno(self: PyStreamBuf) ‑> int
-
Raises an
OSError
, becausePyStreamBuf
doesn't use a file descriptor. def flush(self: PyStreamBuf)
-
Flush the write buffers of the stream.
def isatty(self: PyStreamBuf) ‑> bool
-
Always returns
False
. def read(self: PyStreamBuf, size: int) ‑> str
-
Raises an
OSError
, becausePyStreamBuf
is write only. def readable(self: PyStreamBuf) ‑> bool
-
Always returns
False
. def readline(self: PyStreamBuf, size: int) ‑> str
-
Raises an
OSError
, becausePyStreamBuf
is write only. def readlines(self: PyStreamBuf, hint: int) ‑> List[str]
-
Raises an
OSError
, becausePyStreamBuf
is write only. def seek(self: PyStreamBuf, offset: int, whence: int) ‑> int
-
Raises an
OSError
, becausePyStreamBuf
is not seekable. def seekable(self: PyStreamBuf) ‑> bool
-
Always returns
False
.PyStreamBuf
is not seekable atm. def tell(self: PyStreamBuf) ‑> int
-
Raises an
OSError
, becausePyStreamBuf
is not seekable. def truncate(self: PyStreamBuf, size: int) ‑> int
-
Raises an
OSError
, becausePyStreamBuf
is not seekable. def writable(self: PyStreamBuf) ‑> bool
-
Always return
True
. def write(self: PyStreamBuf, s: str) ‑> int
-
Write the string
s
to the stream and return the number of characters written. def writelines(self: PyStreamBuf, lines: List[str])
-
Write a list of lines to the stream.
class Quantity (...)
-
Enum of all available quantities.
init(self: smuview.Quantity, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var ApparentPower
-
Apparent power
var Capacitance
-
Capacitance
var CarbonMonoxide
-
Carbon monoxide
var Conductance
-
Conductance
var Continuity
-
Continuity
var Count
-
Count
var Current
-
Current
var Difference
-
Difference from reference value.
var DissipationFactor
-
Dissipation factor
var DutyCyle
-
DutyCyle
var ElectricCharge
-
Electric charge
var Energy
-
Energy (also Work)
var Frequency
-
Frequency
var Gain
-
Gain (a transistor's gain, or hFE, for example).
var HarmonicRatio
-
Harmonic ratio
var Mass
-
Mass
var ParallelCapacitance
-
Parallel capacitance
var ParallelInductance
-
Parallel inductance
var ParallelResistance
-
Parallel resistance
var PhaseAngle
-
Phase angle
var Power
-
Electrical power, usually in W, or dBm.
var PowerFactor
-
Power factor
var Pressure
-
Pressure
var PulseWidth
-
PulseWidth
var QualityFactor
-
Quality factor
var RelativeHumidity
-
Relative humidity
var Resistance
-
Resistance
var SeriesCapacitance
-
Series capacitance
var SeriesInductance
-
Series inductance
var SeriesResistance
-
Series resistance
var SoundPressureLevel
-
Logarithmic representation of sound pressure relative to a reference value.
var Temperature
-
Temperature
var Time
-
Time
var Unknown
-
Unknown
var Voltage
-
Voltage
var WindSpeed
-
Wind speed
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.Quantity) -> int
class QuantityFlag (...)
-
Enum of all available quantity flags.
init(self: smuview.QuantityFlag, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var AC
-
Alternating current.
var Autorange
-
Device is in autoranging mode.
var Avg
-
Device is in average mode, averaging upon each new value.
var DC
-
Direct current.
var Diode
-
Value is voltage drop across a diode, or NAN.
var Duration
-
Time is duration (as opposed to epoch, …).
var FourWire
-
Device is in 4-wire mode.
var Hold
-
Device is in hold mode (repeating the last measurement).
var Max
-
Device is in max mode, only updating upon a new max value.
var Min
-
Device is in min mode, only updating upon a new min value.
var RMS
-
Root mean square (RMS).
var Reference
-
Reference value shown.
var Relative
-
Device is in relative mode.
var SplFreqWeightA
-
Sound pressure level is A-weighted in the frequency domain, according to IEC 61672:2003.
var SplFreqWeightC
-
Sound pressure level is C-weighted in the frequency domain, according to IEC 61672:2003.
var SplFreqWeightFlat
-
Sound pressure level is not weighted in the frequency domain, albeit without standards-defined low and high frequency limits.
var SplFreqWeightZ
-
Sound pressure level is Z-weighted.
var SplLAT
-
Sound pressure level is time-averaged (LAT), also known as Equivalent Continuous A-weighted Sound Level (LEQ).
var SplPctOverAlarm
-
Sound pressure level represented as a percentage of measurements that were over a preset alarm level.
var SplTimeWeightF
-
Sound pressure level measurement is F-weighted (125ms) in the time domain.
var SplTimeWeightS
-
Sound pressure level measurement is S-weighted (1s) in the time domain.
var Unknown
-
Unknown quantity flag.
var Unstable
-
Unstable value (hasn't settled yet).
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.QuantityFlag) -> int
class Session (*args, **kwargs)
-
The SmuView
Session
class for accessing the actual state of the application.Ancestors
- pybind11_builtins.pybind11_object
Methods
def add_user_device(self: Session) ‑> UserDevice
def connect_device(self: Session, conn_str: str) ‑> List[HardwareDevice]
-
Connect a new device. For some devices (like DMMs) you may want to wait a fixed time, until the first sample has arrived and an
AnalogSignal
object has been created. Example:import smuview import time # Connect device. dmm_dev = Session.connect_device("hp-3478a:conn=libgpib/hp3478a")[0] # Sleep 1s to give the devices the chance to create signals. time.sleep(1)
Parameters
conn_str
:str
- The connection string. See https://sigrok.org/wiki/Connection_parameters
Returns
List[HardwareDevice]
- A List with the newly connected device objects.
def devices(self: Session) ‑> Dict[str, BaseDevice]
-
Return all connected devices.
Returns
Dict[str, BaseDevice]
- A Dict where the key is the device id and the value is the device object.
class UiProxy (*args, **kwargs)
-
Helper class for accessing the UI.
Ancestors
- pybind11_builtins.pybind11_object
Methods
def add_control_view(self: UiProxy, tab_id: str, area: DockArea, configurable: Configurable) ‑> str
-
Add a control view for a configurable to the given tab.
Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
configurable
:Configurable
- The
Configurable
object.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def add_curve_to_time_plot_view(self: UiProxy, tab_id: str, view_id: str, signal: AnalogTimeSignal) ‑> str
-
Add a signal to the given time plot view.
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the time plot view.
signal
:AnalogTimeSignal
- The signal object.
Returns
str
- The id of the new curve or empty if the curve couldn't be added.
def add_curve_to_xy_plot_view(self: UiProxy, tab_id: str, view_id: str, x_signal: AnalogTimeSignal, y_signal: AnalogTimeSignal) ‑> str
-
Add x/y signals to the given x/y plot view.
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the x/y plot view.
x_signal
:AnalogTimeSignal
- The x signal object.
y_signal
:AnalogTimeSignal
- The y signal object.
Returns
str
- The id of the new curve or empty if the curve couldn't be added.
def add_data_view(self: UiProxy, tab_id: str, area: DockArea, signal: AnalogTimeSignal) ‑> str
-
Add a data view for a signal to the given tab.
Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
signal
:AnalogTimeSignal
- The signal object.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def add_device_tab(self: UiProxy, device: BaseDevice) ‑> str
-
Add a device tab with standard view for a device to the UI.
Parameters
device
:BaseDevice
- The device object.
Returns
str
- The id of the new tab or empty if the tab couldn't be added.
def add_power_panel_view(self: UiProxy, tab_id: str, area: DockArea, voltage_signal: AnalogTimeSignal, current_signal: AnalogTimeSignal) ‑> str
-
Add a power panel view for a voltage and a current signal to the given tab.
Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
voltage_signal
:AnalogTimeSignal
- The voltage signal object.
current_signal
:AnalogTimeSignal
- The current signal object.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def add_signal_to_data_view(self: UiProxy, tab_id: str, view_id: str, signal: AnalogTimeSignal)
-
Add a signal to the given data view.
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the data view.
signal
:AnalogTimeSignal
- The signal object.
def add_time_plot_view(self: UiProxy, tab_id: str, area: DockArea) ‑> str
-
Add a time plot view to the given tab. Use
UiProxy.set_channel_to_time_plot_view()
to set a channel to the plot view or useUiProxy.add_curve_to_time_plot_view()
to set a signal to the plot view. When you have set a channel to the plot, new curves will be automatically created, when the channel changes (e.g. for multimeters when switching functions).Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def add_value_panel_view(*args, **kwargs)
-
Overloaded function.
- add_value_panel_view(self: smuview.UiProxy, tab_id: str, area: smuview.DockArea, channel: smuview.BaseChannel) -> str
Add a value panel view for a channel to the given tab.
Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
channel
:BaseChannel
- The channel object.
Returns
str
- The id of the new view or empty if the view couldn't be added.
2. add_value_panel_view(self: smuview.UiProxy, tab_id: str, area: smuview.DockArea, signal: smuview.AnalogTimeSignal) -> str
Add a value panel view for a signal to the given tab.
Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
signal
:AnalogTimeSignal
- The signal object.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def add_xy_plot_view(self: UiProxy, tab_id: str, area: DockArea) ‑> str
-
Add a x/y plot view for two signals to the given tab. Use
UiProxy.add_curve_to_xy_plot_view()
to add a new curve (a set of two signals) to the plot view.Parameters
tab_id
:str
- The id of the tab.
area
:DockArea
- Where to put the new view.
Returns
str
- The id of the new view or empty if the view couldn't be added.
def set_channel_to_time_plot_view(self: UiProxy, tab_id: str, view_id: str, channel: BaseChannel)
-
Set a channel to the given time plot view. New curves will be automatically created, when the channel changes (e.g. for multimeters when switching functions).
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the time plot view.
channel
:BaseChannel
- The channel object.
def set_curve_color(self: UiProxy, tab_id: str, view_id: str, curve_id: str, color: Tuple[int, int, int])
-
Set the color of the given curve.
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the plot view.
curve_id
:str
- The id of the curve.
color
:Tuple[int, int, int]
- The color for the curve as a Tuple with the RGB values.
def set_curve_name(self: UiProxy, tab_id: str, view_id: str, curve_id: str, name: str)
-
Set the name of the given curve.
Parameters
tab_id
:str
- The id of the tab.
view_id
:str
- The id of the plot view.
curve_id
:str
- The id of the curve.
name
:str
- The name for the curve.
def show_double_input_dialog(self: UiProxy, title: str, label: str, value: float = 0.0, decimals: int = 1, step: float = 0.1, min: float = 2.2250738585072014e-308, max: float = 1.7976931348623157e+308) ‑> object
-
Show a dialog window to get a float value from the user. It returns the entered float value or
None
if the Cancel button was pressed.Only has effect if the used Qt version is equal or greater than 5.10!
Parameters
title
:str
- The window title of the input dialog.
label
:str
- The label to display in the input dialog.
value
:float
- The default value of the float.
decimals
:int
- The maximum number of decimal places the number may have. Default is 1.
step
:float
- The amount by which the value can be incremented or decremented by the user. Default is 0.1. Only has effect for Qt versions >= 5.10!
min
:float
- The minimum value the user may choose.
max
:float
- The maximum value the user may choose.
Returns
float
orNone
- The user entered float value or
None
when the Cancel button was pressed.
def show_int_input_dialog(self: UiProxy, title: str, label: str, value: int = 0, step: int = 1, min: int = -2147483648, max: int = 2147483647) ‑> object
-
Show a dialog window to get an integer value from the user. It returns the entered float value or
None
if the Cancel button was pressed.Parameters
title
:str
- The window title of the input dialog.
label
:str
- The label to display in the input dialog.
value
:int
- The default value of the integer.
step
:int
- The amount by which the value can be incremented or decremented by the user. Default is 1.
min
:int
- The minimum value the user may choose.
max
:int
- The maximum value the user may choose.
Returns
int
orNone
- The user entered integer value or
None
when the Cancel button was pressed.
def show_message_box(self: UiProxy, title: str, text: str) ‑> bool
-
Show a (info) message box with the given window title and text. Returns
True
when the Ok button was pressed.Parameters
title
:str
- The window title of the message box.
text
:str
- The text to display in the message box.
Returns
bool
True
when the Ok button was pressed, elseFalse
.
def show_string_input_dialog(self: UiProxy, title: str, label: str, value: str = '') ‑> object
-
Show a dialog window to get a string value from the user. It returns the entered string value or
None
if the Cancel button was pressed.Parameters
title
:str
- The window title of the input dialog.
label
:str
- The label to display in the input dialog.
value
:str
- The default value of the string.
Returns
str
orNone
- The user entered string value or
None
when the Cancel button was pressed.
class Unit (...)
-
Enum of all available units.
init(self: smuview.Unit, value: int) -> None
Ancestors
- pybind11_builtins.pybind11_object
Class variables
var Ampere
-
Ampere
var AmpereHour
-
AmpereHour (Ah)
var Boolean
-
Boolean
var Carat
-
Weight in carat.
var Celsius
-
Celsius
var Concentration
-
Concentration
var Coulomb
-
Coulomb
var DecibelMW
-
Decibel milliWatt (dBm)
var DecibelSpl
-
Decibel sound pressure level
var DecibelVolt
-
Decibel Volt (dBV)
var Degree
-
Degree
var Fahrenheit
-
Fahrenheit
var Farad
-
Farad
var Grain
-
Weight in grain.
var Gram
-
Weight in gram (g).
var HectoPascal
-
HectoPascal (hPa)
var Henry
-
Henry
var Hertz
-
Hertz
var Humidity293K
-
Humidity at 293K
var Joule
-
Joule
var Kelvin
-
Kelvin
var MeterPerSecond
-
Meter per second (m/s)
var Momme
-
Weight in momme.
var Ohm
-
Ohm
var Ounce
-
Weight in avoirdupois ounce (oz).
var Pennyweight
-
Weight in pennyweight.
var Percentage
-
Percentage
var Piece
-
Piece
var Pound
-
Weight in avoirdupois pound (lb).
var RevolutionsPerMinute
-
Revolutions per minute (RPM)
var Second
-
Second
var Siemens
-
Siemens
var Tael
-
Weight in tael.
var Tola
-
Weight in tola.
var TroyOunce
-
Weight in troy ounce (oz t).
var Unitless
-
Unitless
var Unknown
-
Unknown
var Volt
-
Volt
var VoltAmpere
-
VoltAmpere (VA)
var Watt
-
Watt
var WattHour
-
WattHour (Wh)
Instance variables
var name
-
name(self: handle) -> str
var value
-
(arg0: smuview.Unit) -> int
class UserChannel (*args, **kwargs)
-
An user generated channel for storing custom data.
Ancestors
- BaseChannel
- pybind11_builtins.pybind11_object
Methods
def push_sample(self: UserChannel, sample: float, timestamp: float, quantity: Quantity, quantity_flags: Set[QuantityFlag], unit: Unit, digits: int, decimal_places: int)
-
Push a single sample to the channel.
Parameters
sample
:float
- The sample value.
timestamp
:float
- The absolute timestamp in milliseconds.
quantity
:Quantity
- The
Quantity
of the new signal. quantity_flags
:Set[QuantityFlag]
- The
QuantityFlag
s of the new signal. unit
:Unit
- The
Unit
of the new signal. digits
:int
- The total number of digits.
decimal_places
:int
- The number of decimal places.
Inherited members
class UserDevice (*args, **kwargs)
-
An user generated (virtual) device for storing custom data and showing a custom tab.
Ancestors
- BaseDevice
- pybind11_builtins.pybind11_object
Inherited members