[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model EnergyCalc.java, 1.3, 1.4 Space.java
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nikolaj B. <nbr...@us...> - 2007-01-24 10:23:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10418/src/net/sourceforge/bprocessor/model Modified Files: EnergyCalc.java Space.java Log Message: Fixed the energy calculation to work with the DBK classification system, also added new attributes to functional spaces: building, apartment, floor and room Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EnergyCalc.java 24 Oct 2006 20:40:48 -0000 1.3 --- EnergyCalc.java 24 Jan 2007 10:23:11 -0000 1.4 *************** *** 21,39 **** Iterator it = Project.getInstance().world().getSurfaces().iterator(); double totalloss = 0; ! while (it.hasNext()) { Surface current = (Surface) it.next(); ! if (current.getFrontDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getFrontDomain().getClassification().getName(). ! equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); } } --- 21,44 ---- Iterator it = Project.getInstance().world().getSurfaces().iterator(); double totalloss = 0; ! while (it.hasNext()) { Surface current = (Surface) it.next(); ! if (current.getFrontDomain().getClassification() != null) { ! if (current.getFrontDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } ! if (current.getFrontDomain().getClassification().getName(). ! equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain(), current); ! } } ! if (current.getBackDomain().getClassification() != null) { ! if (current.getBackDomain().getClassification().getName().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); ! } ! if (current.getBackDomain().getClassification().getName() ! .equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getFrontDomain(), current); ! } } } *************** *** 63,75 **** return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Tagkonstruktion")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Loft")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Ydervæg")) { loss = 0.25 * current.getArea(); return loss; --- 68,82 ---- return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Tagkonstruktion") || ! classification.getClassification().getName().equalsIgnoreCase("Tagsystem")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Loftkonstruktion")) { loss = 0.15 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Vægsystem") || ! classification.getClassification().getName().equalsIgnoreCase("Vægkonstruktion")) { loss = 0.25 * current.getArea(); return loss; *************** *** 86,95 **** if (classification.getClassification(). ! getName().equalsIgnoreCase("3-lags lavenergivindue")) { loss = 0.8 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Dør")) { loss = 1.5 * current.getArea(); return loss; --- 93,102 ---- if (classification.getClassification(). ! getName().equalsIgnoreCase("Vinduesparti")) { loss = 0.8 * current.getArea(); return loss; } ! if (classification.getClassification().getName().equalsIgnoreCase("Dørparti")) { loss = 1.5 * current.getArea(); return loss; *************** *** 148,157 **** } ! if (spa != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! relevant = true; ! } --- 155,167 ---- } ! if (spa.getClassification() != null) { ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! relevant = true; ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName().equalsIgnoreCase("Beboelse og ophold")) { ! relevant = true; ! } } *************** *** 173,190 **** if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); ! if (spa.getClassification() != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! tha = tha + current.getArea(); } } if (current.normal().getZ() <= -0.99) { spa = current.getBackDomain(); ! if (spa.getClassification() != null && ! (spa.getClassification().getName().equalsIgnoreCase("Stue") || ! spa.getClassification().getName().equalsIgnoreCase("Badeværelse") || ! spa.getClassification().getName().equalsIgnoreCase("Opvarmet rum"))) { ! tha = tha + current.getArea(); } } --- 183,208 ---- if (current.normal().getZ() >= 0.99) { spa = current.getFrontDomain(); ! if (spa.getClassification() != null) { ! if (spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName() ! .equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } } } if (current.normal().getZ() <= -0.99) { spa = current.getBackDomain(); ! if (spa.getClassification() != null) { ! if (spa.getClassification().getName().equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getName() ! .equalsIgnoreCase("Beboelse og ophold")) { ! tha = tha + current.getArea(); ! } } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** Space.java 23 Jan 2007 14:31:27 -0000 1.111 --- Space.java 24 Jan 2007 10:23:11 -0000 1.112 *************** *** 144,148 **** --- 144,159 ---- private int level; + /** the building the space belongs to */ + private String building = "0"; + + /** the floor the space belongs to */ + private String floor = "0"; + + /** the apartment the space belongs to */ + private String apartment = "0"; + /** the room the space belongs to */ + private String room = "0"; + /** * Constructor for persistence layer *************** *** 1499,1502 **** --- 1510,1521 ---- } else if (a.getName().equals("Type")) { setTypeClassification((((Classification)a.getClassification()))); + } else if (a.getName().equals("Building")) { + setBuilding(((String)a.getValue().toString())); + } else if (a.getName().equals("Apartment")) { + setApartment(((String)a.getValue().toString())); + } else if (a.getName().equals("Floor")) { + setFloor(((String)a.getValue().toString())); + } else if (a.getName().equals("Room")) { + setRoom(((String)a.getValue().toString())); } else if (a.getName().equals("Transparent")) { setTransparent((((Boolean)a.getValue()).booleanValue())); *************** *** 1566,1569 **** --- 1585,1594 ---- getType(getClassification().getName()), getTypeClassification(), this)); } + if (isFunctionalSpace()) { + res.add(new Attribute("Building", getBuilding(), true)); + res.add(new Attribute("Floor", getFloor(), true)); + res.add(new Attribute("Apartment", getApartment(), true)); + res.add(new Attribute("Room", getRoom(), true)); + } res.add(new Attribute("ID", getId().toString(), false)); res.add(new Attribute("Owner", getOwner(), false)); *************** *** 2526,2528 **** --- 2551,2624 ---- this.level = level; } + + + /** + * Get the apartment + * @return The apartment + * @hibernate.property + */ + public String getApartment() { + return apartment; + } + + /** + * Set the apartment + * @param apartment The apartment + */ + public void setApartment(String apartment) { + this.apartment = apartment; + } + + /** + * Get the building + * @return The building + * @hibernate.property + */ + public String getBuilding() { + return building; + } + + /** + * Set the building + * @param building The building + */ + public void setBuilding(String building) { + this.building = building; + } + + /** + * Get the floor + * @return The floor + * @hibernate.property + */ + public String getFloor() { + return floor; + } + + /** + * Set the floor + * @param floor The floor + */ + public void setFloor(String floor) { + this.floor = floor; + } + + /** + * Get the room + * @return The room + * @hibernate.property + */ + public String getRoom() { + return room; + } + + /** + * Set the room + * @param room The room + */ + public void setRoom(String room) { + this.room = room; + } + + } |