use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarPanelArrayOnRackCustomCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final SolarPanel s = rack.getSolarPanel();
newValue = (SolarPanel) s.copy(false);
copySolarPanelProperties(s, oldValue);
rack.ensureFullSolarPanels(false);
rack.draw();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarPanelSizeForAllRacksCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = racks.size();
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
r.setRackWidth(newRackWidths[i]);
r.setRackHeight(newRackHeights[i]);
final SolarPanel s = r.getSolarPanel();
s.setPanelWidth(newWidths[i]);
s.setPanelHeight(newHeights[i]);
s.setNumberOfCellsInX(newCellNxs[i]);
s.setNumberOfCellsInY(newCellNys[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarPanelSizeForRacksOnFoundationCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = racks.size();
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
r.setRackWidth(newRackWidths[i]);
r.setRackHeight(newRackHeights[i]);
final SolarPanel s = r.getSolarPanel();
s.setPanelWidth(newWidths[i]);
s.setPanelHeight(newHeights[i]);
s.setNumberOfCellsInX(newCellNxs[i]);
s.setNumberOfCellsInY(newCellNys[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarTrackersForAllCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
if (panels != null) {
final int n = panels.size();
newValues = new int[n];
for (int i = 0; i < n; i++) {
final SolarPanel p = panels.get(i);
newValues[i] = p.getTracker();
p.setTracker(oldValues[i]);
p.draw();
}
} else if (racks != null) {
final int n = racks.size();
newValues = new int[n];
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
newValues[i] = r.getTracker();
r.setTracker(oldValues[i]);
r.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarTrackersForAllCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
if (panels != null) {
final int n = panels.size();
for (int i = 0; i < n; i++) {
final SolarPanel p = panels.get(i);
p.setTracker(newValues[i]);
p.draw();
}
} else if (racks != null) {
final int n = racks.size();
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
r.setTracker(newValues[i]);
r.draw();
}
}
SceneManager.getInstance().refresh();
}
Aggregations