pyqtUsrObj.py

This commit is contained in:
2022-07-22 12:00:59 +02:00
parent b512ac6aa5
commit 8353749bcc
2 changed files with 128 additions and 43 deletions

File diff suppressed because one or more lines are too long

View File

@@ -94,7 +94,7 @@ from epics_widgets.MotorTweak import MotorTweak
from epics_widgets.SmaractMotorTweak import SmaractMotorTweak
from epics_widgets.SimMotorTweak import SimMotorTweak
ts.log('Import part 5/7:')
from matplotlib import pyplot
import matplotlib as mpl
import numpy as np
import pyqtgraph as pg
import pyqtgraph.exporters
@@ -251,7 +251,12 @@ class Main(QMainWindow, Ui_MainWindow):
vb.setAspectLocked(True)
vb.setBackgroundColor((120, 90, 90))
vb.addItem(self.img)
grid=pg.GridItem()
try:
grid=pg.GridItem(pen=(0,255,0),textPen=(0,255,0)) #green grid and labels
except:
grid=pg.GridItem()
vb.addItem(grid)
self._escape_current_state = "Maintenance"
@@ -3236,7 +3241,17 @@ class StartupSplash:
time.sleep(.1)
def main():
import argparse
from PyQt5.QtCore import QT_VERSION_STR
_log.info(f'Version: pyqtgraph:{pg.__version__} matplotlib:{mpl.__version__} numpy:{np.__version__} epics:{epics.__version__} qt:{QT_VERSION_STR}' )
import argparse, socket
hostname=socket.gethostname()
if hostname=='ganymede':
#use EPICS locally
os.environ['EPICS_CA_ADDR_LIST']='localhost'
#use EPICS if connected to ESC network
# os.environ['EPICS_CA_ADDR_LIST'] ='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
#(h, t)=os.path.split(sys.argv[0]);cmd='\n '+(t if len(h)>20 else sys.argv[0])+' '
#exampleCmd=('', '-m0xf -v0')
@@ -3380,6 +3395,4 @@ def main():
if __name__ == "__main__":
#os.environ['EPICS_CA_ADDR_LIST'] ='129.129.244.255 sf-saresc-cagw.psi.ch:5062 sf-saresc-cagw.psi.ch:5066'
os.environ['EPICS_CA_ADDR_LIST']='localhost'
main()