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