-
Notifications
You must be signed in to change notification settings - Fork 7
/
RunTool.java
51 lines (42 loc) · 1.62 KB
/
RunTool.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main.java.ui;
import java.io.File;
import java.io.IOException;
import org.jdom2.Document;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import main.java.model.gbXML.ReverseTranslator;
import main.java.plugins.ashraeassumptions.ASHRAEConstructions;
import main.java.plugins.ashraeassumptions.ASHRAELightData;
import main.java.plugins.ashraeassumptions.ASHRAEOAData;
import main.java.plugins.ashraeassumptions.DOEReferenceEquipmentData;
import main.java.plugins.ashraebaseline.ASHRAEHVAC;
/**
* Test code
* @author weilixu
*
*/
public class RunTool {
public static void main(String[] args){
SAXBuilder builder = new SAXBuilder();
File xmlFile = new File("/Users/weilixu/Dropbox/BCD-weili/gbXMLTest/temp.xml");
Document doc;
try {
doc = (Document) builder.build(xmlFile);
ReverseTranslator trans = new ReverseTranslator(doc, "8.6");
//register construction
trans.registerDataPlugins(new ASHRAEConstructions());
trans.registerDataPlugins(new ASHRAELightData());
trans.registerDataPlugins(new ASHRAEOAData());
trans.registerDataPlugins(new DOEReferenceEquipmentData());
trans.registerDataPlugins(new ASHRAEHVAC());
trans.convert();
trans.exportFile("/Users/weilixu/Dropbox/BCD-weili/gbXMLTest");
} catch (JDOMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}