[openrtm-commit:01637] r738 - in branches/RELENG_1_1: . jp.go.aist.rtm.RTC jp.go.aist.rtm.RTC/Source/examples jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample jp.go.aist.rtm.RTC/idl jp.go.aist.rtm.RTC/installer/resources/Source/examples jp.go.aist.rtm.RTC/installer/win32 jp.go.aist.rtm.RTC/installer/win32/OpenRTP 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/executionContext jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util
openrtm @ openrtm.org
openrtm @ openrtm.org
2015年 10月 29日 (木) 15:09:55 JST
Author: kawauchi
Date: 2015-10-29 15:09:55 +0900 (Thu, 29 Oct 2015)
New Revision: 738
Added:
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java
Removed:
branches/RELENG_1_1/buildInstaller.bat
branches/RELENG_1_1/buildPackage.sh
branches/RELENG_1_1/jp.go.aist.rtm.RTC/idl/Logger.idl
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextFactory.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextProfile.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/IExecutionContextBase.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/util/clock/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTest110.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogBufTimeTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java
Modified:
branches/RELENG_1_1/
branches/RELENG_1_1/buildRTC.bat
branches/RELENG_1_1/buildRTC.sh
branches/RELENG_1_1/buildTests.sh
branches/RELENG_1_1/jp.go.aist.rtm.RTC/
branches/RELENG_1_1/jp.go.aist.rtm.RTC/.project
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat
branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs
branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs.in
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/openrtpwxs.py
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_hu-hu.wxl
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ja-jp.wxl
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ko-kr.wxl
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_zh-tw.wxl
branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/build.cmd
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
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/ModuleManager.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/StateMachine.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.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/executionContext/ExecutionContextBase.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/OpenHRPExecutionContext.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java
branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java
Log:
[compat] reverted.
Property changes on: branches/RELENG_1_1
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/RELENG_1_0_0:60-401
/branches/work/ConfigurationCallback:631-635
/branches/work/DesignChangeOfEC:648-660
/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/LoggerService:666-669
/branches/work/SourceSharing:591-603
/branches/work/ToGetProperties:545-548
/branches/work/ToIFR_ID:509-514
/trunk:622,630-637,639-658,661,663-665,670-678,680-685,687-692,695-696,698,700,702-703,705,707-727
+ /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
Deleted: branches/RELENG_1_1/buildInstaller.bat
===================================================================
--- branches/RELENG_1_1/buildInstaller.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/buildInstaller.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,10 +0,0 @@
-cd jp.go.aist.rtm.RTC
-call ant buildInstaller -lib %ANT_HOME%\lib\
-if ERRORLEVEL 1 goto error_end
-cd ..
-exit /b 0
-
-:error_end
-cd ..
-exit /b 1
-
Deleted: branches/RELENG_1_1/buildPackage.sh
===================================================================
--- branches/RELENG_1_1/buildPackage.sh 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/buildPackage.sh 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-#
-
-#------------------------------------------------------------
-# find_anthome
-#
-# This function estimate ANT_HOME from ant, which usually
-# is a symbolic link to $ANT_HOME/bin/ant.
-#------------------------------------------------------------
-find_anthome()
-{
- if test ! "x$ANT_HOME" = "x" ; then
- if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
- return 0
- fi
- echo "ant cannot be found under ANT_HOME: $ANT_HOME"
- fi
- echo "Valid Environment variable ANT_HOME is not set. Searching..."
- tmp=`readlink -e $(which ant)`
- ant_path=`dirname $tmp | sed 's/\/bin$//'`
- if test "x$ant_path" = "x" ; then
- echo "Ant not found. Please install Ant and set ANT_HOME."
- exit 1
- fi
- export ANT_HOME=$ant_path
- return 0
-}
-
-find_anthome
-
-echo "------------------------------------------------------------"
-echo "Environment variables:"
-echo "ANT_HOME: $ANT_HOME"
-echo "------------------------------------------------------------"
-
-
-if test $# -eq 0 ; then
- var_for="dist"
-else
- var_for=$1
-fi
-
-#
-#
-#
-cd jp.go.aist.rtm.RTC
-ant $var_for -lib $ANT_HOME/lib/
-if [ $? -ne 0 ];
-then
- exit 1
-fi
-echo "--"
-cd ..
Modified: branches/RELENG_1_1/buildRTC.bat
===================================================================
--- branches/RELENG_1_1/buildRTC.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/buildRTC.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,10 +1,19 @@
+set DUMMY=%ANT_HOME%
+ at rem set ANT_HOME=%ECLIPSE_HOME%\plugins\org.apache.ant_1.6.5\
+ 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 %ANT_HOME%\lib\
+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
+
Modified: branches/RELENG_1_1/buildRTC.sh
===================================================================
--- branches/RELENG_1_1/buildRTC.sh 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/buildRTC.sh 2015-10-29 06:09:55 UTC (rev 738)
@@ -2,39 +2,11 @@
#
#
-#------------------------------------------------------------
-# find_anthome
-#
-# This function estimate ANT_HOME from ant, which usually
-# is a symbolic link to $ANT_HOME/bin/ant.
-#------------------------------------------------------------
-find_anthome()
-{
- if test ! "x$ANT_HOME" = "x" ; then
- if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
- return 0
- fi
- echo "ant cannot be found under ANT_HOME: $ANT_HOME"
- fi
- echo "Valid Environment variable ANT_HOME is not set. Searching..."
- tmp=`readlink -e $(which ant)`
- ant_path=`dirname $tmp | sed 's/\/bin$//'`
- if test "x$ant_path" = "x" ; then
- echo "Ant not found. Please install Ant and set ANT_HOME."
- exit 1
- fi
- export ANT_HOME=$ant_path
- return 0
-}
+DUMMY=$ANT_HOME
+export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
-find_anthome
+
-echo "------------------------------------------------------------"
-echo "Environment variables:"
-echo "ANT_HOME: $ANT_HOME"
-echo "------------------------------------------------------------"
-
-
if test $# -eq 0 ; then
var_for="buildAllLinux"
else
@@ -45,10 +17,15 @@
#
#
cd jp.go.aist.rtm.RTC
-ant $var_for -lib $ANT_HOME/lib
+#ant buildAllLinux -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/
+ant $var_for -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/ -lib $ECLIPSE_HOME/plugins/org.apache.ant_1.7.0.v200803061910/lib
if [ $? -ne 0 ];
then
exit 1
fi
echo "--"
cd ..
+
+export ANT_HOME=$DUMMY
+
+
Modified: branches/RELENG_1_1/buildTests.sh
===================================================================
--- branches/RELENG_1_1/buildTests.sh 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/buildTests.sh 2015-10-29 06:09:55 UTC (rev 738)
@@ -3,49 +3,22 @@
#
-#------------------------------------------------------------
-# find_anthome
-#
-# This function estimate ANT_HOME from ant, which usually
-# is a symbolic link to $ANT_HOME/bin/ant.
-#------------------------------------------------------------
-find_anthome()
-{
- if test ! "x$ANT_HOME" = "x" ; then
- if test -d $ANT_HOME && test -f $ANT_HOME/bin/ant ; then
- return 0
- fi
- echo "ant cannot be found under ANT_HOME: $ANT_HOME"
- fi
- echo "Valid Environment variable ANT_HOME is not set. Searching..."
- tmp=`readlink -e $(which ant)`
- ant_path=`dirname $tmp | sed 's/\/bin$//'`
- if test "x$ant_path" = "x" ; then
- echo "Ant not found. Please install Ant and set ANT_HOME."
- exit 1
- fi
- export ANT_HOME=$ant_path
- return 0
-}
+set DUMMY=$ANT_HOME
+export ANT_HOME=$ECLIPSE_HOME/plugins/org.apache.ant_1.6.5/
-find_anthome
-
-export JUNIT_HOME=$ANT_HOME/lib
-echo "------------------------------------------------------------"
-echo "Environment variables:"
-echo "ANT_HOME: $ANT_HOME"
-echo "------------------------------------------------------------"
-
-
#
#
#
cd jp.go.aist.rtm.RTC
-ant compile_tests -lib $ANT_HOME/lib/
-ant junit -lib $ANT_HOME/lib/
+ant buildTests -lib $ECLIPSE_HOME/plugins/net.sf.ant4eclipse.plugin_0.5.0.rc1/lib/ -lib $JUNIT_HOME/junit.jar
if [ $? -ne 0 ];
then
exit 1
fi
echo "--"
cd ..
+
+set ANT_HOME=$DUMMY
+
+
+
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/DesignChangeOfEC/jp.go.aist.rtm.RTC:648-660
/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/LoggerService/jp.go.aist.rtm.RTC:666-669
/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,661,663-665,670-678,680-685,687-692,695-696,698,700,702-703,705,707-727
+ /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/.project
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/.project 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/.project 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>OpenRTM-1.1.0-Java</name>
+ <name>OpenRTM-1.0.0-Java</name>
<comment></comment>
<projects>
</projects>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConfigSample.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ConfigSample.ConfigSampleComp -f RTMExamples/ConfigSample/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/Connector.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConnectorComp
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleIn.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConsoleInComp -f RTMExamples/SimpleIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ConsoleOut.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleIO.ConsoleOutComp -f RTMExamples/SimpleIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConnector.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConnectorComp
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleIn.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConsoleInComp -f RTMExamples/ExtTrigger/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/ExtConsoleOut.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.ExtTrigger.ConsoleOutComp -f RTMExamples/ExtTrigger/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/GUIIn.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.GUIIn.GUIInComp -f RTMExamples/GUIIn/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceConsumer.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleService.MyServiceConsumerComp -f RTMExamples/SimpleService/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/MyServiceProvider.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SimpleService.MyServiceProviderComp -f RTMExamples/SimpleService/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/RTMExamples/ConfigSample/rtc.conf 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,4 +1,4 @@
corba.nameservers: localhost:2809
naming.formats: %n.rtc
logger.log_level: PARANOID
-#example.ConfigSample.config_file: configsample.conf
+example.ConfigSample.config_file: C:\\Tech-Arts\\Robot\\2007JavaÅRTM\\[i¨\\0_4_1Î\\RTM_Sample\\RTMExamples\\ConfigSample\\configsample.conf
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqIn.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SeqIO.SeqInComp -f RTMExamples/SeqIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SeqOut.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SeqIO.SeqOutComp -f RTMExamples/SeqIO/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/SinCosOut.bat 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,3 +1,3 @@
-set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.1.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
+set CLASSPATH=.;%RTM_JAVA_ROOT%\jar\OpenRTM-aist-1.0.0.jar;%RTM_JAVA_ROOT%\jar\commons-cli-1.1.jar
java RTMExamples.SinCosOut.SinCosOutComp -f RTMExamples/SinCosOut/rtc.conf
pause;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,64 +1,20 @@
-'orbdèµ·åç¨ã¹ã¯ãªãã
-'æ¬ã¹ã¯ãªããã¯ç°å¢å¤æ°TEMPãè¨å®ããã¦ãããã¨ãåæã¨ãã¾ã
-'ãªããç°å¢å¤æ°TEMPã¯éä¾OSã«ããããã©ã«ãã§è¨å®ããã¦ãã¾ã
-
-
-'èµ·åç¨ãªãã¸ã§ã¯ãã®åå¾
+'N®pIuWFNgÌæ¾
Set objShell = WScript.CreateObject("WScript.Shell")
-
-strMode = objShell.Environment("Process").Item("PROCESSOR_ARCHITECTURE")
-
-'JDKã®ã¬ã¸ã¹ããªãã¼ãã»ãã
+'JDKÌWXgL[ðZbg
regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
-If not (UCase(strMode) = "X86") Then
- '64bit OS
- On Error Resume Next
- regJDKkey = regJDKkey + "\"
- If IsNull(objShell.RegRead(regJDKkey)) Then
- 'ãã¼ãåå¨ããªã
- '64bitã®OSä¸ã«32bitçã®Javaãã¤ã³ã¹ãã¼ã«ããã¦ãã
- regJDKkey = "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit"
- End If
-End If
-
-'ã¬ã¸ã¹ããªããJDKã«ã¬ã³ããã¼ã¸ã§ã³ãåå¾
+'WXg©çJDKJgo[Wðæ¾
'objShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion")
-
-'ããããä¾ãã°"1.5"ã ã¨ããã¨ã
+'±êªAá¦Î"1.5"¾Æ·éÆA
'HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.5\JavaHome
-'ã«JDKã«ã¬ã³ããã¼ã¸ã§ã³ã®ã«ã¼ããã©ã«ããè¨è¼ããã¦ãã
+'ÉJDKJgo[WÌ[gtH_ªLÚ³êÄ¢é
Javahome = regJDKkey & "\" & objShell.RegRead(regJDKkey & "\CurrentVersion") & "\JavaHome"
-
-'JDKã«ã¬ã³ããã¼ã¸ã§ã³ã®ã«ã¼ããã©ã«ãJavahomeã®ä¸ã®bin\orbd.exeãç®çã®å®è¡ãã¡ã¤ã«
+'JDKJgo[WÌ[gtH_Javahome̺Ìbin\orbd.exeªÚIÌÀst@C
targetexe = """" & objShell.RegRead(Javahome) & "\bin\orbd.exe"""
-
-'ç®çã®å®è¡ãã¡ã¤ã«targetexeãé©åãªãªãã·ã§ã³ãã¤ãã¦å®è¡ããã
+'ÚIÌÀst@CtargetexeðKØÈIvVð¯ÄÀs³¹é
objShell.Run targetexe & " -ORBInitialPort 2809 -ORBInitialHost localhost -defaultdb ""%TEMP%""\orb.db"
-'ããã¯ä¾ãã°ã次ã®ãããªãã¨ããã£ã¦ãããã ããä½æ¥ãã£ã¬ã¯ããªãã¦ã¼ã¶ã¼ã®tempãã©ã«ãã«æå®ã
+'±êÍá¦ÎAÌæ¤È±ÆðâÁÄéBìÆfBNgð[U[ÌtemptH_ÉwèB
'cf:objShell.Run """C:\Program Files\Java\jdk1.5.0_14\bin\orbd.exe"" -ORBInitialPort 2809 -ORBInitialHost localhost"
-'ä¸å¿ãªãã¸ã§ã¯ããéæ¾
+'êIuWFNgðJú
Set objShell = Nothing
-
-' **********************************************************
-' OS ãã¼ã¸ã§ã³ã®åå¾
-' **********************************************************
-Function GetOSVersion()
-
- Dim strComputer, Wmi, colTarget, strWork, objRow, aData
-
- strComputer = "."
- Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
- Set colTarget = Wmi.ExecQuery( "select Version from Win32_OperatingSystem" )
-
- For Each objRow in colTarget
- strWork = objRow.Version
- Next
-
- aData = Split( strWork, "." )
- strWork = aData(0) & "." & aData(1)
-
- GetOSVersion = CDbl( strWork )
-
-End Function
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 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/build.xml 2015-10-29 06:09:55 UTC (rev 738)
@@ -115,8 +115,6 @@
<property name="idl.ComponentObserver" value="${idl.path}/ComponentObserver.idl" />
- <property name="idl.Logger" value="${idl.path}/Logger.idl" />
-
<property name="idl.test.CorbaConsumer" value="${idl.path.tests}/CorbaConsumer/Hello.idl" />
<property name="idl.test.CorbaPort" value="${idl.path.tests}/CorbaPort/MyService.idl" />
@@ -161,18 +159,6 @@
</target>
- <target name="buildInstaller">
-
- <taskdef name="jsmoothgen"
- classname="net.charabia.jsmoothgen.ant.JSmoothGen"
- classpath="${dir.jsmooth}/lib/jsmoothgen-ant.jar"/>
- <antcall target="createExe" />
-
- <antcall target="javaInstaller" />
-
- </target>
-
-
<target name="buildAllLinux">
<antcall target="idlCompile" />
@@ -486,12 +472,6 @@
</exec>
- <exec executable="${java.home}\..\bin\idlj">
-
- <arg line="-v -fall -td ${source} -i ${idl.path} -emitAll ${idl.Logger}"/>
-
- </exec>
-
</target>
@@ -914,12 +894,8 @@
<target name="compile_tests" description="ã½ã¼ã¹ãã³ã³ãã¤ã«ãã¾ã">
- <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" />
+ <javac srcdir="${source.sdo}:${source.rtc}:${source.rtm}:${source.openrtm}:${source.main}:${source.examples}:${source.test}:${source.tests.bind}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar:${env.JUNIT_HOME}/junit.jar:" encoding="UTF-8" />
- <javac srcdir="${source.main}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar" encoding="UTF-8" includes="go/aist/**" excludes="go/aist/ForSunOrb/**,go/aist/ForJacOrb/**"/>
-
- <javac srcdir="${source.examples}:${source.extension}:${source.test}:${source.tests.bind}" destdir="${build.dir.test}" classpath="lib/commons-cli-1.1.jar:${env.JUNIT_HOME}/junit.jar" encoding="UTF-8" debug="on"/>
-
</target>
@@ -931,28 +907,26 @@
<delete dir="${build.dir.test}/reports/*.txt" />
- <junit haltonfailure="Yes" >
+ <junit haltonfailure="No" >
<formatter type="xml" usefile="true" />
<classpath>
<pathelement path="bin:${env.JUNIT_HOME}/junit:${env.JUNIT_HOME}/junit/samples:${env.JUNIT_HOME}:${env.ANT_HOME}:${build.dir.test}:lib/commons-cli-1.1.jar"/>
<pathelement location="${env.JUNIT_HOME}/junit.jar"/>
<pathelement location="${env.ANT_HOME}/lib/ant-junit.jar"/>
</classpath>
- <test name="jp.go.aist.rtm.AllTest110"/>
<!--
<test name="jp.go.aist.rtm.RTC.FactoryTest"/>
<test name="jp.go.aist.rtm.RTC.StateMachineTests"/>
-->
- <!--
<batchtest todir="${build.dir.test}/reports">
<fileSet dir="${build.dir.test}">
+ <include name="jp/go/aist/rtm/RTC/*Test.class" />
<include name="jp/go/aist/rtm/RTC/*Tests.class" />
<include name="jp/go/aist/rtm/RTC/**/*Test.class" />
<include name="jp/go/aist/rtm/RTC/**/*Tests.class" />
<exclude name="jp/go/aist/rtm/RTC/SampleTest.class" />
</fileSet>
</batchtest>
- -->
</junit>
<echo>All Test complete!</echo>
</target>
@@ -963,7 +937,7 @@
<mkdir dir="${dist.dir}/source/OpenRTM-aist-Java-${version}" />
- <delete file="${dist.dir}/source/OpenRTM-aist-Java-${version}-RELEASE.zip" />
+ <delete file="${dist.dir}/source/OpenRTM-aist-Java-${version}.zip" />
<copy todir="${dist.dir}/source/OpenRTM-aist-Java-${version}/src" >
@@ -989,7 +963,7 @@
<copy file=".classpath" todir="${dist.dir}/source/OpenRTM-aist-Java-${version}" />
- <zip destfile="${dist.dir}/source/OpenRTM-aist-Java-${version}-RELEASE.zip" basedir="${dist.dir}/source/OpenRTM-aist-Java-${version}" />
+ <zip destfile="${dist.dir}/source/OpenRTM-aist-Java-${version}.zip" basedir="${dist.dir}/source/OpenRTM-aist-Java-${version}" />
@@ -1002,7 +976,7 @@
<mkdir dir="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar/OpenRTM-aist/1.1" />
- <delete file="${dist.dir}/source/OpenRTM-aist-Java-${version}-RELEASE-jar.zip" />
+ <delete file="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar.zip" />
<copy todir="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar/OpenRTM-aist/1.1/jar" >
@@ -1060,7 +1034,7 @@
</copy>
- <zip destfile="${dist.dir}/source/OpenRTM-aist-Java-${version}-RELEASE-jar.zip" basedir="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar" />
+ <zip destfile="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar.zip" basedir="${dist.dir}/source/OpenRTM-aist-Java-${version}-jar" />
<delete file="${dist.dir}/source/OpenRTM-aist-Java-${version}-RELEASE.tar.gz" />
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/idl/Logger.idl
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/idl/Logger.idl 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/idl/Logger.idl 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,388 +0,0 @@
-// -*- IDL -*-
-/*!
- * @file Logger.idl
- * @brief Component logger SDO service
- * @date $Date$
- * @author Noriaki Ando <n-ando at aist.go.jp>
- *
- * Copyright (C) 2011
- * Noriaki Ando
- * Intelligent Systems Research Institute,
- * National Institute of
- * Advanced Industrial Science and Technology (AIST), Japan
- * All rights reserved.
- *
- * $Id$
- *
- */
-
-#include <BasicDataType.idl>
-#include <SDOPackage.idl>
-/*!
- * @if jp
- * @brief コンポーネントログ収集サービスインターフェース
- *
- * コンポーネントのログ情報を外部から取得するためのインターフェース。コ
- * ンポーネントに対して、本SDOサービスオブジェクトをアタッチすることで、
- * コンポーネントが出力するログを外部から取得することができる。
- *
- * @since 1.1
- *
- * @else
- * @brief Component logging service interface
- *
- * This interface defines logging service of an RT-Component from
- * outside. Attaching this service interface to an RT-Component, you
- * can get logging information from the RT-Component.
- *
- * @since 1.1
- * @endif
- *
- */
-module OpenRTM
-{
- /*!
- * @if jp
- *
- * @brief ログレベル
- *
- * ログレベル。ログレベルは9段階あり、それぞれ以下の意味を持つ。
- *
- * - SILENT : ロギング機能をオフにするための疑似レベル
- * - ERROR : エラーが発生したことを意味するログレベル
- * - WARN : エラーではないが注意すべき警告を意味するログレベル
- * - INFO : 付加的な情報を提供するためのログレベル
- * - NORMAL : 通常の情報を提供するためのログレベル
- * - DEBUG : デバッグ情報を提供する際のログレベル
- * - TRACE : トレースレベルの情報を提供する際のログレベル
- * - VERBOSE : トレース情報以上に詳細な情報を提供する際のログレベル
- * - PARANOID: リアルタイム周期処理実行時等の情報を提供するログレベル
- *
- * @else
- *
- * @brief Log level
- *
- * This enumeration defines log levels. The log level consists of
- * nine levels, and each level means the following meaning.
- *
- * - SILENT : Pseudo log level to stop logging function.
- * - ERROR : This log level means that an error event is occurring.
- * - WARN : This log level means that a warning event is occurring.
- * - INFO : This log level used to notify information.
- * - NORMAL : This log level means that an event is normal thing.
- * - DEBUG : This log level used to notify debugging information.
- * - TRACE : This log level used to notify trace information.
- * - VERBOSE : This log level used to notify more detailed information.
- * - PARANOID: This is used only to notify information in real-time loop.
- *
- * @endif
- */
- enum LogLevel
- {
- SILENT,
- ERROR,
- WARN,
- INFO,
- NORMAL,
- DEBUG,
- TRACE,
- VERBOSE,
- PARANOID
- };
-
- /*!
- * @if jp
- * @brief ログレコード構造体
- *
- * ログメッセージを含むログ情報を保持する構造体
- *
- * @else
- * @brief Log record structure
- *
- * This struct defines logging information including log message.
- *
- * @endif
- *
- */
- struct LogRecord
- {
- /*!
- * @if jp
- * @brief 時刻
- * タイムスタンプ
- * @else
- * @brief Time
- * Time stump.
- * @endif
- */
- RTC::Time time;
-
- /*!
- * @if jp
- * @brief ロガー名
- * ログを書きこんだロガーオブジェクト名
- * @else
- * @brief logger name
- * The logger name which writes this record.
- * @endif
- */
- string loggername;
-
- /*!
- * @if jp
- * @brief ログレベル
- * このレコードのログレベル
- * @else
- * @brief Log level
- * The log level of this record
- * @endif
- */
- LogLevel level;
-
- /*!
- * @if jp
- * @brief メッセージ
- * ログメッセージ
- * @else
- * @brief Message
- * Log message.
- * @endif
- */
- string message;
- };
-
-
- /*!
- * @if jp
- *
- * @interface Logger インターフェース
- *
- * 個別のRTCのログ情報を取得するためのサービスインターフェース。SDO
- * Service として対象となるRTC/SDOに対してアタッチされ、RTC/SDOのログ
- * 情報を外部から取得する。実際の処理シーケンスは以下の通りである。
- *
- * -# SDO::get_configuration() により Configuration オブジェクトを取得
- * -# Configuration::add_service_profile() によりTool側の
- * Logger を ServiceProfile により RTC に与える。
- * ServiceProfile のメンバーは以下のように設定すること
- * - id: UUID など一意なIDを設定する。削除時にも必要になるので、Tool
- * 側ではIDを保持しておかなければならない。
- * - interface_type: 当該サービスのIFRのIDを文字列として指定。RTC側で
- * はこの文字列により当該サービスオブジェクトを受け入れるか決定す
- * るため指定は必須となる。
- * - properties: RTC側のサービスの受け入れ側に通知するプロパティを設
- * 定する。このサービスでは、下記のログレベル関連のプロパティを
- * 指定する。
- * - service: SDOService オブジェクトの参照を指定する。
- * -# RTC側でロガーへの書き込みが有った場合には publish() オペレーション
- * が LogRecord 構造体としてログメッセージやタイムスタンプをサー
- * ビス側に通知する。サービスを保持する側では、LogRecord内の情報
- * をファイルに書き込む、表示する等の方法で利用することができる。
- * -# RTC側が終了するときには、close() オペレーションが呼び出されるの
- * で、サービス提供側は適切な終了処理を行う必要がある。close()が呼
- * ばれた場合は、remove_service_profile() により明示的にサービスを
- * 削除する必要はない。またRTC側ではclose() を呼んだ後は、当該サー
- * ビスに関する情報やリソースを適切に開放しなければならない。
- * -# ツール等のサービス提供側が終了する場合などは、
- * remove_service_profile() オペレーションを呼び出し、当該RTC上の
- * リソースを適切に開放する必要がある。RTC側は、
- * remove_service_profile() が呼び出された際には、当該ロギングに関
- * するリソースを適切に開放する必要がある。
- *
- * 上記のプロセスを下記シーケンス図に示す。
- *
- * <pre>
- *
- * [RTC] [Configuration] [Logger] [Tool]
- * | | | |
- * | | get_configuration() | |
- * |<------------------------------------------------|
- * | | | |
- * | | add_service_profile(prof) |
- * | |<-----------------------------------|
- * | | | |
- * | | publish(logrecord) | |
- * |----------------------------------->| |
- * | | publish(logrecord) | |
- * |----------------------------------->| |
- * | | : | |
- * | | : | |
- * | | 1) RTCが先に終了するとき |
- * | | : | |
- * | | [close()] | |
- * |----------------------------------->| |
- * | | : | |
- * | | 2) ツールがロギングを終了するとき |
- * | | : | |
- * | | remove_service_profile(id) |
- * | |<-----------------------------------|
- * | | | |
- * | | x x
- *
- * </pre>
- *
- * なお、ServiceProfile::properties に指定するプロパティとしては、
- *
- * - logger.log_level: (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE,
- * PARANOID)
- * - logger.filter: logger name or "ALL"
- *
- * がある、
- *
- * - logger.log_level: ERROR, WARN, INFO, NORMAL, DEBUG, TRACE,
- * VERBOSE またはPARANOID のうち一つを指定する。無指定の場合は
- * NORMAL と同等となる。指定されたレベルと同等あるいはそれより重要
- * な情報がロギングされる。すなわち、それぞれのログレベルを指定した
- * 際に出力されるログは以下の関係になる。
- * - ERROR : (ERROR)
- * - WARN : (ERROR, WARN)
- * - INFO : (ERROR, WARN, INFO)
- * - NORMAL : (ERROR, WARN, INFO, NORMAL)
- * - DEBUG : (ERROR, WARN, INFO, NORMAL, DEBUG)
- * - TRACE : (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE)
- * - VERBOSE : (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE)
- * - PARANOID: (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE, PARA)
- * - logger.filter: RTC内部は、RTC本体、データポート、サービスポート
- * 等それぞれのオブジェクトにロガーオブジェクトが存在する。このプロ
- * パティはロギングする対象のロガーオブジェクトをカンマ区切りで指定
- * する。または、ALLを指定することでRTC配下のすべてのロギングオブジェ
- * クトからのメッセージを受信する。無指定の場合はALLと同等になる。
- *
- * @else
- * @class
- *
- * @interface Logger interface
- *
- * This interface defines logging service for each RT-Component.
- * This service would be attached to a target RTC/SDO, and provides
- * functionality to collect log information from remote
- * applications. Actual process sequences are the following.
- *
- * -# Get configuration object by SDO::get_configuration()
- * -# Attach Logger object with ServiceProfile by
- * Configuration::add_service_profile(). ServiceProfile should be
- * set as follows.
- * - id: An unique ID like UUID. This ID is used when this service
- * is removed. Tools or applications should keep the ID for
- * this.
- * - interface_type: Specify this service's IFR ID in string. This
- * string is used to search available service in the RTC,
- * and if it matches with available SDO services, this
- * service is accepted.
- * - properties: This member specifies properties to notify
- * information to the target RTC. The following properties
- * for log level and others would be specified in this
- * properties.
- *
- * - service: A SDOService object reference is specified.
- * -# When logging occurs in the RTC side, the "publish()" operation
- * notifies a log message, time stump and so on to the service
- * provider as a LogRecord structure. The service provider can
- * use notified information for example writing to files and
- * showing them on the display.
- * -# When RTC is terminated, the "close()" operation is called, and
- * the service provider has to terminate the logging service
- * properly. In this case, tools and applications that have
- * service provider do not need to call remove_service_profile()
- * and remove the service explicitly. After calling close()
- * operation, the RTC has to release the service profile and
- * resources.
- * -# When tools and applications terminate services, they have to
- * call remove_service_profile() operation, and have to release
- * resources in the target RTC. When remove_service_profile() is
- * called, the RTC have to release service profile and resources
- * for this service.
- *
- * The following diagram shows above mentioned sequence.
- *
- * <pre>
- *
- * [RTC] [Configuration] [Logger] [Tool]
- * | | | |
- * | | get_configuration() | |
- * |<------------------------------------------------|
- * | | | |
- * | | add_service_profile(prof) |
- * | |<-----------------------------------|
- * | | | |
- * | | publish(logrecord) | |
- * |----------------------------------->| |
- * | | publish(logrecord) | |
- * |----------------------------------->| |
- * | | : | |
- * | | : | |
- * | | 1) When RTC is terminated |
- * | | : | |
- * | | [close()] | |
- * |----------------------------------->| |
- * | | : | |
- * | | 2) When tool terminates logging |
- * | | : | |
- * | | remove_service_profile(id) |
- * | |<-----------------------------------|
- * | | | |
- * | | x x
- *
- * </pre>
- *
- * So far, the following properties for ServiceProfile::properties
- * are available.
- *
- * - logger.log_level: (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE,
- * PARANOID)
- * - logger.filter: logger name or "ALL"
- *
- *
- * - logger.log_level: One of ERROR, WARN, INFO, NORMAL, DEBUG,
- * TRACE, VERBOSE or PARANOID can be specified. If no
- * properties are specified, it will be NORMAL. Log messages
- * equals and/or more important specified log level would be
- * published. The following list shows the relation between
- * specified level and published level.
- * - ERROR : (ERROR)
- * - WARN : (ERROR, WARN)
- * - INFO : (ERROR, WARN, INFO)
- * - NORMAL : (ERROR, WARN, INFO, NORMAL)
- * - DEBUG : (ERROR, WARN, INFO, NORMAL, DEBUG)
- * - TRACE : (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE)
- * - VERBOSE : (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE)
- * - PARANOID: (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE, PARA)
- * - logger.filter: Some logger objects exist in some object of an
- * RTC such as RTC body, data port, service port and so on.
- * Some logger objects exist in some object of an RTC such as
- * RTC body, data port, service port and so on. This properties
- * specify target logger names separated with commas. If ALL is
- * specified, all the logger's messages under the target RTC's
- * logger would be published. If no property is specified, all
- * the messages will be published.
- *
- * @endif
- *
- */
- interface Logger
- : SDOPackage::SDOService
- {
- /*!
- * @if jp
- * @brief ログメッセージ配信
- * ログメッセージを配信する
- * @else
- * @brief Publish log message
- * This operation publishes log message.
- * @endif
- */
- oneway void publish(in LogRecord record);
-
- /*!
- * @if jp
- * @brief サービスの終了
- * ロギングサービスの終了を通知する
- * @else
- * @brief Terminate service
- * This operation notifies logging service.
- * @endif
- */
- void close();
- };
-};
-
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,64 +1,30 @@
-'orbdèµ·åç¨ã¹ã¯ãªãã
-'æ¬ã¹ã¯ãªããã¯ç°å¢å¤æ°TEMPãè¨å®ããã¦ãããã¨ãåæã¨ãã¾ã
-'ãªããç°å¢å¤æ°TEMPã¯éä¾OSã«ããããã©ã«ãã§è¨å®ããã¦ãã¾ã
+'orbdN®pXNvg
+'{XNvgÍ«ÏTEMPªÝè³êÄ¢é±ÆðOñƵܷ
+'ȨA«ÏTEMPÍÊáOSÉæèftHgÅÝè³êĢܷ
-'èµ·åç¨ãªãã¸ã§ã¯ãã®åå¾
+'N®pIuWFNgÌæ¾
Set objShell = WScript.CreateObject("WScript.Shell")
-strMode = objShell.Environment("Process").Item("PROCESSOR_ARCHITECTURE")
-
-'JDKã®ã¬ã¸ã¹ããªãã¼ãã»ãã
+'JDKÌWXgL[ðZbg
regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
-If not (UCase(strMode) = "X86") Then
- '64bit OS
- On Error Resume Next
- regJDKkey = regJDKkey + "\"
- If IsNull(objShell.RegRead(regJDKkey)) Then
- 'ãã¼ãåå¨ããªã
- '64bitã®OSä¸ã«32bitçã®Javaãã¤ã³ã¹ãã¼ã«ããã¦ãã
- regJDKkey = "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit"
- End If
-End If
-'ã¬ã¸ã¹ããªããJDKã«ã¬ã³ããã¼ã¸ã§ã³ãåå¾
+'WXg©çJDKJgo[Wðæ¾
'objShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion")
-'ããããä¾ãã°"1.5"ã ã¨ããã¨ã
+'±êªAá¦Î"1.5"¾Æ·éÆA
'HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.5\JavaHome
-'ã«JDKã«ã¬ã³ããã¼ã¸ã§ã³ã®ã«ã¼ããã©ã«ããè¨è¼ããã¦ãã
+'ÉJDKJgo[WÌ[gtH_ªLÚ³êÄ¢é
Javahome = regJDKkey & "\" & objShell.RegRead(regJDKkey & "\CurrentVersion") & "\JavaHome"
-'JDKã«ã¬ã³ããã¼ã¸ã§ã³ã®ã«ã¼ããã©ã«ãJavahomeã®ä¸ã®bin\orbd.exeãç®çã®å®è¡ãã¡ã¤ã«
+'JDKJgo[WÌ[gtH_Javahome̺Ìbin\orbd.exeªÚIÌÀst@C
targetexe = """" & objShell.RegRead(Javahome) & "\bin\orbd.exe"""
-'ç®çã®å®è¡ãã¡ã¤ã«targetexeãé©åãªãªãã·ã§ã³ãã¤ãã¦å®è¡ããã
+'ÚIÌÀst@CtargetexeðKØÈIvVð¯ÄÀs³¹é
objShell.Run targetexe & " -ORBInitialPort 2809 -ORBInitialHost localhost -defaultdb ""%TEMP%""\orb.db"
-'ããã¯ä¾ãã°ã次ã®ãããªãã¨ããã£ã¦ãããã ããä½æ¥ãã£ã¬ã¯ããªãã¦ã¼ã¶ã¼ã®tempãã©ã«ãã«æå®ã
+'±êÍá¦ÎAÌæ¤È±ÆðâÁÄéB½¾µAìÆfBNgð[U[ÌtemptH_ÉwèB
'cf:objShell.Run """C:\Program Files\Java\jdk1.5.0_14\bin\orbd.exe"" -ORBInitialPort 2809 -ORBInitialHost localhost"
-'ä¸å¿ãªãã¸ã§ã¯ããéæ¾
+'êIuWFNgðJú
Set objShell = Nothing
-
-' **********************************************************
-' OS ãã¼ã¸ã§ã³ã®åå¾
-' **********************************************************
-Function GetOSVersion()
-
- Dim strComputer, Wmi, colTarget, strWork, objRow, aData
-
- strComputer = "."
- Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
- Set colTarget = Wmi.ExecQuery( "select Version from Win32_OperatingSystem" )
-
- For Each objRow in colTarget
- strWork = objRow.Version
- Next
-
- aData = Split( strWork, "." )
- strWork = aData(0) & "." & aData(1)
-
- GetOSVersion = CDbl( strWork )
-
-End Function
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTM-aist-Java.wxs.in 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
- <Product Name='$(env.PRODUCT_NAME)'
+ <?define ProductName = "{% Product.Name %}-{% Product.Version %} for Java"?>
+ <Product Name="{% Product.Name %}-{% Product.Version %} for Java"
Id="{% Product.Id %}"
Language='$(var.language)'
Codepage='$(var.codepage)'
@@ -10,31 +11,40 @@
<Package Id="*"
Keywords="Installer"
Description="{% Package.Description %}"
- InstallerVersion="{% Package.InstallerVersion %}"
+ InstallerVersion="300"
Languages='$(var.language)'
- Compressed="{% Package.Compressed %}"
+ Compressed="yes"
SummaryCodepage='$(var.codepage)' />
<!-- Property -->
<Property Id='USERPROFILEDIR' Value='%USERPROFILE%' />
- <?if $(env.ARCH) = x86_64 ?>
- <Property Id="JDK17">
- <RegistrySearch Id="JDK17"
- Root="HKLM"
- Key="SOFTWARE\JavaSoft\Java Development Kit\1.7"
- Name="JavaHome"
- Win64="yes"
+ <Property Id="JDK15">
+ <RegistrySearch Id="JDK15"
+ Root="HKLM"
+ Key="SOFTWARE\JavaSoft\Java Development Kit\1.5"
+ Name="JavaHome"
Type="raw" />
</Property>
- <?else?>
- <Property Id="JDK17">
- <RegistrySearch Id="JDK17"
- Root="HKLM"
- Key="SOFTWARE\JavaSoft\Java Development Kit\1.7"
- Name="JavaHome"
+ <Property Id="JDK16">
+ <RegistrySearch Id="JDK16"
+ Root="HKLM"
+ Key="SOFTWARE\JavaSoft\Java Development Kit\1.6"
+ Name="JavaHome"
Type="raw" />
</Property>
- <?endif ?>
+
+ <!-- RTSE Property-->
+<!--
+ <Property Id="FILEEXISTS">
+ <DirectorySearch Id="CheckFileDir" Path="C:\Program Files">
+ <DirectorySearch Id="CheckFileDir2" Path ="OpenRTP">
+ <DirectorySearch Id="CheckFileDir3" Path ="RTSystemEditor">
+ <FileSearch Id="CheckFile" Name="RTSystemEditorRCP.exe" />
+ </DirectorySearch>
+ </DirectorySearch>
+ </DirectorySearch>
+ </Property>
+-->
<!-- <SetProperty Id="FILEEXISTSDIR" After="AppSearch" Value="[FILEEXISTS]">
</SetProperty>-->
@@ -49,7 +59,7 @@
Minimum="1.1.0"
Maximum="1.1.0.1"
Property="OLDERVERSIONBEINGUPGRADED"
- IncludeMaximum="yes" />
+ IncludeMaximum="no" />
<UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND'
Minimum='1.1.0' IncludeMinimum='yes'
Maximum='1.2.0' IncludeMaximum='no' />
@@ -64,17 +74,13 @@
<!-- <Property Id="ALLUSERS" Value="1" /> -->
<!-- Check Conditions -->
- <Condition Message="[ProductName] requires JDK 1.7">
- <![CDATA[Installed OR (JDK17 <> "")]]>
+ <Condition Message="[ProductName] requires JDK 1.5 or 1.6">
+ <![CDATA[Installed OR (JDK15 <> "" OR JDK16 <> "")]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Program Files Folder -->
- <?if $(env.ARCH) = x86 ?>
<Directory Id="ProgramFilesFolder" SourceName="PFILE">
- <?else?>
- <Directory Id="ProgramFiles64Folder" SourceName="PFILE">
- <?endif ?>
<Directory Id="INSTALLLOCATION"
Name="{% Product.Name %}">
<Directory Id="Version"
@@ -85,7 +91,6 @@
<Condition>
<![CDATA[ALLUSERS <> 1]]>
</Condition>
- <CreateFolder />
<Environment Id="envRTMJAVAROOTlocal" Name="RTM_JAVA_ROOT" Action="set"
System="no" Part="last" Value="[Version]"/>
</Component>
@@ -93,30 +98,21 @@
<Condition>
<![CDATA[ALLUSERS = 1 AND Privileged = 1]]>
</Condition>
- <CreateFolder />
<Environment Id="envRTMJAVAROOTsystem" Name="RTM_JAVA_ROOT" Action="set"
System="yes" Part="last" Value="[Version]"/>
</Component>
- <!-- JRE -->
- <?if $(env.INCLUDE_JRE) = YES ?>
- <Merge Id="Msi_JRE_OpenJDK" Language="1041"
- SourceFile="JRE_OpenJDK7_$(env.ARCH).msm" DiskId="1" />
- <?endif ?>
- <!-- end of JRE -->
-
<!-- bin -->
<Directory Id="bin" Name="bin">
<Component Id="RtmSourceExamplesBin" Guid="{% RtmSourceExamplesBin.GUID %}">
<RemoveFolder Id='RtmSourceExamplesBin_f' On='uninstall'/>
- <RemoveFolder Id='RemoveToolsMenuFolder' Directory='ToolsMenuFolder' On='uninstall' />
{% for file in RtmSourceExamplesBin.Files %}
<File Id="{% file.Id %}"
Name="{% file.Name %}" DiskId="1"
Source="{% file.Source %}">
{% if file.Name is start-orbd.vbs %}
- <Shortcut Id="{% file.Id %}" Directory="CommonToolsMenuFolder"
- Name="Start Java Naming Service"
+ <Shortcut Id="{% file.Id %}" Directory="ToolsMenuFolder"
+ Name="Start Naming Service"
Show="normal" WorkingDirectory="bin"/>
{% endif %}
{% if file.Name is rtcd_java.exe %}
@@ -189,7 +185,6 @@
<Component Id="RtmSourceJavadoc"
Guid="{% RtmSourceJavadoc.GUID %}">
<RemoveFolder Id='RtmSourceJavadoc_f' On='uninstall' />
- <RemoveFolder Id='RemoveDocMenuFolder' Directory='DocMenuFolder' On='uninstall' />
{% for file in RtmSourceJavadoc.Files %}
<File Id="{% file.Id %}"
Name="{% file.Name %}" DiskId="1"
@@ -1040,8 +1035,6 @@
Guid="{% RtmSourceExamplesBat.GUID %}">
<RemoveFile Id='RtmSourceExamplesBat' On='uninstall' Name='*.log' />
<RemoveFolder Id='RtmSourceExamplesBat_f' On='uninstall' />
- <RemoveFolder Id='RemoveExpMenuFolder' Directory='ExpMenuFolder' On='uninstall' />
- <RemoveFolder Id='RemoveComponents' Directory='Components' On='uninstall' />
{% for file in RtmSourceExamplesBat.Files %}
<File Id="{% file.Id %}"
Name="{% file.Name %}" DiskId="1"
@@ -1220,8 +1213,7 @@
</Directory>
<!-- rtmtools components -->
<?if $(env.INCLUDE_OPENRTP) = YES ?>
- <Merge Id="Msi_RTSystemEditorRCP" Language="1041"
- SourceFile="RTSystemEditorRCP_$(env.ARCH).msm" DiskId="1" />
+ <?include OpenRTP_inc.wxs ?>
<?endif ?>
<!-- end of rtmtools -->
@@ -1229,34 +1221,30 @@
</Directory>
+ <!-- rtmtools components -->
+<!--
+ <?if $(env.INCLUDE_OPENRTP) = YES ?>
+ <?include OpenRTP_inc.wxs ?>
+ <?endif ?>
+-->
+ <!-- end of rtmtools -->
<!-- end of Program Files Folder -->
- <?if $(env.ARCH) = "x86" ?>
+
</Directory>
- <?else?>
- </Directory>
- <?endif?>
<!-- Program Folder -->
<Directory Id="ProgramMenuFolder">
<Directory Id="AppMenuFolder" Name="{% Product.Name %} {% Product.ShortVersion %}">
- <Component Id="AppMenuFolder" Guid="7B97F931-CCBC-42d4-A280-5223F4EC3885">
- <RemoveFolder Id='AppMenuFolder' On='uninstall' />
- </Component>
<Directory Id="JavaMenuFolder" Name="Java">
- <Component Id="JavaMenuFolder" Guid="4F6569FA-8492-441c-AF92-9E4B65C738EC">
- <RemoveFolder Id='JavaMenuFolder' On='uninstall' />
- </Component>
- <Directory Id="ToolsMenuFolder" Name="Tools">
+ <Directory Id="ToolsMenuFolder" Name="tools">
</Directory>
- <Directory Id="Components" Name="Components">
- <Directory Id="ExpMenuFolder" Name="Examples">
+ <Directory Id="Components" Name="components">
+ <Directory Id="ExpMenuFolder" Name="examples">
</Directory>
</Directory>
- <Directory Id="DocMenuFolder" Name="Documents">
+ <Directory Id="DocMenuFolder" Name="documents">
</Directory>
</Directory>
- <Directory Id="CommonToolsMenuFolder" Name="Tools">
- </Directory>
</Directory>
</Directory>
@@ -1360,17 +1348,27 @@
</Feature>
- <!-- JRE -->
- <?if $(env.INCLUDE_JRE) = YES ?>
- <Feature Id="JRE_OpenJDK" Level="1" Title="JRE for RTSystemEditorRCP 1.1">
- <MergeRef Id="Msi_JRE_OpenJDK" />
- </Feature>
- <?endif ?>
-
<!-- OpenRTP tools -->
<?if $(env.INCLUDE_OPENRTP) = YES ?>
- <Feature Id="RTSE_ONLY" Level="1" Title="RTSystemEditorRCP 1.1">
- <MergeRef Id="Msi_RTSystemEditorRCP" />
+ <Feature Id="OpenRTP" Level="1" Title="OpenRT Platform Tool Chain">
+ <!--
+ <Condition Level ="1"><![CDATA[ (FILEEXISTS = "") ]]></Condition>
+ <Condition Level ="0"><![CDATA[ (FILEEXISTS <> "") ]]></Condition>
+ -->
+ <!-- rtse rcp -->
+ <Feature Id="RTSystemEditor" Level="1" Title="RTSystemEditor">
+ <ComponentRef Id="Openrtp" />
+ <ComponentRef Id="OpenrtpConfiguration" />
+ <ComponentRef Id="OpenrtpPlugins" />
+ <!-- <ComponentRef Id="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610" /> -->
+ <ComponentRef Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" />
+ <!-- <ComponentRef Id="META_INF" /> -->
+ <ComponentRef Id="Meta_inf" />
+ <!-- <ComponentRef Id="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731" /> -->
+ <ComponentRef Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731" />
+ <!-- <ComponentRef Id="META_INF_2" /> -->
+ <ComponentRef Id="Meta_inf_2" />
+ </Feature>
</Feature>
<?endif ?>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs 2015-10-29 06:09:55 UTC (rev 738)
@@ -3,24 +3,23 @@
<!-- root directory -->
<Directory Id="OpenRTP" Name="OpenRTP">
<Directory Id="OpenRTPVersion" Name="1.1">
- <Component Id="Openrtp" Guid="F71D844F-ADA6-11E3-AED5-9A48C58E0395">
+ <Component Id="Openrtp" Guid="D004598F-F86B-11E0-9CF4-001BDC004C2E">
<Environment Id="OPENRTP_ROOT" Name="OPENRTP_ROOT" Action="set"
System="yes" Value="[openrtpVersion]" />
<File Id="Openrtp0000" Name="RTSystemEditorRCP.exe"
- DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\RTSystemEditorRCP.exe">
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\\\RTSystemEditorRCP.exe">
<Shortcut Id="Openrtp0000" Directory="ToolsMenuFolder"
- Name="RTSystemEditor"
- Arguments="-data "%USERPROFILE%\workspace""
+ Name="RTSystemEditor"
Show="normal" WorkingDirectory="tools"/>
</File>
<File Id="Openrtp0001" Name=".eclipseproduct"
- DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\.eclipseproduct">
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\\\.eclipseproduct">
</File>
</Component>
<!-- configuration -->
<Directory Id="openrtp_configuration" Name="configuration">
- <Component Id="OpenrtpConfiguration" Guid="F71EBCD1-ADA6-11E3-A057-9A48C58E0395">
+ <Component Id="OpenrtpConfiguration" Guid="D0176C61-F86B-11E0-8601-001BDC004C2E">
<File Id="OpenrtpConfiguration0000" Name="config.ini"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\configuration\\config.ini">
</File>
@@ -29,7 +28,7 @@
<!-- plugins -->
<Directory Id="openrtp_plugins" Name="plugins">
- <Component Id="OpenrtpPlugins" Guid="F72859C0-ADA6-11E3-BA96-9A48C58E0395">
+ <Component Id="OpenrtpPlugins" Guid="D0424CEE-F86B-11E0-B4B9-001BDC004C2E">
<File Id="OpenrtpPlugins0000" Name="com.ibm.icu.nl_ja_3.8.1.v20080530.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\com.ibm.icu.nl_ja_3.8.1.v20080530.jar">
</File>
@@ -126,167 +125,210 @@
<File Id="OpenrtpPlugins0031" Name="org.eclipse.core.resources_3.4.2.R34x_v20090126.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.resources_3.4.2.R34x_v20090126.jar">
</File>
- <File Id="OpenrtpPlugins0032" Name="org.eclipse.core.runtime_3.4.0.v20080512.jar"
+ <File Id="OpenrtpPlugins0032" Name="org.eclipse.core.runtime.nl_ja_3.4.0.v20080512.jar"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.nl_ja_3.4.0.v20080512.jar">
+ </File>
+ <File Id="OpenrtpPlugins0033" Name="org.eclipse.core.runtime_3.4.0.v20080512.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime_3.4.0.v20080512.jar">
</File>
- <File Id="OpenrtpPlugins0033" Name="org.eclipse.draw2d_3.4.2.v20090114-1330.jar"
+ <File Id="OpenrtpPlugins0034" Name="org.eclipse.draw2d_3.4.2.v20090114-1330.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.draw2d_3.4.2.v20090114-1330.jar">
</File>
- <File Id="OpenrtpPlugins0034" Name="org.eclipse.emf.common_2.4.0.v200902171115.jar"
+ <File Id="OpenrtpPlugins0035" Name="org.eclipse.emf.common_2.4.0.v200902171115.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.emf.common_2.4.0.v200902171115.jar">
</File>
- <File Id="OpenrtpPlugins0035" Name="org.eclipse.emf.ecore.xmi_2.4.1.v200902171115.jar"
+ <File Id="OpenrtpPlugins0036" Name="org.eclipse.emf.ecore.xmi_2.4.1.v200902171115.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.emf.ecore.xmi_2.4.1.v200902171115.jar">
</File>
- <File Id="OpenrtpPlugins0036" Name="org.eclipse.emf.ecore_2.4.2.v200902171115.jar"
+ <File Id="OpenrtpPlugins0037" Name="org.eclipse.emf.ecore_2.4.2.v200902171115.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.emf.ecore_2.4.2.v200902171115.jar">
</File>
- <File Id="OpenrtpPlugins0037" Name="org.eclipse.equinox.app.nl_ja_1.1.0.v20080421-2006.jar"
+ <File Id="OpenrtpPlugins0038" Name="org.eclipse.equinox.app.nl_ja_1.1.0.v20080421-2006.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.app.nl_ja_1.1.0.v20080421-2006.jar">
</File>
- <File Id="OpenrtpPlugins0038" Name="org.eclipse.equinox.app_1.1.0.v20080421-2006.jar"
+ <File Id="OpenrtpPlugins0039" Name="org.eclipse.equinox.app_1.1.0.v20080421-2006.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.app_1.1.0.v20080421-2006.jar">
</File>
- <File Id="OpenrtpPlugins0039" Name="org.eclipse.equinox.common.nl_ja_3.4.0.v20080421-2006.jar"
+ <File Id="OpenrtpPlugins0040" Name="org.eclipse.equinox.common.nl_ja_3.4.0.v20080421-2006.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.common.nl_ja_3.4.0.v20080421-2006.jar">
</File>
- <File Id="OpenrtpPlugins0040" Name="org.eclipse.equinox.common_3.4.0.v20080421-2006.jar"
+ <File Id="OpenrtpPlugins0041" Name="org.eclipse.equinox.common_3.4.0.v20080421-2006.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.common_3.4.0.v20080421-2006.jar">
</File>
- <File Id="OpenrtpPlugins0041" Name="org.eclipse.equinox.launcher.nl_ja_1.0.101.R34x_v20081125.jar"
+ <File Id="OpenrtpPlugins0042" Name="org.eclipse.equinox.launcher.nl_ja_1.0.101.R34x_v20081125.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.nl_ja_1.0.101.R34x_v20081125.jar">
</File>
- <File Id="OpenrtpPlugins0042" Name="org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar"
+ <File Id="OpenrtpPlugins0043" Name="org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar">
</File>
- <File Id="OpenrtpPlugins0043" Name="org.eclipse.equinox.preferences.nl_ja_3.2.201.R34x_v20080709.jar"
+ <File Id="OpenrtpPlugins0044" Name="org.eclipse.equinox.preferences.nl_ja_3.2.201.R34x_v20080709.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.preferences.nl_ja_3.2.201.R34x_v20080709.jar">
</File>
- <File Id="OpenrtpPlugins0044" Name="org.eclipse.equinox.preferences_3.2.201.R34x_v20080709.jar"
+ <File Id="OpenrtpPlugins0045" Name="org.eclipse.equinox.preferences_3.2.201.R34x_v20080709.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.preferences_3.2.201.R34x_v20080709.jar">
</File>
- <File Id="OpenrtpPlugins0045" Name="org.eclipse.equinox.registry.nl_ja_3.4.0.v20080516-0950.jar"
+ <File Id="OpenrtpPlugins0046" Name="org.eclipse.equinox.registry.nl_ja_3.4.0.v20080516-0950.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.registry.nl_ja_3.4.0.v20080516-0950.jar">
</File>
- <File Id="OpenrtpPlugins0046" Name="org.eclipse.equinox.registry_3.4.0.v20080516-0950.jar"
+ <File Id="OpenrtpPlugins0047" Name="org.eclipse.equinox.registry_3.4.0.v20080516-0950.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.registry_3.4.0.v20080516-0950.jar">
</File>
- <File Id="OpenrtpPlugins0047" Name="org.eclipse.gef_3.4.1.v20080806.jar"
+ <File Id="OpenrtpPlugins0048" Name="org.eclipse.gef_3.4.1.v20080806.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.gef_3.4.1.v20080806.jar">
</File>
- <File Id="OpenrtpPlugins0048" Name="org.eclipse.help.nl_ja_3.3.102.v20081014_34x.jar"
+ <File Id="OpenrtpPlugins0049" Name="org.eclipse.help.nl_ja_3.3.102.v20081014_34x.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.help.nl_ja_3.3.102.v20081014_34x.jar">
</File>
- <File Id="OpenrtpPlugins0049" Name="org.eclipse.help_3.3.102.v20081014_34x.jar"
+ <File Id="OpenrtpPlugins0050" Name="org.eclipse.help_3.3.102.v20081014_34x.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.help_3.3.102.v20081014_34x.jar">
</File>
- <File Id="OpenrtpPlugins0050" Name="org.eclipse.jface.databinding.nl_ja_1.2.1.M20080827-0800a.jar"
+ <File Id="OpenrtpPlugins0051" Name="org.eclipse.jface.databinding.nl_ja_1.2.1.M20080827-0800a.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface.databinding.nl_ja_1.2.1.M20080827-0800a.jar">
</File>
- <File Id="OpenrtpPlugins0051" Name="org.eclipse.jface.databinding_1.2.1.M20080827-0800a.jar"
+ <File Id="OpenrtpPlugins0052" Name="org.eclipse.jface.databinding_1.2.1.M20080827-0800a.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface.databinding_1.2.1.M20080827-0800a.jar">
</File>
- <File Id="OpenrtpPlugins0052" Name="org.eclipse.jface.nl_ja_3.4.2.M20090107-0800.jar"
+ <File Id="OpenrtpPlugins0053" Name="org.eclipse.jface.nl_ja_3.4.2.M20090107-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface.nl_ja_3.4.2.M20090107-0800.jar">
</File>
- <File Id="OpenrtpPlugins0053" Name="org.eclipse.jface.text.nl_ja_3.4.2.r342_v20081119-0800.jar"
+ <File Id="OpenrtpPlugins0054" Name="org.eclipse.jface.text.nl_ja_3.4.2.r342_v20081119-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface.text.nl_ja_3.4.2.r342_v20081119-0800.jar">
</File>
- <File Id="OpenrtpPlugins0054" Name="org.eclipse.jface.text_3.4.2.r342_v20081119-0800.jar"
+ <File Id="OpenrtpPlugins0055" Name="org.eclipse.jface.text_3.4.2.r342_v20081119-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface.text_3.4.2.r342_v20081119-0800.jar">
</File>
- <File Id="OpenrtpPlugins0055" Name="org.eclipse.jface_3.4.2.M20090107-0800.jar"
+ <File Id="OpenrtpPlugins0056" Name="org.eclipse.jface_3.4.2.M20090107-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.jface_3.4.2.M20090107-0800.jar">
</File>
- <File Id="OpenrtpPlugins0056" Name="org.eclipse.osgi.nl_ja_3.4.3.R34x_v20081215-1030.jar"
+ <File Id="OpenrtpPlugins0057" Name="org.eclipse.osgi.nl_ja_3.4.3.R34x_v20081215-1030.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.osgi.nl_ja_3.4.3.R34x_v20081215-1030.jar">
</File>
- <File Id="OpenrtpPlugins0057" Name="org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar"
+ <File Id="OpenrtpPlugins0058" Name="org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar">
</File>
- <File Id="OpenrtpPlugins0058" Name="org.eclipse.swt.nl_ja_3.4.2.v3452b.jar"
+ <File Id="OpenrtpPlugins0059" Name="org.eclipse.swt.nl_ja_3.4.2.v3452b.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.swt.nl_ja_3.4.2.v3452b.jar">
</File>
- <File Id="OpenrtpPlugins0059" Name="org.eclipse.swt.win32.win32.x86_3.4.1.v3452b.jar"
+ <File Id="OpenrtpPlugins0060" Name="org.eclipse.swt.win32.win32.x86_3.4.1.v3452b.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.swt.win32.win32.x86_3.4.1.v3452b.jar">
</File>
- <File Id="OpenrtpPlugins0060" Name="org.eclipse.swt_3.4.2.v3452b.jar"
+ <File Id="OpenrtpPlugins0061" Name="org.eclipse.swt_3.4.2.v3452b.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.swt_3.4.2.v3452b.jar">
</File>
- <File Id="OpenrtpPlugins0061" Name="org.eclipse.text.nl_ja_3.4.0.v20080605-1800.jar"
+ <File Id="OpenrtpPlugins0062" Name="org.eclipse.text.nl_ja_3.4.0.v20080605-1800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.text.nl_ja_3.4.0.v20080605-1800.jar">
</File>
- <File Id="OpenrtpPlugins0062" Name="org.eclipse.text_3.4.0.v20080605-1800.jar"
+ <File Id="OpenrtpPlugins0063" Name="org.eclipse.text_3.4.0.v20080605-1800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.text_3.4.0.v20080605-1800.jar">
</File>
- <File Id="OpenrtpPlugins0063" Name="org.eclipse.ui.editors.nl_ja_3.4.0.v20080603-2000.jar"
+ <File Id="OpenrtpPlugins0064" Name="org.eclipse.ui.editors.nl_ja_3.4.0.v20080603-2000.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.editors.nl_ja_3.4.0.v20080603-2000.jar">
</File>
- <File Id="OpenrtpPlugins0064" Name="org.eclipse.ui.editors_3.4.0.v20080603-2000.jar"
+ <File Id="OpenrtpPlugins0065" Name="org.eclipse.ui.editors_3.4.0.v20080603-2000.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.editors_3.4.0.v20080603-2000.jar">
</File>
- <File Id="OpenrtpPlugins0065" Name="org.eclipse.ui.ide.nl_ja_3.4.2.M20090127-1700.jar"
+ <File Id="OpenrtpPlugins0066" Name="org.eclipse.ui.ide.nl_ja_3.4.2.M20090127-1700.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.ide.nl_ja_3.4.2.M20090127-1700.jar">
</File>
- <File Id="OpenrtpPlugins0066" Name="org.eclipse.ui.ide_3.4.2.M20090127-1700.jar"
+ <File Id="OpenrtpPlugins0067" Name="org.eclipse.ui.ide_3.4.2.M20090127-1700.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.ide_3.4.2.M20090127-1700.jar">
</File>
- <File Id="OpenrtpPlugins0067" Name="org.eclipse.ui.nl_ja_3.4.2.M20090204-0800.jar"
+ <File Id="OpenrtpPlugins0068" Name="org.eclipse.ui.nl_ja_3.4.2.M20090204-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.nl_ja_3.4.2.M20090204-0800.jar">
</File>
- <File Id="OpenrtpPlugins0068" Name="org.eclipse.ui.views.nl_ja_3.3.1.M20081112-0800.jar"
+ <File Id="OpenrtpPlugins0069" Name="org.eclipse.ui.views.nl_ja_3.3.1.M20081112-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.views.nl_ja_3.3.1.M20081112-0800.jar">
</File>
- <File Id="OpenrtpPlugins0069" Name="org.eclipse.ui.views_3.3.1.M20081112-0800.jar"
+ <File Id="OpenrtpPlugins0070" Name="org.eclipse.ui.views_3.3.1.M20081112-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.views_3.3.1.M20081112-0800.jar">
</File>
- <File Id="OpenrtpPlugins0070" Name="org.eclipse.ui.win32_3.2.100.v20080408-0800.jar"
+ <File Id="OpenrtpPlugins0071" Name="org.eclipse.ui.win32_3.2.100.v20080408-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.win32_3.2.100.v20080408-0800.jar">
</File>
- <File Id="OpenrtpPlugins0071" Name="org.eclipse.ui.workbench.nl_ja_3.4.2.M20090127-1700.jar"
+ <File Id="OpenrtpPlugins0072" Name="org.eclipse.ui.workbench.nl_ja_3.4.2.M20090127-1700.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.workbench.nl_ja_3.4.2.M20090127-1700.jar">
</File>
- <File Id="OpenrtpPlugins0072" Name="org.eclipse.ui.workbench.texteditor.nl_ja_3.4.1.r341_v20080827-1100.jar"
+ <File Id="OpenrtpPlugins0073" Name="org.eclipse.ui.workbench.texteditor.nl_ja_3.4.1.r341_v20080827-1100.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.workbench.texteditor.nl_ja_3.4.1.r341_v20080827-1100.jar">
</File>
- <File Id="OpenrtpPlugins0073" Name="org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-1100.jar"
+ <File Id="OpenrtpPlugins0074" Name="org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-1100.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-1100.jar">
</File>
- <File Id="OpenrtpPlugins0074" Name="org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar"
+ <File Id="OpenrtpPlugins0075" Name="org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar">
</File>
- <File Id="OpenrtpPlugins0075" Name="org.eclipse.ui_3.4.2.M20090204-0800.jar"
+ <File Id="OpenrtpPlugins0076" Name="org.eclipse.ui_3.4.2.M20090204-0800.jar"
DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.ui_3.4.2.M20090204-0800.jar">
</File>
- </Component>
- <Directory Id="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610" Name="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610">
- <Component Id="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610" DiskId="1" Guid="9B406546-ADAC-458F-8868-4D8E286A179F">
- <File Id="about.html" Name="about.html" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\about.html" />
- <File Id="fragment.properties" Name="fragment.properties" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\fragment.properties" />
- <File Id="runtime_registry_compatibility.jar" Name="runtime_registry_compatibility.jar" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\runtime_registry_compatibility.jar" />
- </Component>
- <Directory Id="META_INF" Name="META-INF">
- <Component Id="META_INF" DiskId="1" Guid="2FC7BBAC-7BE2-43A6-B281-45E5321BA6CD">
- <File Id="eclipse.inf" Name="eclipse.inf" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\META-INF\eclipse.inf" />
- <File Id="MANIFEST.MF" Name="MANIFEST.MF" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\META-INF\MANIFEST.MF" />
- </Component>
+ </Component>
+ <!-- org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610 -->
+ <Directory Id="openrtp_plugins_org_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" Name="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610">
+ <Component Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" Guid="D04978E1-F86B-11E0-91E8-001BDC004C2E">
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v200806100000" Name="about.html"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\about.html">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v200806100001" Name="fragment.properties"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\fragment.properties">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v200806100002" Name="runtime_registry_compatibility.jar"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\runtime_registry_compatibility.jar">
+ </File>
+ </Component>
+ <!-- META_INF -->
+ <Directory Id="_META_INF" Name="META_INF">
+ <Component Id="Meta_inf" Guid="D04978E1-F86B-11E0-9624-001BDC004C2E">
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf0000" Name="eclipse.inf"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\META-INF\\eclipse.inf">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf0001" Name="ECLIPSE.RSA"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\META-INF\\ECLIPSE.RSA">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf0002" Name="ECLIPSE.SF"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\META-INF\\ECLIPSE.SF">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf0003" Name="MANIFEST.MF"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610\\META-INF\\MANIFEST.MF">
+ </File>
+ </Component>
</Directory>
</Directory>
- <Directory Id="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731" Name="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731">
- <Component Id="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731" DiskId="1" Guid="1F0FFE6B-831F-41a3-A32E-7756BA008366">
- <File Id="about.html_1" Name="about.html" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\about.html" />
- <File Id="launcher.win32.win32.x86.properties" Name="launcher.win32.win32.x86.properties" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\launcher.win32.win32.x86.properties" />
- <File Id="eclipse_1115.dll" Name="eclipse_1115.dll" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll" />
- </Component>
- <Directory Id="META_INF_2" Name="META-INF_2">
- <Component Id="META_INF_2" DiskId="1" Guid="FBF62DCE-8E21-49e6-944A-49C8503B1360">
- <File Id="eclipse.inf_1" Name="eclipse.inf" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\META-INF_2\eclipse.inf" />
- <File Id="MANIFEST.MF_1" Name="MANIFEST.MF" Source="C:\distribution\OpenRTP\RTSystemEditor\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\META-INF_2\MANIFEST.MF" />
- </Component>
+ <!-- org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731 -->
+ <Directory Id="openrtp_plugins_org_eclipse_equinox_launcher_win32_win32_x86_1_0_101_R34x_v20080731" Name="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731">
+ <Component Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731" Guid="D04E33CF-F86B-11E0-8687-001BDC004C2E">
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v200807310000" Name="about.html"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\about.html">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v200807310001" Name="eclipse_1115.dll"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\eclipse_1115.dll">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v200807310002" Name="launcher.win32.win32.x86.properties"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\launcher.win32.win32.x86.properties">
+ </File>
+ </Component>
+ <!-- META_INF -->
+ <Directory Id="openrtp_plugins_org_eclipse_equinox_launcher_win32_win32_x86_1_0_101_R34x_v20080731_META_INF" Name="META-INF">
+ <Component Id="Meta_inf_2" Guid="D04E33CF-F86B-11E0-91DD-001BDC004C2E">
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf0000" Name="eclipse.inf"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\META-INF\\eclipse.inf">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf0001" Name="ECLIPSE.RSA"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\META-INF\\ECLIPSE.RSA">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf0002" Name="ECLIPSE.SF"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\META-INF\\ECLIPSE.SF">
+ </File>
+ <File Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf0003" Name="MANIFEST.MF"
+ DiskId="1" Source="C:\\distribution\\OpenRTP\\RTSystemEditor\\plugins\\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\\META-INF\\MANIFEST.MF">
+ </File>
+ </Component>
</Directory>
+
</Directory>
+
+
</Directory>
+
</Directory>
</Directory>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs.in
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs.in 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/OpenRTP_inc.wxs.in 2015-10-29 06:09:55 UTC (rev 738)
@@ -38,7 +38,52 @@
</File>
{% endfor %}
</Component>
+ <!-- org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610 -->
+ <Directory Id="openrtp_plugins_org_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" Name="org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610">
+ <Component Id="OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610" Guid="{% OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610.GUID %}">
+ {% for file in OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610.Files %}
+ <File Id="{% file.Id %}" Name="{% file.Name %}"
+ DiskId="1" Source="{% file.Source %}">
+ </File>
+ {% endfor %}
+ </Component>
+ <!-- META_INF -->
+ <Directory Id="_META_INF" Name="META_INF">
+ <Component Id="Meta_inf" Guid="{% OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf.GUID %}">
+ {% for file in OpenrtpPluginsOrg_eclipse_core_runtime_compatibility_registry_3_2_200_v20080610Meta_inf.Files %}
+ <File Id="{% file.Id %}" Name="{% file.Name %}"
+ DiskId="1" Source="{% file.Source %}">
+ </File>
+ {% endfor %}
+ </Component>
+ </Directory>
+ </Directory>
+ <!-- org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731 -->
+ <Directory Id="openrtp_plugins_org_eclipse_equinox_launcher_win32_win32_x86_1_0_101_R34x_v20080731" Name="org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731">
+ <Component Id="OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731" Guid="{% OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731.GUID %}">
+ {% for file in OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731.Files %}
+ <File Id="{% file.Id %}" Name="{% file.Name %}"
+ DiskId="1" Source="{% file.Source %}">
+ </File>
+ {% endfor %}
+ </Component>
+ <!-- META_INF -->
+ <Directory Id="openrtp_plugins_org_eclipse_equinox_launcher_win32_win32_x86_1_0_101_R34x_v20080731_META_INF" Name="META-INF">
+ <Component Id="Meta_inf_2" Guid="{% OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf.GUID %}">
+ {% for file in OpenrtpPluginsOrg_eclipse_equinox_launcher_win32_win32_x86_1_0_101_r34x_v20080731Meta_inf.Files %}
+ <File Id="{% file.Id %}" Name="{% file.Name %}"
+ DiskId="1" Source="{% file.Source %}">
+ </File>
+ {% endfor %}
+ </Component>
+ </Directory>
+
+ </Directory>
+
+
+
</Directory>
+
</Directory>
</Directory>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/openrtpwxs.py
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/openrtpwxs.py 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/OpenRTP/openrtpwxs.py 2015-10-29 06:09:55 UTC (rev 738)
@@ -18,10 +18,10 @@
("", "*.jar *.exe .eclipseproduct"),
("configuration", "*.ini *.jar"),
("plugins", "*.jar"),
-# ("plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610", "*.*"),
-# ("plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610/META-INF", "*.*"),
-# ("plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731", "*.*"),
-# ("plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731/META-INF", "*.*"),
+ ("plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610", "*.*"),
+ ("plugins/org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610/META-INF", "*.*"),
+ ("plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731", "*.*"),
+ ("plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731/META-INF", "*.*"),
]
import os
@@ -74,7 +74,7 @@
"-o", dir_name + ".yaml",
"-p", base_dir + path]
cmd += flist
- #print cmd
+
makewxs.main(cmd)
@@ -82,5 +82,5 @@
"-o", "OpenRTP_inc.wxs",
"-i", "OpenRTP_inc.wxs.in"]
cmd += glob.glob("*.yaml")
-#print "cmd:",cmd
+print "cmd:",cmd
makewxs.main(cmd)
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_hu-hu.wxl
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_hu-hu.wxl 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_hu-hu.wxl 2015-10-29 06:09:55 UTC (rev 738)
@@ -10,7 +10,7 @@
You must not remove this notice, or any other, from this software.
-->
-<WixLocalization Culture="hu-hu" Codepage="1250" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+<WixLocalization Culture="hu-hu" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="WixUIBack" Overridable="yes">&Vissza</String>
<String Id="WixUINext" Overridable="yes">&Tov叩bb</String>
<String Id="WixUICancel" Overridable="yes">&M辿gse</String>
@@ -596,4 +596,4 @@
<String Id="UITextVolumeCostRequired" Overridable="yes">Sz端ks辿ges</String>
<String Id="UITextVolumeCostSize" Overridable="yes">Lemez m辿rete</String>
<String Id="UITextVolumeCostVolume" Overridable="yes">K旦tet</String>
-</WixLocalization>
+</WixLocalization>
\ No newline at end of file
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ja-jp.wxl
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ja-jp.wxl 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ja-jp.wxl 2015-10-29 06:09:55 UTC (rev 738)
@@ -2,7 +2,7 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
-->
-<WixLocalization Culture="ja-jp" Codepage="932" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+<WixLocalization Culture="ja-jp" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="WixUIBack" Overridable="yes">æ»ã(&B)</String>
<String Id="WixUINext" Overridable="yes">次ã¸(&N)</String>
<String Id="WixUICancel" Overridable="yes">ãã£ã³ã»ã«</String>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ko-kr.wxl
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ko-kr.wxl 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_ko-kr.wxl 2015-10-29 06:09:55 UTC (rev 738)
@@ -2,7 +2,7 @@
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
-->
-<WixLocalization Culture="ko-kr" Codepage="949" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+<WixLocalization Culture="ko-kr" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="WixUIBack" Overridable="yes">ë¤ë¡(&B)</String>
<String Id="WixUINext" Overridable="yes">ë¤ì(&N)</String>
<String Id="WixUICancel" Overridable="yes">ì·¨ì</String>
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_zh-tw.wxl
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_zh-tw.wxl 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/WixUI_zh-tw.wxl 2015-10-29 06:09:55 UTC (rev 738)
@@ -10,7 +10,7 @@
You must not remove this notice, or any other, from this software.
-->
-<WixLocalization Culture="zh-tw" Codepage="950" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+<WixLocalization Culture="zh-tw" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="WixUIBack" Overridable="yes">ä¸ä¸æ¥(&B)</String>
<String Id="WixUINext" Overridable="yes">ä¸ä¸æ¥(&N)</String>
<String Id="WixUICancel" Overridable="yes">åæ¶</String>
@@ -565,4 +565,4 @@
<String Id="UITextVolumeCostRequired" Overridable="yes">æé</String>
<String Id="UITextVolumeCostSize" Overridable="yes">ç£ç¢ç©ºé</String>
<String Id="UITextVolumeCostVolume" Overridable="yes">ç®é</String>
-</WixLocalization>
+</WixLocalization>
\ No newline at end of file
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/build.cmd
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/build.cmd 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/installer/win32/build.cmd 2015-10-29 06:09:55 UTC (rev 738)
@@ -3,24 +3,12 @@
@rem Variable Settings
@rem usually only %TARGET% might be changed
@rem ------------------------------------------------------------
-if not DEFINED ARCH set ARCH=x86_64
-if not DEFINED INCLUDE_JRE set INCLUDE_JRE=YES
- at set PATH_OLD=%PATH%
- at set INCLUDE_OPENRTP=YES
+ at set PATH=%WIX%\bin;%PATH%
@set VERSION=1.1.0
@set TARGET=OpenRTM-aist-Java
@set TARGET_WXS=%TARGET%.wxs
@set TARGET_WIXOBJ=%TARGET%.wixobj
- at set TARGET_FULL=%TARGET%_%VERSION%-RELEASE_%ARCH%
-if "x%ARCH%" == "xx86_64" (
- @set PYTHON_DIR=C:\Python27_x64
- @set OS_ARCH=64-bit OS
-) else (
- @set PYTHON_DIR=C:\Python27
- @set OS_ARCH=32-bit OS
-)
- at set PATH=%WIX%bin;%PYTHON_DIR%;%PATH%
- at set PRODUCT_NAME=OpenRTM-aist-%VERSION%-RELEASE (%OS_ARCH%) for Java
+ at set TARGET_FULL=%TARGET%-%VERSION%
@rem ------------------------------------------------------------
@rem WixUI Customization Settings
@@ -59,32 +47,30 @@
@rem RTSystemEditorRCP.exe should be under %RTSE_ROOT%
@rem
@rem ------------------------------------------------------------
- at rem *** RTSystemEditorRCP has been changed to use the merge module.
- at rem *** So this process has been deleted.
- at rem if "x%RTSE_ROOT%" == "x" (
- at rem echo Envrionment variable "RTSE_ROOT" is not set. Abort.
- at rem goto END
- at rem )
- at rem if not exist "%RTSE_ROOT%\RTSystemEditorRCP.exe" (
- at rem echo RTSystemEditorRCP.exe does not found. Abort
- at rem goto END
- at rem )
- at rem set INCLUDE_RTSE=YES
- at rem set INCLUDE_OPENRTP=YES
- at rem
- at rem if not exist OpenRTP_inc.wxs (
- at rem cd OpenRTP
- at rem rem set TMP_PYTHONPATH=%PYTHONPATH%
- at rem rem set PYTHONPATH=../;../../bin;%PYTHONPATH%
- at rem rem echo Generating OpenRTP_inc.wxs......
- at rem rem openrtpwxs.py
- at rem rem set PYTHONPATH=%TMP_PYTHONPATH%
- at rem copy OpenRTP_inc.wxs ..
- at rem cd ..
- at rem )
+if "x%RTSE_ROOT%" == "x" (
+ echo Envrionment variable "RTSE_ROOT" is not set. Abort.
+ goto END
+)
+if not exist "%RTSE_ROOT%\RTSystemEditorRCP.exe" (
+ echo RTSystemEditorRCP.exe does not found. Abort
+ goto END
+)
+set INCLUDE_RTSE=YES
+set INCLUDE_OPENRTP=YES
+if not exist OpenRTP_inc.wxs (
+ cd OpenRTP
+rem set TMP_PYTHONPATH=%PYTHONPATH%
+rem set PYTHONPATH=../;../../bin;%PYTHONPATH%
+rem echo Generating OpenRTP_inc.wxs......
+rem openrtpwxs.py
+rem set PYTHONPATH=%TMP_PYTHONPATH%
+ copy OpenRTP_inc.wxs ..
+ cd ..
+)
+
@rem ------------------------------------------------------------
@rem Import Language-Country, Language codes, Codepages
@rem from langs.txt
@@ -104,11 +90,7 @@
@rem ============================================================
@rem compile wxs file and link msi
@rem ============================================================
-if "x%ARCH%" == "xx86_64" (
- candle.exe -arch x64 %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=1033 -dcodepage=1252
-) else (
- candle.exe %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=1033 -dcodepage=1252
-)
+candle.exe %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=1033 -dcodepage=1252
light.exe -ext WixUIExtension -loc WixUI_en-us.wxl ^
-out %TARGET_FULL%.msi %TARGET_WIXOBJ% %WIXUI_RTM_WIXOBJ%
@@ -125,11 +107,7 @@
@rem ------------------------------------------------------------
@rem compile wxs file and link msi
@rem
- if "x%ARCH%" == "xx86_64" (
- candle.exe -arch x64 %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=!LANG[%%i]! -dcodepage=!CODE[%%i]!
- ) else (
- candle.exe %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=!LANG[%%i]! -dcodepage=!CODE[%%i]!
- )
+ candle.exe %TARGET_WXS% %WIXUI_RTM_WXS% -dlanguage=!LANG[%%i]! -dcodepage=!CODE[%%i]!
if exist WixUI_!LC[%%i]!.wxl (
light.exe -ext WixUIExtension -loc WixUI_!LC[%%i]!.wxl ^
@@ -166,7 +144,4 @@
:END
del *.yaml
- at set PATH=%PATH_OLD%
- at rem pause;
-
Copied: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java (from rev 731, branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java)
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java (rev 0)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/CorbaObjectManager.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -0,0 +1,81 @@
+package jp.go.aist.rtm.RTC;
+
+import jp.go.aist.rtm.RTC.executionContext.ExecutionContextBase;
+
+import org.omg.CORBA.ORB;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.Servant;
+import org.omg.PortableServer.POAPackage.ObjectNotActive;
+import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
+import org.omg.PortableServer.POAPackage.ServantNotActive;
+import org.omg.PortableServer.POAPackage.WrongPolicy;
+
+import RTC.ExecutionContextServiceHelper;
+import RTC.RTObjectHelper;
+
+
+/**
+ * <p>CorbaObjectManagerã¯ã©ã¹ã§ãã
+ * CORBA ãªãã¸ã§ã¯ããã¢ã¯ãã£ãåãéã¢ã¯ãã£ãåãã¾ãã</p>
+ */
+class CorbaObjectManager {
+ /**
+ * <p>ã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
+ *
+ * @param orbãORB
+ * @param poaãPOA
+ */
+ public CorbaObjectManager(ORB orb, POA poa) {
+ m_pPOA = poa;
+ }
+
+ /**
+ * <p>CORBA ãªãã¸ã§ã¯ã(RTObjct)ãã¢ã¯ãã£ãåãã¾ãã</p>
+ *
+ * @param comp ã¢ã¯ãã£ãå対象RTObject
+ *
+ * @exception ServantAlreadyActive 対象Servantããã§ã«activateæ¸ã¿
+ * @exception WrongPolicy POA ã§ãµãã¼ãããã¦ããªãããªã·ã¼ã使ç¨
+ * @exception ObjectNotActive æå®ããã oid ãæã¤ãªãã¸ã§ã¯ãã Active Object Map ã«ãªãå ´å
+ */
+ public void activate(RTObject_impl comp)
+ throws ServantAlreadyActive, WrongPolicy, ObjectNotActive {
+ if( comp.m_objref==null ) {
+ byte[] id = m_pPOA.activate_object(comp);
+ comp.setObjRef(RTObjectHelper.narrow(m_pPOA.id_to_reference(id)));
+ }
+ }
+
+ /**
+ * <p>CORBA ãªãã¸ã§ã¯ã(ExecutionContext)ãã¢ã¯ãã£ãåãã¾ãã</p>
+ *
+ * @param comp ã¢ã¯ãã£ãå対象ExecutionContext
+ *
+ * @exception ServantAlreadyActive 対象Servantããã§ã«activateæ¸ã¿
+ * @exception WrongPolicy POA ã§ãµãã¼ãããã¦ããªãããªã·ã¼ã使ç¨
+ * @exception ObjectNotActive æå®ããã oid ãæã¤ãªãã¸ã§ã¯ãã Active Object Map ã«ãªãå ´å
+ */
+ public void activate(ExecutionContextBase comp) throws ServantAlreadyActive, WrongPolicy, ObjectNotActive {
+ byte[] id = m_pPOA.activate_object(comp);
+ comp.setObjRef(ExecutionContextServiceHelper.narrow(m_pPOA.id_to_reference(id)));
+ }
+ /**
+ * <p>CORBA ãªãã¸ã§ã¯ããéã¢ã¯ãã£ãåãã¾ãã</p>
+ *
+ * @param comp éã¢ã¯ãã£ãå対象ãªãã¸ã§ã¯ã
+ *
+ * @exception ServantAlreadyActive 対象Servantãactivateåããã¦ããªã
+ * @exception WrongPolicy POA ã§ãµãã¼ãããã¦ããªãããªã·ã¼ã使ç¨
+ * @exception ObjectNotActive æå®ããã oid ãæã¤ãªãã¸ã§ã¯ãã Active Object Map ã«ãªãå ´å
+ *
+ */
+ public void deactivate(Servant comp) throws ServantNotActive, WrongPolicy, ObjectNotActive {
+ byte[] id = m_pPOA.servant_to_id(comp);
+ m_pPOA.deactivate_object(id);
+ }
+
+ /**
+ * POA
+ */
+ private POA m_pPOA;
+}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -50,9 +50,7 @@
"corba.nameservice.replace_endpoint", "NO",
"exec_cxt.periodic.type", "jp.go.aist.rtm.RTC.executionContext.PeriodicExecutionContext",
"exec_cxt.periodic.rate", "1000",
- "exec_cxt.sync_transition", "YES",
- "exec_cxt.transition_timeout", "0.5",
- //"exec_cxt.evdriven.type", "jp.go.aist.rtm.RTC.executionContext.EventDrivenExecutionContext",
+ "exec_cxt.evdriven.type", "jp.go.aist.rtm.RTC.executionContext.EventDrivenExecutionContext",
"manager.modules.load_path", "./",
"manager.modules.abs_path_allowed", "YES",
"manager.is_master", "NO",
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/FactoryGlobal.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -2,7 +2,6 @@
import java.lang.reflect.Constructor;
-import java.util.ArrayList;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Iterator;
@@ -188,7 +187,6 @@
* {@.en Map of FactoryEntry}
*/
protected HashMap<IDENTIFIER, FactoryEntry> m_creators = new HashMap<IDENTIFIER, FactoryEntry>();
- private HashMap<ABSTRACTCLASS, FactoryEntry> m_objects = new HashMap<ABSTRACTCLASS, FactoryEntry>();
/**
* {@.ja Identifierããããã«åå¨ããããã§ãã¯ããã}
@@ -235,7 +233,7 @@
if (m_creators.containsKey(id)){
return ReturnCode.ALREADY_EXISTS;
}
- FactoryEntry f = new FactoryEntry(id, creator, destructor);
+ FactoryEntry f = new FactoryEntry(creator, destructor);
m_creators.put(id,f);
return ReturnCode.FACTORY_OK;
}
@@ -280,9 +278,7 @@
if (!m_creators.containsKey(id)){
return null;
}
- ABSTRACTCLASS obj = m_creators.get(id).creator_.creator_();
- m_objects.put(obj, m_creators.get(id));
- return obj;
+ return m_creators.get(id).creator_.creator_();
}
/**
* {@.ja ãªãã¸ã§ã¯ãåé¤ã}
@@ -300,13 +296,11 @@
* {@.en Deleteed object.}
*
*/
- public ReturnCode deleteObject(final IDENTIFIER id, ABSTRACTCLASS obj) {
+ public void deleteObject(final IDENTIFIER id, ABSTRACTCLASS obj) {
if (!m_creators.containsKey(id)){
- return deleteObject(obj);
+ return ;
}
m_creators.get(id).destructor_.destructor_(obj);
- m_objects.remove(obj);
- return ReturnCode.FACTORY_OK;
}
/**
* {@.ja ãªãã¸ã§ã¯ãåé¤ã}
@@ -320,127 +314,15 @@
* {@.ja åé¤ãããªãã¸ã§ã¯ã}
* {@.en Deleteed object.}
*/
- public ReturnCode deleteObject(ABSTRACTCLASS obj) {
- if(!m_objects.containsKey(obj)) {
- return ReturnCode.NOT_FOUND;
- }
- m_objects.get(obj).destructor_.destructor_(obj);
- m_objects.remove(obj);
+ public void deleteObject(ABSTRACTCLASS obj) {
+ Iterator it = m_creators.keySet().iterator();
- return ReturnCode.FACTORY_OK;
- }
-
- /**
- * {@.ja çææ¸ã¿ãªãã¸ã§ã¯ããªã¹ãã®åå¾}
- * {@.en Getting created objects}
- * <p>
- * {@.ja ãã®ãã¡ã¯ããªã§çæããããªãã¸ã§ã¯ãã®ãªã¹ããåå¾ããã}
- * {@.en This operation returns a list of created objects by the factory.}
- *
- * @return
- * {@.ja çææ¸ã¿ãªãã¸ã§ã¯ããªã¹ã}
- * {@.en created object list}
- *
- */
- public ArrayList<ABSTRACTCLASS> createdObjects() {
- ArrayList<ABSTRACTCLASS> objects = new ArrayList<ABSTRACTCLASS>();
- Iterator it = m_objects.keySet().iterator();
while (it.hasNext()) {
- objects.add((ABSTRACTCLASS)it.next());
+ m_creators.get(it.next()).destructor_.destructor_(obj);
}
- return objects;
}
/**
- * {@.ja ãªãã¸ã§ã¯ãããã®ãã¡ã¯ããªã®çæç©ãã©ãã調ã¹ã}
- * {@.en Whether a object is a product of this factory}
- * <p>
- * @param obj
- * {@.ja 対象ãªãã¸ã§ã¯ã}
- * {@.en A target object}
- * @return
- * {@.ja true: ãã®ãã¡ã¯ããªã®çæç©
- * false: ãã®ãã¡ã¯ããªã®çæç©ã§ã¯ãªã}
- * {@.en true: The object is a product of the factory
- * false: The object is not a product of the factory}
- *
- */
- public boolean isProducerOf(ABSTRACTCLASS obj) {
- return m_objects.containsKey(obj);
- }
-
- /**
- * {@.ja ãªãã¸ã§ã¯ãããã¯ã©ã¹èå¥å(ID)ãåå¾ãã}
- * {@.en Getting class identifier (ID) from a object}
- * <p>
- * {@.ja å½è©²ãªãã¸ã§ã¯ãã®ã¯ã©ã¹èå¥å(ID)ãåå¾ããã}
- * {@.en This operation returns a class identifier (ID) from a object.}
- *
- * @param obj [in]
- * {@.ja ã¯ã©ã¹èå¥å(ID)ãåå¾ããããªãã¸ã§ã¯ã}
- * {@.en An object to investigate its class ID.}
- * @param id [out]
- * {@.ja ã¯ã©ã¹èå¥å(ID)}
- * {@.en Class identifier (ID)}
- * @return
- * {@.ja ãªã¿ã¼ã³ã³ã¼ã NOT_FOUND: èå¥åãåå¨ããªã
- * FACTORY_OK: æ£å¸¸çµäº}
- * {@.en Return code NOT_FOUND: ID not found
- * FACTORY_OK: normal return}
- */
- public ReturnCode objectToIdentifier(ABSTRACTCLASS obj, IDENTIFIER id) {
- if (!m_objects.containsKey(obj)) {
- return ReturnCode.NOT_FOUND;
- }
- id = m_objects.get(obj).id_;
- return ReturnCode.FACTORY_OK;
- }
-
- /**
- * {@.ja ãªãã¸ã§ã¯ãã®ã³ã³ã¹ãã©ã¯ã¿ãåå¾ãã}
- * {@.en Getting destructor of the object}
- * <p>
- * {@.ja ãã®ãã¡ã¯ããªã§çæããããªãã¸ã§ã¯ãã®ã³ã³ã¹ãã©ã¯ã¿ãåå¾ããã
- * obj ã¯ãã®ãã¡ã¯ããªã§çæããããã®ã§ãªããã°ãªããªããäºã
- * isProducerOf() é¢æ°ã§å½è©²ãªãã¸ã§ã¯ãããã®ãã¡ã¯ããªã®çæç©ã§
- * ãããã©ããããã§ãã¯ããªããã°ãªããªãã}
- * {@.en This operation returns a constructor of the object created by
- * the factory. obj must be a product of the factory. User must
- * check if the object is a product of the factory by using
- * isProducerOf()-function, before using this function.}
- *
- * @return
- * {@.ja ãªãã¸ã§ã¯ãã®ãã¹ãã©ã¯ã¿}
- * {@.en destructor of the object}
- *
- */
- public ObjectCreator objectToCreator(ABSTRACTCLASS obj) {
- return m_objects.get(obj).creator_;
- }
-
- /**
- * {@.ja ãªãã¸ã§ã¯ãã®ãã¹ãã©ã¯ã¿ãåå¾ãã}
- * {@.en Getting destructor of the object}
- * <p>
- * {@.ja ãã®ãã¡ã¯ããªã§çæããããªãã¸ã§ã¯ãã®ãã¹ãã©ã¯ã¿ãåå¾ããã
- * obj ã¯ãã®ãã¡ã¯ããªã§çæããããã®ã§ãªããã°ãªããªããäºã
- * isProducerOf() é¢æ°ã§å½è©²ãªãã¸ã§ã¯ãããã®ãã¡ã¯ããªã®çæç©ã§
- * ãããã©ããããã§ãã¯ããªããã°ãªããªãã}
- * {@.en This operation returns a destructor of the object created by
- * the factory. obj must be a product of the factory. User must
- * check if the object is a product of the factory by using
- * isProducerOf()-function, before using this function.}
- *
- * @return
- * {@.ja ãªãã¸ã§ã¯ãã®ãã¹ãã©ã¯ã¿}
- * {@.en destructor of the object}
- *
- */
- public ObjectDestructor objectToDestructor(ABSTRACTCLASS obj) {
- return m_objects.get(obj).destructor_;
- }
-
- /**
* {@.ja çæ/åé¤ã¤ã³ã¿ã¼ãã§ã¼ã¹ç®¡çç¨ã¯ã©ã¹}
* {@.en Class for creation/destruction interface management}
*/
@@ -461,10 +343,8 @@
* {@.ja åé¤ã¤ã³ã¿ã¼ãã§ã¼ã¹}
* {@.en Destruction interface}
*/
- public FactoryEntry(IDENTIFIER id,
- ObjectCreator creator,
- ObjectDestructor destructor) {
- id_ = id;
+ public FactoryEntry(ObjectCreator creator,
+ ObjectDestructor destructor) {
creator_ = creator;
destructor_ = destructor;
}
@@ -478,11 +358,6 @@
* {@.en Destruction interface variable}
*/
public ObjectDestructor destructor_;
- /**
- * {@.ja }
- * {@.en }
- */
- public IDENTIFIER id_;
};
/**
* {@.ja ãªã¿ã¼ã³ã³ã¼ã}
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/LoggerConsumer.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,118 +0,0 @@
-package jp.go.aist.rtm.RTC;
-
-import OpenRTM.Logger;
-import OpenRTM.LoggerHelper;
-
-import _SDOPackage.NVListHolder;
-
-import jp.go.aist.rtm.RTC.port.CorbaConsumer;
-import jp.go.aist.rtm.RTC.util.CallbackFunction;
-import jp.go.aist.rtm.RTC.util.NVUtil;
-import jp.go.aist.rtm.RTC.util.Properties;
- /**
- *
- *
- *
- */
-public class LoggerConsumer implements SdoServiceConsumerBase, CallbackFunction, ObjectCreator<SdoServiceConsumerBase>, ObjectDestructor{
- /**
- * {@.ja ctor of LoggerConsumer}
- * {@.en ctor of LoggerConsumer}
- */
- public LoggerConsumer(){
- m_rtobj = null;
- }
-
-
- /**
- * {@.ja åæå}
- * {@.en Initialization}
- */
- public boolean init(RTObject_impl rtobj,
- final _SDOPackage.ServiceProfile profile){
-
- if (!m_observer.setObject(LoggerHelper.narrow(profile.service))) {
- // narrowing failed
- return false;
- }
-
- m_rtobj = rtobj;
- m_profile = profile;
- //
- NVListHolder nvholder =
- new NVListHolder(profile.properties);
- Properties prop = new Properties();
- NVUtil.copyToProperties(prop, nvholder);
- return true;
- }
-
- /**
- * {@.ja ååæå}
- * {@.en Re-initialization}
- */
- public boolean reinit(final _SDOPackage.ServiceProfile profile){
- if (!m_observer._ptr()._is_equivalent(profile.service)) {
- CorbaConsumer<Logger> tmp = new CorbaConsumer<Logger>();
- if (!tmp.setObject(profile.service)) {
- return false;
- }
- m_observer.releaseObject();
- m_observer.setObject(profile.service);
- }
- m_profile= profile;
- //
- NVListHolder nvholder =
- new NVListHolder(profile.properties);
- Properties prop = new Properties();
- NVUtil.copyToProperties(prop, nvholder);
- return true;
- }
-
- /**
- * {@.ja ServiceProfile ãåå¾ãã}
- * {@.en getting ServiceProfile}
- */
- public final _SDOPackage.ServiceProfile getProfile() {
- return m_profile;
- }
-
- /**
- * {@.ja çµäºå¦ç}
- * {@.en Finalization}
- */
- public void finalize(){
- }
- //============================================================
- // Heartbeat related functions
- /**
- * {@.ja }
- * {@.en }
- */
- public void doOperate(){
- }
-
- /**
- * <p> creator_ </p>
- *
- * @return Object Created instances
- *
- */
- public SdoServiceConsumerBase creator_() {
- return new ComponentObserverConsumer();
- }
- /**
- * <p> destructor_ </p>
- *
- * @param obj The target instances for destruction
- *
- */
- public void destructor_(Object obj) {
- obj = null;
- }
- private RTObject_impl m_rtobj;
- private _SDOPackage.ServiceProfile m_profile;
- private CorbaConsumer<OpenRTM.Logger> m_observer =
- new CorbaConsumer<OpenRTM.Logger>(OpenRTM.Logger.class);
-
-};
-
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 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -232,24 +232,6 @@
}
/**
- * {@.ja ããã¼ã¸ã£ã¤ã³ã¹ã¿ã³ã¹ãçææ¸ã¿ããã§ãã¯ã}
- * {@.en Check Manager Instance}
- *
- * <p>
- * {@.ja ããã¼ã¸ã£ã¤ã³ã¹ã¿ã³ã¹ãçææ¸ã¿ãã©ãã確èªããã}
- * {@.en Check manager instance}
- *
- * @return
- * {@.ja Manager ã®å¯ä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã®æç¡}
- * {@.en Existence of the only instance reference of the manager}
- */
- public static boolean isActive() {
- if(manager==null)
- return false;
- return true;
- }
-
- /**
* {@.ja ããã¼ã¸ã£ã»ã·ã£ãããã¦ã³}
* {@.en Shutdown Manager}
*
@@ -981,14 +963,6 @@
"exec_cxt.periodic.type",
"exec_cxt.periodic.rate",
"exec_cxt.evdriven.type",
- "exec_cxt.sync_transition",
- "exec_cxt.sync_activation",
- "exec_cxt.sync_deactivation",
- "exec_cxt.sync_reset",
- "exec_cxt.transition_timeout",
- "exec_cxt.activation_timeout",
- "exec_cxt.deactivation_timeout",
- "exec_cxt.reset_timeout",
"logger.enable",
"logger.log_level",
"naming.enable",
@@ -998,11 +972,8 @@
};
for (int ic=0; inherit_prop[ic].length() != 0; ++ic) {
-
- String key = inherit_prop[ic];
- if (m_config.findNode(key) != null) {
- prop.setProperty(key,m_config.getProperty(key));
- }
+ prop.setProperty(inherit_prop[ic],
+ m_config.getProperty(inherit_prop[ic]));
}
comp = factory.create(this);
@@ -2008,8 +1979,6 @@
// Set date format for log entry header
rtcout.setDateFormat(m_config.getProperty("logger.date_format"));
- rtcout.setClockType(m_config.getProperty("logger.clock_type"));
-
// Loglevel was set from configuration file.
rtcout.setLevel(m_config.getProperty("logger.log_level"));
@@ -2079,7 +2048,7 @@
// Get the POAManager
m_pPOAManager = m_pPOA.the_POAManager();
- //m_objManager = new CorbaObjectManager(m_pORB, m_pPOA);
+ m_objManager = new CorbaObjectManager(m_pORB, m_pPOA);
} catch (Exception ex) {
rtcout.println(Logbuf.DEBUG,
@@ -2105,12 +2074,12 @@
* {@.en ORB launch options}
*/
protected String createORBOptions() {
-
+
String opt = m_config.getProperty("corba.args");
rtcout.println(Logbuf.DEBUG, "corba.args: "+opt);
String dumpString = new String();
- //dumpString = m_config._dump(dumpString, m_config, 0);
- //rtcout.println(Logbuf.DEBUG, dumpString);
+ dumpString = m_config._dump(dumpString, m_config, 0);
+ rtcout.println(Logbuf.DEBUG, dumpString);
Vector<String> endpoints = new Vector<String>();
@@ -2577,8 +2546,7 @@
for (int i=0, len=m_ecs.size(); i < len; ++i) {
try {
- //m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_ecs.elementAt(i).getObjRef()));
- m_pPOA.deactivate_object(m_pPOA.servant_to_id((RTC.ExecutionContextServicePOA)m_ecs.get(i)));
+ m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_ecs.elementAt(i)));
} catch (Exception e) {
rtcout.println(Logbuf.DEBUG, "Exception: Caught unknown Exception in Manager.shutdownComponents().");
@@ -2703,7 +2671,7 @@
Properties temp = m_config.getNode(category + "." + type_name);
Vector<String> keys = temp.propertyNames();
int length = keys.size();
- if (!(length == 1 && keys.get(length-1).equals("config_file"))) {
+ 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.");
@@ -3137,7 +3105,7 @@
* {@.ja CORBA Object Manager}
* {@.en CORBA Object Manager}
*/
- //protected CorbaObjectManager m_objManager;
+ protected CorbaObjectManager m_objManager;
/**
* {@.ja Timer Object}
* {@.en Timer Object}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ModuleManager.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -212,7 +212,8 @@
}
file = new File(fullClassName);
if(file.isAbsolute()){
- URLClassLoader url = createURLClassLoader(file.getParent());
+ URLClassLoader url
+ = createURLClassLoader(file.getParent());
if(url!=null){
String name = file.getName();
name = getModuleName(name);
@@ -344,8 +345,10 @@
try{
URI uri = path.toURI();
urls[0] = uri.toURL();
- } catch(java.net.MalformedURLException ex){
- rtcout.println(Logbuf.WARN, "java.net.MalformedURLException: toURL() threw Exception."+ex);
+ }
+ catch(java.net.MalformedURLException ex){
+ rtcout.println(Logbuf.WARN,
+ "java.net.MalformedURLException: toURL() threw Exception."+ex);
return null;
}
URLClassLoader url = new URLClassLoader(urls);
@@ -482,7 +485,7 @@
//
Method initMethod;
try {
- initMethod = target.getMethod(method_name, null);
+ initMethod = target.getMethod(method_name);
} catch (SecurityException e) {
throw e;
} catch (NoSuchMethodException e) {
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,436 +0,0 @@
-package jp.go.aist.rtm.RTC;
-
-import jp.go.aist.rtm.RTC.log.Logbuf;
-
-import RTC.ComponentAction;
-import RTC.ComponentActionHelper;
-import RTC.DataFlowComponentAction;
-import RTC.DataFlowComponentActionHelper;
-import RTC.FsmParticipantAction;
-import RTC.FsmParticipantActionHelper;
-import RTC.LifeCycleState;
-import RTC.LightweightRTObject;
-import RTC.MultiModeComponentAction;
-import RTC.MultiModeComponentActionHelper;
-import RTC.ReturnCode_t;
-
-public class RTObjectStateMachine {
- private static final int NUM_OF_LIFECYCLESTATE = 4;
- /**
- * {@.ja ã³ã³ã¹ãã©ã¯ã¿}
- * {@.en Constructor}
- *
- */
- public RTObjectStateMachine(int id, LightweightRTObject comp){
- m_id = id;
- m_rtobj = (LightweightRTObject)comp._duplicate();
- m_sm = new StateMachine<LifeCycleState,
- RTObjectStateMachine>(NUM_OF_LIFECYCLESTATE);
- m_ca = false;
- m_dfc = false;
- m_fsm = false;
- m_mode = false;
- m_caVar = null;
- m_dfcVar = null;
- m_fsmVar = null;
- m_modeVar = null;
- // Setting Action callback objects
- setComponentAction(comp);
- setDataFlowComponentAction(comp);
- setFsmParticipantAction(comp);
- setMultiModeComponentAction(comp);
- // Setting callback functions to StateMachine
- m_sm.setListener(this);
- m_sm.setEntryAction (LifeCycleState.ACTIVE_STATE,
- new onActivated());
- m_sm.setDoAction (LifeCycleState.ACTIVE_STATE,
- new onExecute());
- m_sm.setPostDoAction(LifeCycleState.ACTIVE_STATE,
- new onStateUpdate());
- m_sm.setExitAction (LifeCycleState.ACTIVE_STATE,
- new onDeactivated());
- m_sm.setEntryAction (LifeCycleState.ERROR_STATE,
- new onAborting());
- m_sm.setDoAction (LifeCycleState.ERROR_STATE,
- new onError());
- m_sm.setExitAction (LifeCycleState.ERROR_STATE,
- new onReset());
- // Setting inital state
- StateHolder<LifeCycleState> st = new StateHolder<LifeCycleState>();
- st.prev = LifeCycleState.INACTIVE_STATE;
- st.curr = LifeCycleState.INACTIVE_STATE;
- st.next = LifeCycleState.INACTIVE_STATE;
- m_sm.setStartState(st);
- m_sm.goTo(LifeCycleState.INACTIVE_STATE);
- }
- private RTObjectStateMachine(final RTObjectStateMachine rtobjsm){
- }
- /**
- * {@.ja onActivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onActivated implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_ca) {
- return;
- }
- if (m_caVar.on_activated(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- }
- /**
- * {@.ja onExecuteã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onExecute implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_dfc) {
- return;
- }
- if (m_dfcVar.on_execute(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- }
- /**
- * {@.ja onStateUpdateã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onStateUpdate implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_dfc) {
- return;
- }
- if (m_dfcVar.on_state_update(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- }
- /**
- * {@.ja onDeactivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onDeactivated implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_ca) {
- return;
- }
- m_caVar.on_deactivated(m_id);
- }
- }
- /**
- * {@.ja onAbortingã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onAborting implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_ca) {
- return;
- }
- m_caVar.on_error(m_id);
- }
- }
- /**
- * {@.ja onErrorã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onError implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_ca) {
- return;
- }
- m_caVar.on_error(m_id);
- }
- }
- /**
- * {@.ja onResetã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹}
- */
- private class onReset implements StateAction {
- public void doAction(StateHolder state) {
- if (!m_ca) {
- return;
- }
- if (m_caVar.on_reset(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- }
-
-
- // functions for stored RTObject reference
- /**
- *
- */
- public LightweightRTObject getRTObject() {
- return (LightweightRTObject)m_rtobj._duplicate();
- }
- /**
- *
- */
- public boolean isEquivalent(LightweightRTObject comp) {
- return m_rtobj._is_equivalent(comp);
- }
- /**
- *
- */
- public int getExecutionContextHandle() {
- return m_id;
- }
-
- // RTC::ComponentAction operations
- /**
- *
- */
- public void onStartup(){
- if (!m_ca) {
- return;
- }
- m_caVar.on_startup(m_id);
- }
- /**
- *
- */
- public void onShutdown(){
- if (!m_ca) {
- return;
- }
- m_caVar.on_shutdown(m_id);
- }
- /**
- *
- */
- public void onActivated(final StateHolder<LifeCycleState> st) {
- if (!m_ca) {
- return;
- }
- if (m_caVar.on_activated(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- *
- */
- public void onDeactivated(final StateHolder<LifeCycleState> st) {
- if (!m_ca) {
- return;
- }
- m_caVar.on_deactivated(m_id);
- }
- /**
- *
- */
- public void onAborting(final StateHolder<LifeCycleState> st) {
- if (!m_ca) {
- return;
- }
- m_caVar.on_error(m_id);
- }
- /**
- *
- */
- public void onError(final StateHolder<LifeCycleState> st){
- if (!m_ca) {
- return;
- }
- m_caVar.on_error(m_id);
- }
- /**
- *
- */
- public void onReset(final StateHolder<LifeCycleState> st){
- if (!m_ca) {
- return;
- }
- if (m_caVar.on_reset(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
-
- }
-
- // RTC::DataflowComponentAction
- /**
- *
- */
- public void onExecute(final StateHolder<LifeCycleState> st){
- if (!m_dfc) {
- return;
- }
- if (m_dfcVar.on_execute(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- *
- */
- public void onStateUpdate(final StateHolder<LifeCycleState> st){
- if (!m_dfc) {
- return;
- }
- if (m_dfcVar.on_state_update(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- *
- */
- public void onRateChanged(){
- if (!m_dfc) {
- return;
- }
- if (m_dfcVar.on_rate_changed(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
-
- // FsmParticipantAction
- /**
- *
- */
- public void onAction(final StateHolder<LifeCycleState> st){
- if (!m_fsm) {
- return;
- }
- if (m_fsmVar.on_action(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
-
- // MultiModeComponentAction
- /**
- *
- */
- public void onModeChanged(final StateHolder<LifeCycleState> st){
- if (!m_mode) {
- return;
- }
- if (m_modeVar.on_mode_changed(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
-
- // Getting state of the context
- /**
- *
- */
- public LifeCycleState getState(){
- return m_sm.getState();
- }
- /**
- *
- */
- public StateHolder<LifeCycleState> getStates(){
- return m_sm.getStates();
- }
- /**
- *
- */
- public boolean isCurrentState(LifeCycleState state){
- if(getState() == state){
- return true;
- }
- return false;
- }
- /**
- *
- */
- public boolean isNextState(LifeCycleState state){
- if(m_sm.getStates().next == state){
- return true;
- }
- return false;
- }
- /**
- *
- */
- public void goTo(LifeCycleState state){
- m_sm.goTo(state);
- }
-
- // Workers
- /**
- *
- */
- public void workerPreDo(){
- m_sm.worker_pre();
- }
- /**
- *
- */
- public void workerDo(){
- m_sm.worker_do();
- }
- /**
- *
- */
- public void workerPostDo(){
- m_sm.worker_post();
- }
-
- protected void setComponentAction(final LightweightRTObject comp) {
- m_caVar = ComponentActionHelper.narrow(comp);
- if (m_caVar!=null) {
- m_ca = true;
- }
- }
- protected void setDataFlowComponentAction(final LightweightRTObject comp){
- m_dfcVar = DataFlowComponentActionHelper.narrow(comp);
- if (m_dfcVar!=null) {
- m_dfc = true;
- }
- }
- protected void setFsmParticipantAction(final LightweightRTObject comp){
- m_fsmVar = FsmParticipantActionHelper.narrow(comp);
- if (m_fsmVar!=null) {
- m_fsm = true;
- }
- }
- protected void setMultiModeComponentAction(final LightweightRTObject comp){
- m_modeVar = MultiModeComponentActionHelper.narrow(comp);
- if (m_modeVar!=null) {
- m_mode = true;
- }
- }
-
- /**
- * {@.ja ãã¬ã¼ã¹ããªã¼ã }
- * {@.en Logger stream}
- */
- private Logbuf rtcout;
- // ExecutionContext id
- private int m_id;
- // Associated RTObject reference
- private LightweightRTObject m_rtobj;
- // State machine
- private StateMachine<LifeCycleState,
- RTObjectStateMachine> m_sm;
- private boolean m_ca;
- private boolean m_dfc;
- private boolean m_fsm;
- private boolean m_mode;
- private ComponentAction m_caVar;
- private DataFlowComponentAction m_dfcVar;
- private FsmParticipantAction m_fsmVar;
- private MultiModeComponentAction m_modeVar;
-
- // char dara[1000];
- // Component action invoker
-
-}
-
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,15 +1,10 @@
package jp.go.aist.rtm.RTC;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.Vector;
-import java.util.Set;
import java.lang.reflect.Method;
import jp.go.aist.rtm.RTC.SDOPackage.Configuration_impl;
import jp.go.aist.rtm.RTC.executionContext.ExecutionContextBase;
-import jp.go.aist.rtm.RTC.executionContext.ExecutionContextFactory;
import jp.go.aist.rtm.RTC.port.CorbaPort;
import jp.go.aist.rtm.RTC.port.InPort;
import jp.go.aist.rtm.RTC.port.InPortBase;
@@ -27,7 +22,6 @@
import jp.go.aist.rtm.RTC.util.ORBUtil;
import jp.go.aist.rtm.RTC.util.POAUtil;
import jp.go.aist.rtm.RTC.util.Properties;
-import jp.go.aist.rtm.RTC.util.StringUtil;
import jp.go.aist.rtm.RTC.util.ValueHolder;
import jp.go.aist.rtm.RTC.util.equalFunctor;
import jp.go.aist.rtm.RTC.util.operatorFunc;
@@ -660,42 +654,45 @@
if( !m_created ) {
return ReturnCode_t.PRECONDITION_NOT_MET;
}
+
+ String ec_args = new String();
- // EC creation
- ArrayList<Properties> ec_args = new ArrayList<Properties>() ;
- if (getContextOptions(ec_args)!=ReturnCode_t.RTC_OK )
- {
- rtcout.println(Logbuf.ERROR,"Valid EC options are not available. Aborting");
- return ReturnCode_t.BAD_PARAMETER;
-
+ ec_args += m_properties.getProperty("exec_cxt.periodic.type");
+ ec_args += "?";
+ ec_args += "rate=" + m_properties.getProperty("exec_cxt.periodic.rate");
+
+ ExecutionContextBase ec;
+ ec = Manager.instance().createContext(ec_args);
+ if (ec == null) {
+ return ReturnCode_t.RTC_ERROR;
}
- if(createContexts(ec_args)!=ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"EC creation failed. Maybe out of resources. Aborting.");
- return ReturnCode_t.OUT_OF_RESOURCES;
+ ec.set_rate(Double.valueOf(m_properties.getProperty("exec_cxt.periodic.rate")).doubleValue());
+ m_eclist.add(ec);
+ ExecutionContextService ecv;
+ ecv = ec.getObjRef();
+ if (ecv == null) {
+ return ReturnCode_t.RTC_ERROR;
}
+ ec.bindComponent(this);
- // -- entering alive state --
- rtcout.println(Logbuf.INFO,m_ecMine.value.length
- + " execution context"
- + (m_ecMine.value.length == 1 ? "was created." :"s were created." ));
-
ReturnCode_t ret;
ret = on_initialize();
m_created = false;
if( ret!=ReturnCode_t.RTC_OK ) {
- rtcout.println(Logbuf.ERROR, "on_Initialize() failed.");
return ret;
}
- rtcout.println(Logbuf.DEBUG,"on_initialize() was properly done.");
+ // -- entering alive state --
+ // at least one EC must be attached
+ if (m_ecMine.value.length == 0) {
+ return ReturnCode_t.PRECONDITION_NOT_MET;
+ }
for(int intIdx=0; intIdx < m_ecMine.value.length; ++intIdx) {
rtcout.println(Logbuf.DEBUG, "EC[" + intIdx + "] starting");
m_ecMine.value[intIdx].start();
}
// ret must be RTC_OK
- assert(ret == ReturnCode_t.RTC_OK);
return ret;
}
@@ -3918,16 +3915,10 @@
rtcout.println(Logbuf.TRACE, "RTObject_impl.finalizeContexts()");
for(int i=0, len=m_eclist.size(); i < len; ++i) {
- m_eclist.get(i).getObjRef().stop();
try {
- RTC.ExecutionContextServicePOA servant;
- servant = (RTC.ExecutionContextServicePOA)m_eclist.get(i);
-// m_eclist.elementAt(i).getObjRef().stop();
-// m_eclist.elementAt(i).finalizeExecutionContext();
-// m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_eclist.elementAt(i).getObjRef()));
- rtcout.println(Logbuf.DEBUG, "Deactivating Execution Context.");
- m_pPOA.deactivate_object(m_pPOA.servant_to_id(servant));
- rtcout.println(Logbuf.DEBUG, "Deactivating EC done.");
+ m_eclist.elementAt(i).stop();
+ m_eclist.elementAt(i).finalizeExecutionContext();
+ m_pPOA.deactivate_object(m_pPOA.servant_to_id(m_eclist.elementAt(i)));
}
catch(Exception ex) {
}
@@ -6107,253 +6098,8 @@
m_actionListeners.ecaction_[ExecutionContextActionListenerType.EC_DETACHED].notify(ec_id);
}
- protected ReturnCode_t getInheritedECOptions(Properties default_opts){
- final String inherited_opts[] =
- {
- "sync_transition",
- "sync_activation",
- "sync_deactivation",
- "sync_reset",
- "transition_timeout",
- "activation_timeout",
- "deactivation_timeout",
- "reset_timeout",
- ""
- };
- Properties node = m_properties.findNode("exec_cxt");
- if (node == null) {
- rtcout.println(Logbuf.WARN, "No exec_cxt option found.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG, "Copying inherited EC options.");
- for (int ic=0; inherited_opts[ic].length()<1; ++ic) {
- if (node.findNode(inherited_opts[ic]) != null) {
- rtcout.println(Logbuf.PARANOID, "Option "
- + inherited_opts[ic]
- + " exists.");
- default_opts.setProperty(inherited_opts[ic],
- node.getProperty(inherited_opts[ic]));
- }
- }
- return ReturnCode_t.RTC_OK;
- }
- /**
- * {@.ja getting individual EC options from RTC's configuration file}
- * {@.en getting individual EC options from RTC's configuration file}
- */
- protected ReturnCode_t
- getPrivateContextOptions(ArrayList<Properties> ec_args) {
- rtcout.println(Logbuf.TRACE, "getPrivateContextOptions()");
- // Component specific multiple EC option available
- if (m_properties.findNode("execution_contexts") == null) {
- rtcout.println(Logbuf.DEBUG, "No component specific EC specified.");
- return ReturnCode_t.RTC_ERROR;
- }
- String args = m_properties.getProperty("execution_contexts");
- ArrayList<String> ecs_tmp
- = new ArrayList(Arrays.asList(args.split(",")));
- if (ecs_tmp.isEmpty()) {
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,
- "Component specific e EC option available,"
- + args);
- Properties default_opts = new Properties();
- getInheritedECOptions(default_opts);
- for (int ic=0; ic < ecs_tmp.size(); ++ic) {
- if (StringUtil.normalize(ecs_tmp.get(ic)).equals("none")) {
- rtcout.println(Logbuf.INFO,
- "EC none. EC will not be bound to the RTC.");
- ec_args.clear();
- return ReturnCode_t.RTC_OK;
- }
- ArrayList<String> type_and_name
- = new ArrayList(Arrays.asList(ecs_tmp.get(ic).split("(")));
- if (type_and_name.size() > 2) {
- rtcout.println(Logbuf.DEBUG,
- "Invalid EC type specified: "
- + ecs_tmp.get(ic));
- continue;
- }
- Properties prop = default_opts;
- // create EC's properties
- prop.setProperty("type",type_and_name.get(0));
- rtcout.println(Logbuf.DEBUG,
- "p_type: "
- + prop.getProperty("type"));
- Properties p_type
- = m_properties.findNode("ec." + prop.getProperty("type"));
- if (p_type != null) {
- rtcout.println(Logbuf.DEBUG, "p_type props:");
- String str = new String();
- str = p_type._dump(str,p_type,0);
- prop.merge(p_type);
- }
- else {
- rtcout.println(Logbuf.DEBUG, "p_type none");
- }
-
- // EC name specified
- rtcout.println(Logbuf.DEBUG, "size: "
- + type_and_name.size()
- + "name: "
- + type_and_name.get(1));
- if (type_and_name.size() == 2 &&
- type_and_name.get(1).charAt(type_and_name.get(1).length() - 1) == ')') {
- type_and_name.set(1, type_and_name.get(1).substring(type_and_name.get(1).length() - 1));
- prop.setProperty("name", type_and_name.get(1));
- Properties p_name
- = m_properties.findNode("ec." + prop.getProperty("name"));
- if (p_name != null) {
- rtcout.println(Logbuf.DEBUG, "p_name props:");
- String str = new String();
- str = p_name._dump(str,p_name,0);
- prop.merge(p_name);
- }
- else {
- rtcout.println(Logbuf.DEBUG, "p_name none");
- }
- }
- ec_args.add(prop);
- rtcout.println(Logbuf.DEBUG, "New EC properties stored:");
- String str = new String();
- str = prop._dump(str,prop,0);
- }
- return ReturnCode_t.RTC_OK;
- }
-
/**
- * {@.ja getting global EC options from rtc.conf}
- * {@.en getting global EC options from rtc.conf}
- */
- protected ReturnCode_t
- getGlobalContextOptions(Properties global_ec_props){
- // exec_cxt option is obsolete
- rtcout.println(Logbuf.TRACE, "getGlobalContextOptions()");
-
- Properties prop = m_properties.findNode("exec_cxt.periodic");
- if (prop == null) {
- rtcout.println(Logbuf.WARN, "No global EC options found.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG, "Global EC options are specified.");
- String str = new String();
- str = prop._dump(str,prop,0);
- getInheritedECOptions(global_ec_props);
- global_ec_props.merge(prop);
- return ReturnCode_t.RTC_OK;
- }
-
- /**
- * {@.ja getting EC options}
- * {@.en getting EC options}
- */
- protected ReturnCode_t
- getContextOptions(ArrayList<Properties> ec_args) {
- rtcout.println(Logbuf.TRACE, "getContextOptions()");
- Properties global_props = new Properties();
- ReturnCode_t ret_global = getGlobalContextOptions(global_props);
- ReturnCode_t ret_private = getPrivateContextOptions(ec_args);
-
- // private(X), global(X) -> error
- // private(O), global(O) -> private
- // private(X), global(O) -> global
- // private(O), global(X) -> private
- if (ret_global != ReturnCode_t.RTC_OK
- && ret_private != ReturnCode_t.RTC_OK) {
- return ReturnCode_t.RTC_ERROR;
- }
- if (ret_global == ReturnCode_t.RTC_OK
- && ret_private != ReturnCode_t.RTC_OK) {
- ec_args.add(global_props);
- }
- return ReturnCode_t.RTC_OK;
- }
-
- /**
- * {@.ja fiding existing EC from the factory}
- * {@.en fiding existing EC from the factory}
- */
- protected ReturnCode_t findExistingEC(Properties ec_arg,
- ExecutionContextBase ec){
- ArrayList<ExecutionContextBase> eclist;
- eclist = ExecutionContextFactory.instance().createdObjects();
- for (int ic=0; ic < eclist.size(); ++ic) {
- if (eclist.get(ic).getProperties().getProperty("type").equals(ec_arg.getProperty("type")) &&
- eclist.get(ic).getProperties().getProperty("name").equals(ec_arg.getProperty("name"))) {
- ec = eclist.get(ic);
- return ReturnCode_t.RTC_OK;
- }
- }
- return ReturnCode_t.RTC_ERROR;
- }
- /**
- * {@.ja creating, initializing and binding context}
- * {@.en creating, initializing and binding context}
- */
- protected ReturnCode_t createContexts(ArrayList<Properties> ec_args){
- ReturnCode_t ret = ReturnCode_t.RTC_OK;
- Set<String> avail_ec
- = ExecutionContextFactory.instance().getIdentifiers();
- for (int ic=0; ic < ec_args.size(); ++ic) {
- String ec_type = ec_args.get(ic).getProperty("type");
- String ec_name = ec_args.get(ic).getProperty("name");
- ExecutionContextBase ec = null;
- // if EC's name exists, find existing EC in the factory.
- if (!(ec_name.length()<1) &&
- findExistingEC(ec_args.get(ic), ec) == ReturnCode_t.RTC_OK) {
- rtcout.println(Logbuf.DEBUG, "EC: type="
- + ec_type
- + ", name="
- + ec_name
- + " already exists.");
- }
- // If EC's name is empty or no existing EC, create new EC.
- else { // If EC's name is empty or no existing EC, create new EC.
- boolean find_flag = false;
- Iterator it = avail_ec.iterator();
- while (it.hasNext()) {
- if(it.next().equals(ec_type)){
- find_flag= true;
- break;
- }
- }
- if (!find_flag) {
- rtcout.println(Logbuf.WARN, "EC: "
- + ec_type
- + " is not available.");
- rtcout.println(Logbuf.DEBUG, "Available ECs: "
- + avail_ec.toString());
- continue;
- }
- ExecutionContextFactory<ExecutionContextBase,String> factory
- = ExecutionContextFactory.instance();
- ec = factory.createObject(ec_type);
-
- }
-
- // EC factory available but creation failed. Resource full?
- if (ec == null) {
- rtcout.println(Logbuf.ERROR, "EC ("
- + ec_type
- + ") creation failed.");
- rtcout.println(Logbuf.DEBUG, "Available EC list: "
- + avail_ec.toString());
- ret = ReturnCode_t.RTC_ERROR;
- continue;
- }
- rtcout.println(Logbuf.DEBUG, "EC ("
- + ec_type
- + ") created.");
-
- ec.init(ec_args.get(ic));
- m_eclist.add(ec);
- ec.bindComponent(this);
- }
- return ret;
- }
- /**
* {@.ja ããã¼ã¸ã£ãªãã¸ã§ã¯ã}
* {@.en Manager object}
*/
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/StateMachine.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/StateMachine.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/StateMachine.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -412,25 +412,6 @@
}
/**
- * {@.ja ç¶æ
ãåå¾ãã}
- * {@.en Gets states}
- * <p>
- * {@.ja ç¶æ
æ
å ±ãåå¾ããã
- * ç¾å¨ã®ç¶æ
ãï¼ã¤åã®ç¶æ
ãé·ç§»äºå®ã®ç¶æ
ãåå¾ãããã¨ãã§ããã}
- * {@.en Get state information.
- * Get the current state, the previous state and the next state to
- * be expected to transfer.}
- *
- * @return
- * {@.ja ç¶æ
æ
å ±}
- * {@.en State information}
- *
- */
- public StateHolder<STATE> getStates() {
- return m_states;
- }
-
- /**
* {@.ja ç¾å¨ã®ç¶æ
ãåå¾ãã}
* {@.en Get current state}
*
@@ -546,66 +527,7 @@
}
}
}
- //============================================================
- // divided worker functions
- // The following divided worker functions have to be used together.
- // - worker_pre()
- // - worker_do()
- // - worker_post()
- //
- public void worker_pre() {
- StateHolder state;
-
- synchronized (m_states) {
- state = new StateHolder(m_states);
- }
- if (state.curr == state.next) {
- if( m_predo.get(state.curr) != null ) {
- m_predo.get(state.curr).doAction(state);
- }
- return;
- }
- // State changed
- if( m_exit.get(state.curr) != null ) {
- m_exit.get(state.curr).doAction(state);
- }
-
- synchronized (m_states) {
- state = new StateHolder(m_states);
- }
- if( state.curr != state.next ) {
- state.curr = state.next;
- if( m_entry.get(state.curr)!=null ) {
- m_entry.get(state.curr).doAction(state);
- }
- update_curr((STATE)state.curr);
- }
- }
-
- public void worker_do() {
- StateHolder state;
-
- synchronized (m_states) {
- state = new StateHolder(m_states);
- }
- if( m_do.get(state.curr) != null ) {
- m_do.get(state.curr).doAction(state);
- }
-
- }
-
- public void worker_post() {
- StateHolder state;
-
- synchronized (m_states) {
- state = new StateHolder(m_states);
- }
- if( m_postdo.get(state.curr) != null ) {
- m_postdo.get(state.curr).doAction(state);
- }
- }
-
private boolean need_trans() {
synchronized (m_states) {
return m_states.curr != m_states.next;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/TimeMeasure.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -108,8 +108,8 @@
*
*/
public void tick() {
- double dtm = (double)System.nanoTime();
- m_begin.convert(dtm/1000000000.0); // [TimeValue]
+ double dtm = (double)System.currentTimeMillis();
+ m_begin.convert(dtm/1000); // [TimeValue]
}
@@ -124,8 +124,8 @@
if (m_begin.sec() == 0) {
return;
}
- double dtm = (double)System.nanoTime();
- m_interval.convert((dtm/1000000000.0) - m_begin.toDouble());
+ double dtm = (double)System.currentTimeMillis();
+ m_interval.convert((dtm/1000) - m_begin.toDouble());
m_record.set(m_count,m_interval);
++m_count;
if (m_count == m_countMax)
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 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/buffer/RingBuffer.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -225,6 +225,7 @@
*/
public ReturnCode write(final DataType value, int sec, int nsec) {
synchronized (m_full.mutex) {
+
if (full()) {
boolean timedwrite = m_timedwrite;
@@ -244,17 +245,15 @@
else if (!overwrite && timedwrite) { // "block" mode
if (sec < 0) {
sec =
- (int)(m_wtimeout.sec()*1000+m_wtimeout.usec()/1000);
- nsec = (int)(m_wtimeout.usec() % 1000)*1000;
+ (int)(m_rtimeout.sec()*1000+m_rtimeout.usec()/1000);
+ nsec = (int)(m_rtimeout.usec() % 1000)*1000;
}
try {
if(sec==0 && nsec==0){
return ReturnCode.TIMEOUT;
}
m_full.mutex.wait(sec, (int)nsec);
- if (full()) {
- return ReturnCode.TIMEOUT;
- }
+ return ReturnCode.TIMEOUT;
}
catch(InterruptedException e ){
throw new RuntimeException(e.toString());
@@ -267,21 +266,20 @@
return ReturnCode.PRECONDITION_NOT_MET;
}
}
-
+
+ boolean empty_ = empty();
+
put(value);
synchronized (m_empty.mutex) {
- if (empty()) {
- advanceWptr(1);
+ advanceWptr(1);
+ if (empty_) {
try {
m_empty.mutex.notify();
}
catch(IllegalMonitorStateException e) {
}
}
- else {
- advanceWptr(1);
- }
}
return ReturnCode.BUFFER_OK;
}
@@ -424,15 +422,8 @@
return ReturnCode.BUFFER_EMPTY;
}
else if (!readback && timedread) { // "block" mode
- if (sec < 0) {
- local_msec =
- (int)(m_rtimeout.sec()*1000+m_rtimeout.usec()/1000);
- local_nsec = (int)(m_rtimeout.usec() % 1000)*1000;
- }
+ // true: signaled, false: timeout
try {
- if(local_msec==0 && local_nsec==0){
- return ReturnCode.TIMEOUT;
- }
m_empty.mutex.wait(local_msec, local_nsec);
if (empty()) {
return ReturnCode.TIMEOUT;
@@ -454,20 +445,19 @@
}
}
+ boolean full_ = full();
+
get(valueRef);
synchronized(m_full.mutex){
- if (full()) {
- advanceRptr(1);
+ advanceRptr(1);
+ if (full_) {
try {
m_full.mutex.notify();
}
catch(IllegalMonitorStateException e) {
}
}
- else {
- advanceRptr(1);
- }
}
return ReturnCode.BUFFER_OK;
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextBase.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -5,46 +5,29 @@
import RTC.ExecutionContextService;
import OpenRTM.ExtTrigExecutionContextServicePOA;
-import jp.go.aist.rtm.RTC.RTObjectStateMachine;
import jp.go.aist.rtm.RTC.RTObject_impl;
-import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.Properties;
-import jp.go.aist.rtm.RTC.util.TimeValue;
-import RTC.ExecutionKind;
-import RTC.LifeCycleState;
-import RTC.LightweightRTObject;
import RTC.ReturnCode_t;
-import RTC.RTObject;
/**
* <p>Periodic Sampled Data Processing(å¨æå®è¡ç¨)ExecutionContextã®ãã¼ã¹ã¨ãªã
* æ½è±¡ã¯ã©ã¹ã§ãã</p>
*/
-//public abstract class ExecutionContextBase
-// implements ECNewDeleteFunc {
-public interface ExecutionContextBase extends ECNewDeleteFunc {
+public abstract class ExecutionContextBase extends
+ ExtTrigExecutionContextServicePOA implements ECNewDeleteFunc {
/**
- * {@.ja ExecutionContextã¯ã©ã¹ã®åæåé¢æ°}
- * {@.en Initialization function of ExecutionContext class}
+ * <p>ExecutionContextã®å¦çãï¼å¨æåé²ãã¾ãã</p>
*/
- public void init(Properties props);
-
+ public void tick() throws SystemException {
+ }
+
/**
- * {@.ja CORBA ãªãã¸ã§ã¯ãã®è¨å®}
- * {@.en Sets the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ããè¨å®ããã}
- * {@.en Sets the reference to the CORBA object as
- * ExecutioncontextService of this object.}
- *
- * @param ref
- * {@.ja ãªãã¸ã§ã¯ããªãã¡ã¬ã³ã¹}
- * {@.en The object reference}
- *
+ * <p>æ¬ãªãã¸ã§ã¯ãã®ExecutionContextServiceã¨ãã¦ã®CORBAãªãã¸ã§ã¯ãåç
§ãè¨å®ãã¾ãã</p>
+ *
+ * @param ref CORBAãªãã¸ã§ã¯ãåç
§
*/
- public void setObjRef(final ExecutionContextService ref);
+ public void setObjRef(final ExecutionContextService ref) {
+ }
/**
* <p> bindComponent </p>
@@ -53,258 +36,16 @@
* @return ReturnCode_t
*
*/
- public ReturnCode_t bindComponent(RTObject_impl rtc);
+ public abstract ReturnCode_t bindComponent(RTObject_impl rtc);
/**
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§ã®åå¾}
- * {@.en Get the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ãåç
§ãåå¾ããã}
- * {@.en Get the reference to the CORBA object as
- * ExecutioncontextService of this object.}
+ * <p> getObjRef </p>
*
- * @return
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§}
- * {@.en The reference to CORBA object}
- *
+ * @return ExecutionContextService
+ *
*/
- public ExecutionContextService getObjRef();
+ public abstract ExecutionContextService getObjRef();
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãè¨å®ãã}
- * {@.en Set execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãè¨å®ã
- * ããå®è¡å¨æã®å¤æ´ã¯ãDataFlowComponentAction ã®
- * on_rate_changed ã«ãã£ã¦åRTã³ã³ãã¼ãã³ãã«ä¼éãããã}
- * {@.en This operation shall set the rate (in hertz) at which this
- * contextâs Active participating RTCs are being called. If the
- * execution kind of the context is PERIODIC, a rate change shall
- * result in the invocation of on_rate_changed on any RTCs
- * realizing DataFlowComponentAction that are registered with any
- * RTCs participating in the context.}
- *
- * @param rate
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã
- * RTC_OK: æ£å¸¸çµäº
- * BAD_PARAMETER: è¨å®å¤ãè² ã®å¤}
- * {@.en The return code of ReturnCode_t type
- * RTC_OK: Succeed
- * BAD_PARAMETER: Invalid value. The value might be negative.}
- *
- */
- public ReturnCode_t setRate(double rate);
+ public abstract boolean finalizeExecutionContext();
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãåå¾ãã}
- * {@.en Get execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãåå¾ã
- * ãã}
- * {@.en This operation shall return the rate (in hertz) at which its
- * Active participating RTCs are being invoked.}
- *
- * @return
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- */
- public double getRate();
-
- /**
- * {@.ja ExecutionKind ãæåååãã}
- * {@.en Converting ExecutionKind enum to string}
- * <p>
- * {@.ja RTC::ExecutionKind ã§å®ç¾©ããã¦ãã PERIODIC, EVENT_DRIVEN,
- * OTHER ãæåååããã}
- * {@.en This function converts enumeration (PERIODIC, EVENT_DRIVEN,
- * OTHER) defined in RTC::ExecutionKind to string.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- * @return
- * {@.ja æåååãããExecutionKind}
- * {@.en String of ExecutionKind}
- *
- */
- public String getKindString(ExecutionKind kind);
-
- /**
- * {@.ja ExecutionKind ãè¨å®ãã}
- * {@.en Set the ExecutionKind}
- * <p>
- * {@.ja ãã® ExecutionContext ã® ExecutionKind ãè¨å®ãã}
- * {@.en This operation sets the kind of the execution context.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- */
- public ReturnCode_t setKind(ExecutionKind kind);
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ããã»ããããã}
- * {@.en Setting owner component of the execution context}
- * <p>
- * {@.ja ãã®ECã®Ownerã¨ãªãRTCãã»ããããã}
- * {@.en This function sets an RT-Component to be owner of
- * the execution context.}
- *
- * @param comp
- * {@.ja Ownerã¨ãªãRTã³ã³ãã¼ãã³ã}
- * {@.en an owner RT-Component of this execution context}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t setOwner(LightweightRTObject comp);
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ãã®åç
§ãåå¾ãã}
- * {@.en Getting a reference of the owner component}
- * <p>
- * {@.ja ãã®ECã®Ownerã§ããRTCã®åç
§ãåå¾ããã}
- * {@.en This function returns a reference of the owner RT-Component of
- * this execution context}
- *
- * @return
- * {@.ja OwnerRTã³ã³ãã¼ãã³ãã®åç
§}
- * {@.en a reference of the owner RT-Component}
- */
- public RTObject getOwner();
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã®åå è
ãªã¹ããåå¾ãã}
- * {@.en Getting participant RTC list}
- * <p>
- * {@.ja ç¾å¨ç»é²ããã¦ããåå è
RTCã®ãªã¹ããåå¾ããã}
- * {@.en This function returns a list of participant RTC of
- * the execution context.}
- *
- * @return
- * {@.ja åå è
RTCã®ãªã¹ã}
- * {@.en Participants RTC list}
- *
- */
- public RTObject[] getComponentList();
-
- /**
- * {@.ja Propertiesãã»ãããã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãã»ããããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * coil::Properties.}
- *
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public void setProperties(Properties props);
-
- /**
- * {@.ja Propertiesãåå¾ãã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãåå¾ããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * coil::Properties.}
- *
- * @return
- * {@.ja Propertiesã«å¤æããã ExecutionContextProfile::properties}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public Properties getProperties();
-
- /**
- * {@.ja Profileãåå¾ãã}
- * {@.en Getting Profile}
- * <p>
- * {@.ja ExecutionContextProfile ãåå¾ããã}
- * {@.en This function gets RTC::ExecutionContextProfile.}
- *
- * @return
- * {@.ja RTC.ExecutionContextProfile}
- * {@.en RTC.ExecutionContextProfile}
- *
- */
- public RTC.ExecutionContextProfile getProfile() ;
- public boolean finalizeExecutionContext();
- /**
- * {@.ja Propertiesããå®è¡ã³ã³ããã¹ããã»ãããã}
- * {@.en Setting execution rate from given properties.}
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- */
- public boolean setExecutionRate(Properties props);
- /**
- * {@.ja Propertiesããç¶æ
é·ç§»ã¢ã¼ããã»ãããã}
- * {@.en Setting state transition mode from given properties.}
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- * @param key
- * @param flag
- */
- public boolean setTransitionMode(Properties props, String key, boolean flag);
- /**
- * {@.ja Propertiesããç¶æ
é·ç§»Timeoutãã»ãããã}
- * {@.en Setting state transition timeout from given properties.}
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- * @param key
- * @param timevalue
- */
- public boolean setTimeout(Properties props, String key,TimeValue timevalue);
- public ReturnCode_t onStarted();
- public ReturnCode_t onStopping();
- public ReturnCode_t onStopped();
- public double onGetRate(double rate);
- public double onSettingRate(double rate);
- public ReturnCode_t onSetRate(double rate);
- public ReturnCode_t onAddingComponent(LightweightRTObject rtobj);
- public ReturnCode_t onAddedComponent(LightweightRTObject rtobj);
- public ReturnCode_t onRemovingComponent(LightweightRTObject rtobj);
- public ReturnCode_t onRemovedComponent(LightweightRTObject rtobj);
-
- // template virtual functions related to activation/deactivation/reset
- public ReturnCode_t onActivating(LightweightRTObject comp);
- public ReturnCode_t onActivated(RTObjectStateMachine comp, long count);
- public ReturnCode_t onDeactivating(LightweightRTObject comp);
- public ReturnCode_t onDeactivated(RTObjectStateMachine comp, long count);
- public ReturnCode_t onResetting(LightweightRTObject comp);
- public ReturnCode_t onReset(RTObjectStateMachine comp, long count);
-
- public LifeCycleState onGetComponentState(LifeCycleState state);
- public ExecutionKind onGetKind(ExecutionKind kind);
- public ExecutionContextProfile onGetProfile(ExecutionContextProfile profile);
-
- /**
- * {@.ja onWaitingActivated() template function}
- * {@.en onWaitingActivated() template function}
- */
- public ReturnCode_t onWaitingActivated(RTObjectStateMachine comp, long count);
-
- /**
- * {@.ja onWaitingDeactivated() template function}
- * {@.en onWaitingDeactivated() template function}
- */
- public ReturnCode_t onWaitingDeactivated(RTObjectStateMachine comp, long count);
-
- /**
- * {@.ja onWaitingReset() template function}
- * {@.en onWaitingReset() template function}
- */
- public ReturnCode_t onWaitingReset(RTObjectStateMachine comp, long count);
-
}
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextFactory.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextFactory.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextFactory.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,34 +0,0 @@
-package jp.go.aist.rtm.RTC.executionContext;
-
-import jp.go.aist.rtm.RTC.FactoryGlobal;
-/**
- * {@.ja ExecutionContextç¨ãã¡ã¯ããªã®å®è£
}
- * {@.en Implement of factory for ExecutionContext}
- */
-
-public class ExecutionContextFactory<ABSTRACTCLASS,IDENTIFIER> extends FactoryGlobal<ABSTRACTCLASS,IDENTIFIER> {
-
- /**
- * {@.ja ã³ã³ã¹ãã©ã¯ã¿ã}
- * {@.en Constructor}
- */
- private ExecutionContextFactory() {
-
- }
- /**
- * {@.ja ã¤ã³ã¹ã¿ã³ã¹çæã}
- * {@.en Create instance}
- *
- * <p>
- * {@.ja ã¤ã³ã¹ã¿ã³ã¹ãçæããã}
- *
- * @return
- * {@.ja ã¤ã³ã¹ã¿ã³ã¹}
- * {@.en ExecutionContextFactory object}
- *
- */
- public static ExecutionContextFactory instance() {
- return (ExecutionContextFactory)instance("jp.go.aist.rtm.RTC.executionContext.ExecutionContextFactory");
- }
-}
-
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextProfile.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextProfile.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextProfile.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,589 +0,0 @@
-package jp.go.aist.rtm.RTC.executionContext;
-
-import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
-import jp.go.aist.rtm.RTC.util.equalFunctor;
-import jp.go.aist.rtm.RTC.util.NVUtil;
-import jp.go.aist.rtm.RTC.util.Properties;
-import jp.go.aist.rtm.RTC.util.TimeValue;
-import RTC.ExecutionContextService;
-//import RTC.ExecutionContextProfile;
-import RTC.ExecutionKind;
-import RTC.ExecutionKindHolder;
-import RTC.LightweightRTObject;
-import RTC.ReturnCode_t;
-import RTC.RTCListHolder;
-import RTC.RTObject;
-import RTC.RTObjectHelper;
-import _SDOPackage.NVListHolder;
- /**
- * {@.ja ExecutionContextProfile ã¯ã©ã¹}
- * {@.en ExecutionContextProfile class}
- * <p>
- * {@.ja Periodic Sampled Data Processing(å¨æå®è¡ç¨)ExecutionContextã¯ã©ã¹ã}
- * {@.en Periodic Sampled Data Processing (for the execution cycles)
- * ExecutionContext class}
- */
-public class ExecutionContextProfile {
- public static final double DEEFAULT_PERIOD = 0.000001;
-
- /**
- * {@.ja ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿}
- * {@.en Default Constructor}
- * <p>
- * {@.ja ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿
- * ãããã¡ã¤ã«ã«ä»¥ä¸ã®é
ç®ãè¨å®ããã
- * - kind : PERIODIC
- * - rate : 0.0}
- * {@.en Default Constructor
- * Set the following items to profile.
- * - kind : PERIODIC
- * - rate : 0.0}
- */
- public ExecutionContextProfile(ExecutionKind kind) {
- rtcout = new Logbuf("periodic_ecprofile");
- m_period = new TimeValue(DEEFAULT_PERIOD);
- m_ref = null;
- rtcout.println(Logbuf.TRACE, "ExecutionContextProfile()");
- rtcout.println(Logbuf.DEBUG, "Actual rate: "
- + m_period.sec()
- + " [sec], "
- + m_period.usec()
- + " [usec]");
- // profile initialization
- m_profile.kind = kind;
- m_profile.rate = 1.0 / m_period.toDouble();
- m_profile.owner = null;
- m_profile.participants = new RTObject[0];
- m_profile.properties = new _SDOPackage.NameValue[0];
- }
- public ExecutionContextProfile(){
- this(ExecutionKind.PERIODIC);
- }
- /**
- * {@.ja CORBA ãªãã¸ã§ã¯ãã®è¨å®}
- * {@.en Sets the reference to the CORBA object}
- * <p>
- * {@.ja ExecutioncontextService ã® CORBA ãªãã¸ã§ã¯ãåç
§ãã»ããããã
- * ã»ãããããã¨ãããã¾ã§ã»ããããã¦ãããªãã¸ã§ã¯ãåç
§ã¯
- * releaseããããã»ãããããªãã¸ã§ã¯ãåç
§ã¯æå¹ãªåç
§ã§ãªããã°
- * ãªããªãã}
- * {@.en This operation sets a object reference to
- * ExecutionContextService. After setting a new object reference,
- * old reference is released. The object reference have to be
- * valid reference.}
- *
- * @param ec_ptr
- * {@.ja ExecutionContextServiceã®CORBAãªãã¸ã§ã¯ã}
- * {@.en A CORBA object reference of ExecutionContextService}
- */
- public void setObjRef(ExecutionContextService ec_ptr){
- rtcout.println(Logbuf.TRACE, "setObjRef()");
- synchronized (m_profile){
- m_ref = (ExecutionContextService)ec_ptr._duplicate();
- }
- }
-
- /**
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§ã®åå¾}
- * {@.en Get the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ãåç
§ãåå¾ããã}
- * {@.en Get the reference to the CORBA object as
- * ExecutioncontextService of this object.}
- *
- * @return
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§}
- * {@.en The reference to CORBA object}
- *
- */
- public ExecutionContextService getObjRef(){
- rtcout.println(Logbuf.TRACE, "getObjRef()");
- synchronized (m_profile){
- return (ExecutionContextService)m_ref._duplicate();
- }
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãè¨å®ãã}
- * {@.en Set execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãè¨å®ã
- * ããå®è¡å¨æã®å¤æ´ã¯ãDataFlowComponentAction ã®
- * on_rate_changed ã«ãã£ã¦åRTã³ã³ãã¼ãã³ãã«ä¼éãããã}
- * {@.en This operation shall set the rate (in hertz) at which this
- * contextâs Active participating RTCs are being called. If the
- * execution kind of the context is PERIODIC, a rate change shall
- * result in the invocation of on_rate_changed on any RTCs
- * realizing DataFlowComponentAction that are registered with any
- * RTCs participating in the context.}
- *
- * @param rate
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã
- * RTC_OK: æ£å¸¸çµäº
- * BAD_PARAMETER: è¨å®å¤ãè² ã®å¤}
- * {@.en The return code of ReturnCode_t type
- * RTC_OK: Succeed
- * BAD_PARAMETER: Invalid value. The value might be negative.}
- *
- */
- public ReturnCode_t setRate(double rate) {
- rtcout.println(Logbuf.TRACE, "setRate("+rate+")");
- if (rate < 0.0) {
- return ReturnCode_t.BAD_PARAMETER;
- }
-
- synchronized (m_profile){
- m_profile.rate = rate;
- m_period = new TimeValue(1.0/rate);
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t setPeriod(double period) {
- rtcout.println(Logbuf.TRACE, "setPeriod("+period+" [sec])");
- if (period < 0.0) {
- return ReturnCode_t.BAD_PARAMETER;
- }
-
- synchronized (m_profile){
- m_profile.rate = 1.0 / period;
- m_period = new TimeValue(period);
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t setPeriod(TimeValue period) {
- rtcout.println(Logbuf.TRACE, "setPeriod("+period.toDouble()+" [sec])");
- if (period.toDouble() < 0.0) {
- return ReturnCode_t.BAD_PARAMETER;
- }
-
- synchronized (m_profile){
- m_profile.rate = 1.0 / period.toDouble();
- m_period = period;
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãåå¾ãã}
- * {@.en Get execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãåå¾ã
- * ãã}
- * {@.en This operation shall return the rate (in hertz) at which its
- * Active participating RTCs are being invoked.}
- *
- * @return
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- */
- public double getRate() {
- synchronized (m_profile){
- return m_profile.rate;
- }
- }
- public TimeValue getPeriod(){
- synchronized (m_profile){
- return m_period;
- }
- }
-
- /**
- * {@.ja ExecutionKind ãæåååãã}
- * {@.en Converting ExecutionKind enum to string }
- * <p>
- * {@.ja ExecutionKind ã§å®ç¾©ããã¦ãã PERIODIC, EVENT_DRIVEN,
- * OTHER ãæåååããã}
- * {@.en This function converts enumeration (PERIODIC, EVENT_DRIVEN,
- * OTHER) defined in RTC::ExecutionKind to string.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- * @return
- * {@.en æåååãããExecutionKind}
- * {@.en String of ExecutionKind}
- *
- */
- public final String getKindString(ExecutionKind kind){
- ExecutionKindHolder ekh = new ExecutionKindHolder(kind);
- try {
- return ekh._type().name();
- }
- catch(Exception ex) {
- return "";
- }
- }
- public final String getKindString() {
- return getKindString(m_profile.kind);
- }
-
- /**
- * {@.ja ExecutionKind ãè¨å®ãã}
- * {@.en Set the ExecutionKind}
- * <p>
- * {@.ja ãã® ExecutionContext ã® ExecutionKind ãè¨å®ãã}
- * {@.en This operation sets the kind of the execution context.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- *
- */
- public ReturnCode_t setKind(ExecutionKind kind) {
- rtcout.println(Logbuf.TRACE, "setKind("+getKindString(kind)+")");
- synchronized (m_profile){
- m_profile.kind = kind;
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja ExecutionKind ãåå¾ãã}
- * {@.en Get the ExecutionKind}
- * <p>
- * {@.ja æ¬ ExecutionContext ã® ExecutionKind ãåå¾ãã}
- * {@.en This operation shall report the execution kind of the execution
- * context.}
- *
- * @return
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- */
- public ExecutionKind getKind() {
- synchronized (m_profile) {
- rtcout.println(Logbuf.TRACE, getKindString(m_profile.kind)
- + " = getKind()");
- return m_profile.kind;
- }
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ããã»ããããã}
- * {@.en Setting owner component of the execution context}
- * <p>
- * {@.ja ãã®ECã®Ownerã¨ãªãRTCãã»ããããã}
- * {@.en This function sets an RT-Component to be owner of the
- * execution context.}
- *
- * @param comp
- * {@.ja Ownerã¨ãªãRTã³ã³ãã¼ãã³ã}
- * {@.en an owner RT-Component of this execution context}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t setOwner(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE, "setOwner()");
- if (comp==null) {
- rtcout.println(Logbuf.ERROR,"nil reference is given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- RTObject rtobj;
- rtobj = RTObjectHelper.narrow(comp);
- if (rtobj==null) {
- rtcout.println(Logbuf.ERROR,"Narrowing failed.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- synchronized (m_profile) {
- m_profile.owner = (RTObject)rtobj._duplicate();
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ãã®åç
§ãåå¾ãã}
- * {@.en Getting a reference of the owner component}
- * <p>
- * {@.ja ãã®ECã®Ownerã§ããRTCã®åç
§ãåå¾ããã}
- * {@.en This function returns a reference of the owner RT-Component of
- * this execution context}
- *
- * @return
- * {@.ja OwnerRTã³ã³ãã¼ãã³ãã®åç
§}
- * {@.en a reference of the owner RT-Component}
- */
- public final RTObject getOwner() {
- rtcout.println(Logbuf.TRACE, "getOwner()");
- synchronized (m_profile) {
- return (RTObject)m_profile.owner._duplicate();
- }
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã追å ãã}
- * {@.en Add an RT-component}
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«è¿½å ããã追å ãããRTã³
- * ã³ãã¼ãã³ã㯠attach_context ãå¼ã°ããInactive ç¶æ
ã«é·ç§»ããã
- * æå®ãããRTã³ã³ãã¼ãã³ããnullã®å ´åã¯ãBAD_PARAMETER ãè¿ãã
- * ããæå®ãããRTã³ã³ãã¼ãã³ãã DataFlowComponent 以å¤ã®å ´åã¯ã
- * BAD_PARAMETER ãè¿ãããã}
- * {@.en The operation causes the given RTC to begin participating in
- * the execution context. The newly added RTC will receive a call
- * to LightweightRTComponent::attach_context and then enter the
- * Inactive state. BAD_PARAMETER will be invoked, if the given
- * RT-Component is null or if the given RT-Component is other than
- * DataFlowComponent.}
- *
- * @param comp
- * {@.ja 追å 対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for add}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t addComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE,"addComponent()");
- if (comp==null) {
- rtcout.println(Logbuf.ERROR,"A nil reference was given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- RTObject rtobj = RTObjectHelper.narrow(comp);
- if (rtobj==null) {
- rtcout.println(Logbuf.ERROR,"Narrowing was failed.");
- return ReturnCode_t.RTC_ERROR;
- }
- synchronized (m_profile) {
- RTCListHolder holder = new RTCListHolder(m_profile.participants);
- CORBA_SeqUtil.push_back(holder, rtobj);
- m_profile.participants = holder.value;
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãã}
- * {@.en Remove the RT-Component from participant list}
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãããåé¤ããã
- * RTã³ã³ãã¼ãã³ã㯠detach_context ãå¼ã°ãããæå®ãããRTã³ã³ãã¼
- * ãã³ããåå è
ãªã¹ãã«ç»é²ããã¦ããªãå ´åã¯ãBAD_PARAMETER ãè¿
- * ãããã}
- * {@.en This operation causes a participant RTC to stop participating
- * in the execution context.
- * The removed RTC will receive a call to
- * LightweightRTComponent::detach_context.
- * BAD_PARAMETER will be returned, if the given RT-Component is not
- * participating in the participant list.}
- *
- * @param comp
- * {@.ja åé¤å¯¾è±¡RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for delete}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t removeComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE,"removeComponent()");
- if (comp==null) {
- rtcout.println(Logbuf.ERROR,"A nil reference was given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- RTObject rtobj = RTObjectHelper.narrow(comp);
- if (rtobj==null) {
- rtcout.println(Logbuf.ERROR,"Narrowing was failed.");
- return ReturnCode_t.RTC_ERROR;
- }
- synchronized (m_profile) {
- RTCListHolder holder = new RTCListHolder(m_profile.participants);
- int index;
- index = CORBA_SeqUtil.find(holder,
- new find_participant(rtobj));
- if (index < 0) {
- rtcout.println(Logbuf.ERROR,
- "The given RTObject does not exist in the EC.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- CORBA_SeqUtil.erase(holder, index);
- m_profile.participants = holder.value;
- }
- return ReturnCode_t.RTC_OK;
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã®åå è
ãªã¹ããåå¾ãã}
- * {@.en Getting participant RTC list}
- * <p>
- * {@.ja ç¾å¨ç»é²ããã¦ããåå è
RTCã®ãªã¹ããåå¾ããããã®é¢æ°ã¯ã³ã³ãã¼
- * ãã³ããªã¹ãã®ã¡ã³ãå¤æ°ã¸ã®åç
§ãè¿ãã®ã§ããªã¹ã使ç¨åã«
- * ExecutionContextProfile::lock() ã§ããã¯ãããªã¹ã使ç¨å¾ã¯
- * ExecutionContextProfile::unlock() ã§ããã¯ãéæ¾ããªããã°ãªããª
- * ãã}
- * {@.en This function returns a list of participant RTC of the
- * execution context. Since the function returns a reference to
- * the member variable of component list, user have to lock by
- * ExecutionContextProfile::lock() before using the list, and user
- * also have to release the unlock by
- * ExecutionContextProfile::unlock().}
- *
- * @return
- * {@.ja åå è
RTCã®ãªã¹ã}
- * {@.en Participants RTC list}
- *
- */
- public final RTObject[] getComponentList() {
- rtcout.println(Logbuf.TRACE,"getComponentList("
- + m_profile.participants.length
- +")");
- return m_profile.participants;
- }
-
- /**
- * {@.ja Propertiesãã»ãããã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãã»ããããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- */
- public void setProperties(Properties props) {
- rtcout.println(Logbuf.TRACE,"setProperties()");
- String str = new String();
- str = props._dump(str,props,0);
- rtcout.println(Logbuf.TRACE,str);
- synchronized (m_profile) {
- NVListHolder holder = new NVListHolder(m_profile.properties);
- NVUtil.copyFromProperties(holder, props);
- m_profile.properties = holder.value;
- }
- }
-
- /**
- * {@.ja Propertiesãåå¾ãã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãåå¾ããã}
- *
- * @return
- * {@.ja Propertiesã«å¤æãããExecutionContextProfile::properties}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- */
- public final Properties getProperties() {
- rtcout.println(Logbuf.TRACE,"getProperties()");
- Properties props = new Properties();
- synchronized (m_profile) {
- NVListHolder holder = new NVListHolder(m_profile.properties);
- NVUtil.copyToProperties(props, holder);
- String str = new String();
- str = props._dump(str,props,0);
- rtcout.println(Logbuf.TRACE,str);
- }
- return props;
- }
-
- /**
- * {@.ja Profileãåå¾ãã}
- * {@.en Getting Profile}
- * <p>
- * {@.ja RTC::ExecutionContextProfile ãåå¾ãããåå¾ãã
- * ExecutionContextProfile ã®ææ権ã¯å¼ã³åºãå´ã«ãããåå¾ããããª
- * ãã¸ã§ã¯ããä¸è¦ã«ãªã£ãå ´åãå¼ã³åºãå´ãéæ¾ãã責任ãè² ãã}
- * {@.en This function gets RTC::ExecutionContextProfile. The ownership
- * of the obtained ExecutionContextProfile is given to caller. The
- * caller should release obtained object when it is unneccessary
- * anymore.}
- *
- * @return
- * {@.ja RTC::ExecutionContextProfile}
- * {@.en RTC::ExecutionContextProfile}
- *
- */
- public RTC.ExecutionContextProfile getProfile() {
- rtcout.println(Logbuf.TRACE,"getProfile()");
- RTC.ExecutionContextProfile p;
- synchronized (m_profile){
- p = new RTC.ExecutionContextProfile(m_profile.kind,
- m_profile.rate,
- m_profile.owner,
- m_profile.participants,
- m_profile.properties);
- }
- return p;
-
- }
-
-
- /**
- * {@.ja ExecutionContextProfileãããã¯ãã}
- * {@.en Getting a lock of RTC::ExecutionContextProfile}
- * <p>
- * {@.ja ãã®ãªãã¸ã§ã¯ãã管çãã RTC::ExecutionContextProfile ãããã¯ããã
- * ããã¯ãä¸è¦ã«ãªã£ãéã«ã¯unlock()ã§ããã¯ã解é¤ããªããã°ãªããªãã}
- * {@.en This function locks RTC::ExecutionContextProfile in the object.
- * The lock should be released when the lock is unneccessary.}
- *
- */
- public void lock() {
- //m_profileMutex.lock();
- }
-
- /**
- * {@.ja ExecutionContextProfileãã¢ã³ããã¯ãã}
- * {@.en Release a lock of the RTC::ExecutionContextProfile}
- * <p>
- * {@.ja ãã®ãªãã¸ã§ã¯ãã管çãã RTC::ExecutionContextProfile ãã¢ã³ãã
- * ã¯ããã}
- * {@.en This function release the lock of RTC::ExecutionContextProfile
- * in the object.}
- *
- */
- public void unlock() {
- //m_profileMutex.unlock();
- }
-
- /**
- * {@.ja Logger}
- * {@.en Logger}
- */
- private Logbuf rtcout;
- /**
- * {@.ja ECProfile}
- * {@.en ECProfile}
- */
- private RTC.ExecutionContextProfile m_profile
- = new RTC.ExecutionContextProfile();
-
- /**
- * {@.ja mutex of ExecutionContextProfile}
- * {@.en mutex ExecutionContextProfile}
- */
- //private String m_profileMutex = new String();
-
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ}
- * {@.en Execution cycle of ExecutionContext}
- */
- private TimeValue m_period;
-
- /**
- * {@.ja ExecutionContextService ãªãã¸ã§ã¯ãã¸ã®åç
§}
- * {@.en Reference to ExecutionContextService object}
- */
- private ExecutionContextService m_ref;
-
- private class find_participant implements equalFunctor {
- private RTObject m_comp;
- public find_participant(RTObject comp) {
- m_comp = (RTObject)comp._duplicate();
- }
- public boolean equalof(final java.lang.Object comp) {
- return m_comp._is_equivalent((RTObject)comp);
- }
- };
-}; // class ExecutionContextProfile
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,707 +0,0 @@
-package jp.go.aist.rtm.RTC.executionContext;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import jp.go.aist.rtm.RTC.RTObject_impl;
-import jp.go.aist.rtm.RTC.RTObjectStateMachine;
-import jp.go.aist.rtm.RTC.util.TimeValue;
-import jp.go.aist.rtm.RTC.log.Logbuf;
-
-import RTC.ExecutionContextService;
-import RTC.LifeCycleState;
-import RTC.LightweightRTObject;
-import RTC.ReturnCode_t;
- /**
- * {@.ja PeriodicExecutionContext ã¯ã©ã¹}
- * {@.en PeriodicExecutionContext class}
- * <p>
- * {@.ja Periodic Sampled Data Processing(å¨æå®è¡ç¨)ExecutionContextã¯ã©ã¹ã}
- * {@.en Periodic Sampled Data Processing (for the execution cycles)
- * ExecutionContext class}
- */
-public class ExecutionContextWorker {
-
- /**
- * {@.ja ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿}
- * {@.en Default Constructor}
- * <p>
- * {@.ja ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿
- * ãããã¡ã¤ã«ã«ä»¥ä¸ã®é
ç®ãè¨å®ããã
- * - kind : PERIODIC
- * - rate : 0.0}
- * {@.en Default Constructor
- * Set the following items to profile.
- * - kind : PERIODIC
- * - rate : 0.0}
- */
- public ExecutionContextWorker() {
- rtcout = new Logbuf("ec_worker");
- m_running = false;
- ticked_ = false ;
- running_ = false ;
- rtcout.println(Logbuf.TRACE, "ExecutionContextWorker()");
- }
- //============================================================
- // Object reference to EC
- //============================================================
- public void setECRef(ExecutionContextService ref) {
- m_ref = (ExecutionContextService)ref._duplicate();
- }
- public ExecutionContextService getECRef(){
- return (ExecutionContextService)m_ref._duplicate();
- }
-
- //============================================================
- // ExecutionContext
- //============================================================
- /**
- * {@.ja ExecutionContext å®è¡ç¶æ
確èªé¢æ°}
- * {@.en Check for ExecutionContext running state}
- * <p>
- * {@.ja ãã®æä½ã¯ ExecutionContext ã Runnning ç¶æ
ã®å ´åã« true ãè¿ãã
- * Executioncontext ã Running ã®éãå½è©² Executioncontext ã«åå ã
- * ã¦ããå
¨ã¦ã®ã¢ã¯ãã£ãRTã³ã³ãã¼ãã³ãããExecutionContext ã®å®
- * è¡ç¨®é¡ã«å¿ãã¦å®è¡ãããã}
- * {@.en This operation shall return true if the context is in the
- * Running state. While the context is Running, all Active RTCs
- * participating in the context shall be executed according to the
- * contextâs execution kind.}
- *
- * @return
- * {@.ja ç¶æ
確èªé¢æ°(åä½ä¸:trueãåæ¢ä¸:false)}
- * {@.en Check state function (Running:trueãStopping:false)}
- *
- */
- public boolean isRunning() {
- rtcout.println(Logbuf.TRACE, "isRunning()");
- return m_running;
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡ãéå§}
- * {@.en Start the ExecutionContext}
- * <p>
- * {@.ja ExecutionContext ã®å®è¡ç¶æ
ã Runnning ã¨ããããã®ãªã¯ã¨ã¹ãã
- * çºè¡ãããExecutionContext ã®ç¶æ
ãé·ç§»ããã¨
- * ComponentAction::on_startup ãå¼ã³åºããããåå ãã¦ããRTã³ã³ãã¼
- * ãã³ãããåæåãããã¾ã§ ExecutionContext ãéå§ãããã¨ã¯ã§ã
- * ãªããExecutionContext ã¯è¤æ°åéå§/åæ¢ãç¹°ãè¿ããã¨ãã§ããã}
- * {@.en Request that the context enter the Running state. Once the
- * state transition occurs, the ComponentAction::on_startup
- * operation will be invoked. An execution context may not be
- * started until the RT-Components that participate in it have
- * been initialized. An execution context may be started and
- * stopped multiple times.}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t start() {
- rtcout.println(Logbuf.TRACE, "start()");
- synchronized (m_mutex){
- if (m_running) {
- rtcout.println(Logbuf.WARN,
- "ExecutionContext is already running.");
- return ReturnCode_t.PRECONDITION_NOT_MET;
- }
- // invoke ComponentAction::on_startup for each comps.
- for (int ic=0; ic < m_comps.size(); ++ic) {
- m_comps.get(ic).onStartup();
- }
- rtcout.println(Logbuf.DEBUG, m_comps.size()
- + " components started.");
- // change EC thread state
- m_running = true;
-
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡ãåæ¢}
- * {@.en Stop the ExecutionContext}
- * <p>
- * {@.ja ExecutionContext ã®ç¶æ
ã Stopped ã¨ããããã®ãªã¯ã¨ã¹ããçºè¡ã
- * ããé·ç§»ãçºçããå ´åã¯ãComponentAction::on_shutdown ãå¼ã³åº
- * ããããåå ãã¦ããRTã³ã³ãã¼ãã³ããçµäºããåã«
- * ExecutionContext ãåæ¢ããå¿
è¦ããããExecutionContext ã¯è¤æ°å
- * éå§/åæ¢ãç¹°ãè¿ããã¨ãã§ããã}
- * {@.en Request that the context enter the Stopped state. Once the
- * transition occurs, the ComponentAction::on_shutdown operation
- * will be invoked. An execution context must be stopped before
- * the RT components that participate in it are finalized. An
- * execution context may be started and stopped multiple times.}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t stop(){
- rtcout.println(Logbuf.TRACE, "stop()");
- synchronized (m_mutex){
- if (!m_running) {
- rtcout.println(Logbuf.WARN,
- "ExecutionContext is already stopped.");
- return ReturnCode_t.PRECONDITION_NOT_MET;
- }
- // stop thread
- m_running = false;
-
- // invoke on_shutdown for each comps.
- for (int ic=0; ic < m_comps.size(); ++ic) {
- m_comps.get(ic).onShutdown();
- }
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ããã¢ã¯ãã£ãåãã}
- * {@.en Activate an RT-component}
- * <p>
- * {@.ja Inactive ç¶æ
ã«ããRTã³ã³ãã¼ãã³ããActive ã«é·ç§»ãããã¢ã¯ãã£
- * ãåããããã®æä½ãå¼ã°ããçµæãon_activate ãå¼ã³åºããããæ
- * å®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«å«ã¾ããªãå ´åã¯ã
- * BAD_PARAMETER ãè¿ããããæå®ããRTã³ã³ãã¼ãã³ãã®ç¶æ
ã
- * Inactive 以å¤ã®å ´åã¯ãPRECONDITION_NOT_MET ãè¿ãããã}
- * {@.en The given participant RTC is Inactive and is therefore not
- * being invoked according to the execution contextâs execution
- * kind. This operation shall cause the RTC to transition to the
- * Active state such that it may subsequently be invoked in this
- * execution context. The callback on_activate shall be called as
- * a result of calling this operation. This operation shall not
- * return until the callback has returned, and shall result in an
- * error if the callback does.}
- *
- * @param comp
- * {@.ja ã¢ã¯ãã£ãå対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for activation}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t activateComponent(LightweightRTObject comp,
- RTObjectStateMachine rtobj) {
- rtcout.println(Logbuf.TRACE, "activateComponent()");
- synchronized (m_mutex){
- RTObjectStateMachine obj = findComponent(comp);
- if (obj == null) {
- rtcout.println(Logbuf.ERROR,
- "Given RTC is not participant of this EC.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- rtcout.println(Logbuf.DEBUG, "Component found in the EC.");
- if (!(obj.isCurrentState(LifeCycleState.INACTIVE_STATE))) {
- rtcout.println(Logbuf.ERROR,
- "State of the RTC is not INACTIVE_STATE.");
- return ReturnCode_t.PRECONDITION_NOT_MET;
- }
- rtcout.println(Logbuf.DEBUG,
- "Component is in INACTIVE state. Going to ACTIVE state.");
- obj.goTo(LifeCycleState.ACTIVE_STATE);
- rtobj = obj;
- rtcout.println(Logbuf.DEBUG,"activateComponent() done.");
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj,
- TimeValue timeout,
- long cycle) {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj) {
- return waitActivateComplete(rtobj,new TimeValue(1.0),1000);
- }
- public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj,
- TimeValue timeout ) {
- return waitActivateComplete(rtobj,timeout,1000);
- };
- public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj,
- long cycle) {
- return waitActivateComplete(rtobj,new TimeValue(1.0),cycle);
- }
- /**
- * {@.ja RTã³ã³ãã¼ãã³ããéã¢ã¯ãã£ãåãã}
- * {@.en Deactivate an RT-component}
- * <p>
- * {@.ja Inactive ç¶æ
ã«ããRTã³ã³ãã¼ãã³ããéã¢ã¯ãã£ãåããInactive
- * ã«é·ç§»ãããããã®æä½ãå¼ã°ããçµæãon_deactivate ãå¼ã³åºãã
- * ããæå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«å«ã¾ããªãå ´åã¯ã
- * BAD_PARAMETER ãè¿ããããæå®ããRTã³ã³ãã¼ãã³ãã®ç¶æ
ã
- * Active 以å¤ã®å ´åã¯ãPRECONDITION_NOT_MET ãè¿ãããã}
- * {@.en The given RTC is Active in the execution context. Cause it to
- * transition to the Inactive state such that it will not be
- * subsequently invoked from the context unless and until it is
- * activated again. The callback on_deactivate shall be called as
- * a result of calling this operation. This operation shall not
- * return until the callback has returned, and shall result in an
- * error if the callback does.}
- *
- * @param comp
- * {@.ja éã¢ã¯ãã£ãå対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for deactivate}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t deactivateComponent(LightweightRTObject comp,
- RTObjectStateMachine rtobj){
- rtcout.println(Logbuf.TRACE, "deactivateComponent()");
- synchronized (m_mutex){
- rtobj = findComponent(comp);
- if (rtobj == null) {
- rtcout.println(Logbuf.ERROR,
- "Given RTC is not participant of this EC.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- if (!(rtobj.isCurrentState(LifeCycleState.ACTIVE_STATE))) {
- rtcout.println(Logbuf.ERROR,
- "State of the RTC is not ACTIVE_STATE.");
- return ReturnCode_t.PRECONDITION_NOT_MET;
- }
- rtobj.goTo(LifeCycleState.INACTIVE_STATE);
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj,
- TimeValue timeout,
- long cycle) {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj,
- TimeValue timeout) {
- return waitDeactivateComplete(rtobj,timeout,1000);
- }
- public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj,
- long cycle){
- return waitDeactivateComplete(rtobj,new TimeValue(1.0),cycle);
- }
- public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj){
- return waitDeactivateComplete(rtobj, new TimeValue(1.0),1000);
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãããªã»ãããã}
- * {@.en Reset the RT-component}
- * <p>
- * {@.ja Error ç¶æ
ã®RTã³ã³ãã¼ãã³ãã®å¾©å¸°ã試ã¿ãããã®æä½ãå¼ã°ããçµ
- * æãon_reset ãå¼ã³åºããããæå®ããRTã³ã³ãã¼ãã³ããåå è
ãª
- * ã¹ãã«å«ã¾ããªãå ´åã¯ãBAD_PARAMETER ãè¿ããããæå®ããRTã³ã³
- * ãã¼ãã³ãã®ç¶æ
ã Error 以å¤ã®å ´åã¯ãPRECONDITION_NOT_MET ãè¿
- * ãããã}
- * {@.en Attempt to recover the RTC when it is in Error. The
- * ComponentAction::on_reset callback shall be invoked. This
- * operation shall not return until the callback has returned, and
- * shall result in an error if the callback does. If possible, the
- * RTC developer should implement that callback such that the RTC
- * may be returned to a valid state.}
- *
- * @param comp
- * {@.ja ãªã»ãã対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for reset}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t resetComponent(LightweightRTObject comp,
- RTObjectStateMachine rtobj) {
- rtcout.println(Logbuf.TRACE, "resetComponent()");
- synchronized (m_mutex){
-
- rtobj = findComponent(comp);
- if (rtobj == null) {
- rtcout.println(Logbuf.ERROR,
- "Given RTC is not participant of this EC.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- if (!(rtobj.isCurrentState(LifeCycleState.ERROR_STATE))) {
- rtcout.println(Logbuf.ERROR,
- "State of the RTC is not ERROR_STATE.");
- return ReturnCode_t.PRECONDITION_NOT_MET;
- }
- rtobj.goTo(LifeCycleState.INACTIVE_STATE);
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj,
- TimeValue timeout,
- long cycle) {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj,
- TimeValue timeout){
- return waitResetComplete(rtobj, timeout, 1000);
- }
- public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj,
- long cycle) {
- return waitResetComplete(rtobj, new TimeValue(1.0), cycle);
- }
- public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj) {
- return waitResetComplete(rtobj, new TimeValue(1.0), 1000);
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã®ç¶æ
ãåå¾ãã}
- * {@.en Get RT-component's state}
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ãã®ç¶æ
(LifeCycleState)ãåå¾ãããæå®ã
- * ãRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«å«ã¾ããªãå ´åã¯ã
- * UNKNOWN_STATE ãè¿ãããã}
- * {@.en This operation shall report the LifeCycleState of the given
- * participant RTC. UNKNOWN_STATE will be returned, if the given
- * RT-Component is not inclued in the participant list.}
- *
- * @param comp
- * {@.ja ç¶æ
åå¾å¯¾è±¡RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component to get the state}
- *
- * @return
- * {@.ja ç¾å¨ã®ç¶æ
(LifeCycleState)}
- * {@.en The current state of the target RT-Component(LifeCycleState)}
- *
- */
- public LifeCycleState getComponentState(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE, "getComponentState()");
- synchronized (m_mutex){
- RTObjectStateMachine rtobj = findComponent(comp);
- if (rtobj == null) {
- rtcout.println(Logbuf.WARN,
- "Given RTC is not participant of this EC.");
- return LifeCycleState.CREATED_STATE;
- }
- LifeCycleState state = rtobj.getState();
- rtcout.println(Logbuf.DEBUG,
- "getComponentState() = "
- + getStateString(state)
- + " done" );
- return state;
- }
- }
- public final String getStateString(LifeCycleState state) {
- final String st[] = {
- "CREATED_STATE",
- "INACTIVE_STATE",
- "ACTIVE_STATE",
- "ERROR_STATE"
- };
- return st[state.value()];
- }
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã追å ãã}
- * {@.en Add an RT-component}
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«è¿½å ããã追å ãããRTã³
- * ã³ãã¼ãã³ã㯠attach_context ãå¼ã°ããInactive ç¶æ
ã«é·ç§»ããã
- * æå®ãããRTã³ã³ãã¼ãã³ããnullã®å ´åã¯ãBAD_PARAMETER ãè¿ãã
- * ããæå®ãããRTã³ã³ãã¼ãã³ãã DataFlowComponent 以å¤ã®å ´åã¯ã
- * BAD_PARAMETER ãè¿ãããã}
- * {@.en The operation causes the given RTC to begin participating in
- * the execution context. The newly added RTC will receive a call
- * to LightweightRTComponent::attach_context and then enter the
- * Inactive state. BAD_PARAMETER will be invoked, if the given
- * RT-Component is null or if the given RT-Component is other than
- * DataFlowComponent.}
- *
- * @param comp
- * {@.ja 追å 対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for add}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t addComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE, "addComponent()");
- if (comp==null) {
- rtcout.println(Logbuf.ERROR, "nil reference is given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- try {
- synchronized (m_mutex){
- ExecutionContextService ec = getECRef();
- int id = comp.attach_context(ec);
- m_addedComps.add(new RTObjectStateMachine(id, comp));
- }
- }
- catch (Exception ex) {
- rtcout.println(Logbuf.ERROR, "addComponent() failed.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG, "addComponent() succeeded.");
- return ReturnCode_t.RTC_OK;
- }
-
- /**
- * {@.ja ã³ã³ãã¼ãã³ãããã¤ã³ãããã}
- * {@.en Bind the component.}
- * <p>
- * {@.ja ã³ã³ãã¼ãã³ãããã¤ã³ãããã}
- * {@.en Bind the component.}
- *
- * @param rtc
- * {@.ja RTã³ã³ãã¼ãã³ã}
- * {@.en RT-Component's instances}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t bindComponent(RTObject_impl rtc) {
- rtcout.println(Logbuf.TRACE, "bindComponent()");
- synchronized (m_mutex){
- if (rtc == null) {
- rtcout.println(Logbuf.ERROR, "NULL pointer is given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- ExecutionContextService ec = getECRef();
- int id = rtc.bindContext(ec);
- if (id < 0 || id > RTObject_impl.ECOTHER_OFFSET) {
- // id should be owned context id < ECOTHER_OFFSET
- rtcout.println(Logbuf.ERROR,
- "bindContext returns invalid id: "+id);
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,
- "bindContext returns id = "+id);
-
- // rtc is owner of this EC
- LightweightRTObject comp
- = (LightweightRTObject)rtc.getObjRef()._duplicate();
- // RTObjectStateMachine o(id, comp);
- m_comps.add(new RTObjectStateMachine(id, comp));
- rtcout.println(Logbuf.DEBUG,"bindComponent() succeeded.");
- return ReturnCode_t.RTC_OK;
- }
- }
- /**
- * {@.ja RTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãã}
- * {@.en Remove the RT-Component from participant list}
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãããåé¤ããã
- * RTã³ã³ãã¼ãã³ã㯠detach_context ãå¼ã°ãããæå®ãããRTã³ã³ãã¼
- * ãã³ããåå è
ãªã¹ãã«ç»é²ããã¦ããªãå ´åã¯ãBAD_PARAMETER ãè¿
- * ãããã}
- * {@.en This operation causes a participant RTC to stop participating
- * in the execution context.
- * The removed RTC will receive a call to
- * LightweightRTComponent::detach_context.
- * BAD_PARAMETER will be returned, if the given RT-Component is not
- * participating in the participant list.}
- *
- * @param comp
- * {@.ja åé¤å¯¾è±¡RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for delete}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t removeComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE,"removeComponent()");
- if (comp==null) {
- rtcout.println(Logbuf.ERROR,"nil reference is given.");
- return ReturnCode_t.BAD_PARAMETER;
- }
-
- synchronized (m_mutex){
- RTObjectStateMachine rtobj = findComponent(comp);
-
- if (rtobj == null) {
- rtcout.println(Logbuf.ERROR,
- "no RTC found in this context.");
- return ReturnCode_t.BAD_PARAMETER;
- }
- synchronized (m_removedMutex){
- m_removedComps.add(rtobj);
-
- return ReturnCode_t.RTC_OK;
- }
- }
- }
- public RTObjectStateMachine findComponent(LightweightRTObject comp) {
- for (int ic=0; ic < m_comps.size() ; ++ic) {
- if(m_comps.get(ic).isEquivalent(comp)) {
- return m_comps.get(ic);
- }
- }
- return null;
- }
-
- public boolean isAllCurrentState(LifeCycleState state) {
- synchronized (m_mutex){
- for (int ic=0; ic < m_comps.size(); ++ic) {
- if (!m_comps.get(ic).isCurrentState(state)) {
- return false;
- }
- }
- return true;
- }
- }
- public boolean isAllNextState(LifeCycleState state){
- synchronized (m_mutex){
- for (int ic=0; ic < m_comps.size(); ++ic) {
- if (!m_comps.get(ic).isNextState(state)) {
- return false;
- }
- }
- return true;
- }
- }
- public boolean isOneOfCurrentState(LifeCycleState state){
- synchronized (m_mutex){
- for (int ic=0; ic < m_comps.size(); ++ic) {
- if (m_comps.get(ic).isCurrentState(state)) {
- return true;
- }
- }
- return false;
- }
- }
- public boolean isOneOfNextState(LifeCycleState state){
- synchronized (m_mutex){
- for (int ic=0; ic < m_comps.size(); ++ic) {
- if (m_comps.get(ic).isNextState(state)) {
- return true;
- }
- }
- return false;
- }
- }
-
- public void invokeWorker(){
- rtcout.println(Logbuf.PARANOID,"invokeWorker()");
- // m_comps never changes its size here
- int len = m_comps.size();
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerPreDo();
- }
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerDo();
- }
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerPostDo();
- }
- updateComponentList();
- }
- public void invokeWorkerPreDo(){
- rtcout.println(Logbuf.PARANOID,"invokeWorkerPreDo()");
- // m_comps never changes its size here
- int len = m_comps.size();
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerPreDo();
- }
- }
- public void invokeWorkerDo(){
- rtcout.println(Logbuf.PARANOID,"invokeWorkerDo()");
- // m_comps never changes its size here
- int len = m_comps.size();
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerDo();
- }
- }
- public void invokeWorkerPostDo(){
- rtcout.println(Logbuf.PARANOID,"invokeWorkerPostDo()");
- // m_comps never changes its size here
- int len = m_comps.size();
- for (int ic=0; ic < len; ++ic) {
- m_comps.get(ic).workerPostDo();
- }
- // m_comps might be changed here
- updateComponentList();
- }
-
-
-
- protected void updateComponentList() {
- synchronized (m_mutex) {
- synchronized (m_addedMutex) {// adding component
- for (int ic=0; ic < m_addedComps.size(); ++ic) {
- m_comps.add(m_addedComps.get(ic));
- rtcout.println(Logbuf.TRACE,"Component added.");
- }
- m_addedComps.clear();
- }
- synchronized (m_removedMutex) {// removing component
- for (int ic=0; ic < m_removedComps.size(); ++ic) {
- RTObjectStateMachine rtobj = m_removedComps.get(ic);
- LightweightRTObject lwrtobj = rtobj.getRTObject();
- lwrtobj.detach_context(rtobj.getExecutionContextHandle());
- Iterator it = m_comps.iterator();
- while (it.hasNext()) {
- if(rtobj == (RTObjectStateMachine)it.next()){
- m_comps.remove(it);
- }
- }
- rtobj = null;
- rtcout.println(Logbuf.TRACE,"Component deleted.");
- }
- m_removedComps.clear();
- }
- }
- }
-
-
-
- /*!
- * @if jp
- * @brief ã³ã³ãã¼ãã³ãæ¤ç´¢ç¨ãã¡ã³ã¯ã¿
- * @else
- * @brief Functor to find the component
- * @endif
- */
-// struct find_comp
-// {
-// RTC::LightweightRTObject_var m_comp;
-// find_comp(RTC::LightweightRTObject_ptr comp)
-// : m_comp(RTC::LightweightRTObject::_duplicate(comp)) {}
-// boolean operator()(RTObjectStateMachine* comp)
-// {
-// return comp->isEquivalent(m_comp);
-// }
-// };
-
- //------------------------------------------------------------
- // member variables
- /**
- * {@.ja ãã¬ã¼ã¹ããªã¼ã }
- * {@.en Logger stream}
- */
- protected Logbuf rtcout;
-
- protected ExecutionContextService m_ref;
-
- /**
- * {@.ja ExecutionContext ã®å®è¡ç¶æ
}
- * {@.en The running state of ExecutionContext}
- * true: running, false: stopped
- */
- protected boolean m_running;
- protected boolean ticked_;
- protected boolean running_;
-
- /**
- * {@.ja ã³ã³ãã¼ãã³ãã®åå è
ãªã¹ã}
- * {@.en List of the participating component}
- */
- protected ArrayList<RTObjectStateMachine> m_comps;
-// protected String m_mutex;
- protected String m_mutex = new String();
- protected ArrayList<RTObjectStateMachine> m_addedComps;
-// protected String m_addedMutex;
- protected String m_addedMutex = new String();
- ArrayList<RTObjectStateMachine> m_removedComps;
-// protected String m_removedMutex;
- protected String m_removedMutex = new String();
-
-};
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,32 +1,10 @@
package jp.go.aist.rtm.RTC.executionContext;
-import java.util.ArrayList;
-
import jp.go.aist.rtm.RTC.Manager;
-import jp.go.aist.rtm.RTC.ObjectCreator;
-import jp.go.aist.rtm.RTC.ObjectDestructor;
-import jp.go.aist.rtm.RTC.RTObject_impl;
-import jp.go.aist.rtm.RTC.RTObjectStateMachine;
-import jp.go.aist.rtm.RTC.StateAction;
-import jp.go.aist.rtm.RTC.StateHolder;
-import jp.go.aist.rtm.RTC.StateMachine;
import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.POAUtil;
-import jp.go.aist.rtm.RTC.util.Properties;
import jp.go.aist.rtm.RTC.util.TimeValue;
import org.omg.CORBA.SystemException;
-
-import OpenRTM.ExtTrigExecutionContextServicePOA;
-import OpenRTM.ExtTrigExecutionContextServiceHelper;
-import OpenRTM.DataFlowComponent;
-import OpenRTM.DataFlowComponentHelper;
-import RTC.ExecutionContextService;
-import RTC.ExecutionContextServiceHelper;
-import RTC.ExecutionKind;
-import RTC.LifeCycleState;
-import RTC.LightweightRTObject;
-import RTC.ReturnCode_t;
/**
* {@.ja ã¹ãããå®è¡ãå¯è½ãª ExecutionContext ã¯ã©ã¹}
* {@.en ExecutionContext class that enables one step execution}
@@ -39,15 +17,8 @@
* Time(Tick) advances one cycle by invoking method externally.}
*/
public class ExtTrigExecutionContext
-extends ExtTrigExecutionContextServicePOA
-implements Runnable, ObjectCreator<ExecutionContextBase>, ObjectDestructor, ExecutionContextBase{
+ extends PeriodicExecutionContext implements Runnable {
- TimeValue m_activationTimeout = new TimeValue(0.5);
- TimeValue m_deactivationTimeout = new TimeValue(0.5);
- TimeValue m_resetTimeout = new TimeValue(0.5);
- boolean m_syncActivation = true;
- boolean m_syncDeactivation = true;
- boolean m_syncReset = true;
/**
* {@.ja ã³ã³ã¹ãã©ã¯ã¿}
* {@.en Constructor}
@@ -55,149 +26,61 @@
public ExtTrigExecutionContext() {
super();
- rtcout = new Logbuf("ExtTrigExecutionContext");
- m_svc = false;
- m_profile.setObjRef((ExecutionContextService)this.__this());
+ rtcout = new Logbuf("Manager.ExtTrigExecutionContext");
- m_profile.setKind(ExecutionKind.PERIODIC);
- m_profile.setRate(1000);
- rtcout.println(Logbuf.DEBUG, "Actual period: " + m_profile.getPeriod().sec() + " [sec], "
- + m_profile.getPeriod().usec() + " [usec]");
}
/**
- * <p> __this() </p>
- *
- * @return ExecutionContextService
+ * <p>ExecutionContextã®å¦çãï¼å¨æåé²ãã¾ãã</p>
*/
-
- public ExecutionContextService __this() {
-
- if (this.m_ref == null) {
- try {
- this.m_ref = ExtTrigExecutionContextServiceHelper.narrow(POAUtil.getRef(this));
-
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
- }
-
- return this.m_ref;
- }
- /**
- * <p>çµäºå¦çç¨é¢æ°</p>
- */
- public boolean finalizeExecutionContext() {
- synchronized (m_worker) {
- //m_worker.running_ = true;
- m_worker.ticked_ = true ;
- m_worker.notifyAll();
- }
- m_svc = false;
- try {
- m_thread.join();
- }
- catch (InterruptedException e) {
- System.out.println(e);
- }
-
- return true;
- }
-
- /**
- * {@.ja ExecutionContextã®å¦çãé²ãã}
- * {@.en Proceed with tick of ExecutionContext}
- *
- * <p>
- * {@.ja ExecutionContextã®å¦çãï¼å¨æåé²ãã¾ãã}
- * {@.en Proceed with tick of ExecutionContext for one period.}
- *
- */
public void tick() throws SystemException {
rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.tick()");
synchronized (m_worker) {
- m_worker.ticked_ = true;
+ m_worker._called = true;
m_worker.notifyAll();
}
}
/**
- * <p>ExecutionContextç¨ã®ã¹ã¬ãããçæãã¾ãã</p>
- */
- public int open() {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.open()");
-
- if(m_thread==null) {
- m_thread = new Thread(this, "ExtTrigExecutionContext");
- m_thread.start();
- }
- return 0;
- }
- /**
* <p>ExecutionContextã«attachããã¦ããåComponentã®å¦çãå¼ã³åºãã¾ãã
* å
¨Componentã®å¦çãå¼ã³åºããå¾ã次ã®ã¤ãã³ããçºçããã¾ã§ä¼æ¢ãã¾ãã</p>
*/
public int svc() {
- int count = 0 ;
+
rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.svc()");
+
do {
+ TimeValue tv = new TimeValue(0, m_usec); // (s, us)
synchronized (m_worker) {
- rtcout.println(Logbuf.DEBUG, "Start of worker invocation. ticked = "+ (m_worker.ticked_ ? "true" : "false"));
- while (!m_worker.ticked_) {
+ while (!m_worker._called && m_running) {
try {
m_worker.wait();
- rtcout.println(Logbuf.DEBUG, "Thread was woken up.");
} catch (InterruptedException e) {
break;
}
}
- if(!m_worker.ticked_){continue;}
- }
- TimeValue t0 = new TimeValue();
- t0.convert(System.nanoTime()/1000);
- m_worker.invokeWorkerPreDo();
- m_worker.invokeWorkerDo();
- m_worker.invokeWorkerPostDo();
- TimeValue t1 = new TimeValue();
- t1.convert(System.nanoTime()/1000);
- synchronized (m_worker) {
- m_worker.ticked_ = false ;
- }
- TimeValue period = getPeriod();
- TimeValue t2 = new TimeValue();
- t2.convert(System.nanoTime()/1000);
- if(true){
- TimeValue t1_w = t1;
- TimeValue period_w = period ;
- rtcout.println(Logbuf.PARANOID, "Period: " + period + " [s]");
- rtcout.println(Logbuf.PARANOID, "Execution: " + t1_w.minus(t0) + " [s]");
- rtcout.println(Logbuf.PARANOID, "Sleep: " + period_w.minus(t1_w) + " [s]");
- }
- if( period.getUsec() > 0)
- {
- if(true)
- {
- rtcout.println(Logbuf.PARANOID, "sleeping...");
+ if (m_worker._called) {
+ m_worker._called = false;
+ for (int intIdx = 0; intIdx < m_comps.size(); ++intIdx) {
+ m_comps.elementAt(intIdx).invoke();
+ }
+ while (!m_running) {
+ try {
+ Thread.sleep(0, (int) tv.getUsec());
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ try {
+ Thread.sleep(0, (int) tv.getUsec());
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
}
- try {
- Thread.sleep(period.getUsec());
- } catch (InterruptedException e){
- e.printStackTrace();
- }
}
- TimeValue t3 = new TimeValue();
- t3.convert(System.nanoTime()/1000);
- if(true)
- {
- rtcout.println(Logbuf.PARANOID, "Slept: " + t3.minus(t2) + " [s]");
- count = 0;
- }
- ++count;
-
} while (m_running);
return 0;
@@ -210,1190 +93,6 @@
this.svc();
}
- //============================================================
- // ExecutionContext
- //============================================================
- /**
- * {@.ja ExecutionContext å®è¡ç¶æ
確èªé¢æ°}
- * {@.en heck for ExecutionContext running state}
- * <p>
- * {@.ja ãã®æä½ã¯ ExecutionContext ã Runnning ç¶æ
ã®å ´åã« true ãè¿ãã
- * Executioncontext ã Running ã®éãå½è©² Executioncontext ã«åå ã
- * ã¦ããå
¨ã¦ã®ã¢ã¯ãã£ãRTã³ã³ãã¼ãã³ãããExecutionContext ã®å®
- * è¡ç¨®é¡ã«å¿ãã¦å®è¡ãããã}
- * {@.en This operation shall return true if the context is in the
- * Running state. While the context is Running, all Active RTCs
- * participating in the context shall be executed according to the
- * contextâs execution kind.}
- *
- * @return
- * {@.ja ç¶æ
確èªé¢æ°(åä½ä¸:trueãåæ¢ä¸:false)}
- * {@.en Check state function (Running:trueãStopping:false)}
- *
- */
- public boolean is_running() {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.is_running()");
- return m_worker.isRunning();
- }
-
- public ReturnCode_t onStarting() { return ReturnCode_t.RTC_OK; }
-
- //============================================================
- // protected functions
- //============================================================
- /*!
- * @brief onStarted() template function
- */
- public ReturnCode_t onStarted()
- {
- // change EC thread state
- synchronized (m_worker) {
- if (!m_svc)
- { // If start() is called first time, start the worker thread.
- m_svc = true;
- this.open();
- }
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t onStopping()
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onStopped()
- {
- return ReturnCode_t.RTC_OK;
- }
- public double onGetRate(double rate)
- {
- return rate;
- }
- public double onSettingRate(double rate)
- {
- return rate;
- }
- public ReturnCode_t onSetRate(double rate)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onAddingComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onAddedComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onRemovingComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onRemovedComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
-
- // template virtual functions related to activation/deactivation/reset
- public ReturnCode_t onActivating(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onActivated(RTObjectStateMachine comp, long count)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onDeactivating(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onDeactivated(RTObjectStateMachine comp, long count)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onResetting(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onReset(RTObjectStateMachine comp, long count)
- {
- return ReturnCode_t.RTC_OK;
- }
-
- public LifeCycleState onGetComponentState(LifeCycleState state)
- {
- return state;
- }
- public ExecutionKind onGetKind(ExecutionKind kind)
- {
- return kind;
- }
- public ExecutionContextProfile onGetProfile(ExecutionContextProfile profile)
- {
- return profile;
- }
-
- /**
- * {@.ja onWaitingActivated() template function}
- * {@.en onWaitingActivated() template function}
- */
- public ReturnCode_t onWaitingActivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.onWaitingActivated(count = " + count +")");
-// rtcout.println(Logbuf.PARANOID,
-// "curr: " + comp.getStatus() +", next: " + comp.getStatus());
- // Now comp's next state must be ACTIVE state
- // If worker thread is stopped, restart worker thread.
- synchronized (m_worker) {
- m_worker.notifyAll();
- return ReturnCode_t.RTC_OK;
- }
- }
-
-
- /*!
- * @brief onWaitingDeactivated() template function
- */
- public ReturnCode_t onWaitingDeactivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.onWaitingDeactivated(count = " + count +")");
- synchronized (m_worker) {
- m_worker.notifyAll();
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /*!
- * @brief onWaitingReset() template function
- */
- public ReturnCode_t onWaitingReset(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.onWaitingReset(count = " + count +")");
- synchronized (m_worker) {
- m_worker.notifyAll();
- return ReturnCode_t.RTC_OK;
- }
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡ãéå§}
- * {@.en Start the ExecutionContext}
- * <p>
- * {@.ja ExecutionContext ã®å®è¡ç¶æ
ã Runnning ã¨ããããã®ãªã¯ã¨ã¹ãã
- * çºè¡ãããExecutionContext ã®ç¶æ
ãé·ç§»ããã¨
- * ComponentAction::on_startup ãå¼ã³åºããããåå ãã¦ããRTã³ã³ãã¼
- * ãã³ãããåæåãããã¾ã§ ExecutionContext ãéå§ãããã¨ã¯ã§ã
- * ãªããExecutionContext ã¯è¤æ°åéå§/åæ¢ãç¹°ãè¿ããã¨ãã§ããã}
- * {@.en Request that the context enter the Running state. Once the
- * state transition occurs, the ComponentAction::on_startup
- * operation will be invoked. An execution context may not be
- * started until the RT-Components that participate in it have
- * been initialized. An execution context may be started and
- * stopped multiple times.}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t start() {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.start()");
- ReturnCode_t ret = onStarting();
- if( ret != ReturnCode_t.RTC_OK )
- {
- rtcout.println(Logbuf.ERROR, "onStarting() failed. Starting EC aborted.");
- return ret;
- }
- ret = m_worker.start();
- if(ret!=ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_startup() for each RTC failed.");
- return ret;
- }
- ret = onStarted();
- if(ret!=ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_startup() for each RTC failed.");
- m_worker.stop();
- rtcout.println(Logbuf.ERROR, "on_shutdown() was invoked, because of on_startup");
- return ret;
- }
- return ret;
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡ãåæ¢}
- * {@.en Stop the ExecutionContext}
- * <p>
- * {@.ja ExecutionContext ã®ç¶æ
ã Stopped ã¨ããããã®ãªã¯ã¨ã¹ããçºè¡ã
- * ããé·ç§»ãçºçããå ´åã¯ãComponentAction::on_shutdown ãå¼ã³åº
- * ããããåå ãã¦ããRTã³ã³ãã¼ãã³ããçµäºããåã«
- * ExecutionContext ãåæ¢ããå¿
è¦ããããExecutionContext ã¯è¤æ°å
- * éå§/åæ¢ãç¹°ãè¿ããã¨ãã§ããã}
- * {@.en Request that the context enter the Stopped state. Once the
- * transition occurs, the ComponentAction::on_shutdown operation
- * will be invoked. An execution context must be stopped before
- * the RT components that participate in it are finalized. An
- * execution context may be started and stopped multiple times.}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t stop(){
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.stop()");
-
- ReturnCode_t ret = onStopping(); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "onStopping() failed. Stopping EC aborted.");
- return ret;
- }
- ret = m_worker.stop(); // Actual stop()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_shutdown() for each RTC failed.");
- return ret;
- }
- ret = onStopped(); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_shutdown() for each RTC failed.");
- return ret;
- }
- return ret;
- }
-
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãåå¾ãã}
- * {@.en Get execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãåå¾ã
- * ãã}
- * {@.en This operation shall return the rate (in hertz) at which its
- * Active participating RTCs are being invoked.}
- *
- * @return
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- */
-
- public double get_rate() {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.get_rate()");
-
- return m_profile.getRate();
- }
-
- public TimeValue getPeriod()
- {
- TimeValue period = m_profile.getPeriod();
- return period;
- }
-
- /**
- * <p>ExecutionContextã®å®è¡å¨æ(Hz)ãè¨å®ãã¾ãã</p>
- *
- * @param rate å®è¡å¨æ(Hz)
- */
- public ReturnCode_t set_rate(double rate) {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.set_rate("+rate+")");
-
- if( rate<=0.0 ) return ReturnCode_t.BAD_PARAMETER;
-
- ReturnCode_t ret = m_profile.setRate(onSettingRate(rate));
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Setting execution rate failed. " + rate);
- return ret;
- }
- ret = onSetRate(rate);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "onSetRate("+ rate +") failed.");
- return ret;
- }
- rtcout.println(Logbuf.INFO, "onSetRate("+ rate +") done.");
- return ret;
- }
-
- /**
- * <p>ã³ã³ãã¼ãã³ããã¢ã¯ãã£ãåãã¾ãã</p>
- *
- * @param comp ã¢ã¯ãã£ãå対象ã³ã³ãã¼ãã³ã
- *
- * @return å®è¡çµæ
- */
- public ReturnCode_t activate_component(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.activate_component()");
- return activateComponent(comp);
- }
-
- public ReturnCode_t activateComponent(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.activateComponent()");
-
- ReturnCode_t ret = onActivating(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivating() failed.");
- return ret;
- }
- RTObjectStateMachine rtobj = null;
- ret = m_worker.activateComponent(comp, rtobj); // Actual activateComponent()
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncActivation) // Asynchronous activation mode
- {
- ret = onActivated(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivated() failed.");
- }
- return ret;
- }
- //------------------------------------------------------------
- // Synchronized activation mode
- rtcout.println(Logbuf.DEBUG,"Synchronous activation mode. "
- +"Waiting for the RTC to be ACTIVE state. ");
- return waitForActivated(rtobj);
- }
-
- public ReturnCode_t waitForActivated(RTObjectStateMachine rtobj)
- {
- long count =0 ;
- ReturnCode_t ret = onWaitingActivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingActivated failed.");
- return ret;
- }
- long cycle =
- (long )(m_activationTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_activationTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating INACTIVE -> ACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- ret = onWaitingActivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingActivated failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta= new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be ACTIVE state. " + delta + " [s] slept (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_activationTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be ACTIVE or ERROR
- if (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is " + rtobj.getState());
- ret = onActivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivated() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onActivated() done.");
- return ret;
- }
-
-
- /**
- * <p>ã³ã³ãã¼ãã³ããéã¢ã¯ãã£ãåãã¾ãã</p>
- *
- * @param comp éã¢ã¯ãã£ãå対象ã³ã³ãã¼ãã³ã
- *
- * @return å®è¡çµæ
- */
- public ReturnCode_t deactivate_component(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.deactivate_component()");
- return deactivateComponent(comp);
- }
-
- public ReturnCode_t deactivateComponent(LightweightRTObject comp)
- {
- rtcout.println(Logbuf.TRACE,"ExtTrigExecutionContext.deactivateComponent()");
- ReturnCode_t ret = onDeactivating(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivatingComponent() failed.");
- return ret;
- }
- // Deactivate all the RTCs
- RTObjectStateMachine rtobj = null;
- ret = m_worker.deactivateComponent(comp, rtobj);
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncDeactivation)
- {
- ret = onDeactivated(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivated() failed.");
- }
- return ret;
- }
- //------------------------------------------------------------
- // Waiting for synchronized deactivation
- rtcout.println(Logbuf.DEBUG,"Synchronous deactivation mode. "
- +"Waiting for the RTC to be INACTIVE state. ");
- return waitForDeactivated(rtobj);
- }
- public ReturnCode_t waitForDeactivated(RTObjectStateMachine rtobj)
- {
- long count = 0;
- ReturnCode_t ret = onWaitingDeactivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingDeactivated failed.");
- return ret;
- }
- long cycle =
- (long )(m_deactivationTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_deactivationTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating ACTIVE -> INACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.ACTIVE_STATE))
- {
- ret = onWaitingDeactivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingDeactivated failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta = new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be INACTIVE state. Sleeping " + delta + " [s] (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_activationTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be INACTIVE or ERROR
- if (rtobj.isCurrentState(LifeCycleState.ACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is "+ rtobj.getState());
- ret = onDeactivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivated() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onDeactivated() done.");
- return ret;
- }
-
-
- /**
- * <p>ã³ã³ãã¼ãã³ãããªã»ãããã¾ãã</p>
- *
- * @param comp ãªã»ãã対象ã³ã³ãã¼ãã³ã
- *
- * @return å®è¡çµæ
- */
- public ReturnCode_t reset_component(LightweightRTObject comp){
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.reset_component()");
- return removeComponent(comp);
- }
- public ReturnCode_t resetCcomponent(LightweightRTObject comp){
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.resetComponent()");
-
- ReturnCode_t ret = onResetting(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onResetting() failed.");
- return ret;
- }
- RTObjectStateMachine rtobj = null;
- ret = m_worker.resetComponent(comp, rtobj); // Actual resetComponent()
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncReset)
- {
- ret = onReset(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onReset() failed.");
- }
- return ret;
- }
- //------------------------------------------------------------
- // Waiting for synchronized reset
- rtcout.println(Logbuf.DEBUG,"Synchronous reset mode. "
- +"Waiting for the RTC to be INACTIVE state. ");
- return waitForReset(rtobj);
- }
- public ReturnCode_t waitForReset(RTObjectStateMachine rtobj)
- {
- long count = 0;
- ReturnCode_t ret = onWaitingReset(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingReset() failed.");
- return ret;
- }
- long cycle =
- (long )(m_resetTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_resetTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating ERROR -> INACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.ERROR_STATE))
- {
- ret = onWaitingReset(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingReset failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta = new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be INACTIVE state. Sleeping " + delta + " [s] (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_resetTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be INACTIVE
- if (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is "+ rtobj.getState());
- ret = onReset(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onReset() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onReset() done.");
- return ret;
- }
-
- /**
- * <p>ã³ã³ãã¼ãã³ãã®ç¶æ
ãåå¾ãã¾ãã</p>
- *
- * @param comp ç¶æ
åå¾å¯¾è±¡ã³ã³ãã¼ãã³ã
- *
- * @return ã³ã³ãã¼ãã³ãç¶æ
- */
- public LifeCycleState get_component_state(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.get_component_state()");
- return getComponentState(comp);
- }
- public LifeCycleState getComponentState(LightweightRTObject comp) {
-
- LifeCycleState state = m_worker.getComponentState(comp);
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.getComponentState() = " + state);
- if (state == LifeCycleState.CREATED_STATE)
- {
- rtcout.println(Logbuf.ERROR,"CREATED state: not initialized "
- +"RTC or unknwon RTC specified.");
- }
- return onGetComponentState(state);
- }
-
- /**
- * <p>ExecutionKindãåå¾ãã¾ãã</p>
- *
- * @return ExecutionKind
- */
- public ExecutionKind get_kind() {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.get_kind()");
-
- return getKind();
- }
- public ExecutionKind getKind()
- {
- ExecutionKind kind = m_profile.getKind();
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.getKind() = " + getKindString(kind));
- kind = onGetKind(kind);
- rtcout.println(Logbuf.DEBUG,"onGetKind() returns " + getKindString(kind));
- return kind;
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã追å ãã}
- * {@.en Add an RT-component}
- *
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«è¿½å ããã追å ãããRTã³
- * ã³ãã¼ãã³ã㯠attach_context ãå¼ã°ããInactive ç¶æ
ã«é·ç§»ããã
- * æå®ãããRTã³ã³ãã¼ãã³ããnullã®å ´åã¯ãBAD_PARAMETER ãè¿ãã
- * ããæå®ãããRTã³ã³ãã¼ãã³ãã DataFlowComponent 以å¤ã®å ´åã¯ã
- * BAD_PARAMETER ãè¿ãããã}
- * {@.en The operation causes the given RTC to begin participating in
- * the execution context. The newly added RTC will receive a call
- * to LightweightRTComponent::attach_context and then enter the
- * Inactive state. BAD_PARAMETER will be invoked, if the given
- * RT-Component is null or if the given RT-Component is other than
- * DataFlowComponent.}
- *
- * @param comp
- * {@.ja 追å 対象RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for add}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- *
- */
- public ReturnCode_t add_component(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.add_component()");
- return addComponent(comp);
- }
- public ReturnCode_t addComponent(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.addcomponent()");
-
- ReturnCode_t ret = onAddingComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onAddingComponent(). RTC is not attached.");
- return ret;
- }
- ret = m_worker.addComponent(comp); // Actual addComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECWorker addComponent() faild.");
- return ret;
- }
- ret = m_profile.addComponent(comp); // Actual addComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECProfile addComponent() faild.");
- return ret;
- }
- ret = onAddedComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onAddedComponent() faild.");
- rtcout.println(Logbuf.INFO,"Removing attached RTC.");
- m_worker.removeComponent(comp);
- m_profile.removeComponent(comp);
- return ret;
- }
- rtcout.println(Logbuf.INFO,"Component has been added to this EC.");
- return ret;
- }
-
- /**
- * {@.ja ã³ã³ãã¼ãã³ãããã¤ã³ãããã}
- * {@.en Bind the component.}
- *
- * <p>
- * {@.ja ã³ã³ãã¼ãã³ãããã¤ã³ãããã}
- * {@.en Bind the component.}
- *
- * @param rtc
- * {@.ja RTã³ã³ãã¼ãã³ã}
- * {@.en RT-Component's instances}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
- public ReturnCode_t bindComponent(RTObject_impl rtc) {
- return m_worker.bindComponent(rtc);
- }
- /**
- * {@.ja RTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãã}
- * {@.en Remove the RT-Component from participant list}
- *
- * <p>
- * {@.ja æå®ããRTã³ã³ãã¼ãã³ããåå è
ãªã¹ãããåé¤ãããåé¤ããã
- * RTã³ã³ãã¼ãã³ã㯠detach_context ãå¼ã°ãããæå®ãããRTã³ã³ãã¼
- * ãã³ããåå è
ãªã¹ãã«ç»é²ããã¦ããªãå ´åã¯ãBAD_PARAMETER ãè¿
- * ãããã}
- * {@.en This operation causes a participant RTC to stop participating in
- * the execution context.
- * The removed RTC will receive a call to
- * LightweightRTComponent::detach_context.
- * BAD_PARAMETER will be returned, if the given RT-Component is not
- * participating in the participant list.}
- *
- * @param comp
- * {@.ja åé¤å¯¾è±¡RTã³ã³ãã¼ãã³ã}
- * {@.en The target RT-Component for delete}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- *
- */
-
- public ReturnCode_t remove_component(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.remove_component()");
- return removeComponent(comp);
- }
-
- public ReturnCode_t removeComponent(LightweightRTObject comp) {
-
- rtcout.println(Logbuf.TRACE,
- "ExtTrigExecutionContext.removeComponent()");
- ReturnCode_t ret = onRemovingComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onRemovingComponent(). "
- +"RTC will not not attached.");
- return ret;
- }
- ret = m_worker.removeComponent(comp); // Actual removeComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECWorker removeComponent() faild.");
- return ret;
- }
- ret = m_profile.removeComponent(comp); // Actual removeComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECProfile removeComponent() faild.");
- return ret;
- }
- ret = onRemovedComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onRemovedComponent() faild.");
- rtcout.println(Logbuf.INFO,"Removing attached RTC.");
- m_worker.removeComponent(comp);
- m_profile.removeComponent(comp);
- return ret;
- }
- rtcout.println(Logbuf.INFO,"Component has been removeed to this EC.");
- return ret;
- }
- /**
- * <p>ExecutionContextProfile ãåå¾ãã¾ãã</p>
- *
- * @return ExecutionContextProfile
- */
- public RTC.ExecutionContextProfile get_profile() {
-
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.get_profile()");
- return getProfile();
- }
-
- /**
- * <p>DataFlowComponentã®Actionå®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- protected abstract class DFPBase {
- /**
- * <p>ã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
- *
- * @param id ExecutionContextã®ID
- */
- public DFPBase(int id) {
- ec_id = id;
- m_sm = new StateMachine(3);
- m_sm.setListener(this);
- StateHolder st = new StateHolder();
- m_sm.setEntryAction(LifeCycleState.ACTIVE_STATE, new onActivated());
- m_sm.setDoAction(LifeCycleState.ACTIVE_STATE, new onExecute());
- m_sm.setPostDoAction(LifeCycleState.ACTIVE_STATE, new onStateUpdate());
- m_sm.setExitAction(LifeCycleState.ACTIVE_STATE, new onDeactivated());
- m_sm.setEntryAction(LifeCycleState.ERROR_STATE, new onAborting());
- m_sm.setDoAction(LifeCycleState.ERROR_STATE, new onError());
- m_sm.setExitAction(LifeCycleState.ERROR_STATE, new onReset());
-
- st.prev = LifeCycleState.INACTIVE_STATE;
- st.curr = LifeCycleState.INACTIVE_STATE;
- st.next = LifeCycleState.INACTIVE_STATE;
- m_sm.setStartState(st);
- m_sm.goTo(LifeCycleState.INACTIVE_STATE);
- }
- /**
- * <p>onActivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onActivated implements StateAction {
- public void doAction(StateHolder state) {
- on_activated(state);
- }
- }
- /**
- * <p>onExecuteã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onExecute implements StateAction {
- public void doAction(StateHolder state) {
- on_execute(state);
- }
- }
- /**
- * <p>onStateUpdateã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onStateUpdate implements StateAction {
- public void doAction(StateHolder state) {
- on_state_update(state);
- }
- }
- /**
- * <p>onDeactivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onDeactivated implements StateAction {
- public void doAction(StateHolder state) {
- on_deactivated(state);
- }
- }
- /**
- * <p>onAbortingã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onAborting implements StateAction {
- public void doAction(StateHolder state) {
- on_aborting(state);
- }
- }
- /**
- * <p>onErrorã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onError implements StateAction {
- public void doAction(StateHolder state) {
- on_error(state);
- }
- }
- /**
- * <p>onResetã¢ã¯ã·ã§ã³å®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- private class onReset implements StateAction {
- public void doAction(StateHolder state) {
- on_reset(state);
- }
- }
-
- /**
- * <p>ExecutionContextã®startæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_startup();
- /**
- * <p>ExecutionContextã®stopæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_shutdown();
-
- /**
- * <p>ã³ã³ãã¼ãã³ãã®activateæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_activated(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ãã®deactivateæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_deactivated(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ãã®abortæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_aborting(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ããerrorç¶æ
ã®æã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_error(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ãresetæã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_reset(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ãå®è¡æã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_execute(final StateHolder st);
- /**
- * <p>ã³ã³ãã¼ãã³ãã®å®è¡æã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_state_update(final StateHolder st);
-
- /**
- * <p>ExecutionContextã®å®è¡å¨æå¤æ´æã«å¼ã°ããæ½è±¡ã¡ã½ããã§ãã</p>
- */
- public abstract void on_rate_changed();
- /**
- * <p>ExecutionContextã®ç¶æ
é·ç§»ç¨ã¯ã¼ã«ã¼ã§ãã</p>
- */
- public void worker() {
- m_sm.worker();
- }
- public void worker_pre() {
- m_sm.worker_pre();
- }
- public void worker_do() {
- m_sm.worker_do();
- }
- public void worker_post() {
- m_sm.worker_post();
- }
-
- /**
- * <p>ç¾å¨ã®ç¶æ
ãåå¾ãã¾ãã</p>
- *
- * @return ç¾å¨ã®ç¶æ
- */
- public LifeCycleState get_state(){
- return m_sm.getState();
- }
-
- /**
- * <p>ExecutionContextã®ID</p>
- */
- public int ec_id;
- /**
- * <p>ExecutionContextã®StateMachine</p>
- */
- public StateMachine<LifeCycleState, DFPBase> m_sm;
-
- }
-
- /**
- * <p>DataFlowComponentã®Actionå®ç¾©ç¨æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
- protected class DFP extends DFPBase {
- /**
- * <p>ã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
- *
- * @param obj 対象ã³ã³ãã¼ãã³ã
- * @param id ExecutionContextã®ID
- */
- public DFP(DataFlowComponent obj, int id) {
- super(id);
- m_obj = obj;
- }
- /**
- * <p>onStartupã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_startup() {
- m_obj.on_startup(ec_id);
- }
- /**
- * <p>onShutdownã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_shutdown() {
- m_obj.on_shutdown(ec_id);
- }
- /**
- * <p>onActivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_activated(final StateHolder st) {
- if( m_obj.on_activated(ec_id) != ReturnCode_t.RTC_OK ) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- * <p>onDeactivatedã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_deactivated(final StateHolder st) {
- if( m_obj.on_deactivated(ec_id) != ReturnCode_t.RTC_OK ) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- * <p>onAbortingã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_aborting(final StateHolder st) {
- m_obj.on_aborting(ec_id);
- }
- /**
- * <p>onErrorã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_error(final StateHolder st) {
- m_obj.on_error(ec_id);
- }
- /**
- * <p>onResetã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_reset(final StateHolder st) {
- if( m_obj.on_reset(ec_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- * <p>onExecuteã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_execute(final StateHolder st) {
- if( m_obj.on_execute(ec_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- * <p>onStateUpdateã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_state_update(final StateHolder st) {
- if( m_obj.on_state_update(ec_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
- }
- return;
- }
- /**
- * <p>onRateChangedã¢ã¯ã·ã§ã³å®ç¾©ç¨ã¡ã½ããã§ãã</p>
- */
- public void on_rate_changed() {
- m_obj.on_rate_changed(ec_id);
- }
- private DataFlowComponent m_obj;
- }
-
- /**
- * <p>ExecutionContextã«attachãããã³ã³ãã¼ãã³ãã®ã¡ã½ããå¼åºç¨ã¯ã©ã¹ã§ãã</p>
- */
- protected class Comp {
- /**
- * <p>ã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
- *
- * @param ref 対象ã³ã³ãã¼ãã³ã
- * @param dfp ExecutionContextã®å¯¾è±¡StateMachine
- * @param id ExecutionContextã®ID
- */
- public Comp(LightweightRTObject ref, DataFlowComponent dfp, int id) {
- this._ref = ref;
- this._sm = new DFP(dfp, id);
- }
- /**
- * <p>ã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
- *
- * @param comp 対象ã³ã³ãã¼ãã³ã
- */
- public Comp(final Comp comp) {
- this._ref = comp._ref;
- this._sm = new DFP(comp._sm.m_obj, comp._sm.ec_id);
- }
- /**
- * <p>ã³ã³ãã¼ãã³ããã³ãã¼ãã¾ãã</p>
- *
- * @param comp 対象ã³ã³ãã¼ãã³ã
- */
- public Comp substitute(final Comp comp) {
- this._ref = comp._ref;
- this._sm.m_obj = comp._sm.m_obj;
- this._sm.ec_id = comp._sm.ec_id;
- return this;
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke(){
- this._sm.worker();
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_pre(){
- this._sm.worker_pre();
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_do(){
- this._sm.worker_do();
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_post(){
- this._sm.worker_post();
- }
- /**
- * <p>StartUpæã«å¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_on_startup(){
- this._sm.on_startup();
- }
- /**
- * <p>ShutDownæã«å¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_on_shutdown(){
- this._sm.on_shutdown();
- }
- /**
- * <p>RateChangedæã«å¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_on_rate_changed(){
- this._sm.on_rate_changed();
- }
- /**
- * <p>StateMachine管ç対象ã³ã³ãã¼ãã³ãã§ãã</p>
- */
- public LightweightRTObject _ref;
- /**
- * <p>対象ã³ã³ãã¼ãã³ãã®StateMachineã§ãã</p>
- */
- public DFP _sm;
- }
- /**
- * <p>管ç対象ã³ã³ãã¼ãã³ãæ¤ç´¢ç¨ãã«ãã¼ã¯ã©ã¹ã§ãã</p>
- */
- protected class find_comp {
- private LightweightRTObject m_comp;
- public find_comp(LightweightRTObject comp) {
- m_comp = comp;
- }
- public boolean eqaulof(Comp comp) {
- return comp._ref._is_equivalent(m_comp);
- }
- };
-
- /**
- * <p>ExecutionContextã«atttachããã¦ããã³ã³ãã¼ãã³ãã®ãªã¹ãã§ãã</p>
- */
- protected ArrayList<Comp> m_comps = new ArrayList<Comp>();
- /**
- * <p>ExecutionContextã®å®è¡ç¶æ
ã§ãã</p>
- */
- protected boolean m_running;
- /**
- * <p>ExecutionContext ã®ã¹ã¬ããå®è¡ãã©ã°ã§ãã</p>
- */
- private boolean m_svc;
-
private class Worker {
public Worker() {
@@ -1403,63 +102,16 @@
public boolean _called;
}
-// private Worker m_worker = new Worker();
- private ExecutionContextWorker m_worker = new ExecutionContextWorker();
+ private Worker m_worker = new Worker();
/**
- * <p>ExecutionContextProfileã§ãã</p>
- */
- protected ExecutionContextProfile m_profile = new ExecutionContextProfile();
- /**
- * <p>ExecutionContextã®åä½å¨æã§ãã</p>
- */
- protected long m_usec;
- /**
- * <p>ExecutionContextServiceã¨ãã¦ã®CORBAãªãã¸ã§ã¯ãåç
§ã§ãã</p>
- */
- protected ExecutionContextService m_ref;
- protected boolean m_nowait;
- protected Thread m_thread = null;
-
-
- /**
- * {@.ja OpenHRPExecutionContext ãçæãã}
- * {@.en Creats OpenHRPExecutionContext}
- *
- * @return
- * {@.ja çæãããExtTrigExecutionContext}
- * {@.en Object Created instances}
- *
- *
- */
- public ExecutionContextBase creator_() {
- return new ExtTrigExecutionContext();
- }
- /**
- * {@.ja Object ãç ´æ£ãã}
- * {@.en Destructs Object}
- *
- * @param obj
- * {@.ja ç ´æ£ããã¤ã³ã¿ã¹ã¿ã³ã¹}
- * {@.en The target instances for destruction}
- *
- */
- public void destructor_(Object obj) {
- obj = null;
- }
- /**
* <p>ãã®ExecutionContextãçæããFactoryã¯ã©ã¹ã
* ExecutionContextç¨ObjectManagerã«ç»é²ãã¾ãã</p>
*
* @param manager Managerãªãã¸ã§ã¯ã
*/
public static void ExtTrigExecutionContextInit(Manager manager) {
-
- ExecutionContextFactory<ExecutionContextBase,String> factory
- = ExecutionContextFactory.instance();
- factory.addFactory("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext",
- new ExtTrigExecutionContext(),
- new ExtTrigExecutionContext());
+ manager.registerECFactory("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext");
}
/**
@@ -1484,323 +136,4 @@
* <p>Loggingç¨ãã©ã¼ããããªãã¸ã§ã¯ã</p>
*/
protected Logbuf rtcout;
- /**
- * {@.ja ExecutionContextã¯ã©ã¹ã®åæåé¢æ°}
- * {@.en Initialization function of ExecutionContext class}
- */
- public void init(Properties props) {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.init()");
- rtcout.println(Logbuf.DEBUG, props.toString());
- // getting rate
- setExecutionRate(props);
- // getting sync/async mode flag
- boolean transitionMode=true;
- if(setTransitionMode(props, "sync_transition", transitionMode))
- {
- m_syncActivation = transitionMode;
- m_syncDeactivation = transitionMode;
- m_syncReset = transitionMode;
-
- }
- setTransitionMode(props, "sync_activation", m_syncActivation);
- setTransitionMode(props, "sync_deactivation", m_syncDeactivation);
- setTransitionMode(props, "sync_reset", m_syncReset);
- // getting transition timeout
- TimeValue timeout = new TimeValue(0.0);
- if (setTimeout(props, "transition_timeout", timeout))
- {
- m_activationTimeout = timeout;
- m_deactivationTimeout = timeout;
- m_resetTimeout = timeout;
- }
- setTimeout(props, "activation_timeout", m_activationTimeout);
- setTimeout(props, "deactivation_timeout", m_deactivationTimeout);
- setTimeout(props, "reset_timeout", m_resetTimeout);
-
- rtcout.println(Logbuf.DEBUG,"ExecutionContext's configurations:");
- rtcout.println(Logbuf.DEBUG,"Exec rate : " + getRate() + " [Hz]");
- rtcout.println(Logbuf.DEBUG,"Activation : Sync = " + ( m_syncActivation ? "YES" : "NO" ) + " Timeout = " + m_activationTimeout.toString());
- rtcout.println(Logbuf.DEBUG,"Deactivation: Sync = " + ( m_syncDeactivation ? "YES" : "NO" )+ " Timeout = "+ m_deactivationTimeout.toString());
- rtcout.println(Logbuf.DEBUG,"Reset : Sync = " + ( m_syncReset ? "YES" : "NO" )+ " Timeout = "+ m_resetTimeout.toString());
- // Setting given Properties to EC's profile::properties
-
- setProperties(props);
- }
-
- /**
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§ã®åå¾}
- * {@.en Get the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ãåç
§ãåå¾ããã}
- * {@.en Get the reference to the CORBA object as
- * ExecutioncontextService of this object.}
- *
- * @param ref
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§}
- * {@.en The reference to CORBA object}
- *
- */
- public void setObjRef(final ExecutionContextService ref) {
- m_profile.setObjRef(ref);
- }
- /**
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§ã®åå¾}
- * {@.en Get the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ãåç
§ãåå¾ããã}
- * {@.en Get the reference to the CORBA object as
- * ExecutioncontextService of this object.}
- *
- * @return
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§}
- * {@.en The reference to CORBA object}
- *
- */
- public ExecutionContextService getObjRef() {
- return m_profile.getObjRef();
- }
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãè¨å®ãã}
- * {@.en Set execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãè¨å®ã
- * ããå®è¡å¨æã®å¤æ´ã¯ãDataFlowComponentAction ã®
- * on_rate_changed ã«ãã£ã¦åRTã³ã³ãã¼ãã³ãã«ä¼éãããã}
- * {@.en This operation shall set the rate (in hertz) at which this
- * contextâs Active participating RTCs are being called. If the
- * execution kind of the context is PERIODIC, a rate change shall
- * result in the invocation of on_rate_changed on any RTCs
- * realizing DataFlowComponentAction that are registered with any
- * RTCs participating in the context.}
- *
- * @param rate
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã
- * RTC_OK: æ£å¸¸çµäº
- * BAD_PARAMETER: è¨å®å¤ãè² ã®å¤}
- * {@.en The return code of ReturnCode_t type
- * RTC_OK: Succeed
- * BAD_PARAMETER: Invalid value. The value might be negative.}
- *
- */
- public ReturnCode_t setRate(double rate) {
- return m_profile.setRate(rate);
- }
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãåå¾ãã}
- * {@.en Get execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãåå¾ã
- * ãã}
- * {@.en This operation shall return the rate (in hertz) at which its
- * Active participating RTCs are being invoked.}
- *
- * @return
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- */
- public double getRate() {
- return m_profile.getRate();
- }
- /**
- * {@.ja ExecutionKind ãæåååãã}
- * {@.en Converting ExecutionKind enum to string}
- * <p>
- * {@.ja RTC::ExecutionKind ã§å®ç¾©ããã¦ãã PERIODIC, EVENT_DRIVEN,
- * OTHER ãæåååããã}
- * {@.en This function converts enumeration (PERIODIC, EVENT_DRIVEN,
- * OTHER) defined in RTC::ExecutionKind to string.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- * @return
- * {@.ja æåååãããExecutionKind}
- * {@.en String of ExecutionKind}
- *
- */
- public final String getKindString(ExecutionKind kind) {
- return m_profile.getKindString(kind);
- }
- /**
- * {@.ja ExecutionKind ãè¨å®ãã}
- * {@.en Set the ExecutionKind}
- * <p>
- * {@.ja ãã® ExecutionContext ã® ExecutionKind ãè¨å®ãã}
- * {@.en This operation sets the kind of the execution context.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en kind ExecutionKind}
- *
- */
- public ReturnCode_t setKind(ExecutionKind kind) {
- return m_profile.setKind(kind);
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ããã»ããããã}
- * {@.en Setting owner component of the execution context}
- * <p>
- * {@.ja ãã®ECã®Ownerã¨ãªãRTCãã»ããããã}
- * {@.en This function sets an RT-Component to be owner of
- * the execution context.}
- *
- * @param comp
- * {@.ja Ownerã¨ãªãRTã³ã³ãã¼ãã³ã}
- * {@.en an owner RT-Component of this execution context}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t setOwner(LightweightRTObject comp){
- return m_profile.setOwner(comp);
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ãã®åç
§ãåå¾ãã}
- * {@.en Getting a reference of the owner component}
- * <p>
- * {@.ja ãã®ECã®Ownerã§ããRTCã®åç
§ãåå¾ããã}
- * {@.en This function returns a reference of the owner RT-Component of
- * this execution context}
- *
- * @return
- * {@.ja OwnerRTã³ã³ãã¼ãã³ãã®åç
§}
- * {@.en a reference of the owner RT-Component}
- */
- public RTC.RTObject getOwner() {
- return m_profile.getOwner();
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã®åå è
ãªã¹ããåå¾ãã}
- * {@.en @brief Getting participant RTC list}
- * <p>
- * {@.ja ç¾å¨ç»é²ããã¦ããåå è
RTCã®ãªã¹ããåå¾ããã}
- * {@.en This function returns a list of participant RTC of
- * the execution context.}
- *
- * @return
- * {@.ja åå è
RTCã®ãªã¹ã}
- * {@.en Participants RTC list}
- *
- */
- public RTC.RTObject[] getComponentList(){
- return m_profile.getComponentList();
- }
-
-
- /**
- * {@.ja Propertiesãã»ãããã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãã»ããããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public void setProperties(Properties props){
- m_profile.setProperties(props);
- }
-
- /**
- * {@.ja Propertiesãåå¾ãã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãåå¾ããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- * @return
- * {@.ja Propertiesã«å¤æããã ExecutionContextProfile::properties}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public Properties getProperties() {
- return m_profile.getProperties();
- }
-
- /**
- * {@.ja rofileãåå¾ãã}
- * {@.en Getting Profile}
- * <p>
- * {@.ja ExecutionContextProfile ãåå¾ããã}
- * {@.en This function gets ExecutionContextProfile.}
- *
- * @return
- * {@.ja ExecutionContextProfile}
- * {@.en ExecutionContextProfile}
- *
- */
- public RTC.ExecutionContextProfile getProfile(){
- return m_profile.getProfile();
- }
- /*!
- * @if jp
- * @brief Propertiesããç¶æ
é·ç§»Timeoutãã»ãããã
- * @else
- * @brief Setting state transition timeout from given properties.
- * @endif
- */
- public boolean setTimeout(Properties props, String key,TimeValue timevalue)
- {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.setTimeout(" + key +")");
- if (props.findNode(key) != null)
- {
- timevalue.convert(Double.valueOf(props.getNode(key).getValue())) ;
- rtcout.println(Logbuf.DEBUG, "Timeout (" + key +"): " + props.getNode(key).getValue() + " [s]");
- return true;
- }
- rtcout.println(Logbuf.DEBUG, "Configuration " + key +" not found.");
- return false;
- }
- /*!
- * @if jp
- * @brief Propertiesããå®è¡ã³ã³ããã¹ããã»ãããã
- * @else
- * @brief Setting execution rate from given properties.
- * @endif
- */
- public boolean setExecutionRate(Properties props)
- {
- if (props.findNode("rate") != null)
- {
- double rate;
- rate = Double.valueOf(props.getNode("rate").getValue());
- setRate(rate);
- return true;
- }
- return false;
- }
- /*!
- * @if jp
- * @brief Propertiesããç¶æ
é·ç§»Timeoutãã»ãããã
- * @else
- * @brief Setting state transition timeout from given properties.
- * @endif
- */
- public boolean setTransitionMode(Properties props, String key, boolean flag)
- {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.setTransitionMode(" + key +")");
- if (props.findNode(key) != null)
- {
- flag = props.getNode(key).getValue() == "YES";
- rtcout.println(Logbuf.DEBUG, "Transition Mode: " + key +" = " + ( flag ? "YES" : "NO"));
- return true;
- }
- rtcout.println(Logbuf.DEBUG, "Configuration " + key +" not found.");
- return false;
- }
-
}
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/IExecutionContextBase.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/IExecutionContextBase.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/IExecutionContextBase.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,46 +0,0 @@
-package jp.go.aist.rtm.RTC.executionContext;
-
-import org.omg.CORBA.SystemException;
-
-import RTC.ExecutionContextService;
-import OpenRTM.ExtTrigExecutionContextServicePOA;
-
-import jp.go.aist.rtm.RTC.RTObject_impl;
-import jp.go.aist.rtm.RTC.util.Properties;
-import RTC.ExecutionKind;
-import RTC.ReturnCode_t;
-
-/**
- * <p>Periodic Sampled Data Processing(å¨æå®è¡ç¨)ExecutionContextã®ãã¼ã¹ã¨ãªã
- * æ½è±¡ã¯ã©ã¹ã§ãã</p>
- */
-//public abstract class ExecutionContextBase
-// implements ECNewDeleteFunc {
-public interface IExecutionContextBase extends ECNewDeleteFunc {
-
- /**
- * {@.ja ExecutionContextã¯ã©ã¹ã®åæåé¢æ°}
- * {@.en Initialization function of ExecutionContext class}
- */
- public void init(Properties props);
-
- /**
- * <p> bindComponent </p>
- *
- * @param rtc RTObject
- * @return ReturnCode_t
- *
- */
- public ReturnCode_t bindComponent(RTObject_impl rtc);
-
- public boolean finalizeExecutionContext();
-/*
- public ExecutionContextProfile m_profile
- = new jp.go.aist.rtm.RTC.executionContext.ExecutionContextProfile();
-*/
-/*
- protected ExecutionContextProfile m_profile
- = new ExecutionContextProfile();
-*/
-
-}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/OpenHRPExecutionContext.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/OpenHRPExecutionContext.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/OpenHRPExecutionContext.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,135 +1,83 @@
package jp.go.aist.rtm.RTC.executionContext;
import jp.go.aist.rtm.RTC.Manager;
-import jp.go.aist.rtm.RTC.ObjectCreator;
-import jp.go.aist.rtm.RTC.ObjectDestructor;
-import jp.go.aist.rtm.RTC.log.Logbuf;
-import jp.go.aist.rtm.RTC.util.TimeValue;
import org.omg.CORBA.SystemException;
-import RTC.ReturnCode_t;
-
/**
* <p> OpenHRPExecutionContext </p>
*
*/
public class OpenHRPExecutionContext
-// extends PeriodicExecutionContext implements Runnable{
-extends PeriodicExecutionContext
-implements Runnable, ObjectCreator<ExecutionContextBase>, ObjectDestructor, ExecutionContextBase{
+ extends PeriodicExecutionContext implements Runnable{
+
/**
* <p> Constructor </p>
*/
public OpenHRPExecutionContext() {
super();
- m_count = 0;
}
/**
* <p> tick </p>
*/
public void tick() throws SystemException {
- if(m_workerthread.isRunning())
- {
- return ;
- }
- synchronized (m_tickmutex) {
- m_workerthread.invokeWorkerPostDo();
- TimeValue t0 = new TimeValue();
- t0.convert(System.nanoTime()/1000);
- m_workerthread.invokeWorkerDo();
- TimeValue t1 = new TimeValue();
- t1.convert(System.nanoTime()/1000);
- m_workerthread.invokeWorkerPostDo();
- TimeValue t2 = new TimeValue();
- t2.convert(System.nanoTime()/1000);
-
- TimeValue period = getPeriod();
- if(m_count > 1000)
- {
- TimeValue t1_w = t1;
- TimeValue t2_w = t2;
- TimeValue t2_w2 = t2;
- TimeValue period_w = period ;
- rtcout.println(Logbuf.PARANOID, "Period: " + period_w + " [s]");
- rtcout.println(Logbuf.PARANOID, "Exec-Do: " + t1_w.minus(t0) + " [s]");
- rtcout.println(Logbuf.PARANOID, "Exec-PostDo:" + t2_w.minus(t1) + " [s]");
- rtcout.println(Logbuf.PARANOID, "Sleep: " + period_w.minus(t2_w2.minus(t0)) + " [s]");
+ synchronized (m_comps) {
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ m_comps.elementAt(intIdx).invoke();
}
- TimeValue t3 = new TimeValue();
- t3.convert(System.nanoTime()/1000);
- t2.minus(t0);
- if( period.getUsec() > t2.getUsec() )
- {
- if( m_count > 1000)
- {
- rtcout.println(Logbuf.PARANOID, "sleeping...");
- }
- period.minus(t2);
- try {
- Thread.sleep(period.getUsec());
- } catch (InterruptedException e){
- e.printStackTrace();
- }
- }
- if(m_count > 1000)
- {
- TimeValue t4 = new TimeValue();
- t4.convert(System.nanoTime()/1000);
- rtcout.println(Logbuf.PARANOID, "Slept: " + t4.minus(t3) + " [s]");
- m_count = 0;
- }
- ++m_count ;
- return ;
}
}
- private int m_count ;
- private String m_tickmutex = new String();
-
/**
+ * <p> svc </p>
*
+ * @return int
+ *
*/
- private ExecutionContextWorker m_workerthread = new ExecutionContextWorker();
+ public int svc() {
+ return 0;
+ }
/**
- * {@.ja OpenHRPExecutionContext ãçæãã}
- * {@.en Creats OpenHRPExecutionContext}
- *
- * @return
- * {@.ja çæãããOpenHRPExecutionContext}
- * {@.en Object Created instances}
+ * <p> run </p>
*
*
*/
- public OpenHRPExecutionContext creator_() {
- return new OpenHRPExecutionContext();
+ public void run() {
+ this.svc();
}
+
/**
- * {@.ja Object ãç ´æ£ãã}
- * {@.en Destructs Object}
- *
- * @param obj
- * {@.ja ç ´æ£ããã¤ã³ã¿ã¹ã¿ã³ã¹}
- * {@.en The target instances for destruction}
- *
+ * <p> Worker </p>
*/
- public void destructor_(Object obj) {
- obj = null;
+ private class Worker {
+
+ /**
+ * <p> constructor </p>
+ */
+ public Worker() {
+ this._called = false;
+ }
+
+ /**
+ *
+ */
+ public boolean _called;
}
+
/**
+ *
+ */
+ private Worker m_worker = new Worker();
+
+ /**
* <p> OpenHRPExecutionContextInit </p>
*
* @param manager Manager
*/
public static void OpenHRPExecutionContextInit(Manager manager) {
-// manager.registerECFactory("jp.go.aist.rtm.RTC.executionContext.OpenHRPExecutionContext");
- ExecutionContextFactory<ExecutionContextBase,String> factory
- = ExecutionContextFactory.instance();
- factory.addFactory("jp.go.aist.rtm.RTC.executionContext.OpenHRPExecutionContext",
- new OpenHRPExecutionContext(),
- new OpenHRPExecutionContext());
+ manager.registerECFactory("jp.go.aist.rtm.RTC.executionContext.OpenHRPExecutionContext");
}
/**
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -3,9 +3,6 @@
import java.util.Vector;
import jp.go.aist.rtm.RTC.Manager;
-import jp.go.aist.rtm.RTC.ObjectCreator;
-import jp.go.aist.rtm.RTC.ObjectDestructor;
-import jp.go.aist.rtm.RTC.RTObjectStateMachine;
import jp.go.aist.rtm.RTC.RTObject_impl;
import jp.go.aist.rtm.RTC.StateAction;
import jp.go.aist.rtm.RTC.StateHolder;
@@ -14,16 +11,13 @@
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.POAUtil;
-import jp.go.aist.rtm.RTC.util.Properties;
-import jp.go.aist.rtm.RTC.util.TimeValue;
import jp.go.aist.rtm.RTC.util.equalFunctor;
-//import RTC.ExecutionContextProfile;
import OpenRTM.DataFlowComponent;
import OpenRTM.DataFlowComponentHelper;
+import RTC.ExecutionContextProfile;
import RTC.ExecutionContextProfileHolder;
import RTC.ExecutionContextService;
import RTC.ExecutionContextServiceHelper;
-import RTC.ExecutionContextServicePOA;
import RTC.ExecutionKind;
import RTC.LifeCycleState;
import RTC.LightweightRTObject;
@@ -34,18 +28,8 @@
* <p>Periodic Sampled Data Processing(å¨æå®è¡ç¨)ExecutionContextã¯ã©ã¹ã§ãã</p>
*/
-//public class PeriodicExecutionContext extends ExtTrigExecutionContextServicePOA implements Runnable, ExecutionContextBase {
-public class PeriodicExecutionContext
-extends ExecutionContextServicePOA
-implements Runnable, ObjectCreator<ExecutionContextBase>, ObjectDestructor, ExecutionContextBase {
+public class PeriodicExecutionContext extends ExecutionContextBase implements Runnable {
- TimeValue m_activationTimeout = new TimeValue(0.5);
- TimeValue m_deactivationTimeout = new TimeValue(0.5);
- TimeValue m_resetTimeout = new TimeValue(0.5);
- boolean m_syncActivation = true;
- boolean m_syncDeactivation = true;
- boolean m_syncReset = true;
-
/**
* {@.ja ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿}
* {@.en Default Constructor}
@@ -63,29 +47,98 @@
public PeriodicExecutionContext() {
super();
rtcout = new Logbuf("PeriodicExecutionContext");
- m_svc = false;
+ m_running = false;
+ m_svc = true;
m_nowait = false;
- m_profile.setObjRef((ExecutionContextService)this.__this());
- m_profile.setKind(ExecutionKind.PERIODIC);
- m_profile.setRate(1000);
- rtcout.println(Logbuf.DEBUG, "Actual period: " + m_profile.getPeriod().sec() + " [sec], "
- + m_profile.getPeriod().usec() + " [usec]");
+ double rate = (1.0/0.000001);//1000000Hz
+
+ m_usec = (long)(1000000/rate);
+
+ m_ref = (ExecutionContextService)this.__this();
+
+
+ m_profile.kind = ExecutionKind.PERIODIC;
+ m_profile.rate = 0.0;
+ m_profile.owner = (RTC.RTObject)null;
+ m_profile.participants = new RTC.RTObject[0];
+ m_profile.properties = new _SDOPackage.NameValue[0];
}
/**
+ * {@.ja ã³ã³ã¹ãã©ã¯ã¿}
+ * {@.en Constructor}
+ *
+ * <p>
+ * {@.ja è¨å®ãããå¤ããããã¡ã¤ã«ã«è¨å®ããã}
+ * {@.en Set the configuration value to profile.}
+ *
+ * @param owner
+ * {@.ja å½è©² Executioncontext ã® owner}
+ * {@.en The owner of this Executioncontext}
+ *
+ */
+ public PeriodicExecutionContext(DataFlowComponent owner) {
+ this(owner, 1000);
+ }
+
+ /**
+ * {@.ja ã³ã³ã¹ãã©ã¯ã¿}
+ * {@.en Constructor}
+ *
+ * <p>
+ * {@.ja è¨å®ãããå¤ããããã¡ã¤ã«ã«è¨å®ããã}
+ * {@.en Set the configuration value to profile.}
+ *
+ * @param owner
+ * {@.ja å½è©² Executioncontext ã® owner}
+ * {@.en The owner of this Executioncontext}
+ * @param rate
+ * {@.ja åä½å¨æ(Hz)}
+ * {@.en Execution cycle(Hz)}
+ *
+ */
+ public PeriodicExecutionContext(DataFlowComponent owner, double rate) {
+ super();
+ rtcout = new Logbuf("PeriodicExecutionContext");
+ rtcout.println(Logbuf.TRACE,
+ "PeriodicExecutionContext(owner,rate="+rate+")");
+ m_running = false;
+ m_svc = true;
+ m_nowait = true;
+
+ if( rate==0 ) rate = (1.0/0.000001);//1000000Hz
+
+ m_usec = (long)(1000000/rate);
+ if( m_usec==0 ) m_nowait = true;
+
+ m_ref = (ExecutionContextService)this.__this();
+
+
+ m_profile.kind = ExecutionKind.PERIODIC;
+ m_profile.rate = rate;
+ m_profile.owner = owner;
+ m_profile.participants = new RTC.RTObject[0];
+ m_profile.properties = new _SDOPackage.NameValue[0];
+ }
+
+ /**
* <p>çµäºå¦çç¨é¢æ°</p>
*/
public boolean finalizeExecutionContext() {
- synchronized (m_svcmutex) {
- m_svc = false;
+ synchronized (m_worker) {
+ m_worker.running_ = true;
+ m_worker.notifyAll();
}
- synchronized (mutex_) {
- m_workerthread.running_ = true;
- mutex_.notifyAll();
- }
-
- return true;
+ m_svc = false;
+ try {
+ m_thread.join();
+ }
+ catch (InterruptedException e) {
+ System.out.println(e);
+ }
+
+ return true;
}
/**
@@ -119,7 +172,17 @@
m_ref = ref;
}
+ /**
+ * <p> getObjRef </p>
+ *
+ * @return ExecutionContextService
+ */
+ public ExecutionContextService getObjRef() {
+ rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.getObjRef()");
+
+ return m_ref;
+ }
/**
* <p>æ¬ãªãã¸ã§ã¯ãã®ExecutionContextServiceã¨ãã¦ã®CORBAãªãã¸ã§ã¯ãåç
§ãè¨å®ãã¾ãã</p>
*
@@ -138,6 +201,7 @@
public int open() {
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.open()");
+
if(m_thread==null) {
m_thread = new Thread(this, "PeriodicExecutionContext");
m_thread.start();
@@ -150,60 +214,35 @@
* ç»é²ãããã³ã³ãã¼ãã³ãã®å¦çãå¼ã³åºãã¾ãã</p>
*/
public int svc() {
- int count = 0 ;
+
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.svc()");
do {
-
- m_workerthread.invokeWorkerPreDo();
- synchronized (mutex_) {
- while (!m_workerthread.running_) {
+ synchronized (m_worker) {
+ while (!m_worker.running_) {
try {
- mutex_.wait();
+ m_worker.wait();
} catch (InterruptedException e) {
break;
}
- }
- }
- TimeValue t0 = new TimeValue();
- t0.convert(System.nanoTime()/1000);
- m_workerthread.invokeWorkerDo();
- m_workerthread.invokeWorkerPostDo();
- TimeValue t1 = new TimeValue();
- t1.convert(System.nanoTime()/1000);
-
- TimeValue period = getPeriod();
- if(true){
- rtcout.println(Logbuf.PARANOID, "Period: " + period + " [s]");
- rtcout.println(Logbuf.PARANOID, "Execution: " + t1.minus(t0) + " [s]");
- rtcout.println(Logbuf.PARANOID, "Sleep: " + period.minus(t1) + " [s]");
- }
- TimeValue t2 = new TimeValue();
- t2.convert(System.nanoTime()/1000);
- if( !m_nowait && period.getUsec() > 0)
- {
- if(count > 1000)
- {
- rtcout.println(Logbuf.PARANOID, "sleeping...");
- }
+ }
+ if (m_worker.running_) {
+ for (int intIdx=0; intIdx < m_comps.size(); ++intIdx) {
+ m_comps.elementAt(intIdx).invoke();
+ }
+ }
+ }
+ if( !m_nowait ) {
+ long millisec = m_usec / 1000;
+ int nanosec = (int)((m_usec % 1000) * 1000);
try {
- Thread.sleep(period.getUsec());
- } catch (InterruptedException e){
+ Thread.sleep(millisec, nanosec);
+ } catch (InterruptedException e) {
e.printStackTrace();
}
}
- if(true)
- {
- TimeValue t3 = new TimeValue();
- t3.convert(System.nanoTime()/1000);
- rtcout.println(Logbuf.PARANOID, "Slept: " + t3.minus(t2) + " [s]");
- count = 0;
- }
- ++count;
-
- } while (m_running);
-
- return 0;
+ } while( m_svc );
+ return 0;
}
/**
@@ -241,230 +280,10 @@
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.is_running()");
- return m_workerthread.isRunning();
+ return m_running;
}
- public ReturnCode_t onStarting() { return ReturnCode_t.RTC_OK; }
- //============================================================
- // protected functions
- //============================================================
- /*!
- * @brief onStarted() template function
- */
- public ReturnCode_t onStarted()
- {
- // change EC thread state
- synchronized (m_svcmutex){
- if (!m_svc)
- { // If start() is called first time, start the worker thread.
- m_svc = true;
- this.open();
- }
- }
- if(m_workerthread.isAllNextState(LifeCycleState.INACTIVE_STATE))
- {
- synchronized(mutex_)
- {
- m_workerthread.running_ = false ;
- }
- }
- else
- {
- synchronized (mutex_) {
- m_workerthread.running_ = true ;
- mutex_.notifyAll();
- }
- }
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onStopping()
- {
- synchronized (mutex_) {
- m_workerthread.running_ = false ;
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t onStopped()
- {
- return ReturnCode_t.RTC_OK;
- }
- public double onGetRate(double rate)
- {
- return rate;
- }
- public double onSettingRate(double rate)
- {
- return rate;
- }
- public ReturnCode_t onSetRate(double rate)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onAddingComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onAddedComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onRemovingComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onRemovedComponent(LightweightRTObject rtobj)
- {
- return ReturnCode_t.RTC_OK;
- }
-
- // template virtual functions related to activation/deactivation/reset
- public ReturnCode_t onActivating(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onActivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onActivated(count = " + count +")");
-// rtcout.println(Logbuf.PARANOID,
-// "curr: " + comp.getStatus() +", next: " + comp.getStatus());
- // Now comp's next state must be ACTIVE state
- // If worker thread is stopped, restart worker thread.
- synchronized (mutex_) {
- if(m_workerthread.running_ == false)
- {
- m_workerthread.running_ = true ;
- mutex_.notifyAll();
- }
- return ReturnCode_t.RTC_OK;
- }
- }
- public ReturnCode_t onDeactivating(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onDeactivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onDeactivated(count = " + count +")");
-// rtcout.println(Logbuf.PARANOID,
-// "curr: " + comp.getStatus() +", next: " + comp.getStatus());
- // Now comp's next state must be ACTIVE state
- // If worker thread is stopped, restart worker thread.
- if(m_workerthread.isAllCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- synchronized (mutex_) {
- if(m_workerthread.running_ == true)
- {
- m_workerthread.running_ = false ;
- rtcout.println(Logbuf.TRACE, "All RTCs are INACTIVE. Stopping worker thread.");
- }
- }
- }
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onResetting(LightweightRTObject comp)
- {
- return ReturnCode_t.RTC_OK;
- }
- public ReturnCode_t onReset(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onReset(count = " + count +")");
-// rtcout.println(Logbuf.PARANOID,
-// "curr: " + comp.getStatus() +", next: " + comp.getStatus());
- // Now comp's next state must be ACTIVE state
- // If worker thread is stopped, restart worker thread.
- if(m_workerthread.isAllCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- synchronized (mutex_) {
- if(m_workerthread.running_ == true)
- {
- m_workerthread.running_ = false ;
- rtcout.println(Logbuf.TRACE, "All RTCs are INACTIVE. Stopping worker thread.");
- }
- }
- }
- return ReturnCode_t.RTC_OK;
- }
-
- public LifeCycleState onGetComponentState(LifeCycleState state)
- {
- return state;
- }
- public ExecutionKind onGetKind(ExecutionKind kind)
- {
- return kind;
- }
- public ExecutionContextProfile onGetProfile(ExecutionContextProfile profile)
- {
- return profile;
- }
-
/**
- * {@.ja onWaitingActivated() template function}
- * {@.en onWaitingActivated() template function}
- */
- public ReturnCode_t onWaitingActivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onWaitingActivated(count = " + count +")");
-// rtcout.println(Logbuf.PARANOID,
-// "curr: " + comp.getStatus() +", next: " + comp.getStatus());
- // Now comp's next state must be ACTIVE state
- // If worker thread is stopped, restart worker thread.
- synchronized (mutex_) {
- if(m_workerthread.running_ == false)
- {
- m_workerthread.running_ = true ;
- mutex_.notifyAll();
- }
- return ReturnCode_t.RTC_OK;
- }
- }
-
-
- /*!
- * @brief onWaitingDeactivated() template function
- */
- public ReturnCode_t onWaitingDeactivated(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onWaitingDeactivated(count = " + count +")");
- if(m_workerthread.isAllNextState(LifeCycleState.INACTIVE_STATE))
- {
- synchronized (mutex_) {
- if(m_workerthread.running_ == true)
- {
- m_workerthread.running_ = false ;
- rtcout.println(Logbuf.TRACE, "All RTCs are INACTIVE. Stopping worker thread.");
- }
- }
- }
- return ReturnCode_t.RTC_OK;
- }
-
- /*!
- * @brief onWaitingReset() template function
- */
- public ReturnCode_t onWaitingReset(RTObjectStateMachine comp, long count)
- {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.onWaitingReset(count = " + count +")");
- if(m_workerthread.isAllNextState(LifeCycleState.INACTIVE_STATE))
- {
- synchronized (mutex_) {
- if(m_workerthread.running_ == true)
- {
- m_workerthread.running_ = false ;
- rtcout.println(Logbuf.TRACE, "All RTCs are INACTIVE. Stopping worker thread.");
- }
- }
- }
- return ReturnCode_t.RTC_OK;
- }
-
- /**
* <p>ExecutionContext ãã¹ã¿ã¼ããã¾ãã</p>
*
* @return å®è¡çµæ
@@ -473,27 +292,22 @@
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.start()");
- ReturnCode_t ret = onStarting();
- if( ret != ReturnCode_t.RTC_OK )
- {
- rtcout.println(Logbuf.ERROR, "onStarting() failed. Starting EC aborted.");
- return ret;
+ if( m_running ) return ReturnCode_t.PRECONDITION_NOT_MET;
+
+ // invoke ComponentAction::on_startup for each comps.
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ m_comps.elementAt(intIdx).invoke_on_startup();
}
- ret = m_workerthread.start();
- if(ret!=ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_startup() for each RTC failed.");
- return ret;
+ // change EC thread state
+ m_running = true;
+ synchronized (m_worker) {
+ m_worker.running_ = true;
+ m_worker.notifyAll();
}
- ret = onStarted();
- if(ret!=ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_startup() for each RTC failed.");
- m_workerthread.stop();
- rtcout.println(Logbuf.ERROR, "on_shutdown() was invoked, because of on_startup");
- return ret;
- }
- return ret;
+
+ this.open();
+
+ return ReturnCode_t.RTC_OK;
}
/**
@@ -505,25 +319,20 @@
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.stop()");
- ReturnCode_t ret = onStopping(); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "onStopping() failed. Stopping EC aborted.");
- return ret;
+ if( !m_running ) return ReturnCode_t.PRECONDITION_NOT_MET;
+
+ // change EC thread state
+ m_running = false;
+ synchronized (m_worker) {
+ m_worker.running_ = false;
+ }
+
+ // invoke on_shutdown for each comps.
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ m_comps.elementAt(intIdx).invoke_on_shutdown();
}
- ret = m_workerthread.stop(); // Actual stop()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_shutdown() for each RTC failed.");
- return ret;
- }
- ret = onStopped(); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Invoking on_shutdown() for each RTC failed.");
- return ret;
- }
- return ret;
+
+ return ReturnCode_t.RTC_OK;
}
/**
@@ -535,13 +344,10 @@
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_rate()");
- return m_profile.getRate();
+ synchronized (m_profile) {
+ return m_profile.rate;
+ }
}
- public TimeValue getPeriod()
- {
- TimeValue period = m_profile.getPeriod();
- return period;
- }
/**
* <p>ExecutionContextã®å®è¡å¨æ(Hz)ãè¨å®ãã¾ãã</p>
@@ -554,20 +360,15 @@
if( rate<=0.0 ) return ReturnCode_t.BAD_PARAMETER;
- ReturnCode_t ret = m_profile.setRate(onSettingRate(rate));
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "Setting execution rate failed. " + rate);
- return ret;
+ synchronized (m_profile) {
+ m_profile.rate = rate;
}
- ret = onSetRate(rate);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR, "onSetRate("+ rate +") failed.");
- return ret;
+ this.m_usec = (long)(1000000/rate);
+ if( m_usec == 0 ) m_nowait = true;
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ m_comps.elementAt(intIdx).invoke_on_rate_changed();
}
- rtcout.println(Logbuf.INFO, "onSetRate("+ rate +") done.");
- return ret;
+ return ReturnCode_t.RTC_OK;
}
/**
@@ -580,89 +381,21 @@
public ReturnCode_t activate_component(LightweightRTObject comp) {
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.activate_component()");
- return activateComponent(comp);
- }
- public ReturnCode_t activateComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.activateComponent()");
-
- ReturnCode_t ret = onActivating(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivating() failed.");
- return ret;
- }
- RTObjectStateMachine rtobj = null;
- ret = m_workerthread.activateComponent(comp, rtobj); // Actual activateComponent()
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncActivation) // Asynchronous activation mode
- {
- ret = onActivated(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivated() failed.");
+ // ã³ã³ãã¼ãã³ããåå è
ãªã¹ãã«ç¡ããã° BAD_PARAMETER ãè¿ã
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ find_comp find = new find_comp((LightweightRTObject)comp._duplicate());
+ if (find.eqaulof(m_comps.elementAt(intIdx)) ) {
+ // the given component must be in Alive state.
+ if(!(m_comps.elementAt(intIdx)._sm.m_sm.isIn(LifeCycleState.INACTIVE_STATE))) {
+ return ReturnCode_t.PRECONDITION_NOT_MET;
+ }
+ m_comps.elementAt(intIdx)._sm.m_sm.goTo(LifeCycleState.ACTIVE_STATE);
+ return ReturnCode_t.RTC_OK;
}
- return ret;
}
- //------------------------------------------------------------
- // Synchronized activation mode
- rtcout.println(Logbuf.DEBUG,"Synchronous activation mode. "
- +"Waiting for the RTC to be ACTIVE state. ");
- return waitForActivated(rtobj);
+ return ReturnCode_t.BAD_PARAMETER;
}
- public ReturnCode_t waitForActivated(RTObjectStateMachine rtobj)
- {
- long count =0 ;
- ReturnCode_t ret = onWaitingActivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingActivated failed.");
- return ret;
- }
- long cycle =
- (long )(m_activationTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_activationTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating INACTIVE -> ACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- ret = onWaitingActivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingActivated failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta= new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be ACTIVE state. " + delta + " [s] slept (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_activationTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be ACTIVE or ERROR
- if (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is " + rtobj.getState());
- ret = onActivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onActivated() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onActivated() done.");
- return ret;
- }
/**
* <p>ã³ã³ãã¼ãã³ããéã¢ã¯ãã£ãåãã¾ãã</p>
@@ -674,89 +407,20 @@
public ReturnCode_t deactivate_component(LightweightRTObject comp) {
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.deactivate_component()");
- return deactivateComponent(comp);
- }
- public ReturnCode_t deactivateComponent(LightweightRTObject comp)
- {
- rtcout.println(Logbuf.TRACE,"PeriodicExecutionContext.deactivateComponent()");
- ReturnCode_t ret = onDeactivating(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivatingComponent() failed.");
- return ret;
- }
- // Deactivate all the RTCs
- RTObjectStateMachine rtobj = null;
- ret = m_workerthread.deactivateComponent(comp, rtobj);
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncDeactivation)
- {
- ret = onDeactivated(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivated() failed.");
+
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ find_comp find = new find_comp((LightweightRTObject)comp._duplicate());
+ if (find.eqaulof(m_comps.elementAt(intIdx)) ) {
+ // the given component must be in Alive state.
+ if(!(m_comps.elementAt(intIdx)._sm.m_sm.isIn(LifeCycleState.ACTIVE_STATE))) {
+ return ReturnCode_t.PRECONDITION_NOT_MET;
+ }
+ m_comps.elementAt(intIdx)._sm.m_sm.goTo(LifeCycleState.INACTIVE_STATE);
+ return ReturnCode_t.RTC_OK;
}
- return ret;
}
- //------------------------------------------------------------
- // Waiting for synchronized deactivation
- rtcout.println(Logbuf.DEBUG,"Synchronous deactivation mode. "
- +"Waiting for the RTC to be INACTIVE state. ");
- return waitForDeactivated(rtobj);
+ return ReturnCode_t.BAD_PARAMETER;
}
- public ReturnCode_t waitForDeactivated(RTObjectStateMachine rtobj)
- {
- long count = 0;
- ReturnCode_t ret = onWaitingDeactivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingDeactivated failed.");
- return ret;
- }
- long cycle =
- (long )(m_deactivationTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_deactivationTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating ACTIVE -> INACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.ACTIVE_STATE))
- {
- ret = onWaitingDeactivated(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingDeactivated failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta = new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be INACTIVE state. Sleeping " + delta + " [s] (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_activationTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be INACTIVE or ERROR
- if (rtobj.isCurrentState(LifeCycleState.ACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is "+ rtobj.getState());
- ret = onDeactivated(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onDeactivated() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onDeactivated() done.");
- return ret;
- }
/**
* <p>ã³ã³ãã¼ãã³ãããªã»ãããã¾ãã</p>
@@ -768,89 +432,20 @@
public ReturnCode_t reset_component(LightweightRTObject comp){
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.reset_component()");
- return reset_component(comp);
- }
- public ReturnCode_t resetCcomponent(LightweightRTObject comp){
- rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.resetComponent()");
-
- ReturnCode_t ret = onResetting(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onResetting() failed.");
- return ret;
- }
- RTObjectStateMachine rtobj = null;
- ret = m_workerthread.resetComponent(comp, rtobj); // Actual resetComponent()
- if (ret != ReturnCode_t.RTC_OK) { return ret; }
- if (!m_syncReset)
- {
- ret = onReset(rtobj, -1);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onReset() failed.");
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ find_comp find = new find_comp((LightweightRTObject)comp._duplicate());
+ if (find.eqaulof(m_comps.elementAt(intIdx)) ) {
+ // the given component must be in Alive state.
+ if(!(m_comps.elementAt(intIdx)._sm.m_sm.isIn(LifeCycleState.ERROR_STATE))) {
+ return ReturnCode_t.PRECONDITION_NOT_MET;
+ }
+ m_comps.elementAt(intIdx)._sm.m_sm.goTo(LifeCycleState.INACTIVE_STATE);
+ return ReturnCode_t.RTC_OK;
}
- return ret;
}
- //------------------------------------------------------------
- // Waiting for synchronized reset
- rtcout.println(Logbuf.DEBUG,"Synchronous reset mode. "
- +"Waiting for the RTC to be INACTIVE state. ");
- return waitForReset(rtobj);
+ return ReturnCode_t.BAD_PARAMETER;
}
- public ReturnCode_t waitForReset(RTObjectStateMachine rtobj)
- {
- long count = 0;
- ReturnCode_t ret = onWaitingReset(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingReset() failed.");
- return ret;
- }
- long cycle =
- (long )(m_resetTimeout.toDouble() / getPeriod().toDouble());
- rtcout.println(Logbuf.DEBUG,"Timeout is "+ m_resetTimeout.toDouble() + "[s] ("+ getRate() + "[s] in "+ cycle + " times");
- // Wating ERROR -> INACTIVE
- TimeValue starttime = new TimeValue();
- starttime.convert(System.nanoTime()/1000);
- while (rtobj.isCurrentState(LifeCycleState.ERROR_STATE))
- {
- ret = onWaitingReset(rtobj, count); // Template method
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onWaitingReset failed.");
- return ret;
- }
- try
- {
- Thread.sleep(getPeriod().getUsec());
- }catch(InterruptedException e){}
- TimeValue delta = new TimeValue();
- delta.convert(System.nanoTime()/1000);
- delta.minus(starttime);
- rtcout.println(Logbuf.DEBUG,"Waiting to be INACTIVE state. Sleeping " + delta + " [s] (" + count +"/" + cycle);
- ++count;
- if (delta.getUsec() > m_resetTimeout.getUsec() || count > cycle)
- {
- rtcout.println(Logbuf.WARN,"The component is not responding.");
- break;
- }
- }
- // Now State must be INACTIVE
- if (rtobj.isCurrentState(LifeCycleState.INACTIVE_STATE))
- {
- rtcout.println(Logbuf.ERROR,"Unknown error: Invalid state transition.");
- return ReturnCode_t.RTC_ERROR;
- }
- rtcout.println(Logbuf.DEBUG,"Current state is "+ rtobj.getState());
- ret = onReset(rtobj, count);
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"onReset() failed.");
- }
- rtcout.println(Logbuf.DEBUG,"onReset() done.");
- return ret;
- }
/**
* <p>ã³ã³ãã¼ãã³ãã®ç¶æ
ãåå¾ãã¾ãã</p>
@@ -862,18 +457,14 @@
public LifeCycleState get_component_state(LightweightRTObject comp) {
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_component_state()");
- return getComponentState(comp);
- }
- public LifeCycleState getComponentState(LightweightRTObject comp) {
- LifeCycleState state = m_workerthread.getComponentState(comp);
- rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.getComponentState() = " + state);
- if (state == LifeCycleState.CREATED_STATE)
- {
- rtcout.println(Logbuf.ERROR,"CREATED state: not initialized "
- +"RTC or unknwon RTC specified.");
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ find_comp find = new find_comp((LightweightRTObject)comp._duplicate());
+ if (find.eqaulof(m_comps.elementAt(intIdx)) ) {
+ return m_comps.elementAt(intIdx)._sm.m_sm.getState();
+ }
}
- return onGetComponentState(state);
+ return LifeCycleState.CREATED_STATE;
}
/**
@@ -883,19 +474,10 @@
*/
public ExecutionKind get_kind() {
- rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_kind() ="
- + m_profile.getKindString());
+ rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_kind()");
- return getKind();
+ return m_profile.kind;
}
- public ExecutionKind getKind()
- {
- ExecutionKind kind = m_profile.getKind();
- rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.getKind() = " + getKindString(kind));
- kind = onGetKind(kind);
- rtcout.println(Logbuf.DEBUG,"onGetKind() returns " + getKindString(kind));
- return kind;
- }
/**
* {@.ja RTã³ã³ãã¼ãã³ãã追å ãã}
@@ -928,42 +510,30 @@
rtcout.println(Logbuf.TRACE,
"PeriodicExecutionContext.add_component()");
- return addComponent(comp);
- }
- public ReturnCode_t addComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.addcomponent()");
-
- ReturnCode_t ret = onAddingComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onAddingComponent(). RTC is not attached.");
- return ret;
+ if( comp==null ) return ReturnCode_t.BAD_PARAMETER;
+ //
+ try {
+ DataFlowComponent dfp = DataFlowComponentHelper.narrow(comp);
+ if( dfp==null ) {
+ // Because the ExecutionKind of this context is PERIODIC,
+ // the RTC must be a data flow component.
+ return ReturnCode_t.BAD_PARAMETER;
+ }
+ //
+ int id = dfp.attach_context(m_ref);
+ //
+ m_comps.add(new Comp((LightweightRTObject)comp._duplicate(),
+ (DataFlowComponent)dfp._duplicate(), id));
+ RTC.RTCListHolder holder
+ = new RTC.RTCListHolder(m_profile.participants);
+ CORBA_SeqUtil.push_back(holder,
+ RTC.RTObjectHelper.narrow(comp));
+ m_profile.participants = holder.value;
+ return ReturnCode_t.RTC_OK;
+ } catch(Exception ex) {
+ return ReturnCode_t.BAD_PARAMETER;
}
- ret = m_workerthread.addComponent(comp); // Actual addComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECWorker addComponent() faild.");
- return ret;
- }
- ret = m_profile.addComponent(comp); // Actual addComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECProfile addComponent() faild.");
- return ret;
- }
- ret = onAddedComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onAddedComponent() faild.");
- rtcout.println(Logbuf.INFO,"Removing attached RTC.");
- m_workerthread.removeComponent(comp);
- m_profile.removeComponent(comp);
- return ret;
- }
- rtcout.println(Logbuf.INFO,"Component has been added to this EC.");
- return ret;
}
/**
@@ -986,7 +556,26 @@
rtcout.println(Logbuf.TRACE,
"PeriodicExecutionContext.bindComponent()");
- return m_workerthread.bindComponent(rtc);
+
+ if (rtc == null) return ReturnCode_t.BAD_PARAMETER;
+
+ LightweightRTObject comp = rtc.getObjRef();
+ DataFlowComponent dfp;
+ dfp = DataFlowComponentHelper.narrow(comp);
+
+ int id = rtc.bindContext(m_ref);
+ if (id < 0 || id > RTObject_impl.ECOTHER_OFFSET) {
+ rtcout.println(Logbuf.ERROR, "bindContext returns invalid id: "+id);
+ return ReturnCode_t.RTC_ERROR;
+ }
+ rtcout.println(Logbuf.DEBUG, "bindComponent() returns id = "+id);
+ m_comps.add(new Comp((LightweightRTObject)comp._duplicate(),
+ (DataFlowComponent)dfp._duplicate(),
+ id));
+ m_profile.owner = (DataFlowComponent)dfp._duplicate();
+
+
+ return ReturnCode_t.RTC_OK;
}
/**
@@ -1018,42 +607,40 @@
rtcout.println(Logbuf.TRACE,
"PeriodicExecutionContext.remove_component()");
- return removeComponent(comp);
- }
- public ReturnCode_t removeComponent(LightweightRTObject comp) {
- rtcout.println(Logbuf.TRACE,
- "PeriodicExecutionContext.removeComponent()");
- ReturnCode_t ret = onRemovingComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onRemovingComponent(). "
- +"RTC will not not attached.");
- return ret;
+ for(int intIdx=0;intIdx<m_comps.size();intIdx++ ) {
+ find_comp find
+ = new find_comp((LightweightRTObject)comp._duplicate());
+ if (find.eqaulof(m_comps.elementAt(intIdx)) ) {
+ m_comps.elementAt(intIdx)._ref.detach_context(
+ m_comps.elementAt(intIdx)._sm.ec_id);
+ m_comps.elementAt(intIdx)._ref = null;
+ m_comps.remove(m_comps.elementAt(intIdx));
+ rtcout.println(Logbuf.TRACE, "remove_component(): an RTC removed from this context.");
+ RTC.RTObject rtcomp = RTC.RTObjectHelper.narrow(comp);
+ if(rtcomp == null){
+ rtcout.println(Logbuf.ERROR,"Invalid object reference.");
+ return ReturnCode_t.RTC_ERROR;
+ }
+ synchronized (m_profile) {
+ long index;
+ RTC.RTCListHolder holder
+ = new RTC.RTCListHolder(m_profile.participants);
+ index = CORBA_SeqUtil.find(holder, new is_equiv(rtcomp));
+
+ if (index < 0) { // not found in my list
+ rtcout.println(Logbuf.ERROR, "Not found.");
+ return ReturnCode_t.BAD_PARAMETER;
+ }
+
+ CORBA_SeqUtil.erase(holder, (int)index);
+ m_profile.participants = holder.value;
+ }
+ return ReturnCode_t.RTC_OK;
+ }
}
- ret = m_workerthread.removeComponent(comp); // Actual removeComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECWorker removeComponent() faild.");
- return ret;
- }
- ret = m_profile.removeComponent(comp); // Actual removeComponent()
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: ECProfile removeComponent() faild.");
- return ret;
- }
- ret = onRemovedComponent(comp); // Template
- if (ret != ReturnCode_t.RTC_OK)
- {
- rtcout.println(Logbuf.ERROR,"Error: onRemovedComponent() faild.");
- rtcout.println(Logbuf.INFO,"Removing attached RTC.");
- m_workerthread.removeComponent(comp);
- m_profile.removeComponent(comp);
- return ret;
- }
- rtcout.println(Logbuf.INFO,"Component has been removeed to this EC.");
- return ret;
+ rtcout.println(Logbuf.TRACE, "remove_component(): no RTC found in this context.");
+ return ReturnCode_t.BAD_PARAMETER;
}
//============================================================
@@ -1064,10 +651,15 @@
*
* @return ExecutionContextProfile
*/
- public RTC.ExecutionContextProfile get_profile() {
+ public ExecutionContextProfile get_profile() {
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.get_profile()");
- return m_profile.getProfile();
+
+ ExecutionContextProfileHolder p;
+ synchronized (m_profile) {
+ p = new ExecutionContextProfileHolder(m_profile);
+ }
+ return p.value;
}
/**
@@ -1203,15 +795,6 @@
public void worker() {
m_sm.worker();
}
- public void worker_pre() {
- m_sm.worker_pre();
- }
- public void worker_do() {
- m_sm.worker_do();
- }
- public void worker_post() {
- m_sm.worker_post();
- }
/**
* <p>ç¾å¨ã®ç¶æ
ãåå¾ãã¾ãã</p>
@@ -1372,24 +955,6 @@
this._sm.worker();
}
/**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_pre(){
- this._sm.worker_pre();
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_do(){
- this._sm.worker_do();
- }
- /**
- * <p>ExecutionContextããå¼ã³åºãããã¡ã½ããã§ãã</p>
- */
- public void invoke_work_post(){
- this._sm.worker_post();
- }
- /**
* <p>StartUpæã«å¼ã³åºãããã¡ã½ããã§ãã</p>
*/
public void invoke_on_startup(){
@@ -1442,15 +1007,19 @@
* <p>ExecutionContext ã®ã¹ã¬ããå®è¡ãã©ã°ã§ãã</p>
*/
private boolean m_svc;
- private String m_svcmutex = new String();
+ protected class Worker {
+ public Worker() {
+ this.running_ = false;
+ }
+
private boolean running_;
- private String mutex_ = new String() ;
+ };
// A condition variable for external triggered worker
- private ExecutionContextWorker m_workerthread = new ExecutionContextWorker();
+ private Worker m_worker = new Worker();
/**
* <p>ExecutionContextProfileã§ãã</p>
@@ -1466,7 +1035,6 @@
protected ExecutionContextService m_ref;
protected boolean m_nowait;
protected Thread m_thread = null;
- protected boolean ticked_;
/**
* <p>ãã®ExecutionContextãçæããFactoryã¯ã©ã¹ã
@@ -1475,40 +1043,10 @@
* @param manager Managerãªãã¸ã§ã¯ã
*/
public static void PeriodicExecutionContextInit(Manager manager) {
- //manager.registerECFactory("jp.go.aist.rtm.RTC.executionContext.PeriodicExecutionContext");
- ExecutionContextFactory<ExecutionContextBase,String> factory
- = ExecutionContextFactory.instance();
- factory.addFactory("jp.go.aist.rtm.RTC.executionContext.PeriodicExecutionContext",
- new PeriodicExecutionContext(),
- new PeriodicExecutionContext());
+ manager.registerECFactory("jp.go.aist.rtm.RTC.executionContext.PeriodicExecutionContext");
}
/**
- * {@.ja PeriodicExecutionContext ãçæãã}
- * {@.en Creats PeriodicExecutionContext}
- *
- * @return
- * {@.ja çæãããinstance}
- * {@.en Object Created instances}
- *
- *
- */
- public ExecutionContextBase creator_() {
- return new PeriodicExecutionContext();
- }
- /**
- * {@.ja Object ãç ´æ£ãã}
- * {@.en Destructs Object}
- *
- * @param obj
- * {@.ja ç ´æ£ããã¤ã³ã¿ã¹ã¿ã³ã¹}
- * {@.en The target instances for destruction}
- *
- */
- public void destructor_(Object obj) {
- obj = null;
- }
- /**
* <p>ExecutionContextã®ã¤ã³ã¹ã¿ã³ã¹ãåå¾ãã¾ãã</p>
*
* @return ExecutionContextã¤ã³ã¹ã¿ã³ã¹
@@ -1539,265 +1077,4 @@
return m_obj._is_equivalent((RTC.RTObject)object);
}
}
-
- /**
- * {@.ja ExecutionContextã¯ã©ã¹ã®åæåé¢æ°}
- * {@.en Initialization function of ExecutionContext class}
- */
- public void init(Properties props) {
- }
-
-
- /**
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§ã®åå¾}
- * {@.en Get the reference to the CORBA object}
- * <p>
- * {@.ja æ¬ãªãã¸ã§ã¯ãã® ExecutioncontextService ã¨ãã¦ã® CORBA ãªãã¸ã§
- * ã¯ãåç
§ãåå¾ããã}
- * {@.en Get the reference to the CORBA object as
- * ExecutioncontextService of this object.}
- *
- * @return
- * {@.ja CORBA ãªãã¸ã§ã¯ãåç
§}
- * {@.en The reference to CORBA object}
- *
- */
- public ExecutionContextService getObjRef() {
- return m_profile.getObjRef();
- }
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãè¨å®ãã}
- * {@.en Set execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãè¨å®ã
- * ããå®è¡å¨æã®å¤æ´ã¯ãDataFlowComponentAction ã®
- * on_rate_changed ã«ãã£ã¦åRTã³ã³ãã¼ãã³ãã«ä¼éãããã}
- * {@.en This operation shall set the rate (in hertz) at which this
- * contextâs Active participating RTCs are being called. If the
- * execution kind of the context is PERIODIC, a rate change shall
- * result in the invocation of on_rate_changed on any RTCs
- * realizing DataFlowComponentAction that are registered with any
- * RTCs participating in the context.}
- *
- * @param rate
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã
- * RTC_OK: æ£å¸¸çµäº
- * BAD_PARAMETER: è¨å®å¤ãè² ã®å¤}
- * {@.en The return code of ReturnCode_t type
- * RTC_OK: Succeed
- * BAD_PARAMETER: Invalid value. The value might be negative.}
- *
- */
- public ReturnCode_t setRate(double rate) {
- return m_profile.setRate(rate);
- }
- /**
- * {@.ja ExecutionContext ã®å®è¡å¨æ(Hz)ãåå¾ãã}
- * {@.en Get execution rate(Hz) of ExecutionContext}
- * <p>
- * {@.ja Active ç¶æ
ã«ã¦RTã³ã³ãã¼ãã³ããå®è¡ãããå¨æ(åä½:Hz)ãåå¾ã
- * ãã}
- * {@.en This operation shall return the rate (in hertz) at which its
- * Active participating RTCs are being invoked.}
- *
- * @return
- * {@.ja å¦çå¨æ(åä½:Hz)}
- * {@.en Execution cycle(Unit:Hz)}
- *
- */
- public double getRate() {
- return m_profile.getRate();
- }
- /**
- * {@.ja ExecutionKind ãæåååãã}
- * {@.en Converting ExecutionKind enum to string}
- * <p>
- * {@.ja RTC::ExecutionKind ã§å®ç¾©ããã¦ãã PERIODIC, EVENT_DRIVEN,
- * OTHER ãæåååããã}
- * {@.en This function converts enumeration (PERIODIC, EVENT_DRIVEN,
- * OTHER) defined in RTC::ExecutionKind to string.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en ExecutionKind}
- * @return
- * {@.ja æåååãããExecutionKind}
- * {@.en String of ExecutionKind}
- *
- */
- public final String getKindString(ExecutionKind kind) {
- return m_profile.getKindString(kind);
- }
- /**
- * {@.ja ExecutionKind ãè¨å®ãã}
- * {@.en Set the ExecutionKind}
- * <p>
- * {@.ja ãã® ExecutionContext ã® ExecutionKind ãè¨å®ãã}
- * {@.en This operation sets the kind of the execution context.}
- *
- * @param kind
- * {@.ja ExecutionKind}
- * {@.en kind ExecutionKind}
- *
- */
- public ReturnCode_t setKind(ExecutionKind kind) {
- return m_profile.setKind(kind);
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ããã»ããããã}
- * {@.en Setting owner component of the execution context}
- * <p>
- * {@.ja ãã®ECã®Ownerã¨ãªãRTCãã»ããããã}
- * {@.en This function sets an RT-Component to be owner of
- * the execution context.}
- *
- * @param comp
- * {@.ja Ownerã¨ãªãRTã³ã³ãã¼ãã³ã}
- * {@.en an owner RT-Component of this execution context}
- * @return
- * {@.ja ReturnCode_t åã®ãªã¿ã¼ã³ã³ã¼ã}
- * {@.en The return code of ReturnCode_t type}
- */
- public ReturnCode_t setOwner(LightweightRTObject comp){
- return m_profile.setOwner(comp);
- }
-
- /**
- * {@.ja Ownerã³ã³ãã¼ãã³ãã®åç
§ãåå¾ãã}
- * {@.en Getting a reference of the owner component}
- * <p>
- * {@.ja ãã®ECã®Ownerã§ããRTCã®åç
§ãåå¾ããã}
- * {@.en This function returns a reference of the owner RT-Component of
- * this execution context}
- *
- * @return
- * {@.ja OwnerRTã³ã³ãã¼ãã³ãã®åç
§}
- * {@.en a reference of the owner RT-Component}
- */
- public RTC.RTObject getOwner() {
- return m_profile.getOwner();
- }
-
- /**
- * {@.ja RTã³ã³ãã¼ãã³ãã®åå è
ãªã¹ããåå¾ãã}
- * {@.en @brief Getting participant RTC list}
- * <p>
- * {@.ja ç¾å¨ç»é²ããã¦ããåå è
RTCã®ãªã¹ããåå¾ããã}
- * {@.en This function returns a list of participant RTC of
- * the execution context.}
- *
- * @return
- * {@.ja åå è
RTCã®ãªã¹ã}
- * {@.en Participants RTC list}
- *
- */
- public RTC.RTObject[] getComponentList(){
- return m_profile.getComponentList();
- }
-
-
- /**
- * {@.ja Propertiesãã»ãããã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãã»ããããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- * @param props
- * {@.ja ExecutionContextProfile::properties ã«ã»ããããããããã£ã¼}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public void setProperties(Properties props){
- m_profile.setProperties(props);
- }
-
- /**
- * {@.ja Propertiesãåå¾ãã}
- * {@.en Setting Properties}
- * <p>
- * {@.ja ExecutionContextProfile::properties ãåå¾ããã}
- * {@.en This function sets ExecutionContextProfile::properties by
- * Properties.}
- *
- * @return
- * {@.ja Propertiesã«å¤æããã ExecutionContextProfile::properties}
- * {@.en Properties to be set to ExecutionContextProfile::properties.}
- *
- */
- public Properties getProperties() {
- return m_profile.getProperties();
- }
-
- /**
- * {@.ja rofileãåå¾ãã}
- * {@.en Getting Profile}
- * <p>
- * {@.ja ExecutionContextProfile ãåå¾ããã}
- * {@.en This function gets ExecutionContextProfile.}
- *
- * @return
- * {@.ja ExecutionContextProfile}
- * {@.en ExecutionContextProfile}
- *
- */
- public RTC.ExecutionContextProfile getProfile(){
- return m_profile.getProfile();
- }
- public boolean setTimeout(Properties props, String key,TimeValue timevalue)
- {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.setTimeout(" + key +")");
- if (props.findNode(key) != null)
- {
- timevalue.convert(Double.valueOf(props.getNode(key).getValue())) ;
- rtcout.println(Logbuf.DEBUG, "Timeout (" + key +"): " + props.getNode(key).getValue() + " [s]");
- return true;
- }
- rtcout.println(Logbuf.DEBUG, "Configuration " + key +" not found.");
- return false;
- }
- /*!
- * @if jp
- * @brief Propertiesããå®è¡ã³ã³ããã¹ããã»ãããã
- * @else
- * @brief Setting execution rate from given properties.
- * @endif
- */
- public boolean setExecutionRate(Properties props)
- {
- if (props.findNode("rate") != null)
- {
- double rate;
- rate = Double.valueOf(props.getNode("rate").getValue());
- setRate(rate);
- return true;
- }
- return false;
- }
- /*!
- * @if jp
- * @brief Propertiesããç¶æ
é·ç§»Timeoutãã»ãããã
- * @else
- * @brief Setting state transition timeout from given properties.
- * @endif
- */
- public boolean setTransitionMode(Properties props, String key, boolean flag)
- {
- rtcout.println(Logbuf.TRACE, "ExtTrigExecutionContext.setTransitionMode(" + key +")");
- if (props.findNode(key) != null)
- {
- flag = props.getNode(key).getValue() == "YES";
- rtcout.println(Logbuf.DEBUG, "Transition Mode: " + key +" = " + ( flag ? "YES" : "NO"));
- return true;
- }
- rtcout.println(Logbuf.DEBUG, "Configuration " + key +" not found.");
- return false;
- }
-
}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/log/Logbuf.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,9 +1,7 @@
package jp.go.aist.rtm.RTC.log;
-import java.text.DecimalFormat;
import java.util.Date;
import java.util.IllegalFormatException;
-import java.util.Locale;
import java.util.Vector;
import java.util.logging.Formatter;
import java.util.logging.Handler;
@@ -11,12 +9,6 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import jp.go.aist.rtm.RTC.Manager;
-import jp.go.aist.rtm.RTC.util.TimeValue;
-import jp.go.aist.rtm.RTC.util.clock.ClockManager;
-import jp.go.aist.rtm.RTC.util.clock.IClock;
-import jp.go.aist.rtm.RTC.util.clock.LogicalClock;
-
/**
* <p>ãã°åéONæã®ãã®ã³ã°ã¯ã©ã¹ã§ãã</p>
* ãã°åºåã®å¯å¦ã¯ãããã©ã«ãã§ç¡å¹ã¨ãã
@@ -45,9 +37,6 @@
public static final String VERBOSE_H = "VERBOSE :";
public static final String PARANOID_H = "PARANOID :";
- private int TIME_CONV_UNIT = 1000;
- private double DELTA_TIME = 0.000000000005;
-
/**
* <p>ããã©ã«ãã³ã³ã¹ãã©ã¯ã¿ã§ãã</p>
* Manager.* ã¨ãã¦ãã¬ã¼ãä½æããã
@@ -58,28 +47,16 @@
public Logbuf(String name) {
m_LogLock = false;
m_Suffix = name;
- m_clock = ClockManager.getInstance().getClock("system");
- if(Manager.isActive() ) {
- if( Manager.instance().getConfig().getNode("logger.date_format")!=null ) {
- setDateFormat(Manager.instance().getConfig().getProperty("logger.date_format"));
- }
- if( Manager.instance().getConfig().getNode("logger.clock_type")!=null ) {
- setClockType(Manager.instance().getConfig().getProperty("logger.clock_type"));
- }
- }
-
int parent = name.indexOf("Manager.");
String str;
if(name.equals("Manager")) {
str = "OpenRTM-aist.logging." + name;
m_Logger = Logger.getLogger(str);
this.addStream(new NullHandler());
-
} else if(parent >= 0) {
m_Suffix = this.getLastName(name);
str = "OpenRTM-aist.logging.Manager." + m_Suffix;
m_Logger = Logger.getLogger(str);
-
} else {
str = "OpenRTM-aist.logging.Manager." + name;
m_Logger = Logger.getLogger(str);
@@ -103,16 +80,6 @@
public Logbuf(String name, String parent) {
m_LogLock = false;
m_Suffix = name;
- m_clock = ClockManager.getInstance().getClock("system");
- if(Manager.isActive() ) {
- if( Manager.instance().getConfig().getNode("logger.date_format")!=null ) {
- setDateFormat(Manager.instance().getConfig().getProperty("logger.date_format"));
- }
- if( Manager.instance().getConfig().getNode("logger.clock_type")!=null ) {
- setClockType(Manager.instance().getConfig().getProperty("logger.clock_type"));
- }
- }
-
String str;
if((parent.length() == 0) || (parent == null)) {
str = "OpenRTM-aist.logging." + name;
@@ -152,32 +119,20 @@
// System.err.println("Logbuf.println() destination handler was not registered.");
return;
}
-// StringBuilder sb = new StringBuilder();
-//
-// // Send all output to the Appendable object sb
-// java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
-//
-// // Explicit argument indices may be used to re-order output.
-// Date date = new Date();
+ StringBuilder sb = new StringBuilder();
+ // Send all output to the Appendable object sb
+ java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
+
+ // Explicit argument indices may be used to re-order output.
+ Date date = new Date();
+
String str = logLevelToStr(level);
Level clevel = Level.parse(str);
-// m_Logger.log(clevel,
-// formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date)
-// + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
- m_Logger.log(clevel, getDate() + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
+ m_Logger.log(clevel,
+ formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date)
+ + " " + m_Suffix + " " + logLevelToStr(level) + " " + contents);
}
-
- protected String getDate() {
- //æ¡è½ã¡ãé²ãããã«å¾®å°å¤ãå ç®
-// long sec = (long)(m_clock.getTime().toDouble()*1000+0.000000000005);
-// Date date = new Date(sec);
- StringBuilder sb = new StringBuilder();
-// java.util.Formatter formatter = new java.util.Formatter(sb, java.util.Locale.US);
-// return formatter.format(m_dateFormat,date,date,date,date,date,date,date,date,date,date).toString();
- TimeFormatter formatter = new TimeFormatter(sb, java.util.Locale.US);
- return formatter.format(m_dateFormat, m_clock);
- }
/**
* <p>RTMç¨ãã°ã¬ãã«ã®è¨å®</p>
@@ -453,45 +408,6 @@
}
/**
- * {@.ja ãã°è¨é²æã«ä½¿ç¨ããã¯ããã¯ãæå®ãã}
- * {@.en Specifying clock type to be used for logging}
- *
- * <p>
- * {@.ja ãã°è¨é²æã«æå»ãåå¾ããããã®ã¯ããã¯ã®ç¨®é¡ãæå®ãããã¨ãã§ããã
- * <li> system: ã·ã¹ãã ã¯ããã¯ãããã©ã«ã
- * <li> logical: è«çæéã¯ããã¯ã
- * <li> adjusted: 調æ´æ¸ã¿ã¯ããã¯ã
- * <li> initTimer: Timer åæå</li>
- * è«çæéã¯ããã¯ã«ã¤ãã¦ã¯
- * <pre>
- * ClockManager::instance().getClock("logical").settime()
- * </pre>
- * ã§æå»ãè¨å®ããå¿
è¦ãããã
- *
- * {@.en This function sets a clock type getting time when it is used
- * for logging. Available clock types are,
- * <li> system: System clock. Default option.
- * <li> logical: Logical time clock.
- * <li> adjusted: Adjusted clock.
- * To use logical time clock, call and set time by the following
- * function in somewhere.
- * <pre>
- * coil::ClockManager::instance().getClock("logical").settime()
- * </pre>}
- *
- * @param clocktype
- * {@.ja ä¸è¿°ã®ã¯ããã¯ã¿ã¤ã}
- * {@.en A clock type above mentioned.}
- */
- public void setClockType(String clocktype) {
- m_clock = ClockManager.getInstance().getClock(clocktype);
- //è«çæéã®å ´åã¯åºåæ¸å¼ã®ããã©ã«ãè¨å®ãå¤æ´
- if(m_clock instanceof LogicalClock) {
- setDateFormat("%S %L");
- }
- }
-
- /**
* <p>ãã°ã»ã¬ãã«ãè¨å®ãã¾ãã</p>
*
* @param level ãã°ã»ã¬ãã«
@@ -537,8 +453,6 @@
* <p>åºåå
ãã³ãã©ã®æ°</p>
*/
private int m_HandlerCount = 0;
-
- private IClock m_clock;
/**
* <p>ãã°åºåã®è¨å®</p>
@@ -546,7 +460,7 @@
*/
private static boolean m_Enabled = false;
- private class NullHandler extends Handler{
+ class NullHandler extends Handler{
public void close() {
}
public void flush() {
@@ -554,38 +468,5 @@
public void publish(LogRecord record){
}
}
-
- private class TimeFormatter {
- private java.util.Formatter formatter;
-
- public TimeFormatter(StringBuilder sb, Locale local ) {
- formatter = new java.util.Formatter(sb, local);
- }
-
- public String format(String format, IClock clock) {
- String result = "";
- TimeValue time = clock.getTime();
-
- if(format.contains("%tN")) {
- long mc = time.getUsec()%TIME_CONV_UNIT;
- String strmc = "";
- try {
- DecimalFormat df = new DecimalFormat();
- df.applyPattern("0");
- df.setMaximumIntegerDigits(3);
- df.setMinimumIntegerDigits(3);
- strmc = df.format(mc);
- } catch(Exception e) {
- strmc = Long.valueOf(mc).toString();
- }
- format = format.replace("%tN", strmc);
- }
- long sec = (long)(time.toDouble()*TIME_CONV_UNIT+DELTA_TIME);
- Date date = new Date(sec);
- result = formatter.format(format,date,date,date,date,date,date,date,date,date,date).toString();
-
- return result;
- }
- }
}
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTest110.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTest110.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTest110.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,28 +0,0 @@
-package jp.go.aist.rtm;
-
-import jp.go.aist.rtm.RTC.log.LogBufTimeTest;
-import jp.go.aist.rtm.RTC.log.LogbufTest;
-import jp.go.aist.rtm.RTC.util.AdjustedClockTest;
-import jp.go.aist.rtm.RTC.util.TimeValueTest;
-import jp.go.aist.rtm.RTC.buffer.RingBufferTest;
-import jp.go.aist.rtm.RTC.executionContext.*;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTest110 {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for 1.1.0");
-
- suite.addTestSuite(TimeValueTest.class);
- suite.addTestSuite(LogbufTest.class);
- suite.addTestSuite(AdjustedClockTest.class);
-
- suite.addTestSuite(LogBufTimeTest.class);
- suite.addTestSuite(RingBufferTest.class);
- suite.addTestSuite(ExtTrigExecutionContextTests.class);
- suite.addTestSuite(PeriodicExecutionContextTests.class);
-
- return suite;
- }
-}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/AllTests.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.ConsoleInTest;
import jp.go.aist.rtm.RTC.ConsoleOutTest;
import jp.go.aist.rtm.RTC.CorbaNamingTest;
+import jp.go.aist.rtm.RTC.CorbaObjectManagerTest;
import jp.go.aist.rtm.RTC.FactoryTest;
import jp.go.aist.rtm.RTC.ManagerConfigTest;
import jp.go.aist.rtm.RTC.ManagerTest;
@@ -74,6 +75,7 @@
suite.addTestSuite(ConfigTest.class);
suite.addTestSuite(CorbaConsumerTest.class);
suite.addTestSuite(CorbaNamingTest.class);
+ suite.addTestSuite(CorbaObjectManagerTest.class);
suite.addTestSuite(CorbaPortTest.class);
suite.addTestSuite(DataHolderTest.class);
suite.addTestSuite(DataInPortTest.class);
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConfigSampleTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -67,6 +67,7 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
Thread.yield();
}
Thread.sleep(300);
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleInTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -61,6 +61,7 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ConsoleOutTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -61,6 +61,7 @@
}
protected void tearDown() throws Exception {
for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaNamingTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -93,6 +93,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
naming.bindByString("localhost3.host_cxt/mgr3.mgr_cxt/sample3.rtc", rtobj.getObjRef());
@@ -155,6 +156,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// ãªãã¸ã§ã¯ãããã¤ã³ããããããæ£ããè¨å®ããããï¼
@@ -183,6 +185,7 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
naming.rebindByString("localhost.host_cxt/mgr.mgr_cxt/sample.rtc", rtobj.getObjRef());
@@ -240,6 +243,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
final String fullName0 = "id0-lv0.kind0-lv0/id0-lv1.kind0-lv1";
@@ -270,6 +274,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// ãªãã¸ã§ã¯ãããã¤ã³ããããããæ£ããè¨å®ããããï¼
@@ -303,6 +308,7 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
naming.bindByString("localhost.host_cxt", rtobj.getObjRef());
// naming.bindByString("localhost.host_cxt", rtobj.getObjRef());
@@ -339,9 +345,11 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// ãªãã¸ã§ã¯ãããã¤ã³ããããããæ£ããè¨å®ããããï¼
@@ -371,8 +379,10 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2= new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// ãªãã¸ã§ã¯ãããã¤ã³ããããããæ£ããè¨å®ããããï¼
@@ -412,9 +422,11 @@
// ãã¹ãç¨ã«ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
// ï¼ã¤ç®ã®ãªãã¸ã§ã¯ãããã¤ã³ããã
@@ -443,6 +455,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// ãã¹ãã«ç¨ããã³ã³ããã¹ããæºåãã¦ãã
@@ -486,6 +499,7 @@
// ãã¤ã³ãããã³ã³ããã¹ããä½æãã¦ãã
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
NamingContext nc = naming.newContext();
@@ -517,8 +531,10 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
NamingContext nc1 = naming.newContext();
@@ -565,9 +581,11 @@
// ãã¹ãã«ç¨ããã³ã³ããã¹ããæºåãã¦ãã
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
rtobj2 = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj2);
assertNotNull(rtobj2.getObjRef());
NamingContext nc1 = naming.newContext();
@@ -605,6 +623,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// ãªãã¸ã§ã¯ãããã¤ã³ããã
@@ -642,6 +661,7 @@
naming.init("localhost:2809");
assertNotNull(naming.m_rootContext);
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
naming.rebindByString("localhost2.host_cxt2/mgr2/sample2.rtc2", rtobj.getObjRef());
@@ -864,6 +884,7 @@
try {
naming.init("localhost:2809");
rtobj = new RTObject_impl(manager);
+ manager.m_objManager.activate(rtobj);
assertNotNull(rtobj.getObjRef());
// æ°ããã³ã³ããã¹ãããã¤ã³ãã§ãããï¼
Copied: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java (from rev 731, branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java)
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java (rev 0)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/CorbaObjectManagerTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -0,0 +1,112 @@
+package jp.go.aist.rtm.RTC;
+
+import junit.framework.TestCase;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.ORBPackage.InvalidName;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.POAManager;
+import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
+import org.omg.PortableServer.POAPackage.ObjectNotActive;
+import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
+import org.omg.PortableServer.POAPackage.ServantNotActive;
+import org.omg.PortableServer.POAPackage.WrongPolicy;
+
+/**
+*
+* CORBAãªãã¸ã§ã¯ãããã¼ã¸ã£ã¯ã©ã¹ããã¹ã
+* 対象ã¯ã©ã¹ï¼CorbaObjectManager
+*
+*/
+public class CorbaObjectManagerTest extends TestCase {
+ private CorbaObjectManager objManager;
+ private POA m_POA;
+ private ORB m_ORB;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ String[] argv = new String[0];
+ // (1-1) ORBã®åæå
+ java.util.Properties props = new java.util.Properties();
+ m_ORB = ORB.init(argv, props);
+
+ // (1-2) POAManagerã®activate
+ try {
+ m_POA = org.omg.PortableServer.POAHelper.narrow(
+ m_ORB.resolve_initial_references("RootPOA"));
+ } catch (InvalidName e1) {
+ e1.printStackTrace();
+ fail();
+ }
+ POAManager pman = m_POA.the_POAManager();
+ try {
+ pman.activate();
+ } catch (AdapterInactive e1) {
+ e1.printStackTrace();
+ fail();
+ }
+ objManager = new CorbaObjectManager(m_ORB, m_POA);
+ }
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ if( m_ORB != null) {
+ m_ORB.destroy();
+ m_ORB = null;
+ }
+ }
+
+ /**
+ * <p>RTObjectã®Activate/Deactivate
+ * <ul>
+ * <li>RTObjectãActivateã§ãããï¼</li>
+ * <li>RTObjectãDeactivateã§ãããï¼</li>
+ * </ul>
+ * </p>
+ */
+ public void test_activate_deactivate_rtobject() {
+ Manager manager = Manager.instance();
+ RTObject_impl rtobject = new RTObject_impl(manager);
+ try {
+ rtobject._this();
+ fail();
+ } catch ( Exception ex ) {
+ }
+ try {
+ // RTObjectãã¢ã¯ãã£ãåãã
+ objManager.activate(rtobject);
+ assertNotNull(rtobject._this());
+ // RTObjectã«åç
§ãè¨å®ããã¦ããã確èªãããã¨ã§ã¢ã¯ãã£ãåã®æåã確èªãã
+ assertNotNull(rtobject.getObjRef());
+ rtobject.get_sdo_id();
+ } catch (ServantAlreadyActive e) {
+ e.printStackTrace();
+ fail();
+ } catch (WrongPolicy e) {
+ e.printStackTrace();
+ fail();
+ } catch (ObjectNotActive e) {
+ e.printStackTrace();
+ fail();
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ try {
+ // éã¢ã¯ãã£ãåãã
+ objManager.deactivate(rtobject);
+ } catch (ServantNotActive e) {
+ e.printStackTrace();
+ fail();
+ } catch (WrongPolicy e) {
+ e.printStackTrace();
+ fail();
+ } catch (ObjectNotActive e) {
+ e.printStackTrace();
+ fail();
+ }
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ }
+ }
+}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/ManagerTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1097,6 +1097,7 @@
assertNotNull(manager.getORB());
assertNotNull(manager.getPOA());
assertNotNull(manager.getPOAManager());
+ assertNotNull(manager.m_objManager);
}
/**
@@ -1169,6 +1170,7 @@
assertNotNull(manager.getORB());
assertNotNull(manager.getPOA());
assertNotNull(manager.getPOAManager());
+ assertNotNull(manager.m_objManager);
assertNotNull(manager.m_namingManager);
assertNotNull(manager.m_module);
assertNotNull(manager.m_terminator);
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceConsumerTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -62,6 +62,10 @@
comp = manager.createComponent("MyServiceConsumer");
}
protected void tearDown() throws Exception {
+ for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
+ Thread.yield();
+ }
Thread.sleep(300);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/MyServiceProviderTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -62,6 +62,10 @@
comp = manager.createComponent("MyServiceProvider");
}
protected void tearDown() throws Exception {
+ for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
+ Thread.yield();
+ }
Thread.sleep(300);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingManagerTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -96,7 +96,10 @@
*/
public void test_bindObject_and_unbindObject() throws Exception {
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
ManagerServant mgs = new ManagerServant();
@@ -124,6 +127,7 @@
mgs = null;
rto = null;
+ objMgr = null;
}
/**
@@ -135,10 +139,15 @@
*/
public void test_unbindAll() throws Exception {
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
+
RTObject_impl rto1 = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto1);
assertNotNull(rto1.getObjRef());
RTObject_impl rto2 = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto2);
assertNotNull(rto2.getObjRef());
ManagerServant mgs1 = new ManagerServant();
@@ -178,6 +187,7 @@
mgs1 = null;
rto2 = null;
rto1 = null;
+ objMgr = null;
}
/**
@@ -189,10 +199,15 @@
*/
public void test_getObjects() throws Exception {
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
+
RTObject_impl rto1 = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto1);
assertNotNull(rto1.getObjRef());
RTObject_impl rto2 = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto2);
assertNotNull(rto2.getObjRef());
// NamingManagerãçæãã
@@ -217,6 +232,7 @@
rto2 = null;
rto1 = null;
+ objMgr = null;
}
/**
@@ -239,7 +255,11 @@
String kind = new String("kind"+Integer.toString(num));
String idkind = id + "." + kind;
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
+
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
@@ -265,6 +285,7 @@
rto = null;
+ objMgr = null;
nmgr = null;
}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/NamingOnCorbaTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -57,7 +57,10 @@
final String name_server = "localhost:2809";
NamingOnCorba noc = new NamingOnCorba(m_pORB, name_server);
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
RTObject_impl rto = new RTObject_impl(m_pORB, m_pPOA);
+// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
// RTObject_implãªãã¸ã§ã¯ãããã¤ã³ãã§ãããï¼
@@ -80,6 +83,7 @@
nc.resolve(name);
fail("Exception not thrown.");
} catch (Exception expected) {}
+ objMgr.deactivate(rto);
}
/**
@@ -94,7 +98,10 @@
final String name_server = "localhost:2809";
NamingOnCorba noc = new NamingOnCorba(m_pORB, name_server);
+ // ãã¤ã³ããããªãã¸ã§ã¯ããä½æãã¦ãã
+ CorbaObjectManager objMgr = new CorbaObjectManager(m_pORB, m_pPOA);
ManagerServant rto = new ManagerServant();
+// objMgr.activate(rto);
assertNotNull(rto.getObjRef());
// RTObject_implãªãã¸ã§ã¯ãããã¤ã³ãã§ãããï¼
@@ -117,6 +124,7 @@
nc.resolve(name);
fail("Exception not thrown.");
} catch (Exception expected) {}
+ objMgr.deactivate(rto);
}
}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqInTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -60,6 +60,10 @@
comp = manager.createComponent("SeqIn");
}
protected void tearDown() throws Exception {
+ for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
+ Thread.yield();
+ }
Thread.sleep(600);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/SeqOutTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -60,6 +60,10 @@
comp = manager.createComponent("SeqOut");
}
protected void tearDown() throws Exception {
+ for(int intIdx=0;intIdx<manager.m_ecs.size();intIdx++) {
+ manager.m_ecs.elementAt(intIdx).stop();
+ Thread.yield();
+ }
Thread.sleep(600);
manager.shutdownComponents();
manager.shutdownNaming();
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/buffer/RingBufferTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -5,8 +5,6 @@
import jp.go.aist.rtm.RTC.util.Properties;
import junit.framework.TestCase;
-import java.util.*;
-
/**
* <p>RingBufferã®ããã®ãã¹ãã±ã¼ã¹ã§ãã</p>
*/
@@ -533,8 +531,6 @@
}
return;
}
-
-
public void test_write_read2() {
//(2)Can the buffer correctly read one written data
//in the state of full?
@@ -544,7 +540,7 @@
for (int i = 0; i < length2; i++) {
buff2.write(i + 123);
}
-
+
// ï¼ãã¼ã¿æ¸è¾¼ã»èªåºãè¡ã
for (int writeValue = 0; writeValue < 100; writeValue++) {
// æ¸è¾¼ã¿
@@ -565,7 +561,7 @@
readValue.v.intValue());
}
}
-
+
// (3) ãããã¡ã«å¹¾åãã¼ã¿ãæ¸ãè¾¼ã¾ãã¦ããç¶æ
ã§ï¼ãã¼ã¿æ¸è¾¼ã»èªåºãè¡ããæ¸ãè¾¼ãã ãã¼ã¿ãæ£ããèªã¿åºãããï¼
int length3 = 10;
RingBuffer<Integer> buff3 = new RingBuffer<Integer>(length3);
@@ -594,71 +590,6 @@
}
}
}
-
-
- class writing_thread extends Thread {
- RingBuffer<Integer> m_buff;
- int m_loopcnt;
- public writing_thread(RingBuffer<Integer> buff, int loop) {
- m_buff = buff;
- m_loopcnt = loop;
- }
-
- public void start() {
- super.start();
- }
-
- public void run() {
- //DataRef<Integer> readValue = new DataRef<Integer>(0);
- for (int i = 0; i < m_loopcnt; ++i) {
- //m_buff.read(readValue);
- m_buff.write(i);
- }
- }
-
- ArrayList m_data = new ArrayList();
- public ArrayList getData() {
- return m_data;
- }
- }
-
- public void test_write_read3() {
- int loopcnt = 1000000;
- Properties prop = new Properties();
- prop.setProperty("write.full_policy","block");
- prop.setProperty("write.timeout","5.0");
- prop.setProperty("read.empty_policy","block");
- prop.setProperty("read.timeout","5.0");
- RingBuffer<Integer> buff = new RingBuffer<Integer>(8);
- DataRef<Integer> readValue = new DataRef<Integer>(0);
- buff.init(prop);
- writing_thread wt = new writing_thread(buff, loopcnt);
- wt.start();
- try {
- Thread.sleep(10);
- }
- catch(InterruptedException e) {
- }
- ArrayList rdata = new ArrayList();
- for (int i = 0; i < loopcnt; i++) {
- buff.read(readValue);
- rdata.add(i);
- //buff.write(i);
- }
- try {
- wt.join();
- } catch (InterruptedException e) {
- System.out.println(e);
- }
- ArrayList wdata = wt.getData();
- Iterator w_ite = wdata.iterator();
- Iterator r_ite = rdata.iterator();
- while(w_ite.hasNext()) {
- assertEquals("rdata==wdata",w_ite.next(),r_ite.next());
- }
- }
-
-
/**
* <p>write()ã¡ã½ããããã³read()ã¡ã½ããã®ãã¹ãï¼ãããã¡é·ï¼ã®å ´åï¼
* <ul>
@@ -717,7 +648,7 @@
//and the increment does the pointer on the reading side.
buff2.write(0);
- assertEquals("(2)-2",true, buff2.full());
+ assertEquals("(2)-2",true, buff2.full());
//Readinfg
// Because it reads out data from the reading side and
// the number of pointers is increased,
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContextTests.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -51,6 +51,7 @@
* </p>
*/
public void test_tick() {
+/*
// RTObjectãçæãã
Manager manager = Manager.instance();
DataFlowComponentMock rto = new DataFlowComponentMock(manager); // will be deleted automatically
@@ -60,36 +61,27 @@
// ExecutionContextãçæãã
ExtTrigExecutionContext ec = new ExtTrigExecutionContext(); // will be deleted automatically
assertEquals(ReturnCode_t.RTC_OK, ec.start());
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- assertEquals(ReturnCode_t.RTC_OK, ec.add_component(rto._this()));
- ec.m_worker.updateComponentList();
+ assertEquals(ReturnCode_t.RTC_OK, ec.add(rto.getObjRef()));
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(rto.getObjRef()));
ec.tick();
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+
// tick()å¼åºãè¡ãããã®åæ°ã¨on_execute()ã®å¼åºåæ°ãä¸è´ãã¦ãããã¨ã確èªãã
- for (int tickCalledCount = 2; tickCalledCount < 5; tickCalledCount++) {
+ for (int tickCalledCount = 0; tickCalledCount < 10; tickCalledCount++) {
try {
- Thread.sleep(100);
+ Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
assertEquals(tickCalledCount, mock.countLog("on_execute"));
try {
- Thread.sleep(100);
+ Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
ec.tick();
}
-}
+*/
+ }
/**
* <p>name()ã¡ã½ããã®ãã¹ã
@@ -99,12 +91,14 @@
* </p>
*/
public void test_name() {
+/*
String name = "jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext";
ECFactoryBase factory = new ECFactoryJava(name);
// ã³ã³ã¹ãã©ã¯ã¿ã§æå®ããå称ããname()ã¡ã½ããã§æ£ããåå¾ã§ãããï¼
assertEquals(name, factory.name());
+*/
}
/**
@@ -116,14 +110,16 @@
* </p>
*/
public void test_create_destroy() {
+/*
ECFactoryJava factory = new ECFactoryJava("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext");
assertEquals("jp.go.aist.rtm.RTC.executionContext.ExtTrigExecutionContext", factory.m_name);
ExecutionContextBase base = factory.create();
assertNotNull(base);
- //assertEquals(ExecutionKind.PERIODIC, base.get_kind());
- assertEquals(Double.valueOf(1000.0), Double.valueOf(base.getRate()));
+ assertEquals(ExecutionKind.PERIODIC, base.get_kind());
+ assertEquals(Double.valueOf(0.0), Double.valueOf(base.get_rate()));
base = factory.destroy(base);
assertNull(base);
+*/
}
private class LightweightRTObjectMock extends DataFlowComponentBase {
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContextTests.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -120,8 +120,8 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectããã¤ã³ããã
- ec.bindComponent(mock);
+ // ExecutionContextã«RTObjectãç»é²ãã
+ assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
// ãã®æç¹ã§ã¯ãã¾ã on_startup()ã¯å¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_startup"));
@@ -172,15 +172,15 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectããã¤ã³ããã
- ec.bindComponent(mock);
+ // ExecutionContextã«RTObjectãç»é²ãã
+ assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
// éAliveç¶æ
ã«ãã¦ãã
mock.setAlive(false);
assertFalse(mock.is_alive());
// start()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- //assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.start());
+ // assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.start());
}
/**
@@ -200,8 +200,8 @@
// ExecutionContextãçæãã
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
- // ExecutionContextã«RTObjectããã¤ã³ããã
- ec. bindComponent(mock);
+ // ExecutionContextã«RTObjectãç»é²ãã
+ assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
// start()ãå¼ã³åºã
assertEquals(ReturnCode_t.RTC_OK, ec.start());
@@ -325,8 +325,8 @@
PeriodicExecutionContext ec = new PeriodicExecutionContext(); // will be deleted automatically
assertEquals(ExecutionKind.PERIODIC, ec.get_kind());
- // ExecutionContextã«RTObjectããã¤ã³ããã
- ec.bindComponent(mock);
+ // ExecutionContextã«RTObjectãç»é²ãã
+ assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
// ãã®æç¹ã§ã¯ãon_rate_changed()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_rate_changed"));
@@ -335,7 +335,7 @@
assertEquals(ReturnCode_t.RTC_OK, ec.set_rate(1.0d));
// ãã®æç¹ã§ãon_rate_changed()ã1åã ãå¼ã³åºããã¦ããã¯ã
- //assertEquals(1, mock.countLog("on_rate_changed"));
+ assertEquals(1, mock.countLog("on_rate_changed"));
}
/**
@@ -383,8 +383,7 @@
// LightweightRTObjectã§ã¯ããããDataFlowComponentã§ã¯ãªãRTObjectãç¨ãã¦ã
// add()å¼åºãã試ã¿ã¦ãæå³ã©ããã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- // narrowã§ä¾å¤çºç
- //assertEquals(ReturnCode_t.BAD_PARAMETER, ec.add_component(mock._this()));
+ assertEquals(ReturnCode_t.BAD_PARAMETER, ec.add_component(mock._this()));
}
/**
@@ -407,13 +406,12 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals("2:",ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
+
// ãã®æç¹ã§ã¯ãattach_executioncontext()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals("3:",0, mock.countLog("detach_executioncontext"));
// ExecutionContextã¸ã®ç»é²ã解é¤ãã
assertEquals("4:",ReturnCode_t.RTC_OK, ec.remove_component(mock._this()));
- ec.m_worker.updateComponentList();
// ãã®æç¹ã§ãdetach_executioncontext()ã1åã ãå¼ã³åºããã¦ããã¯ã
assertEquals("5:",1, mock.countLog("detach_executioncontext"));
@@ -462,15 +460,9 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
// ã³ã³ãã¼ãã³ããActiveã«ãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
- ec.m_worker.updateComponentList();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
@@ -478,8 +470,7 @@
assertEquals(LifeCycleState.ACTIVE_STATE, ec.get_component_state(mock._this()));
// ã³ã³ãã¼ãã³ããActiveã®ã¾ã¾ã§remove()ã試ã¿ã¦ãæå³ã©ããã®ã¨ã©ã¼ã³ã¼ããæ»ããã¨ã確èªãã
- // 1.1.0ã§ã¯ç¶æ
ã¯ãã§ãã¯ãã¦ããªãã
- //assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.remove_component(mock._this()));
+ // assertEquals(ReturnCode_t.PRECONDITION_NOT_MET, ec.remove_component(mock._this()));
}
/**
@@ -502,17 +493,12 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// ãã®æç¹ã§ã¯ãã¾ã on_activated()ã¯1åãå¼ã³åºããã¦ããªãã¯ã
assertEquals(0, mock.countLog("on_activated"));
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
// ã³ã³ãã¼ãã³ããActiveã«ãã
- ec.activate_component(mock._this());
+ assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
try {
Thread.sleep(100);
} catch (InterruptedException e) {
@@ -571,7 +557,6 @@
// ã³ã³ãã¼ãã³ããErrorç¶æ
ã«ã¾ã§é·ç§»ããã
mock.setError(true);
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
// Errorç¶æ
ã¸é·ç§»ããã¾ã§å¾
ã¤ãæ¬æ¥ããã®ã¹ãªã¼ããä»æ§ä¸å¿
è¦ãå¦ãï¼
try {
@@ -604,14 +589,13 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// éAliveç¶æ
ã«ãã¦ãã
mock.setAlive(false);
assertFalse(mock.is_alive());
// activate_component()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
- //assertEquals(ReturnCode_t.BAD_PARAMETER, ec.activate_component(mock._this()));
+ // assertEquals(ReturnCode_t.BAD_PARAMETER, ec.activate_component(mock._this()));
}
/**
@@ -634,7 +618,6 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// ã³ã³ãã¼ãã³ããactivateãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
@@ -702,7 +685,6 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// ã³ã³ãã¼ãã³ããactivateãã
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
@@ -744,7 +726,6 @@
// ã³ã³ãã¼ãã³ããErrorç¶æ
ã«ã¾ã§é·ç§»ããã
mock.setError(true);
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
assertEquals(ReturnCode_t.RTC_OK, ec.activate_component(mock._this()));
// Errorç¶æ
ã¸é·ç§»ããã¾ã§å¾
ã¤ãæ¬æ¥ããã®ã¹ãªã¼ããä»æ§ä¸å¿
è¦ãå¦ãï¼
try {
@@ -787,7 +768,6 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// ãã®ç¶æ
(Inactive)ã§reset_component()å¼åºããè¡ããæå³ã©ããã®ã¨ã©ã¼ã³ã¼ãã§æ»ããã¨ã確èªãã
assertEquals(LifeCycleState.INACTIVE_STATE, ec.get_component_state(mock._this()));
@@ -814,7 +794,6 @@
// ExecutionContextã«RTObjectãç»é²ãã
assertEquals(ReturnCode_t.RTC_OK, ec.add_component(mock._this()));
- ec.m_worker.updateComponentList();
// éAliveç¶æ
(Createç¶æ
)ã«ãã¦ãã
mock.setAlive(false);
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogBufTimeTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogBufTimeTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogBufTimeTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,60 +0,0 @@
-package jp.go.aist.rtm.RTC.log;
-
-import java.util.logging.ConsoleHandler;
-
-import junit.framework.TestCase;
-
-public class LogBufTimeTest extends TestCase {
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- *
- * ãã¤ã¯ãç§ã®åºåãã¹ã
- * clock_time=adjustedã®å ´åï¼clock_time=systemã®å ´å
- * ããããã§ãã¤ã¯ãç§ã®å¤ãæ£å¸¸ã«åºåããããã確èªãã
- */
- public void test_case0() {
- Logbuf rtcout = new Logbuf("test0");
-
- rtcout.setEnabled();
- rtcout.setClockType("adjusted");
- rtcout.addStream(new ConsoleHandler());
- rtcout.setEnabled();
- // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
- System.err.println("--- test_case0() adjusted ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.setDateFormat("%b %d %H:%M:%S.%Q %q");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
- // PARANOIDã¯ãã¤ã¯ãç§ã®åºåãªã
- // VERBOSE以éã¯ãã¤ã¯ãç§ã®åºåãããã°OK
-
- System.err.println("--- test_case0() system ---");
- rtcout.setClockType("system");
- rtcout.setDateFormat("%b %d %H:%M:%S.%Q");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.setDateFormat("%b %d %H:%M:%S.%Q %q");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
- // PARANOIDã¯ãã¤ã¯ãç§ã®åºåãªã
- // VERBOSE以éã¯ãã¤ã¯ãç§ã®åºåãããã°OK
- }
-}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/log/LogbufTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,15 +1,16 @@
package jp.go.aist.rtm.RTC.log;
+import junit.framework.TestCase;
+
import java.io.BufferedReader;
+import java.io.File;
import java.io.FileReader;
import java.io.IOException;
-import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
-import java.util.logging.Handler;
-import java.util.logging.LogRecord;
+import java.util.logging.ConsoleHandler;
+import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.Manager;
-import junit.framework.TestCase;
/**
*
@@ -39,74 +40,60 @@
// STDOUT
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
System.err.println("\n\n--- test_case0() setLevel() Not Set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 0");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 0");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 0");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 0");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 0");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 0");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 0");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 0");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 0");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 0");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 0");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 0");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 0");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT 0");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT 0");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 0");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 0");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 0");
// addStream()ãã¦ããªãã®ã§ãprintlnã®æååãåºåãããªããã°OK.
// "Logbuf.println() destination handler was not registered."ã®åºåããã°OK.
rtcout.setLevel("PARANOID"); //å
¨ã¦
System.err.println("--- test_case0() setLevel(PARANOID), addStream(STDOUT) Not set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 1");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 1");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 1");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 1");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 1");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 1");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 1");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 1");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 1");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 1");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 1");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 1");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 1");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT 1");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT 1");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 1");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 1");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 1");
// addStream()ãã¦ããªãã®ã§ãprintlnã®æååãåºåãããªããã°OK.
// "Logbuf.println() destination handler was not registered."ã®åºåããã°OK.
- LocalHandler handler = new LocalHandler();
- rtcout.addStream(handler);
- rtcout.setClockType("logical");
-// rtcout.addStream(new ConsoleHandler());
+ rtcout.addStream(new ConsoleHandler());
System.err.println("--- test_case0() addStream(STDOUT) set ---");
rtcout.setDisabled();
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 2");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 2");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 2");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 2");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT 2");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT 2");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 2");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 2");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 2");
// ä½ãåºåãããªããã°OK.
- String expected = "";
- assertEquals(expected, handler.getStr());
rtcout.setEnabled();
System.err.println("--- test_case0() addStream(STDOUT) set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT 2");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT 2");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT 2");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT 2");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT 2");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT 2");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT 2");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT 2");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT 2");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT 2");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT 2");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT 2");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT 2");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT 2");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT 2");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT 2");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT 2");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT 2");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected = "00 000 test0 PARANOID : PARANOID string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 VERBOSE : VERBOSE string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 TRACE : TRACE string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 DEBUG : DEBUG string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 INFO : INFO string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 WARN : WARN string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 ERROR : ERROR string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 FATAL : FATAL string to STDOUT 2" + System.getProperty("line.separator") +
- "00 000 test0 SILENT : SILENT string to STDOUT 2" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
+
}
/**
@@ -119,212 +106,138 @@
rtcout.setEnabled();
// STDOUT
-// // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
-// rtcout.addStream(new ConsoleHandler());
- rtcout.setEnabled();
- rtcout.setClockType("logical");
- rtcout.setLevel("PARANOID");
- LocalHandler handler = new LocalHandler();
- rtcout.addStream(handler);
+ // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
+ rtcout.addStream(new ConsoleHandler());
rtcout.setLevel("PARANOID");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ System.err.println("\n\n--- setLevel:PARANOID check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- String expected =
- "00 000 test1 PARANOID : PARANOID string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("VERBOSE");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ System.err.println("--- setLevel:VERBOSE check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("TRACE");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ System.err.println("--- setLevel:TRACE check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("DEBUG");
System.err.println("--- setLevel:DEBUG check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("INFO");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ System.err.println("--- setLevel:INFO check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("WARN");
System.err.println("--- setLevel:WARN check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("ERROR");
System.err.println("--- setLevel:ERROR check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("FATAL");
System.err.println("--- setLevel:FATAL check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test1 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test1 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("SILENT");
System.err.println("--- setLevel:SILENT check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
- expected = "";
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel("other");
System.err.println("--- setLevel:other check ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
- expected = "";
- assertEquals(expected, handler.getStr());
}
@@ -338,207 +251,139 @@
rtcout.setEnabled();
// STDOUT
-// // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
-// rtcout.addStream(new ConsoleHandler());
- rtcout.setEnabled();
- rtcout.setClockType("logical");
- rtcout.setLevel("PARANOID");
- LocalHandler handler = new LocalHandler();
- rtcout.addStream(handler);
+ // Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
+ rtcout.addStream(new ConsoleHandler());
- rtcout.setLevel(Logbuf.PARANOID);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.PARANOID);
+ System.err.println("\n\n--- setLevel:int PARANOID check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- String expected =
- "00 000 test2 PARANOID : PARANOID string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.VERBOSE);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.VERBOSE);
+ System.err.println("--- setLevel:int VERBOSE check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 VERBOSE : VERBOSE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.TRACE);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.TRACE);
+ System.err.println("--- setLevel:int TRACE check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 TRACE : TRACE string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.DEBUG);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.DEBUG);
+ System.err.println("--- setLevel:int DEBUG check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 DEBUG : DEBUG string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.INFO);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.INFO);
+ System.err.println("--- setLevel:int INFO check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 INFO : INFO string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.WARN);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.WARN);
+ System.err.println("--- setLevel:int WARN check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 WARN : WARN string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.ERROR);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.ERROR);
+ System.err.println("--- setLevel:int ERROR check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 ERROR : ERROR string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.FATAL);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.FATAL);
+ System.err.println("--- setLevel:int FATAL check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
- expected =
- "00 000 test2 FATAL : FATAL string to STDOUT" + System.getProperty("line.separator") +
- "00 000 test2 SILENT : SILENT string to STDOUT" + System.getProperty("line.separator");
- assertEquals(expected, handler.getStr());
- handler.clear();
- rtcout.setLevel(Logbuf.SILENT);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ rtcout.setLevel(rtcout.SILENT);
+ System.err.println("--- setLevel:int SILENT check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
- expected = "";
- assertEquals(expected, handler.getStr());
- handler.clear();
rtcout.setLevel(999);
- rtcout.println(Logbuf.PARANOID, "PARANOID string to STDOUT");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to STDOUT");
- rtcout.println(Logbuf.TRACE, "TRACE string to STDOUT");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to STDOUT");
- rtcout.println(Logbuf.INFO, "INFO string to STDOUT");
- rtcout.println(Logbuf.WARN, "WARN string to STDOUT");
- rtcout.println(Logbuf.ERROR, "ERROR string to STDOUT");
- rtcout.println(Logbuf.FATAL, "FATAL string to STDOUT");
- rtcout.println(Logbuf.SILENT, "SILENT string to STDOUT");
+ System.err.println("--- setLevel:int 999 check ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to STDOUT");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to STDOUT");
+ rtcout.println(rtcout.TRACE, "TRACE string to STDOUT");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to STDOUT");
+ rtcout.println(rtcout.INFO, "INFO string to STDOUT");
+ rtcout.println(rtcout.WARN, "WARN string to STDOUT");
+ rtcout.println(rtcout.ERROR, "ERROR string to STDOUT");
+ rtcout.println(rtcout.FATAL, "FATAL string to STDOUT");
+ rtcout.println(rtcout.SILENT, "SILENT string to STDOUT");
// ä½ãåºåãããªããã°OK.
- expected = "";
- assertEquals(expected, handler.getStr());
-
+
}
/**
@@ -562,15 +407,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("PARANOID");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -619,15 +464,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("VERBOSE");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -676,15 +521,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("TRACE");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -732,15 +577,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("DEBUG");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -788,15 +633,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("INFO");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -844,15 +689,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("WARN");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -900,15 +745,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("ERROR");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -956,15 +801,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("FATAL");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -1012,15 +857,15 @@
System.err.println("Error: cannot open logfile: " + logfile );
}
rtcout.setLevel("SILENT");
- rtcout.println(Logbuf.PARANOID, "PARANOID string to rtc.log");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string to rtc.log");
- rtcout.println(Logbuf.TRACE, "TRACE string to rtc.log");
- rtcout.println(Logbuf.DEBUG, "DEBUG string to rtc.log");
- rtcout.println(Logbuf.INFO, "INFO string to rtc.log");
- rtcout.println(Logbuf.WARN, "WARN string to rtc.log");
- rtcout.println(Logbuf.ERROR, "ERROR string to rtc.log");
- rtcout.println(Logbuf.FATAL, "FATAL string to rtc.log");
- rtcout.println(Logbuf.SILENT, "SILENT string to rtc.log");
+ rtcout.println(rtcout.PARANOID, "PARANOID string to rtc.log");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string to rtc.log");
+ rtcout.println(rtcout.TRACE, "TRACE string to rtc.log");
+ rtcout.println(rtcout.DEBUG, "DEBUG string to rtc.log");
+ rtcout.println(rtcout.INFO, "INFO string to rtc.log");
+ rtcout.println(rtcout.WARN, "WARN string to rtc.log");
+ rtcout.println(rtcout.ERROR, "ERROR string to rtc.log");
+ rtcout.println(rtcout.FATAL, "FATAL string to rtc.log");
+ rtcout.println(rtcout.SILENT, "SILENT string to rtc.log");
//ãã¡ã¤ã«åºåã®ç¢ºèª
int cnt = 0;
@@ -1060,35 +905,35 @@
rtcout.setLevel("PARANOID");
int lv = 0;
- lv = Logbuf.strToLogLevel("SILENT");
- assertEquals(Logbuf.SILENT, lv);
+ lv = rtcout.strToLogLevel("SILENT");
+ assertEquals(rtcout.SILENT, lv);
- lv = Logbuf.strToLogLevel("FATAL");
- assertEquals(Logbuf.FATAL, lv);
+ lv = rtcout.strToLogLevel("FATAL");
+ assertEquals(rtcout.FATAL, lv);
- lv = Logbuf.strToLogLevel("ERROR");
- assertEquals(Logbuf.ERROR, lv);
+ lv = rtcout.strToLogLevel("ERROR");
+ assertEquals(rtcout.ERROR, lv);
- lv = Logbuf.strToLogLevel("WARN");
- assertEquals(Logbuf.WARN, lv);
+ lv = rtcout.strToLogLevel("WARN");
+ assertEquals(rtcout.WARN, lv);
- lv = Logbuf.strToLogLevel("INFO");
- assertEquals(Logbuf.INFO, lv);
+ lv = rtcout.strToLogLevel("INFO");
+ assertEquals(rtcout.INFO, lv);
- lv = Logbuf.strToLogLevel("DEBUG");
- assertEquals(Logbuf.DEBUG, lv);
+ lv = rtcout.strToLogLevel("DEBUG");
+ assertEquals(rtcout.DEBUG, lv);
- lv = Logbuf.strToLogLevel("TRACE");
- assertEquals(Logbuf.TRACE, lv);
+ lv = rtcout.strToLogLevel("TRACE");
+ assertEquals(rtcout.TRACE, lv);
- lv = Logbuf.strToLogLevel("VERBOSE");
- assertEquals(Logbuf.VERBOSE, lv);
+ lv = rtcout.strToLogLevel("VERBOSE");
+ assertEquals(rtcout.VERBOSE, lv);
- lv = Logbuf.strToLogLevel("PARANOID");
- assertEquals(Logbuf.PARANOID, lv);
+ lv = rtcout.strToLogLevel("PARANOID");
+ assertEquals(rtcout.PARANOID, lv);
- lv = Logbuf.strToLogLevel("other");
- assertEquals(Logbuf.SILENT, lv);
+ lv = rtcout.strToLogLevel("other");
+ assertEquals(rtcout.SILENT, lv);
System.err.println("--- test_strToLogLevel() is OK ---");
}
@@ -1110,14 +955,14 @@
// "logger.date_format", "%b %d %H:%M:%S",
format = "%b %d %H:%M:%S";
rtcout.setDateFormat(format);
- rtcout.println(Logbuf.TRACE, "DateFormat Month day HH:MI:SS");
+ rtcout.println(rtcout.TRACE, "DateFormat Month day HH:MI:SS");
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
// æ¥ä»ã¨æå»ã®ãã¿ã¼ã³ããMonth day hh:mi:ss ã§ãããOK
//Sep 29 16:36:53 TEST1 TRACE : TRACE string to rtc.log
format = "%Y/%m/%d %p %I:%M:%S";
rtcout.setDateFormat(format);
- rtcout.println(Logbuf.TRACE, "DateFormat YYYY/MM/DD pp II:MI:SS");
+ rtcout.println(rtcout.TRACE, "DateFormat YYYY/MM/DD pp II:MI:SS");
// Junitåºåãã¡ã¤ã«*.xmlã® <system-err>ã®æ¬ã«åºåããã
// æ¥ä»ã¨æå»ã®ãã¿ã¼ã³ããYYYY/MM/DD pp II:MI:SS ã§ãããOK
@@ -1163,75 +1008,75 @@
rtcout.setLevel("INFO");
System.err.println("--- Logbuf(Manager) set ---");
- rtcout.println(Logbuf.INFO, "--- setLevel(INFO), addStream(STDOUT) set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string 1");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string 1");
- rtcout.println(Logbuf.TRACE, "TRACE string 1");
- rtcout.println(Logbuf.DEBUG, "DEBUG string 1");
- rtcout.println(Logbuf.INFO, "INFO string 1");
- rtcout.println(Logbuf.WARN, "WARN string 1");
- rtcout.println(Logbuf.ERROR, "ERROR string 1");
- rtcout.println(Logbuf.FATAL, "FATAL string 1");
- rtcout.println(Logbuf.SILENT, "SILENT string 1");
+ rtcout.println(rtcout.INFO, "--- setLevel(INFO), addStream(STDOUT) set ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string 1");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string 1");
+ rtcout.println(rtcout.TRACE, "TRACE string 1");
+ rtcout.println(rtcout.DEBUG, "DEBUG string 1");
+ rtcout.println(rtcout.INFO, "INFO string 1");
+ rtcout.println(rtcout.WARN, "WARN string 1");
+ rtcout.println(rtcout.ERROR, "ERROR string 1");
+ rtcout.println(rtcout.FATAL, "FATAL string 1");
+ rtcout.println(rtcout.SILENT, "SILENT string 1");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout2 = new Logbuf("Manager.hoge1");
rtcout2.setEnabled();
System.err.println("--- Logbuf(Manager.hoge1) set ---");
- rtcout2.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
- rtcout2.println(Logbuf.PARANOID, "PARANOID string 2");
- rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 2");
- rtcout2.println(Logbuf.TRACE, "TRACE string 2");
- rtcout2.println(Logbuf.DEBUG, "DEBUG string 2");
- rtcout2.println(Logbuf.INFO, "INFO string 2");
- rtcout2.println(Logbuf.WARN, "WARN string 2");
- rtcout2.println(Logbuf.ERROR, "ERROR string 2");
- rtcout2.println(Logbuf.FATAL, "FATAL string 2");
- rtcout2.println(Logbuf.SILENT, "SILENT string 2");
+ rtcout2.println(rtcout2.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout2.println(rtcout2.PARANOID, "PARANOID string 2");
+ rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 2");
+ rtcout2.println(rtcout2.TRACE, "TRACE string 2");
+ rtcout2.println(rtcout2.DEBUG, "DEBUG string 2");
+ rtcout2.println(rtcout2.INFO, "INFO string 2");
+ rtcout2.println(rtcout2.WARN, "WARN string 2");
+ rtcout2.println(rtcout2.ERROR, "ERROR string 2");
+ rtcout2.println(rtcout2.FATAL, "FATAL string 2");
+ rtcout2.println(rtcout2.SILENT, "SILENT string 2");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout2.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.hoge1) set ---");
- rtcout2.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout2.println(Logbuf.PARANOID, "PARANOID string 3");
- rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 3");
- rtcout2.println(Logbuf.TRACE, "TRACE string 3");
- rtcout2.println(Logbuf.DEBUG, "DEBUG string 3");
- rtcout2.println(Logbuf.INFO, "INFO string 3");
- rtcout2.println(Logbuf.WARN, "WARN string 3");
- rtcout2.println(Logbuf.ERROR, "ERROR string 3");
- rtcout2.println(Logbuf.FATAL, "FATAL string 3");
- rtcout2.println(Logbuf.SILENT, "SILENT string 3");
+ rtcout2.println(rtcout2.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout2.println(rtcout2.PARANOID, "PARANOID string 3");
+ rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 3");
+ rtcout2.println(rtcout2.TRACE, "TRACE string 3");
+ rtcout2.println(rtcout2.DEBUG, "DEBUG string 3");
+ rtcout2.println(rtcout2.INFO, "INFO string 3");
+ rtcout2.println(rtcout2.WARN, "WARN string 3");
+ rtcout2.println(rtcout2.ERROR, "ERROR string 3");
+ rtcout2.println(rtcout2.FATAL, "FATAL string 3");
+ rtcout2.println(rtcout2.SILENT, "SILENT string 3");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout3 = new Logbuf("hoge2");
rtcout3.setEnabled();
System.err.println("--- Logbuf(hoge2) set ---");
- rtcout3.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
- rtcout3.println(Logbuf.PARANOID, "PARANOID string 4");
- rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 4");
- rtcout3.println(Logbuf.TRACE, "TRACE string 4");
- rtcout3.println(Logbuf.DEBUG, "DEBUG string 4");
- rtcout3.println(Logbuf.INFO, "INFO string 4");
- rtcout3.println(Logbuf.WARN, "WARN string 4");
- rtcout3.println(Logbuf.ERROR, "ERROR string 4");
- rtcout3.println(Logbuf.FATAL, "FATAL string 4");
- rtcout3.println(Logbuf.SILENT, "SILENT string 4");
+ rtcout3.println(rtcout3.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout3.println(rtcout3.PARANOID, "PARANOID string 4");
+ rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 4");
+ rtcout3.println(rtcout3.TRACE, "TRACE string 4");
+ rtcout3.println(rtcout3.DEBUG, "DEBUG string 4");
+ rtcout3.println(rtcout3.INFO, "INFO string 4");
+ rtcout3.println(rtcout3.WARN, "WARN string 4");
+ rtcout3.println(rtcout3.ERROR, "ERROR string 4");
+ rtcout3.println(rtcout3.FATAL, "FATAL string 4");
+ rtcout3.println(rtcout3.SILENT, "SILENT string 4");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout3.setLevel("PARANOID");
System.err.println("--- Logbuf(hoge2) set ---");
- rtcout3.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout3.println(Logbuf.PARANOID, "PARANOID string 5");
- rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 5");
- rtcout3.println(Logbuf.TRACE, "TRACE string 5");
- rtcout3.println(Logbuf.DEBUG, "DEBUG string 5");
- rtcout3.println(Logbuf.INFO, "INFO string 5");
- rtcout3.println(Logbuf.WARN, "WARN string 5");
- rtcout3.println(Logbuf.ERROR, "ERROR string 5");
- rtcout3.println(Logbuf.FATAL, "FATAL string 5");
- rtcout3.println(Logbuf.SILENT, "SILENT string 5");
+ rtcout3.println(rtcout3.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout3.println(rtcout3.PARANOID, "PARANOID string 5");
+ rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 5");
+ rtcout3.println(rtcout3.TRACE, "TRACE string 5");
+ rtcout3.println(rtcout3.DEBUG, "DEBUG string 5");
+ rtcout3.println(rtcout3.INFO, "INFO string 5");
+ rtcout3.println(rtcout3.WARN, "WARN string 5");
+ rtcout3.println(rtcout3.ERROR, "ERROR string 5");
+ rtcout3.println(rtcout3.FATAL, "FATAL string 5");
+ rtcout3.println(rtcout3.SILENT, "SILENT string 5");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
@@ -1239,30 +1084,30 @@
Logbuf rtcout4 = new Logbuf("hoge3", "Manager");
rtcout4.setEnabled();
System.err.println("--- Logbuf(Manager.hoge3) set ---");
- rtcout4.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
- rtcout4.println(Logbuf.PARANOID, "PARANOID string 6");
- rtcout4.println(Logbuf.VERBOSE, "VERBOSE string 6");
- rtcout4.println(Logbuf.TRACE, "TRACE string 6");
- rtcout4.println(Logbuf.DEBUG, "DEBUG string 6");
- rtcout4.println(Logbuf.INFO, "INFO string 6");
- rtcout4.println(Logbuf.WARN, "WARN string 6");
- rtcout4.println(Logbuf.ERROR, "ERROR string 6");
- rtcout4.println(Logbuf.FATAL, "FATAL string 6");
- rtcout4.println(Logbuf.SILENT, "SILENT string 6");
+ rtcout4.println(rtcout4.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout4.println(rtcout4.PARANOID, "PARANOID string 6");
+ rtcout4.println(rtcout4.VERBOSE, "VERBOSE string 6");
+ rtcout4.println(rtcout4.TRACE, "TRACE string 6");
+ rtcout4.println(rtcout4.DEBUG, "DEBUG string 6");
+ rtcout4.println(rtcout4.INFO, "INFO string 6");
+ rtcout4.println(rtcout4.WARN, "WARN string 6");
+ rtcout4.println(rtcout4.ERROR, "ERROR string 6");
+ rtcout4.println(rtcout4.FATAL, "FATAL string 6");
+ rtcout4.println(rtcout4.SILENT, "SILENT string 6");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout4.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.hoge3) set ---");
- rtcout4.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout4.println(Logbuf.PARANOID, "PARANOID string 7");
- rtcout4.println(Logbuf.VERBOSE, "VERBOSE string 7");
- rtcout4.println(Logbuf.TRACE, "TRACE string 7");
- rtcout4.println(Logbuf.DEBUG, "DEBUG string 7");
- rtcout4.println(Logbuf.INFO, "INFO string 7");
- rtcout4.println(Logbuf.WARN, "WARN string 7");
- rtcout4.println(Logbuf.ERROR, "ERROR string 7");
- rtcout4.println(Logbuf.FATAL, "FATAL string 7");
- rtcout4.println(Logbuf.SILENT, "SILENT string 7");
+ rtcout4.println(rtcout4.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout4.println(rtcout4.PARANOID, "PARANOID string 7");
+ rtcout4.println(rtcout4.VERBOSE, "VERBOSE string 7");
+ rtcout4.println(rtcout4.TRACE, "TRACE string 7");
+ rtcout4.println(rtcout4.DEBUG, "DEBUG string 7");
+ rtcout4.println(rtcout4.INFO, "INFO string 7");
+ rtcout4.println(rtcout4.WARN, "WARN string 7");
+ rtcout4.println(rtcout4.ERROR, "ERROR string 7");
+ rtcout4.println(rtcout4.FATAL, "FATAL string 7");
+ rtcout4.println(rtcout4.SILENT, "SILENT string 7");
// setLevel(PARANOID)以ä¸ã®å
容ããåºåãããã°OK.
rtcout.removeStream(stdout);
@@ -1296,30 +1141,30 @@
Logbuf rtcout = new Logbuf("FileOuttest");
System.err.println("--- Logbuf(FileOuttest) set ---");
- rtcout.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string 10");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string 10");
- rtcout.println(Logbuf.TRACE, "TRACE string 10");
- rtcout.println(Logbuf.DEBUG, "DEBUG string 10");
- rtcout.println(Logbuf.INFO, "INFO string 10");
- rtcout.println(Logbuf.WARN, "WARN string 10");
- rtcout.println(Logbuf.ERROR, "ERROR string 10");
- rtcout.println(Logbuf.FATAL, "FATAL string 10");
- rtcout.println(Logbuf.SILENT, "SILENT string 10");
+ rtcout.println(rtcout.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string 10");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string 10");
+ rtcout.println(rtcout.TRACE, "TRACE string 10");
+ rtcout.println(rtcout.DEBUG, "DEBUG string 10");
+ rtcout.println(rtcout.INFO, "INFO string 10");
+ rtcout.println(rtcout.WARN, "WARN string 10");
+ rtcout.println(rtcout.ERROR, "ERROR string 10");
+ rtcout.println(rtcout.FATAL, "FATAL string 10");
+ rtcout.println(rtcout.SILENT, "SILENT string 10");
// setLevel(INFO)以ä¸ã®å
容ããåºåãããã°OK.
rtcout.setLevel("PARANOID");
System.err.println("--- Logbuf(Manager.FileOuttest) set ---");
- rtcout.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout.println(Logbuf.PARANOID, "PARANOID string 11");
- rtcout.println(Logbuf.VERBOSE, "VERBOSE string 11");
- rtcout.println(Logbuf.TRACE, "TRACE string 11");
- rtcout.println(Logbuf.DEBUG, "DEBUG string 11");
- rtcout.println(Logbuf.INFO, "INFO string 11");
- rtcout.println(Logbuf.WARN, "WARN string 11");
- rtcout.println(Logbuf.ERROR, "ERROR string 11");
- rtcout.println(Logbuf.FATAL, "FATAL string 11");
- rtcout.println(Logbuf.SILENT, "SILENT string 11");
+ rtcout.println(rtcout.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout.println(rtcout.PARANOID, "PARANOID string 11");
+ rtcout.println(rtcout.VERBOSE, "VERBOSE string 11");
+ rtcout.println(rtcout.TRACE, "TRACE string 11");
+ rtcout.println(rtcout.DEBUG, "DEBUG string 11");
+ rtcout.println(rtcout.INFO, "INFO string 11");
+ rtcout.println(rtcout.WARN, "WARN string 11");
+ rtcout.println(rtcout.ERROR, "ERROR string 11");
+ rtcout.println(rtcout.FATAL, "FATAL string 11");
+ rtcout.println(rtcout.SILENT, "SILENT string 11");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
@@ -1342,85 +1187,61 @@
rtcout2.setLevel("INFO");
System.err.println("--- Logbuf(PortBase) set ---");
- rtcout2.println(Logbuf.INFO, "--- setLevel(INFO) Not set ---");
- rtcout2.println(Logbuf.PARANOID, "PARANOID string 20");
- rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 20");
- rtcout2.println(Logbuf.TRACE, "TRACE string 20");
- rtcout2.println(Logbuf.DEBUG, "DEBUG string 20");
- rtcout2.println(Logbuf.INFO, "INFO string 20");
- rtcout2.println(Logbuf.WARN, "WARN string 20");
- rtcout2.println(Logbuf.ERROR, "ERROR string 20");
- rtcout2.println(Logbuf.FATAL, "FATAL string 20");
- rtcout2.println(Logbuf.SILENT, "SILENT string 20");
+ rtcout2.println(rtcout2.INFO, "--- setLevel(INFO) Not set ---");
+ rtcout2.println(rtcout2.PARANOID, "PARANOID string 20");
+ rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 20");
+ rtcout2.println(rtcout2.TRACE, "TRACE string 20");
+ rtcout2.println(rtcout2.DEBUG, "DEBUG string 20");
+ rtcout2.println(rtcout2.INFO, "INFO string 20");
+ rtcout2.println(rtcout2.WARN, "WARN string 20");
+ rtcout2.println(rtcout2.ERROR, "ERROR string 20");
+ rtcout2.println(rtcout2.FATAL, "FATAL string 20");
+ rtcout2.println(rtcout2.SILENT, "SILENT string 20");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
rtcout2.setLevel("PARANOID");
System.err.println("--- Logbuf(PortBase) set ---");
- rtcout2.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout2.println(Logbuf.PARANOID, "PARANOID string 21");
- rtcout2.println(Logbuf.VERBOSE, "VERBOSE string 21");
- rtcout2.println(Logbuf.TRACE, "TRACE string 21");
- rtcout2.println(Logbuf.DEBUG, "DEBUG string 21");
- rtcout2.println(Logbuf.INFO, "INFO string 21");
- rtcout2.println(Logbuf.WARN, "WARN string 21");
- rtcout2.println(Logbuf.ERROR, "ERROR string 21");
- rtcout2.println(Logbuf.FATAL, "FATAL string 21");
- rtcout2.println(Logbuf.SILENT, "SILENT string 21");
+ rtcout2.println(rtcout2.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout2.println(rtcout2.PARANOID, "PARANOID string 21");
+ rtcout2.println(rtcout2.VERBOSE, "VERBOSE string 21");
+ rtcout2.println(rtcout2.TRACE, "TRACE string 21");
+ rtcout2.println(rtcout2.DEBUG, "DEBUG string 21");
+ rtcout2.println(rtcout2.INFO, "INFO string 21");
+ rtcout2.println(rtcout2.WARN, "WARN string 21");
+ rtcout2.println(rtcout2.ERROR, "ERROR string 21");
+ rtcout2.println(rtcout2.FATAL, "FATAL string 21");
+ rtcout2.println(rtcout2.SILENT, "SILENT string 21");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
Logbuf rtcout3 = new Logbuf("PublisherFlush", "PortBase");
System.err.println("--- Logbuf(PortBase.PublisherFlush) set ---");
- rtcout3.println(Logbuf.PARANOID, "PARANOID string 22");
- rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 22");
- rtcout3.println(Logbuf.TRACE, "TRACE string 22");
- rtcout3.println(Logbuf.DEBUG, "DEBUG string 22");
- rtcout3.println(Logbuf.INFO, "INFO string 22");
- rtcout3.println(Logbuf.WARN, "WARN string 22");
- rtcout3.println(Logbuf.ERROR, "ERROR string 22");
- rtcout3.println(Logbuf.FATAL, "FATAL string 22");
- rtcout3.println(Logbuf.SILENT, "SILENT string 22");
+ rtcout3.println(rtcout3.PARANOID, "PARANOID string 22");
+ rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 22");
+ rtcout3.println(rtcout3.TRACE, "TRACE string 22");
+ rtcout3.println(rtcout3.DEBUG, "DEBUG string 22");
+ rtcout3.println(rtcout3.INFO, "INFO string 22");
+ rtcout3.println(rtcout3.WARN, "WARN string 22");
+ rtcout3.println(rtcout3.ERROR, "ERROR string 22");
+ rtcout3.println(rtcout3.FATAL, "FATAL string 22");
+ rtcout3.println(rtcout3.SILENT, "SILENT string 22");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
rtcout3.setLevel("PARANOID");
System.err.println("--- Logbuf(PortBase.PublisherFlush) set ---");
- rtcout3.println(Logbuf.INFO, "--- setLevel(PARANOID) set ---");
- rtcout3.println(Logbuf.PARANOID, "PARANOID string 23");
- rtcout3.println(Logbuf.VERBOSE, "VERBOSE string 23");
- rtcout3.println(Logbuf.TRACE, "TRACE string 23");
- rtcout3.println(Logbuf.DEBUG, "DEBUG string 23");
- rtcout3.println(Logbuf.INFO, "INFO string 23");
- rtcout3.println(Logbuf.WARN, "WARN string 23");
- rtcout3.println(Logbuf.ERROR, "ERROR string 23");
- rtcout3.println(Logbuf.FATAL, "FATAL string 23");
- rtcout3.println(Logbuf.SILENT, "SILENT string 23");
+ rtcout3.println(rtcout3.INFO, "--- setLevel(PARANOID) set ---");
+ rtcout3.println(rtcout3.PARANOID, "PARANOID string 23");
+ rtcout3.println(rtcout3.VERBOSE, "VERBOSE string 23");
+ rtcout3.println(rtcout3.TRACE, "TRACE string 23");
+ rtcout3.println(rtcout3.DEBUG, "DEBUG string 23");
+ rtcout3.println(rtcout3.INFO, "INFO string 23");
+ rtcout3.println(rtcout3.WARN, "WARN string 23");
+ rtcout3.println(rtcout3.ERROR, "ERROR string 23");
+ rtcout3.println(rtcout3.FATAL, "FATAL string 23");
+ rtcout3.println(rtcout3.SILENT, "SILENT string 23");
// setLevel()以ä¸ã®å
容ããåºåãããã°OK.
System.err.println("--- test_manager_logbuf2() end ---");
}
- private class LocalHandler extends Handler {
- StringBuilder builder = new StringBuilder();
-
- @Override
- public void close() throws SecurityException {
- }
-
- @Override
- public void flush() {
- }
-
- @Override
- public void publish(LogRecord record) {
- builder.append(record.getMessage()).append(System.getProperty("line.separator"));
- }
-
- public String getStr() {
- return builder.toString();
- }
-
- public void clear() {
- builder = new StringBuilder();
- }
- }
}
Deleted: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/AdjustedClockTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,44 +0,0 @@
-package jp.go.aist.rtm.RTC.util;
-
-import jp.go.aist.rtm.RTC.util.clock.AdjustedClock;
-import junit.framework.TestCase;
-
-/**
-* AdjustedClockã¯ã©ã¹ããã¹ã
-* 対象ã¯ã©ã¹ï¼AdjustedClock
-*
-*/
-public class AdjustedClockTest extends TestCase {
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * æéãªãã»ããã®ãã¹ã
- * setTime()ã§è¨å®ããããªãã»ãããæå¹ã¨ãªã£ã¦ããã確èªãã
- */
- public void test_offset() {
- AdjustedClock clock = new AdjustedClock();
- long msec = System.currentTimeMillis();
- long sec = msec/1000;
- long usec = (msec - sec*1000)*1000;
- TimeValue time = new TimeValue(sec-30, usec);
- clock.setTime(time);
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- //
- long msec2 = System.currentTimeMillis();
- long sec2 = msec2/1000;
- long usec2 = (msec2 - sec2*1000)*1000;
- assertEquals(sec2-30, clock.getTime().getSec());
-// assertEquals(usec2, clock.getTime().getUsec());
- }
-
-}
Modified: branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java
===================================================================
--- branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java 2015-10-28 09:27:41 UTC (rev 737)
+++ branches/RELENG_1_1/jp.go.aist.rtm.RTC/tests/src/jp/go/aist/rtm/RTC/util/TimeValueTest.java 2015-10-29 06:09:55 UTC (rev 738)
@@ -1,8 +1,5 @@
package jp.go.aist.rtm.RTC.util;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
import jp.go.aist.rtm.RTC.util.TimeValue;
import junit.framework.TestCase;
@@ -279,25 +276,4 @@
res = tm1.toDouble();
assertEquals(Double.valueOf(1.000001), Double.valueOf(res));
}
- /**
- * <p>ç¾å¨æå»ã®å¤æããã§ãã¯
- * <ul>
- * <li>ç¾å¨æå»ã®å¤æãæ£å¸¸ã«è¡ãããï¼</li>
- * </ul>
- */
- public void test_date() {
- Date date = new Date();
- long msec = System.currentTimeMillis();
- long sec = msec/1000;
- long usec = (msec - sec*1000)*1000;
- TimeValue base = new TimeValue(sec, usec);
- double curr = base.toDouble();
- assertEquals(sec, (long)curr);
-
- Date convdate = new Date((long)(curr*1000));
- SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSSSS");
- String strCurrent = sdf1.format(date);
- String strConv = sdf1.format(convdate);
- assertTrue(strCurrent.equals(strConv));
- }
}
More information about the openrtm-commit
mailing list