Code Documentation

class stdcom.Subscription[source]

Class Passed Around by data coming from Multiverse, Note most of the time will be in its own thread, so copy the data before use

Data()[source]

Returns a list of the data

Name()[source]

returns the name of the subscription

SetData(name, data)[source]
Sets the class full of information
name

the name of the subscription

data

a list of the data

class stdcom.stdcom(ipaddress, port, connectedFunction=None, Callback=None, NCallback=None, ECallback=None)[source]

Threaded communication class to Multiverse, Standard Communication Class. This is a stand alone class that does not retuire PyQt5

Host

Name, or IP address where the Nextstep plugin is running

Port

ServicePort where the NextStep plugin is listening

Connected

Callback arg(Bool)

Data

Callback, where all the subscription comes in where it changes Callback(Subscription)

Names

Call Back, where all possible names come in Callabck(str)

Error

Callback Callback()

AddSubscriptions(subs)[source]
Adds a list of subscriptions
subs

A list of str of subscriber names desired subs : list[str]

GetAcks()[source]

Gets the number of Acks, used to see if the system is alive based on Pings or other actions, resets after it has been called

Returns

Number of Acks to messages, including pings, since the last time read.

GetErrors()[source]
Returns the status of the socket
return

False is connection is ok

GetNames()[source]
Gets the names all possible names possible to subscribe to
returns

List of possible names that are available at this time to subscribe to.

GetNotifications()[source]

If callback are not used, user can call this and it returns changed subsriptions, Use callbacks it makes more sense

return

list of subs that should be read if call backs are not used

NamesOn()[source]

Turns the names on in the Multiverse Plugin, allowing all possible names to come from Multiverse platform

Ping()[source]

Pings the host, will except if socket in error or not open

ReadData(who)[source]
Reads data of a subscription directly from Multiverse
who

The name of the subscription

ReadValues(name)[source]
Reads data for a given name, returns a list of data, the data that is cached from normal running operation to subscription changes.
name

The subscriber name

return

RemoveSub(who: str)[source]
Remove a Subscription previously made
who

the name of the subscrition

SetCallbacks(callback=None, namecallback=None)[source]
SetCallbacks sets the Data and
callback

Data Callback( Subscription)

namecallback

Name Callback(str)

Start()[source]

Start used interally when constructed starts the thread

UpDateMap(name, data)[source]
Internal Use for stuffing data
name

Subscription name

data

Date coming from Multiverse

UpdateAsBool(who, what, index)[source]
Updates Data as Bool, to Multiverse no need for caller to recast to Bool.. ~/name will assume internal subscription does not participate with Multiverse
who

Name of the subscription

what

list[Bool]

where

to begin to change into the array,

UpdateAsFloat(who, what, index)[source]
Updates Data as Float, to Multiverse no need for caller to recast to Float.. ~/name will assume internal subscription does not participate with Multiverse
who

Name of the subscription

what

list[Float]

where

to begin to change into the array,

UpdateAsInt(who, what, index=0)[source]
Updates Data as int, to Multiverse no need for caller to recast to int.. ~/name will assume internal subscription does not participate with Multiverse
who

Name of the subscription

what

list[int]

where

to begin to change into the array,

UpdateRaw(who, what, index)[source]
Updates Data as when is passed, to Multiverse user should recast to desired type() ~/name will assume internal subscription does not participate with Multiverse
who

Name of the subscription

what

list[type()]

where

to begin to change into the array,

isConnected()[source]
Returns the status of the socket, same as getErrors()
return

False is connection is ok

run()[source]

Internal use, thread running

terminate()[source]

Stops the thread,

class stdcomqt5.VSettings(project: str = 'stec-opcua')[source]

Used to save setup data

class stdcomqt5.stdcomPyQt(uiparent: Optional[PyQt5.QtCore.QObject] = None)[source]
The stdcomPyQt class is a PyQt5 version that sits on top of stdcom, can has signals, slots, and auto restart capabilities build into it.
uiparent

QObject = None default, or the parent QObject

AddNames(values)[source]
Internal use tell when a new name is found, with emit

: sigNames.emit: list[str] of new names entering the picture that can be subscribed to

AddValues(sub)[source]
Internal use, updates makes and notfies by signal data has changed for a subcription
sigNewData.emit

Name, Data

ConnectSocket(v)[source]
Socket connection call back, for internal use
sigConnect.emit

emits the signal if connection happens

ConnectionError()[source]
Socket error connection call back, for internal use
sigNoConnect.emit

emits the signal if connection error or close happens

LoadcBridge()[source]

User calls this to start the ball rolling to the connection to multiverse providing the destination and port are set correctly.

getPossibleSubscribesr()[source]
All the possible subscription names possible
return

list of names of all possible subscritions

getSubscribers()[source]
All the stuff subscribed to
return

A list of all the subscription names we have subscribed to

readValues(Name: str)[source]
Reads values cached for a single subscription name that is given and has been subscribed to.
Name

Name of the subscription

return

list of data for a given subscrition, or None if not available

setDestination(dest, port)[source]

Sets a new Destination and port, the user must terminate amd loadbridge again after changing is connected.

setWatchDogIntervalSec(seconds: int = 5)[source]
Sets the watchdog timer in seconds. This can be adjusted if the Multiverse in on the internet and thousands of miles away.
seconds

Default is 5 seconds, make this longer if huge internet delay

subscribe(Name: str)[source]
Subscribe to a give Name
Name

The subscription name

terminate()[source]

Cridical the user called this function when leaving .. I closes down the thread connected to multiverse

unsubscribe(Name)[source]
UnSubscribe to something previously subscribed to.
Name

The name of the Subscription to delete

writeValues(Name: str, Data: list)[source]
WritesValues to multiverse if subcription is made, or local data is ~/ is the prefix
Name

The name of the subscription, if ~/ is the prefix, then data is local.

Data

Is a list[] of data

class stdcomqt5widget.ipconfigDialog(callBack=None, ip='localhost', port='4897')[source]

IP Form, it is a IP and Port Configuation Dialog User can attach to sigNewIPPort to get IP and Port Changes

class stdcomqt5widget.stdcomqt5qtree(listOf, callback=None, callbackgetdata=None, onclick=True, label='not defined', parent=None)[source]

Used to create a communication tree of names based on NextStep names

AddName(name: str)[source]

Connection from Multiverse, for one name at a time

Parameters

name

Returns

AddNames(names: list)[source]

adds a list of names

SetLineEditText(text)[source]

Internal use :param text: :return:

newTextEnter()[source]

Not used :return:

class frontendOPCUA.StecMultiverseOPCUA(cBridge: Optional[stdcomqt5.stdcomPyQt] = None)[source]

Stec OPCUA Server used fpr anyone whishing use or make a OPCUA Server to Multiverse

DeleteRows()[source]

deletes a selected row :return:

EachData(key, name, nameCorrected, data)[source]

Data itor when data comes in from multiverse that we are subscribed to :param key: :param name: :param nameCorrected: :param data: :return:

EachName(key, name, nameCorrected, data)[source]

The itor function for each name when it comes it :param key: :param name: :param nameCorrected: :param data: :return:

InsertRow(name, enabled: str = 'False', readonly: str = 'True', freq='5')[source]

Inserts a row with a subscription possibility to the table :param name: :param enabled: :param readonly: :param freq: :return:

LoadConfig()[source]

loads all configurations :return:

RebuildAllowed()[source]

gets data from the screen and makes a maps of what to subscribe to :return:

SaveConfig()[source]

Saves all setup data :return:

Terminate()[source]

terminated thread and shuts it all down :return:

UpdateAllowedScreen()[source]

Tells the screen what should be allowed :return:

allowed(name: str)[source]
Parameters

name – Name from setup to determine if we can use it

Returns

closeEvent(event: Optional[PyQt5.QtCore.QEvent] = None)[source]

internal use :param event: :return:

createEndpoint()[source]

Builds an endpoint from ip and name internal use :return:

resetAll()[source]

Internal Use :return:

slotButtonClose()[source]

Close from screen :return:

slotNames(names)[source]
Parameters

names – names as they come in from multiverse

Returns

slotNewData(name, data)[source]

data as it comes in from Multiverse :param name: :param data: :return:

class frontendOPCUA.SubHandler(name: str, cBridge: stdcomqt5.stdcomPyQt)[source]

Subscription Handler. To receive events from server for a subscription

Same(l1: ], l2: ])[source]

Determines if 2 lists are the same :param l1: List 1 :param l2: List 2 :return: True is same, False if not

datachange_notification(node, val, data)[source]

Called when opc changes data :param node: :param val: :param data: :return:

write_from_multiverse(name: str, data: list)[source]
Parameters
  • name – Name of publication

  • data – Data coming from multiverse

Returns

class frontendOPCUA.Tree(cb)[source]

Simple Itor functionallity for traversing names or data

addname(name, data=None)[source]
Parameters
  • name – Names coming in

  • data – Data if uses as data itor

Returns