Initial commit

This commit is contained in:
2023-05-01 10:40:03 +02:00
commit 0ff63ddb4a
31 changed files with 3782 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
rm *.*~
rm *.*-*
rm *.*+*
rm pyrcc5
rm pyrcc5/*.*
rm src/*.*~
rm src/*.*-*
rm src/*.*+*

6
help/README.md Normal file
View File

@@ -0,0 +1,6 @@
# to compile hush.qrc:
make
# to install compiled hush_respources.py
make install
The latter installs hush_respources.py to the ../pyqrcc5 directory

10
help/hush.qrc Normal file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>page5.html</file>
<file>page4.html</file>
<file>page3.html</file>
<file>page2.html</file>
<file>page1.html</file>
<file>index.html</file>
</qresource>
</RCC>

10
help/hush.qrc~ Normal file
View File

@@ -0,0 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>help/page5.html</file>
<file>help/page4.html</file>
<file>help/page3.html</file>
<file>help/page2.html</file>
<file>help/page1.html</file>
<file>help/index.html</file>
</qresource>
</RCC>

196
help/hush_resources.py Normal file
View File

@@ -0,0 +1,196 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x32\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x33\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x31\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x32\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x34\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x35\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x33\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x34\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x03\x13\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x48\x49\x50\x41\x20\x50\x6f\x77\x65\x72\x20\x55\x73\x61\
\x67\x65\x20\x61\x6e\x64\x20\x53\x61\x76\x69\x6e\x67\x20\x48\x69\
\x67\x68\x6c\x69\x67\x68\x74\x73\x2c\x20\x48\x55\x53\x48\x21\x3c\
\x2f\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\
\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x68\x35\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x67\x72\x61\x79\x3b\x22\x3e\
\x53\x70\x72\x69\x6e\x67\x20\x32\x30\x32\x33\x2c\x20\x4a\x61\x6e\
\x20\x43\x68\x72\x69\x6e\x20\x61\x6e\x64\x20\x2e\x2e\x2e\x3c\x2f\
\x68\x35\x3e\x0a\x3c\x68\x34\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x49\x50\x41\x20\x3c\
\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x20\x67\x72\x61\x79\x3b\x22\x3e\x50\x6f\x77\x65\x72\x3c\
\x2f\x73\x70\x61\x6e\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x55\x3c\x2f\x73\x70\x61\x6e\x3e\x73\x61\x67\x65\x20\x61\x6e\
\x64\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\
\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x53\x3c\x2f\x73\
\x70\x61\x6e\x3e\x61\x76\x69\x6e\x67\x20\x3c\x73\x70\x61\x6e\x20\
\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\
\x64\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x69\x67\x68\x6c\
\x69\x67\x68\x74\x73\x2c\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x48\x55\x53\x48\x21\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x2f\x68\
\x34\x3e\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\
\x6c\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x41\x62\x6f\x75\x74\
\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x69\x73\x20\x3c\
\x62\x3e\x68\x75\x73\x68\x3c\x2f\x62\x3e\x20\x61\x70\x70\x6c\x69\
\x63\x61\x74\x69\x6f\x6e\x20\x69\x6e\x68\x65\x72\x69\x74\x73\x20\
\x66\x72\x6f\x6d\x20\x74\x68\x65\x20\x57\x69\x6e\x64\x6f\x77\x20\
\x62\x61\x73\x65\x20\x63\x6c\x61\x73\x73\x2e\x3c\x62\x72\x3e\x20\
\x20\x0a\x3c\x70\x3e\x69\x6e\x66\x6f\x72\x6d\x61\x74\x69\x6f\x6e\
\x20\x63\x6f\x6e\x63\x65\x72\x6e\x69\x6e\x67\x20\x74\x68\x69\x73\
\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x73\x75\
\x63\x68\x20\x61\x73\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\
\x69\x6f\x6e\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x6f\
\x72\x20\x6f\x74\x68\x65\x72\x2c\x20\x6d\x61\x79\x20\x62\x65\x20\
\x65\x6e\x74\x65\x72\x65\x64\x2c\x20\x65\x2e\x67\x2e\x2c\x20\x3c\
\x61\x20\x68\x72\x65\x66\x3d\x22\x70\x61\x67\x65\x31\x2e\x68\x74\
\x6d\x6c\x22\x3e\x68\x65\x72\x65\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\
\x0a\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\
\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x54\x68\x65\x20\x50\x61\
\x6e\x65\x6c\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x65\
\x73\x65\x20\x77\x65\x62\x20\x70\x61\x67\x65\x73\x20\x61\x72\x65\
\x20\x74\x6f\x20\x62\x65\x20\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\
\x20\x62\x79\x20\x74\x68\x65\x20\x61\x70\x70\x6c\x69\x63\x61\x74\
\x69\x6f\x6e\x20\x6f\x77\x6e\x65\x72\x2e\x3c\x62\x72\x3e\x0a\x0a\
\x0a\x0a\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\
\x3e\x0a\
\x00\x00\x00\x80\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x35\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x65\x74\x63\x2e\x2e\x2e\
\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x70\x3e\x0a\
\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x08\x5a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x32\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x4a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x31\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x7a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x34\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x6a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x33\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x0c\xba\xf2\x7c\
\x00\x69\
\x00\x6e\x00\x64\x00\x65\x00\x78\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x8a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x35\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xc3\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xc3\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
\x00\x00\x01\x87\x70\x5b\x10\xc8\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

18
help/index.html Executable file
View File

@@ -0,0 +1,18 @@
<html><head><title>HIPA Power Usage and Saving Highlights, HUSH!</title></head>
<body>
<h5 style="color:gray;">Spring 2023, Jan Chrin and ...</h5>
<h4> <span style="color: red;">H</span>IPA <span style="color: gray;">Power</span> <span style="color: red;">U</span>sage and <span style="color: red;">S</span>aving <span style="color: red;">H</span>ighlights, <span style="color: red;">HUSH!</span></h4>
<h2 style="color:blue;">About</h2>
<p>This <b>hush</b> application inherits from the Window base class.<br>
<p>information concerning this application, such as configuration parameters or other, may be entered, e.g., <a href="page1.html">here</a></p>
<h2 style="color:blue;">The Panel</h2>
<p>These web pages are to be completed by the application owner.<br>
</body></html>

25
help/index.html~ Executable file
View File

@@ -0,0 +1,25 @@
<html><head><title>Lifetime Measurement</title></head>
<body>
<h5 style="color:gray;">Fall 2021, Andreas Streun, Jan Chrin</h5>
<h4>Beam lifetime measurement</h4>
<h2 style="color:blue;">About</h2>
<p>This <b>Example Application</b> inherits from the SLSMainWindow base class.<br>
<p>information concerning this application, such as configuration parameters or other, may be entered, e.g., <a href="page1.html">here</a></p>
<h2 style="color:blue;">The Panel</h2>
<p>These web pages are to be completed by the application owner.<br>
They are located in the following directory: <br>
/afs/psi.ch/intranet/SF/Beamdynamics/common/qrc_resources/help/&lt;appname&gt;<br>
where &lt;appname&gt;.py is the name of the application program</p>
<p> After modification, execute the following script to incorporate changes<br>
into qrc_resource.py for (automatic) import into PyQt4- and PyQt5-based applications:</p>
<p>cd /afs/psi.ch/intranet/SF/Beamdynamics/common/qrc_resources</p>
<p>./make_and_install.sh</>
</body></html>

2
help/make_and_install.sh Normal file
View File

@@ -0,0 +1,2 @@
make compile
make install

9
help/makefile Normal file
View File

@@ -0,0 +1,9 @@
compile:
pyrcc5 hush.qrc > hush_resources.py
install:
if [ ! -f hush_resources.py ]; then echo "pyrcc5 compilation of resources.qrc failed"; fi
if [ -f hush_resources.py -a -f ../pyrcc5/hush_resources.py-- ]; then cp ../pyrcc5/hush_resources.py-- ../pyrcc5/hush_resources.py---; fi
if [ -f hush_resources.py -a -f ../pyrcc5/hush_resources.py- ]; then cp ../pyrcc5/hush_resources.py- ../pyrcc5/hush_resources.py--; fi
if [ -f hush_resources.py -a -f ../pyrcc5/hush_resources.py ]; then cp ../pyrcc5/hush_resources.py ../pyrcc5/hush_resources.py-; fi
if [ -f hush_resources.py ]; then cp hush_resources.py ../pyrcc5/hush_resources.py; fi

9
help/makefile~ Normal file
View File

@@ -0,0 +1,9 @@
compile:
pyrcc5 hush.qrc > hush_resources.py
install:
if [ ! -f hush_resources.py ]; then echo "pyrcc5 compilation of resources.qrc failed"; fi
if [ -f hush_resources.py -a -f pyrcc5/hush_resources.py-- ]; then cp pyrcc5/hush_resources.py-- pyrcc5/hush_resources.py---; fi
if [ -f hush_resources.py -a -f pyrcc5/hush_resources.py- ]; then cp pyrcc5/hush_resources.py- pyrcc5/hush_resources.py--; fi
if [ -f hush_resources.py -a -f pyrcc5/hush_resources.py ]; then cp pyrcc5/hush_resources.py pyrcc5/hush_resources.py-; fi
if [ -f hush_resources.py ]; then cp hush_resources.py pyrcc5/hush_resources.py; fi

7
help/page1.html Executable file
View File

@@ -0,0 +1,7 @@
<html><head><title>Web Help</title></head>
<body>
<p><b>Page 1 of web help</b></p>
<p> <a href="page2.html"> Next</a></p>
<p><b>etc...</b> etc...</p>
</body></html>

7
help/page2.html Executable file
View File

@@ -0,0 +1,7 @@
<html><head><title>Web Help</title></head>
<body>
<p><b>Page 2 of web help</b></p>
<p> <a href="page3.html"> Next</a></p>
<p><b>etc...</b> etc...</p>
</body></html>

7
help/page3.html Executable file
View File

@@ -0,0 +1,7 @@
<html><head><title>Web Help</title></head>
<body>
<p><b>Page 3 of web help</b></p>
<p> <a href="page4.html"> Next</a></p>
<p><b>etc...</b> etc...</p>
</body></html>

7
help/page4.html Executable file
View File

@@ -0,0 +1,7 @@
<html><head><title>Web Help</title></head>
<body>
<p><b>Page 4 of web help</b></p>
<p> <a href="page5.html"> Next</a></p>
<p><b>etc...</b> etc...</p>
</body></html>

7
help/page5.html Executable file
View File

@@ -0,0 +1,7 @@
<html><head><title>Web Help</title></head>
<body>
<p><b>Page 5 of web help</b></p>
<p><b>etc...</b> etc...</p>
</body></html>

67
hush.json Executable file
View File

@@ -0,0 +1,67 @@
{
"menuFlags":{
"hasFile": 0,
"loadInitFile": 0,
"hasDaq": 0,
"hasH5": 0,
"hasEpics": 0
},
"hdf": {
"destination" : "./"
},
"IP2":{
"standby": [-10.0025, 10.0025, 10.0025, 0.05, 0.05, 40.000, 0.05, 0.005,
10.0025, -10.0025, 10.0025, 0.1392, -25.006, 0.05, 0.05, 2.175,
0.05, 10.0025, -10.0025, 0.05, 0.05, 0.05, 0.05, -10.0025,
-10.0025]
},
"IW2":{
"standby": [-5.001, 5.001, 0.05, -5.001, 5.001, 5.001, -5.001, 0.05,
0.05, 0.05, 5.001, -5.001, -5.001, 5.001, 0.05, 0.05,
0.05, -5.001, 10.0025, 27.605, -10.0025, 21.899, 0.05, -6.000,
6.00, 6.0, 0.05, 0.05, 34.152, 0.5, -0.5, 0.05,
40.591, 62.5],
"ref" : [-79.00, 87.58, 496, -89.3, 80.5, 82.9, -83.77, -1.81,
0.40, 1.39, 77.80, -41.43, -62.33, 63.97, -0.33, -0.25,
0.25, -52.27, 83.98, 520.41, -105.96, 433.61, 0.23, -54.25,
50.51, 23.46, -40.14, -4.66, 622.91, 2.00, -7.17, -0.73,
806.99, 1147.69]
},
"PK1":{
"standby": [56.791, 0.05, -2.0005, 2.0005, 0.05, 0.05, 44.9525, -2.0005,
-2.0005, 0.05, 25.006, -25.006, 0.05, 0.05, 64.066]
},
"PK2":{
"standby": [0.05, -25.006, 25.006, 17.4, 10.0025, -2.0005, 0.05, 0.05,
25.85, -10.0025, 10.0025, 0.05, 0.05, -25.006, 25.006, -25.006,
0.05, 0.05, 0.05, 0.05, 25.006, -25.006, 25.006, -25.006,
0.05, 25.006, 25.1877, 0.05]
},
"SINQ":{
"standby": [-25.006, 0.05, 25.006, 10.0025, -12.608, 0.05, 10.98,
15.6045, -18.3075, 0.05, 20.462, 0.05, 21.9925, -19.005,
46.5345, 18.01, -21.3675]
},
"UCN":{
"standby": [9.404, 25.006, -25.006, 0.05, 0.05, 0.05, 0.05, 25.006,
-25.006, 20.625, 10.0025, -10.0025, 0.05, 20.625, 25.006
]
},
"Parameters":{
"drawLine" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}}
},
"Expert":{
"debug": {"flag" : 1, "data":{ "widget": "None", "text" : "Debug", "value" : 0}},
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 1}}
},
"GUI": {
"resultsTabTitle" : "Results",
"subResultsTabTitle" : [],
"resultsSeq" : []
}
}

52
hush.json- Executable file
View File

@@ -0,0 +1,52 @@
{
"menuFlags":{
"hasFile": 0,
"loadInitFile": 0,
"hasDaq": 0,
"hasH5": 0,
"hasEpics": 0
},
"hdf": {
"destination" : "./"
},
"SLS" : ["Injector", "Booster", "Ring"],
"SLS2" : {"test": ["Injector", "Booster", "Ring"]},
"QTabViking":{
"Vikings": {
"radiobutton" : {"data":{ "widget": "QRadioButton", "text" : "Radio Gaga", "value": ["This", "That", "The Other"], "startIdx": 1}},
"readonly" : {"data":{ "widget": "QLineRead", "text" :"ReadOnly:", "value" : "input"}},
"npts" : {"data":{ "widget": "QLineEdit", "text" :"No Events:", "value" : 22, "min": 0.01, "max": 0.99}},
"nspins" : {"data":{ "widget": "QSpinBox", "text" : "No. Points:", "min": 1, "max": 10, "step": 1,"value": 1 }},
"ndspins" : {"data":{ "widget": "QDoubleSpinBox", "text" : "No. Points:", "min": 1, "max": 10.0, "step": 0.1,"value": 1.5 }},
"facility": {"data" : {"widget": "QComboBox", "text" : "Facility:", "link": ["SLS2", "test"],"layout" : "Horizontal"}},
"checkbox" : {"data":{ "widget": "QCheckBox", "orientation" : "Qt.LeftToRight", "text" : "Checkbox", "value" : 1}}
},
"Saxons": {
"nevents" : {"data":{ "widget": "QLineEdit", "text" :"No. Iterations:", "value" : 33}},
"niter" : {"data":{ "widget": "QSpinBox", "text" : "Step size:", "min": 1, "max": 10, "step": 1,"value": 1 }}
}
},
"Parameters":{
"maxmin" : {"flag" : 1, "data":{ "widget": "QRadioButton", "text" : "", "value": ["Maximize", "Minimize" ]}},
"facility": {"flag": 0, "data" : {"widget": "QComboBox", "text" : "Facility:",
"link": ["SLS"],"layout" : "Horizontal"}},
"N_events" : {"flag" : 1, "data":{ "widget": "QLineEdit", "text" : "No. events: ", "value": 2 }},
"N_points" : {"flag" : 1, "data":{ "widget": "QSpinBox", "text" : "No. points:", "min": 1, "max": 10, "step": 1,"value": 1 }},
"drawLine" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}},
"checkbox" : {"flag" : 1, "data":{ "widget": "QCheckBox", "orientation" : "Qt.LeftToRight",
"text" : " Checkbox", "value" : 1}},
"drawLine2" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}},
"qtabdata" : {"flag" : 1, "data":{ "widget": "QTabWidget", "text" : "Measurement: ", "value" : 0, "link" : "QTabViking", "color" : ["#0080aa", "#0000ff"]}}
},
"Expert":{
"debug": {"flag" : 1, "data":{ "widget": "None", "text" : "Debug", "value" : 0}},
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Simulation", "value" : 1}}
},
"GUI": {
"resultsTabTitle" : "Results",
"subResultsTabTitle" : ["Plots", "Plot-2"],
"resultsSeq" : [10, 1]
}
}

67
hush.json~ Executable file
View File

@@ -0,0 +1,67 @@
{
"menuFlags":{
"hasFile": 0,
"loadInitFile": 0,
"hasDaq": 0,
"hasH5": 0,
"hasEpics": 0
},
"hdf": {
"destination" : "./"
},
"IP2":{
"standby": [-10.0025, 10.0025, 10.0025, 0.05, 0.05, 40.000, 0.05, 0.005,
10.0025, -10.0025, 10.0025, 0.1392, -25.006, 0.05, 0.05, 2.175,
0.05, 10.0025, -10.0025, 0.05, 0.05, 0.05, 0.05, -10.0025,
-10.0025]
},
"IW2":{
"standby": [-5.001, 5.001, 0.05, -5.001, 5.001, 5.001, -5.001, 0.05,
0.05, 0.05, 5.001, -5.001, -5.001, 5.001, 0.05, 0.05,
0.05, -5.001, 10.0025, 27.605, -10.0025, 21.899, 0.05, -6,
6, 6, 0.05, 0.05, 34.152, 0.5, -0.5, 0.05,
40.591, 62.5],
"ref" : [-79.00, 87.58, 496, -89.3, 80.5, 82.9, -83.77, -1.81,
0.40, 1.39, 77.80, -41.43, -62.33, 63.97, -0.33, -0.25,
0.25, -52.27, 83.98, 520.41, -105.96, 433.61, 0.23, -54.25,
50.51, 23.46, -40.14, -4.66, 622.91, 2.00, -7.17, -0.73,
806.99, 1147.69]
},
"PK1":{
"standby": [56.791, 0.05, -2.0005, 2.0005, 0.05, 0.05, 44.9525, -2.0005,
-2.0005, 0.05, 25.006, -25.006, 0.05, 0.05, 64.066]
},
"PK2":{
"standby": [0.05, -25.006, 25.006, 17.4, 10.0025, -2.0005, 0.05, 0.05,
25.85, -10.0025, 10.0025, 0.05, 0.05, -25.006, 25.006, -25.006,
0.05, 0.05, 0.05, 0.05, 25.006, -25.006, 25.006, -25.006,
0.05, 25.006, 25.1877, 0.05]
},
"SINQ":{
"standby": [-25.006, 0.05, 25.006, 10.0025, -12.608, 0.05, 10.98,
15.6045, -18.3075, 0.05, 20.462, 0.05, 21.9925, -19.005,
46.5345, 18.01, -21.3675]
},
"UCN":{
"standby": [9.404, 25.006, -25.006, 0.05, 0.05, 0.05, 0.05, 25.006,
-25.006, 20.625, 10.0025, -10.0025, 0.05, 20.625, 25.006
]
},
"Parameters":{
"drawLine" : {"flag" : 0, "data":{ "widget": "QHLine", "text" : "None", "value" : "None"}}
},
"Expert":{
"debug": {"flag" : 1, "data":{ "widget": "None", "text" : "Debug", "value" : 0}},
"simulation": {"flag" : 1, "data":{ "widget": "None", "text" : "Dry run", "value" : 1}}
},
"GUI": {
"resultsTabTitle" : "Results",
"subResultsTabTitle" : [],
"resultsSeq" : []
}
}

231
hush.py Normal file
View File

@@ -0,0 +1,231 @@
import inspect
import logging
import os
import platform
import random
import sys
import time
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor, QFont, QIcon
from qtpy.QtCore import __version__ as QT_VERSION_STR
from qtpy.QtCore import (
PYQT_VERSION_STR, QFile, QIODevice, Qt, QThread, Signal, Slot)
from qtpy.QtWidgets import (
QApplication, QDockWidget, QGridLayout, QGroupBox, QHBoxLayout, QLabel,
QMainWindow, QMessageBox, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QTabWidget, QTableWidget, QTableWidgetItem, QVBoxLayout,
QWidget)
from apps4ops.bdbase.base import BaseWindow
from apps4ops.bdbase.enumkind import MsgSeverity, UserMode, Facility
from apps4ops.bdbase.helpbrowser import HelpBrowser
from apps4ops.hipa.sendeloghipa import QSendToELOG
from apps4ops.hipa.enumkind import ElogHIPA
from src.gui import AppGui
from pyrcc5 import hush_resources
_pymodule = os.path.basename(__file__)
_appname, _appext = _pymodule.split(".")
_appversion = "1.0.0"
#_title = """HIPA Power Usage & Saving Hierarchy""" #, HUSH!"""
_title = """HUSH!"""
def _line():
"""Macro to return the current line number.
The current line number within the file is used when
reporting messages to the message logging window.
Returns:
int: Current line number.
"""
return inspect.currentframe().f_back.f_lineno
class StartMain(BaseWindow):
trigger_log_message = Signal(str, str, int, str, dict)
def __init__(self, parent=None):
super(StartMain, self).__init__(
parent=parent, pymodule=_pymodule, appversion=_appversion,
title=_title, user_mode=UserMode.OPERATION, facility=Facility.HIPA,
has_optics=False, has_procedure=False)
self.appname = _appname
self.gui = AppGui(self)
@Slot()
def send_to_elog(self):
@Slot()
def save_fig_thread_finished():
time.sleep(0.2)
if self.all_data:
QSendToELOG(self, logbook=self.logbook,
projektIdx=self.projekt_idx,
eintragIdx=self.eintrag_idx,
systemIdx=self.system_idx,
statusIdx=self.status_idx,
ordIdx=self.ort_idx,
effektIdx=self.effekt_idx,
title=self.title,
message=self.message,
attachFile=self.attach_files)
time.sleep(1.0)
return
#if not self.verify_send_to_elog():
# return
elog = ElogHIPA()
self.projekt_idx = elog.projekt.NONE
self.system_idx = elog.system.MAGNET_POWER_SUPPLIES
self.eintrag_idx = elog.eintrag.INFO
self.ort_idx = elog.ort.GLOBAL
self.status_idx = elog.status.NONE
self.effekt_idx = elog.effekt.NO
self.attach_files = []
_simulation = self.input_parameters['simulation']
if self.all_data:
if self.all_data['Input data'] is not None:
try:
_simulation = self.all_data['Input data']['simulation']
except KeyError:
_simulation = self.input_parameters['simulation']
pass
self.logbook = "Sandkasten" if _simulation else None
self.title = _title
sector = ["<br>IP2: ","<br>IW2: ","<br>PK1: ", "<br>PK2: ","<br>SNQ: ",
"<br>UCN: ","<br>------------------<br>Tot: "]
pvlist = ['SEC-IP2:TOTSAVE', 'SEC-IW2:TOTSAVE', 'SEC-PK1:TOTSAVE',
'SEC-PK2:TOTSAVE', 'SEC-SINQ:TOTSAVE', 'SEC-UCN:TOTSAVE',
'HUSH:TOTSAVE']
value, stat, stat_list =self.cafe.getScalarList(pvlist, cacheFlag=True)
message = "Power saved for the current year stands at {:.3f} MWh:".format(
value[-1])
for label, val in zip(sector, value):
message += label + "{:.3f}".format(val) + " MWh"
'''
message += "IP2: " + str(value[0])+ " MWh <br>"
message += "IW2: " + str(value[1])+ " MWh <br>"
message += "PK1: " + str(value[2])+ " MWh <br>"
message += "PK2: " + str(value[3])+ " MWh <br>"
message += "SNQ: " + str(value[4])+ " MWh <br>"
message += "UCN: " + str(value[5])+ " MWh <br>"
message += "Tot: " + str(value[6])+ " MWh"
'''
self.message = message
print(self.message, flush=True)
if not self.all_data:
QSendToELOG(self, logbook=self.logbook,
projektIdx=self.projekt_idx,
eintragIdx=self.eintrag_idx,
systemIdx=self.system_idx,
statusIdx=self.status_idx,
ortIdx=self.ort_idx,
effektIdx=self.effekt_idx,
title=self.title,
message=self.message,
attachFile=self.attach_files)
return
_folder_name = self.elog_dest
if not os.path.exists(_folder_name):
os.makedirs(_folder_name)
time_in_seconds = self.all_data['Ambient data']['Time in seconds']
if self.all_data['Processed data']['Reanalysis time']:
reanalysis_time = self.all_data['Processed data'][
'Reanalysis time in seconds']
else:
reanalysis_time = None
self.folder_name = _folder_name
save_fig_thread = self.SaveFigureThread(
self, self.folder_name, time_in_seconds, reanalysis_time)
save_fig_thread.finished.connect(save_fig_thread_finished)
save_fig_thread.start()
time.sleep(0.05)
@Slot()
def closeEvent(self, event):
if not self.verify_close_event():
event.ignore()
return
BaseWindow.closeEvent(self, event)
@Slot()
def show_about(self):
""" To overide by application
"""
QApplication.processEvents()
QMessageBox.about(
self, "About",
"""<b>{0}</b> v {1}
<p>Copyright &copy; Paul Scherrer Institut (PSI).
All rights reserved.</p>
<p>Author: J. Chrin, Spring 2023 </p>
<p>(EPICS db adapted from A. Kovach, 2016) <p>
<p>IOC Administrator: H. Lutz </p>
<p>1st Responsible: A. Barchetti, Tel. 4779
or 3301 (Control Room) </p>
<p>Initiates energy saving procedures and records power saved</p>
<p>Python {2} - Qt {3} - PyQt {4} <br>
cafe {5} - epics {6} on {7}""".format(
_pymodule, _appversion, platform.python_version(),
QT_VERSION_STR, PYQT_VERSION_STR,
self.cafe.CAFE_version(), self.cafe.EPICS_version(),
platform.system()))
QApplication.processEvents()
@Slot()
def show_help(self):
""" Invoke help pages from hush_resources
"""
index_html ="index.html" #self.appname + "/index.html"
help_base = ":" # + self.appname
help_page = HelpBrowser(help_base, index_html, self)
help_page.show()
#########################################################################
if __name__ == "__main__":
app = QApplication(sys.argv)
splash = BaseWindow.initialize_application(
app, appname=_appname, delay=20, facility=Facility.HIPA)
myapp = StartMain()
myapp.show()
if splash is not None:
splash.finish(myapp)
app.exec_()

213
hush.py~ Normal file
View File

@@ -0,0 +1,213 @@
import inspect
import logging
import os
import platform
import random
import sys
import time
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor, QFont, QIcon
from qtpy.QtCore import __version__ as QT_VERSION_STR
from qtpy.QtCore import (
PYQT_VERSION_STR, QFile, QIODevice, Qt, QThread, Signal, Slot)
from qtpy.QtWidgets import (
QApplication, QDockWidget, QGridLayout, QGroupBox, QHBoxLayout, QLabel,
QMainWindow, QMessageBox, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QTabWidget, QTableWidget, QTableWidgetItem, QVBoxLayout,
QWidget)
from apps4ops.bdbase.base import BaseWindow
from apps4ops.bdbase.enumkind import MsgSeverity, UserMode, Facility
from apps4ops.bdbase.helpbrowser import HelpBrowser
from apps4ops.hipa.sendeloghipa import QSendToELOG
from apps4ops.hipa.enumkind import ElogHIPA
from src.gui import AppGui
from pyrcc5 import hush_resources
_pymodule = os.path.basename(__file__)
_appname, _appext = _pymodule.split(".")
_appversion = "1.0.0"
_title = """HIPA Power Usage and Saving Hierarchy, HUSH!"""
def _line():
"""Macro to return the current line number.
The current line number within the file is used when
reporting messages to the message logging window.
Returns:
int: Current line number.
"""
return inspect.currentframe().f_back.f_lineno
class StartMain(BaseWindow):
trigger_log_message = Signal(str, str, int, str, dict)
def __init__(self, parent=None):
super(StartMain, self).__init__(
parent=parent, pymodule=_pymodule, appversion=_appversion,
title=_title, user_mode=UserMode.OPERATION, facility=Facility.HIPA,
has_optics=False, has_procedure=False)
self.appname = _appname
self.gui = AppGui(self)
@Slot()
def send_to_elog(self):
@Slot()
def save_fig_thread_finished():
time.sleep(0.2)
if self.all_data:
QSendToELOG(self, logbook=self.logbook,
projektIdx=self.projekt_idx,
eintragIdx=self.eintrag_idx,
systemIdx=self.system_idx,
statusIdx=self.status_idx,
autoIdx=self.auto_idx,
title=self.title,
message=self.message,
attachFile=self.attach_files)
time.sleep(1.0)
return
if not self.verify_send_to_elog():
return
elog = ElogHIPA()
self.projekt_idx = elog.projekt.OPTICS
self.system_idx = elog.system.BEAMDYNAMICS
self.eintrag_idx = elog.eintrag.INFO
self.auto_idx = elog.auto.NO
self.status_idx = elog.status.NONE
self.attach_files = []
_simulation = self.input_parameters['simulation']
if self.all_data:
if self.all_data['Input data'] is not None:
try:
_simulation = self.all_data['Input data']['simulation']
except KeyError:
_simulation = self.input_parameters['simulation']
pass
self.logbook = "Sandkasten" if _simulation else None
self.title = _title
if not self.all_data:
QSendToELOG(self, logbook=self.logbook,
projektIdx=self.projekt_idx,
eintragIdx=self.eintrag_idx,
systemIdx=self.system_idx,
statusIdx=self.status_idx,
autoIdx=self.auto_idx,
title=self.title,
attachFile=self.attach_files)
return
message = ""
_folder_name = self.elog_dest
if not os.path.exists(_folder_name):
os.makedirs(_folder_name)
time_in_seconds = self.all_data['Ambient data']['Time in seconds']
if self.all_data['Processed data']['Reanalysis time']:
reanalysis_time = self.all_data['Processed data'][
'Reanalysis time in seconds']
else:
reanalysis_time = None
self.message = message
print(message, flush=True)
self.folder_name = _folder_name
save_fig_thread = self.SaveFigureThread(
self, self.folder_name, time_in_seconds, reanalysis_time)
save_fig_thread.finished.connect(save_fig_thread_finished)
save_fig_thread.start()
time.sleep(0.05)
@Slot()
def closeEvent(self, event):
if not self.verify_close_event():
event.ignore()
return
BaseWindow.closeEvent(self, event)
@Slot()
def show_about(self):
""" To overide by application
"""
QApplication.processEvents()
QMessageBox.about(
self, "About",
"""<b>{0}</b> v {1}
<p>Copyright &copy; Paul Scherrer Institut (PSI).
All rights reserved.</p>
<p>Author: J. Chrin, Spring 2023 </p>
<p>(EPICS db adapted from A. Kovach, 2016) <p>
<p>IOC Administrator: H. Lutz </p>
<p>1st Responsible: A. Barchetti, Tel. 4779
or 3301 (Control Room) </p>
<p>Initiates energy saving procedures and records power saved</p>
<p>Python {2} - Qt {3} - PyQt {4} <br>
cafe {5} - epics {6} on {7}""".format(
_pymodule, _appversion, platform.python_version(),
QT_VERSION_STR, PYQT_VERSION_STR,
self.cafe.CAFE_version(), self.cafe.EPICS_version(),
platform.system()))
QApplication.processEvents()
@Slot()
def show_help(self):
""" Invoke help pages from hush_resources
"""
index_html ="index.html" #self.appname + "/index.html"
help_base = ":" # + self.appname
help_page = HelpBrowser(help_base, index_html, self)
help_page.show()
#########################################################################
if __name__ == "__main__":
app = QApplication(sys.argv)
splash = BaseWindow.initialize_application(
app, appname=_appname, delay=20, facility=Facility.HIPA)
myapp = StartMain()
myapp.show()
if splash is not None:
splash.finish(myapp)
app.exec_()

100
hush.sh Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/bash
cd /afs/psi.ch/project/pyqtacc/apps4ops/examples/hush/1.0.0
# For use if script is sourced rather than executed
appNameDefault="hush.sh"
module unload gcc
module load gcc/7.3.0
if [ -z "$PS1" ] # no prompt?
### if [ -v PS1 ] # On Bash 4.2+ ...
then
# non-interactive
echo "Non-interactive script"
else
# interactive
echo "Interactive/sourced script"
fi
# Select Python Version here. Currently one of 3.5, 3.7
PYTHON_VERSION=3.7
if [ "$1" ]; then
if [ "$1" == "3.5" -o "$1" == "35" ]; then
echo "Using default version $PYTHON_VERSION"
elif [ "$1" == "3.7" -o "$1" == "37" ]; then
PYTHON_VERSION=3.7
else
echo "Requested Python version is not supported"
echo "Using default version $PYTHON_VERSION"
fi
fi
echo "PYTHON_VERSION $PYTHON_VERSION"
_EPICS_HOST_ARCH=${EPICS_HOST_ARCH}
. /opt/gfa/python $PYTHON_VERSION
#/sf/bd/applications/OnlineModel/current/PythonModule:/sf/bd/applications/OnlineModel/current
#/sf/bd/applications/OnlineModel/default/scripts/VA:
#C_EXT version for Py 3.7:
export PYTHONPATH=.:/opt/gfa/cafe/python/pycafe/cafe-1.18.0/lib/${_EPICS_HOST_ARCH}:/afs/psi.ch/project/cafe/gitlab/CAFE:/afs/psi.ch/project/pyqtacc
#:/afs/psi.ch/intranet/SLS/Controls/BD/pyqtacc/v1.5.2
echo $PYTHONPATH
STDOUT_DIR="/tmp"
#Set to 0 if you do not wish std::out to write to logger
STDOUT_FLAG=1
if [ "$#" -gt "0" ]; then
appName=$0
if [ "$appName" == "-bash" ]; then
appName=$appNameDefault
fi
else
appName=$appNameDefault
fi
#echo "$appName $@ $#"
baseName="${appName##*/}"
name=$(echo "$baseName" | cut -f 1 -d '.')
nameLog=${name}-$USER
echo "Application: $name"
echo "nameLog: $nameLog"
#Configuration files can be overwritten
#python ${name}.py -s="/sf/bd/deps/pyqtacc/common/config/style.json" -f="/sf/bd/deps/pyqtacc/v1.0.0/pyqtacc/qrc_resources/facility/sf/config/base.json" -q="/sf/bd/deps/pyqtacc/common/config/acc.qss" &
if [ "${STDOUT_FLAG}" -gt "0" ] ; then
#if changing the std::out destination, remember to also change it in your json config file (for reading)
if test -f "$STDOUT_DIR/${nameLog}.log---"; then
rm -f $STDOUT_DIR/${nameLog}.log---
fi
if test -f "$STDOUT_DIR/${nameLog}.log--"; then
cp $STDOUT_DIR/${nameLog}.log-- $STDOUT_DIR/${nameLog}.log---
rm -f $STDOUT_DIR/${nameLog}.log--
fi
if test -f "$STDOUT_DIR/${nameLog}.log-"; then
cp $STDOUT_DIR/${nameLog}.log- $STDOUT_DIR/${nameLog}.log--
rm -f $STDOUT_DIR/${nameLog}.log-
fi
if test -f "$STDOUT_DIR/${nameLog}.log"; then
cp $STDOUT_DIR/${nameLog}.log $STDOUT_DIR/${nameLog}.log-
rm -f $STDOUT_DIR/${nameLog}.log
fi
python ${name}.py -u ${name}.json >> $STDOUT_DIR/${nameLog}.log 2>&1 &
chmod 777 $STDOUT_DIR/${nameLog}.log
else
#Run instead without std::out
python ${name}.py -u ${name}.json &
fi

98
hush.sh~ Executable file
View File

@@ -0,0 +1,98 @@
#!/bin/bash
cd /afs/psi.ch/project/pyqtacc/apps4ops/examples/hush/1.0.0
# For use if script is sourced rather than executed
appNameDefault="hush.sh"
module unload gcc
module load gcc/7.3.0
if [ -z "$PS1" ] # no prompt?
### if [ -v PS1 ] # On Bash 4.2+ ...
then
# non-interactive
echo "Non-interactive script"
else
# interactive
echo "Interactive/sourced script"
fi
# Select Python Version here. Currently one of 3.5, 3.7
PYTHON_VERSION=3.7
if [ "$1" ]; then
if [ "$1" == "3.5" -o "$1" == "35" ]; then
echo "Using default version $PYTHON_VERSION"
elif [ "$1" == "3.7" -o "$1" == "37" ]; then
PYTHON_VERSION=3.7
else
echo "Requested Python version is not supported"
echo "Using default version $PYTHON_VERSION"
fi
fi
echo "PYTHON_VERSION $PYTHON_VERSION"
_EPICS_HOST_ARCH=${EPICS_HOST_ARCH}
. /opt/gfa/python $PYTHON_VERSION
#/sf/bd/applications/OnlineModel/current/PythonModule:/sf/bd/applications/OnlineModel/current
#/sf/bd/applications/OnlineModel/default/scripts/VA:
#C_EXT version for Py 3.7:
export PYTHONPATH=.:/opt/gfa/cafe/python/pycafe/cafe-1.18.0/lib/${_EPICS_HOST_ARCH}:/afs/psi.ch/project/pyqtacc:/afs/psi.ch/intranet/SLS/Controls/BD/pyqtacc/v1.5.2
echo $PYTHONPATH
STDOUT_DIR="/tmp"
#Set to 0 if you do not wish std::out to write to logger
STDOUT_FLAG=1
if [ "$#" -gt "0" ]; then
appName=$0
if [ "$appName" == "-bash" ]; then
appName=$appNameDefault
fi
else
appName=$appNameDefault
fi
#echo "$appName $@ $#"
baseName="${appName##*/}"
name=$(echo "$baseName" | cut -f 1 -d '.')
nameLog=${name}-$USER
echo "Application: $name"
echo "nameLog: $nameLog"
#Configuration files can be overwritten
#python ${name}.py -s="/sf/bd/deps/pyqtacc/common/config/style.json" -f="/sf/bd/deps/pyqtacc/v1.0.0/pyqtacc/qrc_resources/facility/sf/config/base.json" -q="/sf/bd/deps/pyqtacc/common/config/acc.qss" &
if [ "${STDOUT_FLAG}" -gt "0" ] ; then
#if changing the std::out destination, remember to also change it in your json config file (for reading)
if test -f "$STDOUT_DIR/${nameLog}.log---"; then
rm -f $STDOUT_DIR/${nameLog}.log---
fi
if test -f "$STDOUT_DIR/${nameLog}.log--"; then
cp $STDOUT_DIR/${nameLog}.log-- $STDOUT_DIR/${nameLog}.log---
rm -f $STDOUT_DIR/${nameLog}.log--
fi
if test -f "$STDOUT_DIR/${nameLog}.log-"; then
cp $STDOUT_DIR/${nameLog}.log- $STDOUT_DIR/${nameLog}.log--
rm -f $STDOUT_DIR/${nameLog}.log-
fi
if test -f "$STDOUT_DIR/${nameLog}.log"; then
cp $STDOUT_DIR/${nameLog}.log $STDOUT_DIR/${nameLog}.log-
rm -f $STDOUT_DIR/${nameLog}.log
fi
python ${name}.py -u ${name}.json >> $STDOUT_DIR/${nameLog}.log 2>&1 &
chmod 777 $STDOUT_DIR/${nameLog}.log
else
#Run instead without std::out
python ${name}.py -u ${name}.json &
fi

Binary file not shown.

196
pyrcc5/hush_resources.py Normal file
View File

@@ -0,0 +1,196 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x32\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x33\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x31\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x32\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x34\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x35\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x33\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x34\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x03\x13\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x48\x49\x50\x41\x20\x50\x6f\x77\x65\x72\x20\x55\x73\x61\
\x67\x65\x20\x61\x6e\x64\x20\x53\x61\x76\x69\x6e\x67\x20\x48\x69\
\x67\x68\x6c\x69\x67\x68\x74\x73\x2c\x20\x48\x55\x53\x48\x21\x3c\
\x2f\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\
\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x68\x35\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x67\x72\x61\x79\x3b\x22\x3e\
\x53\x70\x72\x69\x6e\x67\x20\x32\x30\x32\x33\x2c\x20\x4a\x61\x6e\
\x20\x43\x68\x72\x69\x6e\x20\x61\x6e\x64\x20\x2e\x2e\x2e\x3c\x2f\
\x68\x35\x3e\x0a\x3c\x68\x34\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x49\x50\x41\x20\x3c\
\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x20\x67\x72\x61\x79\x3b\x22\x3e\x50\x6f\x77\x65\x72\x3c\
\x2f\x73\x70\x61\x6e\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x55\x3c\x2f\x73\x70\x61\x6e\x3e\x73\x61\x67\x65\x20\x61\x6e\
\x64\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\
\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x53\x3c\x2f\x73\
\x70\x61\x6e\x3e\x61\x76\x69\x6e\x67\x20\x3c\x73\x70\x61\x6e\x20\
\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\
\x64\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x69\x67\x68\x6c\
\x69\x67\x68\x74\x73\x2c\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x48\x55\x53\x48\x21\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x2f\x68\
\x34\x3e\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\
\x6c\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x41\x62\x6f\x75\x74\
\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x69\x73\x20\x3c\
\x62\x3e\x68\x75\x73\x68\x3c\x2f\x62\x3e\x20\x61\x70\x70\x6c\x69\
\x63\x61\x74\x69\x6f\x6e\x20\x69\x6e\x68\x65\x72\x69\x74\x73\x20\
\x66\x72\x6f\x6d\x20\x74\x68\x65\x20\x57\x69\x6e\x64\x6f\x77\x20\
\x62\x61\x73\x65\x20\x63\x6c\x61\x73\x73\x2e\x3c\x62\x72\x3e\x20\
\x20\x0a\x3c\x70\x3e\x69\x6e\x66\x6f\x72\x6d\x61\x74\x69\x6f\x6e\
\x20\x63\x6f\x6e\x63\x65\x72\x6e\x69\x6e\x67\x20\x74\x68\x69\x73\
\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x73\x75\
\x63\x68\x20\x61\x73\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\
\x69\x6f\x6e\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x6f\
\x72\x20\x6f\x74\x68\x65\x72\x2c\x20\x6d\x61\x79\x20\x62\x65\x20\
\x65\x6e\x74\x65\x72\x65\x64\x2c\x20\x65\x2e\x67\x2e\x2c\x20\x3c\
\x61\x20\x68\x72\x65\x66\x3d\x22\x70\x61\x67\x65\x31\x2e\x68\x74\
\x6d\x6c\x22\x3e\x68\x65\x72\x65\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\
\x0a\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\
\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x54\x68\x65\x20\x50\x61\
\x6e\x65\x6c\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x65\
\x73\x65\x20\x77\x65\x62\x20\x70\x61\x67\x65\x73\x20\x61\x72\x65\
\x20\x74\x6f\x20\x62\x65\x20\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\
\x20\x62\x79\x20\x74\x68\x65\x20\x61\x70\x70\x6c\x69\x63\x61\x74\
\x69\x6f\x6e\x20\x6f\x77\x6e\x65\x72\x2e\x3c\x62\x72\x3e\x0a\x0a\
\x0a\x0a\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\
\x3e\x0a\
\x00\x00\x00\x80\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x35\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x65\x74\x63\x2e\x2e\x2e\
\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x70\x3e\x0a\
\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x08\x5a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x32\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x4a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x31\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x7a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x34\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x6a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x33\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x0c\xba\xf2\x7c\
\x00\x69\
\x00\x6e\x00\x64\x00\x65\x00\x78\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x8a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x35\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xc3\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xc3\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
\x00\x00\x01\x87\x70\x5b\x10\xc8\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

196
pyrcc5/hush_resources.py- Normal file
View File

@@ -0,0 +1,196 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x00\x80\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x35\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x65\x74\x63\x2e\x2e\x2e\
\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x70\x3e\x0a\
\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x34\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x35\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x03\x13\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x48\x49\x50\x41\x20\x50\x6f\x77\x65\x72\x20\x55\x73\x61\
\x67\x65\x20\x61\x6e\x64\x20\x53\x61\x76\x69\x6e\x67\x20\x48\x69\
\x67\x68\x6c\x69\x67\x68\x74\x73\x2c\x20\x48\x55\x53\x48\x21\x3c\
\x2f\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\
\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x68\x35\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x67\x72\x61\x79\x3b\x22\x3e\
\x53\x70\x72\x69\x6e\x67\x20\x32\x30\x32\x33\x2c\x20\x4a\x61\x6e\
\x20\x43\x68\x72\x69\x6e\x20\x61\x6e\x64\x20\x2e\x2e\x2e\x3c\x2f\
\x68\x35\x3e\x0a\x3c\x68\x34\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x49\x50\x41\x20\x3c\
\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x20\x67\x72\x61\x79\x3b\x22\x3e\x50\x6f\x77\x65\x72\x3c\
\x2f\x73\x70\x61\x6e\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x55\x3c\x2f\x73\x70\x61\x6e\x3e\x73\x61\x67\x65\x20\x61\x6e\
\x64\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\
\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x53\x3c\x2f\x73\
\x70\x61\x6e\x3e\x61\x76\x69\x6e\x67\x20\x3c\x73\x70\x61\x6e\x20\
\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\
\x64\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x69\x67\x68\x6c\
\x69\x67\x68\x74\x73\x2c\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\
\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\
\x3e\x48\x55\x53\x48\x21\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x2f\x68\
\x34\x3e\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\
\x6c\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x41\x62\x6f\x75\x74\
\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x69\x73\x20\x3c\
\x62\x3e\x68\x75\x73\x68\x3c\x2f\x62\x3e\x20\x61\x70\x70\x6c\x69\
\x63\x61\x74\x69\x6f\x6e\x20\x69\x6e\x68\x65\x72\x69\x74\x73\x20\
\x66\x72\x6f\x6d\x20\x74\x68\x65\x20\x57\x69\x6e\x64\x6f\x77\x20\
\x62\x61\x73\x65\x20\x63\x6c\x61\x73\x73\x2e\x3c\x62\x72\x3e\x20\
\x20\x0a\x3c\x70\x3e\x69\x6e\x66\x6f\x72\x6d\x61\x74\x69\x6f\x6e\
\x20\x63\x6f\x6e\x63\x65\x72\x6e\x69\x6e\x67\x20\x74\x68\x69\x73\
\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x73\x75\
\x63\x68\x20\x61\x73\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\
\x69\x6f\x6e\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x6f\
\x72\x20\x6f\x74\x68\x65\x72\x2c\x20\x6d\x61\x79\x20\x62\x65\x20\
\x65\x6e\x74\x65\x72\x65\x64\x2c\x20\x65\x2e\x67\x2e\x2c\x20\x3c\
\x61\x20\x68\x72\x65\x66\x3d\x22\x70\x61\x67\x65\x31\x2e\x68\x74\
\x6d\x6c\x22\x3e\x68\x65\x72\x65\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\
\x0a\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\
\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x54\x68\x65\x20\x50\x61\
\x6e\x65\x6c\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x65\
\x73\x65\x20\x77\x65\x62\x20\x70\x61\x67\x65\x73\x20\x61\x72\x65\
\x20\x74\x6f\x20\x62\x65\x20\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\
\x20\x62\x79\x20\x74\x68\x65\x20\x61\x70\x70\x6c\x69\x63\x61\x74\
\x69\x6f\x6e\x20\x6f\x77\x6e\x65\x72\x2e\x3c\x62\x72\x3e\x0a\x0a\
\x0a\x0a\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\
\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x31\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x32\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x33\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x34\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x32\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x33\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x08\x8a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x35\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x7a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x34\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x0c\xba\xf2\x7c\
\x00\x69\
\x00\x6e\x00\x64\x00\x65\x00\x78\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x4a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x31\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x6a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x33\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x5a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x32\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x04\x46\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\x9c\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x04\xf1\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x84\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x2f\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x04\x46\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\x9c\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x04\xf1\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x84\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x2f\
\x00\x00\x01\x87\x70\x5b\x10\xc8\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

196
pyrcc5/hush_resources.py-- Normal file
View File

@@ -0,0 +1,196 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x00\x80\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x35\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x65\x74\x63\x2e\x2e\x2e\
\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x70\x3e\x0a\
\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x33\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x34\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x31\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x32\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x03\x12\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x48\x49\x50\x41\x20\x50\x6f\x77\x65\x72\x20\x55\x73\x61\
\x67\x65\x20\x61\x6e\x64\x20\x53\x61\x76\x69\x6e\x67\x20\x48\x69\
\x67\x68\x6c\x69\x67\x68\x74\x73\x2c\x20\x48\x55\x53\x48\x21\x3c\
\x2f\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\
\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x68\x35\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x67\x72\x61\x79\x3b\x22\x3e\
\x53\x70\x72\x69\x6e\x67\x20\x32\x30\x32\x33\x2c\x20\x4a\x61\x6e\
\x20\x43\x68\x72\x69\x6e\x20\x61\x6e\x64\x20\x2e\x2e\x2e\x3c\x2f\
\x68\x35\x3e\x0a\x3c\x68\x34\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x49\x50\x41\x20\x3c\
\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x20\x67\x72\x61\x79\x3b\x22\x3e\x50\x6f\x77\x65\x72\x3c\
\x2f\x73\x70\x61\x6e\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\
\x55\x3c\x2f\x73\x70\x61\x6e\x3e\x73\x61\x67\x65\x20\x61\x6e\x64\
\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\
\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x53\x3c\x2f\x73\x70\
\x61\x6e\x3e\x61\x76\x69\x6e\x67\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x69\x67\x68\x6c\x69\
\x67\x68\x74\x73\x2c\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\
\x48\x55\x53\x48\x21\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x2f\x68\x34\
\x3e\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\
\x6f\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x41\x62\x6f\x75\x74\x3c\
\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x69\x73\x20\x3c\x62\
\x3e\x68\x75\x73\x68\x3c\x2f\x62\x3e\x20\x61\x70\x70\x6c\x69\x63\
\x61\x74\x69\x6f\x6e\x20\x69\x6e\x68\x65\x72\x69\x74\x73\x20\x66\
\x72\x6f\x6d\x20\x74\x68\x65\x20\x57\x69\x6e\x64\x6f\x77\x20\x62\
\x61\x73\x65\x20\x63\x6c\x61\x73\x73\x2e\x3c\x62\x72\x3e\x20\x20\
\x0a\x3c\x70\x3e\x69\x6e\x66\x6f\x72\x6d\x61\x74\x69\x6f\x6e\x20\
\x63\x6f\x6e\x63\x65\x72\x6e\x69\x6e\x67\x20\x74\x68\x69\x73\x20\
\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x73\x75\x63\
\x68\x20\x61\x73\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\
\x6f\x6e\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x6f\x72\
\x20\x6f\x74\x68\x65\x72\x2c\x20\x6d\x61\x79\x20\x62\x65\x20\x65\
\x6e\x74\x65\x72\x65\x64\x2c\x20\x65\x2e\x67\x2e\x2c\x20\x3c\x61\
\x20\x68\x72\x65\x66\x3d\x22\x70\x61\x67\x65\x31\x2e\x68\x74\x6d\
\x6c\x22\x3e\x68\x65\x72\x65\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\
\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x54\x68\x65\x20\x50\x61\x6e\
\x65\x6c\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x65\x73\
\x65\x20\x77\x65\x62\x20\x70\x61\x67\x65\x73\x20\x61\x72\x65\x20\
\x74\x6f\x20\x62\x65\x20\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x20\
\x62\x79\x20\x74\x68\x65\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\
\x6f\x6e\x20\x6f\x77\x6e\x65\x72\x2e\x3c\x62\x72\x3e\x0a\x0a\x0a\
\x0a\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\
\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x34\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x35\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x32\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x33\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x08\x8a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x35\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x6a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x33\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x4a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x31\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x0c\xba\xf2\x7c\
\x00\x69\
\x00\x6e\x00\x64\x00\x65\x00\x78\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x7a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x34\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x5a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x32\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x2f\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\x9b\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x84\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x04\xf0\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x01\xda\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x2f\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\x9b\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\x84\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x04\xf0\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x01\xda\
\x00\x00\x01\x87\x70\x59\x43\xd8\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

194
pyrcc5/hush_resources.py--- Normal file
View File

@@ -0,0 +1,194 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x33\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x34\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x34\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x35\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x32\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x33\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x00\xa7\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x31\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x3c\x70\x3e\x20\x20\x3c\x61\x20\x68\x72\x65\x66\x3d\
\x22\x70\x61\x67\x65\x32\x2e\x68\x74\x6d\x6c\x22\x3e\x20\x4e\x65\
\x78\x74\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x3c\x70\x3e\x3c\x62\
\x3e\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\
\x2e\x2e\x3c\x2f\x70\x3e\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\
\x68\x74\x6d\x6c\x3e\x0a\
\x00\x00\x02\xf1\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x48\x49\x50\x41\x20\x50\x6f\x77\x65\x72\x20\x55\x73\x61\
\x67\x65\x20\x61\x6e\x64\x20\x53\x61\x76\x69\x6e\x67\x20\x48\x69\
\x67\x68\x6c\x69\x67\x68\x74\x73\x2c\x20\x48\x55\x53\x48\x21\x3c\
\x2f\x74\x69\x74\x6c\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\
\x62\x6f\x64\x79\x3e\x0a\x0a\x3c\x68\x35\x20\x20\x73\x74\x79\x6c\
\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x67\x72\x61\x79\x3b\x22\x3e\
\x53\x70\x72\x69\x6e\x67\x20\x32\x30\x32\x33\x2c\x20\x4a\x61\x6e\
\x20\x43\x68\x72\x69\x6e\x20\x61\x6e\x64\x20\x2e\x2e\x2e\x3c\x2f\
\x68\x35\x3e\x0a\x3c\x68\x34\x3e\x20\x3c\x73\x70\x61\x6e\x20\x73\
\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\
\x3b\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x49\x50\x41\x20\x50\
\x6f\x77\x65\x72\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x55\
\x3c\x2f\x73\x70\x61\x6e\x3e\x73\x61\x67\x65\x20\x61\x6e\x64\x20\
\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\
\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x53\x3c\x2f\x73\x70\x61\
\x6e\x3e\x61\x76\x69\x6e\x67\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\
\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\
\x22\x3e\x48\x3c\x2f\x73\x70\x61\x6e\x3e\x69\x67\x68\x6c\x69\x67\
\x68\x74\x73\x2c\x20\x3c\x73\x70\x61\x6e\x20\x73\x74\x79\x6c\x65\
\x3d\x22\x63\x6f\x6c\x6f\x72\x3a\x20\x72\x65\x64\x3b\x22\x3e\x48\
\x55\x53\x48\x21\x3c\x2f\x73\x70\x61\x6e\x3e\x3c\x2f\x68\x34\x3e\
\x0a\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\
\x72\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x41\x62\x6f\x75\x74\x3c\x2f\
\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x69\x73\x20\x3c\x62\x3e\
\x68\x75\x73\x68\x3c\x2f\x62\x3e\x20\x61\x70\x70\x6c\x69\x63\x61\
\x74\x69\x6f\x6e\x20\x69\x6e\x68\x65\x72\x69\x74\x73\x20\x66\x72\
\x6f\x6d\x20\x74\x68\x65\x20\x57\x69\x6e\x64\x6f\x77\x20\x62\x61\
\x73\x65\x20\x63\x6c\x61\x73\x73\x2e\x3c\x62\x72\x3e\x20\x20\x0a\
\x3c\x70\x3e\x69\x6e\x66\x6f\x72\x6d\x61\x74\x69\x6f\x6e\x20\x63\
\x6f\x6e\x63\x65\x72\x6e\x69\x6e\x67\x20\x74\x68\x69\x73\x20\x61\
\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2c\x20\x73\x75\x63\x68\
\x20\x61\x73\x20\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\
\x6e\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x6f\x72\x20\
\x6f\x74\x68\x65\x72\x2c\x20\x6d\x61\x79\x20\x62\x65\x20\x65\x6e\
\x74\x65\x72\x65\x64\x2c\x20\x65\x2e\x67\x2e\x2c\x20\x3c\x61\x20\
\x68\x72\x65\x66\x3d\x22\x70\x61\x67\x65\x31\x2e\x68\x74\x6d\x6c\
\x22\x3e\x68\x65\x72\x65\x3c\x2f\x61\x3e\x3c\x2f\x70\x3e\x0a\x0a\
\x3c\x68\x32\x20\x73\x74\x79\x6c\x65\x3d\x22\x63\x6f\x6c\x6f\x72\
\x3a\x62\x6c\x75\x65\x3b\x22\x3e\x54\x68\x65\x20\x50\x61\x6e\x65\
\x6c\x3c\x2f\x68\x32\x3e\x0a\x0a\x3c\x70\x3e\x54\x68\x65\x73\x65\
\x20\x77\x65\x62\x20\x70\x61\x67\x65\x73\x20\x61\x72\x65\x20\x74\
\x6f\x20\x62\x65\x20\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x20\x62\
\x79\x20\x74\x68\x65\x20\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\
\x6e\x20\x6f\x77\x6e\x65\x72\x2e\x3c\x62\x72\x3e\x0a\x0a\x0a\x0a\
\x0a\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
\
\x00\x00\x00\x80\
\x3c\
\x68\x74\x6d\x6c\x3e\x3c\x68\x65\x61\x64\x3e\x3c\x74\x69\x74\x6c\
\x65\x3e\x57\x65\x62\x20\x48\x65\x6c\x70\x3c\x2f\x74\x69\x74\x6c\
\x65\x3e\x3c\x2f\x68\x65\x61\x64\x3e\x0a\x3c\x62\x6f\x64\x79\x3e\
\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x50\x61\x67\x65\x20\x35\x20\x6f\
\x66\x20\x77\x65\x62\x20\x68\x65\x6c\x70\x3c\x2f\x62\x3e\x3c\x2f\
\x70\x3e\x0a\x0a\x3c\x70\x3e\x3c\x62\x3e\x65\x74\x63\x2e\x2e\x2e\
\x3c\x2f\x62\x3e\x20\x65\x74\x63\x2e\x2e\x2e\x3c\x2f\x70\x3e\x0a\
\x3c\x2f\x62\x6f\x64\x79\x3e\x3c\x2f\x68\x74\x6d\x6c\x3e\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x08\x6a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x33\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x7a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x34\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x5a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x32\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x4a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x31\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x0c\xba\xf2\x7c\
\x00\x69\
\x00\x6e\x00\x64\x00\x65\x00\x78\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
\x00\x0a\
\x08\x8a\x34\x9c\
\x00\x70\
\x00\x61\x00\x67\x00\x65\x00\x35\x00\x2e\x00\x68\x00\x74\x00\x6d\x00\x6c\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xa1\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x02\x01\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x34\x00\x00\x00\x00\x00\x01\x00\x00\x01\x56\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x1a\x00\x00\x00\x00\x00\x01\x00\x00\x00\xab\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x82\x00\x00\x00\x00\x00\x01\x00\x00\x05\xa1\
\x00\x00\x01\x87\x70\x19\x8f\x40\
\x00\x00\x00\x68\x00\x00\x00\x00\x00\x01\x00\x00\x02\xac\
\x00\x00\x01\x87\x70\x54\x61\xd8\
"
qt_version = QtCore.qVersion().split('.')
if qt_version < ['5', '8', '0']:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

Binary file not shown.

705
src/gui.py Normal file
View File

@@ -0,0 +1,705 @@
import inspect
import os
import platform
import random
import sys
import time
from datetime import timedelta
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor, QFont, QIcon
from qtpy.QtCore import __version__ as QT_VERSION_STR
from qtpy.QtCore import (
PYQT_VERSION_STR, QDate, QDateTime, QEventLoop, Qt, Signal, Slot)
from qtpy.QtWidgets import (
QApplication, QDockWidget, QFrame, QGridLayout, QGroupBox, QHBoxLayout,
QLabel, QMainWindow, QMessageBox, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QStackedWidget, QTabBar, QTabWidget, QTableWidget,
QTableWidgetItem, QVBoxLayout, QWidget)
from apps4ops.bdbase.base import BaseWindow
from apps4ops.bdbase.enumkind import MsgSeverity, UserMode, Facility
from caqtwidgets.pvwidgets import CAQLabel, CAQLineEdit, CAQTableWidget, QHLine
_pymodule = os.path.basename(__file__)
def _line():
"""Macro to return the current line number.688
The current line number within the file is used when
reporting messages to the message logging window.
Returns:
int: Current line number.
"""
return inspect.currentframe().f_back.f_lineno
class AppGui(QWidget):
def __init__(self, parent):
super(AppGui, self).__init__()
self.parent = parent
self.cafe = self.parent.cafe
self.cyca = self.parent.cyca
self.gui_frame = self.parent.gui_frame
self.gui_header = self.parent.gui_header
self.font_gui = self.parent.gui_frame.font_gui
self.input_parameters = self.parent.input_parameters
self.input_labels = self.parent.input_labels
self.expert_parameters = self.parent.expert_parameters
self.gui_frame.expert_parameters_group.setFixedWidth(260)
self.gui_frame.operator_parameters_group.setFixedWidth(260)
#self.gui_frame.operator_parameters_group.setFixedHeight(260)
self.gui_frame.measurement_tab_wgt.setMinimumWidth(440)
self.gui_frame.measurement_tab_wgt.setFixedHeight(280)
#self.gui_frame.operator_wgt.setFixedHeight(240)
#self.gui_frame.expert_wgt.setFixedHeight(240)
self.gui_frame.central_tab_widget.tabBar().setTabText(0, "Control")
self.gui_frame.central_tab_widget.tabBar().setTabText(1, "Savings")
self.expert_labels = self.parent.expert_labels
self.settings = self.parent.settings
self.obj_to_upper = True if random.randint(1, 10) > 3 else False
self.table_sol_dict = {}
self.table_pwr_dict = {}
self.offtime_dict = {}
wgt = self.group_sector_qtabwidget()
self.gui_frame.measurement_layout.addWidget(
wgt, 0, 1, 6, 3, alignment=Qt.AlignTop)
status_wgt = self.group_sector_status()
self.gui_frame.measurement_layout.addWidget(
status_wgt, 2, 0, 2, 1, alignment=Qt.AlignTop) # | Qt.AlignHCenter)
qf = QFrame()
qf.setFixedHeight(6)
self.gui_frame.measurement_layout.addWidget(
qf, 4, 0, 1, 1, alignment=Qt.AlignTop)
self.sectorI_dict = {}
self.sectorI_dict['IP2'] = 0
self.sectorI_dict['IW2'] = 0
self.sectorI_dict['PK1'] = 0
self.sectorI_dict['PK2'] = 0
self.sectorI_dict['SINQ'] = 0
self.sectorI_dict['UCN'] = 0
self.I_min = 0.009
ucn_line = ["PK1", "PK2"]
sinq_line = ["PK1", "PK2"]
pk1_line = ["IW2"]
pk2_line = ["IW2"]
def enable_disable_end(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['UCN'] > self.I_min or self.sectorI_dict[
'SINQ'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def enable_disable_pk(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['PK1'] > self.I_min or self.sectorI_dict[
'PK2'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def receive_ucn_update(value, status, alarm_severity):
enable_disable_end('UCN', ucn_line, value)
def receive_sinq_update(value, status, alarm_severity):
enable_disable_end('SINQ', sinq_line, value)
def receive_pk1_update(value, status, alarm_severity):
enable_disable_pk('PK1', pk1_line, value)
def receive_pk2_update(value, status, alarm_severity):
enable_disable_pk('PK2', pk2_line, value)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_ucn_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_sinq_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk1_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk2_update)
#self.cafe.monitor("MWC2:IST:2", cb)
#print(dir(self.gui_header.header_wgt.layout().widget()), flush=True)
def group_sector_status(self):
qgrid = QGridLayout()
#Connect all channels
#Heading
idx = self.settings.data["header"].index("IP2")
#Sector
qlp = QLabel("Power \n(kW)")
f = qlp.font()
f.setPixelSize(13)
qlp.setFont(f)
qlp.setAlignment(Qt.AlignCenter)
qli = QLabel("Initial \n(kW)")
f = qli.font()
f.setPixelSize(13)
qli.setFont(f)
qli.setAlignment(Qt.AlignCenter)
qgrid.addWidget(qli, 0, 1, 1, 1)
qsa = QLabel("Saving \n(MWh)")
f = qsa.font()
f.setPixelSize(13)
qsa.setFont(f)
qsa.setAlignment(Qt.AlignCenter)
qti = QLabel("Time \nin Standby")
f = qti.font()
f.setPixelSize(13)
qti.setFont(f)
qti.setAlignment(Qt.AlignCenter)
qtotsav = QLabel("Tot Saved \n(MWh)")
f = qtotsav.font()
f.setPixelSize(13)
qtotsav.setFont(f)
qtotsav.setAlignment(Qt.AlignCenter)
qgrid.addWidget(qlp, 0, 2, 1, 1)
qgrid.addWidget(qsa, 0, 3, 1, 1)
qgrid.addWidget(qti, 0, 4, 1, 1)
qgrid.addWidget(qtotsav, 0, 5, 1, 1)
for i, sector in enumerate(self.settings.data["header"][idx:]):
a, b, c, d, e, f = self.sector_status(sector)
qgrid.addWidget(a, i+1, 0, 1, 1)
qgrid.addWidget(b, i+1, 1, 1, 1)
qgrid.addWidget(c, i+1, 2, 1, 1)
qgrid.addWidget(d, i+1, 3, 1, 1)
qgrid.addWidget(e, i+1, 4, 1, 1)
qgrid.addWidget(f, i+1, 5, 1, 1)
_line = QHLine()
_line.setFixedHeight(10)
_row = qgrid.rowCount()
qgrid.addWidget(_line, _row, 1, 1, 5)
#qgrid.setRowMinimumHeight(_row, 60)
qtot = QLabel("Total:")
f = qtot.font()
f.setPixelSize(13)
qtot.setFont(f)
qgrid.addWidget(qtot, _row+1, 0, 1, 1)
qgrid.addWidget(
CAQLineEdit(self, pv_name="HUSH:TOTPWR", show_units=True),
_row+1, 2, 1, 2)
qgrid.addWidget(
CAQLineEdit(self, pv_name="HUSH:TOTSAVE", show_units=False),
_row+1, 5, 1, 1)
qgrid.setContentsMargins(9, 20, 9, 9)
qw = QGroupBox("Savings Overview")
qw.setContentsMargins(9, 9, 9, 9)
qw.setObjectName("OUTER")
qw.setLayout(qgrid)
qw.setFixedWidth(490) #480
return qw
def sector_status(self, sector):
'''Create each sector line for inclusion into group
'''
device = "SEC-" + sector
#Qlabel
qsector = QLabel(sector+":")
f = qsector.font()
f.setPixelSize(13)
qsector.setFont(f)
_color = "black"
try:
_color = self.settings.data[sector]["color"]
except KeyError as ex:
print(ex, self.settings.data[sector])
_color_str = "color : {0};".format(_color)
_incolor = "QLabel {" + _color_str + "}"
qsector.setStyleSheet(_incolor)
#Savings
pv_pwr_tot = device + ":TOTPWR"
pv_pwr_last = device + ":LASTPWR"
pv_pwr_saved = device + ":LASTSAVE"
pv_pwr_timeout = device + ":OFFTIME"
pv_pwr_totsave = device + ":TOTSAVE"
self.cafe.openPrepare()
self.cafe.open([pv_pwr_tot, pv_pwr_last, pv_pwr_saved, pv_pwr_timeout])
self.cafe.openNowAndWait(2.0)
time.sleep(0.5)
#print("device", device, flush=True)
def cb_outtime(handle, pv, pvdata):
#print("cb", pv, handle, pvdata.value[0])
#_off = 6000000
_delta = "{}".format(str(timedelta(seconds=(pvdata.value[0]))))
if ", " in _delta:
_split = _delta.split(", ")
if len(_split[1]) == len("0:00:00"):
_delta = _split[0] + ", " + _split[1]
if 'days,' in _delta:
_delta = _delta.replace("days,", "d")
elif 'day,' in _delta:
_delta = _delta.replace("day,", "d")
try:
self.offtime_dict[pv].setText(_delta)
except KeyError:
pass
now = QDateTime.currentDateTime()
xdate = QDate(now.date().year(), 1, 15)
xstart = QDateTime(xdate)
#print("delta t ", xstart.secsTo(now))
#print("{}".format(str(timedelta(seconds=xstart.secsTo(now)))))
qpinit = CAQLineEdit(self, pv_name=pv_pwr_last, show_units=False)
qpnow = CAQLineEdit(self, pv_name=pv_pwr_tot, show_units=False)
qpsave = CAQLineEdit(self, pv_name=pv_pwr_saved, show_units=False)
qptotsave = CAQLineEdit(self, pv_name=pv_pwr_totsave, show_units=False)
qptime = CAQLineEdit(self, pv_name=pv_pwr_timeout,
monitor_callback=cb_outtime, show_units=True)
self.offtime_dict[pv_pwr_timeout] = qptime
qptime.setFixedWidth(104)
#qtdis = QBasicTimer()
#qpnow.setAlignment(Qt.AlignRight)
#qpnow.style().polish(qpnow)
return qsector, qpinit, qpnow, qpsave, qptime, qptotsave
def group_sector_qtabwidget(self):
idx_inj = self.settings.data["header"].index("INJ2")
idx = self.settings.data["header"].index("IP2")
#open all PVS
pv = []
for sector in self.settings.data["header"][idx_inj:]:
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
for att in attribute_list:
for dev in device_list:
pv.append(dev + ":" + att)
self.cafe.openPrepare()
self.cafe.open(pv)
self.cafe.openNowAndWait(1.0)
#self.cafe.supplementHandles()
sector_wgt_dict = {}
sector_wgt_dict["INJ2"] = self.ca_table_rf_widget(sector="INJ2")
for sector in self.settings.data["header"][idx:]:
sector_wgt_dict[sector] = self.ca_table_sector_widget(sector=sector)
sector_tab_widget = QTabWidget()
sector_tab_widget.setFont(self.font_gui)
sector_tab_widget.setStyleSheet("QTabBar {font-size: 12pt;}")
sector_tab_widget.tabBar().setShape(QTabBar.TriangularNorth)
for i, sector in enumerate(self.settings.data["header"][idx:]):
#if sector == "INJ2":
# _title = "RF"
#else:
# _title = sector
sector_tab_widget.addTab(sector_wgt_dict[sector], sector)
color = self.settings.data[sector]["color"]
sector_tab_widget.tabBar().setTabTextColor(i, QColor(color))
sector_tab_widget.addTab(sector_wgt_dict["INJ2"], "RF")
color = self.settings.data["INJ2"]["color"]
sector_tab_widget.tabBar().setTabTextColor(
len(self.settings.data["header"][idx:]), QColor(color))
return sector_tab_widget
def ca_table_rf_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
table_pwr = [None] * 2
table_pwr[0] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][0:4], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[0:4])
table_pwr[1] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][4:], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[4:])
for tab in table_pwr:
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_value.setFont(f)
header_value.setText('IST:2')
tab.setContentsMargins(15, 0, 15, 10)
tab.setHorizontalHeaderItem(0, header_item)
tab.setHorizontalHeaderItem(1, header_init)
tab.setHorizontalHeaderItem(2, header_value)
tab.setColumnWidth(0, 80)
tab.setColumnWidth(1, 88)
tab.setColumnWidth(2, 88)
tab.setFixedWidth(304)
# _table_height = 700
#tab.setFixedHeight(_table_height)
tab.restore_layout.removeWidget(tab.restore_value_button)
tab.restore_value_button.deleteLater()
tab.restore_value_button= None
tab.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
box = QVBoxLayout()
box.addWidget(table_pwr[0])
box.addWidget(table_pwr[1])
box.setAlignment(Qt.AlignTop | Qt.AlignRight)
box.setSpacing(10)
qw = QWidget()
qw.setLayout(box)
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw
def check_status_list(self, pv_list, status_list, line):
_brk = ("------------------------------------------------------" +
"------------------------------------------------------")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_options = {}
for pv, stat in zip(pv_list, status_list):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + " ")
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line, _mess, _options)
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_mess = ("The following devices reported an error " +
"in 'set' operation:")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _mess, {})
def check_status(self, pv, stat, line):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + ".")
_options = {}
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(
stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line,
_mess, _options)
def on_sector_standby(self):
target = self.sender()
sector = target.sector
_table = self.table_sol_dict[sector]
##_text = _table.standby_value_button.text()
#_table.standby_value_button
##target.setText("Downing..")
##target.setEnabled(False)
QApplication.processEvents(QEventLoop.AllEvents, 1.0)
#QApplication.processEvents()
#disenable widgets to avoid circular behaviour since
#updates of SOL also update PWR, and vice-versa
self.table_pwr_dict[sector].init_value_button.setEnabled(False)
_table.init_value_button.click()
time.sleep(0.05)
self.table_pwr_dict[sector].init_value_button.setEnabled(True)
_table.init_value_button.setEnabled(False)
self.table_pwr_dict[sector].init_value_button.click()
time.sleep(0.05)
self.table_sol_dict[sector].init_value_button.setEnabled(True)
QApplication.processEvents(QEventLoop.AllEvents, 1.0)
'''
#Now read LAST POWER:
_pv = "SEC-" + target.sector + ":TOTPWR"
tot_power = self.cafe.get(_pv, dt='float')
print("TOTAL PWER===>", tot_power, _pv, flush=True)
status = self.cafe.getStatus(_pv)
print(self.cafe.getStatusCodeAsString(status))
_pv_target = "SEC-" + target.sector + ":LASTPWR"
status = self.cafe.set(_pv_target, tot_power)
print("TOTAL PWER STATUS SET", _pv_target, status, flush=True)
print(self.cafe.getStatusCodeAsString(status))
'''
if not self.input_parameters['simulation']:
status, status_list, pv_list = _table.set_standby_values()
if status != self.cyca.ICAFE_NORMAL:
self.check_status_list(pv_list, status_list, _line())
#time.sleep(1.5)
#QApplication.processEvents()
##target.setText(_text)
##target.setEnabled(False)
##QApplication.processEvents(QEventLoop.AllEvents, 1.0)
#QApplication.flush()
#QApplication.processEvents()
##target.setEnabled(True)
###_table.standby_value_button.style().polish(_table.standby_value_button)
pv = target.sector + ":SAVESTATE"
stat = self.cafe.set(pv, 0)
self.check_status(pv, stat, _line())
def on_sector_restore(self):
target = self.sender()
sector = target.sector
_table = self.table_sol_dict[sector]
if not self.input_parameters['simulation']:
status, status_list, pv_list = _table.restore_init_values()
if status != self.cyca.ICAFE_NORMAL:
self.check_status_list(pv_list, status_list, _line())
pv = target.sector + ":SAVESTATE"
stat = self.cafe.set(pv, 1)
self.check_status(pv, stat, _line())
def ca_table_sector_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
try:
_standby_values = self.settings.data[sector]["standby"]
except KeyError as ex:
print("On Standby values not given")
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
_table_height = 700
table_sol = CAQTableWidget(
self, pv_list=pv_dict['SOL:2'], show_units=True, notify_freq_hz=0,
notify_unison=False, scale_factor=1, show_timestamp=False,
init_column=True, pv_list_show=device_list, standby_column=True,
standby_values=_standby_values, standby_delay = 0.09)
table_sol.restore_value_button.setToolTip(
("Restore devices to their pre-standby values"))
table_sol.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
table_sol.standby_value_button.sector = sector
table_sol.standby_value_button.clicked.disconnect()
table_sol.standby_value_button.clicked.connect(self.on_sector_standby)
table_sol.restore_value_button.sector = sector
table_sol.restore_value_button.clicked.disconnect()
table_sol.restore_value_button.clicked.connect(self.on_sector_restore)
self.table_sol_dict[sector] = table_sol
table_ist = CAQTableWidget(
self, pv_list=pv_dict['IST:2'], show_units=True, notify_freq_hz=2,
notify_unison=True, scale_factor=1, show_timestamp=False,
init_column=False, pv_list_show=[False])
table_pwr = CAQTableWidget(
self, pv_list=pv_dict['PWR:2'], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, init_list=pv_dict['PWR:2'], pv_list_show=[False])
table_pwr.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
self.table_pwr_dict[sector] = table_pwr
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_standby.setFont(f)
header_standby.setText('Standby')
header_value.setFont(f)
header_value.setText('SOL:2')
table_sol.setContentsMargins(15, 0, 15, 10)
table_sol.setHorizontalHeaderItem(0, header_item)
table_sol.setHorizontalHeaderItem(1, header_init)
table_sol.setHorizontalHeaderItem(2, header_standby)
table_sol.setHorizontalHeaderItem(3, header_value)
table_sol.setColumnWidth(0, 80)
table_sol.setColumnWidth(1, 88)
table_sol.setColumnWidth(2, 80)
table_sol.setColumnWidth(3, 88)
table_sol.setFixedWidth(386)
#table_sol.setFixedHeight(_table_height)
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('IST:2')
table_ist.setContentsMargins(15, 0, 15, 10)
table_ist.setHorizontalHeaderItem(0, header_value)
table_ist.setColumnWidth(0, 90)
table_ist.setFixedWidth(140)
#table_ist .setFixedHeight(_table_height)
header_init = QTableWidgetItem()
f = header_init.font()
header_init.setFont(f)
header_init.setText('Init. Value')
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('PWR:2')
table_pwr.setContentsMargins(15, 0, 15, 10)
table_pwr.setHorizontalHeaderItem(0, header_init)
table_pwr.setHorizontalHeaderItem(1, header_value)
table_pwr.setColumnWidth(0, 88)
table_pwr.setColumnWidth(1, 88)
table_pwr.setFixedWidth(226)
#table_pwr.setFixedHeight(_table_height)
#table_pwr.restore_layout.removeWidget(table_pwr.restore_value_button)
#table_pwr.restore_value_button.deleteLater()
#table_pwr.restore_value_button= None
#update_wgt_item = QTableWidgetItem()
#update_wgt = table_pwr.init_value_button
#table_pwr.init_layout.removeWidget(table_pwr.init_value_button)
#table_pwr.setCellWidget(table_pwr.rowCount()-1, 0, update_wgt)
def on_sol_update():
table_sol.init_value_button.setEnabled(False)
table_pwr.init_value_button.click()
time.sleep(0.1)
table_sol.init_value_button.setEnabled(True)
def on_init_update():
table_pwr.init_value_button.setEnabled(False)
table_sol.init_value_button.click()
time.sleep(0.1)
table_pwr.init_value_button.setEnabled(True)
table_sol.init_value_button.sector = sector
table_sol.init_value_button.clicked.connect(on_sol_update)
table_pwr.init_value_button.sector = sector
table_pwr.init_value_button.clicked.connect(on_init_update)
hbox = QHBoxLayout()
hbox.addWidget(table_sol)
hbox.addWidget(table_ist)
hbox.addWidget(table_pwr)
#hbox.setContentsMargins(40, 40, 40, 40)
hbox.setSpacing(10)
hbox.setAlignment(Qt.AlignTop)
qw = QWidget()
qw.setLayout(hbox)
#qw.setStyleSheet("background-color: {0};".format(
# self.settings.data[sector]["qlingrad"]))
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw

542
src/gui.py- Normal file
View File

@@ -0,0 +1,542 @@
import inspect
import os
import platform
import random
import sys
import time
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor, QFont, QIcon
from qtpy.QtCore import __version__ as QT_VERSION_STR
from qtpy.QtCore import (
PYQT_VERSION_STR, QFile, QIODevice, Qt, QThread, Signal, Slot)
from qtpy.QtWidgets import (
QApplication, QDockWidget, QFrame, QGridLayout, QGroupBox, QHBoxLayout,
QLabel, QMainWindow, QMessageBox, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QStackedWidget, QTabBar, QTabWidget, QTableWidget,
QTableWidgetItem, QVBoxLayout, QWidget)
from apps4ops.bdbase.base import BaseWindow
from apps4ops.bdbase.enumkind import MsgSeverity, UserMode, Facility
from caqtwidgets.pvwidgets import CAQTableWidget
_pymodule = os.path.basename(__file__)
def _line():
"""Macro to return the current line number.688
The current line number within the file is used when
reporting messages to the message logging window.
Returns:
int: Current line number.
"""
return inspect.currentframe().f_back.f_lineno
class AppGui(QWidget):
def __init__(self, parent):
super(AppGui, self).__init__()
self.parent = parent
self.cafe = self.parent.cafe
self.cyca = self.parent.cyca
self.gui_frame = self.parent.gui_frame
self.gui_header = self.parent.gui_header
self.font_gui = self.parent.gui_frame.font_gui
self.input_parameters = self.parent.input_parameters
self.input_labels = self.parent.input_labels
self.expert_parameters = self.parent.expert_parameters
self.gui_frame.expert_parameters_group.setFixedWidth(260)
self.gui_frame.operator_parameters_group.setFixedWidth(260)
#self.gui_frame.operator_parameters_group.setFixedHeight(260)
self.gui_frame.measurement_tab_wgt.setMinimumWidth(280)
self.gui_frame.operator_wgt.setFixedHeight(240)
self.gui_frame.expert_wgt.setFixedHeight(240)
self.gui_frame.central_tab_widget.tabBar().setTabText(0, "Control")
self.gui_frame.central_tab_widget.tabBar().setTabText(1, "Savings")
self.expert_labels = self.parent.expert_labels
self.settings = self.parent.settings
self.obj_to_upper = True if random.randint(1, 10) > 3 else False
self.table_sol_dict = {}
#wgt = self.ca_table_sector_widget(sector="IP2")
wgt = self.group_sector_qtabwidget()
self.gui_frame.measurement_layout.addWidget(
wgt, 0, 1, 3, 3, alignment=Qt.AlignTop)
qf = QFrame()
qf.setFixedHeight(600)
self.gui_frame.measurement_layout.addWidget(
qf, 1, 0, 1, 1, alignment=Qt.AlignTop)
self.sectorI_dict = {}
self.sectorI_dict['IP2'] = 0
self.sectorI_dict['IW2'] = 0
self.sectorI_dict['PK1'] = 0
self.sectorI_dict['PK2'] = 0
self.sectorI_dict['SINQ'] = 0
self.sectorI_dict['UCN'] = 0
self.I_min = 10.10
ucn_line = ["PK1", "PK2"]
sinq_line = ["PK1", "PK2"]
pk1_line = ["IW2"]
pk2_line = ["IW2"]
def enable_disable_end(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['UCN'] > self.I_min or self.sectorI_dict[
'SINQ'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def enable_disable_pk(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['PK1'] > self.I_min or self.sectorI_dict[
'PK2'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def receive_ucn_update(value, status, alarm_severity):
enable_disable_end('UCN', ucn_line, value)
def receive_sinq_update(value, status, alarm_severity):
enable_disable_end('SINQ', sinq_line, value)
def receive_pk1_update(value, status, alarm_severity):
enable_disable_pk('PK1', pk1_line, value)
def receive_pk2_update(value, status, alarm_severity):
enable_disable_pk('PK2', pk2_line, value)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_ucn_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_sinq_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk1_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk2_update)
#self.cafe.monitor("MWC2:IST:2", cb)
#print(dir(self.gui_header.header_wgt.layout().widget()), flush=True)
def group_sector_qtabwidget(self):
idx_inj = self.settings.data["header"].index("INJ2")
idx = self.settings.data["header"].index("IP2")
#open all PVS
pv = []
for sector in self.settings.data["header"][idx_inj:]:
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
for att in attribute_list:
for dev in device_list:
pv.append(dev + ":" + att)
self.cafe.openPrepare()
self.cafe.open(pv)
self.cafe.openNowAndWait(0.5)
sector_wgt_dict = {}
sector_wgt_dict["INJ2"] = self.ca_table_rf_widget(sector="INJ2")
for sector in self.settings.data["header"][idx:]:
sector_wgt_dict[sector] = self.ca_table_sector_widget(sector=sector)
sector_tab_widget = QTabWidget()
sector_tab_widget.setFont(self.font_gui)
sector_tab_widget.setStyleSheet("QTabBar {font-size: 12pt;}")
sector_tab_widget.tabBar().setShape(QTabBar.TriangularNorth)
for i, sector in enumerate(self.settings.data["header"][idx:]):
#if sector == "INJ2":
# _title = "RF"
#else:
# _title = sector
sector_tab_widget.addTab(sector_wgt_dict[sector], sector)
color = self.settings.data[sector]["color"]
sector_tab_widget.tabBar().setTabTextColor(i, QColor(color))
sector_tab_widget.addTab(sector_wgt_dict["INJ2"], "RF")
color = self.settings.data["INJ2"]["color"]
sector_tab_widget.tabBar().setTabTextColor(
len(self.settings.data["header"][idx:]), QColor(color))
return sector_tab_widget
def ca_table_rf_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
table_pwr = [None] * 2
table_pwr[0] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][0:4], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[0:4])
table_pwr[1] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][4:], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[4:])
for tab in table_pwr:
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_value.setFont(f)
header_value.setText('IST:2')
tab.setContentsMargins(15, 0, 15, 10)
tab.setHorizontalHeaderItem(0, header_item)
tab.setHorizontalHeaderItem(1, header_init)
tab.setHorizontalHeaderItem(2, header_value)
tab.setColumnWidth(0, 80)
tab.setColumnWidth(1, 88)
tab.setColumnWidth(2, 88)
tab.setFixedWidth(304)
# _table_height = 700
#tab.setFixedHeight(_table_height)
tab.restore_layout.removeWidget(tab.restore_value_button)
tab.restore_value_button.deleteLater()
tab.restore_value_button= None
tab.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
box = QVBoxLayout()
box.addWidget(table_pwr[0])
box.addWidget(table_pwr[1])
box.setAlignment(Qt.AlignTop | Qt.AlignRight)
box.setSpacing(10)
qw = QWidget()
qw.setLayout(box)
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw
'''
def check_status_list(self, pv_list, status_list, line):
_mess = ("The following device(s) reported an error " +
"in 'set' operation: ")
_options = {}
stat_previous = self.cyca.ICAFE_NORMAL
for pv, stat in zip(pv_list, status_list):
if stat != self.cyca.ICAFE_NORMAL:
_mess += pv + " " #("Error in 'set' for " + pv + ".")
if stat != stat_previous:
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(stat)
if stat_previous != self.cyca.ICAFE_NORMAL:
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line, _mess,
_options)
_mess = ""
stat_previous = stat
if _mess:
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line, _mess, _options)
'''
def check_status_list(self, pv_list, status_list, line):
_brk = ("------------------------------------------------------" +
"------------------------------------------------------")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_options = {}
for pv, stat in zip(pv_list, status_list):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + " ")
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line, _mess, _options)
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_mess = ("The following devices reported an error " +
"in 'set' operation:")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _mess, {})
def check_status(self, pv, stat, line):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + ".")
_options = {}
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(
stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line,
_mess, _options)
class StandByThread(QThread):
def __init__(self, parent, table):
QThread.__init__(self)
self.parent = parent
self.table = table
self.cafe = self.parent.cafe
self.cyca = self.parent.cyca
print("INIT", flush=True)
def __del__(self):
print("WAITING", flush=True)
##self.wait()
def run(self):
print("RUNNING", flush=True)
_handles = self.cafe.getHandles()[0]
_status = self.cafe.attachContext(_handles[0])
status, status_list, pv_list = self.table.set_standby_values()
time.sleep(3)
print("END RUNNING", flush=True)
#return status, status_list, pv_list
def on_sector_standby(self):
target = self.sender()
_table = self.table_sol_dict[target.sector]
_text = _table.standby_value_button.text()
_table.standby_value_button.setEnabled(False)
_table.standby_value_button.setText("Downing..")
QApplication.processEvents()
status, status_list, pv_list = _table.set_standby_values()
if status != self.cyca.ICAFE_NORMAL:
self.check_status_list(pv_list, status_list, _line())
_table.standby_value_button.setText(_text)
_table.standby_value_button.setEnabled(True)
QApplication.processEvents()
pv = target.sector + ":SAVESTATE"
stat = self.cafe.set(pv, 1)
self.check_status(pv, stat, _line())
'''
@Slot()
def standby_thread_finished():
print("FIN", flush=True)
_table.standby_value_button.setText(_text)
_table.standby_value_button.setEnabled(True)
QApplication.processEvents()
standby_thread = self.StandByThread(self, _table)
print("HERE", flush=True)
standby_thread.finished.connect(standby_thread_finished)
print("HERE2", flush=True)
standby_thread.start()
print("HERE3", flush=True)
time.sleep(0.05)
print("HERE4", flush=True)
'''
def on_sector_restore(self):
target = self.sender()
pv = target.sector + ":SAVESTATE"
stat = self.cafe.set(pv, 0)
self.check_status(pv, stat, _line())
def ca_table_sector_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
try:
_standby_values = self.settings.data[sector]["standby"]
except KeyError as ex:
print("On Standby values not given")
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
'''
self.cafe.openPrepare()
self.cafe.open(pv_dict['SOL:2'])
self.cafe.open(pv_dict['IST:2'])
self.cafe.open(pv_dict['PWR:2'])
self.cafe.openNowAndWait(0.5)
'''
_table_height = 700
table_sol = CAQTableWidget(
self, pv_list=pv_dict['SOL:2'], show_units=True, notify_freq_hz=0,
notify_unison=False, scale_factor=1, show_timestamp=False,
init_column=True, pv_list_show=device_list, standby_column=True,
standby_values=_standby_values, standby_delay = 0.09)
table_sol.restore_value_button.setToolTip(
("Restore devices to their pre-standby values"))
table_sol.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
table_sol.standby_value_button.sector = sector
table_sol.standby_value_button.clicked.disconnect()
table_sol.standby_value_button.clicked.connect(self.on_sector_standby)
table_sol.restore_value_button.sector = sector
table_sol.restore_value_button.clicked.connect(self.on_sector_restore)
self.table_sol_dict[sector] = table_sol
table_ist = CAQTableWidget(
self, pv_list=pv_dict['IST:2'], show_units=True, notify_freq_hz=2,
notify_unison=True, scale_factor=1, show_timestamp=False,
init_column=False, pv_list_show=[False])
table_pwr = CAQTableWidget(
self, pv_list=pv_dict['PWR:2'], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, init_list=pv_dict['PWR:2'], pv_list_show=[False])
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_standby.setFont(f)
header_standby.setText('Standby')
header_value.setFont(f)
header_value.setText('SOL:2')
table_sol.setContentsMargins(15, 0, 15, 10)
table_sol.setHorizontalHeaderItem(0, header_item)
table_sol.setHorizontalHeaderItem(1, header_init)
table_sol.setHorizontalHeaderItem(2, header_standby)
table_sol.setHorizontalHeaderItem(3, header_value)
table_sol.setColumnWidth(0, 80)
table_sol.setColumnWidth(1, 88)
table_sol.setColumnWidth(2, 80)
table_sol.setColumnWidth(3, 88)
table_sol.setFixedWidth(386)
#table_sol.setFixedHeight(_table_height)
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('IST:2')
table_ist.setContentsMargins(15, 0, 15, 10)
table_ist.setHorizontalHeaderItem(0, header_value)
table_ist.setColumnWidth(0, 90)
table_ist.setFixedWidth(140)
#table_ist .setFixedHeight(_table_height)
header_init = QTableWidgetItem()
f = header_init.font()
header_init.setFont(f)
header_init.setText('Init. Value')
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('PWR:2')
table_pwr.setContentsMargins(15, 0, 15, 10)
table_pwr.setHorizontalHeaderItem(0, header_init)
table_pwr.setHorizontalHeaderItem(1, header_value)
table_pwr.setColumnWidth(0, 88)
table_pwr.setColumnWidth(1, 88)
table_pwr.setFixedWidth(226)
#table_pwr.setFixedHeight(_table_height)
table_pwr.restore_layout.removeWidget(table_pwr.restore_value_button)
table_pwr.restore_value_button.deleteLater()
table_pwr.restore_value_button= None
hbox = QHBoxLayout()
hbox.addWidget(table_sol)
hbox.addWidget(table_ist)
hbox.addWidget(table_pwr)
#hbox.setContentsMargins(40, 40, 40, 40)
hbox.setSpacing(10)
hbox.setAlignment(Qt.AlignTop)
qw = QWidget()
qw.setLayout(hbox)
#qw.setStyleSheet("background-color: {0};".format(
# self.settings.data[sector]["qlingrad"]))
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw

596
src/gui.py~ Normal file
View File

@@ -0,0 +1,596 @@
import inspect
import os
import platform
import random
import sys
import time
from datetime import timedelta
from qtpy import QtCore, QtGui
from qtpy.QtGui import QColor, QFont, QIcon
from qtpy.QtCore import __version__ as QT_VERSION_STR
from qtpy.QtCore import (
PYQT_VERSION_STR, QDate, QDateTime, QEventLoop, Qt, Signal, Slot)
from qtpy.QtWidgets import (
QApplication, QDockWidget, QFrame, QGridLayout, QGroupBox, QHBoxLayout,
QLabel, QMainWindow, QMessageBox, QProgressBar, QPushButton, QSizePolicy,
QSpacerItem, QStackedWidget, QTabBar, QTabWidget, QTableWidget,
QTableWidgetItem, QVBoxLayout, QWidget)
from apps4ops.bdbase.base import BaseWindow
from apps4ops.bdbase.enumkind import MsgSeverity, UserMode, Facility
from caqtwidgets.pvwidgets import CAQLabel, CAQLineEdit, CAQTableWidget
_pymodule = os.path.basename(__file__)
def _line():
"""Macro to return the current line number.688
The current line number within the file is used when
reporting messages to the message logging window.
Returns:
int: Current line number.
"""
return inspect.currentframe().f_back.f_lineno
class AppGui(QWidget):
def __init__(self, parent):
super(AppGui, self).__init__()
self.parent = parent
self.cafe = self.parent.cafe
self.cyca = self.parent.cyca
self.gui_frame = self.parent.gui_frame
self.gui_header = self.parent.gui_header
self.font_gui = self.parent.gui_frame.font_gui
self.input_parameters = self.parent.input_parameters
self.input_labels = self.parent.input_labels
self.expert_parameters = self.parent.expert_parameters
self.gui_frame.expert_parameters_group.setFixedWidth(260)
self.gui_frame.operator_parameters_group.setFixedWidth(260)
#self.gui_frame.operator_parameters_group.setFixedHeight(260)
self.gui_frame.measurement_tab_wgt.setMinimumWidth(280)
self.gui_frame.operator_wgt.setFixedHeight(240)
self.gui_frame.expert_wgt.setFixedHeight(240)
self.gui_frame.central_tab_widget.tabBar().setTabText(0, "Control")
self.gui_frame.central_tab_widget.tabBar().setTabText(1, "Savings")
self.expert_labels = self.parent.expert_labels
self.settings = self.parent.settings
self.obj_to_upper = True if random.randint(1, 10) > 3 else False
self.table_sol_dict = {}
self.table_pwr_dict = {}
#wgt = self.ca_table_sector_widget(sector="IP2")
wgt = self.group_sector_qtabwidget()
self.gui_frame.measurement_layout.addWidget(
wgt, 0, 1, 3, 3, alignment=Qt.AlignTop)
status_wgt = self.group_sector_status()
self.gui_frame.measurement_layout.addWidget(
status_wgt, 1, 0, 2, 1, alignment=Qt.AlignTop)
qf = QFrame()
qf.setFixedHeight(600)
self.gui_frame.measurement_layout.addWidget(
qf, 2, 0, 1, 1, alignment=Qt.AlignTop)
self.sectorI_dict = {}
self.sectorI_dict['IP2'] = 0
self.sectorI_dict['IW2'] = 0
self.sectorI_dict['PK1'] = 0
self.sectorI_dict['PK2'] = 0
self.sectorI_dict['SINQ'] = 0
self.sectorI_dict['UCN'] = 0
self.I_min = 0.017
ucn_line = ["PK1", "PK2"]
sinq_line = ["PK1", "PK2"]
pk1_line = ["IW2"]
pk2_line = ["IW2"]
def enable_disable_end(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['UCN'] > self.I_min or self.sectorI_dict[
'SINQ'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def enable_disable_pk(sector, sector_line, value):
self.sectorI_dict[sector] = value
for sector in sector_line:
if self.sectorI_dict['PK1'] > self.I_min or self.sectorI_dict[
'PK2'] > self.I_min:
if self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(False)
else:
if not self.table_sol_dict[
sector].standby_value_button.isEnabled():
self.table_sol_dict[
sector].standby_value_button.setEnabled(True)
def receive_ucn_update(value, status, alarm_severity):
enable_disable_end('UCN', ucn_line, value)
def receive_sinq_update(value, status, alarm_severity):
enable_disable_end('SINQ', sinq_line, value)
def receive_pk1_update(value, status, alarm_severity):
enable_disable_pk('PK1', pk1_line, value)
def receive_pk2_update(value, status, alarm_severity):
enable_disable_pk('PK2', pk2_line, value)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_ucn_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_sinq_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk1_update)
self.gui_header.beam_current_wgt_dict[
"INJ2"].trigger_monitor_float.connect(receive_pk2_update)
#self.cafe.monitor("MWC2:IST:2", cb)
#print(dir(self.gui_header.header_wgt.layout().widget()), flush=True)
def group_sector_status(self):
vbox = QVBoxLayout()
#Connect all channels
#Heading
idx = self.settings.data["header"].index("IP2")
#Sector
hbox =QHBoxLayout()
hbox.addWidget(QLabel(" "))
hbox.addWidget(QLabel("Power"))
hbox.addWidget(QLabel("Initial"))
qhead = QWidget()
qhead.setLayout(hbox)
vbox.addWidget(qhead)
for i, sector in enumerate(self.settings.data["header"][idx:]):
vbox.addWidget(self.sector_status(sector))
qw = QWidget()
qw.setLayout(vbox)
return qw
def sector_status(self, sector):
'''Create each sector line for inclusion into group
'''
device = "SEC-" + sector
#Qlabel
qsector = QLabel(sector+":")
#Savings
pv_pwr_tot = device + ":TOTPWR"
pv_pwr_last = device + ":LASTPWR"
pv_pwr_saved = device + ":SAVEPWR"
#print("device", device, flush=True)
now = QDateTime.currentDateTime()
xdate = QDate(now.date().year(), 1, 15)
xstart = QDateTime(xdate)
print("delta t ", xstart.secsTo(now))
print("{}".format(str(timedelta(seconds=xstart.secsTo(now)))))
qpnow = CAQLabel(self, pv_name=pv_pwr_tot, show_units=True)
qpinit = CAQLabel(self, pv_name=pv_pwr_last, show_units=True)
#qpsave = QCALabel(pv=pv_pwr_tot, show_units=True)
#qpsum = QCALabel(pv=pv_pwr_tot, show_units=True)
#qtdis = QBasicTimer()
hbox =QHBoxLayout()
hbox.addWidget(qsector)
hbox.addWidget(qpnow)
hbox.addWidget(qpinit)
qw = QWidget()
qw.setLayout(hbox)
return qw
def group_sector_qtabwidget(self):
idx_inj = self.settings.data["header"].index("INJ2")
idx = self.settings.data["header"].index("IP2")
#open all PVS
pv = []
for sector in self.settings.data["header"][idx_inj:]:
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
for att in attribute_list:
for dev in device_list:
pv.append(dev + ":" + att)
self.cafe.openPrepare()
self.cafe.open(pv)
self.cafe.openNowAndWait(0.5)
self.cafe.supplementHandles()
sector_wgt_dict = {}
sector_wgt_dict["INJ2"] = self.ca_table_rf_widget(sector="INJ2")
for sector in self.settings.data["header"][idx:]:
sector_wgt_dict[sector] = self.ca_table_sector_widget(sector=sector)
sector_tab_widget = QTabWidget()
sector_tab_widget.setFont(self.font_gui)
sector_tab_widget.setStyleSheet("QTabBar {font-size: 12pt;}")
sector_tab_widget.tabBar().setShape(QTabBar.TriangularNorth)
for i, sector in enumerate(self.settings.data["header"][idx:]):
#if sector == "INJ2":
# _title = "RF"
#else:
# _title = sector
sector_tab_widget.addTab(sector_wgt_dict[sector], sector)
color = self.settings.data[sector]["color"]
sector_tab_widget.tabBar().setTabTextColor(i, QColor(color))
sector_tab_widget.addTab(sector_wgt_dict["INJ2"], "RF")
color = self.settings.data["INJ2"]["color"]
sector_tab_widget.tabBar().setTabTextColor(
len(self.settings.data["header"][idx:]), QColor(color))
return sector_tab_widget
def ca_table_rf_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
table_pwr = [None] * 2
table_pwr[0] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][0:4], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[0:4])
table_pwr[1] = CAQTableWidget(
self, pv_list=pv_dict['IST:2'][4:], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, pv_list_show=device_list[4:])
for tab in table_pwr:
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_value.setFont(f)
header_value.setText('IST:2')
tab.setContentsMargins(15, 0, 15, 10)
tab.setHorizontalHeaderItem(0, header_item)
tab.setHorizontalHeaderItem(1, header_init)
tab.setHorizontalHeaderItem(2, header_value)
tab.setColumnWidth(0, 80)
tab.setColumnWidth(1, 88)
tab.setColumnWidth(2, 88)
tab.setFixedWidth(304)
# _table_height = 700
#tab.setFixedHeight(_table_height)
tab.restore_layout.removeWidget(tab.restore_value_button)
tab.restore_value_button.deleteLater()
tab.restore_value_button= None
tab.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
box = QVBoxLayout()
box.addWidget(table_pwr[0])
box.addWidget(table_pwr[1])
box.setAlignment(Qt.AlignTop | Qt.AlignRight)
box.setSpacing(10)
qw = QWidget()
qw.setLayout(box)
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw
def check_status_list(self, pv_list, status_list, line):
_brk = ("------------------------------------------------------" +
"------------------------------------------------------")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_options = {}
for pv, stat in zip(pv_list, status_list):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + " ")
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line, _mess, _options)
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _brk, {})
_mess = ("The following devices reported an error " +
"in 'set' operation:")
self.parent.trigger_log_message.emit(
MsgSeverity.INFO.name, _pymodule, line, _mess, {})
def check_status(self, pv, stat, line):
if stat != self.cyca.ICAFE_NORMAL:
_mess = ("Error in 'set' for " + pv + ".")
_options = {}
_options['statusCode'] = (
str(stat) + " " +
self.cafe.getStatusCodeAsString(stat))
_options['statusInfo'] = self.cafe.getStatusInfo(
stat)
self.parent.trigger_log_message.emit(
MsgSeverity.WARN.name, _pymodule, line,
_mess, _options)
def on_sector_standby(self):
target = self.sender()
sector = target.sector
_table = self.table_sol_dict[sector]
_text = _table.standby_value_button.text()
#_table.standby_value_button
target.setText("Downing..")
target.setEnabled(False)
QApplication.processEvents(QEventLoop.AllEvents, 1.0)
#QApplication.processEvents()
#disenable widgets to avoid circular behaviour since
#updates of SOL also update PWR, and vice-versa
self.table_pwr_dict[sector].init_value_button.setEnabled(False)
_table.init_value_button.click()
time.sleep(0.05)
self.table_pwr_dict[sector].init_value_button.setEnabled(True)
_table.init_value_button.setEnabled(False)
self.table_pwr_dict[sector].init_value_button.click()
time.sleep(0.05)
self.table_sol_dict[sector].init_value_button.setEnabled(True)
QApplication.processEvents(QEventLoop.AllEvents, 1.0)
#Now read LAST POWER:
_pv = "SEC-" + target.sector + ":TOTPWR"
tot_power = self.cafe.get(_pv, dt='float')
print("TOTAL PWER===>", tot_power, _pv, flush=True)
status = self.cafe.getStatus(_pv)
print(self.cafe.getStatusCodeAsString(status))
_pv_target = "SEC-" + target.sector + ":LASTPWR"
status = self.cafe.set(_pv_target, tot_power)
print("TOTAL PWER STATUS SET", _pv_target, status, flush=True)
print(self.cafe.getStatusCodeAsString(status))
status, status_list, pv_list = _table.set_standby_values()
if status != self.cyca.ICAFE_NORMAL:
self.check_status_list(pv_list, status_list, _line())
#time.sleep(1.5)
#QApplication.processEvents()
target.setText(_text)
target.setEnabled(False)
QApplication.processEvents(QEventLoop.AllEvents, 1.0)
#QApplication.flush()
#QApplication.processEvents()
target.setEnabled(True)
###_table.standby_value_button.style().polish(_table.standby_value_button)
##pv = target.sector + ":SAVESTATE"
##stat = self.cafe.set(pv, 1)
##self.check_status(pv, stat, _line())
def on_sector_restore(self):
target = self.sender()
pv = target.sector + ":SAVESTATE"
#stat = self.cafe.set(pv, 0)
#self.check_status(pv, stat, _line())
def ca_table_sector_widget(self, sector: str="", color: str="MACHINE"):
device_list = self.settings.data[sector]["device"]
attribute_list = self.settings.data[sector]["attribute"]
try:
_standby_values = self.settings.data[sector]["standby"]
except KeyError as ex:
print("On Standby values not given")
pv_dict = {}
for att in attribute_list:
pv_dict[att] = [] #[None] * len(device_list)
for dev in device_list:
pv_dict[att].append(dev + ":" + att)
_table_height = 700
table_sol = CAQTableWidget(
self, pv_list=pv_dict['SOL:2'], show_units=True, notify_freq_hz=0,
notify_unison=False, scale_factor=1, show_timestamp=False,
init_column=True, pv_list_show=device_list, standby_column=True,
standby_values=_standby_values, standby_delay = 0.09)
table_sol.restore_value_button.setToolTip(
("Restore devices to their pre-standby values"))
table_sol.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
table_sol.standby_value_button.sector = sector
table_sol.standby_value_button.clicked.disconnect()
table_sol.standby_value_button.clicked.connect(self.on_sector_standby)
table_sol.restore_value_button.sector = sector
table_sol.restore_value_button.clicked.connect(self.on_sector_restore)
self.table_sol_dict[sector] = table_sol
table_ist = CAQTableWidget(
self, pv_list=pv_dict['IST:2'], show_units=True, notify_freq_hz=2,
notify_unison=True, scale_factor=1, show_timestamp=False,
init_column=False, pv_list_show=[False])
table_pwr = CAQTableWidget(
self, pv_list=pv_dict['PWR:2'], show_units=False, notify_freq_hz=0,
suffix = "kW",
notify_unison=False, scale_factor=0.001, show_timestamp=False,
init_column=True, init_list=pv_dict['PWR:2'], pv_list_show=[False])
table_pwr.init_value_button.setToolTip(
("Shows initial, pre-standby values. Update is also " +
"executed automatically before the standby procedure."))
self.table_pwr_dict[sector] = table_pwr
header_item = QTableWidgetItem()
header_init = QTableWidgetItem()
header_standby = QTableWidgetItem()
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_item.setFont(f)
header_item.setText('Device')
header_init.setFont(f)
header_init.setText('Init. Value')
header_standby.setFont(f)
header_standby.setText('Standby')
header_value.setFont(f)
header_value.setText('SOL:2')
table_sol.setContentsMargins(15, 0, 15, 10)
table_sol.setHorizontalHeaderItem(0, header_item)
table_sol.setHorizontalHeaderItem(1, header_init)
table_sol.setHorizontalHeaderItem(2, header_standby)
table_sol.setHorizontalHeaderItem(3, header_value)
table_sol.setColumnWidth(0, 80)
table_sol.setColumnWidth(1, 88)
table_sol.setColumnWidth(2, 80)
table_sol.setColumnWidth(3, 88)
table_sol.setFixedWidth(386)
#table_sol.setFixedHeight(_table_height)
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('IST:2')
table_ist.setContentsMargins(15, 0, 15, 10)
table_ist.setHorizontalHeaderItem(0, header_value)
table_ist.setColumnWidth(0, 90)
table_ist.setFixedWidth(140)
#table_ist .setFixedHeight(_table_height)
header_init = QTableWidgetItem()
f = header_init.font()
header_init.setFont(f)
header_init.setText('Init. Value')
header_value = QTableWidgetItem()
f = header_value.font()
f.setPixelSize(13)
header_value.setFont(f)
header_value.setText('PWR:2')
table_pwr.setContentsMargins(15, 0, 15, 10)
table_pwr.setHorizontalHeaderItem(0, header_init)
table_pwr.setHorizontalHeaderItem(1, header_value)
table_pwr.setColumnWidth(0, 88)
table_pwr.setColumnWidth(1, 88)
table_pwr.setFixedWidth(226)
#table_pwr.setFixedHeight(_table_height)
#table_pwr.restore_layout.removeWidget(table_pwr.restore_value_button)
#table_pwr.restore_value_button.deleteLater()
#table_pwr.restore_value_button= None
#update_wgt_item = QTableWidgetItem()
#update_wgt = table_pwr.init_value_button
#table_pwr.init_layout.removeWidget(table_pwr.init_value_button)
#table_pwr.setCellWidget(table_pwr.rowCount()-1, 0, update_wgt)
def on_sol_update():
table_sol.init_value_button.setEnabled(False)
table_pwr.init_value_button.click()
time.sleep(0.1)
table_sol.init_value_button.setEnabled(True)
def on_init_update():
table_pwr.init_value_button.setEnabled(False)
table_sol.init_value_button.click()
time.sleep(0.1)
table_pwr.init_value_button.setEnabled(True)
table_sol.init_value_button.sector = sector
table_sol.init_value_button.clicked.connect(on_sol_update)
table_pwr.init_value_button.sector = sector
table_pwr.init_value_button.clicked.connect(on_init_update)
hbox = QHBoxLayout()
hbox.addWidget(table_sol)
hbox.addWidget(table_ist)
hbox.addWidget(table_pwr)
#hbox.setContentsMargins(40, 40, 40, 40)
hbox.setSpacing(10)
hbox.setAlignment(Qt.AlignTop)
qw = QWidget()
qw.setLayout(hbox)
#qw.setStyleSheet("background-color: {0};".format(
# self.settings.data[sector]["qlingrad"]))
obj_name = self.settings.data[sector]["colorObj"]
if self.obj_to_upper:
obj_name = obj_name.upper()
qw.setObjectName(obj_name)
return qw