Skip to content
Snippets Groups Projects
Commit aea6140b authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Run astyle

parent e2d75190
No related branches found
No related tags found
No related merge requests found
/*
* 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";
......
/*
* 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();
......
......@@ -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;
......
#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;
......
......@@ -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);
}
......
......@@ -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>
......
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment