Search in sources :

Example 91 with SolarPanel

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

Example 92 with SolarPanel

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

Example 93 with SolarPanel

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

Example 94 with SolarPanel

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();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 95 with SolarPanel

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();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Aggregations

SolarPanel (org.concord.energy3d.model.SolarPanel)109 Rack (org.concord.energy3d.model.Rack)66 HousePart (org.concord.energy3d.model.HousePart)58 Foundation (org.concord.energy3d.model.Foundation)43 Window (org.concord.energy3d.model.Window)25 Roof (org.concord.energy3d.model.Roof)24 Wall (org.concord.energy3d.model.Wall)23 Mirror (org.concord.energy3d.model.Mirror)20 Door (org.concord.energy3d.model.Door)17 FresnelReflector (org.concord.energy3d.model.FresnelReflector)14 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)14 ActionEvent (java.awt.event.ActionEvent)13 ActionListener (java.awt.event.ActionListener)13 ParabolicDish (org.concord.energy3d.model.ParabolicDish)13 Vector3 (com.ardor3d.math.Vector3)11 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)11 JMenuItem (javax.swing.JMenuItem)10 JDialog (javax.swing.JDialog)9 JPanel (javax.swing.JPanel)9 Tree (org.concord.energy3d.model.Tree)9