panic.gui.widgets module

Classes

iValidatedWidget

class panic.gui.widgets.iValidatedWidget[source]

This class assumes that you have a self.api=PanicAPI() member in your subclass

Typical usage:

self.setAllowedUsers(self.api.get_admins_for_alarm(len(items)==1 and items[0].get_alarm_tag())) if not self.validate(‘onDisable/Enable(%s,%s)’%(checked,[a.get_alarm_tag() for a in items])):

return

This class requires PanicAdminUsers and UserValidator PyAlarm properties to be declared.

PanicAdminUsers : [root, tester] UserValidator : user_login.TangoLoginDialog

WindowManager

class panic.gui.widgets.WindowManager[source]

CleanMainWindow

class panic.gui.widgets.CleanMainWindow[source]

AlarmFormula

class panic.gui.widgets.AlarmFormula(model=None, parent=None, device=None, _locals=None, allow_edit=False)[source]
updateFormula(formula='', parse=True)[source]
This method will take the formula text box and will store two variables:
  • self.formula: unprocessed formula in a single row
  • self.test.formula: formula with all alarms and attributes replaced

AlarmPreview

class panic.gui.widgets.AlarmPreview(tag=None, formula=None, parent=None, allow_edit=False)[source]
static showCurrentAlarmPreview(gui, tag=None, formula=None)[source]

It gets current Alarm from GUI and tries to show it up

AttributesPreview

class panic.gui.widgets.AttributesPreview(model='', parent=None, source=None)[source]

clickableQTextEdit

class panic.gui.widgets.clickableQTextEdit(*args)[source]

This class is a QLineEdit that executes a ‘hook’ method every time is double-clicked

setClickHook(hook)[source]

the hook must be a function or callable

clickableQLineEdit

class panic.gui.widgets.clickableQLineEdit(*args)[source]

This class is a QLineEdit that executes a ‘hook’ method every time is double-clicked

setClickHook(hook)[source]

the hook must be a function or callable

Functions

setCheckBox

panic.gui.widgets.setCheckBox(cb, v)[source]

formatAlarm

panic.gui.widgets.formatAlarm(f)[source]

addOkCancelButtons

panic.gui.widgets.addOkCancelButtons(widget, cancel=True)[source]

get_snap_api

panic.gui.widgets.get_snap_api()[source]

getAlarmTimestamp

panic.gui.widgets.getAlarmTimestamp(alarm, attr_value=None, use_taurus=True)[source]

Returns alarm activation timestamp (or 0) of an alarm object

line2multiline

panic.gui.widgets.line2multiline(line)[source]

AlarmsSelector

panic.gui.widgets.AlarmsSelector(alarms, text='Choose alarms to modify')[source]

get_user

panic.gui.widgets.get_user()[source]

getAlarmReport

panic.gui.widgets.getAlarmReport(alarm, parent=None)[source]

clean_str

panic.gui.widgets.clean_str(s)[source]

trace

panic.gui.widgets.trace(msg, head='', level=0, clean=False, use_taurus=False)[source]

multiline2line

panic.gui.widgets.multiline2line(lines)[source]

get_archive_trend

panic.gui.widgets.get_archive_trend(models=None, length=14400, show=False)[source]

get_bold_font

panic.gui.widgets.get_bold_font(points=8)[source]

raw autodoc

class panic.gui.widgets.AlarmFormula(model=None, parent=None, device=None, _locals=None, allow_edit=False)[source]

Bases: PyQt4.QtGui.QSplitter

clear()[source]
initStyle(show=False)[source]
isEditable()[source]
onClose()[source]
onEdit(checked=True)[source]
onSave(ask=False)[source]
setClickHook(hook)[source]
setModel(model=None, device=None)[source]
setReadOnly(checked)[source]
setText(text)[source]
static showAlarmFormula()[source]
toPlainText(text=None)[source]
undoEdit()[source]
updateFormula(formula='', parse=True)[source]
This method will take the formula text box and will store two variables:
  • self.formula: unprocessed formula in a single row
  • self.test.formula: formula with all alarms and attributes replaced
updateResult(formula='')[source]
class panic.gui.widgets.AlarmPreview(tag=None, formula=None, parent=None, allow_edit=False)[source]

Bases: PyQt4.QtGui.QDialog

closeEvent(event)[source]
getAlarmReport(url)[source]
initStyle(show=False)[source]
static showCurrentAlarmPreview(gui, tag=None, formula=None)[source]

It gets current Alarm from GUI and tries to show it up

static showEmptyAlarmPreview(gui=None)[source]
panic.gui.widgets.AlarmsSelector(alarms, text='Choose alarms to modify')[source]
class panic.gui.widgets.AttributesPreview(model='', parent=None, source=None)[source]

Bases: PyQt4.QtGui.QFrame

initStyle()[source]
updateAttributes(model=None)[source]
class panic.gui.widgets.CleanMainWindow[source]

Bases: PyQt4.QtGui.QMainWindow, panic.gui.widgets.WindowManager

closeEvent(event)[source]
class panic.gui.widgets.WindowManager[source]

Bases: fandango.objects.Singleton

WINDOWS = []
classmethod addWindow(klass, obj)[source]
classmethod closeAll(klass)[source]
closeKlass(klass, target)[source]
classmethod getWindow(klass, window)[source]
classmethod getWindows(klass)[source]
classmethod getWindowsNames(klass)[source]
classmethod newWindow(klass, Type, args)[source]
classmethod putOnTop(klass, window)[source]
panic.gui.widgets.addOkCancelButtons(widget, cancel=True)[source]
panic.gui.widgets.clean_str(s)[source]
class panic.gui.widgets.clickableQLineEdit(*args)[source]

Bases: PyQt4.QtGui.QLineEdit

This class is a QLineEdit that executes a ‘hook’ method every time is double-clicked

mouseDoubleClickEvent(event)[source]
setClickHook(hook)[source]

the hook must be a function or callable

class panic.gui.widgets.clickableQTextEdit(*args)[source]

Bases: PyQt4.QtGui.QTextEdit

This class is a QLineEdit that executes a ‘hook’ method every time is double-clicked

mouseDoubleClickEvent(event)[source]
setClickHook(hook)[source]

the hook must be a function or callable

panic.gui.widgets.formatAlarm(f)[source]
panic.gui.widgets.getAlarmReport(alarm, parent=None)[source]
panic.gui.widgets.getAlarmTimestamp(alarm, attr_value=None, use_taurus=True)[source]

Returns alarm activation timestamp (or 0) of an alarm object

panic.gui.widgets.get_archive_trend(models=None, length=14400, show=False)[source]
panic.gui.widgets.get_bold_font(points=8)[source]
panic.gui.widgets.get_snap_api()[source]
panic.gui.widgets.get_user()[source]
class panic.gui.widgets.iValidatedWidget[source]

Bases: object

This class assumes that you have a self.api=PanicAPI() member in your subclass

Typical usage:

self.setAllowedUsers(self.api.get_admins_for_alarm(len(items)==1 and items[0].get_alarm_tag())) if not self.validate(‘onDisable/Enable(%s,%s)’%(checked,[a.get_alarm_tag() for a in items])):

return

This class requires PanicAdminUsers and UserValidator PyAlarm properties to be declared.

PanicAdminUsers : [root, tester] UserValidator : user_login.TangoLoginDialog
KEEP = 60
init(tag='')[source]
setAllowedUsers(users)[source]
validate(msg='', tag='')[source]
panic.gui.widgets.line2multiline(line)[source]
panic.gui.widgets.multiline2line(lines)[source]
panic.gui.widgets.print_clean(s)[source]
panic.gui.widgets.setCheckBox(cb, v)[source]
panic.gui.widgets.trace(msg, head='', level=0, clean=False, use_taurus=False)[source]