Skip to main content

Zeta Mission Control python library

Project description

Zeta Mission Control

Simple library that helps connect to Zeta Technologies Mission Control app.

Usage

To make a connection use zmc.connect() as either a context manager or a decorator:

As a context manager:

import zmc

with zmc.connect():
    do_something()  # will execute while connection is established.

As a decorator:

import zmc

@zmc.connect()
def do_something():
    ...  # user implementation

do_something()  # will execute while connection is established.

Any code run within the context manager or decorator will only start running once a connection is established. (see below on how to run code to ensure a connection is made)

Interacting with app

The library enables easily sending and receiving data from the app via "components" found in zmc.components.

Sending data

Sending data is accomplished by calling specific functions on the components:

import zmc

graph = zmc.components.Graph("graphId")

with zmc.connect():
    # Update graph on GUI to show these three points.
    graph.plot(x=[0, 1, 2], y=[5, 6, 7])

Using values set in the GUI

To receive values that are set from the GUI, you can access the corresponding component attributes as you would any other attribute or variable. When a change is made on the GUI, the value will automatically be changed.

import zmc

slider = zmc.components.Slider("sliderId")

with zmc.connect():
    while True:
        if slider.value > 5:
            break  # Break once slider is changed above 5 on the GUI.

Running code

A python script using the zmc library should not be run directly from the terminal. Instead, it should be run through the app (so that the app can establish its own side of the connection). If you do run it directly, you will get a timeout stating that the connection could not be established

To run for debugging purposes, use zmc.connect(debug=True) which will mock out the connection and allow you to run the rest of your code as normal. Add verbose=True for more logging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zmc-0.0.3b1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zmc-0.0.3b1-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file zmc-0.0.3b1.tar.gz.

File metadata

  • Download URL: zmc-0.0.3b1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.1

File hashes

Hashes for zmc-0.0.3b1.tar.gz
Algorithm Hash digest
SHA256 8b9c036134292d158f09e895d0f36e7e7313ec9e2c21fc0b8c8ac692507f95f5
MD5 1b74aaed7caa66216aa00ab039ae4088
BLAKE2b-256 db4d71d3bbdb99186eac168edc76ad53a959a72d08796c2ebc7bbb47d81eb70a

See more details on using hashes here.

File details

Details for the file zmc-0.0.3b1-py3-none-any.whl.

File metadata

  • Download URL: zmc-0.0.3b1-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.1

File hashes

Hashes for zmc-0.0.3b1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce0dd8d20ee9138aa8f1b4a7861c1783aaeeb02f0a16ee4a75d5d02cac11a7fe
MD5 9728fe920dbcae5d9ceae233c610888e
BLAKE2b-256 e836837b37e711217ceac139d60dc05a8673a6838a8428a75277e7b3a9a026d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page