Skip to content

Commit

Permalink
Added detection of PyOpenGL
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis-van-Gils committed Jul 16, 2020
1 parent 6659fcb commit 97c6343
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions Arduino_PyQt_demo_with_multithreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
__authoremail__ = "[email protected]"
__url__ = "https://github.com/Dennis-van-Gils/DvG_Arduino_PyQt_multithread_demo"
__date__ = "16-07-2020"
__version__ = "4.0"
__version__ = "4.1"
# pylint: disable=bare-except, broad-except

import os
import sys
Expand All @@ -29,6 +30,15 @@
from dvg_devices.Arduino_protocol_serial import Arduino # I.e. the `device`
from dvg_qdeviceio import QDeviceIO

try:
# `conda install pyopengl` or `pip install pyopengl`
import OpenGL.GL as gl # pylint: disable=unused-import
except:
pass
else:
pg.setConfigOptions(useOpenGL=True)
pg.setConfigOptions(antialias=True)
pg.setConfigOptions(enableExperimental=True)

# Constants
# fmt: off
Expand Down Expand Up @@ -458,21 +468,6 @@ def DAQ_function():
# Set up multithreaded communication with the Arduino
# --------------------------------------------------------------------------

"""
# Alternative approach as subclassed QDeviceIO()
# fmt: off
qdev_ard = Arduino_qdev(
dev = ard,
DAQ_function = DAQ_function,
DAQ_interval_ms = DAQ_INTERVAL_MS,
critical_not_alive_count = 3,
calc_DAQ_rate_every_N_iter = 100,
debug = DEBUG,
)
# fmt: on
"""

# """
# Create QDeviceIO
qdev_ard = QDeviceIO(ard)

Expand Down

0 comments on commit 97c6343

Please sign in to comment.