[openrtm-commit:02816] r767 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder: . ui/editors
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 9月 9日 (土) 12:21:41 JST
Author: ga
Date: 2017-09-09 12:21:41 +0900 (Sat, 09 Sep 2017)
New Revision: 767
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/GuiRtcBuilder.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/AbstractEditorFormPage.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/DataPortEditorFormPage.java
Log:
Modified search method for CORBA data type #4151
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2017-09-06 13:49:56 UTC (rev 766)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java 2017-09-09 03:21:41 UTC (rev 767)
@@ -43,7 +43,6 @@
import jp.go.aist.rtm.rtcbuilder.manager.CommonGenerateManager;
import jp.go.aist.rtm.rtcbuilder.manager.GenerateManager;
import jp.go.aist.rtm.rtcbuilder.ui.editors.IMessageConstants;
-import jp.go.aist.rtm.rtcbuilder.ui.preference.DataTypePreferenceManager;
import jp.go.aist.rtm.rtcbuilder.util.FileUtil;
import jp.go.aist.rtm.rtcbuilder.util.StringUtil;
import jp.go.aist.rtm.rtcbuilder.util.ValidationUtil;
@@ -146,7 +145,6 @@
}
}
}
- rtcParam.getIdlPathes().addAll(DataTypePreferenceManager.getInstance().getIdlFileDirectories());
if(idlDir!=null) {
rtcParam.getIdlPathes().addAll(idlDir);
}
@@ -676,11 +674,11 @@
* @throws ParseException
* @throws IOException
*/
- public void doGenerateWrite(GeneratorParam generatorParam,
+ public void doGenerateWrite(GeneratorParam generatorParam, List<String> idlDirs,
MergeHandler handler) throws Exception {
for( RtcParam rtcParam : generatorParam.getRtcParams() ) {
- List<GeneratedResult> generatedResult = generateTemplateCode(generatorParam);
+ List<GeneratedResult> generatedResult = generateTemplateCode(generatorParam, idlDirs, true);
writeFile(generatedResult, rtcParam, handler);
}
}
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/GuiRtcBuilder.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/GuiRtcBuilder.java 2017-09-06 13:49:56 UTC (rev 766)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/GuiRtcBuilder.java 2017-09-09 03:21:41 UTC (rev 767)
@@ -1,5 +1,7 @@
package jp.go.aist.rtm.rtcbuilder;
+import java.util.List;
+
import jp.go.aist.rtm.rtcbuilder.Generator.MergeHandler;
import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
import jp.go.aist.rtm.rtcbuilder.generator.param.GeneratorParam;
@@ -40,8 +42,9 @@
* @param generatorParam
* パラメータ
*/
+ @Deprecated
public boolean doGenerateWrite(GeneratorParam generatorParam) {
- return this.doGenerateWrite(generatorParam, true);
+ return this.doGenerateWrite(generatorParam, null, true);
}
/**
* ジェネレートを行い、ファイル出力を行う
@@ -49,10 +52,10 @@
* @param generatorParam パラメータ
* @param isShowDialog 完了時にダイアログを表示するか
*/
- public boolean doGenerateWrite(GeneratorParam generatorParam, boolean isShowDialog) {
+ public boolean doGenerateWrite(GeneratorParam generatorParam, List<String> idlDirs, boolean isShowDialog) {
try {
- generator.doGenerateWrite(generatorParam, new MergeHandler() {
+ generator.doGenerateWrite(generatorParam, idlDirs, new MergeHandler() {
public int getSelectedProcess(GeneratedResult generatedResult,
String originalFileContents) {
return compareByDialog(generatedResult,
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/AbstractEditorFormPage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/AbstractEditorFormPage.java 2017-09-06 13:49:56 UTC (rev 766)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/AbstractEditorFormPage.java 2017-09-09 03:21:41 UTC (rev 767)
@@ -8,7 +8,6 @@
import java.util.List;
import java.util.StringTokenizer;
-import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
import jp.go.aist.rtm.rtcbuilder.RtcBuilderPlugin;
import jp.go.aist.rtm.rtcbuilder.generator.IDLParamConverter;
import jp.go.aist.rtm.rtcbuilder.generator.param.DataTypeParam;
@@ -16,6 +15,10 @@
import jp.go.aist.rtm.rtcbuilder.ui.preference.DataTypePreferenceManager;
import jp.go.aist.rtm.rtcbuilder.util.FileUtil;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.TableViewer;
@@ -437,10 +440,23 @@
return 0;
}
+ protected List<String> getIDLDirectoriesForData() {
+ List<String> result = new ArrayList<String>(DataTypePreferenceManager
+ .getInstance().getIdlFileDirectories());
+ if(editor!=null && editor.getRtcParam()!=null && editor.getRtcParam().getOutputProject()!=null && 0<editor.getRtcParam().getOutputProject().length()) {
+ IWorkspaceRoot workspaceHandle = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = workspaceHandle.getProject(editor.getRtcParam().getOutputProject());
+ IFolder path = project.getFolder("idl");
+ if(path!=null && path.exists()) {
+ result.add(path.getLocation().toOSString());
+ }
+ }
+ return result;
+ }
+
protected String[] extractDataTypes() {
+ List<String> sources = getIDLDirectoriesForData();
String FS = System.getProperty("file.separator");
- List<String> sources = new ArrayList<String>(DataTypePreferenceManager
- .getInstance().getIdlFileDirectories());
String defaultPath = System.getenv("RTM_ROOT");
int baseindex = -1;
if (defaultPath != null) {
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java 2017-09-06 13:49:56 UTC (rev 766)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java 2017-09-09 03:21:41 UTC (rev 767)
@@ -341,7 +341,8 @@
//TODO 複数コンポーネント対応版とする場合には複数設定
generatorParam.getRtcParams().get(0).getServiceClassParams().clear();
setPrefixSuffix(generatorParam.getRtcParams().get(0));
- if (rtcBuilder.doGenerateWrite(generatorParam)) {
+ List<String> idlDirs = getIDLDirectoriesForData();
+ if (rtcBuilder.doGenerateWrite(generatorParam, idlDirs, true)) {
LanguageProperty langProp = LanguageProperty.checkPlugin(editor.getRtcParam());
if(langProp != null) {
try {
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/DataPortEditorFormPage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/DataPortEditorFormPage.java 2017-09-06 13:49:56 UTC (rev 766)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/DataPortEditorFormPage.java 2017-09-09 03:21:41 UTC (rev 767)
@@ -147,7 +147,7 @@
portNameText.setBackground(getSite().getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
//
Group detailGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
- detailGroup.setLayout(new GridLayout(2, false));
+ detailGroup.setLayout(new GridLayout(3, false));
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
detailGroup.setLayoutData(gd);
@@ -157,9 +157,27 @@
String[] items = typeCombo.getItems();
Arrays.sort(items);
typeCombo.setItems(items);
+
+ Button reloadButton = toolkit.createButton(detailGroup, "ReLoad", SWT.PUSH);
+ reloadButton.addSelectionListener(new SelectionAdapter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ defaultTypeList = extractDataTypes();
+ Arrays.sort(defaultTypeList);
+ typeCombo.removeAll();
+ typeCombo.setItems(defaultTypeList);
+ }
+ });
//
varNameText = createLabelAndText(toolkit, detailGroup, IMessageConstants.DATAPORT_TBLLBL_VARNAME, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ varNameText.setLayoutData(gd);
positionCombo = createLabelAndCombo(toolkit, detailGroup, IMessageConstants.DATAPORT_TBLLBL_POSITION, DataPortParam.COMBO_ITEM);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ positionCombo.setLayoutData(gd);
/////
Group documentGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);
documentGroup.setLayout(new GridLayout(2, false));
More information about the openrtm-commit
mailing list