NeuroPAL_ID Dialog System

Back to overview

GUI Controller

class Program.GUI.dialogues

DIALOGUES This class is in charge of coordinating progress dialogues within NeuroPAL_ID and across wrapped python scripts.

Glossary: - Task: This describes an active operation as represented in the

progress dialogue. Use this for any task that features several steps. The dialogues class supports multiple nested tasks. If you add a task while there is no active progress dialogue, one will be created.

  • Step: This describes a step within a tasks and are best used

    within iterative loops. Adding any task or step will clear the last step, and if you add a step while no progress dialogue is active, we do not create one.

  • Level filler: The progress dialogue system implemented through

    the dialogues class supports nesting, meaning that child tasks and steps are displayed as nested underneath their parent tasks. Throughout this class, we use “level filler” to describe the string that represents this nesting visually in the progress dialogue. Basically, if, while performing Task A, you start Task B, the progress dialogue would display as such:

    Task A └🢒 Task B

    If you then add Another Task C underneath Task B, and then add a step D, it will display as such:

    Task A ├🢒 Task B ├─🢒 Task C └──🢒 { Step D }

    Here, Task B has no level filler, while Task C’s level filler is ─ and Step D’s level filler is ──.

Property Summary
identifiers
patterns

Text patterns used for sprintf() calls. The first %s describes the nesting level of the given task/step, and the second %s describes the task/step itself.

Method Summary
static active(input)

ACTIVE This function returns of the active dialogue if one exists.

Inputs: - input: A handle referencing a uiprogressdlg instance.

Outputs: - obj: An active uiprogressdlg object. Empty if no progress

dialogue is active.

static add_task(label)

ADD_TASK This function adds a new task to the progress dialogue.

Inputs: - label: String/char representing text describing the task.

This is what will appear in the progress dialogue.

Outputs: - handle: A handle referencing the active progress

dialogue.

static cache(input)
static choice(message, choices)
static create(mode, varargin)

CREATE This function creates a new dialogue with the passed parameters.

Inputs: - mode: String/char describing the type of dialogue to be

created. We currently only support “progress”.

  • varargin: A variable-size cell array representing

    key/value input arguments to be parsed by an inputParser object.

static resolve()

RESOLVE This function completes the last task/step passed to the progress dialogue.

static set_value(new_value)

SET_VALUE This function updates the value of the active progress dialogue.

Inputs: - new_value: Non-negative numerical value to which the

progress dialogue’s “Value” property will be updated.

static step(label)

STEP This function adds a new step to the progress dialogue.

Inputs: - label: String/char representing text describing the step.

This is what will appear in the progress dialogue.

Outputs: - handle: A handle referencing the active progress

dialogue.

static switch_to(mode, options)
static update_message(addl, template)

UPDATE_MESSAGE This function updates the active progress dialogue with a passed task or step. If no progress dialogue is active, this function calls the create() function instead.

Inputs: - addl: String/char to be added to the progress dialogue. - template: String/char specifying whether this is a task

or a step.

Outputs: - handle: Reference to the active progress dialogue.