02.2026
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.App;
|
||||
import ch.psi.pshell.framework.Context;
|
||||
import ch.psi.pshell.plot.Plot;
|
||||
import ch.psi.pshell.ui.App;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.pshell.framework.Panel;
|
||||
import ch.psi.pshell.utils.State;
|
||||
import java.awt.Component;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -73,14 +74,14 @@ public class Correlation extends Panel {
|
||||
//DecimalFormat formatter = new DecimalFormat("0.##E0");
|
||||
void updateResults(){
|
||||
try{
|
||||
textCorrelation.setText(String.format("%1.4f", Double.valueOf((Double)getContext().getInterpreterVariable("corr"))));
|
||||
textCorrelation.setText(String.format("%1.4f", Double.valueOf((Double)Context.getSequencer().getInterpreterVariable("corr"))));
|
||||
} catch (Exception ex){
|
||||
textCorrelation.setText("");
|
||||
}
|
||||
|
||||
if (checkLinear.isSelected()){
|
||||
try{
|
||||
List pars = (List)getContext().getInterpreterVariable("pars_lin");
|
||||
List pars = (List)Context.getSequencer().getInterpreterVariable("pars_lin");
|
||||
//textLinear.setText(String.format("%1.3fx%+1.3f", (Double)(pars.get(1)), (Double)(pars.get(0))));
|
||||
textLinear.setText(String.format("%1.6gx%+1.6g",pars.get(1), pars.get(0)));
|
||||
} catch (Exception ex){
|
||||
@@ -90,7 +91,7 @@ public class Correlation extends Panel {
|
||||
|
||||
if (checkQuadratic.isSelected()){
|
||||
try{
|
||||
List pars = (List)getContext().getInterpreterVariable("pars_quad");
|
||||
List pars = (List)Context.getSequencer().getInterpreterVariable("pars_quad");
|
||||
//textQuadratic.setText(String.format("%1.2fx\u00B2 %+1.2fx%+1.2f", (Double)(pars.get(0)), (Double)(pars.get(1)), (Double)(pars.get(0))));
|
||||
textQuadratic.setText(String.format("%1.3gx\u00B2%+1.3gx%+1.3g", pars.get(0), pars.get(1), pars.get(0)));
|
||||
//textQuadratic.setText(formatter.format(pars.get(2))+ formatter.format(pars.get(1)) + formatter.format(pars.get(0)));
|
||||
|
||||
Reference in New Issue
Block a user