Consists of utilities designed to help generate random new targets or track an existing set of targets. This group includes functions and structures related to generating target coordinates, checking target proximity, and updating target positions.
More...
|
BOOL | addTargetToTable (HWND hTable, TrialTargets *tSeq) |
| Adds a new item to the ListView control with the specified target sequence.
|
|
int | countTargetsInTable (HWND hTable) |
| Counts the number of targets in the ListView control.
|
|
const char * | getStringFromTopTableRow (HWND hTable) |
| Retrieves the string from the top row of the ListView control.
|
|
void | populateRandomTargets (HWND hTable, TrialTargets *tSeq, int randomTargetSet[], uint16_t travelDistance, uint16_t xc, uint16_t yc) |
| Populates a ListView control with random targets.
|
|
void | removeSelectedTargetsFromTable (HWND hTable) |
| Removes the selected targets from the ListView control.
|
|
void | setSelectedRow (HWND hTable, int rowIndex) |
| Sets the currently selected row in a ListView control.
|
|
const char * | targetSeqToString (TrialTargets *tSeq) |
| Converts the target sequence data to a string representation.
|
|
void | newRandomTarget (TrialTargets *tSeq, Direction newDirection, uint8_t nextSeqIndex, int randomTargetSet[], uint16_t travelDistance, uint16_t xc, uint16_t yc) |
| Generate a new random TrialTargets data structure.
|
|
void | updateTargetSequence (TrialTargets *tSeq, Target newTarget, Direction newDirection, uint16_t travelDistance, uint16_t xc, uint16_t yc) |
| Updates the target sequence data using a new enumerated target and direction.
|
|
void | updateTargetSequenceFromString (TrialTargets *tSeq, const char *value, uint16_t travelDistance, uint16_t xc, uint16_t yc) |
| Updates the target sequence data based on a formatted input string.
|
|
Consists of utilities designed to help generate random new targets or track an existing set of targets. This group includes functions and structures related to generating target coordinates, checking target proximity, and updating target positions.
◆ addTargetToTable()
Adds a new item to the ListView control with the specified target sequence.
- Parameters
-
hTable | Handle to the ListView control. |
tSeq | Pointer to the TrialTargets structure containing the target sequence. |
- Returns
- TRUE if the insertion was successful, FALSE otherwise.
◆ countTargetsInTable()
int countTargetsInTable |
( |
HWND | hTable | ) |
|
Counts the number of targets in the ListView control.
- Parameters
-
hTable | Handle to the ListView control. |
- Returns
- The number of targets in the table.
◆ getStringFromTopTableRow()
const char * getStringFromTopTableRow |
( |
HWND | hTable | ) |
|
Retrieves the string from the top row of the ListView control.
- Parameters
-
hTable | Handle to the ListView control. |
- Returns
- The string from the top row of the ListView control, or "MISSING" if there was an error.
◆ newRandomTarget()
void newRandomTarget |
( |
TrialTargets * | tSeq, |
|
|
Direction | newDirection, |
|
|
uint8_t | nextSeqIndex, |
|
|
int | randomTargetSet[], |
|
|
uint16_t | travelDistance, |
|
|
uint16_t | xc, |
|
|
uint16_t | yc ) |
Generate a new random TrialTargets data structure.
- Parameters
-
tSeq | Pointer to the TrialTargets structure to store the updated target sequence. |
newDirection | The direction for trial indicated by the returned TrialTargets structure. |
nextSeqIndex | The next index within the current random-target-set sequence. Used to stratify the target distribution.
|
randomTargetSet | Array containing the ordered list of targets within the current randomized target sequence. |
travelDistance | The distance traveled from the origin. |
xc | X-center pixel. |
yc | Y-Center pixel. |
◆ populateRandomTargets()
void populateRandomTargets |
( |
HWND | hTable, |
|
|
TrialTargets * | tSeq, |
|
|
int | randomTargetSet[], |
|
|
uint16_t | travelDistance, |
|
|
uint16_t | xc, |
|
|
uint16_t | yc ) |
Populates a ListView control with random targets.
This function generates random targets using the provided parameters, adds them to the provided TrialTargets
structure, and populates the ListView control (hTable
) with these targets.
- Parameters
-
hTable | Handle to the ListView control. |
tSeq | Pointer to the TrialTargets structure. |
randomTargetSet | Array containing the random target indices. |
travelDistance | The distance to travel. |
xc | The x-coordinate. |
yc | The y-coordinate. |
◆ removeSelectedTargetsFromTable()
void removeSelectedTargetsFromTable |
( |
HWND | hTable | ) |
|
Removes the selected targets from the ListView control.
- Parameters
-
hTable | Handle to the ListView control. |
◆ setSelectedRow()
void setSelectedRow |
( |
HWND | hTable, |
|
|
int | rowIndex ) |
Sets the currently selected row in a ListView control.
This function deselects all items in the ListView and then selects the row specified by the rowIndex parameter.
- Parameters
-
hTable | Handle to the ListView control. |
rowIndex | Index of the row to select. |
◆ targetSeqToString()
Converts the target sequence data to a string representation.
This function converts the target sequence data stored in the provided TrialTargets
structure to a string representation. It combines the target and direction information into a single string.
- Parameters
-
tSeq | Pointer to the TrialTargets structure containing the target sequence data. |
- Returns
- A pointer to a string representing the target sequence data.
- Warning
- The returned string is stored in a static buffer and may be overwritten by subsequent calls to this function.
◆ updateTargetSequence()
void updateTargetSequence |
( |
TrialTargets * | tSeq, |
|
|
Target | newTarget, |
|
|
Direction | newDirection, |
|
|
uint16_t | travelDistance, |
|
|
uint16_t | xc, |
|
|
uint16_t | yc ) |
Updates the target sequence data using a new enumerated target and direction.
This function updates the target sequence data based on the provided new target and direction. If the direction is DIRECTION_IN_TO_OUT, the function calculates the coordinates of the second target based on the angle (converted from the target index) and the given travel distance. If the direction is not DIRECTION_IN_TO_OUT, it updates the first target's coordinates to the second target's coordinates, and sets the second target's coordinates to the center point.
- Parameters
-
tSeq | Pointer to the TrialTargets structure to store the updated target sequence. |
newTarget | The new enumerated target. |
newDirection | The new direction (either DIRECTION_IN_TO_OUT or DIRECTION_OUT_TO_IN). |
travelDistance | The distance traveled from the origin. |
xc | X-center pixel. |
yc | Y-Center pixel. |
◆ updateTargetSequenceFromString()
void updateTargetSequenceFromString |
( |
TrialTargets * | tSeq, |
|
|
const char * | value, |
|
|
uint16_t | travelDistance, |
|
|
uint16_t | xc, |
|
|
uint16_t | yc ) |
Updates the target sequence data based on a formatted input string.
This function parses a formatted input string containing target and direction information, and updates the target sequence accordingly.
- Parameters
-
tSeq | Pointer to the TrialTargets structure to be updated. |
value | The formatted input string containing target and direction information. |
travelDistance | The travel distance for updating the target sequence. |
xc | The x-coordinate value for updating the target sequence. |
yc | The y-coordinate value for updating the target sequence. |