This commit is contained in:
Your Name 2024-11-18 10:38:30 +01:00
parent 91e9d3e4dd
commit 64727f5c6e

View File

@ -1074,6 +1074,7 @@ class RelayControl(QtWidgets.QMainWindow):
self.ui.stopSpotlightBtn.clicked.connect(self.spot_off) self.ui.stopSpotlightBtn.clicked.connect(self.spot_off)
# self.scene = QtWidgets.QGraphicsScene(self) # self.scene = QtWidgets.QGraphicsScene(self)
# self.ui.graphicsView.setScene(self.scene) # self.ui.graphicsView.setScene(self.scene)
self.r = sainsmartrelay.SainsmartRelay()
# def populate_model_dropdown(self): # def populate_model_dropdown(self):
# """Populate the dropdown menu with model files from the models directory.""" # """Populate the dropdown menu with model files from the models directory."""
@ -1088,7 +1089,7 @@ class RelayControl(QtWidgets.QMainWindow):
# self.yolo_stream = YOLOv8CameraStream(model_path="models/yolov8m_seg_e300.pt", logging_level="high") # self.yolo_stream = YOLOv8CameraStream(model_path="models/yolov8m_seg_e300.pt", logging_level="high")
# # self.yolo_stream.start() # Start the YOLOv8 stream # # self.yolo_stream.start() # Start the YOLOv8 stream
# self.timer.start(30) # Start the timer to update the frame every 30ms (about 33 FPS) # self.timer.start(30) # Start the timer to update the frame every 30ms (about 33 FPS)
sainsmartrelay.turn_on(1) r.turn_on(1)
def spot_off(self): def spot_off(self):
# # Stop the camera stream and processing # # Stop the camera stream and processing
@ -1098,7 +1099,7 @@ class RelayControl(QtWidgets.QMainWindow):
# self.yolo_stream = None # Reset the YOLOv8 stream object # self.yolo_stream = None # Reset the YOLOv8 stream object
# self.scene.clear() # Clear the displayed frame from the graphicsView # self.scene.clear() # Clear the displayed frame from the graphicsView
# print("Camera stream stopped and resources released.") # print("Camera stream stopped and resources released.")
sainsmartrelay.turn_off(1) r.turn_off(1)
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys