Commit 024ba0c1 authored by Spencer Du's avatar Spencer Du

update

parent 0119c5a7
This diff is collapsed.
This diff is collapsed.
......@@ -2,4 +2,13 @@
name=laser
[cameras]
name=cameras
\ No newline at end of file
name=cameras
[webcam]
name=webcam
[stage]
name=stage
[filter_wheel]
name=filter wheel
\ No newline at end of file
......@@ -34,7 +34,7 @@ class embedded:
def import_devices(devices):
for item in devices:
device = (item + "Embedded")
device = (item + "_embedded")
deviceImport = __import__(device)
with open("list_of_device(s)_currently_active.txt", "a+") as myfile:
......
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'filterwheel.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Filterwheel(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(322, 161)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.label_5 = QtWidgets.QLabel(self.centralwidget)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 1, 1, 2, 1)
self.comboBox = QtWidgets.QComboBox(self.centralwidget)
self.comboBox.setObjectName("comboBox")
self.gridLayout.addWidget(self.comboBox, 2, 0, 3, 1)
self.checkBox = QtWidgets.QCheckBox(self.centralwidget)
self.checkBox.setText("")
self.checkBox.setCheckable(True)
self.checkBox.setChecked(False)
self.checkBox.setObjectName("checkBox")
self.gridLayout.addWidget(self.checkBox, 3, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
self.checkBox_2 = QtWidgets.QCheckBox(self.centralwidget)
self.checkBox_2.setText("")
self.checkBox_2.setObjectName("checkBox_2")
self.gridLayout.addWidget(self.checkBox_2, 7, 1, 1, 1)
self.comboBox_3 = QtWidgets.QComboBox(self.centralwidget)
self.comboBox_3.setObjectName("comboBox_3")
self.gridLayout.addWidget(self.comboBox_3, 6, 0, 2, 1)
self.comboBox_4 = QtWidgets.QComboBox(self.centralwidget)
self.comboBox_4.setObjectName("comboBox_4")
self.gridLayout.addWidget(self.comboBox_4, 6, 2, 2, 1)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 2, 1, 1)
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 5, 2, 1, 1)
self.comboBox_2 = QtWidgets.QComboBox(self.centralwidget)
self.comboBox_2.setObjectName("comboBox_2")
self.gridLayout.addWidget(self.comboBox_2, 2, 2, 3, 1)
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setCheckable(True)
self.pushButton.setChecked(True)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 0, 0, 1, 1)
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.label_6 = QtWidgets.QLabel(self.centralwidget)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 5, 1, 2, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label_5.setText(_translate("MainWindow", "Link"))
self.label_3.setText(_translate("MainWindow", "Left magnification changer"))
self.label_2.setText(_translate("MainWindow", "Right filter wheel"))
self.label_4.setText(_translate("MainWindow", "Right magnification changer"))
self.pushButton.setText(_translate("MainWindow", "ON"))
self.label.setText(_translate("MainWindow", "Left filter wheel"))
self.label_6.setText(_translate("MainWindow", "Link"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_Filterwheel()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'stage.ui'
#
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!
from mqtt import *
from PyQt5 import QtCore, QtWidgets, QtGui
import os
import configparser
import time
import json
class Ui_Stage(object):
def setupUi(self, Stage):
Stage.setObjectName("Stage")
Stage.resize(404, 321)
self.centralwidget = QtWidgets.QWidget(Stage)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.lineEdit_6 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_6.setObjectName("lineEdit_6")
self.gridLayout.addWidget(self.lineEdit_6, 4, 4, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout.addWidget(self.lineEdit_2, 0, 4, 1, 1)
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton, 0, 2, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 0, 3, 1, 1)
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_3.setObjectName("pushButton_3")
self.gridLayout.addWidget(self.pushButton_3, 2, 2, 1, 1)
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 2, 3, 1, 1)
self.lineEdit_3 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_3.setObjectName("lineEdit_3")
self.gridLayout.addWidget(self.lineEdit_3, 2, 1, 1, 1)
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 0, 6, 1, 1)
self.lineEdit_4 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_4.setObjectName("lineEdit_4")
self.gridLayout.addWidget(self.lineEdit_4, 2, 4, 1, 1)
self.label_5 = QtWidgets.QLabel(self.centralwidget)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1)
self.pushButton_5 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_5.setObjectName("pushButton_5")
self.gridLayout.addWidget(self.pushButton_5, 4, 2, 1, 1)
self.pushButton_6 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_6.setObjectName("pushButton_6")
self.gridLayout.addWidget(self.pushButton_6, 4, 6, 1, 1)
self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_4.setObjectName("pushButton_4")
self.gridLayout.addWidget(self.pushButton_4, 2, 6, 1, 1)
self.lineEdit_5 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_5.setObjectName("lineEdit_5")
self.gridLayout.addWidget(self.lineEdit_5, 4, 1, 1, 1)
self.horizontalSlider_3 = QtWidgets.QSlider(self.centralwidget)
self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_3.setObjectName("horizontalSlider_3")
self.gridLayout.addWidget(self.horizontalSlider_3, 5, 0, 1, 7)
self.lineEdit_7 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_7.setObjectName("lineEdit_7")
self.gridLayout.addWidget(self.lineEdit_7, 6, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(self.centralwidget)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1)
self.label_6 = QtWidgets.QLabel(self.centralwidget)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 4, 3, 1, 1)
self.pushButton_7 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_7.setObjectName("pushButton_7")
self.gridLayout.addWidget(self.pushButton_7, 6, 2, 1, 1)
self.horizontalSlider = QtWidgets.QSlider(self.centralwidget)
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider.setObjectName("horizontalSlider")
self.gridLayout.addWidget(self.horizontalSlider, 1, 0, 1, 7)
self.horizontalSlider_2 = QtWidgets.QSlider(self.centralwidget)
self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_2.setObjectName("horizontalSlider_2")
self.gridLayout.addWidget(self.horizontalSlider_2, 3, 0, 1, 7)
self.pushButton_8 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_8.setObjectName("pushButton_8")
self.gridLayout.addWidget(self.pushButton_8, 8, 1, 1, 1)
self.pushButton_11 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_11.setObjectName("pushButton_11")
self.gridLayout.addWidget(self.pushButton_11, 8, 4, 1, 1)
self.pushButton_12 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_12.setObjectName("pushButton_12")
self.gridLayout.addWidget(self.pushButton_12, 8, 5, 1, 1)
self.pushButton_13 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_13.setObjectName("pushButton_13")
self.gridLayout.addWidget(self.pushButton_13, 8, 6, 1, 1)
self.pushButton_9 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_9.setObjectName("pushButton_9")
self.gridLayout.addWidget(self.pushButton_9, 8, 2, 1, 1)
self.pushButton_10 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_10.setObjectName("pushButton_10")
self.gridLayout.addWidget(self.pushButton_10, 8, 3, 1, 1)
self.horizontalSlider_4 = QtWidgets.QSlider(self.centralwidget)
self.horizontalSlider_4.setOrientation(QtCore.Qt.Horizontal)
self.horizontalSlider_4.setObjectName("horizontalSlider_4")
self.gridLayout.addWidget(self.horizontalSlider_4, 7, 0, 1, 7)
Stage.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(Stage)
self.statusbar.setObjectName("statusbar")
Stage.setStatusBar(self.statusbar)
self.retranslateUi(Stage)
QtCore.QMetaObject.connectSlotsByName(Stage)
def retranslateUi(self, Stage):
_translate = QtCore.QCoreApplication.translate
Stage.setWindowTitle(_translate("Stage", "MainWindow"))
self.pushButton.setText(_translate("Stage", "um"))
self.label.setText(_translate("Stage", "X"))
self.label_2.setText(_translate("Stage", "Step"))
self.label_3.setText(_translate("Stage", "Y"))
self.pushButton_3.setText(_translate("Stage", "um"))
self.label_4.setText(_translate("Stage", "Step"))
self.pushButton_2.setText(_translate("Stage", "um"))
self.label_5.setText(_translate("Stage", "Z"))
self.pushButton_5.setText(_translate("Stage", "um"))
self.pushButton_6.setText(_translate("Stage", "um"))
self.pushButton_4.setText(_translate("Stage", "um"))
self.label_7.setText(_translate("Stage", "R"))
self.label_6.setText(_translate("Stage", "Step"))
self.pushButton_7.setText(_translate("Stage", "deg"))
self.pushButton_8.setText(_translate("Stage", "90" + "\n" + "degrees" + "\n" + "counter-clockwise"))
self.pushButton_11.setText(_translate("Stage", "15" + "\n" + "degrees" + "\n" + "clockwise"))
self.pushButton_12.setText(_translate("Stage", "45" + "\n" + "degrees" + "\n" + "clockwise"))
self.pushButton_13.setText(_translate("Stage", "90" + "\n" + "degrees" + "\n" + "clockwise"))
self.pushButton_9.setText(_translate("Stage", "45" + "\n" + "degrees" + "\n" + "counter-clockwise"))
self.pushButton_10.setText(_translate("Stage", "15" + "\n" + "degrees" + "\n" + "counter-clockwise"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Stage = QtWidgets.QMainWindow()
ui = Ui_Stage()
ui.setupUi(Stage)
Stage.show()
sys.exit(app.exec_())
\ No newline at end of file
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from webcam2 import *
from mqtt import *
import json
import time
import sys
class SubWindow(QtWidgets.QMainWindow):
def __init__(self, parent = None):
super(SubWindow, self).__init__(parent)
self.setMinimumSize(QSize(300, 300))
self.ui = Ui_Webcam()
self.ui.setupUi(self)
def main():
if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
app = QtWidgets.QApplication(sys.argv)
application = SubWindow()
application.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
# def on(self):
# client = device()
# client.run()
# client.loop_start()
# print("Connected to broker")
# time.sleep(1)
# print("Subscribing to topic", "microscope/light_sheet_microscope/UI")
# client.subscribe("microscope/light_sheet_microscope/UI")
# print("Publishing message to topic", "microscope/light_sheet_microscope/UI")
# client.publish("microscope/light_sheet_microscope/UI", json.dumps({"type": "device", "payload":{"name": self.fileName_UI, "cmd": "laser turning on"}}, indent=2))
# time.sleep(1)
# client.loop_stop()
# self.Button.setStyleSheet("background-color: green")
# listofdevices = []
# listofdevices.append(self.fileName_UI)
# with open("list_of_devices_currently_active.txt", "a+") as myfile:
# for item in listofdevices:
# myfile.write(item + "\n")
# print("\n" + item + " added to device list" + "\n" + "\n" + "List of devices currently active:")
# def readFile(fname):
# try:
# with open(fname, "r") as f:
# for item in f:
# print(item)
# except:
# print("No devices added yet")
# readFile("list_of_devices_currently_active.txt")
# def off(self):
# client = device()
# client.run()
# client.loop_start()
# print("Connected to broker")
# time.sleep(1)
# print("Subscribing to topic", "microscope/light_sheet_microscope/UI/states")
# client.subscribe("microscope/light_sheet_microscope/UI/states")
# print("Publishing message to topic", "microscope/light_sheet_microscope/UI/states")
# client.publish("microscope/light_sheet_microscope/UI/states", json.dumps({"type": "device", "payload":{"name": self.fileName_UI, "cmd": "cameras turning off"}}, indent=2))
# time.sleep(1)
# client.loop_stop()
# print("Device turned off")
# self.Button.setStyleSheet("background-color:")
# with open("list_of_devices_currently_active.txt", "r") as f:
# lines = f.readlines()
# with open("list_of_devices_currently_active.txt", "w") as f:
# for line in lines:
# if line.strip("\n") != "laser":
# f.write(line)
# print("Laser removed from device list" + "\n\n" + "List of devices currently active")
# def readFile(fname):
# try:
# with open(fname, "r") as f:
# for item in f:
# print(item)
# except:
# print("No devices added yet")
# readFile("list_of_devices_currently_active.txt")
# def closeEvent(self, event):
# self.close()
\ No newline at end of file
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtPrintSupport import *
from PyQt5.QtMultimedia import *
from PyQt5.QtMultimediaWidgets import *
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
import os
import configparser
import time
import json
from mqtt import *
import os
import sys
import time
class Ui_Webcam(object):
def setupUi(self, Webcam):
Webcam.setObjectName("Webcam")
Webcam.resize(300, 300)
self.centralwidget = QtWidgets.QWidget(Webcam)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.viewfinder = QCameraViewfinder()
self.viewfinder.show()
Webcam.setCentralWidget(self.viewfinder)
self.statusbar = QtWidgets.QStatusBar(Webcam)
self.statusbar.setObjectName("statusbar")
self.statusbar = QStatusBar()
Webcam.setStatusBar(self.statusbar)
self.retranslateUi(Webcam)
QtCore.QMetaObject.connectSlotsByName(Webcam)
self.available_cameras = QCameraInfo.availableCameras()
if not self.available_cameras:
pass #quit
# self.status = QStatusBar()
# self.setStatusBar(self.status)
self.save_path = ""
# self.viewfinder = QCameraViewfinder()
# self.viewfinder.show()
# self.setCentralWidget(self.viewfinder)
# Set the default camera.
self.select_camera(0)
# Setup tools
camera_toolbar = QToolBar("Camera")
camera_toolbar.setIconSize(QSize(14, 14))
Webcam.addToolBar(camera_toolbar)
photo_action = QAction()
photo_action.setStatusTip("Take photo of current view")
photo_action.triggered.connect(self.take_photo)
camera_toolbar.addAction(photo_action)
change_folder_action = QAction()
change_folder_action.setStatusTip("Change folder where photos are saved.")
change_folder_action.triggered.connect(self.change_folder)
camera_toolbar.addAction(change_folder_action)
camera_selector = QComboBox()
camera_selector.addItems([c.description() for c in self.available_cameras])
camera_selector.currentIndexChanged.connect( self.select_camera )
camera_toolbar.addWidget(camera_selector)
# self.setWindowTitle("NSAViewer")
# self.show()
def select_camera(self, i):
self.camera = QCamera(self.available_cameras[i])
self.camera.setViewfinder(self.viewfinder)
self.camera.setCaptureMode(QCamera.CaptureStillImage)
self.camera.error.connect(lambda: self.alert(self.camera.errorString()))
self.camera.start()
self.capture = QCameraImageCapture(self.camera)
self.capture.error.connect(lambda i, e, s: self.alert(s))
self.capture.imageCaptured.connect(lambda d, i: self.status.showMessage("Image %04d captured" % self.save_seq))
self.current_camera_name = self.available_cameras[i].description()
self.save_seq = 0
def take_photo(self):
timestamp = time.strftime("%d-%b-%Y-%H_%M_%S")
self.capture.capture(os.path.join(self.save_path, "%s-%04d-%s.jpg" % (
self.current_camera_name,
self.save_seq,
timestamp
)))
self.save_seq += 1
def change_folder(self):
path = QFileDialog.getExistingDirectory(self, "Snapshot save location", "")
if path:
self.save_path = path
self.save_seq = 0
def alert(self, s):
"""
Handle errors coming from QCamera dn QCameraImageCapture by displaying alerts.
"""
err = QErrorMessage(self)
err.showMessage(s)
def retranslateUi(self, Webcam):
_translate = QtCore.QCoreApplication.translate
Webcam.setWindowTitle(_translate("Webcam", "MainWindow"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Webcam = QtWidgets.QMainWindow()
ui = Ui_Webcam()
ui.setupUi(Webcam)
Webcam.show()
sys.exit(app.exec_())
# class MainWindow(QMainWindow):
# def __init__(self, *args, **kwargs):
# super(MainWindow, self).__init__(*args, **kwargs)
# self.available_cameras = QCameraInfo.availableCameras()
# if not self.available_cameras:
# pass #quit
# self.status = QStatusBar()
# self.setStatusBar(self.status)
# self.save_path = ""
# self.viewfinder = QCameraViewfinder()
# self.viewfinder.show()
# self.setCentralWidget(self.viewfinder)
# # Set the default camera.
# self.select_camera(0)
# # Setup tools
# camera_toolbar = QToolBar("Camera")
# camera_toolbar.setIconSize(QSize(14, 14))
# self.addToolBar(camera_toolbar)
# photo_action = QAction(QIcon(os.path.join('images', 'camera-black.png')), "Take photo...", self)
# photo_action.setStatusTip("Take photo of current view")
# photo_action.triggered.connect(self.take_photo)
# camera_toolbar.addAction(photo_action)
# change_folder_action = QAction(QIcon(os.path.join('images', 'blue-folder-horizontal-open.png')), "Change save location...", self)
# change_folder_action.setStatusTip("Change folder where photos are saved.")
# change_folder_action.triggered.connect(self.change_folder)
# camera_toolbar.addAction(change_folder_action)
# camera_selector = QComboBox()
# camera_selector.addItems([c.description() for c in self.available_cameras])
# camera_selector.currentIndexChanged.connect( self.select_camera )
# camera_toolbar.addWidget(camera_selector)
# self.setWindowTitle("NSAViewer")
# self.show()
# def select_camera(self, i):
# self.camera = QCamera(self.available_cameras[i])
# self.camera.setViewfinder(self.viewfinder)
# self.camera.setCaptureMode(QCamera.CaptureStillImage)
# self.camera.error.connect(lambda: self.alert(self.camera.errorString()))
# self.camera.start()
# self.capture = QCameraImageCapture(self.camera)
# self.capture.error.connect(lambda i, e, s: self.alert(s))
# self.capture.imageCaptured.connect(lambda d, i: self.status.showMessage("Image %04d captured" % self.save_seq))
# self.current_camera_name = self.available_cameras[i].description()
# self.save_seq = 0
# def take_photo(self):
# timestamp = time.strftime("%d-%b-%Y-%H_%M_%S")
# self.capture.capture(os.path.join(self.save_path, "%s-%04d-%s.jpg" % (
# self.current_camera_name,
# self.save_seq,
# timestamp
# )))
# self.save_seq += 1
# def change_folder(self):
# path = QFileDialog.getExistingDirectory(self, "Snapshot save location", "")
# if path:
# self.save_path = path
# self.save_seq = 0
# def alert(self, s):
# """