|
@@ -15,19 +15,20 @@ from multiWidget import MultiWidget
|
|
|
from groupedelements import MenuItems, Elements
|
|
|
from multipage import MultiPage
|
|
|
import bitsTable as bt
|
|
|
-from base import log
|
|
|
+import log
|
|
|
# ---------[ Widgets IMPORTANT!!! ]------------------
|
|
|
# this enables widgets. If this is not imported (even though it is not directly used) no widgets will be available
|
|
|
-from widgets import *
|
|
|
+from ..widgets import *
|
|
|
# from widgets import * # copy in case the above line gets removed by ide
|
|
|
# ---------[ IMPORTANT ]---------------------
|
|
|
|
|
|
tr = kcgw.tr
|
|
|
|
|
|
-import config
|
|
|
+from .. import config
|
|
|
import time
|
|
|
import getpass
|
|
|
|
|
|
+
|
|
|
Elements.setFlags({'autoremove': True, 'warn': True, 'exception_on_deleted': False})
|
|
|
|
|
|
def readconfig(parent):
|
|
@@ -39,9 +40,9 @@ def readconfig(parent):
|
|
|
"""
|
|
|
|
|
|
nec_conf = ['acquireSettingsIcon', 'bunches_per_turn', 'default_log_entries', 'default_save_location', 'default_subdirectory_name',
|
|
|
- 'epics_base_path', 'epics_log_entry_pvs', 'force_ask', 'guiIcon', 'language', 'logCommentIcon', 'logIcon',
|
|
|
- 'newPlotDataIcon', 'newPlotLiveIcon', 'save_header', 'show_advanced_control', 'singleReadIcon', 'startIcon',
|
|
|
- 'stopIcon', 'style', 'tRev', 'timingIcon', 'epics_test_pv']
|
|
|
+ 'epics_base_path', 'epics_log_entry_pvs', 'epics_test_pv', 'force_ask', 'guiIcon', 'language', 'logCommentIcon',
|
|
|
+ 'logIcon', 'newPlotDataIcon', 'newPlotLiveIcon', 'save_header', 'show_advanced_control', 'singleReadIcon', 'startIcon',
|
|
|
+ 'stopIcon', 'style', 'tRev', 'timingIcon']
|
|
|
missing_conf = []
|
|
|
for c in nec_conf:
|
|
|
if c not in dir(config):
|
|
@@ -171,7 +172,7 @@ class Gui(QtGui.QMainWindow):
|
|
|
:return: -
|
|
|
"""
|
|
|
self.setWindowTitle("KCG - Kapture Control Gui")
|
|
|
- self.setWindowIcon(QtGui.QIcon(config.guiIcon))
|
|
|
+ self.setWindowIcon(QtGui.QIcon(config.install_path + config.guiIcon))
|
|
|
|
|
|
self.statusbar.showMessage(board.status.status_text)
|
|
|
|
|
@@ -195,10 +196,10 @@ class Gui(QtGui.QMainWindow):
|
|
|
"""
|
|
|
self.populate_storage()
|
|
|
|
|
|
- with open("style/style.css") as f:
|
|
|
+ with open(config.install_path+"style/style.css") as f:
|
|
|
styleSheet = f.read()
|
|
|
if config.style == 'blue':
|
|
|
- with open('style/blue.css') as f:
|
|
|
+ with open(config.install_path+'style/blue.css') as f:
|
|
|
styleSheet += f.read()
|
|
|
self.setStyleSheet(styleSheet)
|
|
|
|
|
@@ -244,18 +245,18 @@ class Gui(QtGui.QMainWindow):
|
|
|
self.saveConfigAction = self.fileMenu.addAction(tr("Button", "Save Board Configuration"), self.saveConfig)
|
|
|
self.saveConfigAction = self.fileMenu.addAction(tr("Button", "Load Board Configuration"), self.loadConfig)
|
|
|
self.settingsAction = self.fileMenu.addAction(tr("Button", "Settings"), self.showSettings, "Ctrl+P")
|
|
|
- self.quitAction = self.fileMenu.addAction(QtGui.QIcon("icons/exit.png"), tr("Button", "Quit"), self.close, "Ctrl+Q")
|
|
|
+ self.quitAction = self.fileMenu.addAction(QtGui.QIcon(config.install_path + "icons/exit.png"), tr("Button", "Quit"), self.close, "Ctrl+Q")
|
|
|
self.menu.setCornerWidget(self.cw.pagesWidget.leftright)
|
|
|
|
|
|
# ----------[ Page specific Menu Entries ]-------------
|
|
|
self.multiMenu = self.menu.addMenu("&"+tr("Button", "Windows"))
|
|
|
MenuItems.addMenuItem(_MultiView_Name_, self.multiMenu)
|
|
|
- self.plotAction = self.multiMenu.addAction(QtGui.QIcon(config.newPlotLiveIcon), tr("Button", "New Plot"), self.cw.mainMultiWidget.leftBar.add_plot)
|
|
|
+ self.plotAction = self.multiMenu.addAction(QtGui.QIcon(config.install_path + config.newPlotLiveIcon), tr("Button", "New Plot"), self.cw.mainMultiWidget.leftBar.add_plot)
|
|
|
self.addWindowMenuEntries()
|
|
|
|
|
|
self.acquireMenu = self.menu.addMenu("&"+tr("Button", "Acquire"))
|
|
|
MenuItems.addMenuItem(_MultiView_Name_, self.acquireMenu)
|
|
|
- self.startAcquisitionAction = self.acquireMenu.addAction(QtGui.QIcon(config.startIcon), tr("Button", "Start Acquisition"), bif.bk_acquire)
|
|
|
+ self.startAcquisitionAction = self.acquireMenu.addAction(QtGui.QIcon(config.install_path + config.startIcon), tr("Button", "Start Acquisition"), bif.bk_acquire)
|
|
|
self.startAcquisitionAction.setObjectName("start_acquisition_action")
|
|
|
|
|
|
MenuItems.addMenuItem("continuous_read", self.startAcquisitionAction)
|
|
@@ -267,7 +268,7 @@ class Gui(QtGui.QMainWindow):
|
|
|
|
|
|
self.help = self.menu.addMenu("&"+tr("Button", "Help"))
|
|
|
import webbrowser
|
|
|
- self.help.addAction(tr("Button", "Open Manual"), lambda: webbrowser.open("Documentation/build/html/index.html"))
|
|
|
+ self.help.addAction(tr("Button", "Open Manual"), lambda: webbrowser.open(config.install_path + "Documentation/build/html/index.html"))
|
|
|
self.help.addAction(tr("Button", "About"), self.showAbout)
|
|
|
|
|
|
def saveConfig(self):
|