use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeSolarCellPropertiesForAllCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = panels.size();
newEfficiencies = new double[n];
newTypes = new int[n];
newColors = new int[n];
SolarPanel p;
for (int i = 0; i < n; i++) {
p = panels.get(i);
newEfficiencies[i] = p.getCellEfficiency();
p.setCellEfficiency(oldEfficiencies[i]);
newTypes[i] = p.getCellType();
p.setCellType(oldTypes[i]);
newColors[i] = p.getColorOption();
p.setColorOption(oldColors[i]);
p.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeSolarCellPropertiesForAllCommand method redo.
@Override
public void redo() throws CannotRedoException {
super.redo();
final int n = panels.size();
SolarPanel p;
for (int i = 0; i < n; i++) {
p = panels.get(i);
p.setCellEfficiency(newEfficiencies[i]);
p.setCellType(newTypes[i]);
p.setColorOption(newColors[i]);
p.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeSolarPanelModelForAllRacksCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = racks.size();
newWidths = new double[n];
newHeights = new double[n];
newModels = new PvModuleSpecs[n];
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
newWidths[i] = r.getRackWidth();
newHeights[i] = r.getRackHeight();
r.setRackWidth(oldWidths[i]);
r.setRackHeight(oldHeights[i]);
final SolarPanel s = r.getSolarPanel();
newModels[i] = s.getPvModuleSpecs();
s.setPvModuleSpecs(oldModels[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeSolarPanelModelForAllRacksCommand 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(newWidths[i]);
r.setRackHeight(newHeights[i]);
final SolarPanel s = r.getSolarPanel();
s.setPvModuleSpecs(newModels[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.
the class ChangeSolarPanelModelForRacksOnFoundationCommand method undo.
@Override
public void undo() throws CannotUndoException {
super.undo();
final int n = racks.size();
newWidths = new double[n];
newHeights = new double[n];
newModels = new PvModuleSpecs[n];
for (int i = 0; i < n; i++) {
final Rack r = racks.get(i);
newWidths[i] = r.getRackWidth();
newHeights[i] = r.getRackHeight();
final SolarPanel s = r.getSolarPanel();
newModels[i] = s.getPvModuleSpecs();
s.setPvModuleSpecs(oldModels[i]);
r.setRackWidth(oldWidths[i]);
r.setRackHeight(oldHeights[i]);
r.ensureFullSolarPanels(false);
r.draw();
}
SceneManager.getInstance().refresh();
}
Aggregations