ME 305 Group 6 Documentation
|
Manages the states for the User Interface task. More...
Functions | |
def | taskUser_04.printLegend_04 () |
Prints the available user key commands to the console. More... | |
def | taskUser_04.printTestLegend_04 () |
Prints the available user key commands in test interface to the console. More... | |
def | taskUser_04.taskUserFcn_04 (str task_name, int period, shares_04.Share_04 zFlag, shares_04.Share_04 pFlag, shares_04.Share_04 dFlag, shares_04.Share_04 vFlag, shares_04.Share_04 duty1, shares_04.Share_04 duty2, shares_04.Share_04 cFlag, shares_04.Share_04 gFlag, shares_04.Share_04 tFlag, shares_04.Share_04 sFlag, shares_04.Share_04 dataPrint, shares_04.Share_04 testData, shares_04.Share_04 target_val, shares_04.Share_04 prop_gain, shares_04.Share_04 cont_enable, shares_04.Share_04 input_signal) |
Main task function to control UI states. More... | |
Manages the states for the User Interface task.
Manages the current state and executes state-related logic for all User Interface functionality. Cycles through states for processing input, zeroing encoder position, and printing output.
def taskUser_04.printLegend_04 | ( | ) |
Prints the available user key commands to the console.
Prints a table of available user input commands to the console to preview the available user key commands.
def taskUser_04.printTestLegend_04 | ( | ) |
Prints the available user key commands in test interface to the console.
Prints a table of available user input commands to the console to preview the available user key commands in the testing interface.
def taskUser_04.taskUserFcn_04 | ( | str | task_name, |
int | period, | ||
shares_04.Share_04 | zFlag, | ||
shares_04.Share_04 | pFlag, | ||
shares_04.Share_04 | dFlag, | ||
shares_04.Share_04 | vFlag, | ||
shares_04.Share_04 | duty1, | ||
shares_04.Share_04 | duty2, | ||
shares_04.Share_04 | cFlag, | ||
shares_04.Share_04 | gFlag, | ||
shares_04.Share_04 | tFlag, | ||
shares_04.Share_04 | sFlag, | ||
shares_04.Share_04 | dataPrint, | ||
shares_04.Share_04 | testData, | ||
shares_04.Share_04 | target_val, | ||
shares_04.Share_04 | prop_gain, | ||
shares_04.Share_04 | cont_enable, | ||
shares_04.Share_04 | input_signal | ||
) |
Main task function to control UI states.
Manage different User Input states, including Init, Read_Cmd, Zero_Encoder, and Print_Data. On function run, executes the logic of the current state and if appropriate shifts state for next run of function.
task_name | Task name for the function to help with debugging |
period | Period to run execute function at. Period defines frequency that states are executed and refreshed. |
zFlag | Shared data object to encapsulate the z key being pressed. Signals that encoder should be zeroed. |
pFlag | Shared data object to encapsulate the p key being pressed. Signals to print the encoder position. |
dFlag | Shared data object to encapsulate the d key being pressed. Signals to print the encoder delta. |
vFlag | Shared data object to encapsulate the v key being pressed. Signals to print the encoder velocity. |
duty1 | Shared data object to store the duty cycle for motor 1. |
duty2 | Shared data object to store the duty cycle for motor 2. |
cFlag | Shared data object to encapsulate the c key being pressed. Signals to clear a motor fault. |
gFlag | Shared data object to encapsulate the g key being pressed. Signals to begin data collection. |
tFlag | Shared data object to encapsulate the t key being pressed. Starts the testing interface. |
sFlag | Shared data object to encapsulate the s key being pressed. Signals to end data collection prematurely. |
dataPrint | Shared data object to store the recorded encoder data. Stores both the position data and time values. |
testData | Shared data object to act as a flag to record avg velocity and to store the velocity data during testing. |
target_val | Shared data object to hold the target velocity value |
prop_gain | Shared data object to hold the proportional gain for the controllerTask |
cont_enable | Shared data object to specificy whether closed-loop controller is enabled (True) or not |
input_signal | Shared data object to store the encoder velocity @yield state If task ran, yields state the function is now in. If task did not evaluate, returns None. |