Closedown
This commit is contained in:
@@ -271,7 +271,45 @@ public class Eiger extends Panel {
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigActionPerformed
|
||||
|
||||
try{
|
||||
if (stddaq!=null){
|
||||
String title = "Std Daq Config";
|
||||
this.evalAsync("std_daq.get_config()").handle((ret,ex)->{
|
||||
if (ex!=null){
|
||||
showException((Exception) ex);
|
||||
} else {
|
||||
try{
|
||||
Map cfg = (Map) ret;
|
||||
String json = EncoderJson.encode(cfg, true);
|
||||
ScriptDialog dlg = new ScriptDialog(getWindow(), true, title, json, "json");
|
||||
dlg.setVisible(true);
|
||||
if (dlg.getResult()){
|
||||
json = dlg.getText();
|
||||
cfg = (Map) EncoderJson.decode(json, Map.class);
|
||||
setGlobalVar("_daq_config", cfg);
|
||||
evalAsync("std_daq.set_config(_daq_config)").handle((r,e)->{
|
||||
if (e!=null){
|
||||
showException((Exception) e);
|
||||
} else {
|
||||
showMessage(title, "Success updating config");
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
}
|
||||
} catch (Exception e){
|
||||
showException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
} catch (Exception ex){
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_buttonConfigActionPerformed
|
||||
|
||||
private void buttonConfigDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigDetActionPerformed
|
||||
@@ -294,12 +332,12 @@ public class Eiger extends Panel {
|
||||
if (dlg.getResult()){
|
||||
json = dlg.getText();
|
||||
cfg = (Map) EncoderJson.decode(json, Map.class);
|
||||
setGlobalVar("_detector_config", cfg);
|
||||
evalAsync("detector.set_pars(_detector_config)").handle((r,e)->{
|
||||
setGlobalVar("_detector_pars", cfg);
|
||||
evalAsync("detector.set_pars(_detector_pars)").handle((r,e)->{
|
||||
if (e!=null){
|
||||
showException((Exception) e);
|
||||
} else {
|
||||
showMessage(title, "Success");
|
||||
showMessage(title, "Success updating parameters");
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user