Search in sources :

Example 21 with ParabolicDish

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

the class ChangeStructureTypeForAllParabolicDishesCommand method redo.

@Override
public void redo() throws CannotRedoException {
    super.redo();
    final int n = dishes.size();
    for (int i = 0; i < n; i++) {
        final ParabolicDish d = dishes.get(i);
        d.setStructureType(newValues[i]);
        d.draw();
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish)

Example 22 with ParabolicDish

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

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

the class Scene method setBaseHeightForAllParabolicDishes.

public void setBaseHeightForAllParabolicDishes(final double baseHeight) {
    for (final HousePart p : parts) {
        if (p instanceof ParabolicDish) {
            ((ParabolicDish) p).setBaseHeight(baseHeight);
            p.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) HousePart(org.concord.energy3d.model.HousePart)

Example 24 with ParabolicDish

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

the class Scene method setNumberOfRibsForAllParabolicDishes.

public void setNumberOfRibsForAllParabolicDishes(final int nrib) {
    for (final HousePart p : parts) {
        if (p instanceof ParabolicDish) {
            final ParabolicDish d = (ParabolicDish) p;
            d.setNumberOfRibs(nrib);
            d.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) HousePart(org.concord.energy3d.model.HousePart)

Example 25 with ParabolicDish

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

the class SceneManager method update.

@Override
public void update(final ReadOnlyTimer timer) {
    final double tpf = timer.getTimePerFrame();
    passManager.updatePasses(tpf);
    taskManager.getQueue(GameTaskQueue.UPDATE).setExecuteMultiple(executeAllTask);
    taskManager.getQueue(GameTaskQueue.UPDATE).execute(canvas.getCanvasRenderer().getRenderer());
    if (operationFlag) {
        executeOperation();
    }
    if (mouseState != null) {
        mouseMoved();
    }
    if (Scene.isRedrawAll()) {
        Scene.getInstance().redrawAllNow();
    }
    if (rotAnim && viewMode == ViewMode.NORMAL && canvas.getCanvasRenderer() != null) {
        final Matrix3 rotate = new Matrix3();
        rotate.fromAngleNormalAxis(45 * tpf * MathUtils.DEG_TO_RAD, Vector3.UNIT_Z);
        final Camera camera = getCamera();
        camera.setLocation(rotate.applyPre(camera.getLocation(), null));
        camera.lookAt(0, 0, 1, Vector3.UNIT_Z);
        getCameraNode().updateFromCamera();
        Scene.getInstance().updateEditShapes();
    }
    final Heliodon heliodon = Heliodon.getInstance();
    if (heliodon != null) {
        if (sunAnim) {
            heliodon.setHourAngle(heliodon.getHourAngle() + tpf * 0.5, true, true, false);
            SceneManager.getInstance().changeSkyTexture();
            SceneManager.getInstance().setShading(heliodon.isNightTime());
            final boolean night = Heliodon.getInstance().isNightTime();
            for (final HousePart part : Scene.getInstance().getParts()) {
                if (part instanceof Mirror) {
                    final Mirror m = (Mirror) part;
                    if (night) {
                        // call this so that the light beams can be set invisible
                        m.drawSunBeam();
                    } else {
                        if (m.getReceiver() != null) {
                            m.draw();
                        }
                    }
                } else if (part instanceof ParabolicTrough) {
                    final ParabolicTrough t = (ParabolicTrough) part;
                    if (night) {
                        // call this so that the light beams can be set invisible
                        t.drawSunBeam();
                    } else {
                        t.draw();
                    }
                } else if (part instanceof ParabolicDish) {
                    final ParabolicDish d = (ParabolicDish) part;
                    if (night) {
                        // call this so that the light beams can be set invisible
                        d.drawSunBeam();
                    } else {
                        d.draw();
                    }
                } else if (part instanceof FresnelReflector) {
                    final FresnelReflector f = (FresnelReflector) part;
                    if (night) {
                        // call this so that the light beams can be set invisible
                        f.drawSunBeam();
                    } else {
                        f.draw();
                    }
                } else if (part instanceof SolarPanel) {
                    final SolarPanel sp = (SolarPanel) part;
                    if (!night && sp.getTracker() != Trackable.NO_TRACKER) {
                        sp.draw();
                    }
                    if (sp.isSunBeamVisible()) {
                        sp.drawSunBeam();
                    }
                } else if (part instanceof Rack) {
                    final Rack rack = (Rack) part;
                    if (!night && rack.getTracker() != Trackable.NO_TRACKER) {
                        rack.draw();
                    }
                    if (rack.isSunBeamVisible()) {
                        rack.drawSunBeam();
                    }
                }
            }
        }
        heliodon.update();
    }
    if (cameraControl != null && cameraControl.isAnimating()) {
        cameraControl.animate();
    }
    root.updateGeometricState(tpf);
}
Also used : ParabolicDish(org.concord.energy3d.model.ParabolicDish) Rack(org.concord.energy3d.model.Rack) ParabolicTrough(org.concord.energy3d.model.ParabolicTrough) FresnelReflector(org.concord.energy3d.model.FresnelReflector) SolarPanel(org.concord.energy3d.model.SolarPanel) Camera(com.ardor3d.renderer.Camera) Mirror(org.concord.energy3d.model.Mirror) PickedHousePart(org.concord.energy3d.model.PickedHousePart) HousePart(org.concord.energy3d.model.HousePart) Matrix3(com.ardor3d.math.Matrix3) Heliodon(org.concord.energy3d.shapes.Heliodon)

Aggregations

ParabolicDish (org.concord.energy3d.model.ParabolicDish)43 HousePart (org.concord.energy3d.model.HousePart)26 Foundation (org.concord.energy3d.model.Foundation)20 FresnelReflector (org.concord.energy3d.model.FresnelReflector)17 Mirror (org.concord.energy3d.model.Mirror)17 ParabolicTrough (org.concord.energy3d.model.ParabolicTrough)17 Rack (org.concord.energy3d.model.Rack)15 SolarPanel (org.concord.energy3d.model.SolarPanel)13 Window (org.concord.energy3d.model.Window)13 Wall (org.concord.energy3d.model.Wall)10 Door (org.concord.energy3d.model.Door)9 Roof (org.concord.energy3d.model.Roof)9 ArrayList (java.util.ArrayList)5 Calendar (java.util.Calendar)5 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)3 CullHint (com.ardor3d.scenegraph.hint.CullHint)3 List (java.util.List)3 JDialog (javax.swing.JDialog)3 Human (org.concord.energy3d.model.Human)3 SolarCollector (org.concord.energy3d.model.SolarCollector)3