| | |
| | | |
| | | |
| | | import com.whyc.pojo.*; |
| | | import com.whyc.util.MathUtil; |
| | | import org.dom4j.Document; |
| | | import org.dom4j.DocumentException; |
| | | import org.dom4j.Element; |
| | |
| | | file_node=node.element("br_1"); |
| | | String br=file_node.getTextTrim(); |
| | | battData.setBr(br); |
| | | float esCap=0f; |
| | | /*float esCap=0f; |
| | | if(battRes==0){ |
| | | esCap=1; |
| | | }else{ |
| | | esCap=battRes/Float.valueOf(br); |
| | | } |
| | | battData.setEstimatedCap(esCap*battCap); |
| | | battData.setBr(br); |
| | | battData.setEstimatedCap(esCap*battCap);*/ |
| | | float preCapPercent=MathUtil.getPreCapTest(Float.valueOf(br),battRes); |
| | | //容量百分比修改 |
| | | battData.setPreCapPercent(preCapPercent); |
| | | //预估容量 |
| | | battData.setEstimatedCap(preCapPercent*battCap); |
| | | //内阻偏差率 |
| | | float resDevRate=(Float.valueOf(br)-battRes)/battRes; |
| | | battData.setResDevRate(resDevRate); |
| | | |
| | | file_node=node.element("bs_1"); |
| | | battData.setBs(file_node.getTextTrim()); |
| | | file_node=node.element("cr_1"); |
| | |
| | | batt_node=file_node.element("br_1"); |
| | | String br=batt_node.getTextTrim(); |
| | | battData.setBr(br); |
| | | float esCap=0f; |
| | | /* float esCap=0f; |
| | | if(battRes==0){ |
| | | esCap=1; |
| | | }else{ |
| | | esCap=battRes/Float.valueOf(br); |
| | | } |
| | | battData.setEstimatedCap(esCap*battCap); |
| | | battData.setEstimatedCap(esCap*battCap);*/ |
| | | float preCapPercent=MathUtil.getPreCapTest(Float.valueOf(br),battRes); |
| | | //容量百分比修改 |
| | | battData.setPreCapPercent(preCapPercent); |
| | | //预估容量 |
| | | battData.setEstimatedCap(preCapPercent*battCap); |
| | | //内阻偏差率 |
| | | float resDevRate=(Float.valueOf(br)-battRes)/battRes; |
| | | battData.setResDevRate(resDevRate); |
| | | |
| | | batt_node=file_node.element("bs_1"); |
| | | battData.setBs(batt_node.getTextTrim()); |
| | | batt_node=file_node.element("cr_1"); |
| | |
| | | } |
| | | return fileInfo; |
| | | } |
| | | |
| | | |
| | | //解析xml文件 |
| | | public static FileInfo readXml(String xmlFilePath) |
| | | { |