[openrtm-commit:02779] r764 - in trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor: corba nl ui/dialog ui/editor ui/util ui/views/managercontrolview
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 8月 30日 (水) 10:34:44 JST
Author: ga
Date: 2017-08-30 10:34:44 +0900 (Wed, 30 Aug 2017)
New Revision: 764
Modified:
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/corba/CORBAHelper.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/CreateComponentDialog.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/RestoreComponentDialog.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/UIUtil.java
trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java
Log:
Added Mapping Restore
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/corba/CORBAHelper.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/corba/CORBAHelper.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/corba/CORBAHelper.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -9,7 +9,9 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
+import java.util.logging.Level;
import jp.go.aist.rtm.nameserviceview.corba.NameServerAccesser;
import jp.go.aist.rtm.toolscommon.model.component.Component;
@@ -19,6 +21,7 @@
import jp.go.aist.rtm.toolscommon.synchronizationframework.SynchronizationSupport;
import jp.go.aist.rtm.toolscommon.util.RtsProfileHandler;
+import org.omg.CORBA.ORB;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,6 +35,7 @@
private static NS _ns = new NS();
private static Factory _factory = new Factory();
+ public static final int MANAGER_PORT = 2810;
/**
* CORBA ネーミングサービスに関するヘルパーを取得します (Singleton)。
@@ -398,6 +402,72 @@
}
/**
+ * ORBオブジェクトを生成、管理するヘルパー
+ */
+ public static class ORBUtil {
+
+ private static ORB orb = null;
+
+ /**
+ * ORBオブジェクトを取得する
+ *
+ * @return ORBオブジェクト
+ */
+ public static ORB getOrb() {
+ return getOrb(null);
+ }
+
+ /**
+ * 管理しているORBオブジェクトをクリアする
+ *
+ */
+ public static void clearOrb() {
+ orb = null;
+ }
+
+ /**
+ * ORBオブジェクトを取得する
+ *
+ * @param args
+ * アプリケーションの main メソッドのコマンド行引数
+ *
+ * @return ORBオブジェクト
+ */
+ public static ORB getOrb(String[] args) {
+ return getOrb(args, null);
+ }
+
+ /**
+ * 指定された引数に基づいてORBオブジェクトを生成後、取得する
+ * <p>
+ * すでにORBオブジェクトが生成済みの場合は、それが取得される
+ *
+ * @param args
+ * ORBオブジェクト生成時の引数
+ * @return ORBオブジェクト
+ */
+ public static ORB getOrb(String[] args, Properties prop) {
+
+ if (orb == null) {
+ orb = ORB.init(args, prop);
+ try {
+ if (orb instanceof com.sun.corba.se.spi.orb.ORB) {
+ java.util.logging.Logger logger = ((com.sun.corba.se.spi.orb.ORB) orb).getLogger("");
+ logger.setLevel(Level.SEVERE); // log
+ }
+ } catch (Exception e) {
+ e.printStackTrace(); // system error
+
+ } catch (NoClassDefFoundError e) {
+ e.printStackTrace(); // system error
+ }
+ }
+
+ return orb;
+ }
+ }
+
+ /**
* コンポーネントの生成コマンドのパラメータを表します。
*/
public static class CreateComponentParameter {
@@ -407,6 +477,9 @@
public static final String KEY_EXPORTED_PORTS = "exported_ports";
public static final String KEY_MANAGER_NAME = "manager_name";
public static final String KEY_LANGUAGE = "language";
+ public static final String KEY_VENDOR = "vendor";
+ public static final String KEY_CATEGORY = "category";
+ public static final String KEY_VERSION = "version";
private String implementation_id;
private String instance_name;
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/nl/messages.properties 2017-08-30 01:34:44 UTC (rev 764)
@@ -94,7 +94,6 @@
NewCompositeComponentDialog.msg.contain_grouping_fail=The Grouping composite component cannot be included in the composite components other than Grouping.
CreateComponentDialog.2=Type :
CreateComponentDialog.manager_name.title=Manager Name :
-CreateComponentDialog.lang.title=Language :
CreateComponentDialog.3=Parameter :
CreateComponentDialog.6=Invalid parameter format.
CreateComponentDialog.add_button=Add
@@ -343,7 +342,7 @@
IconPreferenceDialog.filter.name=Icon image
IconPreferencePage.error.import=Icon profile import failure.
IconPreferencePage.error.export=Icon profile export failure.
-RestoreComponentDialog.head_message=Please map target for components.
+RestoreComponentDialog.head_message=Please assign components to be restored to nodes.
RestoreComponentDialog.msg_no_ep_name=No endpoint name
RestoreComponentDialog.msg_ep_unreach=Endpoint unreachable
RestoreComponentDialog.msg_need_create=Creation necessary
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/CreateComponentDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/CreateComponentDialog.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/CreateComponentDialog.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -1,7 +1,10 @@
package jp.go.aist.rtm.systemeditor.ui.dialog;
+import static jp.go.aist.rtm.systemeditor.corba.CORBAHelper.CreateComponentParameter.KEY_CATEGORY;
import static jp.go.aist.rtm.systemeditor.corba.CORBAHelper.CreateComponentParameter.KEY_IMPLEMENTATION_ID;
import static jp.go.aist.rtm.systemeditor.corba.CORBAHelper.CreateComponentParameter.KEY_LANGUAGE;
+import static jp.go.aist.rtm.systemeditor.corba.CORBAHelper.CreateComponentParameter.KEY_VENDOR;
+import static jp.go.aist.rtm.systemeditor.corba.CORBAHelper.CreateComponentParameter.KEY_VERSION;
import java.util.ArrayList;
import java.util.Arrays;
@@ -60,8 +63,6 @@
.getString("CreateComponentDialog.2");
private static final String LABEL_MANAGER_NAME_TITLE = Messages
.getString("CreateComponentDialog.manager_name.title");
- private static final String LABEL_LANGUAGE_TITLE = Messages
- .getString("CreateComponentDialog.lang.title");
private static final String LABEL_PARAMETER_TITLE = Messages
.getString("CreateComponentDialog.3");
private static final String ERR_INVALID_PARAM = Messages
@@ -79,7 +80,6 @@
private Combo typeCombo;
private Combo managerNameCombo;
- private Combo langCombo;
private TableViewer parameterViewer;
private Button parameterAddButton;
private Button parameterDeleteButton;
@@ -95,11 +95,11 @@
private ParameterCellModifier keyModifier;
private String[] defaultKeyList = {"instance_name", "conf.__widget__.", "conf._constraints__."};
private String[] currentKeyList = {};
+ private List<String> exclusionList;
/** モジュール情報 */
static class Module {
String type;
- String lang;
List<String> keyList = new ArrayList<String>();
}
@@ -107,6 +107,13 @@
super(parentShell);
setHelpAvailable(false);
setShellStyle(getShellStyle() | SWT.CENTER | SWT.RESIZE);
+
+ exclusionList = new ArrayList<String>();
+ exclusionList.add("vendor");
+ exclusionList.add("category");
+ exclusionList.add("implementation_id");
+ exclusionList.add("language");
+ exclusionList.add("version");
}
/**
@@ -117,14 +124,16 @@
public void setModuleProfileList(List<RTM.ModuleProfile> moduleProfileList) {
this.moduleList.clear();
for (RTM.ModuleProfile prof : moduleProfileList) {
- String type = SDOUtil.findValueAsString(KEY_IMPLEMENTATION_ID,
- prof.properties);
- String lang = SDOUtil.findValueAsString(KEY_LANGUAGE,
- prof.properties);
+ String type = SDOUtil.findValueAsString(KEY_IMPLEMENTATION_ID, prof.properties);
+ String lang = SDOUtil.findValueAsString(KEY_LANGUAGE, prof.properties);
+ String vendor = SDOUtil.findValueAsString(KEY_VENDOR, prof.properties);
+ String category = SDOUtil.findValueAsString(KEY_CATEGORY, prof.properties);
+ String version = SDOUtil.findValueAsString(KEY_VERSION, prof.properties);
+
Module mod = new Module();
- mod.type = type;
- mod.lang = lang;
+ mod.type = "RTC:" + vendor + ":" + category + ":" + type + ":" + lang + ":" + version;
for(NameValue p : prof.properties) {
+ if(exclusionList.contains(p.name) ) continue;
mod.keyList.add(p.name);
}
this.moduleList.add(mod);
@@ -174,7 +183,7 @@
Label typeLabel = new Label(mainComposite, SWT.NONE);
typeLabel.setText(LABEL_TYPE_TITLE);
- this.typeCombo = new Combo(mainComposite, SWT.NONE);
+ this.typeCombo = new Combo(mainComposite, SWT.READ_ONLY);
GridData gd = new GridData(GridData.GRAB_HORIZONTAL);
gd.minimumWidth = 180;
gd.horizontalAlignment = GridData.FILL;
@@ -188,15 +197,6 @@
this.typeCombo.select(0);
this.typeCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- String type = typeCombo.getText();
- Module mod = findModuleByType(type);
- if (mod != null) {
- langCombo.removeAll();
- langCombo.add(mod.lang);
- setKeyList(mod);
- }
- langCombo.select(0);
- //
notifyModified();
}
});
@@ -203,17 +203,6 @@
this.typeCombo.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
- int selected = typeCombo.getSelectionIndex();
- if(selected < 0) return;
- Module mod = moduleList.get(selected);
-
- if (mod != null) {
- langCombo.removeAll();
- langCombo.add(mod.lang);
- setKeyList(mod);
- }
- langCombo.select(0);
- //
notifyModified();
}
@Override
@@ -223,7 +212,7 @@
Label mnLabel = new Label(mainComposite, SWT.NONE);
mnLabel.setText(LABEL_MANAGER_NAME_TITLE);
- this.managerNameCombo = new Combo(mainComposite, SWT.NONE);
+ this.managerNameCombo = new Combo(mainComposite, SWT.READ_ONLY);
gd = new GridData(GridData.GRAB_HORIZONTAL);
gd.minimumWidth = 180;
gd.horizontalAlignment = GridData.FILL;
@@ -243,25 +232,6 @@
}
});
- Label langLabel = new Label(mainComposite, SWT.NONE);
- langLabel.setText(LABEL_LANGUAGE_TITLE);
- this.langCombo = new Combo(mainComposite, SWT.NONE);
- gd = new GridData(GridData.GRAB_HORIZONTAL);
- gd.minimumWidth = 180;
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- this.langCombo.setLayoutData(gd);
- Module mod = findModuleByType(this.typeCombo.getText());
- if (mod != null) {
- this.langCombo.add(mod.lang);
- }
- this.langCombo.select(0);
- this.langCombo.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- notifyModified();
- }
- });
-
Group parameterGroup = new Group(mainComposite, SWT.SHADOW_IN);
parameterGroup.setText(LABEL_PARAMETER_TITLE);
gl = new GridLayout(2, false);
@@ -407,25 +377,11 @@
return composite;
}
- /** コンポーネント型名からモジュール情報を検索します。 */
- private Module findModuleByType(String type) {
- if (type == null || type.isEmpty()) {
- return null;
- }
- for (Module mod : this.moduleList) {
- if (type.equals(mod.type)) {
- return mod;
- }
- }
- return null;
- }
-
/** 変更を通知します。 */
private void notifyModified() {
this.parameter = new CORBAHelper.CreateComponentParameter(
this.typeCombo.getText());
this.parameter.setManagerName(this.managerNameCombo.getText());
- this.parameter.setLanguage(this.langCombo.getText());
this.parameter.setParams(buildParameter());
//
if (!validateInput()) {
@@ -518,7 +474,7 @@
super(viewer);
switch (column) {
case PARAMETER_KEY:
- editor = new LocalComboBoxCellEditor(((TableViewer) viewer).getTable(), currentKeyList, SWT.DROP_DOWN);
+ editor = new LocalComboBoxCellEditor(((TableViewer) viewer).getTable(), currentKeyList, SWT.READ_ONLY);
break;
default:
editor = new TextCellEditor(((TableViewer) viewer).getTable());
@@ -564,16 +520,10 @@
switch (this.column) {
case PARAMETER_KEY:
- if( value instanceof Integer ) {
- targetParam.setName(currentKeyList[((Integer) value).intValue()]);
- if(currentKeyList.length > ((Integer) value).intValue()) {
- targetParam.setName(
- currentKeyList[((Integer) value).intValue()]);
- }
- }else{
- // 手入力された場合
- updateDefaultKeyList((String)value);
- targetParam.setName((String)value);
+ targetParam.setName(currentKeyList[((Integer) value).intValue()]);
+ if(currentKeyList.length > ((Integer) value).intValue()) {
+ targetParam.setName(
+ currentKeyList[((Integer) value).intValue()]);
}
break;
case PARAMETER_VALUE:
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/RestoreComponentDialog.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/RestoreComponentDialog.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/dialog/RestoreComponentDialog.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -1,6 +1,8 @@
package jp.go.aist.rtm.systemeditor.ui.dialog;
+import static jp.go.aist.rtm.systemeditor.ui.util.UIUtil.COLOR_MODIFY;
import static jp.go.aist.rtm.systemeditor.ui.util.UIUtil.COLOR_WHITE;
+import static jp.go.aist.rtm.systemeditor.ui.util.UIUtil.COLOR_UNEDITABLE;
import static jp.go.aist.rtm.systemeditor.ui.util.UIUtil.getColor;
import java.util.ArrayList;
@@ -11,12 +13,14 @@
import jp.go.aist.rtm.systemeditor.corba.CORBAHelper;
import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.toolscommon.model.component.CorbaComponent;
+import jp.go.aist.rtm.toolscommon.model.component.SystemDiagram;
import jp.go.aist.rtm.toolscommon.model.manager.ManagerFactory;
import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -25,10 +29,13 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -39,10 +46,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import RTM.ManagerHelper;
+
/**
* RTシステム復元設定を行うダイアログ
*/
-public class RestoreComponentDialog extends TitleAreaDialog {
+public class RestoreComponentDialog extends Dialog {
private static final Logger LOGGER = LoggerFactory
.getLogger(RestoreComponentDialog.class);
@@ -57,32 +66,38 @@
static final String MSG_STATUS_NEED_CREATE = Messages
.getString("RestoreComponentDialog.msg_need_create");
- private static final String LABEL_COMPONENT = "component:";
- private static final String LABEL_MANAGER = "manager:";
- private static final String LABEL_TARGET = "target:";
- private static final String LABEL_STATUS = "status:";
+ private static final String LABEL_COMPONENT_NAME = "Component Name:";
+ private static final String LABEL_COMPONENT_ID = "Component Id:";
+ private static final String LABEL_NODE = "Node:";
+ private static final String LABEL_CONTAINER = "Container:";
- private static final String COL_COMPONENT = "component";
- private static final String COL_TYPE = "type";
- private static final String COL_MANAGER = "manager";
- private static final String COL_ENDPOINT = "endpoint";
- private static final String COL_TARGET = "target";
- private static final String COL_STATUS = "status";
+ private static final String COL_COMPONENT_NAME = "Component Name";
+ private static final String COL_COMPONENT_ID = "Component Id";
+ private static final String COL_NODE = "Node";
+ private static final String COL_CONTAINER = "Container";
+ private static final String COL_STATUS = "Status";
static final String PROP_IMPLEMENTATION_ID = "implementation_id";
+ static final String PROP_INSTANCE_NAME = "instance_name";
+ static final String PROP_LANGUAGE = "language";
+ static final String PROP_VENDOR = "vendor";
+ static final String PROP_CATEGORY = "category";
+ static final String PROP_VERSION = "version";
static final String PROP_CORBA_ENDPOINTS = "corba.endpoints";
- static final String PROP_MANAGER_NAME = "manager_name";
+ static final String PROP_MANAGER_NAME = "manager.instance_name";
+ static final int APPLY_ID = 998;
+
private TableViewer tableViewer;
private Table table;
private Label componentNameLabel;
- private Label typeNameLabel;
- private Text managerNameText;
- private Text endpointNameText;
- private Combo targetCombo;
- private Label statusLabel;
+ private Label componentIdLabel;
+ private Text nodeText;
+ private Text containerText;
+ private SystemDiagram diagram;
+
private List<TargetInfo> targetList = new ArrayList<>();
private TargetInfo selectedTarget;
@@ -90,10 +105,13 @@
public RestoreComponentDialog(Shell parentShell) {
super(parentShell);
- setHelpAvailable(false);
setShellStyle(getShellStyle() | SWT.CENTER | SWT.RESIZE);
}
+ public void setSystemDiagram(SystemDiagram source) {
+ this.diagram = source;
+ }
+
/**
* マッピング対象となる CORBAコンポーネントの一覧を設定します。
*/
@@ -103,14 +121,18 @@
}
for (CorbaComponent comp : list) {
TargetInfo target = new TargetInfo(comp);
- target.verifyStatus();
this.targetList.add(target);
- String epName = target.getEndpointName();
+ String epName = target.node;
if (epName == null) {
continue;
}
- Endpoint ep = this.endpoints.get(epName);
- RTC.RTObject rtc = ep.getComponent(target.getName());
+ String[] epList = epName.split(",");
+ Endpoint ep = null;
+ for(String each : epList) {
+ ep = this.endpoints.get(each);
+ if(ep!=EndpointCache.NULL_ENDPOINT) break;
+ }
+ RTC.RTObject rtc = ep.getComponent(target.compName);
if (rtc != null) {
target.setTarget(rtc);
}
@@ -117,17 +139,6 @@
}
}
- /**
- * マッピングの設定結果一覧を取得します。
- */
- public List<MappingResult> getMappingResultList() {
- List<MappingResult> ret = new ArrayList<>();
- for (TargetInfo target : this.targetList) {
- ret.add(target.getMappingResult());
- }
- return ret;
- }
-
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
@@ -157,9 +168,8 @@
SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER);
this.tableViewer.setContentProvider(new ArrayContentProvider());
this.tableViewer
- .setColumnProperties(new String[] { COL_COMPONENT,
- COL_TYPE, COL_MANAGER, COL_ENDPOINT, COL_TARGET,
- COL_STATUS });
+ .setColumnProperties(new String[] { COL_COMPONENT_NAME,
+ COL_COMPONENT_ID, COL_NODE, COL_CONTAINER, COL_STATUS });
this.tableViewer.setLabelProvider(new TargetLabelProvider());
this.tableViewer
.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -191,31 +201,28 @@
this.table.setHeaderVisible(true);
TableColumn col = new TableColumn(this.table, SWT.NONE);
- col.setText(COL_COMPONENT);
+ col.setText(COL_COMPONENT_NAME);
col.setWidth(150);
col = new TableColumn(this.table, SWT.NONE);
- col.setText(COL_TYPE);
- col.setWidth(150);
+ col.setText(COL_COMPONENT_ID);
+ col.setWidth(300);
col = new TableColumn(this.table, SWT.NONE);
- col.setText(COL_MANAGER);
+ col.setText(COL_NODE);
col.setWidth(100);
col = new TableColumn(this.table, SWT.NONE);
- col.setText(COL_ENDPOINT);
+ col.setText(COL_CONTAINER);
col.setWidth(120);
col = new TableColumn(this.table, SWT.NONE);
- col.setText(COL_TARGET);
- col.setWidth(150);
- col = new TableColumn(this.table, SWT.NONE);
col.setText(COL_STATUS);
- col.setWidth(200);
+ col.setWidth(400);
}
{
gl = new GridLayout();
- gl.numColumns = 3;
+ gl.numColumns = 4;
detailComposite.setLayout(gl);
Label compLabel = new Label(detailComposite, SWT.NONE);
- compLabel.setText(LABEL_COMPONENT);
+ compLabel.setText(LABEL_COMPONENT_NAME);
this.componentNameLabel = new Label(detailComposite, SWT.BORDER);
gd = new GridData();
@@ -222,29 +229,30 @@
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
this.componentNameLabel.setLayoutData(gd);
- this.componentNameLabel.setBackground(getColor(COLOR_WHITE));
-
- this.typeNameLabel = new Label(detailComposite, SWT.BORDER);
+ this.componentNameLabel.setBackground(getColor(COLOR_UNEDITABLE));
+ ///
+ Label compIdLabel = new Label(detailComposite, SWT.NONE);
+ compIdLabel.setText(LABEL_COMPONENT_ID);
+
+ this.componentIdLabel = new Label(detailComposite, SWT.BORDER);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
- this.typeNameLabel.setLayoutData(gd);
- this.typeNameLabel.setBackground(getColor(COLOR_WHITE));
+ this.componentIdLabel.setLayoutData(gd);
+ this.componentIdLabel.setBackground(getColor(COLOR_UNEDITABLE));
+ /////
+ Label nodeLabel = new Label(detailComposite, SWT.NONE);
+ nodeLabel.setText(LABEL_NODE);
- Label mgrLabel = new Label(detailComposite, SWT.NONE);
- mgrLabel.setText(LABEL_MANAGER);
-
- this.managerNameText = new Text(detailComposite, SWT.SINGLE
+ this.nodeText = new Text(detailComposite, SWT.SINGLE
| SWT.BORDER);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
- this.managerNameText.setLayoutData(gd);
- this.managerNameText.addFocusListener(new FocusListener() {
+ this.nodeText.setLayoutData(gd);
+ this.nodeText.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
- LOGGER.trace("Restore: managerName.focusLost: event=<{}>",
- e);
notifyModified();
}
@@ -252,24 +260,21 @@
public void focusGained(FocusEvent e) {
}
});
+ /////
+ Label mgrLabel = new Label(detailComposite, SWT.NONE);
+ mgrLabel.setText(LABEL_CONTAINER);
- this.endpointNameText = new Text(detailComposite, SWT.SINGLE
+ this.containerText = new Text(detailComposite, SWT.SINGLE
| SWT.BORDER);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
- this.endpointNameText.setLayoutData(gd);
- this.endpointNameText.addFocusListener(new FocusListener() {
+ this.containerText.setLayoutData(gd);
+ this.containerText.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
- LOGGER.trace("Restore: endpointName.focusLost: event=<{}>",
+ LOGGER.trace("Restore: managerName.focusLost: event=<{}>",
e);
- String epName = endpointNameText.getText();
- Endpoint ep = endpoints.get(epName);
- targetCombo.removeAll();
- for (String comp : ep.getComponentNames()) {
- targetCombo.add(comp);
- }
notifyModified();
}
@@ -277,41 +282,6 @@
public void focusGained(FocusEvent e) {
}
});
-
- Label tgtLabel = new Label(detailComposite, SWT.NONE);
- tgtLabel.setText(LABEL_TARGET);
-
- this.targetCombo = new Combo(detailComposite, SWT.DROP_DOWN);
- gd = new GridData();
- gd.horizontalSpan = 2;
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- this.targetCombo.setLayoutData(gd);
-
- this.targetCombo.select(0);
- this.targetCombo.addFocusListener(new FocusListener() {
- @Override
- public void focusLost(FocusEvent e) {
- LOGGER.trace("Restore: targetCombo.focusLost: event=<{}>",
- e);
- notifyModified();
- }
-
- @Override
- public void focusGained(FocusEvent e) {
- }
- });
-
- Label stLabel = new Label(detailComposite, SWT.NONE);
- stLabel.setText(LABEL_STATUS);
-
- this.statusLabel = new Label(detailComposite, SWT.BORDER);
- gd = new GridData();
- gd.horizontalSpan = 2;
- gd.horizontalAlignment = SWT.FILL;
- gd.grabExcessHorizontalSpace = true;
- this.statusLabel.setLayoutData(gd);
- this.statusLabel.setBackground(getColor(COLOR_WHITE));
}
buildData();
@@ -321,7 +291,89 @@
@Override
protected Control createButtonBar(Composite parent) {
- Control composite = super.createButtonBar(parent);
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout(2, false);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ composite.setLayout(gl);
+ composite.setLayoutData(gd);
+
+ Button btnApply = createButton(composite, APPLY_ID, "Restore", false);
+ btnApply.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ refreshData();
+ for(TargetInfo target : targetList) {
+ if(target.node==null || target.node.length()==0) {
+ target.status = MSG_STATUS_EP_UNREACHABLE;
+ target.isError = true;
+ continue;
+ }
+ Endpoint ep = null;
+ String[] nodes = target.node.split(",");
+ if(nodes.length==0) {
+ target.status = MSG_STATUS_EP_UNREACHABLE;
+ target.isError = true;
+ continue;
+ }
+ for(String node : nodes) {
+ ep = endpoints.get(node);
+ if(ep!=null) break;
+ }
+ if(ep==null) {
+ target.status = MSG_STATUS_EP_UNREACHABLE;
+ target.isError = true;
+ continue;
+ }
+ //
+ RTCManager manager = ep.getManager();
+ if(manager==null) {
+ target.status = String.format("No manager, it can not create component: comp=<%s>", target.compId);
+ target.isError = true;
+ continue;
+ }
+ try {
+ RTC.RTObject rtobj = null;
+ if (target.component.isCompositeComponent()) {
+ rtobj = CORBAHelper.factory().createCompositeRTObject(
+ manager, target.component, diagram);
+ } else {
+ rtobj = CORBAHelper.factory().createRTObject(
+ manager, target.component, diagram);
+ }
+ if (rtobj == null) {
+ target.status = String.format("Fail to create rtobject: comp=<%s>", target.compId);
+ target.isError = true;
+ continue;
+ }
+ target.component.setCorbaObject(rtobj);
+ } catch (Exception e1) {
+ }
+ target.status = String.format("Created: comp=<%s>", target.compId);
+ target.isError = false;
+ }
+ tableViewer.refresh();
+ }
+ });
+
+ Label lblDummy = new Label(composite, SWT.NONE);
+ gd = new GridData();
+ gd.grabExcessHorizontalSpace = true;
+ lblDummy.setLayoutData(gd);
+
+ Button btnClose = createButton(composite, OK, "OK", false);
+ btnClose.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ close();
+ }
+ });
+ Button btnCancel = createButton(composite, CANCEL, "Cancel", true);
+ btnCancel.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ close();
+ }
+ });
return composite;
}
@@ -336,23 +388,12 @@
return;
}
- String managerName = this.managerNameText.getText();
- String epName = this.endpointNameText.getText();
- String targetName = this.targetCombo.getText();
- Endpoint ep = this.endpoints.get(epName);
- RTC.RTObject rtc = ep.getComponent(targetName);
+ String managerName = this.containerText.getText();
+ String epName = this.nodeText.getText();
- this.selectedTarget.setManagerName(managerName);
- this.selectedTarget.setEndpointName(epName);
- this.selectedTarget.setTargetName(targetName);
- this.selectedTarget.setEndpoint(ep);
- this.selectedTarget.setTarget(rtc);
+ this.selectedTarget.containerName = managerName;
+ this.selectedTarget.node = epName;
- this.selectedTarget.verifyStatus();
- if (this.selectedTarget.getStatus() != null) {
- this.statusLabel.setText(this.selectedTarget.getStatus());
- }
-
this.tableViewer.refresh();
}
@@ -360,32 +401,22 @@
void refreshData() {
if (this.selectedTarget == null) {
this.componentNameLabel.setText("");
- this.typeNameLabel.setText("");
- this.managerNameText.setText("");
- this.endpointNameText.setText("");
- this.targetCombo.select(0);
- this.statusLabel.setText("");
+ this.componentIdLabel.setText("");
+ this.containerText.setText("");
+ this.nodeText.setText("");
} else {
- if (this.selectedTarget.getName() != null) {
- this.componentNameLabel.setText(this.selectedTarget.getName());
+ if (this.selectedTarget.compName != null) {
+ this.componentNameLabel.setText(this.selectedTarget.compName);
}
- if (this.selectedTarget.getType() != null) {
- this.typeNameLabel.setText(this.selectedTarget.getType());
+ if (this.selectedTarget.compId != null) {
+ this.componentIdLabel.setText(this.selectedTarget.compId);
}
- if (this.selectedTarget.getManagerName() != null) {
- this.managerNameText.setText(this.selectedTarget
- .getManagerName());
+ if (this.selectedTarget.containerName != null) {
+ this.containerText.setText(this.selectedTarget.containerName);
}
- if (this.selectedTarget.getEndpointName() != null) {
- this.endpointNameText.setText(this.selectedTarget
- .getEndpointName());
+ if (this.selectedTarget.node != null) {
+ this.nodeText.setText(this.selectedTarget.node);
}
- if (this.selectedTarget.getTargetName() != null) {
- this.targetCombo.setText(this.selectedTarget.getTargetName());
- }
- if (this.selectedTarget.getStatus() != null) {
- this.statusLabel.setText(this.selectedTarget.getStatus());
- }
}
}
@@ -396,69 +427,48 @@
*/
public static class TargetInfo {
- private String name;
- private String type;
- private String managerName;
- private String endpointName;
- private String targetName;
+ private String compName;
+ private String compId;
+ private String node;
+ private String containerName;
private String status;
+ private boolean isError;
- private Endpoint endpoint;
private CorbaComponent component;
public TargetInfo(CorbaComponent component) {
this.component = component;
- this.name = component.getInstanceNameL();
- this.type = component.getProperty(PROP_IMPLEMENTATION_ID);
- this.managerName = component.getProperty(PROP_MANAGER_NAME);
- this.endpointName = component.getProperty(PROP_CORBA_ENDPOINTS);
+ this.compName = component.getInstanceNameL();
+ String type = component.getProperty(PROP_IMPLEMENTATION_ID);
+ String lang = component.getProperty(PROP_LANGUAGE);
+ String vendor = component.getProperty(PROP_VENDOR);
+ String category = component.getProperty(PROP_CATEGORY);
+ String version = component.getProperty(PROP_VERSION);
+ this.compId = "RTC:" + vendor + ":" + category + ":" + type + ":" + lang + ":" + version;
+
+ String endPoints = component.getProperty(PROP_CORBA_ENDPOINTS);
+ String[] epList = endPoints.split(",");
+ StringBuilder builder = new StringBuilder();
+ for(String each : epList) {
+ if(0<builder.length()) {
+ builder.append(",");
+ }
+ builder.append(getHostName(each));
+ }
+ this.node = builder.toString();
+
+ this.containerName = component.getProperty(PROP_MANAGER_NAME);
//
- if (this.endpointName == null) {
+ if (this.node == null) {
// エンドポイントのプロパティ設定がない場合は、パスURIから取得(既存互換)
String path = component.getPathId();
if (path != null && !path.isEmpty()) {
path = path.substring(0, path.indexOf("/"));
- this.endpointName = path;
+ this.node = path;
}
}
}
- public String getName() {
- return this.name;
- }
-
- public String getType() {
- return this.type;
- }
-
- public String getManagerName() {
- return this.managerName;
- }
-
- public void setManagerName(String managerName) {
- this.managerName = managerName;
- }
-
- public String getEndpointName() {
- return this.endpointName;
- }
-
- public void setEndpointName(String endpointName) {
- this.endpointName = endpointName;
- }
-
- public void setEndpoint(Endpoint endpoint) {
- this.endpoint = endpoint;
- }
-
- public String getTargetName() {
- return this.targetName;
- }
-
- public void setTargetName(String targetName) {
- this.targetName = targetName;
- }
-
public void setTarget(RTC.RTObject rtc) {
if (this.component != null) {
this.component.setCorbaObject(rtc);
@@ -465,90 +475,21 @@
}
}
- public MappingResult getMappingResult() {
- if (this.component != null) {
- this.component.setProperty(PROP_CORBA_ENDPOINTS,
- this.endpointName);
- this.component.setProperty(PROP_MANAGER_NAME, this.managerName);
- }
- RTCManager manager = null;
- if (this.endpoint != null) {
- manager = this.endpoint.getManager();
- }
- MappingResult ret = new MappingResult(this.component, manager);
- return ret;
- }
-
- public String getStatus() {
- return this.status;
- }
-
- public void verifyStatus() {
- this.status = "";
- if (this.endpointName == null || this.endpointName.isEmpty()) {
- // エンドポイント名が未設定
- this.status = MSG_STATUS_NO_EP_NAME;
- return;
- }
- if (this.endpoint == null
- || EndpointCache.NULL_ENDPOINT.equals(this.endpoint)) {
- // エンドポイントへアクセス不可
- this.status = MSG_STATUS_EP_UNREACHABLE;
- return;
- }
- if (this.targetName == null || this.targetName.isEmpty()) {
- // コンポーネント生成が必要
- this.status = MSG_STATUS_NEED_CREATE;
- return;
- }
- }
-
@Override
public String toString() {
- return getClass().getSimpleName() + "<" + this.name + "|"
- + this.type + "|" + this.managerName + "|"
- + this.endpointName + "|" + this.targetName + "|"
- + this.status + ">";
+ return getClass().getSimpleName() + "<" + this.compName + "|"
+ + this.compId + "|" + this.containerName + "|"
+ + this.node + "|" + this.status + ">";
}
-
- }
-
- /**
- * コンポーネントのマッピング結果を表します。
- */
- public static class MappingResult {
-
- private CorbaComponent component;
- private RTCManager manager;
-
- public MappingResult(CorbaComponent component, RTCManager manager) {
- this.component = component;
- this.manager = manager;
+
+ private String getHostName(String source) {
+ String hostName = source;
+ if(hostName.contains(":")) {
+ String[] elems = source.split(":");
+ hostName = elems[0];
+ }
+ return hostName;
}
-
- public CorbaComponent getComponent() {
- return this.component;
- }
-
- public RTCManager getManager() {
- return this.manager;
- }
-
- public boolean isMapped() {
- return (this.component != null && this.component
- .getCorbaObjectInterface() != null);
- }
-
- public boolean hasManager() {
- return (this.manager != null);
- }
-
- @Override
- public String toString() {
- return getClass().getSimpleName() + "<" + this.component + "|"
- + this.manager + ">";
- }
-
}
/**
@@ -569,7 +510,9 @@
RTM.Manager remote = null;
if (endpoint != null) {
try {
- remote = CORBAHelper.ns().findManager(endpoint);
+ org.omg.CORBA.Object managerObj = CORBAHelper.ORBUtil.getOrb()
+ .string_to_object("corbaloc::" + endpoint + ":" + CORBAHelper.MANAGER_PORT + "/manager");
+ remote = ManagerHelper.narrow(managerObj);
} catch (RuntimeException e) {
remote = null;
}
@@ -584,7 +527,6 @@
this.cache.put(endpoint, ret);
return ret;
}
-
}
/**
@@ -593,8 +535,6 @@
public static class Endpoint {
private RTCManager remote;
- private List<String> managers = null;
- private List<String> components = null;
private Map<String, RTC.RTObject> objects = null;
Endpoint(RTCManager remote) {
@@ -606,26 +546,6 @@
}
/**
- * エンドポイントに属する起動中のコンポーネント名一覧を取得します。
- */
- public List<String> getComponentNames() {
- if (this.components != null) {
- return this.components;
- }
- this.components = new ArrayList<>();
- this.objects = new HashMap<>();
- if (this.remote == null) {
- return this.components;
- }
- for (RTC.RTObject rtc : this.remote.getComponentsR()) {
- RTC.ComponentProfile prof = rtc.get_component_profile();
- this.components.add(prof.instance_name);
- this.objects.put(prof.instance_name, rtc);
- }
- return this.components;
- }
-
- /**
* コンポーネント名に対する CORBAオブジェクトを取得します。
*/
public RTC.RTObject getComponent(String name) {
@@ -634,29 +554,10 @@
}
return null;
}
-
- /**
- * エンドポイントのマネージャに属するスレーブマネージャ名一覧を取得します。
- */
- public List<String> getManagerNames() {
- if (this.managers != null) {
- return this.managers;
- }
- this.managers = new ArrayList<>();
- if (this.remote == null) {
- return this.managers;
- }
- this.remote.getSlaveManagersR();
- for (String name : this.remote.getSlaveManagerNames()) {
- this.managers.add(name);
- }
- return this.managers;
- }
-
}
public class TargetLabelProvider extends LabelProvider implements
- ITableLabelProvider {
+ ITableLabelProvider, ITableColorProvider {
@Override
public Image getColumnImage(Object element, int columnIndex) {
@@ -667,21 +568,38 @@
public String getColumnText(Object element, int columnIndex) {
TargetInfo entry = (TargetInfo) element;
if (columnIndex == 0) {
- return entry.getName();
+ return entry.compName;
} else if (columnIndex == 1) {
- return entry.getType();
+ return entry.compId;
} else if (columnIndex == 2) {
- return entry.getManagerName();
+ return entry.node;
} else if (columnIndex == 3) {
- return entry.getEndpointName();
+ return entry.containerName;
} else if (columnIndex == 4) {
- return entry.getTargetName();
- } else if (columnIndex == 5) {
- return entry.getStatus();
+ return entry.status;
}
return "";
}
+ @Override
+ public Color getForeground(Object element, int columnIndex) {
+ return null;
+ }
+
+ @Override
+ public Color getBackground(Object element, int columnIndex) {
+ TargetInfo entry = (TargetInfo) element;
+
+ if (columnIndex == 4) {
+ if(entry.isError) {
+ return getColor(COLOR_MODIFY);
+ } else {
+ return getColor(COLOR_WHITE);
+ }
+ }
+
+ return null;
+ }
}
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/editor/SystemDiagramEditor.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -276,38 +276,11 @@
RestoreComponentDialog dialog = new RestoreComponentDialog(
getSite().getShell());
dialog.setCorbaComponents(corbaComponents);
+ dialog.setSystemDiagram(diagram);
if (dialog.open() != IDialogConstants.OK_ID) {
return;
}
- // マッピング結果を元にコンポーネント生成
- for (RestoreComponentDialog.MappingResult mapping : dialog
- .getMappingResultList()) {
- if (mapping.isMapped()) {
- continue;
- }
- if (!mapping.hasManager()) {
- throw new Exception(
- String.format(
- "No manager, it can not create component: comp=<%s>",
- mapping));
- }
- CorbaComponent comp = mapping.getComponent();
- RTC.RTObject rtobj = null;
- if (comp.isCompositeComponent()) {
- rtobj = CORBAHelper.factory().createCompositeRTObject(
- mapping.getManager(), comp, diagram);
- } else {
- rtobj = CORBAHelper.factory().createRTObject(
- mapping.getManager(), comp, diagram);
- }
- if (rtobj == null) {
- throw new Exception(String.format(
- "Fail to create rtobject: comp=<%s>", mapping));
- }
- comp.setCorbaObject(rtobj);
- }
-
// 同期サポート割当
SystemEditorWrapperFactory.getInstance()
.getSynchronizationManager()
@@ -350,6 +323,36 @@
}
}
+ public void updateWithMapping(IEditorSite site, SystemDiagram diagram, RtsProfileHandler handler) {
+ // 同期サポート割当
+ SystemEditorWrapperFactory.getInstance()
+ .getSynchronizationManager()
+ .assignSynchonizationSupportToDiagram(diagram);
+
+ // 読み込み時に明示的に状態の同期を実行
+ List<Component> eComps = new ArrayList<>(
+ diagram.getComponents());
+ diagram.getComponents().clear();
+ for (Component c : eComps) {
+ c.synchronizeManually();
+ diagram.addComponent(c);
+ }
+
+ handler.restoreCompositeComponentPort(diagram);
+
+ setSystemDiagram(diagram);
+
+ try {
+ RtsProfileHandler handlerProf = new RtsProfileHandler();
+ handlerProf.restoreConnection(getSystemDiagram());
+ handlerProf.restoreConfigSet(getSystemDiagram());
+ handlerProf.restoreExecutionContext(getSystemDiagram());
+ doReplace(getSystemDiagram(), site);
+ } catch (Exception e) {
+ LOGGER.error("Fail to replace diagram", e);
+ }
+ }
+
/**
* ロード時の復元を行います。
*/
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/UIUtil.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/UIUtil.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/util/UIUtil.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -25,7 +25,7 @@
colorRegistry.put(COLOR_ERROR, new RGB(255, 0, 0));
colorRegistry.put(COLOR_UNEXIST, new RGB(128, 128, 128));
colorRegistry.put(COLOR_MODIFY, new RGB(255, 192, 192));
- colorRegistry.put(COLOR_UNEDITABLE, new RGB(240, 240, 240));
+ colorRegistry.put(COLOR_UNEDITABLE, new RGB(230, 230, 230));
}
return colorRegistry.get(name);
}
Modified: trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java 2017-08-30 01:33:50 UTC (rev 763)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java 2017-08-30 01:34:44 UTC (rev 764)
@@ -7,6 +7,7 @@
import jp.go.aist.rtm.systemeditor.nl.Messages;
import jp.go.aist.rtm.systemeditor.ui.dialog.CreateComponentDialog;
import jp.go.aist.rtm.systemeditor.ui.dialog.ManagerConfigurationDialog;
+import jp.go.aist.rtm.toolscommon.model.component.Component;
import jp.go.aist.rtm.toolscommon.model.manager.RTCManager;
import jp.go.aist.rtm.toolscommon.util.AdapterUtil;
import jp.go.aist.rtm.toolscommon.util.SDOUtil;
@@ -13,6 +14,7 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -34,6 +36,7 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySheetPage;
@@ -277,7 +280,12 @@
if (dialog.open() == IDialogConstants.OK_ID) {
String cmd = dialog.getParameter();
LOGGER.info("create command: <{}>", cmd);
- targetManager.createComponentR(cmd);
+ Component result = targetManager.createComponentR(cmd);
+ if(result==null) {
+ MessageDialog.openError(PlatformUI.getWorkbench()
+ .getDisplay().getActiveShell(), "Error",
+ "FAILED to create of target RTC.");
+ }
}
}
});
@@ -515,7 +523,7 @@
/** コンポーネントプロファイル: マネージャ名を取得します */
public String getComponent_manager_name() {
- return SDOUtil.findValueAsString("manager_name",
+ return SDOUtil.findValueAsString("manager.instance_name",
this.component.properties);
}
@@ -529,8 +537,6 @@
public String getManager_language() {
return SDOUtil.findValueAsString("language",
this.manager.properties);
-// return SDOUtil.findValueAsString("supported_languages",
-// this.manager.properties);
}
@SuppressWarnings("rawtypes")
More information about the openrtm-commit
mailing list