Search in sources :

Example 1 with SolarReflector

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]);
        }
    }
}
Also used : SolarReflector(org.concord.energy3d.model.SolarReflector) Foundation(org.concord.energy3d.model.Foundation) HousePart(org.concord.energy3d.model.HousePart)

Example 2 with SolarReflector

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]);
        }
    }
}
Also used : SolarReflector(org.concord.energy3d.model.SolarReflector) Foundation(org.concord.energy3d.model.Foundation) HousePart(org.concord.energy3d.model.HousePart)

Aggregations

Foundation (org.concord.energy3d.model.Foundation)2 HousePart (org.concord.energy3d.model.HousePart)2 SolarReflector (org.concord.energy3d.model.SolarReflector)2