Files
SwissMX/deltatau.py

34 lines
1.1 KiB
Python

import sys,os
sys.path.insert(0, os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
sys.path.insert(0, os.path.expanduser('..'))
import logging
_log=logging.getLogger(__name__)
from PyQt5.QtWidgets import (QApplication,)
from app_config import AppCfg #settings, option, toggle_option
from pbtools.misc.pp_comm import PPComm
from pbtools.misc.gather import Gather
import shapepath
class Deltatau:
def __init__(self):
app=QApplication.instance()
cfg=app._cfg
# cfg.setValue(AppCfg.DELTATAU_HOST, 'SAR-CPPM-EXPMX1')
cfg.setValue(AppCfg.DELTATAU_HOST, 'localhost:10001:10002')
host=cfg.value(AppCfg.DELTATAU_HOST)
hpp=host.split(':')
param={'host':hpp[0]}
if len(hpp)>1:
param['port']=int(hpp[1])
if len(hpp)>2:
param['fast_gather_port']=int(hpp[2])
_log.info(' -> ssh-tunneling PPComm({host}:{port} {host}:{fast_gather_port})'.format(**param))
self._comm=comm=PPComm(**param)
self._gather=gather=Gather(comm)
verbose=0xff
self._shapepath=sp=shapepath.ShapePath(comm, gather, verbose, sync_mode=1, sync_flag=3)