RBE1001Lib
Public Member Functions | Data Fields | Private Attributes
WebPage Class Reference

#include <WebPage.h>

Collaboration diagram for WebPage:
Collaboration graph
[legend]

Public Member Functions

 WebPage ()
 
void initalize ()
 
float getSliderValue (uint32_t number)
 
JoyDatagetJoystickData ()
 
float getJoystickAngle ()
 
float getJoystickMagnitude ()
 
float getJoystickX ()
 
float getJoystickY ()
 
void setSliderValue (uint32_t number, float value)
 
void setJoystickValue (float xpos, float ypos, float angle, float mag)
 
void setValue (String name, float data)
 
void newButton (String url, void(*handler)(String), String label, String description)
 
bool SendAllValues ()
 
bool SendAllLabels ()
 
void valueChanged (String name, float value)
 
void sendValueUpdate (uint32_t index, uint8_t *buffer)
 
void sendLabelUpdate (uint32_t index, uint8_t *buffer)
 
void printToWebConsole (String data)
 
void markAllDirty ()
 
bool dirtyLabels ()
 
bool dirtyValues ()
 
bool sendHeartbeat ()
 
void setHeartbeatUUID (uint32_t uuid)
 
void UpdatePIDValues (uint32_t motor, float p, float i, float d)
 
void UpdateSetpoint (uint32_t motor, float setpoint)
 
bool SendPIDValues (uint32_t motor)
 
bool SendSetpoint (uint32_t motor)
 
bool sendPacket (unsigned char *packet, uint32_t length)
 

Data Fields

bool updatePID =true
 
float sliders [numSliders]
 
telemetryValue values [numValues]
 
int numValuesUsed =0
 
JoyData joystick
 
uint32_t txPacketCount = 0
 
uint32_t rxPacketCount = 0
 
TaskHandle_t updateTaskHandle
 
TaskHandle_t packetTaskHandle
 
uint32_t motor_count
 
SemaphoreHandle_t valuesSem
 

Private Attributes

uint32_t _heartbeat_uuid =0
 

Detailed Description

Definition at line 29 of file WebPage.h.

Constructor & Destructor Documentation

◆ WebPage()

WebPage::WebPage ( )

Member Function Documentation

◆ dirtyLabels()

bool WebPage::dirtyLabels ( )

Definition at line 375 of file WebPage.cpp.

References numValues, and values.

Referenced by SendAllLabels().

◆ dirtyValues()

bool WebPage::dirtyValues ( )

Definition at line 382 of file WebPage.cpp.

References numValues, and values.

Referenced by SendAllValues().

◆ getJoystickAngle()

float WebPage::getJoystickAngle ( )

Definition at line 308 of file WebPage.cpp.

References _JoyData::angle, and joystick.

◆ getJoystickData()

JoyData * WebPage::getJoystickData ( )

Definition at line 320 of file WebPage.cpp.

References joystick.

◆ getJoystickMagnitude()

float WebPage::getJoystickMagnitude ( )

Definition at line 311 of file WebPage.cpp.

References joystick, and _JoyData::mag.

◆ getJoystickX()

float WebPage::getJoystickX ( )

Definition at line 314 of file WebPage.cpp.

References joystick, and _JoyData::xpos.

Referenced by runStateMachine().

◆ getJoystickY()

float WebPage::getJoystickY ( )

Definition at line 317 of file WebPage.cpp.

References joystick, and _JoyData::ypos.

Referenced by runStateMachine().

◆ getSliderValue()

float WebPage::getSliderValue ( uint32_t  number)

Definition at line 303 of file WebPage.cpp.

References sliders.

Referenced by runStateMachine(), and updateDashboard().

◆ initalize()

void WebPage::initalize ( )

◆ markAllDirty()

void WebPage::markAllDirty ( )

Definition at line 580 of file WebPage.cpp.

References _telemetryValue::labelDirty, numValues, _telemetryValue::valueDirty, and values.

Referenced by onWsEvent().

◆ newButton()

void WebPage::newButton ( String  url,
void(*)(String)  handler,
String  label,
String  description 
)

Definition at line 570 of file WebPage.cpp.

◆ printToWebConsole()

void WebPage::printToWebConsole ( String  data)

Definition at line 602 of file WebPage.cpp.

References sendPacket().

Here is the call graph for this function:

◆ SendAllLabels()

bool WebPage::SendAllLabels ( )

Definition at line 465 of file WebPage.cpp.

References dirtyLabels(), labelBufferSize, numValues, sendPacket(), values, and valuesSem.

Referenced by updateTask().

Here is the call graph for this function:

◆ SendAllValues()

bool WebPage::SendAllValues ( )

Definition at line 390 of file WebPage.cpp.

References dirtyValues(), numValues, sendPacket(), values, and ws().

Referenced by updateTask().

Here is the call graph for this function:

◆ sendHeartbeat()

bool WebPage::sendHeartbeat ( )

Definition at line 592 of file WebPage.cpp.

References _heartbeat_uuid, and sendPacket().

Referenced by updateTask().

Here is the call graph for this function:

◆ sendLabelUpdate()

void WebPage::sendLabelUpdate ( uint32_t  index,
uint8_t *  buffer 
)

Definition at line 554 of file WebPage.cpp.

References _telemetryValue::name, numValues, _telemetryValue::valueDirty, and values.

◆ sendPacket()

bool WebPage::sendPacket ( unsigned char *  packet,
uint32_t  length 
)

Definition at line 669 of file WebPage.cpp.

References txPacketCount, and ws().

Referenced by printToWebConsole(), SendAllLabels(), SendAllValues(), sendHeartbeat(), SendPIDValues(), and SendSetpoint().

Here is the call graph for this function:

◆ SendPIDValues()

bool WebPage::SendPIDValues ( uint32_t  motor)

Definition at line 630 of file WebPage.cpp.

References Motor::getGainsD(), Motor::getGainsI(), Motor::getGainsP(), Motor::list, MAX_POSSIBLE_MOTORS, sendPacket(), and ws().

Referenced by updateTask().

Here is the call graph for this function:

◆ SendSetpoint()

bool WebPage::SendSetpoint ( uint32_t  motor)

Definition at line 650 of file WebPage.cpp.

References Motor::getCurrentDegrees(), Motor::list, MAX_POSSIBLE_MOTORS, and sendPacket().

Referenced by updateTask().

Here is the call graph for this function:

◆ sendValueUpdate()

void WebPage::sendValueUpdate ( uint32_t  index,
uint8_t *  buffer 
)

Definition at line 541 of file WebPage.cpp.

References numValues, _telemetryValue::value, and values.

◆ setHeartbeatUUID()

void WebPage::setHeartbeatUUID ( uint32_t  uuid)

Definition at line 588 of file WebPage.cpp.

References _heartbeat_uuid.

Referenced by onWsEvent().

◆ setJoystickValue()

void WebPage::setJoystickValue ( float  xpos,
float  ypos,
float  angle,
float  mag 
)

Definition at line 335 of file WebPage.cpp.

References _JoyData::angle, joystick, _JoyData::mag, _JoyData::xpos, and _JoyData::ypos.

Referenced by onWsEvent().

◆ setSliderValue()

void WebPage::setSliderValue ( uint32_t  number,
float  value 
)

Definition at line 331 of file WebPage.cpp.

References sliders.

Referenced by onWsEvent().

◆ setValue()

void WebPage::setValue ( String  name,
float  data 
)

◆ UpdatePIDValues()

void WebPage::UpdatePIDValues ( uint32_t  motor,
float  p,
float  i,
float  d 
)

Definition at line 616 of file WebPage.cpp.

References Motor::list, MAX_POSSIBLE_MOTORS, Motor::setGainsD(), Motor::setGainsI(), and Motor::setGainsP().

Here is the call graph for this function:

◆ UpdateSetpoint()

void WebPage::UpdateSetpoint ( uint32_t  motor,
float  setpoint 
)

Definition at line 624 of file WebPage.cpp.

References Motor::list, MAX_POSSIBLE_MOTORS, and Motor::setSetpoint().

Here is the call graph for this function:

◆ valueChanged()

void WebPage::valueChanged ( String  name,
float  value 
)

Definition at line 575 of file WebPage.cpp.

References setValue().

Here is the call graph for this function:

Field Documentation

◆ _heartbeat_uuid

uint32_t WebPage::_heartbeat_uuid =0
private

Definition at line 94 of file WebPage.h.

Referenced by sendHeartbeat(), and setHeartbeatUUID().

◆ joystick

JoyData WebPage::joystick

◆ motor_count

uint32_t WebPage::motor_count

Definition at line 61 of file WebPage.h.

◆ numValuesUsed

int WebPage::numValuesUsed =0

Definition at line 51 of file WebPage.h.

Referenced by setValue().

◆ packetTaskHandle

TaskHandle_t WebPage::packetTaskHandle

Definition at line 60 of file WebPage.h.

◆ rxPacketCount

uint32_t WebPage::rxPacketCount = 0

Definition at line 58 of file WebPage.h.

Referenced by onWsEvent(), and updateDashboard().

◆ sliders

float WebPage::sliders[numSliders]

Definition at line 49 of file WebPage.h.

Referenced by getSliderValue(), setSliderValue(), and WebPage().

◆ txPacketCount

uint32_t WebPage::txPacketCount = 0

Definition at line 57 of file WebPage.h.

Referenced by sendPacket(), and updateDashboard().

◆ updatePID

bool WebPage::updatePID =true

Definition at line 34 of file WebPage.h.

Referenced by onWsEvent(), and updateTask().

◆ updateTaskHandle

TaskHandle_t WebPage::updateTaskHandle

Definition at line 59 of file WebPage.h.

Referenced by initalize().

◆ values

telemetryValue WebPage::values[numValues]

◆ valuesSem

SemaphoreHandle_t WebPage::valuesSem

Definition at line 82 of file WebPage.h.

Referenced by initalize(), SendAllLabels(), and setValue().


The documentation for this class was generated from the following files: