minor syntax beauty changes
This commit is contained in:
@ -48,7 +48,7 @@ class Utilities:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
print("init phoenix.Utilities")
|
print("init phoenix.Utilities")
|
||||||
pass
|
|
||||||
# setattr(self, "description", description)
|
# setattr(self, "description", description)
|
||||||
# atribute 'label' for compatibility woith La groups...
|
# atribute 'label' for compatibility woith La groups...
|
||||||
# setattr(self, "label", description)
|
# setattr(self, "label", description)
|
||||||
@ -75,7 +75,7 @@ class Utilities:
|
|||||||
name = cls.name
|
name = cls.name
|
||||||
n_name = len(name)
|
n_name = len(name)
|
||||||
except:
|
except:
|
||||||
Name = " "
|
name = " "
|
||||||
try:
|
try:
|
||||||
config = cls._info["describe"]
|
config = cls._info["describe"]
|
||||||
except:
|
except:
|
||||||
@ -95,6 +95,9 @@ class Utilities:
|
|||||||
print("no key")
|
print("no key")
|
||||||
|
|
||||||
def list_signals_falcon(self):
|
def list_signals_falcon(self):
|
||||||
|
"""
|
||||||
|
List signals for falcon
|
||||||
|
"""
|
||||||
|
|
||||||
print("........... dev.falcon ")
|
print("........... dev.falcon ")
|
||||||
self.list_signals_(dev.falcon)
|
self.list_signals_(dev.falcon)
|
||||||
@ -106,6 +109,9 @@ class Utilities:
|
|||||||
self.list_signals_(dev.falcon.roi0)
|
self.list_signals_(dev.falcon.roi0)
|
||||||
|
|
||||||
def list_signals_xmap(self):
|
def list_signals_xmap(self):
|
||||||
|
"""
|
||||||
|
List signals for XMAP
|
||||||
|
"""
|
||||||
|
|
||||||
print("........... dev.xmap ")
|
print("........... dev.xmap ")
|
||||||
self.list_signals_(dev.xmap)
|
self.list_signals_(dev.xmap)
|
||||||
@ -171,12 +177,17 @@ class PhoenixBL(Utilities, PhoenixHelp):
|
|||||||
# bec.config.update_session_with_file(self.file_devices_file_local)
|
# bec.config.update_session_with_file(self.file_devices_file_local)
|
||||||
|
|
||||||
def create_base_config(self):
|
def create_base_config(self):
|
||||||
# create a yaml file from standard configuration
|
""" "
|
||||||
|
create a yaml file from standard configuration
|
||||||
|
"""
|
||||||
os.system("cat " + self.file_devices_file + " > " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_file + " > " + self.file_devices_tmp)
|
||||||
# os.system("ls -altr" + self.path_phoenix_bec + "phoenix_bec/devices")
|
# os.system("ls -altr" + self.path_phoenix_bec + "phoenix_bec/devices")
|
||||||
bec.config.update_session_with_file(self.file_devices_tmp)
|
bec.config.update_session_with_file(self.file_devices_tmp)
|
||||||
|
|
||||||
def add_phoenix_config(self):
|
def add_phoenix_config(self):
|
||||||
|
"""
|
||||||
|
Add phoenix config
|
||||||
|
"""
|
||||||
print("add_phoenix_config ")
|
print("add_phoenix_config ")
|
||||||
print("self.file_devices_file")
|
print("self.file_devices_file")
|
||||||
os.system("cat " + self.file_devices_file + " >> " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_file + " >> " + self.file_devices_tmp)
|
||||||
@ -184,24 +195,28 @@ class PhoenixBL(Utilities, PhoenixHelp):
|
|||||||
bec.config.update_session_with_file(self.file_devices_tmp)
|
bec.config.update_session_with_file(self.file_devices_tmp)
|
||||||
|
|
||||||
def add_xmap(self):
|
def add_xmap(self):
|
||||||
|
"""Add XMAP to config"""
|
||||||
print("add xmap ")
|
print("add xmap ")
|
||||||
|
|
||||||
os.system("cat " + self.file_devices_xmap + " >> " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_xmap + " >> " + self.file_devices_tmp)
|
||||||
bec.config.update_session_with_file(self.file_devices_tmp)
|
bec.config.update_session_with_file(self.file_devices_tmp)
|
||||||
|
|
||||||
def load_xmap(self):
|
def load_xmap(self):
|
||||||
|
"""Load XMAP"""
|
||||||
print("load_xmap")
|
print("load_xmap")
|
||||||
os.system("cat " + self.file_devices_xmap + " > " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_xmap + " > " + self.file_devices_tmp)
|
||||||
|
|
||||||
bec.config.update_session_with_file(self.file_devices_xmap)
|
bec.config.update_session_with_file(self.file_devices_xmap)
|
||||||
|
|
||||||
def add_falcon(self):
|
def add_falcon(self):
|
||||||
|
"""Add Falcon to config"""
|
||||||
print("add_falcon to existing configuration ")
|
print("add_falcon to existing configuration ")
|
||||||
|
|
||||||
os.system("cat " + self.file_devices_falcon + " >> " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_falcon + " >> " + self.file_devices_tmp)
|
||||||
bec.config.update_session_with_file(self.file_devices_tmp)
|
bec.config.update_session_with_file(self.file_devices_tmp)
|
||||||
|
|
||||||
def load_falcon(self):
|
def load_falcon(self):
|
||||||
|
"""Load FALCON"""
|
||||||
|
|
||||||
print("load_falcon")
|
print("load_falcon")
|
||||||
os.system("cat " + self.file_devices_falcon + " > " + self.file_devices_tmp)
|
os.system("cat " + self.file_devices_falcon + " > " + self.file_devices_tmp)
|
||||||
@ -212,7 +227,14 @@ class PhoenixBL(Utilities, PhoenixHelp):
|
|||||||
# os.system("cat " + self.path_phoenix_bec + "phoenix_bec/scripts/Current_setup.txt")
|
# os.system("cat " + self.path_phoenix_bec + "phoenix_bec/scripts/Current_setup.txt")
|
||||||
|
|
||||||
def run_shell(self, commands):
|
def run_shell(self, commands):
|
||||||
|
"""
|
||||||
|
run one or sever shell comands in a new terminal
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
run_shell('ls')
|
||||||
|
runt_shell(['sh script.sh','pwd','ls'])
|
||||||
|
"""
|
||||||
cmd = 'gnome-terminal --geometry 100X30 -- bash -c "'
|
cmd = 'gnome-terminal --geometry 100X30 -- bash -c "'
|
||||||
print(cmd)
|
print(cmd)
|
||||||
if type(commands) == list:
|
if type(commands) == list:
|
||||||
|
Reference in New Issue
Block a user