more cleanup
This commit is contained in:
@@ -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<E> implements Action {
|
||||
|
||||
@@ -47,7 +45,6 @@ public class ChannelAccessCondition<E> 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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Actor>();
|
||||
this.preActions = new ArrayList<Action>();
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -19,8 +19,5 @@
|
||||
|
||||
package ch.psi.fda.serializer;
|
||||
|
||||
/**
|
||||
* Data Serializer marker interface
|
||||
*/
|
||||
public interface DataSerializer {
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -36,8 +36,6 @@ import ch.psi.fda.core.messages.StreamDelimiterMessage;
|
||||
|
||||
/**
|
||||
* Serialize data received by a DataQueue
|
||||
* @author ebner
|
||||
*
|
||||
*/
|
||||
public class DataSerializerTXT implements DataSerializer{
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user