From 36f717c8bf1870eb6281773b5f7b92301292e2ac Mon Sep 17 00:00:00 2001 From: Simon Ebner Date: Mon, 14 Oct 2013 13:06:50 +0200 Subject: [PATCH] more cleanup --- .../fda/core/actions/ChannelAccessCondition.java | 3 --- .../java/ch/psi/fda/core/actions/ShellAction.java | 8 +++----- .../ch/psi/fda/core/actors/ComplexActuator.java | 8 -------- .../ch/psi/fda/core/guard/ChannelAccessGuard.java | 3 --- .../java/ch/psi/fda/serializer/DataSerializer.java | 3 --- .../ch/psi/fda/serializer/DataSerializerMAT.java | 2 -- .../ch/psi/fda/serializer/DataSerializerMAT2D.java | 3 --- .../fda/serializer/DataSerializerMAT2DZigZag.java | 3 --- .../ch/psi/fda/serializer/DataSerializerMDA.java | 5 ----- .../ch/psi/fda/serializer/DataSerializerTXT.java | 2 -- .../ch/psi/fda/serializer/DataSerializerTXT2D.java | 5 ----- .../psi/fda/serializer/DataSerializerTXTSplit.java | 13 ------------- 12 files changed, 3 insertions(+), 55 deletions(-) diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ChannelAccessCondition.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ChannelAccessCondition.java index 2756d91..05429bb 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ChannelAccessCondition.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ChannelAccessCondition.java @@ -31,8 +31,6 @@ import ch.psi.jcae.ChannelException; /** * Perform a put on the specified Channel Access channel. The put can be done synchronous or * asynchronously. - * @author ebner - * */ public class ChannelAccessCondition implements Action { @@ -47,7 +45,6 @@ public class ChannelAccessCondition implements Action { private volatile Thread waitT = null; /** - * Constructor * @param channel Channel to wait value for * @param expectedValue Value to wait for * @param timeout Timeout of the condition in milliseconds (null accepted - will take default wait timeout for channels ch.psi.jcae.ChannelBeanFactory.waitTimeout) diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ShellAction.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ShellAction.java index 3918186..6023d3b 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ShellAction.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/actions/ShellAction.java @@ -30,7 +30,6 @@ import ch.psi.fda.core.Action; /** * Action that executes a specified command when it is executed. - * */ public class ShellAction implements Action{ @@ -72,7 +71,7 @@ public class ShellAction implements Action{ // Log output of the shell script if loglevel is finest if(logger.isLoggable(Level.FINEST)){ logger.finest("STDOUT [BEGIN]"); - // TODO The readout of the stream should be in parallel to the processing of the script! I.e. the output appears in the log as it is generated by the script! + // Ideally the readout of the stream should be in parallel to the processing of the script! I.e. the output appears in the log as it is generated by the script! BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null; while((line=reader.readLine()) != null){ @@ -81,7 +80,7 @@ public class ShellAction implements Action{ logger.finest("STDOUT [END]"); logger.finest("STDERR [BEGIN]"); - // TODO The readout of the stream should be in parallel to the processing of the script! I.e. the output appears in the log as it is generated by the script! + // Ideally the readout of the stream should be in parallel to the processing of the script! I.e. the output appears in the log as it is generated by the script! reader = new BufferedReader(new InputStreamReader(process.getErrorStream())); line = null; while((line=reader.readLine()) != null){ @@ -101,10 +100,9 @@ public class ShellAction implements Action{ throw new RuntimeException("Script ["+script+"] returned with an exit value not equal to 0"); } } - process = null; // Ensure that the process is null + process = null; } catch(IOException e){ - // Convert Exception into unchecked RuntimeException throw new RuntimeException("Unable to execute script: "+script,e); } } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/actors/ComplexActuator.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/actors/ComplexActuator.java index b994c8f..1db950a 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/actors/ComplexActuator.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/actors/ComplexActuator.java @@ -31,9 +31,6 @@ import ch.psi.fda.core.Actor; * steps of the actors that this actuator consists of. * First all the steps of the first actor are used, after that the steps of the next actor are done. * Before the first step of an actor pre actions are available and after the last step of an actor a post action is available. - * - * @author ebner - * */ public class ComplexActuator implements Actor { @@ -75,9 +72,6 @@ public class ComplexActuator implements Actor { */ private boolean firstrun; - /** - * Constructor - */ public ComplexActuator(){ this.actors = new ArrayList(); this.preActions = new ArrayList(); @@ -91,7 +85,6 @@ public class ComplexActuator implements Actor { @Override public void set() throws InterruptedException { - // Throw an IllegalStateException in the case that set is called although there is no next step. if(!next){ throw new IllegalStateException("The actuator does not have any next step."); } @@ -142,7 +135,6 @@ public class ComplexActuator implements Actor { @Override public void init() { - // Initialize all actors this actor consist of for(Actor a: actors){ a.init(); diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/core/guard/ChannelAccessGuard.java b/ch.psi.fda/src/main/java/ch/psi/fda/core/guard/ChannelAccessGuard.java index e38220e..d459373 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/core/guard/ChannelAccessGuard.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/core/guard/ChannelAccessGuard.java @@ -32,11 +32,8 @@ import ch.psi.jcae.ChannelException; /** * Guard checking channels to meet a certain condition - * @author ebner - * */ public class ChannelAccessGuard implements Guard { - private static Logger logger = Logger.getLogger(ChannelAccessGuard.class.getName()); diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializer.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializer.java index e34bc3e..14e26b0 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializer.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializer.java @@ -19,8 +19,5 @@ package ch.psi.fda.serializer; -/** - * Data Serializer marker interface - */ public interface DataSerializer { } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT.java index bd0f1c5..486f900 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT.java @@ -37,8 +37,6 @@ import ch.psi.fda.core.messages.Message; /** * Serialize data received by a DataQueue into a Matlab file - * @author ebner - * */ public class DataSerializerMAT implements DataSerializer{ diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2D.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2D.java index e30e1cd..017001c 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2D.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2D.java @@ -39,8 +39,6 @@ import ch.psi.fda.core.messages.Message; /** * Serialize data received by a DataQueue into a Matlab file - * @author ebner - * */ public class DataSerializerMAT2D implements DataSerializer{ @@ -61,7 +59,6 @@ public class DataSerializerMAT2D implements DataSerializer{ private File outfile; /** - * Construtor * @param queue Data queue holding the data to serialize * @param file Name of the Matlab file to serialize the data to */ diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2DZigZag.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2DZigZag.java index 5725a7e..fa8248b 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2DZigZag.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMAT2DZigZag.java @@ -40,12 +40,9 @@ import ch.psi.fda.core.messages.Message; /** * Serialize data received by a DataQueue into a Matlab file - * @author ebner - * */ public class DataSerializerMAT2DZigZag implements DataSerializer{ - // Get Logger private static final Logger logger = Logger.getLogger(DataSerializerMAT2DZigZag.class.getName()); private DataMessageMetadata metadata; diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMDA.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMDA.java index a427d15..e7f265b 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMDA.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerMDA.java @@ -43,9 +43,6 @@ import ch.psi.fda.core.messages.StreamDelimiterMessage; * Serialize data received by a DataQueue * * http://www.aps.anl.gov/bcda/synApps/sscan/saveData_fileFormat.txt - * - * @author ebner - * */ public class DataSerializerMDA implements DataSerializer{ @@ -69,8 +66,6 @@ public class DataSerializerMDA implements DataSerializer{ this.file = file; } - - @Subscribe public void onMessage(Message message) { if(first){ diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT.java index f9d300e..ffced58 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT.java @@ -36,8 +36,6 @@ import ch.psi.fda.core.messages.StreamDelimiterMessage; /** * Serialize data received by a DataQueue - * @author ebner - * */ public class DataSerializerTXT implements DataSerializer{ diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT2D.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT2D.java index 87ce9f0..d614b43 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT2D.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXT2D.java @@ -37,8 +37,6 @@ import ch.psi.fda.core.messages.Message; /** * Serialize data received by a DataQueue into a Matlab file - * @author ebner - * */ public class DataSerializerTXT2D implements DataSerializer{ @@ -56,7 +54,6 @@ public class DataSerializerTXT2D implements DataSerializer{ boolean firstF; /** - * Construtor * @param queue Data queue holding the data to serialize * @param file Name of the Matlab file to serialize the data to */ @@ -201,7 +198,5 @@ public class DataSerializerTXT2D implements DataSerializer{ } catch (IOException e) { throw new RuntimeException("Data serializer had a problem writing to the specified file",e); } - } - } diff --git a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXTSplit.java b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXTSplit.java index 0639413..06223ca 100644 --- a/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXTSplit.java +++ b/ch.psi.fda/src/main/java/ch/psi/fda/serializer/DataSerializerTXTSplit.java @@ -36,8 +36,6 @@ import ch.psi.fda.core.messages.Message; /** * Serialize data received by a DataQueue - * @author ebner - * */ public class DataSerializerTXTSplit implements DataSerializer{ @@ -68,8 +66,6 @@ public class DataSerializerTXTSplit implements DataSerializer{ } } - - @Subscribe public void onMessage(Message message) { try{ @@ -199,13 +195,4 @@ public class DataSerializerTXTSplit implements DataSerializer{ // Close file writer.close(); } - - - /** - * Enable/disable the generation of the _0000 suffix in front of the extension of the out file - * @param appendSuffix the appendSuffix to set - */ - public void setAppendSuffix(boolean appendSuffix) { -// this.appendSuffix = appendSuffix; - } }