Saving and restoring client state

There are several ways to recall desired states of MWClient. MWorks has the ability to:

  • Save variable sets into .xml files.
  • Save and restore client plugin windows between sessions.
  • Save entire client configuration to a .json file called a “workspace.” This includes server connection, experiment file, variable set, and client plugin window configurations.

Variable sets

Variable sets are .xml files that contain variable-assignment instructions for MWorks.

After saving, a variable set file will include every variable which has an attribute of persistent=1. The persistent attribute is generated (and set to 1) when the box “Retain on Save Variables” is checked, or can be added manually to the variable element in the .xml file. Variables without the persistent attribute or with persistent=0 will not be saved. The parameters of the eye calibrator window, which are private, are automatically saved.

When a variable set is loaded, it sets each variable listed in the .xml file to the saved value. If a variable listed in the variable set no longer exists in the experiment file, MWorks will generate an error.

Variable sets are located in ~/MWorks/Experiment Storage/, and can be created and/or modified in a text editor.

Restoring plugin windows from a past session

This option can be found in the MWClient menu under “Preferences…”. After closing and reopening MWClient, any plugin windows that were open when it was closed will be reopened in the same positions. There is also an option for the client to connect to the last server.

Workspaces

To create a workspace, first set everything up the way you want (connected server, loaded experiment, loaded variable set, client window state). Then, in the MWClient “File” menu, select “Save Workspace…”.

To load an existing workspace, open the client, then select “File → Open Workspace…”.

Workspaces can be saved wherever a user chooses, and like variable sets, can be created and/or modified in a text editor.