testing if ctrl_c is the problem
This commit is contained in:
@ -7,12 +7,10 @@ from . import ctrl_c, theme
|
||||
from .mainwin import MainWindow
|
||||
from .mdi import MDIWindowMode
|
||||
|
||||
from bec_utils import RedisConnector
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
ctrl_c.setup(app)
|
||||
# ctrl_c.setup(app)
|
||||
|
||||
clargs = handle_clargs()
|
||||
if not clargs.pop("no_theme"):
|
||||
|
@ -1,6 +1,6 @@
|
||||
import signal
|
||||
import socket
|
||||
from PyQt5.QtNetwork import QAbstractSocket
|
||||
# from PyQt5.QtNetwork import QAbstractSocket
|
||||
|
||||
|
||||
def setup(app):
|
||||
@ -23,7 +23,7 @@ class SignalWatchdog(QAbstractSocket):
|
||||
Propagates system signals from Python to QEventLoop
|
||||
adapted from https://stackoverflow.com/a/65802260/655404
|
||||
"""
|
||||
super().__init__(QAbstractSocket.SctpSocket, None)
|
||||
# super().__init__(QAbstractSocket.SctpSocket, None)
|
||||
|
||||
self.writer, self.reader = writer, reader = socket.socketpair()
|
||||
writer.setblocking(False)
|
||||
|
@ -14,7 +14,7 @@ from .shortcut import shortcut
|
||||
from .webview import WebView
|
||||
|
||||
from bec_utils import RedisConnector
|
||||
from .plot_recon import plot_recon, BECConnector
|
||||
from .plot_recon import plot_recon, BECConnector, DataAccess
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
@ -30,6 +30,7 @@ class MainWindow(QMainWindow):
|
||||
redis_connector = RedisConnector(redis_url)
|
||||
connector = BECConnector(redis_connector)
|
||||
data_access = DataAccess(connector)
|
||||
|
||||
|
||||
|
||||
if offline:
|
||||
|
@ -6,6 +6,9 @@ from abc import ABC, abstractmethod
|
||||
from collections import defaultdict, deque
|
||||
from bec_utils import BECMessage, MessageEndpoints
|
||||
from PyQt5.QtCore import QObject, pyqtSignal
|
||||
from collections import deque
|
||||
from PyQt5.QtCore import QObject, pyqtSignal
|
||||
from bec_utils import BECMessage
|
||||
|
||||
pyqtWrapperType = type(QObject)
|
||||
|
||||
@ -111,13 +114,6 @@ class BECConnector(ConnectorBase):
|
||||
self.storage_device[device_name].append(signals)
|
||||
self.new_monitor_value.emit(device_name)
|
||||
|
||||
|
||||
from collections import deque
|
||||
from PyQt5.QtCore import QObject, pyqtSignal
|
||||
from live_display.bec_connector import ConnectorBase
|
||||
from bec_utils import BECMessage
|
||||
|
||||
|
||||
class DataAccess(QObject):
|
||||
new_mon_value = pyqtSignal(str)
|
||||
used_devices_updated = pyqtSignal(bool)
|
||||
@ -132,15 +128,12 @@ class DataAccess(QObject):
|
||||
self.start_all_subscriptions(self.connector)
|
||||
self.device_storage = self.connector.storage_device
|
||||
|
||||
self.all_device_names = self.get_all_device_names()
|
||||
self.used_devices = []
|
||||
self.scan_nr = ""
|
||||
self.positions = None
|
||||
self.used_motors = []
|
||||
self.connect_pyqtSignals()
|
||||
|
||||
|
||||
|
||||
def start_all_subscriptions(self, conn):
|
||||
conn.start_scan_sub()
|
||||
conn.start_monitor_sub()
|
||||
@ -170,8 +163,6 @@ class DataAccess(QObject):
|
||||
|
||||
# for scan_segment_mess in message:
|
||||
# self.new_scan_msg.emit(scan_segment_mess)
|
||||
|
||||
|
||||
def get_scan_info(self, msg):
|
||||
print(
|
||||
"--------------------------------------------------------------------------------------------"
|
||||
@ -185,12 +176,7 @@ class DataAccess(QObject):
|
||||
)
|
||||
|
||||
def connect_pyqtSignals(self):
|
||||
# self.new_mon_value.connect(lambda: self.monitor_plot_update(self.monitored_device))
|
||||
self.connector.new_monitor_value.connect(self.on_new_monitor_value)
|
||||
self.connector.msg_update.connect(self.on_msg_update)
|
||||
self.connector.msg_scan_update.connect(self.on_msg_scan_update)
|
||||
self.connector.msg_queue_update.connect(self.on_msg_queue_update)
|
||||
|
||||
|
||||
def get_files():
|
||||
|
||||
@ -203,7 +189,7 @@ def plot_recon():
|
||||
recon_files = [file for file in files if file.endswith("h5")]
|
||||
for file in recon_files:
|
||||
print(file)
|
||||
print(file.keys())
|
||||
#print keys...
|
||||
|
||||
# i = 1
|
||||
# while True:
|
||||
|
Reference in New Issue
Block a user