[openrtm-commit:01182] r492 - branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 1月 24日 (金) 08:59:28 JST
Author: win-ei
Date: 2014-01-24 08:59:28 +0900 (Fri, 24 Jan 2014)
New Revision: 492
Modified:
branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java
Log:
Daily work.
Modified: branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java
===================================================================
--- branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java 2014-01-23 23:32:31 UTC (rev 491)
+++ branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java 2014-01-23 23:59:28 UTC (rev 492)
@@ -713,7 +713,7 @@
String template = TEMPLATE_PATH + "/" +"DataPortConctTbl.c.vsl";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream ins = cl.getResourceAsStream(template);
- String outfile = "src/" + "testtable.c";
+ String dataPortContct = tablepath+File.separator+"DataPortConctTbl.c";
Map<String, Object> contextMap = new HashMap<String, Object>();
contextMap.put("template", TEMPLATE_PATH);
List<DataportConnector> conns = profile.getDataPortConnectors();
@@ -724,11 +724,10 @@
connsMap.put(conn.getTargetDataPort().getPortName().replace(".", "_"),conn.getSourceDataPort().getPortName().replace(".", "_"));
}
contextMap.put("connectPorts", connsMap);
- GeneratedResult gr = TemplateUtil.createGeneratedResult(ins, contextMap, outfile);
+ GeneratedResult gr = TemplateUtil.createGeneratedResult(ins, contextMap, dataPortContct);
if (ins != null) {
ins.close();
}
- String dataPortContct = tablepath+File.separator+"DataPortConctTbl.c";
File targetFile = new File(dataPortContct);
FileWriter filewriter = new FileWriter(targetFile);
BufferedWriter bw = new BufferedWriter(filewriter);
@@ -1368,7 +1367,42 @@
public boolean openConfirm(String title, String message) {
return MessageDialog.openConfirm(getSite().getShell(), title, message);
}
+ /**
+ * Creates DataPortConctTbl.c
+ */
+ /*
+ public generateDataPortConctTbl()
+ {
+ String template = TEMPLATE_PATH + "/" +"DataPortConctTbl.c.vsl";
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ InputStream ins = cl.getResourceAsStream(template);
+ String dataPortContct = tablepath+File.separator+"DataPortConctTbl.c";
+ Map<String, Object> contextMap = new HashMap<String, Object>();
+ contextMap.put("template", TEMPLATE_PATH);
+ List<DataportConnector> conns = profile.getDataPortConnectors();
+ int ic = 0;
+ Map connsMap = new HashMap();
+ for(DataportConnector conn : conns)
+ {
+ connsMap.put(conn.getTargetDataPort().getPortName().replace(".", "_"),conn.getSourceDataPort().getPortName().replace(".", "_"));
+ }
+ contextMap.put("connectPorts", connsMap);
+ GeneratedResult gr = TemplateUtil.createGeneratedResult(ins, contextMap, dataPortContct);
+ if (ins != null)
+ {
+ ins.close();
+ }
+ File targetFile = new File(dataPortContct);
+ FileWriter filewriter = new FileWriter(targetFile);
+ BufferedWriter bw = new BufferedWriter(filewriter);
+ PrintWriter pw = new PrintWriter(bw);
+ pw.println(gr.getCode());
+ pw.close();
+ //System.out.println(gr.getCode());
+ }
+ */
+
// private void debugPrint(EditPart part, int size) {
// Object model = part.getModel();
// if (model instanceof Port) debugPrint((Port)model);
More information about the openrtm-commit
mailing list