Skip to content
Snippets Groups Projects
Commit 4e6234b2 authored by esarrey's avatar esarrey
Browse files

Clean up

parent 9d3c4677
No related branches found
Tags v7.0
No related merge requests found
import nidaqmx
from time import sleep
try:
nidaqmx.Task()
except:
raise RuntimeError("Failed communicating with the DAC, aborting task")
with nidaqmx.Task() as task:
task.ao_channels.add_ao_voltage_chan("Dev1/ao1")
task.write(0.5, timeout=10)
task.start()
sleep(4)
task.write(0., timeout=10)
task.stop()
task.wait_until_done()
task.close()
import sys
from PyQt5.QtWidgets import QApplication, QDialog, QLabel
from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtCore import QTimer
import cv2
class AppWindow(QDialog):
def __init__(self):
super().__init__()
self.video = cv2.VideoCapture(0)
self.initUI()
def initUI(self):
self.setWindowTitle('miniMOKE')
self.setGeometry(300, 300, 800, 600)
self.label = QLabel(self)
self.label.setGeometry(0, 0, 1920//4, 1080//4)
self.label.setScaledContents(True)
self.timer = QTimer(self)
self.timer.timeout.connect(self.show_frame)
self.timer.start(20)
def show_frame(self):
_, frame = self.video.read()
# frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# image = QImage(frame, frame.shape[1], frame.shape[0],
# frame.strides[0], QImage.Format_RGB888)
# self.label.setPixmap(QPixmap.fromImage(image))
if __name__ == "__main__":
app = QApplication(sys.argv)
window = AppWindow()
window.show()
sys.exit(app.exec_())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment