diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicDeltaDataFilter.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicDeltaDataFilter.java index 08b4f7c..0d74f29 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicDeltaDataFilter.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicDeltaDataFilter.java @@ -20,8 +20,7 @@ package ch.psi.fda.core.loops.cr; /** - * @author ebner - * + * Filter calculating the delta of two subsequent values */ public class CrlogicDeltaDataFilter { diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicLoop.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicLoop.java index c75b718..9434813 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicLoop.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/CrlogicLoop.java @@ -47,8 +47,6 @@ import ch.psi.jcae.ChannelException; import ch.psi.jcae.ChannelService; /** - * @author ebner - * * While using Crlogic the IOC system clock rate should/must be set to 1000 (default 60) * * sysClkRateSet 1000 @@ -756,7 +754,6 @@ public class CrlogicLoop implements ActionLoop { readoutThread.interrupt(); try { - cservice.destroyAnnotatedChannels(template); cservice.destroyAnnotatedChannels(motortemplate); template = null; diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/ParallelCrlogicStreamMerge.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/ParallelCrlogicStreamMerge.java index e218a72..00ebc9f 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/ParallelCrlogicStreamMerge.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/ParallelCrlogicStreamMerge.java @@ -30,8 +30,9 @@ import ch.psi.fda.core.messages.EndOfStreamMessage; import ch.psi.fda.core.messages.Message; /** - * @author ebner - * + * Class to merge two data streams into one. The secondary queues data is added to the primary queues data. + * The resulting queue therefor will hold the same amount of elements as the primary queue does. + * The datagroup flag set in the end of stream message will be set according to the flag set in the primary queue. */ public class ParallelCrlogicStreamMerge { @@ -41,10 +42,6 @@ public class ParallelCrlogicStreamMerge { private DataQueue secondaryQueue; /** - * Class to merge two data streams into one. The secondary queues data is added to the primary queues data. - * The resulting queue therefor will hold the same amount of elements as the primary queue does. - * The datagroup flag set in the end of stream message will be set according to the flag set in the primary queue. - * * @param pqueue Primary/master queue * @param squeue Secondary queue */ @@ -78,13 +75,10 @@ public class ParallelCrlogicStreamMerge { long milliseconds = (long) (timestamp*1000); long nanoOffset = (long)((timestamp*1000-milliseconds)*1000000); -// System.out.println("timestamp: "+new Date(milliseconds)+" "+milliseconds+" ."+nanoOffset); - while(true){ // Assumption: the secondary Queue holds at least the data up to the // timestamp of the primary queue Message mess = secondaryQueue.getQueue().peek(); -// Message mess = secondaryQueue.getQueue().take(); if(mess instanceof EndOfStreamMessage){ break; @@ -99,20 +93,15 @@ public class ParallelCrlogicStreamMerge { // message from the primary queue - if the timestamp is bigger do not take message out of the queue DataMessage msCheck = (DataMessage) mess; -// System.out.println("Mess: "+mess); - long currMilliCheck = ((Double) msCheck.getData().get(0)).longValue(); long currNanoCheck = ((Double) msCheck.getData().get(1)).longValue(); - // Check if(currMilliCheck>milliseconds || (currMilliCheck==milliseconds && currNanoCheck>nanoOffset)){ break; } DataMessage ms = (DataMessage) secondaryQueue.getQueue().take(); -// System.out.println("Ms: "+ms); - currData = ms.getData(); // Remove timestamps currData.remove(0); diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateCrlogic.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateCrlogic.java index d700a58..57736fc 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateCrlogic.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateCrlogic.java @@ -22,17 +22,8 @@ package ch.psi.fda.core.loops.cr; import ch.psi.jcae.Channel; import ch.psi.jcae.annotation.CaChannel; -/** - * @author ebner - * - */ public class TemplateCrlogic { - /** - * Status of the OTFSCAN IOC logic - */ - public enum Status { SETUP, INACTIVE, INITIALIZE, ACTIVE, STOP, FAULT, ERROR }; - /** * Ticks per second - IOC setting * ATTENTION - This field must only be set bu the IOC - ATTENTION @@ -43,6 +34,7 @@ public class TemplateCrlogic { /** * Status of the OTFSCAN IOC logic */ + public enum Status { SETUP, INACTIVE, INITIALIZE, ACTIVE, STOP, FAULT, ERROR }; @CaChannel(type=String.class, name ="${PREFIX}:STATUS") private Channel status; @@ -83,7 +75,6 @@ public class TemplateCrlogic { @CaChannel(type=Boolean.class, name ="${PREFIX}:FAPPE") private Channel appendFile; - /** * Readout resources */ @@ -91,65 +82,31 @@ public class TemplateCrlogic { private Channel readoutResources; - /** - * @return the ticksPerSecond - */ + public Channel getTicksPerSecond() { return ticksPerSecond; } - - /** - * @return the status - */ public Channel getStatus() { return status; } - - /** - * @return the message - */ public Channel getMessage() { return message; } - - /** - * @return the ticksBetweenInterrupts - */ public Channel getTicksBetweenInterrupts() { return ticksBetweenInterrupts; } - - /** - * @return the nfsServer - */ public Channel getNfsServer() { return nfsServer; } - - /** - * @return the nfsShare - */ public Channel getNfsShare() { return nfsShare; } - - /** - * @return the dataFile - */ public Channel getDataFile() { return dataFile; } - - /** - * @return the appendFile - */ public Channel getAppendFile() { return appendFile; } - - /** - * @return the readoutResources - */ public Channel getReadoutResources() { return readoutResources; } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateEncoder.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateEncoder.java index bfc464a..c61380d 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateEncoder.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateEncoder.java @@ -44,6 +44,7 @@ public class TemplateEncoder { private Channel direction; + public Channel getResolution() { return resolution; } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateMotor.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateMotor.java index 0dcd79f..fea3dcb 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateMotor.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateMotor.java @@ -22,10 +22,6 @@ package ch.psi.fda.core.loops.cr; import ch.psi.jcae.Channel; import ch.psi.jcae.annotation.CaChannel; -/** - * @author ebner - * - */ public class TemplateMotor { public enum Type {SOFT_CHANNEL, MOTOR_SIMULATION, OMS_VME58, OMS_MAXv}; @@ -334,317 +330,140 @@ public class TemplateMotor { @CaChannel(type=Boolean.class, name ="${PREFIX}.DMOV", monitor=true) private Channel moveDone; - /** - * @return the highLimit - */ + + public Channel getHighLimit() { return highLimit; } - - /** - * @return the lowLimit - */ public Channel getLowLimit() { return lowLimit; } - - /** - * @return the readbackValue - */ public Channel getReadbackValue() { return readbackValue; } - - /** - * @return the setValue - */ public Channel getSetValue() { return setValue; } - - /** - * @return the relativeMoveValue - */ public Channel getRelativeMoveValue() { return relativeMoveValue; } - - /** - * @return the tweakValue - */ public Channel getTweakValue() { return tweakValue; } - - /** - * @return the tweakReverse - */ public Channel getTweakReverse() { return tweakReverse; } - - /** - * @return the tweakForward - */ public Channel getTweakForward() { return tweakForward; } - - /** - * @return the jogReverse - */ public Channel getJogReverse() { return jogReverse; } - - /** - * @return the jogForward - */ public Channel getJogForward() { return jogForward; } - - /** - * @return the homeReverse - */ public Channel getHomeReverse() { return homeReverse; } - - /** - * @return the homeForward - */ public Channel getHomeForward() { return homeForward; } - - /** - * @return the engineeringUnit - */ public Channel getEngineeringUnit() { return engineeringUnit; } - - /** - * @return the type - */ public Channel getType() { return type; } - - /** - * @return the description - */ public Channel getDescription() { return description; } - - /** - * @return the dialHighLimit - */ public Channel getDialHighLimit() { return dialHighLimit; } - - /** - * @return the dialLowLimit - */ public Channel getDialLowLimit() { return dialLowLimit; } - - /** - * @return the dialReadbackValue - */ public Channel getDialReadbackValue() { return dialReadbackValue; } - - /** - * @return the dialSetValue - */ public Channel getDialSetValue() { return dialSetValue; } - - /** - * @return the rawValue - */ public Channel getRawValue() { return rawValue; } - - /** - * @return the rawReadbackValue - */ public Channel getRawReadbackValue() { return rawReadbackValue; } - - /** - * @return the command - */ public Channel getCommand() { return command; } - - /** - * @return the calibration - */ public Channel getCalibration() { return calibration; } - - /** - * @return the userOffset - */ public Channel getOffset() { return offset; } - - /** - * @return the offsetMode - */ public Channel getOffsetMode() { return offsetMode; } - - /** - * @return the direction - */ public Channel getDirection() { return direction; } - - /** - * @return the velocity - */ public Channel getVelocity() { return velocity; } - - /** - * @return the backlashVelocity - */ public Channel getBacklashVelocity() { return backlashVelocity; } - - /** - * @return the baseSpeed - */ public Channel getBaseSpeed() { return baseSpeed; } - - /** - * @return the accelerationTime - */ public Channel getAccelerationTime() { return accelerationTime; } - - /** - * @return the backlashAccelerationTime - */ public Channel getBacklashAccelerationTime() { return backlashAccelerationTime; } - - /** - * @return the backlashDistance - */ public Channel getBacklashDistance() { return backlashDistance; } - - /** - * @return the moveFracion - */ public Channel getMoveFracion() { return moveFracion; } - - /** - * @return the motorResolution - */ public Channel getMotorResolution() { return motorResolution; } - - /** - * @return the encoderResolution - */ public Channel getEncoderResolution() { return encoderResolution; } - - /** - * @return the readbackResolution - */ public Channel getReadbackResolution() { return readbackResolution; } - - /** - * @return the retryDeadband - */ public Channel getRetryDeadband() { return retryDeadband; } - - /** - * @return the maxRetryCount - */ public Channel getMaxRetryCount() { return maxRetryCount; } - - /** - * @return the retryCount - */ public Channel getRetryCount() { return retryCount; } - - /** - * @return the useEncoder - */ public Channel getUseEncoder() { return useEncoder; } - - /** - * @return the useReadback - */ public Channel getUseReadback() { return useReadback; } - - /** - * @return the readbackDelay - */ public Channel getReadbackDelay() { return readbackDelay; } - - /** - * @return the readbackLink - */ public Channel getReadbackLink() { return readbackLink; } - - /** - * @return the outputMode - */ public Channel getOutputMode() { return outputMode; } - - /** - * @return the moveDone - */ public Channel getMoveDone() { return moveDone; } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateVSC16Scaler.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateVSC16Scaler.java index bc120dc..4bac08c 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateVSC16Scaler.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TemplateVSC16Scaler.java @@ -24,17 +24,12 @@ import java.util.List; import ch.psi.jcae.Channel; import ch.psi.jcae.annotation.CaChannel; -/** - * @author ebner - * - */ public class TemplateVSC16Scaler { - - public enum Command {Done, Count}; /** * Command */ + public enum Command {Done, Count}; @CaChannel(type=Integer.class, name ="${PREFIX}.CNT") private Channel command; @@ -65,39 +60,21 @@ public class TemplateVSC16Scaler { @CaChannel(type=Integer.class, name={"${PREFIX}.PR1", "${PREFIX}.PR2", "${PREFIX}.PR3", "${PREFIX}.PR4", "${PREFIX}.PR5", "${PREFIX}.PR6", "${PREFIX}.PR7", "${PREFIX}.PR8", "${PREFIX}.PR9", "${PREFIX}.PR10", "${PREFIX}.PR11", "${PREFIX}.PR12", "${PREFIX}.PR13", "${PREFIX}.PR14", "${PREFIX}.PR15", "${PREFIX}.PR16"}) private List> channelPresetCount; - /** - * @return the command - */ + + public Channel getCommand() { return command; } - - /** - * @return the mode - */ public Channel getMode() { return mode; } - - /** - * @return the channelDescription - */ public List> getChannelDescription() { return channelDescription; } - - /** - * @return the channelGate - */ public List> getChannelGate() { return channelGate; } - - /** - * @return the channelPresetCount - */ public List> getChannelPresetCount() { return channelPresetCount; } - } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValue.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValue.java index e381a63..0250cf4 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValue.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValue.java @@ -19,15 +19,11 @@ package ch.psi.fda.core.loops.cr; -/** - * @author ebner - * - */ public class TimestampedValue { - private Double value; - private long timestamp; - private long nanosecondsOffset; + private final Double value; + private final long timestamp; + private final long nanosecondsOffset; public TimestampedValue(Double value, long timestamp, long nanosecondsOffset){ this.value = value; @@ -35,47 +31,13 @@ public class TimestampedValue { this.nanosecondsOffset = nanosecondsOffset; } - /** - * @return the value - */ public Double getValue() { return value; } - - /** - * @param value the value to set - */ - public void setValue(Double value) { - this.value = value; - } - - /** - * @return the timestamp - */ public long getTimestamp() { return timestamp; } - - /** - * @param timestamp the timestamp to set - */ - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - /** - * @return the nanosecondsOffset - */ public long getNanosecondsOffset() { return nanosecondsOffset; } - - /** - * @param nanosecondsOffset the nanosecondsOffset to set - */ - public void setNanosecondsOffset(long nanosecondsOffset) { - this.nanosecondsOffset = nanosecondsOffset; - } - - } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValueComparator.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValueComparator.java index 965b6e7..6d0cc69 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValueComparator.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/loops/cr/TimestampedValueComparator.java @@ -22,8 +22,7 @@ package ch.psi.fda.core.loops.cr; import java.util.Comparator; /** - * @author ebner - * + * Comparator for comparint 2 timestamped values */ public class TimestampedValueComparator implements Comparator {