First iteration of text system.
This commit is contained in:
parent
cc9c353f33
commit
0959a609bb
@ -77,7 +77,7 @@ public class PrepareDataAction extends OneToOneAction<NumassData, Table> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (meta.hasNode("correction")) {
|
if (meta.hasNode("correction")) {
|
||||||
corrections.addAll(meta.getNodes("correction").stream()
|
corrections.addAll(meta.getMetaList("correction").stream()
|
||||||
.map((Function<Meta, Correction>) this::makeCorrection)
|
.map((Function<Meta, Correction>) this::makeCorrection)
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ public class PrepareDataAction extends OneToOneAction<NumassData, Table> {
|
|||||||
//Генерируем автоматический формат по первой строчке
|
//Генерируем автоматический формат по первой строчке
|
||||||
format = TableFormat.forPoint(dataList.get(0));
|
format = TableFormat.forPoint(dataList.get(0));
|
||||||
} else {
|
} else {
|
||||||
format = TableFormat.fixedWidth(8, parnames);
|
format = TableFormat.forNames(parnames);
|
||||||
}
|
}
|
||||||
|
|
||||||
String head;
|
String head;
|
||||||
|
@ -21,10 +21,11 @@ import hep.dataforge.tables.TableFormat;
|
|||||||
import hep.dataforge.values.Value;
|
import hep.dataforge.values.Value;
|
||||||
import inr.numass.storage.NMFile;
|
import inr.numass.storage.NMFile;
|
||||||
import inr.numass.storage.NMPoint;
|
import inr.numass.storage.NMPoint;
|
||||||
|
import org.apache.commons.math3.util.Pair;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.commons.math3.util.Pair;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -40,7 +41,7 @@ public class SlicedData extends SimplePointSource {
|
|||||||
ArrayList<String> names = new ArrayList<>(intervals.keySet());
|
ArrayList<String> names = new ArrayList<>(intervals.keySet());
|
||||||
names.add(0, TNAME);
|
names.add(0, TNAME);
|
||||||
names.add(0, UNAME);
|
names.add(0, UNAME);
|
||||||
return TableFormat.fixedWidth(8, names);
|
return TableFormat.forNames(names);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class SummaryAction extends ManyToOneAction<FitState, Table> {
|
|||||||
}
|
}
|
||||||
names[names.length - 1] = "chi2";
|
names[names.length - 1] = "chi2";
|
||||||
|
|
||||||
ListTable.Builder res = new ListTable.Builder(TableFormat.fixedWidth(8, names));
|
ListTable.Builder res = new ListTable.Builder(TableFormat.forNames(names));
|
||||||
|
|
||||||
double[] weights = new double[parNames.length];
|
double[] weights = new double[parNames.length];
|
||||||
Arrays.fill(weights, 0);
|
Arrays.fill(weights, 0);
|
||||||
|
@ -10,7 +10,7 @@ import hep.dataforge.storage.api.Loader;
|
|||||||
import hep.dataforge.storage.api.StateLoader;
|
import hep.dataforge.storage.api.StateLoader;
|
||||||
import hep.dataforge.storage.api.Storage;
|
import hep.dataforge.storage.api.Storage;
|
||||||
import hep.dataforge.storage.commons.JSONMetaWriter;
|
import hep.dataforge.storage.commons.JSONMetaWriter;
|
||||||
import hep.dataforge.storage.servlet.Utils;
|
import hep.dataforge.storage.servlet.ServletUtils;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import ratpack.handling.Context;
|
import ratpack.handling.Context;
|
||||||
import ratpack.handling.Handler;
|
import ratpack.handling.Handler;
|
||||||
@ -40,7 +40,7 @@ public class NumassRootHandler implements Handler {
|
|||||||
public void handle(Context ctx) throws Exception {
|
public void handle(Context ctx) throws Exception {
|
||||||
try {
|
try {
|
||||||
ctx.getResponse().contentType("text/html");
|
ctx.getResponse().contentType("text/html");
|
||||||
Template template = Utils.freemarkerConfig().getTemplate("NumassRoot.ftl");
|
Template template = ServletUtils.freemarkerConfig().getTemplate("NumassRoot.ftl");
|
||||||
|
|
||||||
Map data = new HashMap(6);
|
Map data = new HashMap(6);
|
||||||
if (!server.meta().isEmpty()) {
|
if (!server.meta().isEmpty()) {
|
||||||
|
@ -10,8 +10,8 @@ import hep.dataforge.meta.MetaBuilder;
|
|||||||
import hep.dataforge.storage.api.ObjectLoader;
|
import hep.dataforge.storage.api.ObjectLoader;
|
||||||
import hep.dataforge.storage.api.PointLoader;
|
import hep.dataforge.storage.api.PointLoader;
|
||||||
import hep.dataforge.storage.api.Storage;
|
import hep.dataforge.storage.api.Storage;
|
||||||
|
import hep.dataforge.storage.servlet.ServletUtils;
|
||||||
import hep.dataforge.storage.servlet.StorageRatpackHandler;
|
import hep.dataforge.storage.servlet.StorageRatpackHandler;
|
||||||
import hep.dataforge.storage.servlet.Utils;
|
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import ratpack.handling.Context;
|
import ratpack.handling.Context;
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ public class NumassStorageHandler extends StorageRatpackHandler {
|
|||||||
try {
|
try {
|
||||||
ObjectLoader<NumassNote> noteLoader = (ObjectLoader<NumassNote>) loader;
|
ObjectLoader<NumassNote> noteLoader = (ObjectLoader<NumassNote>) loader;
|
||||||
ctx.getResponse().contentType("text/html");
|
ctx.getResponse().contentType("text/html");
|
||||||
Template template = Utils.freemarkerConfig().getTemplate("NoteLoader.ftl");
|
Template template = ServletUtils.freemarkerConfig().getTemplate("NoteLoader.ftl");
|
||||||
|
|
||||||
List<String> notes = getNotes(noteLoader).limit(100).map(note -> render(note)).collect(Collectors.toList());
|
List<String> notes = getNotes(noteLoader).limit(100).map(note -> render(note)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user