diff --git a/scenarios/CMakeLists.txt b/scenarios/CMakeLists.txt index 80acd6c86f7b5badbe08ddedcf909e44e33f9909..c232f087b6be52dd91b71f6ae3d072ebb9b8530d 100644 --- a/scenarios/CMakeLists.txt +++ b/scenarios/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(WeissHapticSensorsUnitTest) -add_subdirectory(DummyTest) \ No newline at end of file diff --git a/scenarios/DummyTest/CMakeLists.txt b/scenarios/DummyTest/CMakeLists.txt deleted file mode 100644 index 4cee04548d1b8d77f51dfb70ae811e866bfcd781..0000000000000000000000000000000000000000 --- a/scenarios/DummyTest/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(SCENARIO_COMPONENTS - DummyUnitApp - DummyUnitObserver - ) - -# optional 3rd parameter: "path/to/global/config.cfg" -armarx_scenario("DummyUnitTest" "${SCENARIO_COMPONENTS}") diff --git a/scenarios/DummyTest/config/DummyUnitApp.cfg b/scenarios/DummyTest/config/DummyUnitApp.cfg deleted file mode 100644 index e0b8b5606d5015130fc1249a2b863cbdc07269cd..0000000000000000000000000000000000000000 --- a/scenarios/DummyTest/config/DummyUnitApp.cfg +++ /dev/null @@ -1,83 +0,0 @@ -# ================================================================== -# ArmarX properties -# ================================================================== - -# ArmarX.DataPath: Semicolon-separated search list for data files -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.DataPath = "" - - -# ArmarX.Verbosity: Global logging level for whole application -# Attributes: -# - Default: Verbose -# - Case sensitivity: no -# - Required: no -# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} -# ArmarX.Verbosity = Verbose - - -# ArmarX.DisableLogging: Turn logging off in whole application -# Attributes: -# - Default: 0 -# - Case sensitivity: no -# - Required: no -# - Possible values: {0, 1, false, no, true, yes} -# ArmarX.DisableLogging = 0 - - -# ArmarX.CachePath: Path for cache files -# Attributes: -# - Default: ${HOME}/.armarx/mongo/.cache -# - Case sensitivity: no -# - Required: no -# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache - - -# ArmarX.ApplicationName: Application name -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.ApplicationName = "" - - -# ArmarX.Config: Comma-separated list of configuration files -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.Config = "" - - -# ================================================================== -# ArmarX.DummyUnit properties -# ================================================================== - -# ArmarX.DummyUnit.ReportPeriod: The unit's reporting period in ms -# Attributes: -# - Case sensitivity: no -# - Required: yes -ArmarX.DummyUnit.ReportPeriod = 1000 - - -# ArmarX.DummyUnit.MinimumLoggingLevel: Local logging level only for this component -# Attributes: -# - Default: Undefined -# - Case sensitivity: no -# - Required: no -# - Possible values: {Error, Fatal, Info, Undefined, Verbose, Warning} -# ArmarX.DummyUnit.MinimumLoggingLevel = Undefined - - -# ArmarX.DummyUnit.ObjectName: Name of IceGrid well-known object -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.DummyUnit.ObjectName = "" - - - diff --git a/scenarios/DummyTest/config/DummyUnitObserver.cfg b/scenarios/DummyTest/config/DummyUnitObserver.cfg deleted file mode 100644 index 5994f9f5efb45b0c65fca75687e0f99d23404d7f..0000000000000000000000000000000000000000 --- a/scenarios/DummyTest/config/DummyUnitObserver.cfg +++ /dev/null @@ -1,83 +0,0 @@ -# ================================================================== -# ArmarX properties -# ================================================================== - -# ArmarX.DataPath: Semicolon-separated search list for data files -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.DataPath = "" - - -# ArmarX.Verbosity: Global logging level for whole application -# Attributes: -# - Default: Verbose -# - Case sensitivity: no -# - Required: no -# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} -# ArmarX.Verbosity = Verbose - - -# ArmarX.DisableLogging: Turn logging off in whole application -# Attributes: -# - Default: 0 -# - Case sensitivity: no -# - Required: no -# - Possible values: {0, 1, false, no, true, yes} -# ArmarX.DisableLogging = 0 - - -# ArmarX.CachePath: Path for cache files -# Attributes: -# - Default: ${HOME}/.armarx/mongo/.cache -# - Case sensitivity: no -# - Required: no -# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache - - -# ArmarX.ApplicationName: Application name -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.ApplicationName = "" - - -# ArmarX.Config: Comma-separated list of configuration files -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.Config = "" - - -# ================================================================== -# ArmarX.DummyUnitObserver properties -# ================================================================== - -# ArmarX.DummyUnitObserver.ReportPeriod: The unit's reporting period in ms -# Attributes: -# - Case sensitivity: no -# - Required: yes -ArmarX.DummyUnitObserver.ReportPeriod = <set value!> - - -# ArmarX.DummyUnitObserver.MinimumLoggingLevel: Local logging level only for this component -# Attributes: -# - Default: Undefined -# - Case sensitivity: no -# - Required: no -# - Possible values: {Error, Fatal, Info, Undefined, Verbose, Warning} -# ArmarX.DummyUnitObserver.MinimumLoggingLevel = Undefined - - -# ArmarX.DummyUnitObserver.ObjectName: Name of IceGrid well-known object -# Attributes: -# - Default: "" -# - Case sensitivity: no -# - Required: no -# ArmarX.DummyUnitObserver.ObjectName = "" - - - diff --git a/source/RobotAPI/applications/CMakeLists.txt b/source/RobotAPI/applications/CMakeLists.txt index 9c5c39bca3a4918451d5b3194d34df9dfb0a5a6f..22b602a95a1b56abc243668df62037f66548a89d 100644 --- a/source/RobotAPI/applications/CMakeLists.txt +++ b/source/RobotAPI/applications/CMakeLists.txt @@ -21,6 +21,4 @@ add_subdirectory(PlatformUnitObserver) add_subdirectory(RobotStateComponent) add_subdirectory(RobotStateObserver) add_subdirectory(HandUnitObserver) -add_subdirectory(DummyUnit) -add_subdirectory(DummyUnitObserver) diff --git a/source/RobotAPI/applications/DummyUnit/CMakeLists.txt b/source/RobotAPI/applications/DummyUnit/CMakeLists.txt deleted file mode 100644 index 1951cd058c6c9ba00fd8580b0a2147818186e621..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnit/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -armarx_component_set_name("DummyUnitApp") - -set(COMPONENT_LIBS RobotAPIInterfaces RobotAPIUnits ArmarXCore) -set(EXE_SOURCE main.cpp DummyUnitApp.h) - -armarx_add_component_executable("${EXE_SOURCE}") diff --git a/source/RobotAPI/applications/DummyUnit/DummyUnitApp.h b/source/RobotAPI/applications/DummyUnit/DummyUnitApp.h deleted file mode 100644 index cfd6861b99233a61b97091dea5db7517aaa06bf1..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnit/DummyUnitApp.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::application::DummyUnit - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#ifndef _ARMARX_APPLICATION_RobotAPI_DummyUnit_H -#define _ARMARX_APPLICATION_RobotAPI_DummyUnit_H - -#include <Core/core/application/Application.h> -#include <RobotAPI/units/DummyUnit.h> - -namespace armarx -{ - class DummyUnitApp : - virtual public armarx::Application - { - void setup(const ManagedIceObjectRegistryInterfacePtr& registry, Ice::PropertiesPtr properties) - { - registry->addObject(Component::create<DummyUnit>(properties)); - } - }; -} - -#endif diff --git a/source/RobotAPI/applications/DummyUnit/main.cpp b/source/RobotAPI/applications/DummyUnit/main.cpp deleted file mode 100644 index 56c78e7f2a620e5223afc0e507833d2c54b03e7e..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnit/main.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::application::DummyUnitApp - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#include "DummyUnitApp.h" - -int main(int argc, char* argv[]) -{ - armarx::ApplicationPtr app = armarx::Application::createInstance <armarx::DummyUnitApp>(); - app->setName("DummyUnit"); - - return app->main(argc, argv); -} diff --git a/source/RobotAPI/applications/DummyUnitObserver/CMakeLists.txt b/source/RobotAPI/applications/DummyUnitObserver/CMakeLists.txt deleted file mode 100644 index 5ecfd42e2d9fa7466107b099bf4cc5c444ff3969..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnitObserver/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ - -armarx_component_set_name(DummyUnitObserver) - -set(COMPONENT_LIBS RobotAPIUnits RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers) - -set(SOURCES main.cpp DummyUnitObserverApp.h) - -armarx_add_component_executable("${SOURCES}") diff --git a/source/RobotAPI/applications/DummyUnitObserver/DummyUnitObserverApp.h b/source/RobotAPI/applications/DummyUnitObserver/DummyUnitObserverApp.h deleted file mode 100644 index 27d9c4cd944db121e1fe375c2633cb7953c37f01..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnitObserver/DummyUnitObserverApp.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::application::DummyUnit - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#include <Core/core/application/Application.h> -#include <RobotAPI/units/DummyUnitObserver.h> - -namespace armarx -{ - class DummyUnitObserverApp : - virtual public armarx::Application - { - void setup(const ManagedIceObjectRegistryInterfacePtr& registry, Ice::PropertiesPtr properties) - { - registry->addObject( Component::create<DummyUnitObserver>(properties) ); - } - }; -} - - - diff --git a/source/RobotAPI/applications/DummyUnitObserver/main.cpp b/source/RobotAPI/applications/DummyUnitObserver/main.cpp deleted file mode 100644 index f33f71dbf87c88b7cf6de5db1e8646854615da74..0000000000000000000000000000000000000000 --- a/source/RobotAPI/applications/DummyUnitObserver/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::application::DummyUnit - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#include "DummyUnitObserverApp.h" -#include <Core/core/logging/Logging.h> - -int main(int argc, char* argv[]) -{ - armarx::ApplicationPtr app = armarx::Application::createInstance<armarx::DummyUnitObserverApp>(); - app->setName("DummyUnitObserver"); - - return app->main(argc, argv); -} diff --git a/source/RobotAPI/interface/CMakeLists.txt b/source/RobotAPI/interface/CMakeLists.txt index 1b25210e2c9398480c56054ef1369e99c74906bf..4fa3f1ba89d44f53b52ddfceee7786afec483ca9 100644 --- a/source/RobotAPI/interface/CMakeLists.txt +++ b/source/RobotAPI/interface/CMakeLists.txt @@ -9,7 +9,6 @@ set(SLICE_FILES observers/KinematicUnitObserverInterface.ice observers/PlatformUnitObserverInterface.ice - observers/DummyUnitObserverInterface.ice robotstate/LinkedPoseBase.ice robotstate/PoseBase.ice @@ -27,7 +26,6 @@ set(SLICE_FILES units/TCPControlUnit.ice units/TCPMoverUnitInterface.ice units/UnitInterface.ice - units/DummyUnitInterface.ice ) # generate the interface library diff --git a/source/RobotAPI/interface/observers/DummyUnitObserverInterface.ice b/source/RobotAPI/interface/observers/DummyUnitObserverInterface.ice deleted file mode 100644 index 8ee86c6ff6f005d7f668b6dde1542073524012e4..0000000000000000000000000000000000000000 --- a/source/RobotAPI/interface/observers/DummyUnitObserverInterface.ice +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::units - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#ifndef _ARMARX_CORE_DUMMY_UNIT_OBSERVER_SLICE_ -#define _ARMARX_CORE_DUMMY_UNIT_OBSERVER_SLICE_ - -#include <RobotAPI/interface/units/DummyUnitInterface.ice> -#include <Core/interface/observers/ObserverInterface.ice> - -module armarx -{ - interface DummyUnitObserverInterface extends ObserverInterface, DummyUnitListener - { - }; -}; - -#endif diff --git a/source/RobotAPI/interface/units/DummyUnitInterface.ice b/source/RobotAPI/interface/units/DummyUnitInterface.ice deleted file mode 100644 index 8e970cbb9d3c0d7e03fe603aea8cecd4c52accb0..0000000000000000000000000000000000000000 --- a/source/RobotAPI/interface/units/DummyUnitInterface.ice +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package ArmarX::RobotAPI - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @copyright 2014 - * @license http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#ifndef _ARMARX_CORE_DUMMYUNIT_SLICE_ -#define _ARMARX_CORE_DUMMYUNIT_SLICE_ - -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <Core/interface/observers/VariantBase.ice> -#include <Core/interface/observers/ObserverInterface.ice> - -/* - * The DummyUnit is a SensorActorUnit that is only implemented for documentation - * purposes. It is designed to be a minimum working example and has no real use. - */ -module armarx -{ - interface DummyUnitInterface extends SensorActorUnitInterface - { - void setPeriodicValue(VariantBase value); - }; - - interface DummyUnitListener - { - void reportPeriodicValue(VariantBase value); - }; -}; - -#endif diff --git a/source/RobotAPI/units/CMakeLists.txt b/source/RobotAPI/units/CMakeLists.txt index 5aaba769d858950b05b961ab30dd2bb1b1ee19ba..0164bfeccee201feabbaae3a2da9ef9e4ddb8ec7 100644 --- a/source/RobotAPI/units/CMakeLists.txt +++ b/source/RobotAPI/units/CMakeLists.txt @@ -47,8 +47,6 @@ set(LIB_HEADERS KinematicUnitObserver.h PlatformUnitObserver.h SensorActorUnit.h - DummyUnit.h - DummyUnitObserver.h ) set(LIB_FILES @@ -71,8 +69,6 @@ set(LIB_FILES KinematicUnitObserver.cpp PlatformUnitObserver.cpp SensorActorUnit.cpp - DummyUnit.cpp - DummyUnitObserver.cpp ) armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") diff --git a/source/RobotAPI/units/DummyUnit.cpp b/source/RobotAPI/units/DummyUnit.cpp deleted file mode 100644 index ff8abbfd431aaee7e1a17b0f24dc5247c109a16d..0000000000000000000000000000000000000000 --- a/source/RobotAPI/units/DummyUnit.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::units - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#include "DummyUnit.h" - -using namespace armarx; - -void DummyUnit::onInitComponent() -{ - period = getProperty<int>("ReportPeriod").getValue(); - - periodicValue = VariantPtr(new Variant(10)); - - offeringTopic("PeriodicDummyValue"); -} - -void DummyUnit::onConnectComponent() -{ - listenerPrx = getTopic<DummyUnitListenerPrx>("PeriodicDummyValue"); - - if(periodicTask) - { - periodicTask->stop(); - } - periodicTask = new PeriodicTask<DummyUnit>(this, &DummyUnit::reportValue, period, false, "DummyValueProducer"); - periodicTask->start(); -} - -void DummyUnit::onExitComponent() -{ -} - -void DummyUnit::setPeriodicValue(const VariantBasePtr &value, const Ice::Current &c) -{ - periodicValue = VariantPtr::dynamicCast(value); -} - -PropertyDefinitionsPtr DummyUnit::createPropertyDefinitions() -{ - return PropertyDefinitionsPtr(new DummyUnitPropertyDefinitions(getConfigIdentifier())); -} - -void DummyUnit::reportValue() -{ - listenerPrx->reportPeriodicValue(periodicValue); -} diff --git a/source/RobotAPI/units/DummyUnit.h b/source/RobotAPI/units/DummyUnit.h deleted file mode 100644 index 2167a64d909d2190fd49ff1a663cbf39719b50fe..0000000000000000000000000000000000000000 --- a/source/RobotAPI/units/DummyUnit.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::units - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#ifndef _ARMARX_COMPONENT_DUMMY_UNIT_H -#define _ARMARX_COMPONENT_DUMMY_UNIT_H - -#include <RobotAPI/units/SensorActorUnit.h> - -#include <Core/core/Component.h> -#include <Core/core/application/properties/Properties.h> -#include <Core/core/system/ImportExportComponent.h> -#include <Core/observers/variant/Variant.h> -#include <Core/core/services/tasks/PeriodicTask.h> - -#include <RobotAPI/interface/units/DummyUnitInterface.h> - -namespace armarx -{ - class DummyUnitPropertyDefinitions: - public ComponentPropertyDefinitions - { - public: - DummyUnitPropertyDefinitions(std::string prefix): - ComponentPropertyDefinitions(prefix) - { - defineRequiredProperty<int>("ReportPeriod","The unit's reporting period in ms"); - } - }; - - class DummyUnit : - virtual public DummyUnitInterface, - virtual public SensorActorUnit - { - public: - virtual std::string getDefaultName() const { return "DummyUnit"; } - - virtual void onInitComponent(); - virtual void onConnectComponent(); - virtual void onExitComponent(); - - virtual void setPeriodicValue(const VariantBasePtr &value, const Ice::Current& c = ::Ice::Current()); - - virtual PropertyDefinitionsPtr createPropertyDefinitions(); - - protected: - void reportValue(); - - DummyUnitListenerPrx listenerPrx; - - PeriodicTask<DummyUnit>::pointer_type periodicTask; - - int period; - VariantPtr periodicValue; - }; -} - -#endif - diff --git a/source/RobotAPI/units/DummyUnitObserver.cpp b/source/RobotAPI/units/DummyUnitObserver.cpp deleted file mode 100644 index 33670369632fab3365fe7ccd667503024466d58d..0000000000000000000000000000000000000000 --- a/source/RobotAPI/units/DummyUnitObserver.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::units - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#include "DummyUnitObserver.h" - -armarx::DummyUnitObserver::DummyUnitObserver() -{ -} - -void armarx::DummyUnitObserver::onInitObserver() -{ - usingTopic("PeriodicDummyValue"); -} - -void armarx::DummyUnitObserver::onConnectObserver() -{ -} - -void armarx::DummyUnitObserver::reportPeriodicValue(const armarx::VariantBasePtr &value, const Ice::Current &) -{ - ARMARX_INFO << VariantPtr::dynamicCast(value); -} - -armarx::PropertyDefinitionsPtr armarx::DummyUnitObserver::createPropertyDefinitions() -{ - return armarx::PropertyDefinitionsPtr(new DummyUnitPropertyDefinitions(getConfigIdentifier())); -} diff --git a/source/RobotAPI/units/DummyUnitObserver.h b/source/RobotAPI/units/DummyUnitObserver.h deleted file mode 100644 index ca0f1f1f0962fe309a778dd80c742819de3f798c..0000000000000000000000000000000000000000 --- a/source/RobotAPI/units/DummyUnitObserver.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of ArmarX. - * - * ArmarX is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * ArmarX is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * @package RobotAPI::units - * @author Peter Kaiser (peter dot kaiser at kit dot edu) - * @date 2014 - * @copyright http://www.gnu.org/licenses/gpl.txt - * GNU General Public License - */ - -#ifndef _ARMARX_ROBOTAPI_DUMMYUNIT_OBSERVER_H -#define _ARMARX_ROBOTAPI_DUMMYUNIT_OBSERVER_H - -#include <RobotAPI/interface/observers/DummyUnitObserverInterface.h> -#include <Core/observers/Observer.h> -#include <Core/core/application/properties/Properties.h> - -namespace armarx -{ - class DummyUnitPropertyDefinitions : public ComponentPropertyDefinitions - { - public: - DummyUnitPropertyDefinitions(std::string prefix) : - ComponentPropertyDefinitions(prefix) - { - // No required properties - } - }; - - class DummyUnitObserver : - virtual public Observer, - virtual public DummyUnitObserverInterface - { - public: - DummyUnitObserver(); - - virtual std::string getDefaultName() const { return "DummyUnitObserver"; } - void onInitObserver(); - void onConnectObserver(); - - void reportPeriodicValue(const VariantBasePtr &value, const ::Ice::Current& = ::Ice::Current()); - - virtual PropertyDefinitionsPtr createPropertyDefinitions(); - }; -} - -#endif -