From aea6140b1cfad6e2e426c486912f7bf8a7c5db3e Mon Sep 17 00:00:00 2001 From: Raphael Grimm <raphael.grimm@kit.edu> Date: Thu, 6 Dec 2018 23:38:29 +0100 Subject: [PATCH] Run astyle --- .../RobotAPI/components/units/SpeechObserver.cpp | 4 ++-- .../RobotAPI/components/units/SpeechObserver.h | 6 +++--- .../BLEProthesisInterfaceQtWorker.h | 14 +++++++------- .../BLEProthesisInterfaceQtWorkerThread.cpp | 6 +++--- .../libraries/ArmarXEtherCAT/DeviceContainer.h | 4 ++-- .../ArmarXEtherCAT/VirtualDeviceFactory.h | 2 +- .../ForceTorqueUtility/DetectForceSpike.cpp | 16 ++++++++-------- .../SpeechObserverTestGroup/TestTextToSpeech.cpp | 6 +++--- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/source/RobotAPI/components/units/SpeechObserver.cpp b/source/RobotAPI/components/units/SpeechObserver.cpp index 15b2766b4..2f5d7f502 100644 --- a/source/RobotAPI/components/units/SpeechObserver.cpp +++ b/source/RobotAPI/components/units/SpeechObserver.cpp @@ -1,6 +1,6 @@ /* * This file is part of ArmarX. - * + * * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), * Karlsruhe Institute of Technology (KIT), all rights reserved. * @@ -47,7 +47,7 @@ void SpeechObserver::onConnectObserver() std::string SpeechObserver::SpeechStateToString(TextToSpeechStateType state) { - switch(state) + switch (state) { case eIdle: return "Idle"; diff --git a/source/RobotAPI/components/units/SpeechObserver.h b/source/RobotAPI/components/units/SpeechObserver.h index 769677e27..de6495365 100644 --- a/source/RobotAPI/components/units/SpeechObserver.h +++ b/source/RobotAPI/components/units/SpeechObserver.h @@ -1,6 +1,6 @@ /* * This file is part of ArmarX. - * + * * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), * Karlsruhe Institute of Technology (KIT), all rights reserved. * @@ -41,8 +41,8 @@ namespace armarx }; class SpeechObserver : - virtual public Observer, - virtual public SpeechObserverInterface + virtual public Observer, + virtual public SpeechObserverInterface { public: SpeechObserver(); diff --git a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorker.h b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorker.h index 322ab5a3f..f4b84d716 100644 --- a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorker.h +++ b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorker.h @@ -25,27 +25,27 @@ public: private: void cleanup(); protected: - void timerEvent(QTimerEvent *event) override; + void timerEvent(QTimerEvent* event) override; signals: - void resultReady(const QString &s); + void resultReady(const QString& s); private slots: //dev discover - void deviceDiscovered(const QBluetoothDeviceInfo &device); + void deviceDiscovered(const QBluetoothDeviceInfo& device); void deviceDiscoverFinished(); void deviceDiscoverError(QBluetoothDeviceDiscoveryAgent::Error); void deviceConnected(); void deviceDisconnected(); //service discovery - void serviceDiscovered(const QBluetoothUuid &gatt); + void serviceDiscovered(const QBluetoothUuid& gatt); void serviceDiscoverFinished(); void controllerError(QLowEnergyController::Error error); //communication - void receiveDeviceDisconnec(const QLowEnergyDescriptor &d, const QByteArray &value); + void receiveDeviceDisconnec(const QLowEnergyDescriptor& d, const QByteArray& value); void serviceStateChanged(QLowEnergyService::ServiceState s); - void readData(const QLowEnergyCharacteristic &c,const QByteArray &value); + void readData(const QLowEnergyCharacteristic& c, const QByteArray& value); private: -// friend class BLEProthesisInterface; + // friend class BLEProthesisInterface; BLEProthesisInterface* _owner; QString _mac; diff --git a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorkerThread.cpp b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorkerThread.cpp index 5f665d077..479693f30 100644 --- a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorkerThread.cpp +++ b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterfaceQtWorkerThread.cpp @@ -1,7 +1,7 @@ #include "BLEProthesisInterfaceQtWorkerThread.h" -BLEProthesisInterfaceQtWorkerThread::BLEProthesisInterfaceQtWorkerThread(const std::string &mac, BLEProthesisInterface &owner) : +BLEProthesisInterfaceQtWorkerThread::BLEProthesisInterfaceQtWorkerThread(const std::string& mac, BLEProthesisInterface& owner) : _owner{&owner}, _mac{QString::fromStdString(mac)} {} @@ -14,7 +14,7 @@ void BLEProthesisInterfaceQtWorkerThread::kill() _worker->kill(); } -void BLEProthesisInterfaceQtWorkerThread::sendCommand(const std::string &cmd) +void BLEProthesisInterfaceQtWorkerThread::sendCommand(const std::string& cmd) { _worker->sendCommand(cmd); } @@ -24,7 +24,7 @@ void BLEProthesisInterfaceQtWorkerThread::run() _worker = new BLEProthesisInterfaceQtWorker{_mac, *_owner}; qDebug() << '[' << _mac << ']' << " Starting qt event loop."; int r = exec(); - if(_worker) + if (_worker) { _worker->kill(); delete _worker; diff --git a/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h b/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h index dad5a4d22..2ae55ba25 100644 --- a/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h +++ b/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h @@ -34,7 +34,7 @@ namespace armarx class DeviceContainer { public: - size_t load(const MultiNodeRapidXMLReader &rootNodeConfigs, const VirtualRobot::RobotPtr& robot); + size_t load(const MultiNodeRapidXMLReader& rootNodeConfigs, const VirtualRobot::RobotPtr& robot); template <typename Type> std::vector<std::shared_ptr<Type>> getDevicesOfType() const { @@ -42,7 +42,7 @@ namespace armarx for (auto& dev : devices) { auto castedDev = std::dynamic_pointer_cast<Type>(dev); - if(castedDev) + if (castedDev) { results.push_back(castedDev); } diff --git a/source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h b/source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h index 75557cf93..72b7738fa 100644 --- a/source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h +++ b/source/RobotAPI/libraries/ArmarXEtherCAT/VirtualDeviceFactory.h @@ -36,7 +36,7 @@ namespace armarx { using AbstractFunctionalDevicePtr = std::shared_ptr<class AbstractFunctionalDevice>; - using VirtualDeviceFactoryArgs = std::tuple<RapidXmlReaderNode, armarx::DefaultRapidXmlReaderNode , VirtualRobot::RobotPtr>; + using VirtualDeviceFactoryArgs = std::tuple<RapidXmlReaderNode, armarx::DefaultRapidXmlReaderNode, VirtualRobot::RobotPtr>; class VirtualDeviceFactory : public AbstractFactoryMethod<VirtualDeviceFactory, VirtualDeviceFactoryArgs, AbstractFunctionalDevicePtr> diff --git a/source/RobotAPI/statecharts/ForceTorqueUtility/DetectForceSpike.cpp b/source/RobotAPI/statecharts/ForceTorqueUtility/DetectForceSpike.cpp index 4061852d7..6be767cbd 100644 --- a/source/RobotAPI/statecharts/ForceTorqueUtility/DetectForceSpike.cpp +++ b/source/RobotAPI/statecharts/ForceTorqueUtility/DetectForceSpike.cpp @@ -53,7 +53,7 @@ void DetectForceSpike::run() in.getTriggerInAxisDirection(); in.getTriggerCounterAxisDirection(); - std::deque<float> spikes(in.getWindowSizeMs()/10, getForceAlongAxis()); + std::deque<float> spikes(in.getWindowSizeMs() / 10, getForceAlongAxis()); while (!isRunningTaskStopped()) // stop run function if returning true { @@ -68,15 +68,15 @@ void DetectForceSpike::run() bool f2rDetected = false; bool r2fDetected = false; - for(const float spike : spikes) + for (const float spike : spikes) { - if(low) + if (low) { - if(spike < refValue) + if (spike < refValue) { refValue = spike; } - else if(spike > refValue + forceThreshold) + else if (spike > refValue + forceThreshold) { low = false; risingEdgeDetected = true; @@ -84,13 +84,13 @@ void DetectForceSpike::run() } } - if(!low) + if (!low) { - if(spike > refValue) + if (spike > refValue) { refValue = spike; } - else if(spike < refValue - forceThreshold) + else if (spike < refValue - forceThreshold) { low = true; fallingEdgeDetected = true; diff --git a/source/RobotAPI/statecharts/SpeechObserverTestGroup/TestTextToSpeech.cpp b/source/RobotAPI/statecharts/SpeechObserverTestGroup/TestTextToSpeech.cpp index 56dcb329b..ab3e967a6 100644 --- a/source/RobotAPI/statecharts/SpeechObserverTestGroup/TestTextToSpeech.cpp +++ b/source/RobotAPI/statecharts/SpeechObserverTestGroup/TestTextToSpeech.cpp @@ -42,9 +42,9 @@ void TestTextToSpeech::onEnter() void TestTextToSpeech::waitForSpeechFinished() { TimeUtil::SleepMS(20); - while(true) + while (true) { - if(getSpeechObserver()->getDatafieldByName("TextToSpeech", "State")->getString() == "FinishedSpeaking") + if (getSpeechObserver()->getDatafieldByName("TextToSpeech", "State")->getString() == "FinishedSpeaking") { break; } @@ -60,7 +60,7 @@ void TestTextToSpeech::run() getTextToSpeech()->reportText("Goodbye!"); -// uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load. + // uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load. while (!isRunningTaskStopped()) // stop run function if returning true { // do your calculations -- GitLab