基于JGraphX的通风网络解算---通风网络解算中出现风量为负值的处理

在通风网络计算中,如果风流的方向与分支的方向相反时,会出现风量解算结果为负数的情况,此时需要做相应的处理。

                                               <pre name="code" class="java">					if(ve.getAirQ()<0){
						Node bn = (Node) c.getSource().getValue();
						//Node nbn = nl.getNode(bn.getLabel());
						

						Node en = (Node) c.getTarget().getValue();
					//	Node nen = nl.getNode(en.getLabel());
						mxCell cs = (mxCell) c.getSource();
						mxCell ct = (mxCell) c.getTarget();
						c.setSource(ct);
						c.setTarget(cs);
//						c.getSource().setValue(en);
//						c.getTarget().setValue(bn);
						ve.setEnode(bn);
						ve.setBnode(en);
						c.setValue(ve);

//						mxPoint sp=c.getGeometry().getSourcePoint();
//						mxPoint tp=c.getGeometry().getTargetPoint();
//						c.getGeometry().setSourcePoint(tp);
//						c.getGeometry().setTargetPoint(sp);
						
						
					}

 
 

发布了34 篇原创文章 · 获赞 9 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/tianyatest/article/details/47133023