User interface
List of functions in the ui
folder: those are mostly to handle the “graphic interface”
that can be used to deal with userInputs()
.
- src.ui.askUserCli(items)
It shows the questions to ask in the command window and checks, when it is necessary, if the given input by the user is an integer.
USAGE:
items = askUserCli(items)
- Parameters
items (
structure
) – It contains the questions list to ask and if the response given to one question must be checked to be a positive integer.
EXAMPLE:
items = returnDefaultQuestionnaire(); items = askUserCli(items);
See also: createQuestionnaire
- src.ui.askUserGui(items)
It shows the questions to ask in in a GUI interface and checks, when it is necessary, if the given input by the user is a positive integer. If not, it keeps showing the GUI interface.
USAGE:
[responses] = askUserGui(questions, responses)
- Parameters
questions (
structure
) – It contains the questions list to ask and if the response given to one question must be checked to be an integer number.responses (
cell
) – It contains the responses set by default.
- Returns
- responses
(cell) Response updated with the user inputs.
- src.ui.createQuestionnaire(cfg)
It creates a list of default questions to ask the users regarding:
the subj number
the run number
the group ID (if required by user)
and session nb (if required by user)
USAGE:
[items, cfg] = createQuestionnaire(cfg)
- Parameters
cfg (
structure
) – Configuration. SeecheckCFG()
.- Returns
- items
(structure) It contains the questions list to ask and if the response given to one question must be checked to be a positive integer.
EXAMPLE
items(1).question = ‘Enter subject number (1-999): ‘; items(1).response = ‘’; items(1).mustBePosInt = true; items(1).show = true;
See also: returnDefaultQuestionnaire
- src.ui.askForGroupAndOrSession(cfg)
It checks
cfg
ifgroup
,session
,run
are required incfg.subject.ask
by the user. If not specified, it will add these by default.USAGE:
[cfg] = askForGroupAndOrSession(cfg)
- Parameters
cfg (
structure
) – Configuration. SeecheckCFG()
.- Returns
- cfg
(structure) Configuration update with the instructions if to ask for
group
andsession
.
- src.ui.getIsQuestionToAsk(questions, responses)
While using the GUI interface to input the experiment information, it flags any question that will be presented in the GUI. If a response is not valid (e.g. is not an integer) it will keep flagging it as a ‘question to ask’ and represent the GUI.
USAGE:
isQuestionToAsk = getIsQuestionToAsk(questions, responses)
- Parameters
questions (
structure
) – It contains the questions list to ask and if the response given to one question must be checked to be an integer.responses (
cell
) – It contains the responses set by default or as input by the user
- Returns
- argout1
(type) (dimension)
- argout2
(type) (dimension)