[openrtm-commit:01628] r731 - in branches/RELENG_1_1: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util
openrtm @ openrtm.org
openrtm @ openrtm.org
2015年 10月 28日 (水) 10:21:46 JST
Author: kawauchi
Date: 2015-10-28 10:21:46 +0900 (Wed, 28 Oct 2015)
New Revision: 731
Modified:
branches/RELENG_1_1/
branches/RELENG_1_1/buildRTC.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/StringUtil.java
Log:
[compat,merge] r639,640-644,647,649,652,658 merged from trunk.
Property changes on: branches/RELENG_1_1
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0_0:60-401
/branches/work/ConfigurationCallback:631-635
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
/trunk:622,630-637
+ /branches/RELENG_1_0_0:60-401
/branches/work/ConfigurationCallback:631-635
/branches/work/ForComponentActionListener:521-522
/branches/work/ForComponentObserverConsumer:534-543
/branches/work/ForConfigurationListener:524-526
/branches/work/ForLogFormat:518-519
/branches/work/ForPortConnectListener:528-532
/branches/work/ForSDOServiceAdminClass:505-507
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
/trunk:622,630-637,639-658
Modified: branches/RELENG_1_1/buildRTC.bat
===================================================================
--- branches/RELENG_1_1/buildRTC.bat 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/buildRTC.bat 2015-10-28 01:21:46 UTC (rev 731)
@@ -1,13 +1,19 @@
set DUMMY=%ANT_HOME%
@rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.6.5\
-set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.7.0.v200706080842\
+ at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.7.0.v200706080842\
+set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.7.0.v200803061910\
cd jp.go.aist.rtm.RTC
call ant buildAll -lib %ECLIPSE_HOME%\plugins\net.sf.ant4eclipse.plugin_0.5.0.rc1\lib\
+if ERRORLEVEL 1 goto error_end
cd ..
+set ANT_HOME=%DUMMY%
+exit /b 0
-
+:error_end
+cd ..
set ANT_HOME=%DUMMY%
+exit /b 1
Property changes on: branches/RELENG_1_1/jp.go.aist.rtm.RTC
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/work/ConfigurationCallback/jp.go.aist.rtm.RTC:631-635
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-603
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
/trunk/jp.go.aist.rtm.RTC:622,630-637
+ /branches/RELENG_1_0/jp.go.aist.rtm.RTC:408-498
/branches/RELENG_1_0_0/jp.go.aist.rtm.RTC:60-401
/branches/work/ConfigurationCallback/jp.go.aist.rtm.RTC:631-635
/branches/work/ForComponentActionListener/jp.go.aist.rtm.RTC:521-522
/branches/work/ForComponentObserverConsumer/jp.go.aist.rtm.RTC:534-543
/branches/work/ForConfigurationListener/jp.go.aist.rtm.RTC:524-526
/branches/work/ForLogFormat/jp.go.aist.rtm.RTC:518-519
/branches/work/ForPortConnectListener/jp.go.aist.rtm.RTC:528-532
/branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC:505-507
/branches/work/SourceSharing/jp.go.aist.rtm.RTC:591-603
/branches/work/ToGetProperties/jp.go.aist.rtm.RTC:545-548
/branches/work/ToIFR_ID/jp.go.aist.rtm.RTC:509-514
/trunk/jp.go.aist.rtm.RTC:622,630-637,639-658
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml 2015-10-28 01:21:46 UTC (rev 731)
@@ -336,7 +336,8 @@
noindex="false" nonavbar="false" notree="false"
package="yes" source="1.5" splitindex="true"
- use="true" version="true" charset="UTF-8"
+ use="true" version="true" charset="UTF-8"
+ classpath="lib/commons-cli-1.1.jar"
>
<taglet name="JaOnTaglet" path="./util"/>
@@ -360,6 +361,7 @@
package="yes" source="1.5" splitindex="true"
use="true" version="true" charset="UTF-8"
+ classpath="lib/commons-cli-1.1.jar"
>
<taglet name="EnOnTaglet" path="./util"/>
<taglet name="JaOffTaglet" path="./util"/>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/RTMExamples/SimpleIO/rtc.conf 2015-10-28 01:21:46 UTC (rev 731)
@@ -2,6 +2,9 @@
naming.formats: %n.rtc
logger.enable:NO
+#manager.modules.load_path: ./Extension/LocalService/nameservice_file/
+#manager.local_service.modules: FileNameservice
+
#manager.modules.load_path:./RTMExamples/SimpleIO
#manager.modules.preload: ConsoleOut
#manager.components.precreate: ConsoleOut
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2015-10-28 01:21:46 UTC (rev 731)
@@ -6,6 +6,8 @@
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+
+import java.util.ArrayList;
import java.util.Vector;
import java.util.logging.FileHandler;
import java.util.logging.ConsoleHandler;
@@ -1060,7 +1062,11 @@
rtcout.println(Logbuf.TRACE,
"RTC initialization failed: "
+ comp_id.getProperty("implementaion_id"));
- comp.exit();
+ if (comp.exit() != ReturnCode_t.RTC_OK) {
+ rtcout.println(Logbuf.DEBUG,
+ comp_id.getProperty("implementation_id")
+ + " finalization was failed.");
+ }
return null;
}
rtcout.println(Logbuf.TRACE,
@@ -2579,6 +2585,7 @@
String type_conf = category + "." + type_name + ".config_file";
String name_conf = category + "." + inst_name + ".config_file";
+ ArrayList<String> config_fname = new ArrayList<String>();
Properties type_prop = new Properties();
Properties name_prop = new Properties();
@@ -2590,7 +2597,14 @@
BufferedReader conff = new BufferedReader(
new FileReader(m_config.getProperty(name_conf)));
name_prop.load(conff);
-
+ rtcout.println(Logbuf.INFO,
+ "Component instance conf file: "
+ + m_config.getProperty(name_conf)
+ + " loaded.");
+ String str = new String();
+ str = name_prop._dump(str,name_prop,0);
+ rtcout.println(Logbuf.DEBUG, str);
+ config_fname.add(m_config.getProperty(name_conf));
} catch (FileNotFoundException e) {
rtcout.println(Logbuf.DEBUG,
"Exception: Caught FileNotFoundException"
@@ -2606,7 +2620,20 @@
}
if (m_config.findNode(category + "." + inst_name) != null) {
- name_prop.merge(m_config.getNode(category + "." + inst_name));
+ Properties temp = m_config.getNode(category + "." + inst_name);
+ Vector<String> keys = temp.propertyNames();
+ int length = keys.size();
+ if (!( length == 1 && keys.get(length-1).equals("config_file"))) {
+ name_prop.merge(m_config.getNode(category + "." + inst_name));
+ rtcout.println(Logbuf.INFO,
+ "Component type conf exists in rtc.conf. Merged.");
+ String str = new String();
+ str = name_prop._dump(str,name_prop,0);
+ rtcout.println(Logbuf.DEBUG,str);
+ if (m_config.findNode("config_file") != null) {
+ config_fname.add(m_config.getProperty("config_file"));
+ }
+ }
}
if (!(m_config.getProperty(type_conf) == null
@@ -2616,6 +2643,14 @@
BufferedReader conff = new BufferedReader(
new FileReader(m_config.getProperty(type_conf)));
type_prop.load(conff);
+ rtcout.println(Logbuf.INFO,
+ "Component type conf file: "
+ + m_config.getProperty(type_conf)
+ + " loaded.");
+ String str = new String();
+ str = type_prop._dump(str,type_prop,0);
+ rtcout.println(Logbuf.DEBUG,str);
+ config_fname.add(m_config.getProperty(type_conf));
} catch (FileNotFoundException e) {
rtcout.println(Logbuf.DEBUG,
@@ -2633,13 +2668,28 @@
}
}
if (m_config.findNode(category + "." + type_name) != null) {
- type_prop.merge(m_config.getNode(category + "." + type_name));
+ Properties temp = m_config.getNode(category + "." + type_name);
+ Vector<String> keys = temp.propertyNames();
+ int length = keys.size();
+ if (!(length == 1 && keys.get(length).equals("config_file"))) {
+ type_prop.merge(m_config.getNode(category + "." + type_name));
+ rtcout.println(Logbuf.INFO,
+ "Component type conf exists in rtc.conf. Merged.");
+ String str = new String();
+ str = type_prop._dump(str,type_prop,0);
+ rtcout.println(Logbuf.DEBUG,str);
+ if (m_config.findNode("config_file") != null) {
+ config_fname.add(m_config.getProperty("config_file"));
+ }
+ }
}
// Merge Properties. type_prop is merged properties
comp.setProperties(prop);
type_prop.merge(name_prop);
+ String fname = StringUtil.flatten(StringUtil.unique_sv(config_fname));
+ type_prop.setProperty("config_file",fname);
comp.setProperties(type_prop);
// ------------------------------------------------------------
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerConfig.java 2015-10-28 01:21:46 UTC (rev 731)
@@ -182,6 +182,7 @@
// Properties from arguments are marged finally
properties.merge(m_argprop);
+ properties.setProperty("config_file", m_configFile);
}
/**
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ManagerServant.java 2015-10-28 01:21:46 UTC (rev 731)
@@ -690,7 +690,20 @@
public RTC.ReturnCode_t delete_component(final String instance_name) {
rtcout.println(Logbuf.TRACE, "delete_component("+instance_name+")");
- m_mgr.deleteComponent(instance_name);
+ RTObject_impl comp = m_mgr.getComponent(instance_name);
+ if (comp == null) {
+ rtcout.println(Logbuf.WARN,"No such component exists: "
+ + instance_name);
+ return ReturnCode_t.BAD_PARAMETER;
+ }
+ try {
+ comp.exit();
+ }
+ catch (org.omg.CORBA.SystemException ex) { // never come here
+ rtcout.println(Logbuf.ERROR,
+ "Unknown exception was raised, when RTC was finalized.");
+ return ReturnCode_t.RTC_ERROR;
+ }
return ReturnCode_t.RTC_OK;
}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2015-10-28 01:21:46 UTC (rev 731)
@@ -271,9 +271,9 @@
put(value);
- advanceWptr(1);
- if (empty_) {
- synchronized (m_empty.mutex) {
+ synchronized (m_empty.mutex) {
+ advanceWptr(1);
+ if (empty_) {
try {
m_empty.mutex.notify();
}
@@ -443,24 +443,24 @@
return ReturnCode.PRECONDITION_NOT_MET;
}
}
+ }
- boolean full_ = full();
+ boolean full_ = full();
- get(valueRef);
- advanceRptr();
+ get(valueRef);
+ synchronized(m_full.mutex){
+ advanceRptr(1);
if (full_) {
- synchronized(m_full.mutex){
- try {
- m_full.mutex.notify();
- }
- catch(IllegalMonitorStateException e) {
- }
+ try {
+ m_full.mutex.notify();
}
+ catch(IllegalMonitorStateException e) {
+ }
}
+ }
return ReturnCode.BUFFER_OK;
- }
}
/**
@@ -707,19 +707,19 @@
*
*/
public ReturnCode advanceWptr(int n) {
- // n > 0 :
- // n satisfies n <= writable elements
- // n <= m_length - m_fillcout
- // n < 0 : -n = n'
- // n satisfies n'<= readable elements
- // n'<= m_fillcount
- // n >= - m_fillcount
- if (n > 0 && n > (m_length - m_fillcount) ||
- n < 0 && n < (-m_fillcount)) {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
+ synchronized (m_posmutex) {
+ // n > 0 :
+ // n satisfies n <= writable elements
+ // n <= m_length - m_fillcout
+ // n < 0 : -n = n'
+ // n satisfies n'<= readable elements
+ // n'<= m_fillcount
+ // n >= - m_fillcount
+ if (n > 0 && n > (m_length - m_fillcount) ||
+ n < 0 && n < (-m_fillcount)) {
+ return ReturnCode.PRECONDITION_NOT_MET;
+ }
- synchronized (m_posmutex) {
m_wpos = (m_wpos + n + m_length) % m_length;
m_fillcount += n;
m_wcount += n;
@@ -844,19 +844,18 @@
*
*/
public ReturnCode advanceRptr(int n) {
- // n > 0 :
- // n satisfies n <= readable elements
- // n <= m_fillcout
- // n < 0 : -n = n'
- // n satisfies n'<= m_length - m_fillcount
- // n >= m_fillcount - m_length
- if ((n > 0 && n > m_fillcount) ||
- (n < 0 && n < (m_fillcount - m_length)))
- {
- return ReturnCode.PRECONDITION_NOT_MET;
- }
+ synchronized(m_posmutex) {
+ // n > 0 :
+ // n satisfies n <= readable elements
+ // n <= m_fillcout
+ // n < 0 : -n = n'
+ // n satisfies n'<= m_length - m_fillcount
+ // n >= m_fillcount - m_length
+ if ((n > 0 && n > m_fillcount) ||
+ (n < 0 && n < (m_fillcount - m_length))) {
+ return ReturnCode.PRECONDITION_NOT_MET;
+ }
- synchronized(m_posmutex) {
m_rpos = (m_rpos + n + m_length) % m_length;
m_fillcount -= n;
return ReturnCode.BUFFER_OK;
@@ -997,22 +996,70 @@
+ /**
+ * {@.ja 上書きフラグ}
+ * {@.en Overwrite flag}
+ */
private boolean m_overwrite;
+ /**
+ * {@.ja 読み戻しフラグ}
+ * {@.en Readback flag}
+ */
private boolean m_readback;
+ /**
+ * {@.ja タイムアウト付き書き込みフラグ}
+ * {@.en Timedwrite flag}
+ */
private boolean m_timedwrite;
+ /**
+ * {@.ja タイムアウト付き読み出しフラグ}
+ * {@.en Timedread flag}
+ */
private boolean m_timedread;
+ /**
+ * {@.ja 書き込み時タイムアウト}
+ * {@.en Timeout time for writing}
+ */
private TimeValue m_wtimeout;
+ /**
+ * {@.ja 読み出し時タイムアウト}
+ * {@.en Timeout time of reading}
+ */
private TimeValue m_rtimeout;
+ /**
+ * {@.ja バッファ長}
+ * {@.en Buffer length}
+ */
private int m_length;
private int m_oldPtr;
private int m_newPtr;
+ /**
+ * {@.ja バッファ配列}
+ * {@.en baffer array}
+ */
private Vector<DataType> m_buffer;
+ /**
+ * {@.ja 書き込みポインタ}
+ * {@.en pointer to write}
+ */
private int m_wpos;
+ /**
+ * {@.ja 読み出しポインタ}
+ * {@.en poitner to read}
+ */
private int m_rpos;
+ /**
+ * {@.ja Fillカウント}
+ * {@.en Fill count}
+ */
private int m_fillcount;
+ /**
+ * {@.ja 位置変数ミューテックス}
+ * {@.en mutex for position variable}
+ */
private static String m_posmutex = new String();
/**
@@ -1032,7 +1079,15 @@
*/
public String mutex = new String();
};
+ /**
+ * {@.ja 空条件変数}
+ * {@.en empty condition variable}
+ */
private condition m_empty = new condition();
+ /**
+ * {@.ja 満杯条件変数}
+ * {@.en full condition variable}
+ */
private condition m_full = new condition();
/**
* {@.ja 書き込みカウント}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/StringUtil.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/StringUtil.java 2015-10-28 01:05:37 UTC (rev 730)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/StringUtil.java 2015-10-28 01:21:46 UTC (rev 731)
@@ -230,6 +230,29 @@
}
return str;
}
+ /**
+ * {@.ja 与えられた文字列リストから重複を削除する}
+ * {@.en Deletes repetition from the given character string list.}
+ * <p>
+ * {@.ja 引数で与えられた文字列リストから重複を削除したリストを作成する。}
+ *
+ * @param sv
+ * {@.ja 確認元文字列リスト}
+ * {@.en Character string list}
+ * @return
+ * {@.ja 重複削除処理結果リスト}
+ * {@.en List of character string of result}
+ */
+ public static ArrayList<String> unique_sv(ArrayList<String> sv) {
+ ArrayList<String> str = new ArrayList<String>();
+ for( int intIdx=0; intIdx < sv.size(); ++intIdx ) {
+ if( !sv.get(intIdx).trim().equals("")
+ && !str.contains(sv.get(intIdx).trim()) ) {
+ str.add(sv.get(intIdx).trim());
+ }
+ }
+ return str;
+ }
/**
* {@.ja 与えられた文字列リストからCSVを生成する}
@@ -285,7 +308,34 @@
return str.toString();
}
+ /**
+ * {@.ja 与えられた文字列リストからCSVを生成する}
+ * {@.en generates CSV from the given character string list.}
+ * <p>
+ * {@.ja 引数で与えられた文字列リストの各要素を並べたCSVを生成する。
+ * 文字列リストが空の場合には空白文字を返す。}
+ *
+ * @param sv
+ * {@.ja CSV変換対象文字列リスト}
+ * {@.en Character string list to be converted}
+ * @return
+ * {@.ja CSV変換結果文字列}
+ * {@.en Character string of conversion result}
+ */
+ public static String flatten(ArrayList sv) {
+ if( sv.size() == 0) return "";
+ StringBuffer str = new StringBuffer();
+
+ int intIdx;
+ for(intIdx=0; intIdx < sv.size()-1; ++intIdx) {
+ str.append(sv.get(intIdx) + ", ");
+ }
+ str.append(sv.get(intIdx));
+
+ return str.toString();
+ }
+
/**
* {@.ja 文字列を分割文字で分割する}
* {@.en divides the character string by the division character.}
More information about the openrtm-commit
mailing list