use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeTiltAngleForSolarPanelRowCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = panels.size();
newValues = new double[n];
for (int i = 0; i < n; i++) {
final SolarPanel p = panels.get(i);
newValues[i] = p.getTiltAngle();
p.setTiltAngle(oldValues[i]);
p.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetFoundationTemperatureEffectsCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = panels.size();
newPmaxs = new double[n];
newNocts = new double[n];
SolarPanel p;
for (int i = 0; i < n; i++) {
p = panels.get(i);
newPmaxs[i] = p.getTemperatureCoefficientPmax();
newNocts[i] = p.getNominalOperatingCellTemperature();
p.setTemperatureCoefficientPmax(oldPmaxs[i]);
p.setNominalOperatingCellTemperature(oldNocts[i]);
}
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetNoctForAllRacksCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = racks.size();
newValues = new double[n];
for (int i = 0; i < n; i++) {
final SolarPanel r = racks.get(i).getSolarPanel();
newValues[i] = r.getNominalOperatingCellTemperature();
r.setNominalOperatingCellTemperature(oldValues[i]);
}
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class SetSolarPanelSizeForAllRacksCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = racks.size();
newRackWidths = new double[n];
newRackHeights = new double[n];
newWidths = new double[n];
newHeights = new double[n];
newCellNxs = new int[n];
newCellNys = new int[n];
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
newRackWidths[i] = r.getRackWidth();
newRackHeights[i] = r.getRackHeight();
final SolarPanel s = r.getSolarPanel();
newWidths[i] = s.getPanelWidth();
s.setPanelWidth(oldWidths[i]);
newHeights[i] = s.getPanelHeight();
s.setPanelHeight(oldHeights[i]);
newCellNxs[i] = s.getNumberOfCellsInX();
newCellNys[i] = s.getNumberOfCellsInY();
s.setNumberOfCellsInX(oldCellNxs[i]);
s.setNumberOfCellsInY(oldCellNys[i]);
r.setRackWidth(oldRackWidths[i]);
r.setRackHeight(oldRackHeights[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 undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = racks.size();
newRackWidths = new double[n];
newRackHeights = new double[n];
newWidths = new double[n];
newHeights = new double[n];
newCellNxs = new int[n];
newCellNys = new int[n];
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
newRackWidths[i] = r.getRackWidth();
newRackHeights[i] = r.getRackHeight();
final SolarPanel s = r.getSolarPanel();
newWidths[i] = s.getPanelWidth();
newHeights[i] = s.getPanelHeight();
s.setPanelWidth(oldWidths[i]);
s.setPanelHeight(oldHeights[i]);
newCellNxs[i] = s.getNumberOfCellsInX();
newCellNys[i] = s.getNumberOfCellsInY();
s.setNumberOfCellsInX(oldCellNxs[i]);
s.setNumberOfCellsInY(oldCellNys[i]);
r.setRackWidth(oldRackWidths[i]);
r.setRackHeight(oldRackHeights[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
Aggregations