Commit 0126e3e0 authored by bliss administrator's avatar bliss administrator
Browse files

Add functions to start/stop synchronization and check free space on lbs pc

parent e988671c
import os
from bliss.setup_globals import * from bliss.setup_globals import *
from bliss.shell.cli.user_dialog import * from bliss.shell.cli.user_dialog import *
from bliss.shell.cli.pt_widgets import BlissDialog from bliss.shell.cli.pt_widgets import BlissDialog
...@@ -11,6 +12,8 @@ from bliss.shell.cli.user_dialog import * ...@@ -11,6 +12,8 @@ from bliss.shell.cli.user_dialog import *
from bliss.shell.cli.pt_widgets import BlissDialog from bliss.shell.cli.pt_widgets import BlissDialog
from bliss.config.static import get_config from bliss.config.static import get_config
from bliss import setup_globals from bliss import setup_globals
from bliss.common.logtools import *
_TOMO = None _TOMO = None
def init_tomo(tomo): def init_tomo(tomo):
...@@ -106,3 +109,22 @@ def feclose(): ...@@ -106,3 +109,22 @@ def feclose():
def psp(): def psp():
print(f'sx {setup_globals.sx.position} sy {setup_globals.sy.position} sz {setup_globals.sz.position} yrot {setup_globals.yrot.position}') print(f'sx {setup_globals.sx.position} sy {setup_globals.sy.position} sz {setup_globals.sz.position} yrot {setup_globals.yrot.position}')
def start_synchro_lbs():
os.system("ssh lbs191 sudo /root/dockerStart.sh")
def stop_synchro_lbs():
os.system("ssh lbs191 sudo /root/dockerStop.sh")
def lbs_free_space():
process = os.popen('df -h /lbsram')
result = process.readlines()
process.close()
mem_use = [item[:-1] for item in result[1].split(' ') if '%' in item]
mem_use = int(mem_use[0])
mem_available = 100 - mem_use
msg = f"\n\033[1mIt remains {mem_available}% of free space on lbs\033[0m\n"
print(msg)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment