ConfigHCSModel configHCSModel = (ConfigHCSModel) config;
configHCSModel.removeListener(listenerConfigHCS);
for (ISensor sensor : config.getSensorsList()) {
((SensorModel) sensor).removeListener(listenerSensor);
}
DimensionHCSModel dimensionHCSModel = (DimensionHCSModel) configHCSModel
.getDimensionX();
dimensionHCSModel.removeListener(listenerDimensionHCS);
for (IActuator actuator : dimensionHCSModel.getActuatorsList()) {
((ActuatorModel) actuator).removeListener(listenerActuator);
}
for (IRangeHCS rangeHCS : dimensionHCSModel.getRangesXList()) {
((RangeHCSModel) rangeHCS).removeListener(listenerRangeHCS);
for (ITrajectory trajectory : rangeHCS.getTrajectoriesList()) {
((TrajectoryHCSModel) trajectory).removeListener(listenerTrajectoryHCS);
}
}