added option to configure offline pipelines; show ROI entries in numpy order (y, x)
This commit is contained in:
25
scam.py
25
scam.py
@ -4,6 +4,7 @@ import argparse
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-a", "--all", dest="show_all_settings", action="store_true", help="show all settings")
|
parser.add_argument("-a", "--all", dest="show_all_settings", action="store_true", help="show all settings")
|
||||||
|
parser.add_argument("-o", "--offline", dest="show_offline_pipelines", action="store_true", help="show offline pipelines")
|
||||||
clargs = parser.parse_args()
|
clargs = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
@ -44,9 +45,16 @@ from settings import SettingsList
|
|||||||
pc = PipelineClient("http://sf-daqsync-01:8889")
|
pc = PipelineClient("http://sf-daqsync-01:8889")
|
||||||
si = pc.get_server_info()
|
si = pc.get_server_info()
|
||||||
pls = si["active_instances"]
|
pls = si["active_instances"]
|
||||||
|
|
||||||
|
if clargs.show_offline_pipelines:
|
||||||
|
all_pls = pc.get_pipelines()
|
||||||
|
pls = set(all_pls) - set(pls)
|
||||||
|
|
||||||
if not clargs.show_all_settings:
|
if not clargs.show_all_settings:
|
||||||
pls = (i for i in pls if "spec_db" in i)
|
pls = (i for i in pls if "spec_db" in i)
|
||||||
|
|
||||||
pls = sorted(pls)
|
pls = sorted(pls)
|
||||||
|
print("found:", pls)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -119,8 +127,13 @@ class MainPanel(wx.Panel):
|
|||||||
self.entries.clear()
|
self.entries.clear()
|
||||||
|
|
||||||
self.instance = instance = self.cb_pls.GetValue()
|
self.instance = instance = self.cb_pls.GetValue()
|
||||||
|
|
||||||
|
if clargs.show_offline_pipelines:
|
||||||
|
cfg = pc.get_config(instance)
|
||||||
|
print("pipeline config:", cfg)
|
||||||
|
else:
|
||||||
cfg = pc.get_instance_config(instance)
|
cfg = pc.get_instance_config(instance)
|
||||||
print(cfg)
|
print("instance config:", cfg)
|
||||||
|
|
||||||
self.camera = camera = cfg["camera_name"]
|
self.camera = camera = cfg["camera_name"]
|
||||||
|
|
||||||
@ -216,7 +229,7 @@ class MainPanel(wx.Panel):
|
|||||||
xmin, xdelta, ymin, ydelta = roi
|
xmin, xdelta, ymin, ydelta = roi
|
||||||
xmax = xmin + xdelta
|
xmax = xmin + xdelta
|
||||||
ymax = ymin + ydelta
|
ymax = ymin + ydelta
|
||||||
return xmin, xmax, ymin, ymax
|
return ymin, ymax, xmin, xmax
|
||||||
|
|
||||||
|
|
||||||
def on_print(self, event):
|
def on_print(self, event):
|
||||||
@ -229,8 +242,14 @@ class MainPanel(wx.Panel):
|
|||||||
|
|
||||||
def on_save_cfg(self, event):
|
def on_save_cfg(self, event):
|
||||||
new_cfg = self.make_cfg()
|
new_cfg = self.make_cfg()
|
||||||
|
if clargs.show_offline_pipelines:
|
||||||
|
cfg = pc.get_config(self.instance)
|
||||||
|
cfg.update(new_cfg) # need to send a full config, a delta is not enough
|
||||||
|
res = pc.set_config(self.instance, cfg)
|
||||||
|
print("pipeline config:", res)
|
||||||
|
else:
|
||||||
res = pc.set_instance_config(self.instance, new_cfg)
|
res = pc.set_instance_config(self.instance, new_cfg)
|
||||||
print(res)
|
print("instance config:", res)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user