use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.
the class EditParabolicTroughCommand method undo.
@Override
public void undo() throws CannotUndoException {
final ParabolicTrough trough = (ParabolicTrough) part;
newTroughCenter = trough.getPoints().get(0).clone();
newTroughWidth = trough.getApertureWidth();
newTroughLength = trough.getTroughLength();
trough.getPoints().get(0).set(oldTroughCenter);
trough.setApertureWidth(oldTroughWidth);
trough.setTroughLength(oldTroughLength);
super.undo();
}
use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.
the class EditParabolicTroughCommand method redo.
@Override
public void redo() throws CannotRedoException {
final ParabolicTrough trough = (ParabolicTrough) part;
trough.getPoints().get(0).set(newTroughCenter);
trough.setApertureWidth(newTroughWidth);
trough.setTroughLength(newTroughLength);
super.redo();
}
use of org.concord.energy3d.model.ParabolicTrough in project energy3d by concord-consortium.
the class MovePartCommand method move.
private void move(final Vector3 v) {
SceneManager.getInstance().setSelectedPart(part);
SceneManager.getTaskManager().update(new Callable<Object>() {
@Override
public Object call() throws Exception {
if (part == null) {
for (final HousePart p : Scene.getInstance().getParts()) {
if (p instanceof Foundation) {
((Foundation) p).move(v, p.getGridSize());
}
}
} else if (part instanceof Foundation) {
final Foundation f = (Foundation) part;
if (f.isGroupMaster()) {
final List<Foundation> g = Scene.getInstance().getFoundationGroup(f);
for (final Foundation x : g) {
x.move(v, part.getGridSize());
}
} else {
f.move(v, part.getGridSize());
}
} else if (part instanceof Window) {
final Window w = (Window) part;
w.move(v);
w.draw();
} else if (part instanceof SolarPanel) {
final SolarPanel s = (SolarPanel) part;
s.move(v, part.getGridSize());
s.draw();
} else if (part instanceof Rack) {
final Rack r = (Rack) part;
r.move(v, part.getGridSize());
r.draw();
} else if (part instanceof Mirror) {
final Mirror m = (Mirror) part;
m.move(v, part.getGridSize());
m.draw();
} else if (part instanceof ParabolicTrough) {
final ParabolicTrough t = (ParabolicTrough) part;
t.move(v, part.getGridSize());
t.draw();
} else if (part instanceof ParabolicDish) {
final ParabolicDish d = (ParabolicDish) part;
d.move(v, part.getGridSize());
d.draw();
} else if (part instanceof FresnelReflector) {
final FresnelReflector f = (FresnelReflector) part;
f.move(v, part.getGridSize());
f.draw();
}
return null;
}
});
}
use of org.concord.energy3d.model.ParabolicTrough 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.ParabolicTrough in project energy3d by concord-consortium.
the class Scene method setSectionsForAllParabolicTroughs.
public void setSectionsForAllParabolicTroughs(final int nParabola, final int nAxis) {
for (final HousePart p : parts) {
if (p instanceof ParabolicTrough) {
final ParabolicTrough t = (ParabolicTrough) p;
t.setNSectionParabola(nParabola);
t.setNSectionAxis(nAxis);
t.draw();
}
}
SceneManager.getInstance().refresh();
}
Aggregations