[openrtm-commit:02643] r740 - trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 6月 19日 (月) 12:29:47 JST


Author: ga
Date: 2017-06-19 12:29:47 +0900 (Mon, 19 Jun 2017)
New Revision: 740

Modified:
   trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java
Log:
Modified Manager View #4122

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-06-18 03:22:50 UTC (rev 739)
+++ trunk/rtmtools/jp.go.aist.rtm.systemeditor/src/jp/go/aist/rtm/systemeditor/ui/views/managercontrolview/ManagerControlView.java	2017-06-19 03:29:47 UTC (rev 740)
@@ -99,6 +99,7 @@
 
 	private RTCManager targetManager;
 	private List<Profile> profileList;
+	private List<RTCManager> managerList; 
 
 	public ManagerControlView() {
 	}
@@ -263,8 +264,9 @@
 						.getLoadableModuleProfilesR());
 				//
 				List<String> managerList = new ArrayList<String>();
-				managerList.add(SDOUtil.findValueAsString("instance_name", targetManager.getManagerProfile().properties));
-				managerList.addAll(targetManager.getSlaveManagerNames());
+				for(Profile manager : profileList) {
+					managerList.add(manager.getManager_name());
+				}
 				dialog.setManagerNameList(managerList);
 				int selectedIndex = modulesTable.getSelectionIndex();
 				if (selectedIndex != -1 && isSelectedManagers) {
@@ -288,17 +290,18 @@
 		this.configureButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				if (targetManager == null) {
+				RTCManager target = targetManager;
+				int selectedIndex = modulesTable.getSelectionIndex();
+				if(selectedIndex < 0 || selectedIndex < managerList.size()) {
+					target = managerList.get(selectedIndex);
+				}
+				if (target == null) {
 					return;
 				}
 				ManagerConfigurationDialog dialog = new ManagerConfigurationDialog(
 						getSite().getShell());
-				dialog.setManager(targetManager);
-				if (dialog.open() == IDialogConstants.OK_ID) {
-//					String cmd = dialog.getParameter();
-//					LOGGER.info("create command: <{}>", cmd);
-//					targetManager.createComponentR(cmd);
-				}
+				dialog.setManager(target);
+				dialog.open();
 			}
 		});
 
@@ -311,10 +314,15 @@
 		this.restartButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				if (targetManager != null) {
-					targetManager.restartR();
-					targetManager = null;
+				RTCManager target = targetManager;
+				int selectedIndex = modulesTable.getSelectionIndex();
+				if(selectedIndex < 0 || selectedIndex < managerList.size()) {
+					target = managerList.get(selectedIndex);
 				}
+				if (target == null) {
+					return;
+				}
+				target.restartR();
 				buildData();
 			}
 		});
@@ -328,10 +336,16 @@
 		this.shutdownButton.addSelectionListener(new SelectionAdapter() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				if (targetManager != null) {
-					targetManager.shutdownR();
-					targetManager = null;
+				RTCManager target = targetManager;
+				int selectedIndex = modulesTable.getSelectionIndex();
+				if(selectedIndex < 0 || selectedIndex < managerList.size()) {
+					target = managerList.get(selectedIndex);
 				}
+				if (target == null) {
+					return;
+				}
+				
+				target.shutdownR();
 				buildData();
 			}
 		});
@@ -386,6 +400,7 @@
 					this.profileList.add(new Profile(module));
 				}
 				this.modulesTableViewer.setInput(this.profileList);
+
 			} else if (this.isSelectedRtcInstances) {
 				for (RTC.ComponentProfile component : this.targetManager
 						.getComponentProfilesR()) {
@@ -392,11 +407,19 @@
 					this.profileList.add(new Profile(component));
 				}
 				this.modulesTableViewer.setInput(this.profileList);
+
 			} else if (this.isSelectedManagers) {
+				if(managerList == null) {
+					managerList = new ArrayList<RTCManager>();
+				}
+				managerList.clear();
+				
 				this.profileList.add(new Profile(this.targetManager.getProfileR()));
+				managerList.add(targetManager);
 				for (RTCManager manager : this.targetManager
 						.getSlaveManagersR()) {
 					this.profileList.add(new Profile(manager.getProfileR()));
+					managerList.add(manager);
 				}
 				this.modulesTableViewer.setInput(this.profileList);
 			}



More information about the openrtm-commit mailing list