use of org.concord.energy3d.model.SolarReflector in project energy3d by concord-consortium.
the class ChangeSolarReceiverEfficiencyForAllReflectorsCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = reflectors.size();
for (int i = 0; i < n; i++) {
final SolarReflector r = reflectors.get(i);
if (r instanceof HousePart) {
final Foundation f = ((HousePart) r).getTopContainer();
f.setSolarReceiverEfficiency(newValues[i]);
}
}
}
use of org.concord.energy3d.model.SolarReflector in project energy3d by concord-consortium.
the class ChangeSolarReceiverEfficiencyForAllReflectorsCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = reflectors.size();
newValues = new double[n];
for (int i = 0; i < n; i++) {
final SolarReflector r = reflectors.get(i);
if (r instanceof HousePart) {
final Foundation f = ((HousePart) r).getTopContainer();
newValues[i] = f.getSolarReceiverEfficiency();
f.setSolarReceiverEfficiency(oldValues[i]);
}
}
}
Aggregations