MET4FOFDataReceiver module

Created on Wed Sep 4 09:20:12 2019

Data receiver for Met4FoF Protobuff Data @author: Benedikt.Seeger@ptb.de

class MET4FOFDataReceiver.AliasDict(*args, **kwargs)[source]

Bases: dict

add_alias(key, alias)[source]
class MET4FOFDataReceiver.ChannelDescription(CHID)[source]

Bases: object

setDescription(key, value)[source]

Sets an spefic key of an channel description.

key : string
PHYSICAL_QUANTITY”,UNIT,RESOLUTION,MIN_SCALE or MAX_SCALE.
value : string or intger
valuie coresponding to the key.

None.

class MET4FOFDataReceiver.DataReceiver(IP, Port=7654)[source]

Bases: object

Class for handlig the incomming UDP Packets and spwaning sensor Tasks and sending the Protobuff Messages over an queue to the Sensor Task

_images/DR_flow.png
run()[source]

Spwans the Datareceiver task.

None.

stop()[source]

Stops the Datareceiver task and closes the UDP socket.

None.

class MET4FOFDataReceiver.Sensor(ID, BufferSize=2500000.0)[source]

Bases: object

Class for Processing the Data from Datareceiver class. All instances of this class will be swaned in Datareceiver.AllSensors

_images/Sensor_loop.png
DescriptionTypNames = {0: 'PHYSICAL_QUANTITY', 1: 'UNIT', 2: 'UNCERTAINTY_TYPE', 3: 'RESOLUTION', 4: 'MIN_SCALE', 5: 'MAX_SCALE'}
FFieldNames = ['f_Data_01', 'f_Data_02', 'f_Data_03', 'f_Data_04', 'f_Data_05', 'f_Data_06', 'f_Data_07', 'f_Data_08', 'f_Data_09', 'f_Data_10', 'f_Data_11', 'f_Data_12', 'f_Data_13', 'f_Data_14', 'f_Data_15', 'f_Data_16']
SetCallback(callback)[source]

Sets an callback function signature musste be: callback(message[“ProtMsg”], self.Description)

callback : function
callback function signature musste be: callback(message[“ProtMsg”], self.Description).

None.

StartDumpingToFileASCII(filename='')[source]

Activate dumping Messages in a file ASCII encoded ; seperated.

filename : path
path to the dumpfile.

None.

StartDumpingToFileProto(filename='')[source]

Activate dumping Messages in a file ProtBuff encoded n seperated.

filename : path
path to the dumpfile.

None.

StopDumpingToFileASCII()[source]

Stops dumping to file ASCII encoded.

None.

StopDumpingToFileProto()[source]

Stops dumping to file Protobuff encoded.

None.

StrFieldNames = ['str_Data_01', 'str_Data_02', 'str_Data_03', 'str_Data_04', 'str_Data_05', 'str_Data_06', 'str_Data_07', 'str_Data_08', 'str_Data_09', 'str_Data_10', 'str_Data_11', 'str_Data_12', 'str_Data_13', 'str_Data_14', 'str_Data_15', 'str_Data_16']
UnSetCallback()[source]

deactivates the callback.

None.

join(*args, **kwargs)[source]

Call the stop function

*args : args
args are discarded.
**kwargs : kwargs
kwargs are discarded.

None.

run()[source]

None.

stop()[source]

Stops the sensor task.

None.

class MET4FOFDataReceiver.SensorDescription(ID=0, SensorName='undefined', fromDict=None)[source]

Bases: object

this class is holding the Sensor description. It’s subscriptable by : 1. inter number of the channel eg.g. SensorDescription[1] 2. Name of The physical quantity SensorDescription[“Temperature”] 3. Name of the data field SensorDescription[“Data_01”]

asDict()[source]

ChannelDescription as dict.

ReturnDict : dict
ChannelDescription as dict.
getUnits()[source]
setChannelParam(CHID, key, value)[source]

Set parametes for an specific channel.

CHID : intger
ID of the channel startig with 1.
key : string
PHYSICAL_QUANTITY”,UNIT,RESOLUTION,MIN_SCALE or MAX_SCALE.
value : string or intger
valuie coresponding to the key.

None.

class MET4FOFDataReceiver.genericPlotter(BufferLength)[source]

Bases: object

PushData(message, Description)[source]

Pushes an block of data in to the buffer. This function is set as Sensor callback with the function :Sensor.SetCallback`

message : protobuff message
Message to be pushed in the buffer.
Description SensorDescription:
SensorDescription is discarded.

None.

setUpFig()[source]

Sets up the figure with subplots and labels cant be called in init since this params arent knowen to init time.

None.