Graph documentation

This commit is contained in:
Christian Colglazier 2022-01-17 16:54:57 -05:00
parent eb9e4ad365
commit df827b5054
2 changed files with 54 additions and 0 deletions

View File

@ -211,6 +211,7 @@ void ADDroplet::UpdateStateCallback() {
sample_rate, sample_rate,
State()); State());
} }
delete title_graph;
title_graph = new Graph(GetScreenMax()-GetScreenMin(), title_graph = new Graph(GetScreenMax()-GetScreenMin(),
GetTitleHeight()); GetTitleHeight());
} }

View File

@ -14,15 +14,68 @@ class Graph {
bool** graph; bool** graph;
int GetNextActive(); int GetNextActive();
public: public:
/*
* Contsturctor for graph.
*
* @param m_width width
* @param m_height height
*/
Graph(int m_width, Graph(int m_width,
int m_height); int m_height);
/*
* Destructor for graph.
*/
~Graph(); ~Graph();
/*
* Shifts the graph by one pixel.
*/
void Update(); void Update();
/*
* Clears the pxiels at the currently active column.
*/
void ClearColumn(); void ClearColumn();
/*
* Draws an active pixel on the graph.
*
* @param pos y dimension of pixel
*/
void SetPixel(int pos); void SetPixel(int pos);
/*
* Draws a pixel on the graph.
*
* @param pos y dimension of pixel
* @param on pixel active state
*/
void SetPixel(int pos, bool on); void SetPixel(int pos, bool on);
/*
* Draws an acive pixel based on a percentage of the
* the height of the graph.
*
* @param percentage precentage height of the pixel
*/
void SetPixelPercentage(double percentage); void SetPixelPercentage(double percentage);
/*
* Draws a pixel based on a percentage of the
* the height of the graph.
*
* @param percentage precentage height of the pixel
* @param on pixel active state
*/
void SetPixelPercentage(double percentage, bool on); void SetPixelPercentage(double percentage, bool on);
/*
* Draws graph on display.
*
* @param patch daisy patch board
* @param x starting x coordinate of graph
* @param y starting y coordinate of graph
*/
void Draw(DaisyPatch* patch, int x, int y); void Draw(DaisyPatch* patch, int x, int y);
}; };