diff --git a/Code/Mantid/CMakeLists.txt b/Code/Mantid/CMakeLists.txt index aa0093eee2df350c25a371308009eb68b136eb3f..2b79286d6eb5c7c689686d17a5556e1d7c0e75e0 100644 --- a/Code/Mantid/CMakeLists.txt +++ b/Code/Mantid/CMakeLists.txt @@ -197,8 +197,8 @@ if ( ENABLE_CPACK ) set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,PyQt4,sip" ) set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},python-ipython >= 1.1.0" ) - # scipy, matplotlib, psutil - set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib,python-psutil" ) + # scipy & matplotlib + set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib" ) set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},mxml,hdf,hdf5,jsoncpp" ) if( "${UNIX_CODENAME}" MATCHES "Santiago" ) @@ -226,19 +226,19 @@ if ( ENABLE_CPACK ) set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools0 (>= 1.7)" ) if( "${UNIX_CODENAME}" MATCHES "lucid" ) list ( APPEND DEPENDS_LIST ",libqscintilla2-5," - "libopencascade-foundation-6.3.0 (>= 6.3.0),libopencascade-modeling-6.3.0 (>= 6.3.0),python-psutil," + "libopencascade-foundation-6.3.0 (>= 6.3.0),libopencascade-modeling-6.3.0 (>= 6.3.0)," "libmuparser0,libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9" ) elseif( "${UNIX_CODENAME}" MATCHES "precise" ) list ( APPEND DEPENDS_LIST ",libqscintilla2-8," "libopencascade-foundation-6.5.0 (>= 6.5.0),libopencascade-modeling-6.5.0 (>= 6.5.0)," "libmuparser0debian1," - "ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,python-psutil," + "ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy," "libpocofoundation9,libpocoutil9,libpoconet9,libpoconetssl9,libpococrypto9,libpocoxml9") elseif( "${UNIX_CODENAME}" STREQUAL "trusty" ) list ( APPEND DEPENDS_LIST ",libqscintilla2-11," "liboce-foundation8,liboce-modeling8," "libmuparser2," - "ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy,python-psutil," + "ipython-qtconsole (>= 1.1),python-matplotlib,python-scipy," "libpocofoundation11,libpocoutil11,libpoconet11,libpoconetssl11,libpococrypto11,libpocoxml11") set ( PERFTOOLS_DEB_PACKAGE "libgoogle-perftools4 (>= 1.7)" ) else() diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 63f091d4a3b0f400c61a18e682882c41e8903bfc..68daaff89d6fdea488c03b40bf6bba8e2d9fcfac 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -880,21 +880,6 @@ copy_files_to_dir ( "${IPY_FILES}" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ipython_widget IPYTHON_INSTALL_FILES ) -# SysMon scripts -set( SYSMON_FILES - __init__.py - _version.py - config.py - sysmon.py - sysmon_tools.py - ui_sysmon.py - ui_sysmon.ui -) -copy_files_to_dir ( "${SYSMON_FILES}" - ${CMAKE_CURRENT_SOURCE_DIR}/SysMon - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/SysMon - SYSMON_INSTALL_FILES ) - ########################################################################### # MantidPlot executable ########################################################################### @@ -902,7 +887,7 @@ copy_files_to_dir ( "${SYSMON_FILES}" add_executable ( MantidPlot ${WIN_CONSOLE} MACOSX_BUNDLE ${ALL_SRC} src/main.cpp ${INC_FILES} ${QTIPLOT_C_SRC} ${UI_HDRS} ${RES_FILES} ${MANTID_RC_FILE} - ${PYTHON_INSTALL_FILES} ${MTDPLOT_INSTALL_FILES} ${CONFIG_RESET_SCRIPT_FILE} ${MTDPLOT_FUTURE_INSTALL_FILES} ${IPYTHON_INSTALL_FILES} ${SYSMON_INSTALL_FILES} + ${PYTHON_INSTALL_FILES} ${MTDPLOT_INSTALL_FILES} ${CONFIG_RESET_SCRIPT_FILE} ${MTDPLOT_FUTURE_INSTALL_FILES} ${IPYTHON_INSTALL_FILES} ) # Library dependencies @@ -1050,9 +1035,6 @@ endforeach() foreach(PY_FILE ${IPY_FILES} ) install ( FILES ipython_widget/${PY_FILE} DESTINATION ${BIN_DIR}/ipython_widget ) endforeach() -foreach(PY_FILE ${SYSMON_FILES} ) - install ( FILES SysMon/${PY_FILE} DESTINATION ${BIN_DIR}/SysMon ) -endforeach() install ( FILES ${CONFIG_RESET_SCRIPT} DESTINATION ${BIN_DIR} ) # file make_package.rb contains hard-coded path to the libraries @@ -1060,11 +1042,11 @@ install ( FILES ${CONFIG_RESET_SCRIPT} DESTINATION ${BIN_DIR} ) # therefore MACPORTS option is introduced if ( APPLE ) if (OSX_VERSION VERSION_LESS 10.9 OR MACPORTS) - configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in + configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake @ONLY ) - install ( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake ) + install ( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake ) else () install ( FILES make_package.rb DESTINATION MantidPlot.app/ ) configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixMavericksBundle.cmake.in diff --git a/Code/Mantid/MantidPlot/SysMon/README.md b/Code/Mantid/MantidPlot/SysMon/README.md deleted file mode 100644 index 8ef2ab770d0438d8e0c596efbbf91b546b8d1b80..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/README.md +++ /dev/null @@ -1,25 +0,0 @@ -SysMon -====== - -Python qt system monitor which utilizes the Python psutil and platform modules to provide system information for display. - -This application has been adapted to work with psutil version 1 and version 2 modules as there are some command syntax changes between these two versions. - -The SysMon user interface has been divided into a main window which imports the tabs to make a standalone application, or the tabs can be imported into other applications as a QWidget. Thus there are separate .ui files corresponding to each. - -The code which imports the tabs into the main program resides in SysMon.pyw. This is where to look to see how to include the tabs into your own application. All files except SysMon.pyw and ui_sysmonMainWindow.* will be required when tabs are incorporated in other applications. - -The following command line arguments have been added: - --help to print out the help message. - --nompl to run the application minus matplotlib in support of the current MantidPlot (removes those tabs requiring matplotlib). - --custom to enable the custom menubar item in the standalone application (currently supports checking Matlab license status on SNS analysis computers). - -To run as a standalone application via the corresponding command lines: - *Change to the folder containing the Sysmon software, then: - *DOS: python SysMon.pyw - *Linux: ./SysMon.pyw - -The standalone application been tested on Windows and RHEL Linux, but not on Mac yet. - -Note that configuration and global constants and variables now reside in config.py. - diff --git a/Code/Mantid/MantidPlot/SysMon/SysMon.pyw b/Code/Mantid/MantidPlot/SysMon/SysMon.pyw deleted file mode 100755 index 638813a2990d33fd4705a3f7cfa5a799460f8965..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/SysMon.pyw +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/python -""" -SysMon.pyw -Initial application development 03Sep14 by S. Miller -The application utilizes the psutil and platform python modules to provide system information -for display via text fields, a table and Matplotlib plots. - -The application utilizes a timer with user selectable timer intervals to update information -provided to the application. -""" -import config -import sys - -__version__="unknown" -try: - from _version import __version__ -except ImportError: - #_version.py file not found - version not known in this case so use - #the default previously given. - pass - -#parse args - doing it here as config structure needs to be filled prior to importing sysmon -if ['--nompl'] == [s for s in sys.argv if '--nompl' in s]: - #case to not use matplotlib - config.nompl=True -else: - #case to use matplotlib (default case) - config.nompl=False - -if ['--help'] == [s for s in sys.argv if '--help' in s]: - print "SysMon Help" - print "--help - this message" - print "--nompl - flag to disable using matplotlib, also disables History and Users tabs" - print "--custom: - flag to use facility specific options" - sys.exit() - -if ['--custom'] == [s for s in sys.argv if '--custom' in s]: - config.custom=True - -from PyQt4 import QtGui - -from ui_sysmonMainWindow import * -#from ui_sysmonTabs import * -from sysmon import * - -class SysMonMainWindow(QtGui.QMainWindow): - - def __init__(self, parent=None): - #setup main window - QtGui.QMainWindow.__init__(self, parent) - self.setWindowTitle("System Status") - self.ui = Ui_MainWindow() #defined from ui_sysmon.py - self.ui.setupUi(self) - #setup tabs - class imported from sysmon.py - self.sysmontabs=SysMon(self) - self.setCentralWidget(self.sysmontabs) - - #setup menu bar actions - self.connect(self.ui.actionExit, QtCore.SIGNAL('triggered()'), self.confirmExit) #define function to confirm and perform exit - self.connect(self.ui.actionAbout, QtCore.SIGNAL('triggered()'), self.About) - self.connect(self.ui.actionCheck_Matlab_Licenses, QtCore.SIGNAL('triggered()'), self.updateMatlab) - - #check if custom menu bar enabled via command line flag --custom and if not, remove it as it's built by default from Qt - if not(config.custom): - self.ui.menubar.removeAction(self.ui.menuCustom.menuAction()) - - - #define methods for menu bar options - def confirmExit(self): - reply = QtGui.QMessageBox.question(self, 'Message', - "Are you sure to quit?", QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No, QtGui.QMessageBox.No) - - if reply == QtGui.QMessageBox.Yes: - #close application - self.close() - else: - #do nothing and return - pass - - def About(self): - dialog=QtGui.QMessageBox(self) - dialog.setText("PyQt4 System Monitoring Application "+__version__) - info='Application Info: \n\r * Changing the Update Rate Clears plots \n\r * It may take one full new update cycle for changes to take effect \n\r * Update rate shown in History plot xaxis label \n\r * Process tab CPU percentage can be greater than 100 when more than a single core is involved' - dialog.setDetailedText(info) #give full info in detailed text - dialog.exec_() - - def updateMatlab(self): - #run license server command to extract license info - info=commands.getstatusoutput(config.matlabchk) - info=str(info[1]) #seem to need to make this a string for Linux to work properly - #test if info string contains MATLAB info - if info.find("MATLAB") < 0: - #case where no license server found - outstr="No Matlab License Server Found to Check" - else: - indx0=info.find("Users of MATLAB:") - indx1=info.find("licenses in use") - if indx0 > -1 and indx1 > -1: - outstr=info[indx0:indx1+15+1] - else: - outstr="Unable to determine Matlab license information" - dialog=QtGui.QMessageBox(self) - #print "outstr: "+outstr - dialog.setText(outstr) - dialog.setDetailedText(info) #give full info in detailed text - dialog.exec_() - -if __name__=="__main__": - app = QtGui.QApplication(sys.argv) - sysmon = SysMonMainWindow() - sysmon.show() - - sys.exit(app.exec_()) \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/SysMon/__init__.py b/Code/Mantid/MantidPlot/SysMon/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/Code/Mantid/MantidPlot/SysMon/_version.py b/Code/Mantid/MantidPlot/SysMon/_version.py deleted file mode 100644 index b88b26dd7c4b60b65af208073080c75e107d6f13..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/_version.py +++ /dev/null @@ -1,4 +0,0 @@ -#File to identify the current version of the software -#Note that this file must be manually updated to contain the same -#version number as the git tag for the check-in. -__version__="v0.29" \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/SysMon/config.py b/Code/Mantid/MantidPlot/SysMon/config.py deleted file mode 100644 index f52dcf1e520eeb8787e2f4f516f75b2a7c593cff..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/config.py +++ /dev/null @@ -1,20 +0,0 @@ - -#global definitions for constants and variables - -#Tab indices - based upon the order of the tabs as built via Qt and these must be the same as the Qt GUI. -SYST_TAB=0 -HIST_TAB=1 -PROC_TAB=2 -USER_TAB=3 -OPTS_TAB=4 - -#Global Variables: -psutilVer=0 #flag for the version of psutil being used -nompl=False #Flag to indicate if using matplotlib - True, then do not use plots, False, then try to use matplotlib plots -mplLoaded=False #flag for matplotlib loading -custom=False #flag to indicate if the custom interface is to be used (usually not) -matlabchk='lmstat -S -c 27010@licenses1.sns.gov' #text command to status the Matlab license server (only for custom mode with SysMon.pyw) -basefontsize=9 #basic font size when GUI is at minimum size -fscl=0.5 #scale factor for font size change with GUI resizing - less than one, font size slower than GUI size change, and greater than one font size faster than GUI size change -pltFont=9 #initial font size for matplotlib plots -linewidth=1 #initial line widths for matplotlib plots \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/SysMon/sysmon.py b/Code/Mantid/MantidPlot/SysMon/sysmon.py deleted file mode 100644 index 33249856c52c3ea52c64d365ac24907c266a47a7..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/sysmon.py +++ /dev/null @@ -1,272 +0,0 @@ - - -import sys, os, time -import re -import config #application constants and variables -#suppress deprecation warnings that can occur when importing psutil version 2 -#note - all deprecation warnings will probably be suppressed using this filterwarnings -#as specifying the psutil module specifically in filterwarnings did not suppress -#these warnings -import warnings -warnings.filterwarnings('ignore',category=DeprecationWarning) -import psutil - -#check psutil version as command syntax changes between version 1 and version 2 -ver=psutil.__version__ -#using positional numeric wildcards for re.match() to check sub versions -#match returns a match object if a match is found else returns NoneType -if re.match('0.[0-9].[0-9]',ver) or re.match('1.[0-9].[0-9]',ver) != None: - #set flag to version 1 if either version 0 or version 1 psutil imported - config.psutilVer=1 -else: - #set flat to version 2 for any versions higher than version 1 - config.psutilVer=2 - -from ui_sysmon import * -from sysmon_tools import * - - -import platform -import commands - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -#import application version information -__version__="unknown" -try: - from _version import __version__ -except ImportError: - #_version.py file not found - version not known in this case so use - #the default previously given. - pass - -class SysMon(QtGui.QWidget): - - def __init__(self, parent=None): - QtGui.QWidget.__init__(self, parent) - self.ui = Ui_Form() #defined from ui_sysmon.py - self.ui.setupUi(self) - self.ui.parent=parent - self.ui.progressBarStatusMemory.setStyleSheet("QProgressBar {width: 25px;border: 1px solid black; border-radius: 3px; background: white;text-align: center;padding: 0px;}" - +"QProgressBar::chunk:horizontal {background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #00CCEE, stop: 0.3 #00DDEE, stop: 0.6 #00EEEE, stop:1 #00FFEE);}") - self.ui.progressBarStatusCPU.setStyleSheet("QProgressBar {width: 25px;border: 1px solid black; border-radius: 3px; background: white;text-align: center;padding: 0px;}" - +"QProgressBar::chunk:horizontal {background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #00CCEE, stop: 0.3 #00DDEE, stop: 0.6 #00EEEE, stop:1 #00FFEE);}") - - #setup timer to enable periodic events such as status update checks - self.ctimer = QtCore.QTimer() - self.ctimer.start(2000) #time in mSec - set default update timer cycle to 2 seconds - QtCore.QObject.connect(self.ctimer, QtCore.SIGNAL("timeout()"), self.constantUpdate) - - #update rate actions - QtCore.QObject.connect(self.ui.radioButton1Sec, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update1Sec) - QtCore.QObject.connect(self.ui.radioButton2Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update2Sec) - QtCore.QObject.connect(self.ui.radioButton5Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update5Sec) - QtCore.QObject.connect(self.ui.radioButton10Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update10Sec) - self.update=2 #set default to 2 seconds update rate - - #duration actions - QtCore.QObject.connect(self.ui.radioButton60Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update60Duration) - QtCore.QObject.connect(self.ui.radioButton300Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update300Duration) - QtCore.QObject.connect(self.ui.radioButton600Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update600Duration) - QtCore.QObject.connect(self.ui.radioButton3600Secs, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.update3600Duration) - self.duration=60 #set default plot duration to 60 seconds - - QtCore.QObject.connect(self.ui.pushButtonUpdate, QtCore.SIGNAL('clicked(bool)'), self.updateProcesses) - - #Initialize System Tab - self.ui.tabWidget.setCurrentIndex(config.SYST_TAB) - self.ui.labelComputerName.setText("Computer Name: "+platform.node()) - if platform.os.name == 'nt': - info=platform.win32_ver() - oslabel="Windows "+info[0]+" Version: "+info[1] - elif platform.os.name == 'posix': - info=platform.linux_distribution() - oslabel=info[0]+" Version: "+info[1] - elif platform.os.name == 'mac': - info=platform.mac_ver() - oslabel=info[0]+" Version: "+info[1] - else: - oslabel=" " - - self.ui.labelOS.setText("Operating System: "+oslabel) - info=platform.uname() - self.ui.labelProcFam.setText("Processor Family: "+info[5]) - - #determine the number of users on the computer - userInfo=psutil.get_users() if config.psutilVer==1 else psutil.users() - lst=[] - for item in userInfo: - lst.append(item.name) - uusers=set(lst) - Nuusers=len(uusers) - self.ui.labelNUsers.setText("Number of Users Logged On: "+str(Nuusers)) - - #determine the computer uptime - if config.psutilVer == 1: - uptime = str(datetime.datetime.now() - datetime.datetime.fromtimestamp(psutil.BOOT_TIME)) - else: - uptime = str(datetime.datetime.now() - datetime.datetime.fromtimestamp(psutil.boot_time())) - self.ui.labelUptime.setText("System Uptime: "+uptime) - - if config.mplLoaded: - #if matplotlib loaded OK, initialize plotting - #Initialize History Tab - self.ui.tabWidget.setCurrentIndex(config.HIST_TAB) - #Place Matplotlib figure within the GUI frame - #create drawing canvas - # a figure instance to plot on - - #rc_context in matplotlib requires version 1.2.0 or later, so check we don't have an older version of matplotlib - if not re.match('1.[0-1]',matplotlib.__version__) and not re.match('0.',matplotlib.__version__): - #if not an old version of matplotlib, then use the following command - matplotlib.rc_context({'toolbar':False}) - #initialize figure 1 and its canvas for cpu and memory history plots - self.ui.figure = plt.figure(1) - # the Canvas Widget displays the `figure` - # it takes the `figure` instance as a parameter to __init__ - self.ui.canvas = FigureCanvas(self.ui.figure) - layout=QtGui.QVBoxLayout(self.ui.framePlot) - layout.addWidget(self.ui.canvas) - self.ui.layout=layout - - #initialize figure 2 and its canvas for user usage bar chart - self.ui.figure2 = plt.figure(2) - self.ui.canvas2 = FigureCanvas(self.ui.figure2) - layout2=QtGui.QVBoxLayout(self.ui.frameBar) - layout2.addWidget(self.ui.canvas2) - self.ui.layout2=layout2 - - - else: - #if matplotlib not loaded, remove the tabs that depend upon it - self.removeMPLTabs() - - #initialize history plot arrays - easier just to initialize these even if not doing plotting in case when matplotlib not available. - Nsamples=3600 - self.ui.Nsamples=Nsamples - #need one extra sample to fill the plotting interval - self.ui.cpu=np.zeros(Nsamples+1) - self.ui.mem=np.zeros(Nsamples+1) - self.ui.dt=[None]*(Nsamples+1) - self.ui.cpuMe=np.zeros(Nsamples+1) - self.ui.memMe=np.zeros(Nsamples+1) - - self.ui.tabWidget.setTabsClosable(False) #disable the ability to close tabs once state of matplotlib is handled - - #initialize the process table - self.doUpdates=True #flag for updating the process tab table - updateProcTable(self,config) - - #upon initialization completion, set System tab (first tab on left) as the visible tab - self.ui.tabWidget.setCurrentIndex(config.SYST_TAB) - - #initialize version label - self.ui.labelVersion.setText("Version: "+__version__+"_"+matplotlib.__version__+"_"+psutil.__version__) - - def constantUpdate(self): - #redirct to global function - constantUpdateActor(self,config) - - def update1Sec(self): - self.update=1 - self.ctimer.stop() - self.ctimer.start(1000) - #clear persistent arrays when update rate changed - self.ui.cpu=self.ui.cpu*0 - self.ui.mem=self.ui.mem*0 - self.ui.cpuMe=self.ui.cpuMe*0 - self.ui.memMe=self.ui.memMe*0 - self.ui.dt=[None]*self.ui.Nsamples - - def update2Sec(self): - self.update=2 - self.ctimer.stop() - self.ctimer.start(2000) - #clear persistent arrays when update rate changed - self.ui.cpu=self.ui.cpu*0 - self.ui.mem=self.ui.mem*0 - self.ui.cpuMe=self.ui.cpuMe*0 - self.ui.memMe=self.ui.memMe*0 - self.ui.dt=[None]*self.ui.Nsamples - - def update5Sec(self): - self.update=5 - self.ctimer.stop() - self.ctimer.start(5000) - #clear persistent arrays when update rate changed - self.ui.cpu=self.ui.cpu*0 - self.ui.mem=self.ui.mem*0 - self.ui.cpuMe=self.ui.cpuMe*0 - self.ui.memMe=self.ui.memMe*0 - self.ui.dt=[None]*self.ui.Nsamples - - def update10Sec(self): - self.update=10 - self.ctimer.stop() - self.ctimer.start(10000) - #clear persistent arrays when update rate changed - self.ui.cpu=self.ui.cpu*0 - self.ui.mem=self.ui.mem*0 - self.ui.cpuMe=self.ui.cpuMe*0 - self.ui.memMe=self.ui.memMe*0 - self.ui.dt=[None]*self.ui.Nsamples - - def update60Duration(self): - self.duration=60 - def update300Duration(self): - self.duration=300 - def update600Duration(self): - self.duration=600 - def update3600Duration(self): - self.duration=3600 - - def updateProcesses(self): - if self.doUpdates == True: - #case to toggle to False - self.doUpdates=False - self.ui.pushButtonUpdate.setText('Continue') - else: - #case where updates must be off - self.doUpdates=True - self.ui.pushButtonUpdate.setText('Hold Updates') - - def resizeEvent(self,resizeEvent): - sz=self.ui.tableWidgetProcess.size() - w=sz.width() - wmin=self.ui.parent.minimumSize().width() #establish minimum table size based upon parent widget minimum size - if w < wmin: - w=wmin - #now use widget width to determine process table column width - self.ui.tableWidgetProcess.setColumnWidth(0,3.5*w/20) #PID - self.ui.tableWidgetProcess.setColumnWidth(1,4*w/20) #User - self.ui.tableWidgetProcess.setColumnWidth(2,3.5*w/20) #CPU% - self.ui.tableWidgetProcess.setColumnWidth(3,3.5*w/20) #MEM% - self.ui.tableWidgetProcess.setColumnWidth(4,5.5*w/20) #Name - - #check size of GUI to determine the size of font to use. - minSz=self.ui.parent.minimumSize().width() #establish minimum table size based upon parent widget minimum size - curSz=self.ui.parent.size().width() - #print "current size: ",curSz," type: ",type(curSz)," min size: ",minSz," type: ",type(minSz) - fsize=max([int(config.basefontsize*float(curSz)/float(minSz)*config.fscl),config.basefontsize]) - #print "Font Size: ",fsize - config.pltFont=fsize - - #adapt plot line width to GUI size change - config.linewidth=min([max([int(float(curSz)/float(minSz)),1]),3]) - - def removeMPLTabs(self): - #In case matplotlib not available, remove tabs requiring this - #Note to developers - removing tabs changes the tab index numbers! - #Keep this in mind regarding setting and using tab indices - self.ui.tabWidget.removeTab(config.HIST_TAB) #History tab - config.HIST_TAB=-1 - config.PROC_TAB-=1 - config.USER_TAB-=1 - config.OPTS_TAB-=1 - self.ui.tabWidget.removeTab(config.USER_TAB) #Users tab - originally tab 3, but becomes tab 2 once history tab is removed - config.USER_TAB=-1 - config.OPTS_TAB-=1 - self.ui.tabWidget.setTabsClosable(False) diff --git a/Code/Mantid/MantidPlot/SysMon/sysmon_tools.py b/Code/Mantid/MantidPlot/SysMon/sysmon_tools.py deleted file mode 100644 index e0dc66da46159408b05a74b2209c1a3f9854d0b5..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/sysmon_tools.py +++ /dev/null @@ -1,658 +0,0 @@ -#suppress deprecation warnings that can occur when importing psutil version 2 -#note - all deprecation warnings will probably be suppressed using this filterwarnings -#as specifying the psutil module specifically in filterwarnings did not suppress -#these warnings -import warnings -warnings.filterwarnings('ignore',category=DeprecationWarning) -import psutil - -from PyQt4 import Qt, QtCore, QtGui -import datetime -import numpy as np -import config -import math -import getpass -import re -import sys -import time - -#check if command line flag --nompl set to disable matplotlib -if not(config.nompl): - try: - import matplotlib - if matplotlib.get_backend() != 'QT4Agg': - matplotlib.use('QT4Agg') - from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas - from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar - import matplotlib.pyplot as plt - config.mplLoaded=True - # print "matplotlib try successful" - except: - # print "matplotlib except case" - #case where matplotlib not available - need to know this for handling plotting tabs - config.mplLoaded=False - pass -else: - config.mplLoaded=False #use this flag to test case when matplotlib is not available - -def constantUpdateActor(self,config): - - #set duration number - Ndur=self.duration - - #get current CPU percent busy - percentcpubusy = psutil.cpu_percent() - - percentmembusy=psutil.virtual_memory().percent - self.ui.progressBarStatusMemory.setValue(round(percentmembusy)) - Ncpus=len(psutil.cpu_percent(percpu=True)) - self.ui.Ncpus=Ncpus - totalcpustr='CPU Count: '+str(Ncpus) -# print "Total CPU str: ",totalcpustr - self.ui.labelCPUCount.setText(totalcpustr+' - CPU Utilization:') - totalmem=int(round(float(psutil.virtual_memory().total)/(1024*1024*1024))) #psutil syntax OK for both versions -# print "Total Mem: ",totalmem - self.ui.totalmem=totalmem - totalmemstr=str(totalmem)+' GB' - self.ui.labelMemUsage.setText('Memory Usage: '+str(totalmem*percentmembusy/100)+' GB of '+totalmemstr) -# print "Total Mem str: ",totalmemstr - - # update system tab - if self.ui.tabWidget.currentIndex() == config.SYST_TAB: - #determine the computer uptime - if config.psutilVer == 1: - uptime = str(datetime.datetime.now() - datetime.datetime.fromtimestamp(psutil.BOOT_TIME)) - else: - uptime = str(datetime.datetime.now() - datetime.datetime.fromtimestamp(psutil.boot_time())) - self.ui.labelUptime.setText("System Uptime: "+uptime) - - - - #update the number of users each time interval as well - userInfo=psutil.get_users() if config.psutilVer == 1 else psutil.users() - lst=[] - for item in userInfo: - lst.append(item.name) - uusers=set(lst) - Nuusers=len(uusers) - self.ui.labelNUsers.setText("Number of Users Logged On: "+str(Nuusers)) - - #determine "Me" user CPU and memory statistics - Me=getpass.getuser() - cpupctMe=0 - memValMe=0 - cpupctTot=0 - memValTot=0 - for proc in psutil.process_iter(): - try: - #check if process still exists, if so, update dictionaries - cpupct=proc.get_cpu_percent(interval=0) if config.psutilVer == 1 else proc.cpu_percent(interval=0) - memVal=proc.get_memory_percent() if config.psutilVer == 1 else proc.memory_percent() - - try: - #some processes give permission denied when getting the name, if so, fail out gracefully using this try. - if config.psutilVer == 1: - uname=proc.username - else: - uname=proc.username() - #print "proc.username: ",uname," type: ",type(uname)," Me: ",Me," type: ",type(Me) - except: - uname='' - except: - #skip process - case where process no longer exists - cpupct=0 - memVal=0 - uname='' - cpupctTot+=cpupct - memValTot+=memVal - #print "uname: ",uname," Me: ",Me - #note that on Windows systems that getpass.getuser() does not return the same base username as proc.username, so check for the smaller - if Me in uname: - cpupctMe+=cpupct - memValMe+=memVal - #print "cpupctMe: ",cpupctMe," memValMe: ",memValMe - - #update first position with most recent value overwriting oldest value which has been shifted to first position - self.ui.cpu=np.roll(self.ui.cpu,1) - #check if CPU smoothing to be applied - sm=int(str(self.ui.comboBoxCPUHistSmooth.currentText())) - if sm == 1: - self.ui.cpu[0]=percentcpubusy - elif sm >1: - self.ui.cpu[0]=(percentcpubusy+np.sum(self.ui.cpu[1:sm]))/sm - else: - #unknown case - default to no smoothing - self.ui.cpu[0]=percentcpubusy - #update progress bar with (potentially) smoothed cpu percentage - self.ui.progressBarStatusCPU.setValue(round(self.ui.cpu[0])) - self.ui.mem=np.roll(self.ui.mem,1) - self.ui.mem[0]=percentmembusy - self.ui.cpuMe=np.roll(self.ui.cpuMe,1) - #check if CPU smoothing to be applied - if sm == 1: - self.ui.cpuMe[0]=cpupctMe/(Ncpus) - elif sm>1: - self.ui.cpuMe[0]=(cpupctMe/(Ncpus)+np.sum(self.ui.cpuMe[1:sm]))/sm - else: - #use no filtering in case sm is unknown (should never happen...) - self.ui.cpuMe[0]=cpupctMe/(Ncpus) - self.ui.memMe=np.roll(self.ui.memMe,1) - self.ui.memMe[0]=memValMe - - - #update the history plot - if self.ui.tabWidget.currentIndex() == config.HIST_TAB: - #only update history plot if tab is active - font = {'family' : 'sans-serif', - 'weight' : 'bold', - 'size' : config.pltFont+1} - matplotlib.rc('font', **font) - - xtime=range(0,self.ui.Nsamples+1,self.update) - - Npts=Ndur/self.update - - plt.figure(self.ui.figure.number) #make plot figure active - plt.clf() #clear figure each time for rolling updates to show - plt.plot(xtime[0:Npts+1],self.ui.cpu[0:Npts+1],color='Blue',label='CPU: All',linewidth=config.linewidth) - plt.plot(xtime[0:Npts+1],self.ui.mem[0:Npts+1],color='Green',label='Mem: All',linewidth=config.linewidth) - plt.plot(xtime[0:Npts+1],self.ui.cpuMe[0:Npts+1],color='red',label='CPU: '+Me,linewidth=config.linewidth) - plt.plot(xtime[0:Npts+1],self.ui.memMe[0:Npts+1],color='cyan',label='Mem: '+Me,linewidth=config.linewidth) - - plt.title('Composite CPU and Memory Activity',fontsize=config.pltFont+1,fontweight='bold') - plt.ylabel('% Used',fontsize=config.pltFont+0.5,fontweight='bold') - - if self.update == 1: - xlab="Seconds with 1 Second Updates" - elif self.update == 2: - xlab="Seconds with 2 Second Updates" - elif self.update == 5: - xlab="Seconds with 5 Second Updates" - elif self.update == 10: - xlab="Seconds with 10 Second Updates" - plt.xlabel(xlab,fontsize=config.pltFont+0.5,fontweight='bold') - plt.legend(loc="upper right",prop={'size':config.pltFont}) - - plt.xlim([0,Ndur]) - self.ui.canvas.draw() - - #update the process table - if self.ui.tabWidget.currentIndex() == config.PROC_TAB: - #only update process table if tab is active - updateProcTable(self,config) - - #update the Users bar chart - if self.ui.tabWidget.currentIndex() == config.USER_TAB: - #only update bar chart if the tab is active. - updateUserChart(self,config) - - - -def updateProcTable(self,config): - if self.doUpdates==True: - - Ncpus=len(psutil.cpu_percent(percpu=True)) - - table=self.ui.tableWidgetProcess - #first remove all rows - Nrows=table.rowCount() - for row in range(Nrows): - table.removeRow(0) - - #get the processes - pidList=psutil.get_pid_list() if config.psutilVer == 1 else psutil.pids() - Npids=len(pidList) - - #now add rows to the table according to the number of processes - # for row in range(Npids): - # table.insertRow(0) - - #now populate the table - row=0 #table row counter incremented for each row added to the process table - rout=0 #counter for number of rows to remove due to invalid processes - memtot=psutil.virtual_memory() #psutil syntax OK for both versions - - #determine which column has been selected for sorting - column_sorted=table.horizontalHeader().sortIndicatorSection() - order = table.horizontalHeader().sortIndicatorOrder() - #temporarily set sort column to outside column range so that table items can be filled properly - table.sortItems(5,order=QtCore.Qt.AscendingOrder) - #print table.horizontalHeader().sortIndicatorSection() - - #create empty dictionaries to be used by the process table - d_user={} - d_cpu={} - d_mem={} - d_name={} - d_cpuTimes={} - d_procTimes={} - - #fill the dictionaries - seems to need to be done faster than within loop which also fills the table...not sure why... - - try: - #check if this dictionary exists or not - self.ui.d_procTimes - self.ui.d_cpuTimes - #if so, move on - pass - except: - #case to initialize the dictionary - for proc in psutil.process_iter(): - try: - #check if acess denied - pname=proc.name - proctime=proc.get_cpu_times() #get - cputime=psutil.cpu_times() - d_procTimes.update({proc.pid:proctime}) - d_cpuTimes.update({proc.pid:cputime}) - except: - #case we skip a process - pass - self.ui.d_cpuTimes=d_cpuTimes - self.ui.d_procTimes=d_procTimes - d_cpuTimes={} - d_procTimes={} - - updateInterval=float(self.update) #timer interval in seconds - for proc in psutil.process_iter(): - #try: - if psutil.Process(proc.pid).is_running(): - #if proc.pid == 37196: - #check if process still exists, if so, update dictionaries - try: - #check if process previously existed - if so we can calculate a cpupct - proctimeHold=self.ui.d_procTimes[proc.pid] - proctime=proc.get_cpu_times() #get - deltaProcTime=(proctime.user+proctime.system) - (proctimeHold.user+proctimeHold.system) - - cputimeHold=self.ui.d_cpuTimes[proc.pid] - cputime=psutil.cpu_times() - deltaCPUTime=(cputime.user+cputime.system+cputime.idle) - (cputimeHold.user+cputimeHold.system+cputimeHold.idle) - - if deltaProcTime > 0: - if deltaCPUTime < updateInterval: - deltaCPUTime=updateInterval - else: - pass - cpupct=float(deltaProcTime)/float(deltaCPUTime)*100.0 - - else: - cpupct=0 - - if cpupct < 0: - cpupct=0 - - cpupct=float(int(float(cpupct)*100))/100 #only keep two decimal places - memVal=float(int(float(proc.get_memory_percent())*100.0))/100.0 if config.psutilVer == 1 else float(int(float(proc.memory_percent())*100.0))/100.0 - - try: - #don't update dictionaries if name gives an access denied error when checking process name - #print "Updating" - pname=proc.name if config.psutilVer == 1 else proc.name() - d_user.update({proc.pid:proc.username}) if config.psutilVer == 1 else d_user.update({proc.pid:proc.username()}) - d_cpu.update({proc.pid:cpupct}) - d_mem.update({proc.pid:memVal}) - d_name.update({proc.pid:pname}) - d_cpuTimes.update({proc.pid:cputime}) - d_procTimes.update({proc.pid:proctime}) - - except: - #print "psutil General Error: ",sys.exc_info()[0] - pass - - except: - #else process did not previously exist and we cannot give an update this iteration - #print "except - pid: ",proc.pid - - pass - - - #once the dictionarys are updated, update cpu times for next loop - self.ui.d_cpuTimes=d_cpuTimes - self.ui.d_procTimes=d_procTimes - - #now fill the table for display - for proc in d_user.keys(): - #print "proc: ",proc," type: ",type(proc) - pid=int(proc) - #print "pid: ",pid - - table.insertRow(0) - #print "inserting row" - #set process id - item=QtGui.QTableWidgetItem() - item.setData(QtCore.Qt.DisplayRole,pid) - table.setItem(0,0,item) - #set username - #print " d_user[proc]: ",d_user[proc]," proc: ",proc - table.setItem(0,1,QtGui.QTableWidgetItem(d_user[proc])) - #set CPU % - item=QtGui.QTableWidgetItem() - item.setData(QtCore.Qt.DisplayRole,d_cpu[proc]) - table.setItem(0,2,item) - #set memory % - item=QtGui.QTableWidgetItem() - item.setData(QtCore.Qt.DisplayRole,d_mem[proc]) - table.setItem(0,3,item) - #set process name - table.setItem(0,4,QtGui.QTableWidgetItem(d_name[proc])) - row+=1 - - - # for row in range(rout): - # table.removeRow(Npids-row) - #restore sort to previously selected column - #table.sortItems(column_sorted,order=QtCore.Qt.AscendingOrder) - table.sortItems(column_sorted,order=order) - self.ui.labelLastUpdate.setText("Last Update: "+str(datetime.datetime.now())) - -def updateUserChart(self,config): - - font = {'family' : 'sans-serif', - 'weight' : 'bold', - 'size' : config.pltFont} - - matplotlib.rc('font', **font) - - f=plt.figure(self.ui.figure2.number) - -# self.ui.figure2=plt.figure(2) - plt.clf() - plt.cla() -# f.gca().cla() - plt.subplot(121) #divide plot area into two: plot on left and legend on right - #create empty dictionaries to be used by the process table - d_user={} - d_cpu={} - d_mem={} - d_name={} - d_cpuTimes={} - d_procTimes={} - - try: - #check if this dictionary exists or not - self.ui.d_procTimes - self.ui.d_cpuTimes - #if so, move on - pass - except: - #case to initialize the dictionary - for proc in psutil.process_iter(): - try: - #check if acess denied - pname=proc.name - proctime=proc.get_cpu_times() #get - cputime=psutil.cpu_times() - d_procTimes.update({proc.pid:proctime}) - d_cpuTimes.update({proc.pid:cputime}) - except: - #case we skip a process - pass - self.ui.d_cpuTimes=d_cpuTimes - self.ui.d_procTimes=d_procTimes - d_cpuTimes={} - d_procTimes={} - - updateInterval=float(self.update) #timer interval in seconds - totcpupct=0 - for proc in psutil.process_iter(): - try: - psutil.Process(proc.pid).is_running() - #if proc.pid == 37196: - #check if process still exists, if so, update dictionaries - try: - #check if process previously existed - if so we can calculate a cpupct - proctimeHold=self.ui.d_procTimes[proc.pid] - proctime=proc.get_cpu_times() #get - deltaProcTime=(proctime.user+proctime.system) - (proctimeHold.user+proctimeHold.system) - - cputimeHold=self.ui.d_cpuTimes[proc.pid] - cputime=psutil.cpu_times() - deltaCPUTime=(cputime.user+cputime.system+cputime.idle) - (cputimeHold.user+cputimeHold.system+cputimeHold.idle) - - if deltaProcTime > 0: - if deltaCPUTime < updateInterval: - deltaCPUTime=updateInterval - else: - pass - cpupct=float(deltaProcTime)/float(deltaCPUTime)*100.0 - - else: - cpupct=0 - - if cpupct < 0: - cpupct=0 - - cpupct=float(int(float(cpupct)*100))/100 #only keep two decimal places - totcpupct+=cpupct - memVal=float(int(float(proc.get_memory_percent())*100.0))/100.0 if config.psutilVer == 1 else float(int(float(proc.memory_percent())*100.0))/100.0 - - try: - #don't update dictionaries if name gives an access denied error when checking process name - #print "Updating" - pname=proc.name if config.psutilVer == 1 else proc.name() - d_user.update({proc.pid:proc.username}) if config.psutilVer == 1 else d_user.update({proc.pid:proc.username()}) - #System Idle process should not be listed in users cpu totals so set it to zero - if pname =="System Idle Process": - cpupct=0 - d_cpu.update({proc.pid:cpupct}) - d_mem.update({proc.pid:memVal}) - d_name.update({proc.pid:pname}) - d_cpuTimes.update({proc.pid:cputime}) - d_procTimes.update({proc.pid:proctime}) - - except: - #print "psutil General Error: ",sys.exc_info()[0] - pass - - except: - #else process did not previously exist and we cannot give an update this iteration - #print "except - pid: ",proc.pid - - pass - except: - #process no longer exists - do nothing - pass - - - self.ui.d_cpuTimes=d_cpuTimes - self.ui.d_procTimes=d_procTimes - - #print "** Total Mem Used: ",sum(d_mem.values()) - users=d_user.values() - users_unique=list(set(users)) #use set() to find unique users then convert the resulting set to a list via list() - Nusers=len(users_unique) - - #create cpu and memory by users dictionaries - cpu_by_users={} - mem_by_users={} - for u in range(Nusers): - cpu_by_users.update({users_unique[u]:0}) - mem_by_users.update({users_unique[u]:0}) - #apparently update does not order keys in sequence to users_unique - #thus need to re-create users_unique according to the order of the users - #in the cpu and mem dictionary keys - users_unique=list(cpu_by_users.keys()) - - #fill cpu and memory dictionaries sequencing thru each PID - for pid in d_user.keys(): - user=d_user[pid] - cpu_by_users[user]=cpu_by_users[user] + d_cpu[pid] - mem_by_users[user]=mem_by_users[user] + d_mem[pid] - #print d_cpu[35296],d_cpu[37196],d_cpu[35296]+d_cpu[37196] - #now convert to a list which we can index - cpu_by_users_lst=cpu_by_users.values() - mem_by_users_lst=mem_by_users.values() - - width=0.85 - - colors=['b','g','r','c','m','y','gray','hotpink','brown','k'] - Nmax=len(colors) #don't want to have more users than colors... - - if self.ui.radioButtonCPU.isChecked(): - sortBy='cpu' - elif self.ui.radioButtonMem.isChecked(): - sortBy='mem' - elif self.ui.radioButtonMax.isChecked(): - sortBy='max' - else: - print "invalid radio button selection - using CPU sort as default" - sortBy='cpu' - #sortBy='cpu' # 'cpu' or 'mem' - use for debugging - #create sort index - if sortBy=='cpu': - indx=sorted(range(len(cpu_by_users_lst)), key=cpu_by_users_lst.__getitem__,reverse=True) - elif sortBy=='mem': - indx=sorted(range(len(mem_by_users_lst)), key=mem_by_users_lst.__getitem__,reverse=True) - elif sortBy=='max': - #determine if cpu or mem is larger - if sum(cpu_by_users_lst) > sum(mem_by_users_lst): - #case where cpu usage is larger value - indx=sorted(range(len(cpu_by_users_lst)), key=cpu_by_users_lst.__getitem__,reverse=True) - else: - #case where mem usage is larger - indx=sorted(range(len(mem_by_users_lst)), key=mem_by_users_lst.__getitem__,reverse=True) - else: - print 'Incorrect sort parameter' - - #sort lists - cpu_by_users_sorted=[cpu_by_users_lst[x] for x in indx] - mem_by_users_sorted=[mem_by_users_lst[x] for x in indx] - users_unique_sorted=[users_unique[x] for x in indx] - - #restrict the number of users we'll show to Nmax - if Nusers > Nmax: - #replace the Nmaxth - 1 element with the total of the values from index Nmax - 1 to the end of the list - cpu_by_users_sorted[Nmax-1]=sum(cpu_by_users_sorted[Nmax-1:]) - mem_by_users_sorted[Nmax-1]=sum(mem_by_users_sorted[Nmax-1:]) - users_unique_sorted[Nmax-1]='Remaining' - Nshow=Nmax - else: - Nshow=Nusers - - if min(cpu_by_users_sorted) < 0: - print " *** cpu_by_users_sorted has values less than zero - should not occur, please check" - print cpu_by_users_sorted - print " ***" - if min(mem_by_users_sorted) < 0: - print " *** mem_by_users_sorted has values less than zero - should not occur, please check" - print mem_by_users_sorted - print " ***" - - #range check the values of the sorted lists - may not be necessary, just being cautious... - tst=np.array(cpu_by_users_sorted)<0 #need an array for summing - indx=list(np.array(cpu_by_users_sorted)<0) #need bool list for indexing - #check if any users have less than zero CPU usage and set usage to 0 for these users - if sum(tst) > 0: - print "cpu_by_users < 0: ",sum(indx) - cpu_by_users_sorted=[0 if x<0 else x for x in cpu_by_users_sorted] - tst=np.array(cpu_by_users_sorted)>(self.ui.Ncpus*100) - indx=list(np.array(cpu_by_users_sorted)>self.ui.Ncpus*100) - #check if any users have CPU usage greater than possible number of CPUs and set usage to max CPU usage for those users - if sum(tst) > 0: - print "cpu_by_users > Ncpus*100: ",sum(indx) - cpu_by_users_sorted=[self.ui.Ncpus*100 if x>self.ui.Ncpus*100 else x for x in cpu_by_users_sorted] - tst=np.array(mem_by_users_sorted)<0 - indx=list(np.array(mem_by_users_sorted)<0) - #check if any users have less than zero memory usage and set these users to zero usage - if sum(tst) > 0: - print "mem_by_users < 0: ",sum(indx) - mem_by_users_sorted=[0 if x<0 else x for x in mem_by_users_sorted] - tst=np.array(mem_by_users_sorted)>self.ui.totalmem - indx=np.array(mem_by_users_sorted)>self.ui.totalmem - #check if any users have memory usage greater than the total system memory - should never happen... - if sum(tst) > 0: - #if true, then need to adjust maximum usage for these users to the total memory possible - #print "mem_by_users > totalmem: ",sum(indx)," indx: ",indx," mem_by_users: ",mem_by_users_sorted - mem_by_users_sorted=[self.ui.totalmem if x>self.ui.totalmem else x for x in mem_by_users_sorted] - - - p=[] #list to contain plot objects for use by the legend - ind=np.arange(2) - #print "**************" - #print mem_by_users_sorted[0:Nshow] - for u in range(Nshow): - if u == 0: - p.append(plt.bar(ind,(cpu_by_users_sorted[u],mem_by_users_sorted[u]),width,bottom=(0,0),color=colors[u])) - else: - p.append(plt.bar(ind,(cpu_by_users_sorted[u],mem_by_users_sorted[u]),width,bottom=(sum(cpu_by_users_sorted[0:u]),sum(mem_by_users_sorted[0:u])),color=colors[u])) - - plt.title('Usage by User',fontsize=config.pltFont+1,fontweight='bold') - - #remove default yaxis ticks then redraw them via ax1 and ax2 below - frame=plt.gca() - frame.axes.get_yaxis().set_ticks([]) - plt.xticks(np.arange(2)+width/2.,('CPU','Mem'),fontsize=config.pltFont,fontweight='bold') - ymaxCPU=int(round(sum(cpu_by_users_sorted)+10))/10*10 #range ymaxCPU to nearest 10% - ymaxMEM=int(round(sum(mem_by_users_sorted)+10))/10*10 #range ymaxMEM to nearest 10% - - ymaxMAX=max([ymaxCPU,ymaxMEM]) - - if sortBy == 'cpu': - ymax=max([ymaxCPU,10]) - auto=False - elif sortBy == 'mem': - ymax=max([ymaxMEM,10]) - auto=False - elif sortBy == 'max': - ymax=max([ymaxMAX,10]) - auto=True - #print 'ymaxCPU: ',ymaxCPU,' ymaxMEM: ',ymaxMEM,' ymaxMAX: ',ymaxMAX,' ymax: ',ymax - #print 'sum(cpu_by_users_sorted): ',sum(cpu_by_users_sorted),'sum(mem_by_users_sorted): ',sum(mem_by_users_sorted) - #print cpu_by_users - plt.ylim(0,ymax,auto=True) - - - - #compute composite % - sumCPU=sum(cpu_by_users_sorted) - sumCPU=float(int(sumCPU*100))/100 #use two digits - ylab=np.arange(5)/4.0*float(sumCPU)#/float(self.ui.Ncpus) - scl=float(ymax)/float(sumCPU) - ylab=ylab*100*scl - tmp=ylab.astype('int') - tmp1=tmp.astype('float') - tmp1=tmp1/100 - ylab1=np.round(tmp1) - - ax1=plt.twinx() - ax1.set_ylabel('Composite CPU Percent',fontsize=config.pltFont,fontweight='bold') - ax1.yaxis.set_ticks_position('left') - ax1.yaxis.set_label_position('left') - ax1.set_ybound(lower=0,upper=max(ylab1)) - ax1.set_yticks(ylab1) - -# print 'ylab1: ',ylab1 - - #place warnings if MEM or CPU go out of range - if ymax < ymaxCPU: - plt.text(2.7,0.0,'CPU Above Axis',color='red') - if ymax < ymaxMEM: - plt.text(2.7,0.0,'MEM Above Axis',color='green') - - usersLegend=users_unique_sorted[0:Nshow] - #reverse legend print order to have legend correspond with the order data are placed in the bar chart - usersLegend.reverse() - p.reverse() - #place legend outside of plot to the right - if not re.match('1.[0-1]',matplotlib.__version__): - #if not an old version of matplotlib, then use the following command - plt.legend(p,usersLegend,bbox_to_anchor=(1.45, 1.1), loc="upper left", borderaxespad=0.1,fontsize=config.pltFont-0.5,title='Users') - else: - plt.legend(p,usersLegend,bbox_to_anchor=(1.45, 1.1), loc="upper left", borderaxespad=0.1,title='Users') - - #place second y axis label on plot - ylab2=np.arange(5)/4.0*float(ymax) - ax2=plt.twinx() - ax2.set_ylabel('Memory Percent',fontsize=config.pltFont,fontweight='bold',position=(0.9,0.5)) - ax2.set_yticks(ylab2) - #ax2.set_yticks(ylab2) - ax2.yaxis.set_ticks_position('right') - ax2.yaxis.set_label_position('right') - - self.ui.canvas2.draw() - -def reLayout(self): - tmpWidget=QtGui.QWidget() - tmpWidget.setLayout(self.ui.layout2) - tmpLayout = QtGui.QVBoxLayout(self.ui.frameBar) \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/SysMon/ui_sysmon.py b/Code/Mantid/MantidPlot/SysMon/ui_sysmon.py deleted file mode 100644 index 351c80dd4287508f682c3fbbfd40feeecda21c57..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/ui_sysmon.py +++ /dev/null @@ -1,390 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_sysmon.ui' -# -# Created: Fri Dec 05 09:55:29 2014 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_Form(object): - def setupUi(self, Form): - Form.setObjectName(_fromUtf8("Form")) - Form.resize(230, 331) - Form.setMinimumSize(QtCore.QSize(230, 331)) - Form.setMaximumSize(QtCore.QSize(16777215, 16777215)) - self.horizontalLayout = QtGui.QHBoxLayout(Form) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - self.tabWidget = QtGui.QTabWidget(Form) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) - self.tabWidget.setSizePolicy(sizePolicy) - self.tabWidget.setObjectName(_fromUtf8("tabWidget")) - self.tab = QtGui.QWidget() - self.tab.setObjectName(_fromUtf8("tab")) - self.verticalLayout = QtGui.QVBoxLayout(self.tab) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.scrollArea = QtGui.QScrollArea(self.tab) - self.scrollArea.setWidgetResizable(True) - self.scrollArea.setObjectName(_fromUtf8("scrollArea")) - self.scrollAreaWidgetContents = QtGui.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 179, 267)) - self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents")) - self.verticalLayout_2 = QtGui.QVBoxLayout(self.scrollAreaWidgetContents) - self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) - self.groupBox_3 = QtGui.QGroupBox(self.scrollAreaWidgetContents) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox_3.sizePolicy().hasHeightForWidth()) - self.groupBox_3.setSizePolicy(sizePolicy) - self.groupBox_3.setMinimumSize(QtCore.QSize(0, 0)) - self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) - self.gridLayout_4 = QtGui.QGridLayout(self.groupBox_3) - self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) - self.gridLayout_7 = QtGui.QGridLayout() - self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) - self.labelComputerName = QtGui.QLabel(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelComputerName.sizePolicy().hasHeightForWidth()) - self.labelComputerName.setSizePolicy(sizePolicy) - self.labelComputerName.setMinimumSize(QtCore.QSize(0, 0)) - self.labelComputerName.setObjectName(_fromUtf8("labelComputerName")) - self.gridLayout_7.addWidget(self.labelComputerName, 0, 0, 1, 1) - self.labelOS = QtGui.QLabel(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelOS.sizePolicy().hasHeightForWidth()) - self.labelOS.setSizePolicy(sizePolicy) - self.labelOS.setMinimumSize(QtCore.QSize(0, 0)) - self.labelOS.setObjectName(_fromUtf8("labelOS")) - self.gridLayout_7.addWidget(self.labelOS, 1, 0, 1, 1) - self.labelProcFam = QtGui.QLabel(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelProcFam.sizePolicy().hasHeightForWidth()) - self.labelProcFam.setSizePolicy(sizePolicy) - self.labelProcFam.setMinimumSize(QtCore.QSize(0, 0)) - self.labelProcFam.setObjectName(_fromUtf8("labelProcFam")) - self.gridLayout_7.addWidget(self.labelProcFam, 2, 0, 1, 1) - self.labelNUsers = QtGui.QLabel(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelNUsers.sizePolicy().hasHeightForWidth()) - self.labelNUsers.setSizePolicy(sizePolicy) - self.labelNUsers.setMinimumSize(QtCore.QSize(0, 0)) - self.labelNUsers.setObjectName(_fromUtf8("labelNUsers")) - self.gridLayout_7.addWidget(self.labelNUsers, 3, 0, 1, 1) - self.labelUptime = QtGui.QLabel(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.labelUptime.sizePolicy().hasHeightForWidth()) - self.labelUptime.setSizePolicy(sizePolicy) - self.labelUptime.setMinimumSize(QtCore.QSize(0, 0)) - self.labelUptime.setObjectName(_fromUtf8("labelUptime")) - self.gridLayout_7.addWidget(self.labelUptime, 4, 0, 1, 1) - self.gridLayout_4.addLayout(self.gridLayout_7, 0, 0, 1, 1) - self.groupBox_5 = QtGui.QGroupBox(self.groupBox_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.groupBox_5.sizePolicy().hasHeightForWidth()) - self.groupBox_5.setSizePolicy(sizePolicy) - self.groupBox_5.setMinimumSize(QtCore.QSize(0, 0)) - font = QtGui.QFont() - font.setWeight(50) - font.setUnderline(False) - font.setBold(False) - self.groupBox_5.setFont(font) - self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) - self.verticalLayout_7 = QtGui.QVBoxLayout(self.groupBox_5) - self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7")) - self.labelMemUsage = QtGui.QLabel(self.groupBox_5) - font = QtGui.QFont() - font.setUnderline(False) - self.labelMemUsage.setFont(font) - self.labelMemUsage.setObjectName(_fromUtf8("labelMemUsage")) - self.verticalLayout_7.addWidget(self.labelMemUsage) - self.progressBarStatusMemory = QtGui.QProgressBar(self.groupBox_5) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.progressBarStatusMemory.sizePolicy().hasHeightForWidth()) - self.progressBarStatusMemory.setSizePolicy(sizePolicy) - self.progressBarStatusMemory.setMaximumSize(QtCore.QSize(210, 16777215)) - self.progressBarStatusMemory.setToolTip(_fromUtf8("")) - self.progressBarStatusMemory.setObjectName(_fromUtf8("progressBarStatusMemory")) - self.verticalLayout_7.addWidget(self.progressBarStatusMemory) - self.labelCPUCount = QtGui.QLabel(self.groupBox_5) - self.labelCPUCount.setObjectName(_fromUtf8("labelCPUCount")) - self.verticalLayout_7.addWidget(self.labelCPUCount) - self.progressBarStatusCPU = QtGui.QProgressBar(self.groupBox_5) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.progressBarStatusCPU.sizePolicy().hasHeightForWidth()) - self.progressBarStatusCPU.setSizePolicy(sizePolicy) - self.progressBarStatusCPU.setMaximumSize(QtCore.QSize(210, 16777215)) - self.progressBarStatusCPU.setToolTip(_fromUtf8("")) - self.progressBarStatusCPU.setStatusTip(_fromUtf8("")) - self.progressBarStatusCPU.setProperty(_fromUtf8("value"), 24) - self.progressBarStatusCPU.setObjectName(_fromUtf8("progressBarStatusCPU")) - self.verticalLayout_7.addWidget(self.progressBarStatusCPU) - self.gridLayout_4.addWidget(self.groupBox_5, 1, 0, 1, 1) - self.verticalLayout_2.addWidget(self.groupBox_3) - self.scrollArea.setWidget(self.scrollAreaWidgetContents) - self.verticalLayout.addWidget(self.scrollArea) - self.tabWidget.addTab(self.tab, _fromUtf8("")) - self.tab_2 = QtGui.QWidget() - self.tab_2.setObjectName(_fromUtf8("tab_2")) - self.horizontalLayout_2 = QtGui.QHBoxLayout(self.tab_2) - self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) - self.framePlot = QtGui.QFrame(self.tab_2) - self.framePlot.setFrameShape(QtGui.QFrame.StyledPanel) - self.framePlot.setFrameShadow(QtGui.QFrame.Raised) - self.framePlot.setObjectName(_fromUtf8("framePlot")) - self.horizontalLayout_2.addWidget(self.framePlot) - self.tabWidget.addTab(self.tab_2, _fromUtf8("")) - self.tab_3 = QtGui.QWidget() - self.tab_3.setObjectName(_fromUtf8("tab_3")) - self.verticalLayout_3 = QtGui.QVBoxLayout(self.tab_3) - self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) - self.horizontalLayout_3 = QtGui.QHBoxLayout() - self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) - self.labelLastUpdate = QtGui.QLabel(self.tab_3) - self.labelLastUpdate.setMinimumSize(QtCore.QSize(0, 0)) - self.labelLastUpdate.setMaximumSize(QtCore.QSize(300, 16777215)) - self.labelLastUpdate.setObjectName(_fromUtf8("labelLastUpdate")) - self.horizontalLayout_3.addWidget(self.labelLastUpdate) - self.verticalLayout_3.addLayout(self.horizontalLayout_3) - self.tableWidgetProcess = QtGui.QTableWidget(self.tab_3) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(100) - sizePolicy.setVerticalStretch(100) - sizePolicy.setHeightForWidth(self.tableWidgetProcess.sizePolicy().hasHeightForWidth()) - self.tableWidgetProcess.setSizePolicy(sizePolicy) - self.tableWidgetProcess.setMinimumSize(QtCore.QSize(0, 0)) - self.tableWidgetProcess.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tableWidgetProcess.setRowCount(10) - self.tableWidgetProcess.setColumnCount(5) - self.tableWidgetProcess.setObjectName(_fromUtf8("tableWidgetProcess")) - self.tableWidgetProcess.setColumnCount(5) - self.tableWidgetProcess.setRowCount(10) - item = QtGui.QTableWidgetItem() - self.tableWidgetProcess.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetProcess.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetProcess.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetProcess.setHorizontalHeaderItem(3, item) - item = QtGui.QTableWidgetItem() - self.tableWidgetProcess.setHorizontalHeaderItem(4, item) - self.tableWidgetProcess.horizontalHeader().setDefaultSectionSize(57) - self.tableWidgetProcess.horizontalHeader().setSortIndicatorShown(True) - self.tableWidgetProcess.horizontalHeader().setStretchLastSection(True) - self.tableWidgetProcess.verticalHeader().setVisible(False) - self.tableWidgetProcess.verticalHeader().setDefaultSectionSize(20) - self.tableWidgetProcess.verticalHeader().setStretchLastSection(True) - self.verticalLayout_3.addWidget(self.tableWidgetProcess) - self.horizontalLayout_7 = QtGui.QHBoxLayout() - self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7")) - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout_7.addItem(spacerItem) - self.pushButtonUpdate = QtGui.QPushButton(self.tab_3) - self.pushButtonUpdate.setMinimumSize(QtCore.QSize(0, 0)) - self.pushButtonUpdate.setMaximumSize(QtCore.QSize(80, 15)) - font = QtGui.QFont() - font.setPointSize(7) - self.pushButtonUpdate.setFont(font) - self.pushButtonUpdate.setObjectName(_fromUtf8("pushButtonUpdate")) - self.horizontalLayout_7.addWidget(self.pushButtonUpdate) - self.verticalLayout_3.addLayout(self.horizontalLayout_7) - self.tabWidget.addTab(self.tab_3, _fromUtf8("")) - self.tab_5 = QtGui.QWidget() - self.tab_5.setObjectName(_fromUtf8("tab_5")) - self.verticalLayout_6 = QtGui.QVBoxLayout(self.tab_5) - self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6")) - self.groupBox = QtGui.QGroupBox(self.tab_5) - self.groupBox.setObjectName(_fromUtf8("groupBox")) - self.horizontalLayout_6 = QtGui.QHBoxLayout(self.groupBox) - self.horizontalLayout_6.setContentsMargins(-1, 3, -1, 2) - self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) - self.radioButtonCPU = QtGui.QRadioButton(self.groupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.radioButtonCPU.sizePolicy().hasHeightForWidth()) - self.radioButtonCPU.setSizePolicy(sizePolicy) - self.radioButtonCPU.setMinimumSize(QtCore.QSize(0, 0)) - self.radioButtonCPU.setObjectName(_fromUtf8("radioButtonCPU")) - self.horizontalLayout_6.addWidget(self.radioButtonCPU) - self.radioButtonMem = QtGui.QRadioButton(self.groupBox) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.radioButtonMem.sizePolicy().hasHeightForWidth()) - self.radioButtonMem.setSizePolicy(sizePolicy) - self.radioButtonMem.setMinimumSize(QtCore.QSize(0, 0)) - self.radioButtonMem.setChecked(False) - self.radioButtonMem.setObjectName(_fromUtf8("radioButtonMem")) - self.horizontalLayout_6.addWidget(self.radioButtonMem) - self.radioButtonMax = QtGui.QRadioButton(self.groupBox) - self.radioButtonMax.setChecked(True) - self.radioButtonMax.setObjectName(_fromUtf8("radioButtonMax")) - self.horizontalLayout_6.addWidget(self.radioButtonMax) - self.verticalLayout_6.addWidget(self.groupBox) - self.frameBar = QtGui.QFrame(self.tab_5) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.frameBar.sizePolicy().hasHeightForWidth()) - self.frameBar.setSizePolicy(sizePolicy) - self.frameBar.setFrameShape(QtGui.QFrame.StyledPanel) - self.frameBar.setFrameShadow(QtGui.QFrame.Raised) - self.frameBar.setObjectName(_fromUtf8("frameBar")) - self.verticalLayout_6.addWidget(self.frameBar) - self.tabWidget.addTab(self.tab_5, _fromUtf8("")) - self.tab_4 = QtGui.QWidget() - self.tab_4.setObjectName(_fromUtf8("tab_4")) - self.horizontalLayout_4 = QtGui.QHBoxLayout(self.tab_4) - self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) - self.scrollArea_2 = QtGui.QScrollArea(self.tab_4) - self.scrollArea_2.setWidgetResizable(True) - self.scrollArea_2.setObjectName(_fromUtf8("scrollArea_2")) - self.scrollAreaWidgetContents_2 = QtGui.QWidget() - self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 238, 250)) - self.scrollAreaWidgetContents_2.setObjectName(_fromUtf8("scrollAreaWidgetContents_2")) - self.horizontalLayout_5 = QtGui.QHBoxLayout(self.scrollAreaWidgetContents_2) - self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) - self.groupBox_6 = QtGui.QGroupBox(self.scrollAreaWidgetContents_2) - self.groupBox_6.setMinimumSize(QtCore.QSize(0, 0)) - self.groupBox_6.setObjectName(_fromUtf8("groupBox_6")) - self.verticalLayout_5 = QtGui.QVBoxLayout(self.groupBox_6) - self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5")) - self.radioButton60Secs = QtGui.QRadioButton(self.groupBox_6) - self.radioButton60Secs.setChecked(True) - self.radioButton60Secs.setObjectName(_fromUtf8("radioButton60Secs")) - self.verticalLayout_5.addWidget(self.radioButton60Secs) - self.radioButton300Secs = QtGui.QRadioButton(self.groupBox_6) - self.radioButton300Secs.setObjectName(_fromUtf8("radioButton300Secs")) - self.verticalLayout_5.addWidget(self.radioButton300Secs) - self.radioButton600Secs = QtGui.QRadioButton(self.groupBox_6) - self.radioButton600Secs.setObjectName(_fromUtf8("radioButton600Secs")) - self.verticalLayout_5.addWidget(self.radioButton600Secs) - self.radioButton3600Secs = QtGui.QRadioButton(self.groupBox_6) - self.radioButton3600Secs.setObjectName(_fromUtf8("radioButton3600Secs")) - self.verticalLayout_5.addWidget(self.radioButton3600Secs) - self.line = QtGui.QFrame(self.groupBox_6) - self.line.setFrameShape(QtGui.QFrame.HLine) - self.line.setFrameShadow(QtGui.QFrame.Sunken) - self.line.setObjectName(_fromUtf8("line")) - self.verticalLayout_5.addWidget(self.line) - self.label = QtGui.QLabel(self.groupBox_6) - self.label.setObjectName(_fromUtf8("label")) - self.verticalLayout_5.addWidget(self.label) - self.comboBoxCPUHistSmooth = QtGui.QComboBox(self.groupBox_6) - self.comboBoxCPUHistSmooth.setObjectName(_fromUtf8("comboBoxCPUHistSmooth")) - self.comboBoxCPUHistSmooth.addItem(_fromUtf8("")) - self.comboBoxCPUHistSmooth.addItem(_fromUtf8("")) - self.comboBoxCPUHistSmooth.addItem(_fromUtf8("")) - self.comboBoxCPUHistSmooth.addItem(_fromUtf8("")) - self.comboBoxCPUHistSmooth.addItem(_fromUtf8("")) - self.verticalLayout_5.addWidget(self.comboBoxCPUHistSmooth) - spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.verticalLayout_5.addItem(spacerItem1) - self.labelVersion = QtGui.QLabel(self.groupBox_6) - self.labelVersion.setObjectName(_fromUtf8("labelVersion")) - self.verticalLayout_5.addWidget(self.labelVersion) - self.horizontalLayout_5.addWidget(self.groupBox_6) - self.groupBox_4 = QtGui.QGroupBox(self.scrollAreaWidgetContents_2) - self.groupBox_4.setMinimumSize(QtCore.QSize(0, 0)) - self.groupBox_4.setObjectName(_fromUtf8("groupBox_4")) - self.verticalLayout_4 = QtGui.QVBoxLayout(self.groupBox_4) - self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) - self.radioButton1Sec = QtGui.QRadioButton(self.groupBox_4) - self.radioButton1Sec.setObjectName(_fromUtf8("radioButton1Sec")) - self.verticalLayout_4.addWidget(self.radioButton1Sec) - self.radioButton2Secs = QtGui.QRadioButton(self.groupBox_4) - self.radioButton2Secs.setChecked(True) - self.radioButton2Secs.setObjectName(_fromUtf8("radioButton2Secs")) - self.verticalLayout_4.addWidget(self.radioButton2Secs) - self.radioButton5Secs = QtGui.QRadioButton(self.groupBox_4) - self.radioButton5Secs.setObjectName(_fromUtf8("radioButton5Secs")) - self.verticalLayout_4.addWidget(self.radioButton5Secs) - self.radioButton10Secs = QtGui.QRadioButton(self.groupBox_4) - self.radioButton10Secs.setObjectName(_fromUtf8("radioButton10Secs")) - self.verticalLayout_4.addWidget(self.radioButton10Secs) - spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.verticalLayout_4.addItem(spacerItem2) - self.horizontalLayout_5.addWidget(self.groupBox_4) - self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) - self.horizontalLayout_4.addWidget(self.scrollArea_2) - self.tabWidget.addTab(self.tab_4, _fromUtf8("")) - self.horizontalLayout.addWidget(self.tabWidget) - - self.retranslateUi(Form) - self.tabWidget.setCurrentIndex(0) - QtCore.QMetaObject.connectSlotsByName(Form) - - def retranslateUi(self, Form): - Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_3.setTitle(QtGui.QApplication.translate("Form", "System Info", None, QtGui.QApplication.UnicodeUTF8)) - self.labelComputerName.setText(QtGui.QApplication.translate("Form", "Computer Name: ", None, QtGui.QApplication.UnicodeUTF8)) - self.labelOS.setText(QtGui.QApplication.translate("Form", "Operating System:", None, QtGui.QApplication.UnicodeUTF8)) - self.labelProcFam.setText(QtGui.QApplication.translate("Form", "Processor Family:", None, QtGui.QApplication.UnicodeUTF8)) - self.labelNUsers.setText(QtGui.QApplication.translate("Form", "Number of Users Logged On:", None, QtGui.QApplication.UnicodeUTF8)) - self.labelUptime.setText(QtGui.QApplication.translate("Form", "System Uptime: ", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_5.setTitle(QtGui.QApplication.translate("Form", "Composite System Status", None, QtGui.QApplication.UnicodeUTF8)) - self.labelMemUsage.setText(QtGui.QApplication.translate("Form", "Memory Usage", None, QtGui.QApplication.UnicodeUTF8)) - self.labelCPUCount.setText(QtGui.QApplication.translate("Form", "CPU count:", None, QtGui.QApplication.UnicodeUTF8)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("Form", "System", None, QtGui.QApplication.UnicodeUTF8)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("Form", "History", None, QtGui.QApplication.UnicodeUTF8)) - self.labelLastUpdate.setText(QtGui.QApplication.translate("Form", "Last Update: ", None, QtGui.QApplication.UnicodeUTF8)) - self.tableWidgetProcess.setSortingEnabled(True) - self.tableWidgetProcess.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("Form", "PID", None, QtGui.QApplication.UnicodeUTF8)) - self.tableWidgetProcess.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("Form", "USER", None, QtGui.QApplication.UnicodeUTF8)) - self.tableWidgetProcess.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("Form", "CPU%", None, QtGui.QApplication.UnicodeUTF8)) - self.tableWidgetProcess.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("Form", "MEM%", None, QtGui.QApplication.UnicodeUTF8)) - self.tableWidgetProcess.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Form", "NAME", None, QtGui.QApplication.UnicodeUTF8)) - self.pushButtonUpdate.setText(QtGui.QApplication.translate("Form", "Hold Updates", None, QtGui.QApplication.UnicodeUTF8)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("Form", "Processes", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox.setTitle(QtGui.QApplication.translate("Form", "Sort", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButtonCPU.setText(QtGui.QApplication.translate("Form", "CPU", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButtonMem.setText(QtGui.QApplication.translate("Form", "Memory", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButtonMax.setText(QtGui.QApplication.translate("Form", "Max", None, QtGui.QApplication.UnicodeUTF8)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), QtGui.QApplication.translate("Form", "Users", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_6.setTitle(QtGui.QApplication.translate("Form", "Display Period", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton60Secs.setText(QtGui.QApplication.translate("Form", "60 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton300Secs.setText(QtGui.QApplication.translate("Form", "300 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton600Secs.setText(QtGui.QApplication.translate("Form", "600 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton3600Secs.setText(QtGui.QApplication.translate("Form", "3600 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("Form", "CPU History Smooth", None, QtGui.QApplication.UnicodeUTF8)) - self.comboBoxCPUHistSmooth.setItemText(0, QtGui.QApplication.translate("Form", "1", None, QtGui.QApplication.UnicodeUTF8)) - self.comboBoxCPUHistSmooth.setItemText(1, QtGui.QApplication.translate("Form", "2", None, QtGui.QApplication.UnicodeUTF8)) - self.comboBoxCPUHistSmooth.setItemText(2, QtGui.QApplication.translate("Form", "5", None, QtGui.QApplication.UnicodeUTF8)) - self.comboBoxCPUHistSmooth.setItemText(3, QtGui.QApplication.translate("Form", "10", None, QtGui.QApplication.UnicodeUTF8)) - self.comboBoxCPUHistSmooth.setItemText(4, QtGui.QApplication.translate("Form", "15", None, QtGui.QApplication.UnicodeUTF8)) - self.labelVersion.setText(QtGui.QApplication.translate("Form", "Version: ", None, QtGui.QApplication.UnicodeUTF8)) - self.groupBox_4.setTitle(QtGui.QApplication.translate("Form", "Update Rate", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton1Sec.setText(QtGui.QApplication.translate("Form", "1 Second", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton2Secs.setText(QtGui.QApplication.translate("Form", "2 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton5Secs.setText(QtGui.QApplication.translate("Form", "5 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.radioButton10Secs.setText(QtGui.QApplication.translate("Form", "10 Seconds", None, QtGui.QApplication.UnicodeUTF8)) - self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), QtGui.QApplication.translate("Form", "Options", None, QtGui.QApplication.UnicodeUTF8)) - diff --git a/Code/Mantid/MantidPlot/SysMon/ui_sysmon.ui b/Code/Mantid/MantidPlot/SysMon/ui_sysmon.ui deleted file mode 100644 index 265c066807af702299636f36c2d1b9d5d6e24a47..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/ui_sysmon.ui +++ /dev/null @@ -1,735 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>230</width> - <height>331</height> - </rect> - </property> - <property name="minimumSize"> - <size> - <width>230</width> - <height>331</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>16777215</height> - </size> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QTabWidget" name="tabWidget"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>System</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> - <item alignment="Qt::AlignLeft"> - <widget class="QScrollArea" name="scrollArea"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>179</width> - <height>267</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="title"> - <string>System Info</string> - </property> - <layout class="QGridLayout" name="gridLayout_4"> - <item row="0" column="0"> - <layout class="QGridLayout" name="gridLayout_7"> - <item row="0" column="0"> - <widget class="QLabel" name="labelComputerName"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Computer Name: </string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="labelOS"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Operating System:</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="labelProcFam"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Processor Family:</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="labelNUsers"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Number of Users Logged On:</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="labelUptime"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>System Uptime: </string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" alignment="Qt::AlignLeft"> - <widget class="QGroupBox" name="groupBox_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="font"> - <font> - <weight>50</weight> - <bold>false</bold> - <underline>false</underline> - </font> - </property> - <property name="title"> - <string>Composite System Status</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QLabel" name="labelMemUsage"> - <property name="font"> - <font> - <underline>false</underline> - </font> - </property> - <property name="text"> - <string>Memory Usage</string> - </property> - </widget> - </item> - <item alignment="Qt::AlignLeft"> - <widget class="QProgressBar" name="progressBarStatusMemory"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>210</width> - <height>16777215</height> - </size> - </property> - <property name="toolTip"> - <string extracomment="Percent of Memory Usage"/> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelCPUCount"> - <property name="text"> - <string>CPU count:</string> - </property> - </widget> - </item> - <item alignment="Qt::AlignLeft"> - <widget class="QProgressBar" name="progressBarStatusCPU"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>210</width> - <height>16777215</height> - </size> - </property> - <property name="toolTip"> - <string extracomment="Percent of Composite CPU Usage"/> - </property> - <property name="statusTip"> - <string extracomment="Composite CPU Usage"/> - </property> - <property name="value"> - <number>24</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>History</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QFrame" name="framePlot"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_3"> - <attribute name="title"> - <string>Processes</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="labelLastUpdate"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>300</width> - <height>16777215</height> - </size> - </property> - <property name="text"> - <string>Last Update: </string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QTableWidget" name="tableWidgetProcess"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>100</horstretch> - <verstretch>100</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::NoEditTriggers</set> - </property> - <property name="sortingEnabled"> - <bool>true</bool> - </property> - <property name="rowCount"> - <number>10</number> - </property> - <property name="columnCount"> - <number>5</number> - </property> - <attribute name="horizontalHeaderDefaultSectionSize"> - <number>57</number> - </attribute> - <attribute name="horizontalHeaderShowSortIndicator" stdset="0"> - <bool>true</bool> - </attribute> - <attribute name="horizontalHeaderStretchLastSection"> - <bool>true</bool> - </attribute> - <attribute name="verticalHeaderVisible"> - <bool>false</bool> - </attribute> - <attribute name="verticalHeaderDefaultSectionSize"> - <number>20</number> - </attribute> - <attribute name="verticalHeaderStretchLastSection"> - <bool>true</bool> - </attribute> - <row/> - <row/> - <row/> - <row/> - <row/> - <row/> - <row/> - <row/> - <row/> - <row/> - <column> - <property name="text"> - <string>PID</string> - </property> - </column> - <column> - <property name="text"> - <string>USER</string> - </property> - </column> - <column> - <property name="text"> - <string>CPU%</string> - </property> - </column> - <column> - <property name="text"> - <string>MEM%</string> - </property> - </column> - <column> - <property name="text"> - <string>NAME</string> - </property> - </column> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="pushButtonUpdate"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>80</width> - <height>15</height> - </size> - </property> - <property name="font"> - <font> - <pointsize>7</pointsize> - </font> - </property> - <property name="text"> - <string>Hold Updates</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_5"> - <attribute name="title"> - <string>Users</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Sort</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <property name="topMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>2</number> - </property> - <item> - <widget class="QRadioButton" name="radioButtonCPU"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>CPU</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButtonMem"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Memory</string> - </property> - <property name="checked"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButtonMax"> - <property name="text"> - <string>Max</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QFrame" name="frameBar"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_4"> - <attribute name="title"> - <string>Options</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QScrollArea" name="scrollArea_2"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents_2"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>238</width> - <height>250</height> - </rect> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QGroupBox" name="groupBox_6"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="title"> - <string>Display Period</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QRadioButton" name="radioButton60Secs"> - <property name="text"> - <string>60 Seconds</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton300Secs"> - <property name="text"> - <string>300 Seconds</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton600Secs"> - <property name="text"> - <string>600 Seconds</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton3600Secs"> - <property name="text"> - <string>3600 Seconds</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>CPU History Smooth</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBoxCPUHistSmooth"> - <item> - <property name="text"> - <string>1</string> - </property> - </item> - <item> - <property name="text"> - <string>2</string> - </property> - </item> - <item> - <property name="text"> - <string>5</string> - </property> - </item> - <item> - <property name="text"> - <string>10</string> - </property> - </item> - <item> - <property name="text"> - <string>15</string> - </property> - </item> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="labelVersion"> - <property name="text"> - <string>Version: </string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_4"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="title"> - <string>Update Rate</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QRadioButton" name="radioButton1Sec"> - <property name="text"> - <string>1 Second</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton2Secs"> - <property name="text"> - <string>2 Seconds</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton5Secs"> - <property name="text"> - <string>5 Seconds</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioButton10Secs"> - <property name="text"> - <string>10 Seconds</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.py b/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.py deleted file mode 100644 index a7c6a67caaf2073455e8987503a11ffba596f660..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui_sysmonMainWindow.ui' -# -# Created: Wed Sep 17 15:59:14 2014 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName(_fromUtf8("MainWindow")) - MainWindow.resize(427, 323) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) - MainWindow.setSizePolicy(sizePolicy) - MainWindow.setMinimumSize(QtCore.QSize(336, 282)) - self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.gridLayout = QtGui.QGridLayout(self.centralwidget) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - MainWindow.setCentralWidget(self.centralwidget) - self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setObjectName(_fromUtf8("statusbar")) - MainWindow.setStatusBar(self.statusbar) - self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 427, 21)) - self.menubar.setObjectName(_fromUtf8("menubar")) - self.menuFile = QtGui.QMenu(self.menubar) - self.menuFile.setObjectName(_fromUtf8("menuFile")) - self.menuHelp = QtGui.QMenu(self.menubar) - self.menuHelp.setObjectName(_fromUtf8("menuHelp")) - self.menuCustom = QtGui.QMenu(self.menubar) - self.menuCustom.setObjectName(_fromUtf8("menuCustom")) - MainWindow.setMenuBar(self.menubar) - self.actionExit = QtGui.QAction(MainWindow) - self.actionExit.setObjectName(_fromUtf8("actionExit")) - self.actionAbout = QtGui.QAction(MainWindow) - self.actionAbout.setObjectName(_fromUtf8("actionAbout")) - self.actionCheck_Matlab_Licenses = QtGui.QAction(MainWindow) - self.actionCheck_Matlab_Licenses.setObjectName(_fromUtf8("actionCheck_Matlab_Licenses")) - self.menuFile.addAction(self.actionExit) - self.menuHelp.addAction(self.actionAbout) - self.menuCustom.addAction(self.actionCheck_Matlab_Licenses) - self.menubar.addAction(self.menuFile.menuAction()) - self.menubar.addAction(self.menuHelp.menuAction()) - self.menubar.addAction(self.menuCustom.menuAction()) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "System Monitor", None, QtGui.QApplication.UnicodeUTF8)) - self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) - self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) - self.menuCustom.setTitle(QtGui.QApplication.translate("MainWindow", "Custom", None, QtGui.QApplication.UnicodeUTF8)) - self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) - self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) - self.actionCheck_Matlab_Licenses.setText(QtGui.QApplication.translate("MainWindow", "Check Matlab Licenses", None, QtGui.QApplication.UnicodeUTF8)) - diff --git a/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.ui b/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.ui deleted file mode 100644 index 75196f8911a9271568732b28d395fd53899a3cdf..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/SysMon/ui_sysmonMainWindow.ui +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>427</width> - <height>323</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>336</width> - <height>282</height> - </size> - </property> - <property name="windowTitle"> - <string>System Monitor</string> - </property> - <widget class="QWidget" name="centralwidget"> - <layout class="QGridLayout" name="gridLayout"/> - </widget> - <widget class="QStatusBar" name="statusbar"/> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>427</width> - <height>21</height> - </rect> - </property> - <widget class="QMenu" name="menuFile"> - <property name="title"> - <string>File</string> - </property> - <addaction name="actionExit"/> - </widget> - <widget class="QMenu" name="menuHelp"> - <property name="title"> - <string>Help</string> - </property> - <addaction name="actionAbout"/> - </widget> - <widget class="QMenu" name="menuCustom"> - <property name="title"> - <string>Custom</string> - </property> - <addaction name="actionCheck_Matlab_Licenses"/> - </widget> - <addaction name="menuFile"/> - <addaction name="menuHelp"/> - <addaction name="menuCustom"/> - </widget> - <action name="actionExit"> - <property name="text"> - <string>Exit</string> - </property> - </action> - <action name="actionAbout"> - <property name="text"> - <string>About</string> - </property> - </action> - <action name="actionCheck_Matlab_Licenses"> - <property name="text"> - <string>Check Matlab Licenses</string> - </property> - </action> - </widget> - <resources/> - <connections/> -</ui> diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp index 299958fd8dee442c2673678b6e789c66627da3d0..a13343453c9d8876f1fc57ccb72c3df4efaeb493 100644 --- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp +++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp @@ -179,9 +179,8 @@ #include <boost/scoped_ptr.hpp> //Mantid -#include "Mantid/MantidAbout.h" -#include "Mantid/MantidDock.h" #include "Mantid/MantidUI.h" +#include "Mantid/MantidAbout.h" #include "Mantid/PeakPickerTool.h" #include "Mantid/ManageCustomMenus.h" #include "Mantid/ManageInterfaceCategories.h" @@ -439,10 +438,6 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args) explorerSplitter->setSizes( splitterSizes << 45 << 45); explorerWindow->hide(); - // Other docked widgets - m_interpreterDock = new QDockWidget(this); - m_sysMonitorDock = new QDockWidget(this); - // Needs to be done after initialization of dock windows, // because we now use QDockWidget::toggleViewAction() createActions(); @@ -573,7 +568,7 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args) setScriptingLanguage(defaultScriptingLang); m_iface_script = NULL; - // -- IPython docked widget -- + m_interpreterDock = new QDockWidget(this); m_interpreterDock->setObjectName("interpreterDock"); // this is needed for QMainWindow::restoreState() m_interpreterDock->setWindowTitle("Script Interpreter"); runPythonScript("from ipython_widget import *\nw = _qti.app._getInterpreterDock()\nw.setWidget(MantidIPythonWidget())",false,true,true); @@ -583,54 +578,6 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args) addDockWidget( Qt::BottomDockWidgetArea, m_interpreterDock ); } - // Algorithms, Workspaces & SysMonitor - if ( !restoreDockWidget(mantidUI->m_exploreMantid)) - { - addDockWidget(Qt::RightDockWidgetArea, mantidUI->m_exploreMantid); - } - if ( !restoreDockWidget(mantidUI->m_exploreAlgorithms)) - { - addDockWidget(Qt::RightDockWidgetArea, mantidUI->m_exploreAlgorithms); - } - if(psutilPresent()) - { - m_sysMonitorDock->setObjectName("systemMonitor"); // this is needed for QMainWindow::restoreState() - m_sysMonitorDock->setWindowTitle("System Monitor"); - runPythonScript("from SysMon import sysmon\n" - "w = sysmon.SysMon(_qti.app._getSysMonitorDock())\n" - "_qti.app._getSysMonitorDock().setWidget(w)", - false, true, true); - if ( !restoreDockWidget(m_sysMonitorDock)) - { - // Setting the max width to 300 and then to -1 later seems to - // be the only way that I found to get the dock to have a decent initial - // size but then still be resizable. - m_sysMonitorDock->setMaximumWidth(300); - addDockWidget(Qt::RightDockWidgetArea, m_sysMonitorDock); - m_sysMonitorDock->setMaximumWidth(QWIDGETSIZE_MAX); // reset it - } - tabifyDockWidget(mantidUI->m_exploreAlgorithms, m_sysMonitorDock); // first, second in that order on tabs - mantidUI->m_exploreAlgorithms->raise(); - - } - else - { - // Remove menu item - auto actions = view->actions(); - auto itr = actions.constBegin(); - auto iend = actions.constEnd(); - for(; itr != iend; ++itr) - { - if(*itr == m_sysMonitorDock->toggleViewAction()) break; - } - // Move back for the separator - if(itr != actions.constBegin()) --itr; - view->removeAction(*itr); - ++itr; - view->removeAction(*itr); - delete m_sysMonitorDock; - } - loadCustomActions(); // Nullify catalogSearch @@ -694,13 +641,13 @@ bool ApplicationWindow::shouldWeShowFirstTimeSetup(const QStringList& commandArg { const Mantid::Kernel::FacilityInfo& facilityInfo = config.getFacility(facility); const Mantid::Kernel::InstrumentInfo& instrumentInfo = config.getInstrument(instrument); - g_log.information()<<"Default facility '" << facilityInfo.name() + g_log.information()<<"Default facility '" << facilityInfo.name() << "', instrument '" << instrumentInfo.name() << "'" << std::endl; } catch (Mantid::Kernel::Exception::NotFoundError&) { //failed to find the facility or instrument - g_log.error()<<"Could not find your default facility '" << facility + g_log.error()<<"Could not find your default facility '" << facility <<"' or instrument '" << instrument << "' in facilities.xml, showing please select again." << std::endl; return true; } @@ -1308,12 +1255,6 @@ void ApplicationWindow::initMainMenu() mantidUI->addMenuItems(view); - // System monitor (might get removed later after check) - view->insertSeparator(); - m_sysMonitorDock->toggleViewAction()->setChecked(false); - view->addAction(m_sysMonitorDock->toggleViewAction()); - - view->insertSeparator(); toolbarsMenu = view->addMenu(tr("&Toolbars")); view->addAction(actionShowConfigureDialog); @@ -6173,7 +6114,7 @@ void ApplicationWindow::savetoNexusFile() else { throw std::runtime_error("Invalid input for SaveNexus, you cannot save this type of object as a NeXus file"); - } + } } else { @@ -7177,7 +7118,7 @@ void ApplicationWindow::showGeneralPlotDialog() return; } if (ml && ml->layers()) - showPlotDialog(); + showPlotDialog(); } else if (plot->isA("Graph3D")) { @@ -7186,7 +7127,7 @@ void ApplicationWindow::showGeneralPlotDialog() try { plot3D = dynamic_cast<Plot3DDialog*>(gd); - } + } catch(std::runtime_error& ) { g_log.error() << "Failed to open general plot dialog for 3D plot"; @@ -7217,7 +7158,7 @@ void ApplicationWindow::showAxisDialog() return; } if (ml && ml->layers()) - dynamic_cast<AxesDialog*>(gd)->showAxesPage(); + dynamic_cast<AxesDialog*>(gd)->showAxesPage(); } else if (gd && plot->isA("Graph3D")) { @@ -11665,13 +11606,13 @@ void ApplicationWindow::analyzeCurve(Graph *g, Analysis operation, const QString ScaleEngine *se = dynamic_cast<ScaleEngine *>(g->plotWidget()->axisScaleEngine(c->xAxis())); if(se) { - if(se->type() == QwtScaleTransformation::Log10) - fitter = new LogisticFit (this, g); - else - fitter = new SigmoidalFit (this, g); + if(se->type() == QwtScaleTransformation::Log10) + fitter = new LogisticFit (this, g); + else + fitter = new SigmoidalFit (this, g); + } } } - } break; } @@ -14686,7 +14627,7 @@ bool ApplicationWindow::deleteFolder(Folder *f) auto newParent = dynamic_cast<Folder*>(currentFolder()->parent()); if(newParent) parent = newParent; - } + } } folders->blockSignals(true); @@ -15584,25 +15525,6 @@ bool ApplicationWindow::runPythonScript(const QString & code, bool async, return success; } -/// @return True if the psuitl python module is present and importable otherwise return false -bool ApplicationWindow::psutilPresent() -{ - static bool checkPerformed(false); - static bool pkgPresent(false); - - if(!checkPerformed) - { - g_log.debug("Checking for psutil\n"); - using Mantid::Kernel::Logger; - bool verbose = g_log.is(Logger::Priority::PRIO_DEBUG); - pkgPresent = runPythonScript("import psutil", false, false, verbose); - if(pkgPresent) g_log.debug() << "Found psutil package"; - else g_log.debug() << "Unable to find psutil package"; - checkPerformed = true; - } - - return pkgPresent; -} bool ApplicationWindow::validFor2DPlot(Table *table) diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.h b/Code/Mantid/MantidPlot/src/ApplicationWindow.h index 451818e3476239cf0da2e19f7e27351a7bd43bb6..c984bd2ea01a50dddabf69493f1ae6e0bd4cfd17 100644 --- a/Code/Mantid/MantidPlot/src/ApplicationWindow.h +++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.h @@ -226,9 +226,7 @@ public slots: void onScriptExecuteError(const QString & message, const QString & scriptName, int lineNumber); /// Runs an arbitrary lump of python code, return true/false on success/failure. bool runPythonScript(const QString & code, bool async = false, bool quiet=false, bool redirect=true); - /// Checks for the presence of the Python psutil module for the system monitor widget - bool psutilPresent(); - + QList<MdiSubWindow *> windowsList() const; QList<MdiSubWindow *> getAllWindows() const; void updateWindowLists(MdiSubWindow *w); @@ -597,8 +595,8 @@ public slots: //! Creates a new empty multilayer plot MultiLayer* newGraph(const QString& caption = tr("Graph")); - /// Prepares MultiLayer for plotting - creates if necessary, clears, applies initial settings - MultiLayer* prepareMultiLayer(bool& isNew, MultiLayer* window, const QString& newWindowName = "Graph", + /// Prepares MultiLayer for plotting - creates if necessary, clears, applies initial settings + MultiLayer* prepareMultiLayer(bool& isNew, MultiLayer* window, const QString& newWindowName = "Graph", bool clearWindow = false); void openRecentProject(int index); @@ -1007,12 +1005,12 @@ public slots: //@{ //! show scripting language selection dialog void showScriptingLangDialog(); - //! switches to the given scripting language; + //! switches to the given scripting language; bool setScriptingLanguage(const QString &lang); void scriptsDirPathChanged(const QString& path); //@} - + void makeToolbarsMenu(); void savetoNexusFile(); @@ -1322,7 +1320,7 @@ public: bool applyCurveStyleToMantid; ///< if true defaultCurveStyle, defaultSymbolSize are applyed to MantidCurves /// if true all errors are drawn on new plots with error bars, for a particular graph can be overridden /// form Add Error bars dialog - bool drawAllErrors; + bool drawAllErrors; QFont appFont, plot3DTitleFont, plot3DNumbersFont, plot3DAxesFont; QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont; QColor tableBkgdColor, tableTextColor, tableHeaderColor; @@ -1356,8 +1354,7 @@ public: QString defaultScriptingLang; QDockWidget *m_interpreterDock; - QDockWidget *m_sysMonitorDock; - + QSet<QString> allCategories() const { return m_allCategories; } private: @@ -1403,7 +1400,7 @@ private: QMenu *windowsMenu, *foldersMenu, *view, *graph, *fileMenu, *format, *edit; QMenu *recentProjectsMenu, *recentFilesMenu, *interfaceMenu; - + QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu, *icat; QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu; QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu,*saveMenu,*openMenu, *toolbarsMenu; @@ -1486,7 +1483,7 @@ private: QList<QAction *> d_user_actions; QList<QMenu* > d_user_menus; //Mantid - + QList<QAction *> m_interfaceActions; /// list of mantidmatrix windows opened from project file. @@ -1505,7 +1502,7 @@ private: QList<FloatingWindow*> m_floatingWindows; // To block activating new window when a floating window is in process of resetting flags bool blockWindowActivation; - /// + /// bool m_enableQtiPlotFitting; #ifdef SHARED_MENUBAR diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp index 4cbce1df41e6516ce63984f869ccd4811313aa8e..e9434bad68020a893aae67cce4e44c7ceba208bf 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp @@ -43,6 +43,7 @@ MantidDockWidget::MantidDockWidget(MantidUI *mui, ApplicationWindow *parent) : setObjectName("exploreMantid"); // this is needed for QMainWindow::restoreState() setMinimumHeight(150); setMinimumWidth(200); + parent->addDockWidget( Qt::RightDockWidgetArea, this ); m_appParent = parent; @@ -71,13 +72,13 @@ MantidDockWidget::MantidDockWidget(MantidUI *mui, ApplicationWindow *parent) : buttonLayout->addWidget(m_saveButton); m_workspaceFilter = new MantidQt::MantidWidgets::LineEditWithClear(); - m_workspaceFilter->setPlaceholderText("Filter Workspaces"); - m_workspaceFilter->setToolTip("Type here to filter the workspaces"); + m_workspaceFilter->setPlaceholderText("Filter Workspaces"); + m_workspaceFilter->setToolTip("Type here to filter the workspaces"); connect(m_workspaceFilter, SIGNAL(textChanged(const QString&)), this, SLOT(filterWorkspaceTree(const QString&))); QVBoxLayout * layout = new QVBoxLayout(); - f->setLayout(layout); + f->setLayout(layout); layout->setSpacing(0); layout->setMargin(0); layout->addLayout(buttonLayout); @@ -197,7 +198,7 @@ void MantidDockWidget::createWorkspaceMenuActions() connect(m_showMDPlot, SIGNAL(activated()), m_mantidUI, SLOT(showMDPlot())); m_showListData = new QAction(tr("List Data"), this); - connect(m_showListData, SIGNAL(activated()), m_mantidUI, SLOT(showListData())); + connect(m_showListData, SIGNAL(activated()), m_mantidUI, SLOT(showListData())); m_showSpectrumViewer = new QAction(tr("Show Spectrum Viewer"), this); connect(m_showSpectrumViewer, SIGNAL(activated()), m_mantidUI, SLOT(showSpectrumViewer())); @@ -682,7 +683,7 @@ void MantidDockWidget::filterWorkspaceTree(const QString &text) //show all items QTreeWidgetItemIterator it(m_tree); - while (*it) + while (*it) { (*it)->setHidden(false); ++it; @@ -705,7 +706,7 @@ void MantidDockWidget::filterWorkspaceTree(const QString &text) { expanded << item->text(0); } - else + else { //expand everything that is at the top level (as we lazy load this is required) item->setExpanded(true); @@ -714,12 +715,12 @@ void MantidDockWidget::filterWorkspaceTree(const QString &text) //filter based on the string QTreeWidgetItemIterator it(m_tree,QTreeWidgetItemIterator::All); - while (*it) + while (*it) { QTreeWidgetItem *item = (*it); QVariant userData = item->data(0, Qt::UserRole); - if (!userData.isNull() ) + if (!userData.isNull() ) { Workspace_sptr workspace = userData.value<Workspace_sptr>(); if (workspace) @@ -770,10 +771,10 @@ void MantidDockWidget::filterWorkspaceTree(const QString &text) //make children of visible groups visible for (auto itGroup = visibleGroups.begin(); itGroup != visibleGroups.end(); ++itGroup) { - QTreeWidgetItem *group = (*itGroup); + QTreeWidgetItem *group = (*itGroup); for (int i = 0; i < group->childCount(); i++) { - QTreeWidgetItem *child = group->child(i); + QTreeWidgetItem *child = group->child(i); if (child->isHidden()) { //I was previously hidden, show me @@ -811,7 +812,7 @@ void MantidDockWidget::clickedWorkspace(QTreeWidgetItem* item, int) } void MantidDockWidget::workspaceSelected() -{ +{ QList<QTreeWidgetItem*> selectedItems=m_tree->selectedItems(); if(selectedItems.isEmpty()) return; @@ -1076,7 +1077,7 @@ void MantidDockWidget::saveToProgram(const QString & name) } //Check to see if mandatory information is included - if ((programKeysAndDetails.count("name") != 0) && (programKeysAndDetails.count("target") != 0) && (programKeysAndDetails.count("saveusing") != 0)) + if ((programKeysAndDetails.count("name") != 0) && (programKeysAndDetails.count("target") != 0) && (programKeysAndDetails.count("saveusing") != 0)) { std::string expTarget = Poco::Path::expand(programKeysAndDetails.find("target")->second); @@ -1240,7 +1241,7 @@ void MantidDockWidget::popupMenu(const QPoint & pos) } // Add the items that are appropriate for the type - if( MatrixWorkspace_const_sptr matrixWS = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(ws) ) + if( MatrixWorkspace_const_sptr matrixWS = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(ws) ) { addMatrixWorkspaceMenuItems(menu, matrixWS); } @@ -1256,7 +1257,7 @@ void MantidDockWidget::popupMenu(const QPoint & pos) { addPeaksWorkspaceMenuItems(menu, peaksWS); } - else if( boost::dynamic_pointer_cast<const WorkspaceGroup>(ws) ) + else if( boost::dynamic_pointer_cast<const WorkspaceGroup>(ws) ) { addWorkspaceGroupMenuItems(menu); } @@ -1303,16 +1304,16 @@ void MantidDockWidget::popupMenu(const QPoint & pos) connect(m_program,SIGNAL(activated()),m_programMapper,SLOT(map())); //Send name of program when clicked m_programMapper->setMapping(m_program, name); - m_saveToProgram->addAction(m_program); + m_saveToProgram->addAction(m_program); // Set first pass to false so that it doesn't set up another menu entry for all programs. firstPass = false; } - } + } } //Tell the button what to listen for and what to do once clicked (if there is anything to connect it will be set to false) - if (firstPass == false) + if (firstPass == false) connect(m_programMapper, SIGNAL(mapped(const QString &)), this, SLOT(saveToProgram(const QString &))); //Rename is valid for all workspace types @@ -1529,11 +1530,11 @@ void MantidTreeWidget::dragEnterEvent(QDragEnterEvent *de) void MantidTreeWidget::dropEvent(QDropEvent *de) { QStringList filenames; - const QMimeData *mimeData = de->mimeData(); - if (mimeData->hasUrls()) + const QMimeData *mimeData = de->mimeData(); + if (mimeData->hasUrls()) { QList<QUrl> urlList = mimeData->urls(); - for (int i = 0; i < urlList.size(); ++i) + for (int i = 0; i < urlList.size(); ++i) { QString fName = urlList[i].toLocalFile(); if (fName.size()>0) @@ -1544,7 +1545,7 @@ void MantidTreeWidget::dropEvent(QDropEvent *de) } de->acceptProposedAction(); - for (int i = 0; i < filenames.size(); ++i) + for (int i = 0; i < filenames.size(); ++i) { try { @@ -1559,7 +1560,7 @@ void MantidTreeWidget::dropEvent(QDropEvent *de) catch (std::runtime_error& error) { treelog.error()<<"Failed to Load the file "<<filenames[i].toStdString()<<" . The reason for failure is: "<< error.what()<<std::endl; - } + } catch (std::logic_error& error) { treelog.error()<<"Failed to Load the file "<<filenames[i].toStdString()<<" . The reason for failure is: "<< error.what()<<std::endl; @@ -1730,7 +1731,7 @@ QMultiMap<QString,std::set<int> > MantidTreeWidget::chooseSpectrumFromSelected() return spectrumToPlot; } - // Else, one or more workspaces + // Else, one or more workspaces MantidWSIndexDialog *dio = new MantidWSIndexDialog(m_mantidUI, 0, selectedMatrixWsNameList); dio->exec(); return dio->getPlots(); @@ -1893,6 +1894,7 @@ AlgorithmDockWidget::AlgorithmDockWidget(MantidUI *mui, ApplicationWindow *w): setObjectName("exploreAlgorithms"); // this is needed for QMainWindow::restoreState() setMinimumHeight(150); setMinimumWidth(200); + w->addDockWidget( Qt::RightDockWidgetArea, this );//*/ //Add the AlgorithmSelectorWidget m_selector = new MantidQt::MantidWidgets::AlgorithmSelectorWidget(this); @@ -2005,3 +2007,4 @@ void AlgorithmDockWidget::hideProgressBar() //-------------------- ----------------------// + diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h index 744af6c1eaf9e0959d52f891ded14c4188a3a848..d776af0a37799c9b29f7642a4351670ca2876acf 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h @@ -204,7 +204,7 @@ public: void showAlgWidget(bool on = true); /// Plot a 1D graph for an integrated mdworkspace - MultiLayer* plotMDList(const QStringList& wsNames, const int plotAxis, + MultiLayer* plotMDList(const QStringList& wsNames, const int plotAxis, const Mantid::API::MDNormalization normalization, const bool showError, MultiLayer* plotWindow = NULL, bool clearWindow = false); @@ -256,7 +256,7 @@ public: /// Create a table showing detector information for the given workspace and indices and optionally the data for that detector Table* createDetectorTable(const QString & wsName, const std::vector<int>& indices, bool include_data = false); /// Create the instrument detector table from a MatrixWorkspace - Table* createDetectorTable(const QString & wsName, const Mantid::API::MatrixWorkspace_sptr & ws, + Table* createDetectorTable(const QString & wsName, const Mantid::API::MatrixWorkspace_sptr & ws, const std::vector<int>& indices, bool include_data = false); /// Create a table of detectors from a PeaksWorkspace Table* createDetectorTable(const QString & wsName, const Mantid::API::IPeaksWorkspace_sptr & ws); @@ -271,7 +271,7 @@ public: void renameWorkspace(QStringList = QStringList()); /** - * Set the currently used fit property browser. Is needed because e.g. Muon Analysis is using its + * Set the currently used fit property browser. Is needed because e.g. Muon Analysis is using its * own fit browser. * @param newBrowser The browser to be used. If is null, is set to default one. */ @@ -314,15 +314,6 @@ signals: public: - // QMainWindow needs the dock widgets to be accessible - MantidDockWidget *m_exploreMantid; // Dock window for manipulating workspaces - AlgorithmDockWidget *m_exploreAlgorithms; // Dock window for using algorithms - RemoteClusterDockWidget *m_exploreRemoteTasks; // Dock window for using remote tasks - /// Current fit property browser being used - MantidQt::MantidWidgets::FitPropertyBrowser* m_fitFunction; - /// Default fit property browser (the one docked on the left) - MantidQt::MantidWidgets::FitPropertyBrowser* m_defaultFitFunction; - signals: // These signals are to be fired from methods run in threads other than the main one @@ -493,11 +484,11 @@ private: void handleRenameWorkspace(Mantid::API::WorkspaceRenameNotification_ptr pNf); Poco::NObserver<MantidUI, Mantid::API::WorkspaceRenameNotification> m_renameObserver; - //handles notification send by Groupworkspaces algorithm + //handles notification send by Groupworkspaces algorithm void handleGroupWorkspaces(Mantid::API::WorkspacesGroupedNotification_ptr pNf); Poco::NObserver<MantidUI, Mantid::API::WorkspacesGroupedNotification> m_groupworkspacesObserver; - //handles notification send by UnGroupworkspaces algorithm + //handles notification send by UnGroupworkspaces algorithm void handleUnGroupWorkspace(Mantid::API::WorkspaceUnGroupingNotification_ptr pNf); Poco::NObserver<MantidUI, Mantid::API::WorkspaceUnGroupingNotification> m_ungroupworkspaceObserver; @@ -532,6 +523,13 @@ private: // Private variables ApplicationWindow *m_appWindow; // QtiPlot main ApplicationWindow + MantidDockWidget *m_exploreMantid; // Dock window for manipulating workspaces + AlgorithmDockWidget *m_exploreAlgorithms; // Dock window for using algorithms + RemoteClusterDockWidget *m_exploreRemoteTasks; // Dock window for using remote tasks + /// Current fit property browser being used + MantidQt::MantidWidgets::FitPropertyBrowser* m_fitFunction; + /// Default fit property browser (the one docked on the left) + MantidQt::MantidWidgets::FitPropertyBrowser* m_defaultFitFunction; QAction *actionCopyRowToTable; QAction *actionCopyRowToGraph; diff --git a/Code/Mantid/MantidPlot/src/qti.sip b/Code/Mantid/MantidPlot/src/qti.sip index a15734f9e842f98ff90515f88c8ccedb828f7ebe..2d12a0cb2431f98d15c8afda373768a9d0009603 100644 --- a/Code/Mantid/MantidPlot/src/qti.sip +++ b/Code/Mantid/MantidPlot/src/qti.sip @@ -1123,9 +1123,9 @@ public: %End Matrix* newMatrix(); Matrix* newMatrix(const QString&, int=32, int=32); - + TiledWindow *newTiledWindow(); - + MultiLayer *plot(const QString&) /PyName=graph/; %MethodCode sipRes = sipCpp->currentFolder()->graph(*a0, false); @@ -1207,12 +1207,6 @@ public: sipRes = sipCpp->m_interpreterDock; %End - // Required for setting the SysMon widget - QDockWidget _getSysMonitorDock(); -%MethodCode - sipRes = sipCpp->m_sysMonitorDock; -%End - // folders Folder *activeFolder(); %MethodCode