[openrtm-commit:03164] r1108 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 2月 7日 (水) 17:03:19 JST
Author: t-katami
Date: 2018-02-07 17:03:19 +0900 (Wed, 07 Feb 2018)
New Revision: 1108
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java
Log:
[compat,->RELENG_1_2] Added a search directory of the configuration file for Windows. refs #4444
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2018-02-07 05:50:14 UTC (rev 1107)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2018-02-07 08:03:19 UTC (rev 1108)
@@ -6,6 +6,7 @@
import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
+import java.util.ArrayList;
import java.util.Random;
import jp.go.aist.rtm.Constants;
@@ -372,14 +373,31 @@
}
}
- // Search rtc configuration file from default search path
- for (int i = 0; Constants.CONFIG_FILE_PATH[i] != null; i++) {
- if (fileExist(Constants.CONFIG_FILE_PATH[i])) {
- m_configFile = Constants.CONFIG_FILE_PATH[i];
- return true;
+ String osname = System.getProperty("os.name").toLowerCase();
+ if(osname.startsWith("windows")){
+ ArrayList<String> paths = new ArrayList<String>();
+ paths.add("./rtc.conf");
+ String def_path = System.getenv("RTM_ROOT")
+ + "bin\\"
+ + System.getenv("RTM_VC_VERSION")
+ + "\\rtc.conf";
+ paths.add(def_path);
+ for(String path:paths){
+ if (fileExist(path)) {
+ this.m_configFile = path;
+ return true;
+ }
}
}
-
+ else{
+ // Search rtc configuration file from default search path
+ for (int i = 0; Constants.CONFIG_FILE_PATH[i] != null; i++) {
+ if (fileExist(Constants.CONFIG_FILE_PATH[i])) {
+ m_configFile = Constants.CONFIG_FILE_PATH[i];
+ return true;
+ }
+ }
+ }
return false;
}
More information about the openrtm-commit
mailing list