pylab_ml.scope.softscope.Softscope
- class Softscope(mqttc, logger, instName='softscope')[source]
Bases:
mqtt_deviceattributesClass for the communication with the softcope-GUI.
- via mqtt some command controlled the sending of data:
- start:
create a Timer-thread with the loop-time = sampleTime
- stop:
stop the Timer-thread
- setchannel(value):
call the value as attribute for each timing event
- sampleTime:
loop time
- TODO: very simple…..
max sample Time ~50Hz
Methods
__init__(mqttc, logger[, instName])Initialise.
close()init(topinstname)mqtt_add(client, instrument[, liste, qos])Add the instrument to mqtt.
Remove the instrument from mqtt.
off()on()publish(topic, value)Publish topic as type='cmd' with paylad=value.
publish_get(function_name, value)Publish function_name as type='get' with paylad=value.
publish_set(function_name, value)Publish function_name as type='set' with paylad=value.
setchannel(value)set the scopeChannel via mqtt
Attributes
commandmqtt_enablemqtt_listGetter for the mqtt_status.
sampleTimetest- json = <module 'json' from '/home/runner/miniconda3/envs/test/lib/python3.9/json/__init__.py'>
- mqtt_add(client, instrument, liste='#', qos=0)
Add the instrument to mqtt.
calling from base_instrument, after the instrument (device) has been create. Normally you have not to use this function, only base_instrument use it.
- Returns:
None.
- mqtt_disconnect()
Remove the instrument from mqtt.
calling from base_instrument, if the instrument are closing. Normally you have not to use this function, only base_instrument use it.
- Returns:
None.
- property mqtt_status
Getter for the mqtt_status.
- publish(topic, value)
Publish topic as type=’cmd’ with paylad=value.
- publish_get(function_name, value)
Publish function_name as type=’get’ with paylad=value.
- publish_set(function_name, value)
Publish function_name as type=’set’ with paylad=value.