User Tools

Site Tools


en:software:matlab:ta:dev:gui-appdata

Storing and managing data inside the GUI

<note important>The following data model is still in its development, although by now it is rather additions than severe restructurings taking place.</note>

Structure

  • data - cell-Array
    Saves datasets (spectra) together with its' informations
    See below for the details of the data structure
  • origdata - cell-Array
    Saves datasets (spectra) together with its' informations
    • “original data” in sense of as they got loaded from their files
    • helpful/necessary for an undo function (still to be developed)
  • configuration - struct
    Saves the current configuration settings1)
    • display - struct
      • highlight - struct
        • method - string (color, linewidth, marker, style, none)
          How to highlight the current spectrum in the main axes
        • value - string/scalar/vector (depending on the value of “method”)
  • control - struct
    Saves informations important for the current operation of the GUI, such as the currently active spectrum
    • spectra - struct, informations about currently loaded spectra
      • activeSpectrum - integer, reference to data
      • visible - vector, holds the positions of the visible spectra in the cell array data
      • invisible - see above with “visible”
      • modified - see above with “visible”; reference to the spectra that got modified after they were laoded into the GUI2)
      • missing - see above with “visible”, reference to the spectra that have missing parameters immediately after the load that are important for later operations
    • measure - struct
      • point
      • x1val
      • y1val
      • x1ind
      • y1ind
    • axis - struct
      Informations for the axis handle (display of spectra)
      • displayType - string, 2D, B0, t
      • MFEdisplay - string
        display mode for MFE data
        values: “MFoff”/“MFoff+MFon”/“MFoff+MFon+DeltaMF”/“MFon”/“DeltaMF”
      • grid - struct
        • x - string, {“major”,“minor”,“off”}
        • y - string, {“major”,“minor”,“off”}
        • zero - struct
          • visible - boolean
          • color - 1×3 vector
          • width - scalar
          • style - string
      • legend - struct
        • handle - scalar
        • location - string
        • box - boolean
        • FontName - string
        • FontWeight - string
        • FontAngle - string
        • FontSize - scalar
      • highlight - struct
        • method
        • value
      • labels - struct
        • x
          • measure
          • unit
        • y
          • measure
          • unit
        • z
          • measure
          • unit
      • limits - struct
        • auto - boolean
        • x
          • min
          • max
        • y
          • min
          • max
        • z
          • min
          • max
      • normalisation - string
      • stdev - boolean
      • onlyActive - boolean
    • status - cell array
      Status messages since starting the GUI
      • Gets displayed in the “status” window of the GUI (TAgui_statuswindow)
    • dirs - struct
      • lastLoad - string
        Directory data have been loaded from last time
      • lastSave - string
      • lastFigSave - string
      • lastExport - string
    • system - struct
      • username - string
      • platform - string
      • matlab - string
      • TA - string

Data Structure (data)

  • Cell array containing all data.
  • All aspects important for the GUI (visible, modified) are controlled via the control structure.

The actual TA Toolbox data format is documented elsewhere. Here, only the additional fields are documented that are added when loading data into the GUI.

  • history - cell array
    History of modifications of a dataset. Every step is documented in a struct that contains (at least) of the following fields:
    • date - datestr(now,31) (time stamp including seconds)3)
    • method - string
      Name of the Matlab™ function (e.g. TAACC)4)
    • system - struct
      Informations about the system used
      • username - string
        Account name of the user having performed the operation
      • platform - string
        Platform the operation was performed on
    • parameters - struct
      Parameters of the operation performed
    • info - cell array of strings
      Additional informations in textual form, e.g. reprot of the ACC function
  • line - struct
    Line style settings
    • color - string oder vector, default: 'k'
    • style - string, default: '-'
    • marker - string, default: 'none'
    • width - scalar, default: 1
  • display - struct
    Values of the sliders etcetera
    • position - struct
      Position in the 2D dataset
      • x - scalar, default: 1
      • y - scalar, default: 1
    • displacement - struct
      displacement in x, y, and z
      • x - scalar, default: 0
      • y - scalar, default: 0
      • z - scalar, default: 0
    • scaling - struct
      Scaling in x, y, and z
      • x - scalar, default: 1
      • y - scalar, default: 1
      • z - scalar, default: 1
    • smoothing - struct
      Smoothing in x and y
      • x - struct
        • value - scalar, default: 1
        • filterfun - string
      • y - struct
        • value - scalar, default: 1
        • filterfun - string
    • measure - struct
      Details about the measurement (measurement of points/distances inside the GUI)
      • point - array of structs
        Index and unit of the x and y values of each point
        • index - vector
          x- and y value of the measured point as index
        • unit - vector
          x- and y value of the measured point in units
    • MFon - struct (OPTIONAL)
      Display of the data with applied magnetic field
      • line - struct
        Line style settings
        • color - string oder vector, default: 'k'
        • style - string, default: '-'
        • marker - string, default: 'none'
        • width - scalar, default: 1
    • DeltaMF - struct (OPTIONAL)
      Display of the difference spectra MFon-MFoff
      • line - struct
        Line style settings
        • color - string oder vector, default: 'k'
        • style - string, default: '-'
        • marker - string, default: 'none'
        • width - scalar, default: 1
1)
The same parameters may be found again in the “control” field. The difference is that in “configure” you find the configuration (and therefore default) settings (as they got read from the config file), whereas “control” holds the actual values currently in use.
2)
If this is not empty, the GUI should ask the user before closing whether she/he wants to save the modifications.
3)
A time step that is accurate to a second should be sufficient, as such a time stamp is only valid for one operation on one dataset.
4)
To keep it simple, gets determined by the function mfilename.
en/software/matlab/ta/dev/gui-appdata.txt · Last modified: 2020/09/30 21:35 by 127.0.0.1