Commit d1ee2561 authored by Markus's avatar Markus

Rename CRotor->Rotor

parent 4692f36e
......@@ -20,7 +20,7 @@ CHamlib::CHamlib()
/// @brief Initialize Hamlib
///
void CHamlib::initHamlib(EthernetUDP *udp, CRotor *rotor)
void CHamlib::initHamlib(EthernetUDP *udp, Rotor *rotor)
{
udp_ = udp;
rotor_ = rotor;
......
......@@ -20,7 +20,7 @@ public:
enum hamlibError{HAMLIB_OK,
HAMLIB_NOK };
CHamlib();
void initHamlib(EthernetUDP *udp, CRotor *rotor);
void initHamlib(EthernetUDP *udp, Rotor *rotor);
void receiveHamlibPacket();
void sendHamlibPacket();
hamlibError parseHamlibPacket();
......@@ -28,7 +28,7 @@ public:
private:
EthernetUDP *udp_;
CRotor *rotor_;
Rotor *rotor_;
char received_packet_[UDP_TX_PACKET_MAX_SIZE];
char tx_packet_[UDP_TX_PACKET_MAX_SIZE];
bool packet_received_ = false;
......
......@@ -11,7 +11,7 @@
/// @brief Constructor
///
CRotor::CRotor()
Rotor::Rotor()
{
initRotor();
}
......@@ -20,7 +20,7 @@ CRotor::CRotor()
/// @brief Initialize all ADC Values and set Arduino Pins to a defined value.
///
void CRotor::initRotor()
void Rotor::initRotor()
{
if(AZIM)
{
......@@ -58,7 +58,7 @@ void CRotor::initRotor()
/// @brief Does all the rotor movement stuff
///
void CRotor::doRotor()
void Rotor::doRotor()
{
int diff_elev, diff_azim;
readRotSensors();
......@@ -115,31 +115,31 @@ void CRotor::doRotor()
}
}
void CRotor::releaseBreakAzimuth()
void Rotor::releaseBreakAzimuth()
{
m_bAzimuthBreakReleased = 1;
digitalWrite(AZIM_RE_BREAK, LOW);
}
void CRotor::releaseBreakElevation()
void Rotor::releaseBreakElevation()
{
m_bElevationBreakReleased = 1;
digitalWrite(ELEV_RE_BREAK, LOW);
}
void CRotor::tightenBreakAzimuth()
void Rotor::tightenBreakAzimuth()
{
m_bAzimuthBreakReleased = 0;
digitalWrite(AZIM_RE_BREAK, HIGH);
}
void CRotor::tightenBreakElevation()
void Rotor::tightenBreakElevation()
{
m_bElevationBreakReleased = 0;
digitalWrite(ELEV_RE_BREAK, HIGH);
}
void CRotor::stopAzimuth()
void Rotor::stopAzimuth()
{
digitalWrite(AZIM_RE_CW, HIGH);
digitalWrite(AZIM_RE_CCW, HIGH);
......@@ -147,7 +147,7 @@ void CRotor::stopAzimuth()
m_bAzimuthShouldRotate = 0;
}
void CRotor::stopElevation()
void Rotor::stopElevation()
{
digitalWrite(ELEV_RE_UP, HIGH);
digitalWrite(ELEV_RE_DWN, HIGH);
......@@ -155,44 +155,44 @@ void CRotor::stopElevation()
m_bElevationShouldRotate = 0;
}
CRotor::rotorError CRotor::rotateCW()
Rotor::rotorError Rotor::rotateCW()
{
if ( m_bAzimuthBreakReleased == 0 )
return CRotor::ROT_BREAK_NOT_RELEASED;
return Rotor::ROT_BREAK_NOT_RELEASED;
digitalWrite(AZIM_RE_CW, LOW);
digitalWrite(AZIM_RE_CCW, HIGH);
m_bAzimuthCurrentlyRotating = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
CRotor::rotorError CRotor::rotateCCW()
Rotor::rotorError Rotor::rotateCCW()
{
if ( m_bAzimuthBreakReleased == 0 )
return CRotor::ROT_BREAK_NOT_RELEASED;
return Rotor::ROT_BREAK_NOT_RELEASED;
digitalWrite(AZIM_RE_CW, HIGH);
digitalWrite(AZIM_RE_CCW, LOW);
m_bAzimuthCurrentlyRotating = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
CRotor::rotorError CRotor::rotateUp()
Rotor::rotorError Rotor::rotateUp()
{
if ( m_bElevationBreakReleased == 0 )
return CRotor::ROT_BREAK_NOT_RELEASED;
return Rotor::ROT_BREAK_NOT_RELEASED;
digitalWrite(ELEV_RE_UP, LOW);
digitalWrite(ELEV_RE_DWN, HIGH);
m_bElevationCurrentlyRotating = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
CRotor::rotorError CRotor::rotateDown()
Rotor::rotorError Rotor::rotateDown()
{
if ( m_bElevationBreakReleased == 0 )
return CRotor::ROT_BREAK_NOT_RELEASED;
return Rotor::ROT_BREAK_NOT_RELEASED;
digitalWrite(ELEV_RE_UP, HIGH);
digitalWrite(ELEV_RE_DWN, LOW);
m_bElevationCurrentlyRotating = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
......@@ -200,7 +200,7 @@ CRotor::rotorError CRotor::rotateDown()
/// @brief Serial Debug output Function
///
void CRotor::debugOut()
void Rotor::debugOut()
{
//debug Out
readRotSensors();
......@@ -217,7 +217,7 @@ void CRotor::debugOut()
/// @return uint16 actual Azimuth value in degree
///
uint16 CRotor::getActualAzimuth() const
uint16 Rotor::getActualAzimuth() const
{
return m_uActualAzimuth;
}
......@@ -228,7 +228,7 @@ uint16 CRotor::getActualAzimuth() const
/// @return actual Elevation value in degree
///
uint16 CRotor::getActualElevation() const
uint16 Rotor::getActualElevation() const
{
return m_uActualElevation;
}
......@@ -241,17 +241,17 @@ uint16 CRotor::getActualElevation() const
/// @return Error Code
///
CRotor::rotorError CRotor::setAzimuth(uint16 pAzimuth)
Rotor::rotorError Rotor::setAzimuth(uint16 pAzimuth)
{
if(pAzimuth >= AZIM_MIN && pAzimuth <= AZIM_MAX)
{
m_uSetAzimuth = pAzimuth;
m_bAzimuthShouldRotate = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
else
{
return CRotor::ROT_VAL_OUT_OF_RANGE;
return Rotor::ROT_VAL_OUT_OF_RANGE;
}
}
......@@ -263,17 +263,17 @@ CRotor::rotorError CRotor::setAzimuth(uint16 pAzimuth)
/// @return Error Code
///
CRotor::rotorError CRotor::setElevation(uint16 pElevation)
Rotor::rotorError Rotor::setElevation(uint16 pElevation)
{
if(pElevation >= ELEV_MIN && pElevation <= ELEV_MAX)
{
m_uSetElevation = pElevation;
m_bElevationShouldRotate = 1;
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
else
{
return CRotor::ROT_VAL_OUT_OF_RANGE;
return Rotor::ROT_VAL_OUT_OF_RANGE;
}
}
......@@ -283,14 +283,14 @@ CRotor::rotorError CRotor::setElevation(uint16 pElevation)
/// @return Error Code
///
CRotor::rotorError CRotor::readRotSensors()
Rotor::rotorError Rotor::readRotSensors()
{
if(AZIM)
m_uActualAzimuth = (uint16)(readADC(AZIM_POT)/AZIM_DEG);
if(ELEV)
m_uActualElevation = (uint16)(readADC(ELEV_POT)/ELEV_DEG);
return CRotor::ROT_OK;
return Rotor::ROT_OK;
}
///
......@@ -301,7 +301,7 @@ CRotor::rotorError CRotor::readRotSensors()
/// @return average ADC value
///
uint16 CRotor::readADC(int AdcPin)
uint16 Rotor::readADC(int AdcPin)
{
//Read ADC 4 times and calculate average
uint32_t adcValue = 0;
......
......@@ -11,14 +11,14 @@
#include "settings.h"
#include "Arduino.h"
class CRotor
class Rotor
{
public:
enum rotorError { ROT_OK,
ROT_NOK,
ROT_VAL_OUT_OF_RANGE,
ROT_BREAK_NOT_RELEASED };
CRotor();
Rotor();
void initRotor();
void doRotor();
void debugOut();
......
......@@ -20,7 +20,7 @@ byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x13, 0x37 };
IPAddress ip(83,133,178,126);
unsigned int localPort = 51337;
CRotor rotor;
Rotor rotor;
CHamlib hamlib;
EthernetUDP udp;
int debugTime;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment