Compare commits
2 Commits
67c8c1e93d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a9a67b7b6 | |||
| ea14faff14 |
17
scam.py
17
scam.py
@@ -82,6 +82,7 @@ class MainPanel(wx.Panel):
|
||||
self.camera = None
|
||||
|
||||
self.orig_cfg = None
|
||||
self.pipeline_cfg = None
|
||||
|
||||
self.pls = pls = Pipelines()
|
||||
|
||||
@@ -160,6 +161,8 @@ class MainPanel(wx.Panel):
|
||||
cfg = pipeline.get()
|
||||
print("current config:", cfg)
|
||||
|
||||
self.pipeline_cfg = cfg
|
||||
|
||||
# use contents of KNOWN_TYPES to pre-fill cfg
|
||||
#TODO use setdefault instead?
|
||||
cfg_o = cfg
|
||||
@@ -225,7 +228,7 @@ class MainPanel(wx.Panel):
|
||||
|
||||
def on_screenpanel(self, event):
|
||||
cam = self.camera
|
||||
cmd = f"screen_panel -persist -cam={cam}"
|
||||
cmd = f"screen_panel -persist -cam {cam}"
|
||||
print(cmd)
|
||||
subprocess.Popen(cmd.split(), start_new_session=True)
|
||||
|
||||
@@ -299,12 +302,16 @@ class MainPanel(wx.Panel):
|
||||
|
||||
|
||||
def on_change(self, event):
|
||||
old_cfg = self.orig_cfg
|
||||
old_cfg = self.pipeline_cfg or {}
|
||||
new_cfg = self.make_cfg()
|
||||
|
||||
for k, v in KNOWN_TYPES.items():
|
||||
if new_cfg.get(k) is None:
|
||||
new_cfg[k] = v
|
||||
new = {}
|
||||
old = {}
|
||||
for i in sorted(set(old_cfg) & set(new_cfg)):
|
||||
old[i] = old_cfg.get(i)
|
||||
new[i] = new_cfg.get(i)
|
||||
old_cfg = old
|
||||
new_cfg = new
|
||||
|
||||
color = wx.Colour(164, 36, 23) if new_cfg != old_cfg else wx.NullColour
|
||||
self.btn_save.SetBackgroundColour(color)
|
||||
|
||||
Reference in New Issue
Block a user