List<Trajectory> trajectoryList = CurrentConfigurationParser.getCurrentTrajectory(
scanServer, index);
if (trajectoryList != null && !trajectoryList.isEmpty()) {
IRange range = null;
ITrajectory configTrajectory = null;
Trajectory trajectory = null;
for (int i = 0; i < trajectoryList.size(); i++) {
trajectory = trajectoryList.get(i);
range = createRange(dimension);
configTrajectory = range.getTrajectoriesList().get(i);
if (configTrajectory instanceof IActuatorTrajectory && actuatorList != null
&& actuatorList.size() == trajectoryList.size()) {
((IActuatorTrajectory) configTrajectory).setActuator(actuatorList
.get(i));
}
range.setStepsNumber(trajectory.getStepNumber());
if (range instanceof IRangeIntegrated) {
((IRangeIntegrated) range)
.setIntegrationTime(CurrentConfigurationParser
.readIntegrationTime(scanServer));
}
configTrajectory.setBeginPosition(trajectory.getFrom());
configTrajectory.setEndPosition(trajectory.getTo());
configTrajectory.setTrajectory(trajectory.getCompleteTrajectory());
}
}
}
catch (Exception e) {
// TODO: handle exception