password protected Reset Account
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
{
|
||||
|
||||
"Parameters":{
|
||||
"drawLine" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}},
|
||||
"delayRamp" : {"flag" : 1, "data":{ "widget": "QDoubleSpinBox", "text" : "Ramp delay (s):",
|
||||
"value" : 0.1, "min": 0.00, "max": 0.20, "step": 0.01,
|
||||
"tooltip":"Wait time between sending set point to each magnet in 'Restore'/'Standby' "}},
|
||||
"drawLine2" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}}
|
||||
|
||||
},
|
||||
"Expert":{
|
||||
"debug": {"flag" : 0, "data":{ "widget": "None", "text" : "Debug", "value" : 0}},
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"IOC": {
|
||||
"resultsTabTitle" : "IOC"
|
||||
},
|
||||
"headerMagnetSector": ["B1B2","G1","SH","G2","O2","PIF", "G3"],
|
||||
"Master": "Controlroom"
|
||||
}
|
||||
@@ -17,5 +17,6 @@
|
||||
"resultsTabTitle" : "IOC"
|
||||
},
|
||||
"headerMagnetSector": ["B1B2","G1","SH","G2","O2","PIF", "G3"],
|
||||
"Master": "Controlroom"
|
||||
"Master": "Controlroom",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -73,5 +73,6 @@
|
||||
"IOC": {
|
||||
"resultsTabTitle" : "IOC"
|
||||
},
|
||||
"Master": "Controlroom
|
||||
"Master": "Controlroom",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"headerMagnetSector": ["G1"],
|
||||
"Master": "Gantry 1"
|
||||
"Master": "Gantry 1",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"headerMagnetSector": ["G2"],
|
||||
"Master": "Gantry 2"
|
||||
"Master": "Gantry 2",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"headerMagnetSector": ["PIF", "G3"],
|
||||
"Master": "Gantry 3"
|
||||
"Master": "Gantry 3",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"headerMagnetSector": ["O2"],
|
||||
"Master": "OPTIS2"
|
||||
"Master": "OPTIS2",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 0}}
|
||||
},
|
||||
"headerMagnetSector": ["PIF"],
|
||||
"Master": "PIF"
|
||||
"Master": "PIF",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
@@ -127,5 +127,6 @@
|
||||
"resultsTabTitle" : "IOC"
|
||||
},
|
||||
"headerMagnetSector": ["B1B2","G1","SH","G2","O2","PIF", "G3"],
|
||||
"Master": "Controlroom"
|
||||
"Master": "Controlroom",
|
||||
"Reset": "HUSH!"
|
||||
}
|
||||
|
||||
6
hush.sh
6
hush.sh
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.5.0
|
||||
cd /proscan/bd/applications/hush/hla/1.6.0
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush.sh"
|
||||
@@ -60,10 +60,10 @@ echo "PYTHON_VERSION $PYTHON_VERSION"
|
||||
|
||||
|
||||
#C_EXT version
|
||||
export PYTHONPATH=.:/opt/gfa/cafe/python/pycafe/cafe-1.21.0/lib/${_EPICS_HOST_ARCH}:/proscan/bd/applications/deps/apps4ops/v1.10.0
|
||||
export PYTHONPATH=.:/opt/gfa/cafe/python/pycafe/cafe-1.21.0/lib/${_EPICS_HOST_ARCH}:/proscan/bd/applications/deps/apps4ops/v1.13.0
|
||||
|
||||
if [ "${EXTRA_PYTHON_PATH_FLAG}" -gt "0" ] ; then
|
||||
export PYTHONPATH=$PYTHONPATH:/proscan/bd/applications/deps/apps4ops/v1.10.0/common/python${PYTHON_VERSION_DIR}
|
||||
export PYTHONPATH=$PYTHONPATH:/proscan/bd/applications/deps/apps4ops/v1.13.0/common/python${PYTHON_VERSION_DIR}
|
||||
fi
|
||||
echo $PYTHONPATH
|
||||
|
||||
|
||||
24
src/gui.py
24
src/gui.py
@@ -12,9 +12,9 @@ from qtpy.QtGui import QColor, QPixmap
|
||||
from qtpy.QtCore import __version__ as QT_VERSION_STR
|
||||
from qtpy.QtCore import QEventLoop, Qt, QTimer, Slot
|
||||
from qtpy.QtWidgets import (
|
||||
QApplication, QFrame, QGridLayout, QGroupBox, QHBoxLayout, QLabel,
|
||||
QMessageBox, QPushButton, QSpacerItem, QTabBar, QTabWidget,
|
||||
QTableWidgetItem, QTextEdit, QWidget)
|
||||
QApplication, QFrame, QGridLayout, QGroupBox, QHBoxLayout, QInputDialog,
|
||||
QLabel, QLineEdit, QMessageBox, QPushButton, QSpacerItem, QTabBar,
|
||||
QTabWidget, QTableWidgetItem, QTextEdit, QWidget)
|
||||
|
||||
try:
|
||||
import elog
|
||||
@@ -1327,6 +1327,7 @@ class AppGui(QWidget):
|
||||
def clear_saving(self, sector_prefix_list: list = None):
|
||||
if not sector_prefix_list:
|
||||
return
|
||||
'''
|
||||
qm = QMessageBox()
|
||||
mess = ("This action will reset the energy saving account to zero. \n" +
|
||||
"This is typically undertaken at the end of the calendar " +
|
||||
@@ -1338,7 +1339,22 @@ class AppGui(QWidget):
|
||||
|
||||
if reply == QMessageBox.No:
|
||||
return
|
||||
|
||||
'''
|
||||
|
||||
qd = QInputDialog(self)
|
||||
#pwedit = QLineEdit()
|
||||
mess = ("To execute the reset,\nplease enter the password:")
|
||||
text, ok = qd.getText(None, "Reset Account", mess,
|
||||
QLineEdit.Password)
|
||||
if ok and text:
|
||||
if text.upper()!= self.settings.data["Reset"]:
|
||||
qmb = QMessageBox(qd)
|
||||
mess = "Incorrect password!\nTry Reset Account once again."
|
||||
qmb.information(self, "Reset Account", mess)
|
||||
return
|
||||
else:
|
||||
return
|
||||
|
||||
self.parent.prepare_elog_message()
|
||||
print("message", self.parent.message)
|
||||
print("logbook", self.parent.logbook, flush=True)
|
||||
|
||||
Reference in New Issue
Block a user