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
- class stdcom.stdcom(ipaddress, port, connectedFunction=None, Callback=None, NCallback=None, ECallback=None, DCallback=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.
- GetDescNotifications()[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
- 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
- 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
- SetCallbacks(callback=None, namecallback=None, desccallback=None)[source]¶
- SetCallbacks sets the Data and
- callback
Data Callback( Subscription)
- namecallback
Name Callback(str)
- 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,
- 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
- AddDesc(sub)[source]¶
- Internal use, updates makes and notfies by signal data has changed for a subcription
- sigNewData.emit
Name, Data
- 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.
- getPossibleSubscribers()[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
- terminate()[source]¶
Cridical the user called this function when leaving .. I closes down the thread connected to multiverse
- 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
- class stdcomqt5widget.stdcomqt5qtreeMorph(tree: PyQt5.QtWidgets.QTreeWidget, listOf=[''], parent=None)[source]¶
Used to create a communication tree of names based on NextStep names It is passed with an exisiting QTreeWidget, this is the most userful of the tree widget because it uses exisitng QTreeWidgets
- class pjaniceGeneric.pjaniceGeneric(cBridge: Optional[stdcomqt5.stdcomPyQt] = None, project: str = 'stec-pjanice', parent=None)[source]¶
Stec Pjanice Widget, but with trees not list.
- closeEvent(event: Optional[PyQt5.QtCore.QEvent] = None)[source]¶
internal use :param event: :return:
- getcBridge()[source]¶
return the current cBridge, the stdcomPyQt which is the qt version of the stdcom
.