Search in sources :

Example 21 with ParabolicTrough

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

the class EditParabolicTroughCommand method undo.

@Override
public void undo() throws CannotUndoException {
    final ParabolicTrough trough = (ParabolicTrough) part;
    newTroughCenter = trough.getPoints().get(0).clone();
    newTroughWidth = trough.getApertureWidth();
    newTroughLength = trough.getTroughLength();
    trough.getPoints().get(0).set(oldTroughCenter);
    trough.setApertureWidth(oldTroughWidth);
    trough.setTroughLength(oldTroughLength);
    super.undo();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 22 with ParabolicTrough

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

the class EditParabolicTroughCommand method redo.

@Override
public void redo() throws CannotRedoException {
    final ParabolicTrough trough = (ParabolicTrough) part;
    trough.getPoints().get(0).set(newTroughCenter);
    trough.setApertureWidth(newTroughWidth);
    trough.setTroughLength(newTroughLength);
    super.redo();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough)

Example 23 with ParabolicTrough

use of org.concord.energy3d.model.ParabolicTrough 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 24 with ParabolicTrough

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

the class CspProjectDailyEnergyGraph method updateGraph.

public void updateGraph() {
    if (base == null) {
        return;
    }
    graph.clearData();
    final List<ParabolicTrough> troughs = base.getParabolicTroughs();
    if (!troughs.isEmpty()) {
        // favor parabolic troughs if there are also mirrors or Fresnel reflectors
        for (int i = 0; i < 24; i++) {
            SolarRadiation.getInstance().computeEnergyAtHour(i);
            double output = 0;
            for (final ParabolicTrough t : troughs) {
                output += t.getSolarPotentialNow() * t.getSystemEfficiency();
            }
            graph.addData("Solar", output);
        }
    } else {
        final List<ParabolicDish> dishes = base.getParabolicDishes();
        if (!dishes.isEmpty()) {
            for (int i = 0; i < 24; i++) {
                SolarRadiation.getInstance().computeEnergyAtHour(i);
                double output = 0;
                for (final ParabolicDish d : dishes) {
                    output += d.getSolarPotentialNow() * d.getSystemEfficiency();
                }
                graph.addData("Solar", output);
            }
        } else {
            final List<FresnelReflector> fresnels = base.getFresnelReflectors();
            if (!fresnels.isEmpty()) {
                for (int i = 0; i < 24; i++) {
                    SolarRadiation.getInstance().computeEnergyAtHour(i);
                    double output = 0;
                    for (final FresnelReflector r : fresnels) {
                        output += r.getSolarPotentialNow() * r.getSystemEfficiency();
                    }
                    graph.addData("Solar", output);
                }
            } else {
                final List<Mirror> mirrors = base.getHeliostats();
                if (!mirrors.isEmpty()) {
                    for (int i = 0; i < 24; i++) {
                        SolarRadiation.getInstance().computeEnergyAtHour(i);
                        double output = 0;
                        for (final Mirror m : mirrors) {
                            output += m.getSolarPotentialNow() * m.getSystemEfficiency();
                        }
                        graph.addData("Solar", output);
                    }
                }
            }
        }
    }
    repaint();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) FresnelReflector(org.concord.energy3d.model.FresnelReflector) Mirror(org.concord.energy3d.model.Mirror)

Example 25 with ParabolicTrough

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

the class Scene method setSectionsForAllParabolicTroughs.

public void setSectionsForAllParabolicTroughs(final int nParabola, final int nAxis) {
    for (final HousePart p : parts) {
        if (p instanceof ParabolicTrough) {
            final ParabolicTrough t = (ParabolicTrough) p;
            t.setNSectionParabola(nParabola);
            t.setNSectionAxis(nAxis);
            t.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) HousePart(org.concord.energy3d.model.HousePart)

Aggregations

ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)44 HousePart (org.concord.energy3d.model.HousePart)30 Foundation (org.concord.energy3d.model.Foundation)22 FresnelReflector (org.concord.energy3d.model.FresnelReflector)18 Mirror (org.concord.energy3d.model.Mirror)17 ParabolicDish (org.concord.energy3d.model.ParabolicDish)17 Rack (org.concord.energy3d.model.Rack)16 SolarPanel (org.concord.energy3d.model.SolarPanel)14 Window (org.concord.energy3d.model.Window)14 Roof (org.concord.energy3d.model.Roof)10 Wall (org.concord.energy3d.model.Wall)10 Door (org.concord.energy3d.model.Door)9 ArrayList (java.util.ArrayList)6 Calendar (java.util.Calendar)5 List (java.util.List)5 JDialog (javax.swing.JDialog)4 Tree (org.concord.energy3d.model.Tree)4 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)3 Human (org.concord.energy3d.model.Human)3 UserData (org.concord.energy3d.model.UserData)3