[openrtm-commit:01167] r477 - in branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor: template ui/editor

openrtm @ openrtm.org openrtm @ openrtm.org
2014年 1月 21日 (火) 18:31:09 JST


Author: win-ei
Date: 2014-01-21 18:31:09 +0900 (Tue, 21 Jan 2014)
New Revision: 477

Modified:
   branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/DataPortConctTbl.c.vsl
   branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/TemplateUtil.java
   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/template/DataPortConctTbl.c.vsl
===================================================================
--- branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/DataPortConctTbl.c.vsl	2014-01-19 12:54:59 UTC (rev 476)
+++ branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/DataPortConctTbl.c.vsl	2014-01-21 09:31:09 UTC (rev 477)
@@ -18,11 +18,16 @@
 /* The connection setting table */ 
 const DataPortConctSetting_t gsDataPortConctSettingTbl[DATAPORT_CONNECT_NUM] =
 {
+$conns_num
+#foreach($key in $connectPorts.keySet())
     {
-        OBJECTKEY_DEMOLED_INPUT,                  /* InPortID(ObjectKey) */
-        OBJECTKEY_DEMOACCELERATION_OUTPUT,        /* OutPortID(ObjectKey) */
+        OBJECTKEY_${key.toUpperCase()}, /* InPortID(ObjectKey) */
+        OBJECTKEY_${connectPorts.get($key).toUpperCase()}, /* OutPortID(ObjectKey) */
         12,                                       /* Data length(byte) */
         RESERVE_FOR_DATAPORT_CONCT_CREATE_TBL,    /* Reserve */
+
     }
+#end
 };
 
+

Modified: branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/TemplateUtil.java
===================================================================
--- branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/TemplateUtil.java	2014-01-19 12:54:59 UTC (rev 476)
+++ branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/template/TemplateUtil.java	2014-01-21 09:31:09 UTC (rev 477)
@@ -80,15 +80,6 @@
 		System.out.println("createGeneratedResult");
 		return new GeneratedResult(fileName, generate(in, contextMap));
 	}
-	public static String createGeneratedResultDM(InputStream in,
-			Map<String, Object> contextMap, String fileName) {
-		System.out.println("createGeneratedResultDM");
-		return "Test";
-	}
-	public static void createGeneratedResultDM2() {
-		System.out.println("createGeneratedResultDM");
-		return ;
-	}
 
 	/**
 	 * 設定済みのVelocityEngineを取得する
@@ -160,6 +151,7 @@
 		System.out.println("Template.generate 030");
 		for (Iterator iter = contextMap.entrySet().iterator(); iter.hasNext();) {
 			Map.Entry element = (Map.Entry) iter.next();
+			System.out.println(element.getKey()+"  "+ element.getValue());
 			vc.put((String) element.getKey(), element.getValue());
 		}
 

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-19 12:54:59 UTC (rev 476)
+++ branches/work_ForRTMSafety/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/AbstractSystemDiagramEditor.java	2014-01-21 09:31:09 UTC (rev 477)
@@ -5,6 +5,10 @@
 import java.io.FileWriter;
 import java.io.BufferedWriter;
 import java.io.PrintWriter;
+import java.io.ByteArrayInputStream;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.openrtp.namespaces.rts.version02.DataportConnector;
+import org.openrtp.namespaces.rts.version02.TargetPort;
 //zxc+>
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -676,11 +680,14 @@
 				{
 					System.out.println("Creates table files  for RTMSafety");
 					final String TEMPLATE_PATH = "jp/go/aist/rtm/systemeditor/template";
+					//
+					//DataPortConctTbl.c
+					//
+					System.out.println("DataPortConctTbl.c");
 					String template = TEMPLATE_PATH + "/" +"DataPortConctTbl.c.vsl";
 					ClassLoader cl = Thread.currentThread().getContextClassLoader();
 					System.out.println("Loads class for RTMSafety");
-					System.out.print("template:");
-					System.out.println(template);
+					System.out.println("template:"+template);
 					InputStream ins = cl.getResourceAsStream(template);
 					System.out.println("Opens file.");
 					String outfile = "src/" + "testtable.c";
@@ -690,6 +697,16 @@
 					Map<String, Object> contextMap = new HashMap<String, Object>();
 					System.out.println("save 440");
 					contextMap.put("template", TEMPLATE_PATH);
+					List<DataportConnector> conns = profile.getDataPortConnectors();
+					int ic = 0;
+					Map connsMap = new HashMap();
+					for(DataportConnector conn : conns)
+					{
+						//contextMap.put("TargetDataPort", conn.getTargetDataPort().getPortName().replace(".", "_"));
+						//contextMap.put("SourceDataPort", conn.getSourceDataPort().getPortName().replace(".", "_"));
+						connsMap.put(conn.getTargetDataPort().getPortName().replace(".", "_"),conn.getSourceDataPort().getPortName().replace(".", "_"));
+					}
+					contextMap.put("connectPorts", connsMap);
 					System.out.println("save 450");
 					GeneratedResult gr = TemplateUtil.createGeneratedResult(ins, contextMap, outfile);
 					System.out.println("save 460");
@@ -723,21 +740,24 @@
 					System.out.println("save 476 tablepath="+tablepath);
 					String dataPortContct = tablepath+"\\DataPortConctTbl.c";
 					System.out.println("save 476 tablepath="+dataPortContct);
-					//File targetFile = new File("DataPortConctTbl.c");
 					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("save 480");
-					FileWriter filewriter = new FileWriter(targetFile);
+
 					System.out.println("save 490");
-					BufferedWriter bw = new BufferedWriter(filewriter);
 					System.out.println("save 495");
-					PrintWriter pw = new PrintWriter(bw);
 					System.out.println("save 500");
-					pw.println(gr.getCode());
 					System.out.println("save 600");
-					pw.close();
 					System.out.println("save 700");
 					System.out.println(gr.getCode());
 					System.out.println("save 800");
+					//
+					//
+					//
 
 				}
 



More information about the openrtm-commit mailing list