Skip to content
Snippets Groups Projects
Commit 83a055f1 authored by PICHON's avatar PICHON
Browse files

Code cleaning

parent edcd90ce
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ import java.util.List;
import org.nfunk.jep.JEP;
import org.nfunk.jep.ParseException;
import org.tango.utils.DevFailedUtils;
import com.google.common.collect.BiMap;
......
package fr.soleil.tango.parser.datasource;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
......@@ -13,14 +11,11 @@ import org.lsmp.djep.vectorJep.values.MVector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tango.utils.DevFailedUtils;
import org.tango.utils.TangoUtil;
import fr.esrf.Tango.AttrDataFormat;
import fr.esrf.Tango.DevFailed;
import fr.esrf.Tango.DevState;
import fr.esrf.TangoApi.CallBack;
import fr.esrf.TangoApi.DeviceAttribute;
import fr.esrf.TangoApi.DeviceProxy;
import fr.esrf.TangoDs.TangoConst;
import fr.soleil.tango.clientapi.InsertExtractUtils;
import fr.soleil.tango.clientapi.TangoGroupAttribute;
......@@ -39,7 +34,6 @@ public class TangoSource {
private final AttributeResults attributeData = new AttributeResults();
private final Map<String, TangoGroupAttribute> writeGroups = new TreeMap<String, TangoGroupAttribute>();
private final boolean isSynchronous;
private final Map<String, List<Integer>> suscribedEventIds = new TreeMap<>();
TangoSource(final String deviceName, final String name, final boolean isSynchronous) {
this.deviceName = deviceName.toLowerCase(Locale.ENGLISH);
......@@ -97,24 +91,6 @@ public class TangoSource {
return attributeData.getAttributeResult(sourceName, variableName);
}
private void subscribeToAttribute(String fullAttributeName, CallBack callback) throws DevFailed {
String deviceAttribute = TangoUtil.getAttributeName(fullAttributeName);
String deviceName = TangoUtil.getfullDeviceNameForAttribute(fullAttributeName);
DeviceProxy deviceProxy = getDeviceProxy(fullAttributeName);
int eventId = deviceProxy.subscribe_event(deviceAttribute, TangoConst.CHANGE_EVENT, callback, null);
List<Integer> deviceEventList = suscribedEventIds.get(deviceProxy.get_name());
if( deviceEventList==null ) {
deviceEventList = new ArrayList<>();
suscribedEventIds.put(deviceProxy.get_name(), deviceEventList);
}
deviceEventList.add(eventId);
}
private DeviceProxy getDeviceProxy(String fullAttributeName) throws DevFailed {
DeviceProxy deviceProxy = readGroup.getGroup().getDevice(fullAttributeName);
return deviceProxy;
}
public void getResults() throws DevFailed {
// get results for tango attributes
final DeviceAttribute[] results = readGroup.getReadAsyncReplies();
......
......@@ -576,7 +576,6 @@ public final class TangoParser {
inputExpressions = new String[inputNames.length];
for (int i = 0; i < inputNames.length; i++) {
final int comma = inputNames[i].indexOf(',');
// final String[] elements = inputNames[i].split(",");
iNames[i] = inputNames[i].substring(0, comma);
// try to get the type
if (iNames[i].indexOf(' ') != -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment