Project Structure
Last updated
Last updated
This page describes how the code is laid out and also provides links to concepts as needed.
Code is laid out in (the directories starting with a +
denote a package in MATLAB).
The bulk of the code is in : it is .
is used to neatly start up the GUI in a user-friendly way.
The main gui is structured in a similar way to a layout:
The "model", , handles the underlying logic and is independent of the GUI as possible. This class is sometimes referred to at the in the documentation, is it is the interface used to integrate the photostimulation into custom behavior code.
The "view", , builds the UI elements of the GUI itself and contains no logic. It was built using and must never be edited by hand.
The "controller", , is a class that zapit.gui.main.view
and so when it is instantiated (i.e. created at the command line or in start_zapit
) the GUI appears. The controller
class is what provides the logic to make the GUI run: it defines , , etc. The controller
is a composite class, since it has a model
that contains an instance of zapit.pointer
this enables the controller
to interact with the model. For example, to initiate the galvo calibration routine or to present stimuli.
The class implements the bulk of the logic and does the heavy lifting.
In most classes contain some, meaning that changes to the values of those properties will drive a to run via a . For example, the experimentPath
property in is observable. The method in creates a listener that watches for changes the experiment path property. These can be made via the GUI or at the command line (hZP.experimentPath='\some\path'
). When changes are made, the updateExperimentPathTextArea
method of zapit.gui.main.controller
is run to update the text of the path in a text area box found in the GUI Calibrate Scanners tab.