|
mupp 1.1.0
|
Data structure for X-Y axis label associations. More...
#include <PmuppGui.h>
Public Member Functions | |
| PmuppXY () | |
| Default constructor. Initializes with invalid collection tag. | |
| void | setCollectionTag (int tag) |
| Sets the collection tag (identifier). | |
| void | setXlabel (QString str) |
| Sets the X-axis label. | |
| void | addYlabel (QString str) |
| Adds a Y-axis label to the list. | |
| void | setYlabel (int idx, QString str) |
| Sets the Y-axis label at a specific index. | |
| void | removeYlabel (int idx) |
| Removes a Y-axis label by index. | |
| void | removeYlabel (QString str) |
| Removes a Y-axis label by name. | |
| int | getCollectionTag () |
| Gets the collection tag. | |
| QString | getXlabel () |
| Gets the X-axis label. | |
| int | getXlabelIdx () |
| Extracts the parameter index from the X-axis label. | |
| int | getYlabelSize () |
| Gets the number of Y-axis labels. | |
| QString | getYlabel (int idx) |
| Gets a Y-axis label by index. | |
| int | getYlabelIdx (int idx) |
| Extracts the parameter index from a Y-axis label. | |
| QVector< QString > | getYlabels () |
| Gets all Y-axis labels. | |
Private Member Functions | |
| void | init () |
| Initializes the object to default state. | |
Private Attributes | |
| int | fCollectionTag |
| identifier for the associated data collection | |
| QString | fXlabel |
| X-axis parameter label. | |
| QVector< QString > | fYlabel |
| vector of Y-axis parameter labels | |
Data structure for X-Y axis label associations.
PmuppXY stores the relationship between X-axis and Y-axis parameter labels for plotting. Each instance represents one plot configuration with:
The class supports:
Definition at line 100 of file PmuppGui.h.
|
inline |
Default constructor. Initializes with invalid collection tag.
Definition at line 106 of file PmuppGui.h.
|
inline |
Adds a Y-axis label to the list.
| str | Y-axis parameter label to add |
Definition at line 124 of file PmuppGui.h.
|
inline |
|
inline |
| int PmuppXY::getXlabelIdx | ( | ) |
Extracts the parameter index from the X-axis label.
Parameter labels are formatted as "name (-index-)" where index is the parameter number. This method parses the label string to extract the numeric index value.
The parsing process:
Definition at line 205 of file PmuppGui.cpp.
| QString PmuppXY::getYlabel | ( | int | idx | ) |
Gets a Y-axis label by index.
| idx | index of the Y-label |
Returns the Y-axis parameter label at the specified position. If the index is out of bounds, returns an empty string instead of causing an error.
| idx | zero-based index of the Y-label to retrieve |
Definition at line 181 of file PmuppGui.cpp.
| int PmuppXY::getYlabelIdx | ( | int | idx | ) |
Extracts the parameter index from a Y-axis label.
| idx | index of the Y-label |
Similar to getXlabelIdx(), this method parses a Y-axis label formatted as "name (-index-)" to extract the parameter number. The method first validates that the requested Y-label exists in the vector.
The parsing process:
| idx | zero-based index of the Y-label to process |
Definition at line 249 of file PmuppGui.cpp.
|
inline |
Gets all Y-axis labels.
Definition at line 187 of file PmuppGui.h.
|
inline |
Gets the number of Y-axis labels.
Definition at line 167 of file PmuppGui.h.
|
private |
Initializes the object to default state.
Initializes the PmuppXY object to default state.
Sets the collection tag to -1 (invalid), clears the X-axis label, and empties the Y-axis label vector. This provides a clean starting state for the X-Y configuration.
Definition at line 107 of file PmuppGui.cpp.
| void PmuppXY::removeYlabel | ( | int | idx | ) |
Removes a Y-axis label by index.
| idx | index of the Y-label to remove |
Deletes the Y-axis label at the specified position from the vector. If the index is out of bounds, the operation is silently ignored.
| idx | zero-based index of the Y-label to remove |
Definition at line 141 of file PmuppGui.cpp.
| void PmuppXY::removeYlabel | ( | QString | str | ) |
Removes a Y-axis label by name.
| str | Y-axis parameter label to remove |
Searches for a Y-axis label matching the given string and removes it if found. Only the first matching label is removed. If no match is found, the vector remains unchanged.
| str | Y-axis parameter label string to remove |
Definition at line 159 of file PmuppGui.cpp.
|
inline |
Sets the collection tag (identifier).
| tag | collection identifier |
Definition at line 112 of file PmuppGui.h.
|
inline |
Sets the X-axis label.
| str | X-axis parameter label |
Definition at line 118 of file PmuppGui.h.
| void PmuppXY::setYlabel | ( | int | idx, |
| QString | str ) |
Sets the Y-axis label at a specific index.
Sets a Y-axis label at a specific index.
| idx | index of the Y-label to modify |
| str | new Y-axis parameter label |
Replaces the Y-axis label at the given index with a new value. If the index is out of bounds, the operation is silently ignored.
| idx | zero-based index of the Y-label to modify |
| str | new Y-axis parameter label string |
Definition at line 124 of file PmuppGui.cpp.
|
private |
identifier for the associated data collection
Definition at line 190 of file PmuppGui.h.
|
private |
X-axis parameter label.
Definition at line 191 of file PmuppGui.h.
|
private |
vector of Y-axis parameter labels
Definition at line 192 of file PmuppGui.h.