[openrtm-commit:00863] r330 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator: . param

openrtm @ openrtm.org openrtm @ openrtm.org
2012年 7月 6日 (金) 02:26:40 JST


Author: sakamoto
Date: 2012-07-06 02:26:40 +0900 (Fri, 06 Jul 2012)
New Revision: 330

Modified:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/ProfileHandler.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/ParamUtil.java
Log:
Modified RtcProfile generator

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/ProfileHandler.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/ProfileHandler.java	2012-07-04 06:05:16 UTC (rev 329)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/ProfileHandler.java	2012-07-05 17:26:40 UTC (rev 330)
@@ -77,6 +77,15 @@
 		return xmlFile;
 	}
 
+	public String convert2XML(RtcParam target) throws Exception {
+	    String xmlFile = "";
+	    ParamUtil putil = new ParamUtil();
+		RtcProfile profile = putil.convertToModule(target, managerList);
+		XmlHandler handler = new XmlHandler();
+		xmlFile = handler.convertToXmlRtc(profile);
+		return xmlFile;
+	}
+
 	public 	String createInitialRtcXml(String creationDate) {
 		String result = "";
 		RtcProfile profile = ParamUtil.initialXml(creationDate);

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/ParamUtil.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/ParamUtil.java	2012-07-04 06:05:16 UTC (rev 329)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/ParamUtil.java	2012-07-05 17:26:40 UTC (rev 330)
@@ -522,32 +522,35 @@
 	public RtcProfile convertToModule(GeneratorParam generatorParam,
 										List<GenerateManager> managerList) throws Exception {
 		RtcParam rtcParam = generatorParam.getRtcParams().get(0);
-		
+		return convertToModule(rtcParam, managerList);
+	}
+
+	public RtcProfile convertToModule(RtcParam target, List<GenerateManager> managerList) throws Exception {
 		ObjectFactory factory = new ObjectFactory();
 		RtcProfile profile = factory.createRtcProfile();
 		String moduleId = IRtcBuilderConstants.SPEC_SUFFIX + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
-							rtcParam.getVender() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
-							rtcParam.getCategory() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
-							rtcParam.getName() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
-							rtcParam.getVersion();
+		target.getVender() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
+		target.getCategory() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
+		target.getName() + IRtcBuilderConstants.SPEC_MAJOR_SEPARATOR +
+		target.getVersion();
 		profile.setId(moduleId);
-		profile.setVersion(rtcParam.getSchemaVersion());
-		convertToModuleBasic(rtcParam, factory, profile);
-		convertToModuleActions(rtcParam, factory, profile);
-		
-		for( DataPortParam dataportp : rtcParam.getInports() ) {
+		profile.setVersion(target.getSchemaVersion());
+		convertToModuleBasic(target, factory, profile);
+		convertToModuleActions(target, factory, profile);
+
+		for( DataPortParam dataportp : target.getInports() ) {
 			profile.getDataPorts().add(createDataPort(dataportp, IRtcBuilderConstants.SPEC_DATA_INPORT_KIND));
 		}
-		for( DataPortParam dataportp : rtcParam.getOutports() ) {
+		for( DataPortParam dataportp : target.getOutports() ) {
 			profile.getDataPorts().add(createDataPort(dataportp, IRtcBuilderConstants.SPEC_DATA_OUTPORT_KIND));
 		}
-		for( ServicePortParam serviceportp : rtcParam.getServicePorts() ) {
+		for( ServicePortParam serviceportp : target.getServicePorts() ) {
 			ServiceportExt serviceport = createServicePort(serviceportp);
 			profile.getServicePorts().add(serviceport);
 		}
-		convertToModuleConfiguration(rtcParam, factory, profile);
-		convertToModuleParameter(rtcParam, factory, profile);
-		convertToModuleLanguage(managerList, rtcParam, factory, profile);
+		convertToModuleConfiguration(target, factory, profile);
+		convertToModuleParameter(target, factory, profile);
+		convertToModuleLanguage(managerList, target, factory, profile);
 		
 		deleteInapplicableItem(profile, managerList);
 		



More information about the openrtm-commit mailing list