Skip to main content

Simple tool for creating a Qt-Dialog with updating values

Project description

qtmonitor

Simple tool for creating a Qt-Dialog with updating values.

The idea behind the project was the necessity to monitor some real-time values on a robotic-prototype. The package allows you to create a simple UI with a lot of values, that are updating constantly at specified intervals, without any knowledge of QT / PySide packages

Setup

To install qtmonitor use pip or download it from PyPI.

pip install qtmonitor

Example

There is an example module, which demonstrates how to write your own monitor. Feel free to dig down and explore the code. The file is located under you-python-packages-folder/qtmonitor/example.py

To run and see it in action feel free to use following command:

python -m qtmonitor.example

Usage

First of all, you need to create some python methods, which would return the value, you want to track. Here is a simple random int generator method. It will be used to demonstrate the module, there is no practical use for it.

import random

def random_int_value():
    return random.randrange(0, 1000)

The easiest way to create you own monitor is to subclass the qtmonitor.Monitor class

from qtmonitor import Monitor

class MyMonitor(Monitor):
    def __init__(self, parent=None):
        super(MyMonitor, self).__init__(parent)

Now add at least one group to put your values in:

from qtmonitor import Monitor

class MyMonitor(Monitor):
    def __init__(self, parent=None):
        super(MyMonitor, self).__init__(parent)

        grp = self.add_group('My group')

Add the values to the group and run the tool. Feel free to use provided run method:

import random
from qtmonitor import Monitor


def random_int_value():
    return random.randrange(0, 1000)


class MyMonitor(Monitor):
    def __init__(self, parent=None):
        super(MyMonitor, self).__init__(parent)

        grp = self.add_group('My group')
        grp.add_value('Value', random_int_value)
        grp.add_value('Value 10ms', random_int_value, interval=10)

if __name__ == '__main__':
    from qtmonitor import run
    run('My monitor', MyMonitor)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

qtmonitor-0.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file qtmonitor-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: qtmonitor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

File hashes

Hashes for qtmonitor-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0826b8c06d5db8d3610ea306f707af8098af98dfed0021c15a0101929159783
MD5 38a70aba951d4eabf5775484f697efed
BLAKE2b-256 296e46ec04f4f79877aa122f8f55f14c40e17316f39a1feac1a05dc931c0bf6e

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