Code Documentation

class stdcomQt.SubObject(name, Parent=None)[source]

Internal use, not for users

class stdcomQt.Subscriber(name: str, cloud: stdcomQt.stecQSocket, DataCallBack=None, DescCallBack=None, Parent=None)[source]

User connects to Multiverse just like c++ code Subscribers are used by any user to connect to a name or create a name on Multiverse

Data()[source]
Returns

The data if it exists

Desc()[source]
Returns

Description if exists

SetUserData(userData)[source]

sets user data locally for user to decide what to do with can be anything

StartSingleShot()[source]

interanl use :return:

UpdateData(what, index=0)[source]

User can update multiverse with data :param what: Data to send to Muliverse :param index: Zero default, but it can be sent in the middle of an arrary :return:

UpdateDesc(what)[source]

if we are the golden copy, we can send a Malcolm proof descriptor :param what: the descriptor :return:

UserData()[source]

Users can attach user data here

deleteLater()[source]

Deletes later inheritied

name

alias of str

newData(name, data)[source]

intenal use :param name: subscription name :param data: Data :return:

newDesc(name, desc)[source]

internal use :param desc: new description coming from multiverse :return:

class stdcomQt.stecQSocket(host: str = 'localhost', port: int = 4897, Parent=None)[source]

Qt Style cBridge to Multiverse just like c++ code

Host()[source]
Returns

current Host

InsertProxy(name)[source]

Internal use, not for user :param name: name of the subscription :return:

Port()[source]
Returns

current service Port

ProcessCommand(row)[source]

internal use, decodes messages :param row: :return:

SlotConnected()[source]

interal use Will restart any Subscription previously made :return:

SlotDataReady()[source]

Internal use :return:

SlotDisconnected()[source]

internal use :return:

SlotNewHost(host, port)[source]

user can change the connection, by host and port :param host: :param port: :return:

SlotSocketError()[source]

internal use called when connection to multiverse fails :return:

SlotTimerout()[source]

internal use :return:

SlotWrite(command)[source]

internal use :param command: :return:

isConnected()[source]

returns true if connected to multiverse :return:

quit()[source]

call before deletelater by user :return:

setOwner(name, description: str = 'Make this MalcolmProof Please', flag: bool = True)[source]

Sets us as the owner of the subscription, we will automatically refeed multiverse if reset :param name: subscription name :param flag: True means we are golden copy, false restores to non-golden copy :return:

class stdcomutilitywidgets.StecIPconfigDialog(OkCallBack: Optional[object] = None, CancelCallBack: Optional[object] = None, ip: object = 'localhost', port: object = '4897', parent: Optional[object] = None)[source]

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

class stdcomutilitywidgets.StecPostgresConfigWidget(okCb=None, cancel=None, host: str = 'localhost', port: str = 5432, database: str = 'vremsoft', user: str = 'vremsoft', passowrd: str = 'vrem2010!', parent=None)[source]

Configuration Widget for connecting to Stec Postgres Database

Cancel()[source]

cancel ir pressed :return:

Ok()[source]

when ok is pressed also self.OKSignal.emit(a, b, c, d, e) :return:

class stdcomutilitywidgets.StecTreeMorph(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

AddDesc(name, desc)[source]
Parameters
  • name – Name in the tree

  • desc – Description of that name

Returns

AddName(name: str)[source]

Connection from Multiverse, for one name at a time :param name: :return:

AddNames(names: list)[source]

adds a list of names

DeleteSelected()[source]

deletes selected items

clear()[source]

clears the list, and puts the original back

getData(item: PyQt5.QtWidgets.QTreeWidgetItem)[source]

gets

class stdcomvsettings.RetensionSettings(project: str = 'stdcomQt.ResidentSubscriber')[source]
class stdcomvsettings.VSettings(project: str = 'stec-general')[source]

Used to save setup data

class stdcomQtC20.ComputerSL(X1, X2, Y1, Y2)[source]

computers the slope and intercept for interpolation of history array

class stdcomQtC20.Dahlin(TC: float = 15.0, LAMBDA: float = 0.1, GAIN: float = 1)[source]

simple Dahlin controller, if you don’t like the PID controller

Reset()[source]

clears history

XtoC(X: float)[source]

in with error from 0, where 0 is the target, return controller output

class stdcomQtC20.ExpFilter(FI: float = 0.2)[source]

Exponetial filter

Reset()[source]

clean out history

SetFI(FI: float = 1)[source]

sets to new FI

XtoC(X: float)[source]

in with value return filtered value

class stdcomQtC20.F25(G: float, LAMBDA: float, TC: float, TAU: float, steps: int = 40)[source]

F25 Lambda tuned Algorith

Control(value: float)[source]

0 is always the target so the value is delta to 0, it is the error returns control move

Reset()[source]

reset, normally just make a new controller, but if you want you can reset

class stdcomQtC20.HistoryDelay(steps: int = 40, tau: Optional[float] = None)[source]

This is a history array, it will work with either number storage IE steps, or if tau is not None, then it will work off of Tau It is meant as to not store more than necessary if tau is given.. if steps are used, then storage will be in steps and the use must ensure then number of steps is suffecient to store what is needed. No Block rate is needed, this works of actual seconds.

class stdcomQtC20.MapToZones(args)[source]
args = edge_allow_0=True allows 0’s at the edges

middle_allow_0=False allows 0’s in the middle start_s=1 starting slice number or databox number end_s=20 ending slice number of databox number left_s=1 if rev with right_s then porfile is to be reversed right_s=20 offset=0.0 offset in units of total_s_width actuator to headbox total_s_width=100 total slice width or headbox width min_d_width=6 units of total_s_width, the min actuator wisth d_count=10 number of actuators

maps profile from scanner to actuator zones

Control(src)[source]

Enter with profile, return with profile mapped to zone

class stdcomQtC20.PID(p=0, i=0, d=0, **kwargs)[source]

Simple PID control.

class stdcomQtC20.RollingAverageFilter(nbrSamples: int = 5)[source]

rolling average filter

Reset()[source]

clears history

stdcomQtC20.twiddle(evaluator, tol=0.001, params=3, error_cmp=None, initial_guess=None)[source]

A coordinate descent parameter tuning algorithm.

https://en.wikipedia.org/wiki/Coordinate_descent

Params:

evaluator := callable that will be passed a series of number parameters, which will return

an error measure

tol := tolerance threshold, the smaller the value, the greater the tuning

params := the number of parameters to tune

error_cmp := a callable that takes two error measures (the current and last best)

and returns true if the first is less than the second

initial_guess := parameters to begin tuning with

class stdcomQtPjanice.pjanicesimpleGeneric(cBridge: Optional[stdcomQt.stecQSocket] = None, parent=None)[source]

Stec Pjanice Widget, but with trees not list.

addRow()[source]

adds a row to table

getcBridge()[source]

return the current cBridge, the stdcomPyQt which is the qt version of the stdcom

mousePressEvent(self, QMouseEvent)[source]
newData(name, data)[source]

Internal use :param name: :param data: :return:

on_any_itemChanged(itm: PyQt5.QtWidgets.QTableWidgetItem)[source]

when any item is clicked

slotDesc(name, desc)[source]

internal use

slotNames(names)[source]

internal use

slotSelected(name, desc)[source]

selected slot, it tree item is clicked

This is where Stec parse args for xxxx= turns list into a dict.. for pulling out xxxx=what

class stdcomQtargs.stdcomQtargs(args, delimters: str = '=')[source]

arguments list xxx=yyy delimter = returns dictionary of terms