Search in sources :

Example 41 with SolarPanel

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

the class SetNoctForRacksOnFoundationCommand 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 s = racks.get(i).getSolarPanel();
        newValues[i] = s.getNominalOperatingCellTemperature();
        s.setNominalOperatingCellTemperature(oldValues[i]);
    }
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel)

Example 42 with SolarPanel

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

the class MainFrame method getDailyEnergyAnalysisForSelectionMenuItem.

private JMenuItem getDailyEnergyAnalysisForSelectionMenuItem() {
    if (dailyEnergyAnalysisForSelectionMenuItem == null) {
        dailyEnergyAnalysisForSelectionMenuItem = new JMenuItem("Daily Energy Analysis for Selected Part...");
        dailyEnergyAnalysisForSelectionMenuItem.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(final ActionEvent e) {
                if (EnergyPanel.getInstance().checkCity()) {
                    if (EnergyPanel.getInstance().adjustCellSize()) {
                        return;
                    }
                    final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
                    if (selectedPart instanceof Window || selectedPart instanceof Wall || selectedPart instanceof Roof || selectedPart instanceof Door || selectedPart instanceof SolarPanel || selectedPart instanceof Rack || selectedPart instanceof Foundation) {
                        new EnergyDailyAnalysis().show("Daily Energy for Selected Part");
                    } else {
                        JOptionPane.showMessageDialog(MainFrame.this, "You must select a building part first.", "No Selection", JOptionPane.INFORMATION_MESSAGE);
                    }
                }
            }
        });
    }
    return dailyEnergyAnalysisForSelectionMenuItem;
}
Also used : Window(org.concord.energy3d.model.Window) Wall(org.concord.energy3d.model.Wall) ActionEvent(java.awt.event.ActionEvent) Door(org.concord.energy3d.model.Door) Rack(org.concord.energy3d.model.Rack) Roof(org.concord.energy3d.model.Roof) ActionListener(java.awt.event.ActionListener) SolarPanel(org.concord.energy3d.model.SolarPanel) EnergyDailyAnalysis(org.concord.energy3d.simulation.EnergyDailyAnalysis) Foundation(org.concord.energy3d.model.Foundation) JMenuItem(javax.swing.JMenuItem) HousePart(org.concord.energy3d.model.HousePart)

Example 43 with SolarPanel

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

the class Scene method setAzimuthForAllSolarPanels.

public void setAzimuthForAllSolarPanels(final double angle) {
    for (final HousePart p : parts) {
        if (p instanceof SolarPanel) {
            ((SolarPanel) p).setRelativeAzimuth(angle);
            p.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel) HousePart(org.concord.energy3d.model.HousePart)

Example 44 with SolarPanel

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

the class Scene method setTiltAngleForAllSolarPanels.

public void setTiltAngleForAllSolarPanels(final double angle) {
    for (final HousePart p : parts) {
        if (p instanceof SolarPanel) {
            ((SolarPanel) p).setTiltAngle(angle);
            p.draw();
        }
    }
    SceneManager.getInstance().refresh();
}
Also used : SolarPanel(org.concord.energy3d.model.SolarPanel) HousePart(org.concord.energy3d.model.HousePart)

Example 45 with SolarPanel

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

the class Scene method pasteToPickedLocationOnFloor.

public void pasteToPickedLocationOnFloor() {
    EnergyPanel.getInstance().updateRadiationHeatMap();
    if (copyBuffer == null) {
        return;
    }
    if (copyBuffer instanceof Foundation) {
        return;
    }
    final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
    if (!(selectedPart instanceof Floor)) {
        return;
    }
    final HousePart c = copyBuffer.copy(false);
    if (c == null) {
        return;
    }
    Vector3 position = SceneManager.getInstance().getPickedLocationOnFloor();
    if (position == null) {
        return;
    }
    if (selectedPart != c.getContainer()) {
        // solar panels and racks can be pasted to a different parent
        if (c instanceof SolarPanel) {
            ((SolarPanel) c).moveTo(selectedPart);
        } else if (c instanceof Rack) {
            ((Rack) c).moveTo(selectedPart);
        }
    }
    position = c.toRelative(position.subtractLocal(c.getContainer().getAbsPoint(0)));
    final Vector3 center = c.toRelative(c.getAbsCenter().subtractLocal(c.getContainer().getAbsPoint(0)));
    position = position.subtractLocal(center);
    final int n = c.getPoints().size();
    for (int i = 0; i < n; i++) {
        final Vector3 v = c.getPoints().get(i);
        v.addLocal(position);
    }
    if (c instanceof Rack) {
        ((Rack) c).moveSolarPanels(position);
        setIdOfChildren(c);
    }
    add(c, true);
    copyBuffer = c;
    SceneManager.getInstance().setSelectedPart(c);
    SceneManager.getInstance().getUndoManager().addEdit(new PastePartCommand(c));
}
Also used : Floor(org.concord.energy3d.model.Floor) Rack(org.concord.energy3d.model.Rack) SolarPanel(org.concord.energy3d.model.SolarPanel) Foundation(org.concord.energy3d.model.Foundation) ReadOnlyVector3(com.ardor3d.math.type.ReadOnlyVector3) Vector3(com.ardor3d.math.Vector3) HousePart(org.concord.energy3d.model.HousePart) PastePartCommand(org.concord.energy3d.undo.PastePartCommand)

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