Skip to main content

Interface the R2X4 light source from Industrialise.

Project description

Driver package for the R2X4 light source from Industrialise.

Installation

The package can be installed from the wheel file:

pip install ls_r2x4-0.2.0-py3-none-any.whl

There is an optional Qt based widget available, next to a tkinter based one. The Qt widget uses QtPy to abstract the Qt backend. The package can be installed with:

pip install qtpy

The actual Qt backend needs to be installed separately. For example, to use the PySide2 backend:

pip install PySide2

QtPy5 and PySide6 are also supported. Checkout the QtPy documentation for information on which version of backend is supported by which version of QtPy.

There is also a R2X4Panel available for use in Gamma Desk which makes use of the Qt widget. Check the ls_r2x4.gui.gdesk_panel module for more information. To install Gamma Desk:

pip install gamma-desk

Usage

Demo

A demo is started when the package is run as a script:

python -m ls_r2x4

These top level scripts are available when the python environment is active:

  • r2x4_gui_tkinter : Start the GUI using the tkinter backend.
  • r2x4_gui_qt: Start the GUI using a Qt backend. This is needs pyqt or pyside to be installed!
  • r2x4_demo: Start the same demo as when the package is run as a script.

More demo scripts are available in the ls_r2x4.demo.demo module.

For jupyter lab users there is also a demo jupyter notebook available in the ls_r2x4.demo folder.

Programming API

The main class to use is the LightSourceR2X4 class. It is located in the ls_r2x4.r2x4 module.

from ls_r2x4.r2x4 import LightSourceR2X4
ls = LightSourceR2X4()

A serial port name can be passed to the constructor, if left None it will try to find the correct port automatically.

Once the instance is created, the light source can be controlled using the methods and attributes of the class.

import time
ls.triggering_force_a_channels()
ls.blue_a.value = 5  # set the blue a channel to 5%
ls.red_b.value = 3  # set the red b channel to 3%
time.sleep(2)
ls.triggering_force_b_channels()
time.sleep(1)
ls.blue_a.value = 0  # turn back off
ls.red_b.value = 0

Checkout the demo scripts for more examples.

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.

ind_ls_r2x4-0.2.0rc1-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file ind_ls_r2x4-0.2.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for ind_ls_r2x4-0.2.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b409764c837e966e451ac5814b9759874db18aa9fec5bbc4e44143f1c2352532
MD5 c956c041c9173bff2e6a2028e05628f1
BLAKE2b-256 3517bae9937edcc08af0facb94690374b73abaae5f6d8acbb0a8fa94d8b6bb8e

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