TaskController 2.2.23
A light-weight UI that serves as the task/parameter front-end.
Loading...
Searching...
No Matches
Target Generation/Tracking

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...

Functions

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.
 

Detailed Description

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.

Function Documentation

◆ addTargetToTable()

BOOL addTargetToTable ( HWND hTable,
TrialTargets * tSeq )

Adds a new item to the ListView control with the specified target sequence.

Parameters
hTableHandle to the ListView control.
tSeqPointer 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
hTableHandle 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
hTableHandle 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
tSeqPointer to the TrialTargets structure to store the updated target sequence.
newDirectionThe direction for trial indicated by the returned TrialTargets structure.
nextSeqIndexThe next index within the current random-target-set sequence. Used to stratify the target distribution.
randomTargetSetArray containing the ordered list of targets within the current randomized target sequence.
travelDistanceThe distance traveled from the origin.
xcX-center pixel.
ycY-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
hTableHandle to the ListView control.
tSeqPointer to the TrialTargets structure.
randomTargetSetArray containing the random target indices.
travelDistanceThe distance to travel.
xcThe x-coordinate.
ycThe y-coordinate.

◆ removeSelectedTargetsFromTable()

void removeSelectedTargetsFromTable ( HWND hTable)

Removes the selected targets from the ListView control.

Parameters
hTableHandle 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
hTableHandle to the ListView control.
rowIndexIndex of the row to select.

◆ targetSeqToString()

const char * targetSeqToString ( TrialTargets * tSeq)

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
tSeqPointer 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
tSeqPointer to the TrialTargets structure to store the updated target sequence.
newTargetThe new enumerated target.
newDirectionThe new direction (either DIRECTION_IN_TO_OUT or DIRECTION_OUT_TO_IN).
travelDistanceThe distance traveled from the origin.
xcX-center pixel.
ycY-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
tSeqPointer to the TrialTargets structure to be updated.
valueThe formatted input string containing target and direction information.
travelDistanceThe travel distance for updating the target sequence.
xcThe x-coordinate value for updating the target sequence.
ycThe y-coordinate value for updating the target sequence.