This package is intended to be used to read and write data from the OGP to a local database. The package is divided into two parts:
- CLI tool for automatic upload of data from the OGP to the local database.
- GUI to read data from the local database to the OGP
In Python 3.6 or greater on the OGP computer:
pip install git+https://github.com/cmu-hgc-mac/HGC_OGP_DB.git@template_based
Then run in terminal
uploadOGPresults
If run for the first time, this prompts user to enter a secure folder/directory to create a configuration file containing information about database connection and OGP survey results. Modify the configuration file to include the correct information.
Running this command after will automatically postprocess and upload the OGP survey results to the database.
cd read-write-ogp
python3 file_selector.py
This GUI contains two tabs: 'View Plots' and 'Upload Files'.
- View plots shows plots data from the OGP. (TBD: Change limit on number of files)
- Upload Files lets the user upload .XLS output files containing OGP meaurements to the local db.
- The watch directory must contain the following subdirectories for the GUI to work:
- baseplates
- hexaboards
- protomodules
- modules
- The OGP inspection files must be configured to write to these locations by default type.
- The .XLS files must be saved with the ID of the component and will be used as the part ID in the db.
- The watch directory must contain the following subdirectories for the GUI to work:
file_selector.py
runs the GUI instance- Code for reading/writing from local db are in
postgres_tools/upload_inspect.py
. - The 'Upload Files' tab calls
process_im.py
to process data by module type. - The processing itself happens in
ogp_height_plotter.py
to process data by module type.
(To ber combined with file_selector GUI)
cd read-write-ogp
python3 auto_upload.py
Install postgreSQL-15 with pgAdmin4 on your computers. Make sure you add psql
to your path.