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]);
}
}
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;
}
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();
}
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();
}
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));
}
Aggregations