Search in sources :

Example 36 with SolarPanel

use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.

the class SetSolarTrackersOnFoundationCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    if (solarPanels != null) {
        final int n = solarPanels.size();
        for (int i = 0; i < n; i++) {
            final SolarPanel s = solarPanels.get(i);
            s.setTracker(newValues[i]);
            s.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();
}
Also used : Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 37 with SolarPanel

use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.

the class SetTemperatrureEffectsForAllCommand 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.setTemperatureCoefficientPmax(newPmaxs[i]);
        p.setNominalOperatingCellTemperature(newNocts[i]);
    }
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 38 with SolarPanel

use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.

the class MovePartCommand method move.

private void move(final Vector3 v) {
    SceneManager.getInstance().setSelectedPart(part);
    SceneManager.getTaskManager().update(new Callable<Object>() {

        @Override
        public Object call() throws Exception {
            if (part == null) {
                for (final HousePart p : Scene.getInstance().getParts()) {
                    if (p instanceof Foundation) {
                        ((Foundation) p).move(v, p.getGridSize());
                    }
                }
            } else if (part instanceof Foundation) {
                final Foundation f = (Foundation) part;
                if (f.isGroupMaster()) {
                    final List<Foundation> g = Scene.getInstance().getFoundationGroup(f);
                    for (final Foundation x : g) {
                        x.move(v, part.getGridSize());
                    }
                } else {
                    f.move(v, part.getGridSize());
                }
            } else if (part instanceof Window) {
                final Window w = (Window) part;
                w.move(v);
                w.draw();
            } else if (part instanceof SolarPanel) {
                final SolarPanel s = (SolarPanel) part;
                s.move(v, part.getGridSize());
                s.draw();
            } else if (part instanceof Rack) {
                final Rack r = (Rack) part;
                r.move(v, part.getGridSize());
                r.draw();
            } else if (part instanceof Mirror) {
                final Mirror m = (Mirror) part;
                m.move(v, part.getGridSize());
                m.draw();
            } else if (part instanceof ParabolicTrough) {
                final ParabolicTrough t = (ParabolicTrough) part;
                t.move(v, part.getGridSize());
                t.draw();
            } else if (part instanceof ParabolicDish) {
                final ParabolicDish d = (ParabolicDish) part;
                d.move(v, part.getGridSize());
                d.draw();
            } else if (part instanceof FresnelReflector) {
                final FresnelReflector f = (FresnelReflector) part;
                f.move(v, part.getGridSize());
                f.draw();
            }
            return null;
        }
    });
}
Also used : Window(org.concord.energy3d.model.Window) ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) FresnelReflector(org.concord.energy3d.model.FresnelReflector) CannotUndoException(javax.swing.undo.CannotUndoException) CannotRedoException(javax.swing.undo.CannotRedoException) ParabolicDish(org.concord.energy3d.model.ParabolicDish) Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel) Foundation(org.concord.energy3d.model.Foundation) Mirror(org.concord.energy3d.model.Mirror) HousePart(org.concord.energy3d.model.HousePart)

Example 39 with SolarPanel

use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.

the class SetFoundationTemperatureEffectsCommand 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.setTemperatureCoefficientPmax(newPmaxs[i]);
        p.setNominalOperatingCellTemperature(newNocts[i]);
    }
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 40 with SolarPanel

use of org.concord.energy3d.model.SolarPanel in project energy3d by concord-consortium.

the class ChooseSolarPanelSizeForRackCommand method undo.

@Override
public void undo() throws CannotUndoException {
    super.undo();
    final SolarPanel s = rack.getSolarPanel();
    newRackWidth = rack.getRackWidth();
    newRackHeight = rack.getRackHeight();
    newWidth = s.getPanelWidth();
    newHeight = s.getPanelHeight();
    newCellNx = s.getNumberOfCellsInX();
    newCellNy = s.getNumberOfCellsInY();
    s.setPanelWidth(oldWidth);
    s.setPanelHeight(oldHeight);
    s.setNumberOfCellsInX(oldCellNx);
    s.setNumberOfCellsInY(oldCellNy);
    rack.setRackWidth(oldRackWidth);
    rack.setRackHeight(oldRackHeight);
    rack.ensureFullSolarPanels(false);
    rack.draw();
}
Also used : 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