Service and manager for updating the HLM Database with PV data from the Helium Recovery PLC (Omron FINS).
This repository contains the HLM PV Import Service and the Service Manager. For information regarding both, please check the HLM PV Import Wiki.
- HLM PV Import Wiki
- HLM GAM Database - the gas management database in which PV values are being imported as object measurements
- Helium Recovery PLC - FINS PLC - used for monitoring various parameters related to the helium gas recovery system
- HLM Project Sharepoint - project management docs and other useful info
- HLM View - data display website repo
- Jenkins Build - automated testing
- Download the code and pip install requirements.
- Run
pyinstaller HlmManager.spec
andpyinstaller HlmService.spec
inside the project root. Both the manager and service should now be bundled, and the .exe files located in\dist
. - Either copy the service
settings.ini
andpv_config.json
from HLM Settings, Config and HLM DB.zip to the same directory asHlmService.exe
, or runHlmManager\HlmManager.exe
and select the directory path ofHlmService.exe
when prompted, which should create the default PV configuration and service settings files. HlmService.exe install
via terminal with admin rights, or put service_setup.zip in the same directory and run it (does the same thing).- Run the manager with admin rights for full functionality.
- Check out the Service Setup & Manager Manual.
Notes:
- When builing, update the
B_DATE
(andVER
, if done any changes) inServiceManager\constants.py
. - Do not forget to set up the database. The schema creation script can be found in
\\isis\inst$\Kits$\CompGroup\Helium Level Meters\For Review
. When first starting the HLM PV Import manager, configure the "DB Connection" settings. The DB user & password are saved in the windows registry as parameters of the service. - If it helps with setting-up (to check configuration/settings files/registry etc.), the service is currently running on the server machine, you can check the files there.
- The Helium Recovery PLC must also be set up and running on the machine: Notes on NDAHEMON static build setup
The service directory should look like this:
.
├── logs
│ └── ...
├── HlmService.exe
├── pv_config.json
├── settings.ini
├── service_setup.bat* (optional)
The manager can be placed anywhere, as long as it is given the correct service directory path. The service requires the settings.ini
and pv_config.json
files. The service_setup.bat
is optional; logs will be created once the service has run.
To test the manager or the service in an IDE (as it's easier to make changes), run \HlmManager.py
for manager, and \HLM_PV_Import\__main__.py
for service.
Note that for running the service script directly from the IDE, the PV config and settings.ini will need to be added to the project root.
Depending on the user, the manager's settings and logs may differ (as they are saved in <user>\AppData\Local\HLM Service Manager
).
To check the test coverge you first need to install coverge pip install coverage
and then ensure that you can run from command line. This poses an issue with the service mains imports, this can be resolved by editing the virtual environments activate.ps1
to contain the following in the deactivate function.
# The prior PYTHONPATH:
if (Test-Path -Path Env:_OLD_PYTHON_PATH){
Copy-Item -Path Env:_OLD_PYTHON_PATH -Destination env:PYTHONPATH
Remove-Item -Path Env:_OLD_PYTHON_PATH
}elseif(Test-Path -Path Env:NOPYTHONPATH){
Remove-Item -Path Env:PYTHONPATH
Remove-Item -Path Env:NOPYTHONPATH
}
And the following to the end of the file.
# Add the venv to the PYTHONPATH
if (Test-Path env:PYTHONPATH) {
copy-item env:PYTHONPATH env:_OLD_PYTHON_PATH
}else {
$env:NOPYTHONPATH = "NOPATH"
}
$env:PYTHONPATH = "$(Resolve-Path "$env:VIRTUAL_ENV\..");$env:PYTHONPATH"
Once this is the case it should be possible to run python .\HLM_PV_Import\__main__.py
if this is working correctly coverege should now work properly on the tests.
hlm_manual_system_tests_v1.0.0.xlsx (feel free to add to this as you run your own tests)