Fixed some bad configuration (changed sdc.psi.ch/slsyoke1.psi.ch to

yoke.psi.ch)
This commit is contained in:
2012-02-02 08:56:06 +01:00
parent fc84512b23
commit 2e09e7bab6
8 changed files with 127 additions and 29 deletions
+2 -2
View File
@@ -149,12 +149,12 @@
<snapshotRepository>
<id>i.snapshots</id>
<name>Artifactory Snapshots</name>
<url>http://slsyoke1/artifactory/libs-snapshots-local</url>
<url>http://yoke/artifactory/libs-snapshots-local</url>
</snapshotRepository>
<repository>
<id>i.releases</id>
<name>Atrifactory Releases</name>
<url>http://slsyoke1/artifactory/libs-releases-local</url>
<url>http://yoke/artifactory/libs-releases-local</url>
</repository>
</distributionManagement>
</project>
@@ -172,7 +172,8 @@ public class ParallelCrlogic implements ActionLoop {
try {
bf.get();
} catch (ExecutionException e) {
logger.log(Level.WARNING, "Something went wrong while waiting for crthreads to finish", e);
logger.log(Level.WARNING, "Something went wrong while waiting for crthreads to finish");
throw new RuntimeException(e);
}
}
@@ -0,0 +1,102 @@
/**
*
* Copyright 2012 Paul Scherrer Institute. All rights reserved.
*
* This code is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This code is distributed in the hope that it will be useful, but without any
* warranty; without even the implied warranty of merchantability or fitness for
* a particular purpose. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this code. If not, see <http://www.gnu.org/licenses/>.
*
*/
package ch.psi.fda;
/**
* @author ebner
*
*/
public class TestConfiguration {
private static final TestConfiguration instance = new TestConfiguration();
private final String otfPrefix = "MTEST-HW3-OTFX";
private final String crlogicPrefix = "MTEST-HW3-CRL";
private final String prefixScaler = "MTEST-HW3:JS";
private final String server = "yoke.psi.ch";
private final String share = "/usr/local/nfsshare";
private final String smbShare = "smb://:@"+server+"/otftemp/"; // It is important to have the last slash / !
private final String motor1 = "MTEST-HW3:MOT1";
private final String analogIn1 = "MTEST-HW3-AI1:AI_01";
private TestConfiguration(){
}
public static TestConfiguration getInstance(){
return instance;
}
/**
* @return the prefix
*/
public String getCrlogicPrefix() {
return crlogicPrefix;
}
/**
* @return the prefixScaler
*/
public String getPrefixScaler() {
return prefixScaler;
}
/**
* @return the server
*/
public String getServer() {
return server;
}
/**
* @return the share
*/
public String getShare() {
return share;
}
/**
* @return the smbShare
*/
public String getSmbShare() {
return smbShare;
}
/**
* @return the motor1
*/
public String getMotor1() {
return motor1;
}
/**
* @return the analogIn1
*/
public String getAnalogIn1() {
return analogIn1;
}
/**
* @return the otfPrefix
*/
public String getOtfPrefix() {
return otfPrefix;
}
}
@@ -27,6 +27,8 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ch.psi.fda.TestConfiguration;
/**
* @author ebner
*
@@ -45,7 +47,7 @@ public class DistributedFileTest {
@Before
public void setUp() throws Exception {
file = new DistributedFile("src/test/resources");
smbfile = new DistributedFile("smb://:@slsyoke1.psi.ch/otftemp/");
smbfile = new DistributedFile(TestConfiguration.getInstance().getSmbShare());
}
/**
@@ -31,6 +31,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ch.psi.fda.TestConfiguration;
import ch.psi.fda.core.actors.OTFActuator;
import ch.psi.fda.core.loops.OTFLoop;
import ch.psi.fda.core.messages.ControlMessage;
@@ -82,12 +83,7 @@ public class OTFLoopTest {
}
private static final String motor = "MTEST-HW3:MOT1";
private static final String channelPrefix = "MTEST-HW3-OTFX";
private static final String channelAnalogIn = "MTEST-HW3-AI1:AI_01";
private static final String server = "slsyoke1.psi.ch";
private static final String share = "/usr/local/nfsshare";
private static final String smbShare = "smb://:@slsyoke1.psi.ch/otftemp/";
private static final TestConfiguration configuration = TestConfiguration.getInstance();
private OTFLoop loopZigZag;
@@ -100,18 +96,18 @@ public class OTFLoopTest {
@Before
public void setUp() throws Exception {
statusChannel = ChannelBeanFactory.getFactory().createChannelBean(Integer.class, channelPrefix+":USTAT", false);
statusChannel = ChannelBeanFactory.getFactory().createChannelBean(Integer.class, configuration.getOtfPrefix()+":USTAT", false);
OTFActuator actor = new OTFActuator("id", motor, null, 0, 8, 0.5, 0.5, 0);
OTFActuator actor = new OTFActuator("id", configuration.getMotor1(), null, 0, 8, 0.5, 0.5, 0);
OTFReadbackSensor s1 = new OTFReadbackSensor("id0");
OTFScalerChannelSensor s2 = new OTFScalerChannelSensor("id1", 0);
OTFScalerChannelSensor s3 = new OTFScalerChannelSensor("id2", 1);
MillisecondTimestampSensor s4 = new MillisecondTimestampSensor("id3");
OTFNamedChannelSensor s5 = new OTFNamedChannelSensor("id4", channelAnalogIn);
OTFNamedChannelSensor s5 = new OTFNamedChannelSensor("id4", configuration.getAnalogIn1());
// ZigZag loop
loopZigZag = new OTFLoop(channelPrefix, server, share, smbShare, true);
loopZigZag = new OTFLoop(configuration.getOtfPrefix(), configuration.getServer(), configuration.getShare(), configuration.getSmbShare(), true);
loopZigZag.setActor(actor);
loopZigZag.getSensors().add(s1);
loopZigZag.getSensors().add(s2);
@@ -121,7 +117,7 @@ public class OTFLoopTest {
// Normal loop
loop = new OTFLoop(channelPrefix, server, share, smbShare, false);
loop = new OTFLoop(configuration.getOtfPrefix(), configuration.getServer(), configuration.getShare(), configuration.getSmbShare(), false);
loop.setActor(actor);
loop.getSensors().add(s1);
loop.getSensors().add(s2);
@@ -53,7 +53,7 @@ public class SambaTest {
// smbShare = "smb://x05laop:mXAS@x05la/x05laop/Data1/otfTmp/";
smbShare = "smb://x05la.psi.ch/x05laop/Data1/otfTmp/";
// smbShare = "smb://x05laop:mXAS@x05la/x05laop/Data1/otfTmp/000000.txt.lock";
// smbShare = "smb://:@slsyoke1.psi.ch/otftemp/";
// smbShare = "smb://:@yoke.psi.ch/otftemp/";
// NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("x05laop:mXAS");
// SmbFile tmpDir = new SmbFile(smbShare,auth);
SmbFile tmpDir = new SmbFile(smbShare);
@@ -31,6 +31,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ch.psi.fda.TestConfiguration;
import ch.psi.fda.core.Sensor;
import ch.psi.fda.core.actors.OTFActuator;
import ch.psi.fda.core.messages.EndOfStreamMessage;
@@ -67,14 +68,10 @@ public class ParallelCrlogicTest {
@Test(timeout=60000)
public void testExecute() throws InterruptedException, CAException{
String prefix = "MTEST-HW3-CRL";
String prefixScaler = "MTEST-HW3:JS";
String server = "yoke.psi.ch";
String share = "/usr/local/nfsshare";
String smbShare = "smb://:@"+server+"/otftemp/";
TestConfiguration c = TestConfiguration.getInstance();
boolean zigZag = false;
String name = "MTEST-HW3:MOT1";
String readback = null;
double start = 0;
double end = 2;
@@ -83,8 +80,8 @@ public class ParallelCrlogicTest {
double additionalBacklash = 0;
List<Sensor> sensors = new ArrayList<Sensor>();
ChannelAccessDoubleSensor s2 = new ChannelAccessDoubleSensor("mot1", name+".RVAL");
ChannelAccessDoubleSensor s1 = new ChannelAccessDoubleSensor("mot1", name+".RBV");
ChannelAccessDoubleSensor s2 = new ChannelAccessDoubleSensor("mot1", c.getMotor1()+".RVAL");
ChannelAccessDoubleSensor s1 = new ChannelAccessDoubleSensor("mot1", c.getMotor1()+".RBV");
sensors.add(s1);
sensors.add(s2);
@@ -92,8 +89,8 @@ public class ParallelCrlogicTest {
ScrlogicLoop scrlogic = new ScrlogicLoop(sensors);
CrlogicLoop crlogic = new CrlogicLoop(prefix, server, share, smbShare, zigZag);
crlogic.setActor(new OTFActuator("cmot", name, readback, start, end, stepSize, integrationTime, additionalBacklash));
CrlogicLoop crlogic = new CrlogicLoop(c.getCrlogicPrefix(), c.getServer(), c.getShare(), c.getSmbShare(), zigZag);
crlogic.setActor(new OTFActuator("cmot", c.getMotor1(), readback, start, end, stepSize, integrationTime, additionalBacklash));
crlogic.getSensors().add(new OTFNamedChannelSensor("trigger", "TRIGGER0"));
crlogic.getSensors().add(new OTFScalerChannelSensor("scaler0", 0));
crlogic.getSensors().add(new OTFScalerChannelSensor("scaler1", 1));
@@ -102,7 +99,7 @@ public class ParallelCrlogicTest {
// Initialize scaler template
VSC16ScalerChannelsTemplate scalertemplate = new VSC16ScalerChannelsTemplate();
ChannelBeanFactory.getFactory().createChannelBeans(scalertemplate, prefixScaler);
ChannelBeanFactory.getFactory().createChannelBeans(scalertemplate, c.getPrefixScaler());
ParallelCrlogic pcrlogic = new ParallelCrlogic(crlogic, scrlogic);
@@ -3,9 +3,9 @@ ch.psi.fda.aq.data.filePrefix=${yyyy_MM}/${yyyyMMdd}/${yyyyMMddHHmmss}_${name}/$
# OTF scan related configuration
ch.psi.fda.aq.otf.channelPrefix=MTEST-HW3-OTFX
ch.psi.fda.aq.otf.nfsServer=slsyoke1.psi.ch
ch.psi.fda.aq.otf.nfsServer=yoke.psi.ch
ch.psi.fda.aq.otf.nfsShare=/usr/local/nfsshare
ch.psi.fda.aq.otf.smbShare=smb://:@sdc.psi.ch/otftemp/
ch.psi.fda.aq.otf.smbShare=smb://:@yoke.psi.ch/otftemp/
ch.psi.fda.aq.otf.useCrlogic=true
ch.psi.fda.aq.otf.crlogicPrefix=MTEST-HW3-CRL