Python QSYS QRC Wrapper
Project description
Python QSYS QRC Wrapper
- Control QSC QSYS Core devices with python
ToDo
- Flaskify...
- Document, document, document
Use
- For each QSC Core on the network instantiate a "Core" class
- When adding control objects they will "cast" themselves to the parent core class
- The parent Core class instance is required as keyword arg "parent" when creating control objects
#!/usr/bin/python3
import time
from qsys import Core,Control,ChangeGroup
def main():
#See qsys.py for parameters in Core class
#The initiail EngineStatus response parameters from the device will get added to Core.__dict__
#You can pass "port" as well, but it defaults to 1710
myCore = Core(Name='myCore',User='',Password='',ip='192.168.61.2')
#Open the socket,creates "listen" and "keepalive" threads
myCore.start()
#ValueType can be a list of potential value types [int,float] or a single type "str" etc
#This object is assumed to be a "gain" control object, so we can pass [int,float]
gainControlObject = Control(parent=myCore,Name='namedControlInQsysDesigner',ValueType=[int,float])
#To constantly monitor the state of your object use a ChangeGroup
#You need to a ChangeGroup instance to add control objects and set polling rates
#Parameters that are capitalize are that way because of the QRC parameter protocol
#Id in this case is just the name of the ChangeGroup
myChangeGroup = ChangeGroup(parent=myCore,Id='myChangeGroup')
myChangeGroup.AddControl(gainControlObject)
#Allow the socket time to connect and parse the initial responses
time.sleep(2)
#Set the change group auto poll rate
#This rate is fast, your mileage may vary
myChangeGroup.AutoPoll(Rate=0.1)
while True:
print(gainControlObject.state)
time.sleep(1)
Notes
- In development, versions will change rapidly. This version doesn't do much yet.. stand by
References
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
qsys-0.0.2.tar.gz
(5.6 kB
view details)
Built Distribution
qsys-0.0.2-py3-none-any.whl
(7.3 kB
view details)
File details
Details for the file qsys-0.0.2.tar.gz
.
File metadata
- Download URL: qsys-0.0.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6acfd62019736bc1c86be0862a54ca5a6482a6d1ab13281388fb279460d765a6 |
|
MD5 | 64ed3a33a788ab7b5c275bdc4eadc2fb |
|
BLAKE2b-256 | 541df5a2f8142209762c25769bff75bd34a6771cb1c007850baa28a113e1cf69 |
File details
Details for the file qsys-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: qsys-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b9752f29b9f96b2eec7d291bf0ca77d3eed8cef2bd3cae4541a1d9026281342 |
|
MD5 | d6518bf9822adb42e7597ca7bcebf074 |
|
BLAKE2b-256 | 293bbf57dd71f7b67f38e87cae0c5958f606264a8f4473bbd93577c32a036cb7 |