button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
IScanResult result = connector.retrieveCommonScanResult(true);
Map<IActuator, double[]> trajectoryMap = result.getTrajectoryMap();
StringBuilder builder = new StringBuilder();
if (result != null) {
builder.append("ScanServer=" + result.getScanServer() + "\n");
builder.append("Class=" + result.getClass().getName() + "\n");
builder.append("ScanType=" + result.getResultType() + "\n");
builder.append("RunName=" + result.getRunName() + "\n");
builder.append("SensorTimeStamps=" + result.getSensorsTimeStampsCompleteName() + "\n");
builder.append("ActuatorTimeStamps=" + result.getActuatorsTimeStampsCompleteName() + "\n");
List<ISensor> sensorList = result.getSensorsList();
builder.append("---Sensor size=" + sensorList.size() + "---\n");
for (ISensor sensor : sensorList) {
builder.append("Sensor name=" + sensor.getName() + "\n");
builder.append("Sensor attribute name=" + sensor.getScanServerAttributeName() + "\n");
}
List<IActuator> actuatorXList = result.getActuatorsXList();
builder.append("---Actuator X size=" + actuatorXList.size() + "---\n");
for (IActuator actuator : actuatorXList) {
builder.append("Actuator X name=" + actuator.getName() + "\n");
builder.append("Actuator attribute name=" + actuator.getScanServerAttributeName()
+ "\n");
if ((trajectoryMap != null) && trajectoryMap.containsKey(actuator)) {
builder.append("Real trajectory =" + Arrays.toString(trajectoryMap.get(actuator))
+ "\n");
}
}
if (result.getResultType() == IScanResult.ResultType.RESULT_2D) {
List<IActuator> actuatorYList = ((IScanResult2D) result).getActuatorsYList();
builder.append("---Actuator Y size=" + actuatorYList.size() + "---\n");
for (IActuator actuator : actuatorYList) {
builder.append("Actuator Y name=" + actuator.getName() + "\n");
builder.append("Actuator attribute name=" + actuator.getScanServerAttributeName()