blob: ec525fd613c6507de8c636c03d6653586741b47f (
plain) (
blame)
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
|
package hu.bme.mit.inf.yakinduModelExtractor;
import java.util.List;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.yakindu.sct.model.sgraph.State;
import org.yakindu.sct.model.sgraph.Statechart;
public class Main {
public static void main(String[] args) {
ModelManager manager = new ModelManager();
Yakindu2CommonModel converter = new Yakindu2CommonModel();
String years[] = {"2015","2016","2017"};
for(String year : years) {
String folderPath = "D:\\Eclipse\\GIT\\RemoHF\\"+year;
// Loading folder
List<String> paths = manager.loadAllModelPathsInDirectory(folderPath);
int index = 1;
for(String path : paths) {
Statechart s = null;
try{
EObject root = manager.loadModel(path);
s = (Statechart) root;
} catch (Exception e) {
System.out.println("unable to load: "+ path);
}
if(s!=null) {
EObject s2 = converter.transform(s);
manager.saveModel(s2, "output/R"+year+index+".xmi");
}
System.out.println(year + " Progress: " + 100.0*index/paths.size() + "%");
index++;
}
System.out.println(year + " done.");
}
System.out.println("All done.");
}
}
|