use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setTiltAngleForAllHeliostats.
public void setTiltAngleForAllHeliostats(final double angle) {
for (final HousePart p : parts) {
if (p instanceof Mirror) {
((Mirror) p).setTiltAngle(angle);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setBaseHeightForAllHeliostats.
public void setBaseHeightForAllHeliostats(final double baseHeight) {
for (final HousePart p : parts) {
if (p instanceof Mirror) {
((Mirror) p).setBaseHeight(baseHeight);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method removeAllSensors.
public void removeAllSensors() {
final ArrayList<HousePart> sensors = new ArrayList<HousePart>();
final HousePart selectedPart = SceneManager.getInstance().getSelectedPart();
if (selectedPart != null) {
final Foundation foundation = selectedPart instanceof Foundation ? (Foundation) selectedPart : selectedPart.getTopContainer();
for (final HousePart part : parts) {
if (part instanceof Sensor && part.getTopContainer() == foundation) {
sensors.add(part);
}
}
} else {
for (final HousePart part : parts) {
if (part instanceof Sensor) {
sensors.add(part);
}
}
}
if (sensors.isEmpty()) {
JOptionPane.showMessageDialog(MainFrame.getInstance(), "There is no sensor to remove.", "No Sensor", JOptionPane.INFORMATION_MESSAGE);
return;
}
if (JOptionPane.showConfirmDialog(MainFrame.getInstance(), "Do you really want to remove all " + sensors.size() + " sensors" + (selectedPart != null ? " on the selected foundation" : "") + "?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.YES_OPTION) {
return;
}
final RemoveMultiplePartsCommand c = new RemoveMultiplePartsCommand(sensors);
for (final HousePart part : sensors) {
remove(part, false);
}
redrawAll();
SceneManager.getInstance().getUndoManager().addEdit(c);
edited = true;
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setCellNumbersForAllSolarPanels.
public void setCellNumbersForAllSolarPanels(final int nx, final int ny) {
for (final HousePart p : parts) {
if (p instanceof SolarPanel) {
final SolarPanel s = (SolarPanel) p;
s.setNumberOfCellsInX(nx);
s.setNumberOfCellsInY(ny);
} else if (p instanceof Rack) {
final SolarPanel s = ((Rack) p).getSolarPanel();
s.setNumberOfCellsInX(nx);
s.setNumberOfCellsInY(ny);
}
p.draw();
}
SceneManager.getInstance().refresh();
}
use of org.concord.energy3d.model.HousePart in project energy3d by concord-consortium.
the class Scene method setAzimuthForAllRacks.
public void setAzimuthForAllRacks(final double angle) {
for (final HousePart p : parts) {
if (p instanceof Rack) {
((Rack) p).setRelativeAzimuth(angle);
p.draw();
}
}
SceneManager.getInstance().refresh();
}
Aggregations