Skip to content
Browse files

initial 100

  • Loading branch information...
1 parent affeadd commit 370230d0dc0217b32bb6a97e3d47ef1ca77e74d2 @Baseform committed Feb 15, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/org/addition/epanet/EPATool.java
View
11 src/org/addition/epanet/EPATool.java
@@ -29,6 +29,7 @@
import org.addition.epanet.network.structures.Demand;
import org.addition.epanet.network.structures.Link;
import org.addition.epanet.network.structures.Node;
+import org.addition.epanet.network.structures.Pump;
import org.addition.epanet.quality.QualityReader;
import org.addition.epanet.quality.QualitySim;
import org.addition.epanet.util.ENException;
@@ -136,15 +137,19 @@ public double getValue(FieldsMap fmap, AwareStep step, Node node, int index) thr
this.type = type;
}
- public double getValue(FieldsMap fmap, AwareStep step, Link link, int index) throws ENException
+
+ public double getValue(PropertiesMap.FormType formType,FieldsMap fmap, AwareStep step, Link link, int index) throws ENException
{
switch (this) {
case LENGHT:
return fmap.revertUnit(type, link.getLenght());
case DIAMETER:
return fmap.revertUnit(type, link.getDiameter());
case ROUGHNESS:
- return fmap.revertUnit(type, link.getRoughness());
+ if(link.getType()== Link.LinkType.PIPE && formType == PropertiesMap.FormType.DW)
+ return fmap.revertUnit(FieldsMap.Type.DIAM, link.getRoughness());
+ else
+ return link.getRoughness();
case FLOW:
return step != null ? Math.abs(step.getLinkFlow(index, link, fmap)) : 0;
case VELOCITY:
@@ -383,7 +388,7 @@ else if(parseMode == 3){
for (LinkVariableType linkVar : linksVariables) {
linksTextWriter.write("\t");
- Double val = linkVar.getValue(net.getFieldsMap(), step, link, i);
+ Double val = linkVar.getValue(net.getPropertiesMap().getFormflag(),net.getFieldsMap(), step, link, i);
linksTextWriter.write(convertToScientifcNotation(val, 1000, 0.01, 2));
}

0 comments on commit 370230d

Please sign in to comment.
Something went wrong with that request. Please try again.