SENAITE can be configured to automatically import results files generated by instruments at regular intervals of time, without human intervention. For instance, let’s say you want to automatically import the results generated by Agilent MassHunter, for which there is already an import interface for quantitative reuslts available in SENAITE.
Configure the results path
Choose the instrument from the instruments list (or create a new one):
- Click to the top right gear-icon
- Choose “Instruments”
- Click to the instrument of choice
Two sections are displayed at the bottom of the edit view: “Import Data Interface” and “Results file folders”.
As soon as you select the import data interface to use, a new row for the selected interface will be displayed below the “Results files folders” section:
For the selected interface, type the full path where Senaite should look for files at regular intervals of time and press “Save”
Import results from configured paths
If you type http://localhost:8080/senaite/auto_import_results in your browser, Senaite will try to import new results files (not yet imported) from inside the specified folder. This auto import will be logged automatically in “Import > Auto Import Instrument Results” view:
Configure Senaite to automatically import results
To tell Senaite to automatically call the method auto_import_results
at regular intervals of time, a clock must be added to the buildout.cfg
file:
zope-conf-additional =
<clock-server>
method /senaite/auto_import_results
period 3600
user admin
password secret
host localhost:8080
</clock-server>
In this example, the method “/senaite/auto_import_results” will be called once per hour (3600 seconds). Further info about clocks here: https://docs.plone.org/develop/plone/misc/asyncronoustasks.html
Stop the instance, run bin/buildout
and start the instance again.
Each time the system founds a new result file will try to import and log the action in “Import > Auto Import Instrument Results”.