mirror of
https://github.com/eclipse/upm.git
synced 2025-07-26 21:51:16 +03:00
Added interface iRotaryAngle
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
75c7bd8d12
commit
8693a72ed6
@ -53,4 +53,6 @@ int RotaryEncoder::position()
|
||||
return rotaryencoder_get_position(m_rotaryencoder);
|
||||
}
|
||||
|
||||
|
||||
float RotaryEncoder::getValue() {
|
||||
return (float) RotaryEncoder::position();
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "rotaryencoder.h"
|
||||
#include <interfaces/iRotaryAngle.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
@ -60,7 +61,7 @@ namespace upm {
|
||||
* @snippet rotaryencoder.cxx Interesting
|
||||
*/
|
||||
|
||||
class RotaryEncoder {
|
||||
class RotaryEncoder : virtual public iRotaryAngle {
|
||||
public:
|
||||
/**
|
||||
* RotaryEncoder constructor
|
||||
@ -87,6 +88,13 @@ namespace upm {
|
||||
*/
|
||||
int position();
|
||||
|
||||
/**
|
||||
* Get rotation value from sensor data.
|
||||
*
|
||||
* @return rotation value.
|
||||
*/
|
||||
virtual float getValue();
|
||||
|
||||
private:
|
||||
/* Disable implicit copy and assignment operators */
|
||||
RotaryEncoder(const RotaryEncoder&) = delete;
|
||||
@ -95,5 +103,3 @@ namespace upm {
|
||||
rotaryencoder_context m_rotaryencoder;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user