Wyatt
1.0.1
Main Page
Classes
Files
File List
src
sensors
EncoderSensor.cpp
1
//
2
// Created by Tucker Haydon on 4/26/17.
3
//
4
5
#include "sensors/EncoderSensor.h"
6
7
EncoderSensor::EncoderSensor
() {
8
// Nothing
9
}
10
11
EncoderSensor::~EncoderSensor
() {
12
// Nothing
13
}
14
15
void
EncoderSensor::updateSensor
(
IMessage
*message) {
16
17
if
(
typeid
(*message) !=
typeid
(
EncoderMessage
)) {
18
throw
MismatchedMessageException
(message);
19
}
20
21
// Cast the message
22
EncoderMessage
* msg = (
EncoderMessage
*)message;
23
24
this->RPM = msg->
getData
();
25
}
26
27
double
EncoderSensor::getRPM
() {
28
return
this->RPM;
29
}
MismatchedMessageException
Definition:
MismatchedMessageException.h:13
IMessage
Definition:
IMessage.h:10
EncoderSensor::EncoderSensor
EncoderSensor()
Definition:
EncoderSensor.cpp:7
EncoderSensor::updateSensor
void updateSensor(IMessage *message)
Definition:
EncoderSensor.cpp:15
EncoderMessage
Definition:
EncoderMessage.h:15
EncoderMessage::getData
double getData()
Definition:
EncoderMessage.cpp:19
EncoderSensor::getRPM
double getRPM()
Definition:
EncoderSensor.cpp:27
EncoderSensor::~EncoderSensor
~EncoderSensor()
Definition:
EncoderSensor.cpp:11
Generated by
1.8.11