Compare commits

...

2 Commits

2 changed files with 16 additions and 1 deletions

View File

@@ -32,7 +32,9 @@ data = {
"x": None,
"y": [1,2,3],
"aaa": "aaa",
"c": "cccccc"
"c": "cccccc",
"image_background_enable": "passive",
"function": "spectrometer.py"
},
"ignored": {}
@@ -51,6 +53,8 @@ class PipelineClient:
return server_info
def get_instance_config(self, name):
return data[name]
def set_instance_config(self, name, config):
pass
def get_pipelines(self):
return data.keys()

11
scam.py
View File

@@ -104,6 +104,8 @@ class MainPanel(wx.Panel):
self.entries = entries = SettingsList(self)
self.Bind(wx.EVT_TEXT, self.on_change)
self.btn_print = btn_print = wx.Button(self, label="Print")
self.btn_save = btn_save = wx.Button(self, label="Save")
@@ -290,6 +292,15 @@ class MainPanel(wx.Panel):
pipeline = self.pls[self.instance]
res = pipeline.set(new_cfg)
print("result config:", res)
self.on_select(None) # get the server-side config again
self.btn_save.SetBackgroundColour(wx.NullColour)
def on_change(self, event):
old_cfg = self.orig_cfg
new_cfg = self.make_cfg()
color = wx.Colour(164, 36, 23) if new_cfg != old_cfg else wx.NullColour
self.btn_save.SetBackgroundColour(color)