Annotated to Metoid, Loggable to History

This commit is contained in:
Alexander Nozik 2017-05-04 22:19:29 +03:00
parent de5e302f76
commit 5a0f9b2150
8 changed files with 13 additions and 13 deletions

View File

@ -16,9 +16,9 @@
package inr.numass.cryotemp; package inr.numass.cryotemp;
import hep.dataforge.meta.Annotated;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.meta.Metoid;
import hep.dataforge.names.Named; import hep.dataforge.names.Named;
import hep.dataforge.values.Value; import hep.dataforge.values.Value;
@ -28,7 +28,7 @@ import java.util.function.Function;
/** /**
* Created by darksnake on 28-Sep-16. * Created by darksnake on 28-Sep-16.
*/ */
public class PKT8Channel implements Named, Annotated { public class PKT8Channel implements Named, Metoid {
private final Meta meta; private final Meta meta;
private final Function<Double, Double> transformation; private final Function<Double, Double> transformation;

View File

@ -6,9 +6,9 @@
package inr.numass.cryotemp; package inr.numass.cryotemp;
import hep.dataforge.control.ports.VirtualPort; import hep.dataforge.control.ports.VirtualPort;
import hep.dataforge.meta.Annotated;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaUtils; import hep.dataforge.meta.MetaUtils;
import hep.dataforge.meta.Metoid;
import hep.dataforge.values.Value; import hep.dataforge.values.Value;
import java.time.Duration; import java.time.Duration;
@ -18,7 +18,7 @@ import java.util.Random;
/** /**
* @author Alexander Nozik * @author Alexander Nozik
*/ */
public class PKT8VirtualPort extends VirtualPort implements Annotated { public class PKT8VirtualPort extends VirtualPort implements Metoid {
private final Random generator = new Random(); private final Random generator = new Random();

View File

@ -6,8 +6,8 @@
package inr.numass.data; package inr.numass.data;
import hep.dataforge.data.Data; import hep.dataforge.data.Data;
import hep.dataforge.meta.Annotated;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.Metoid;
import hep.dataforge.names.Named; import hep.dataforge.names.Named;
import hep.dataforge.tables.Table; import hep.dataforge.tables.Table;
@ -20,7 +20,7 @@ import java.util.stream.Stream;
/** /**
* @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a> * @author <a href="mailto:altavir@gmail.com">Alexander Nozik</a>
*/ */
public interface NumassData extends Named, Annotated, Iterable<NumassPoint> { public interface NumassData extends Named, Metoid, Iterable<NumassPoint> {
String getDescription(); String getDescription();

View File

@ -51,7 +51,7 @@ public class PlotFitResultAction extends OneToOneAction<FitResult, FitResult> {
NavigablePointSource data = input.getData(); NavigablePointSource data = input.getData();
if (!(state.getModel() instanceof XYModel)) { if (!(state.getModel() instanceof XYModel)) {
context.getLog(name).reportError("The fit model should be instance of XYModel for this action. Action failed!"); context.getChronicle(name).reportError("The fit model should be instance of XYModel for this action. Action failed!");
return input; return input;
} }
XYModel model = (XYModel) state.getModel(); XYModel model = (XYModel) state.getModel();

View File

@ -65,7 +65,7 @@ public class DebunchAction extends OneToOneAction<RawNMFile, RawNMFile> {
}); });
report(context, name, "File {} completed", source.getName()); report(context, name, "File {} completed", source.getName());
context.getLog(name).print(new PrintWriter(buildActionOutput(context, name))); context.getChronicle(name).print(new PrintWriter(buildActionOutput(context, name)));
// res.configure(source.meta()); // res.configure(source.meta());
return res; return res;

View File

@ -58,7 +58,7 @@ public class MonitorCorrectAction extends OneToOneAction<Table, Table> {
TreeMap<Instant, DataPoint> index = getMonitorIndex(monitor, sourceData); TreeMap<Instant, DataPoint> index = getMonitorIndex(monitor, sourceData);
if (index.isEmpty()) { if (index.isEmpty()) {
context.getLog(name).reportError("No monitor points found"); context.getChronicle(name).reportError("No monitor points found");
return sourceData; return sourceData;
} }
double norm = 0; double norm = 0;

View File

@ -20,8 +20,8 @@ import hep.dataforge.exceptions.StorageException;
import hep.dataforge.io.envelopes.Envelope; import hep.dataforge.io.envelopes.Envelope;
import hep.dataforge.io.envelopes.EnvelopeBuilder; import hep.dataforge.io.envelopes.EnvelopeBuilder;
import hep.dataforge.io.messages.Responder; import hep.dataforge.io.messages.Responder;
import hep.dataforge.meta.Annotated;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.Metoid;
import hep.dataforge.storage.api.ObjectLoader; import hep.dataforge.storage.api.ObjectLoader;
import hep.dataforge.storage.api.StateLoader; import hep.dataforge.storage.api.StateLoader;
import hep.dataforge.storage.commons.LoaderFactory; import hep.dataforge.storage.commons.LoaderFactory;
@ -43,7 +43,7 @@ import static inr.numass.server.NumassServerUtils.getNotes;
* *
* @author darksnake * @author darksnake
*/ */
public class NumassRun implements Annotated, Responder { public class NumassRun implements Metoid, Responder {
public static final String RUN_STATE = "@run"; public static final String RUN_STATE = "@run";
public static final String RUN_NOTES = "@notes"; public static final String RUN_NOTES = "@notes";

View File

@ -8,7 +8,7 @@ import hep.dataforge.fx.fragments.LogFragment
import hep.dataforge.fx.work.Work import hep.dataforge.fx.work.Work
import hep.dataforge.fx.work.WorkManager import hep.dataforge.fx.work.WorkManager
import hep.dataforge.fx.work.WorkManagerFragment import hep.dataforge.fx.work.WorkManagerFragment
import hep.dataforge.meta.Annotated import hep.dataforge.meta.Metoid
import hep.dataforge.names.AlphanumComparator import hep.dataforge.names.AlphanumComparator
import hep.dataforge.names.Named import hep.dataforge.names.Named
import hep.dataforge.storage.api.Storage import hep.dataforge.storage.api.Storage
@ -239,7 +239,7 @@ class MainView : View() {
} else { } else {
return content.startTime().toString() return content.startTime().toString()
} }
} else if (content is Annotated) { } else if (content is Metoid) {
return content.meta().getString("file.timeModified", "") return content.meta().getString("file.timeModified", "")
} else { } else {
return ""; return "";