gui Package

gui Package

NICOS GUI application package.

config Module

NICOS GUI config helpers.

class nicos.gui.config.hsplit

Bases: tuple

Bases: tuple

class nicos.gui.config.panel

Bases: tuple

Bases: tuple

class nicos.gui.config.tool

Bases: tuple

Bases: tuple

class nicos.gui.config.vsplit

Bases: tuple

Bases: tuple

class nicos.gui.config.window

Bases: tuple

Bases: tuple

data Module

NICOS GUI data handler class.

class nicos.gui.data.Curve

Bases: object

copy()
class nicos.gui.data.DataError

Bases: exceptions.Exception

Bases: Exception

class nicos.gui.data.DataHandler(client)

Bases: PyQt4.QtCore.QObject

Bases: QObject

add_existing_dataset(set, origins=())
on_client_connected()
on_client_datapoint((xvalues, yvalues))
on_client_dataset(set)
class nicos.gui.data.DataProxy(lists)

Bases: object

defconfig Module

NICOS GUI default configuration.

fitutils Module

NICOS GUI fitting utilities.

class nicos.gui.fitutils.FitError

Bases: exceptions.Exception

Bases: Exception

nicos.gui.fitutils.fit_arby(xdata, ydata, yerr, fcnstr, params, guesses, xlimits)
nicos.gui.fitutils.fit_gauss(xdata, ydata, yerr, (xb, yb), (x0, y0), (xw, yw))
nicos.gui.fitutils.fit_peak_common(xdata, ydata, yerr, (xb, yb), (x0, y0), (xw, yw), modelfunc, beta0)
nicos.gui.fitutils.fit_pearson_vii(xdata, ydata, yerr, (xb, yb), (x0, y0), (xw, yw))
nicos.gui.fitutils.fit_pseudo_voigt(xdata, ydata, yerr, (xb, yb), (x0, y0), (xw, yw))
nicos.gui.fitutils.fit_tc(xdata, ydata, yerr, (Tb, Ib), (Tc, Ic))
nicos.gui.fitutils.gauss(beta, x)
nicos.gui.fitutils.pearson_vii(beta, x)
nicos.gui.fitutils.pseudo_voigt(beta, x)
nicos.gui.fitutils.tc_curve(beta, T)

gui_rc Module

nicos.gui.gui_rc.qCleanupResources()
nicos.gui.gui_rc.qInitResources()

histedit Module

A line editor control with history stepping.

class nicos.gui.histedit.HistoryLineEdit(parent, history=None)

Bases: PyQt4.QtGui.QLineEdit

Bases: QLineEdit

A line editor with history stepping.

event(event)
keyPressEvent(kev)
stepHistory(num)
stepHistoryUntil(prefix, direction)

main Module

NICOS GUI main window and application startup.

class nicos.gui.main.MainWindow

Bases: PyQt4.QtGui.QMainWindow, nicos.gui.utils.DlgUtils

Bases: QMainWindow, DlgUtils

closeEvent(event)
createWindow(wtype)
loadSettings(settings)
on_actionAboutQt_triggered()
on_actionAbout_triggered()
on_actionColor_triggered()
on_actionConnect_triggered(on)
on_actionFont_triggered()
on_actionPreferences_triggered()
on_auxWindow_closed(window)
on_client_broken(problem)
on_client_cache((time, key, op, value))
on_client_connected()
on_client_disconnected()
on_client_error(problem, exc=None)
on_client_failed(problem)
on_client_status(data)
on_trayIcon_activated(reason)
runTool(ttype)
saveSettings(settings)
setConnData(login, host, port)
setStatus(status, exception=False)
setTitlebar(connected, setups=())
show()
class nicos.gui.main.NicosGuiClient(parent)

Bases: nicos.daemon.client.NicosClient, PyQt4.QtCore.QObject

Bases: NicosClient, QObject

signal(name, *args)
nicos.gui.main.main(argv)

outview Module

A text control to display output.

class nicos.gui.outview.OutputView(parent)

Bases: PyQt4.QtGui.QTextBrowser

Bases: QTextBrowser

addMessage(message)
addMessages(messages)
addText(text, fmt=None)
clear()
findNext(what, regex=False)
formatMessage(message)
getOutputString()
scrollToBottom()
setActionLabel(label)
viewAll()
viewOnly(match)
nicos.gui.outview.format_time(timeval)

plothelpers Module

NICOS GUI plotting helpers.

class nicos.gui.plothelpers.ActivePlotPicker(*args)

Bases: PyQt4.Qwt5.Qwt.QwtPlotPicker

Bases: QwtPlotPicker

QwtPlotPicker that emits mouse move events when activated.

widgetMouseMoveEvent(event)
class nicos.gui.plothelpers.ErrorBarPlotCurve(x=[], y=[], dx=None, dy=None, curvePen=<PyQt4.QtGui.QPen object at 0xadbc844>, curveStyle=1, curveSymbol=<PyQt4.Qwt5.Qwt.QwtSymbol object at 0xade9f5c>, errorPen=<PyQt4.QtGui.QPen object at 0xadbc87c>, errorCap=0, errorOnTop=False, title=None)

Bases: PyQt4.Qwt5.Qwt.QwtPlotCurve

Bases: QwtPlotCurve

Copied from Qwt examples and applied some fixes.

boundingRect()
drawFromTo(painter, xMap, yMap, first, last=-1)
setData(x, y, dx=None, dy=None)
class nicos.gui.plothelpers.NicosPlot(parent, window, timeaxis=False)

Bases: PyQt4.Qwt5.Qwt.QwtPlot

Bases: QwtPlot

addPlotCurve(plotcurve, replot=False)
on_legendClicked(item)
on_picker_moved(point)
on_zoomer_zoomed(rect)
setFonts(font, bold, larger)
setLegend(on)
setVisibility(item, on)
titleString()
updateDisplay()
xaxisName()
xaxisScale()
y2axisName()
y2axisScale()
yaxisName()
yaxisScale()
class nicos.gui.plothelpers.TimeScaleDraw

Bases: PyQt4.Qwt5.Qwt.QwtScaleDraw

Bases: QwtScaleDraw

label(value, strf=<built-in function strftime>, local=<built-in function localtime>)
nicos.gui.plothelpers.cloneToGrace(plot, saveall='', pause=0.20000000000000001)

Clone the plot into Grace for very high quality hard copy output.

Know bug: Grace does not scale the data correctly when Grace cannot cannot keep up with gracePlot. This happens when it takes too long to load Grace in memory (exit the Grace process and try again) or when ‘pause’ is too short.

Cloned from the Qwt5.qplt module and applied some fixes.

settings Module

NICOS GUI settings window.

class nicos.gui.settings.SettingsDialog(main)

Bases: PyQt4.QtGui.QDialog, nicos.gui.utils.DlgUtils

Bases: QDialog, DlgUtils

on_createProfile_released()
on_deleteProfile_released()
on_editProfile_released()
on_settingsTree_itemActivated(item, column)
saveSettings()

utils Module

NICOS GUI utilities.

class nicos.gui.utils.DlgPresets(group, ctls)

Bases: object

Save dialog presets for Qt dialogs.

get_QCheckBox(ctl)
get_QComboBox(ctl)
get_QDateTimeEdit(ctl)
get_QLineEdit(ctl)
get_QListBox(ctl)
get_QListWidget(ctl)
get_QRadioButton(ctl)
get_QSpinBox(ctl)
get_QTabWidget(ctl)
get_QTextEdit(ctl)
load()
save()
set_QCheckBox(ctl, val)
set_QComboBox(ctl, val)
set_QDateTimeEdit(ctl, val)
set_QLineEdit(ctl, val)
set_QListBox(ctl, val)
set_QListWidget(ctl, val)
set_QRadioButton(ctl, val)
set_QSpinBox(ctl, val)
set_QTabWidget(ctl, val)
set_QTextEdit(ctl, val)
class nicos.gui.utils.DlgUtils(title)

Bases: object

askQuestion(text, select_no=False)
selectDirectory(ctl, text='Choose a directory')
selectInputFile(ctl, text='Choose an input file')
selectOutputFile(ctl, text='Choose an output filename')
showError(text)
showInfo(text)
viewTextFile(fname)
class nicos.gui.utils.SettingGroup(name)

Bases: object

nicos.gui.utils.chunks(iterable, size)
nicos.gui.utils.dialogFromUi(parent, uiname, subdir='')
nicos.gui.utils.enumerateWithProgress(seq, text, every=1, parent=None, total=None)
nicos.gui.utils.formatAlternateDuration(secs)
nicos.gui.utils.formatDuration(secs)
nicos.gui.utils.formatEndtime(secs)
nicos.gui.utils.getXDisplay()
nicos.gui.utils.importString(import_name, silent=False)

Imports an object based on a string.

nicos.gui.utils.loadBasicWindowSettings(window, settings)
nicos.gui.utils.loadUi(widget, uiname, subdir='')
nicos.gui.utils.parseConnectionData(s)
nicos.gui.utils.safeFilename(fn)
nicos.gui.utils.setBackgroundColor(widget, color)
nicos.gui.utils.setForegroundColor(widget, color)
nicos.gui.utils.showToolText(toolbar, action)
nicos.gui.utils.showTraceback(tb, parent, fontwidget)
nicos.gui.utils.unzip(data)