dm-station-gui
==============
One of the methods to manage processes in the APS Data Management System is the 
application **dm-station-gui**.  This application is a PyQt application which gives 
access to add/modify/control items such as experiments, file transfer to storage
location ('daq' and 'uploads'), workflows and processing jobs.  An example of 
this application is shown in the figure below.

.. image:: images/dm-station-gui-experiments.png
    :scale: 50 %

Experiments
-----------
**dm-station-gui** opens showing a tab that lists experiments which have been added 
to the DM System.  At the beamline, these experiments generally will correspond
to an accepted proposal in the APS Proposal system.  Experiments in the DM 
System define an entity that ties sets of managed data together.  When an 
experiment is selected by double clicking or by clicking and then clicking the
*Use Selected* button, the contents of the Experiment tab changes to give 
details about that experiment.  Much of this information is pulled from the 
proposal/ESAF databases.  This is shown in the image below.

.. image:: images/dm-station-gui-experiments-detail.png
    :scale: 50 %

This view of the data enable a couple of key features of the DM System.  The 
ability to associate files with the Management system, and the ability to set 
which users have access to the system and therefore which data they can access.
Selecting users that will have access to experiment data is done by clicking the
*Modify Users* button below the user list and then selecting users in the right 
list & pressing the arrow button between the lists to add users or selecting
users from the left list and clicking the arrow button to delete users from the
list.  Click the _Save_ button at the bottom to accept the changes and go back 
to the Experiment detail or click *Back* button in the upper left to exit back 
to Experiment detail without saving.  This view is shown below.

.. image:: images/dm-station-gui-experiments-user-management.png
    :scale: 50 %

Getting Files into Data Management
----------------------------------
The overall purpose of this system is to get data into the system and providing 
access control to that data.  This means linking the data files to the users in
an experiment.  For each beam station there is storage location defined for that 
station.  On the **Experiments** tab there are a couple of items relevant to 
getting the data onto that storage location.  These items are shown in the image
below.  Files transferred onto the storage location will go into:
*STORAGE_LOCATION/(storage_root_path)/(experiment_name)*.  Files to go into this 
directory are specified in the entry "Data Directory or Single File Path".  Note
that if the data directory is specified, only the files will go into the 
storage location, not a new subdirectory with the transferred files.  Any 
subdirectories will be copied as will the contents.

Once the the storage location and source are defined the transfer can be started
in one of two ways:
- A monitor can be placed on the directory and any new files/subdirectories in the directory will be transferred if you select *Start DAQ*
- A one time copy will happen and all files/subdirectories currently in the directry will be copied if you select *Start Upload*

When a tranfer is started, the display will switch to either the **DAQs** or 
**Uploads** tab.  The tab will show the status of all transfers that have been 
started since the last restart of the system.  Status of a particular transfer is
shown by color 
- green: Done success
- yellow: running
- red: Done with an errors

An example of this is shown below.

.. image:: images/dm-station-gui-uploads.png
    :scale: 50 %

Clicking on a particular transfer, on **DAQs** or **Uploads** will switch the 
view to show detail of that transfer including errors.  

.. image:: images/dm-station-gui-uploads-detail.png
    :scale: 50 %