audrey06100 commited on
Commit
7d67389
·
1 Parent(s): 83b7c6a
Files changed (2) hide show
  1. app.py +3 -3
  2. channel_mapping.py +4 -0
app.py CHANGED
@@ -121,7 +121,7 @@ init_js = """
121
  }
122
  """
123
 
124
- indication_js = """
125
  (app_state, channel_info) => {
126
  app_state = JSON.parse(JSON.stringify(app_state));
127
  channel_info = JSON.parse(JSON.stringify(channel_info));
@@ -574,7 +574,7 @@ with gr.Blocks() as demo:
574
 
575
  ).success(
576
  fn = None,
577
- js = indication_js,
578
  inputs = [app_state_json, channel_info_json],
579
  outputs = []
580
  )
@@ -658,7 +658,7 @@ with gr.Blocks() as demo:
658
 
659
  ).success(
660
  fn = None,
661
- js = indication_js,
662
  inputs = [app_state_json, channel_info_json],
663
  outputs = []
664
  )
 
121
  }
122
  """
123
 
124
+ update_js = """
125
  (app_state, channel_info) => {
126
  app_state = JSON.parse(JSON.stringify(app_state));
127
  channel_info = JSON.parse(JSON.stringify(channel_info));
 
574
 
575
  ).success(
576
  fn = None,
577
+ js = update_js,
578
  inputs = [app_state_json, channel_info_json],
579
  outputs = []
580
  )
 
658
 
659
  ).success(
660
  fn = None,
661
+ js = update_js,
662
  inputs = [app_state_json, channel_info_json],
663
  outputs = []
664
  )
channel_mapping.py CHANGED
@@ -228,6 +228,10 @@ def mapping_stage1(app_state, channel_info, loc_file):
228
  input_dict[channel].matched = True
229
  input_dict[channel].assigned = True
230
 
 
 
 
 
231
  channel_info.update({
232
  "templateByName" : {k : v.__dict__ for k,v in template_dict.items()},
233
  "inputByName" : {k : v.__dict__ for k,v in input_dict.items()},
 
228
  input_dict[channel].matched = True
229
  input_dict[channel].assigned = True
230
 
231
+ # update names
232
+ template_order = template_montage.ch_names
233
+ input_order = input_montage.ch_names
234
+
235
  channel_info.update({
236
  "templateByName" : {k : v.__dict__ for k,v in template_dict.items()},
237
  "inputByName" : {k : v.__dict__ for k,v in input_dict.items()},