Skip to content

Commit

Permalink
Merge pull request #139 from TobiasE-github/master
Browse files Browse the repository at this point in the history
Add SixValues and fix Fluid in gen_set.py
  • Loading branch information
norbert-walter authored Jan 18, 2025
2 parents 49be7f1 + 27b02c4 commit 2c2d215
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 116 deletions.
2 changes: 1 addition & 1 deletion lib/obp60task/Create_new_pages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Craete new page for OBP60
1. Create page under /lib/obp60task/PageXXXX.cpp
2. Set page name in PageXXXX.cpp on file name
3. Register new page in /lib/obp60task/obp60task.cpp line 242 (registerAllPages)
4. Add new page in /lib/obp60task/config.json for each page type or add new page to gen_set.pl and run it to auto-generate the relevant section of config.json
4. Add new page in /lib/obp60task/config.json for each page type or add new page to gen_set.py and run it to auto-generate the relevant section of config.json

112 changes: 0 additions & 112 deletions lib/obp60task/gen_set.pl

This file was deleted.

13 changes: 10 additions & 3 deletions lib/obp60task/gen_set.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#!/usr/bin/env python3
# A tool to generate that part of config.json that deals with pages and fields.
#
#Usage: 1. modify this script (e.g.add a page, change number of fields, etc.)
# 2. Delete all lines from config.json from the curly backet before "name": "page1type" to o the end of the file (as of today, delete from line 917 to the end of the File)
# 3. run ./gen_set.py >> config.json

import json

# List of all pages and the number of parameters they expect.
no_of_fields_per_page = {
"ApparentWind": 0,
"Wind": 0,
"XTETrack": 0,
"Battery2": 0,
"Battery": 0,
"BME280": 0,
"Clock": 0,
"DST810": 0,
"Fluid": 0,
"Fluid": 1,
"FourValues2": 4,
"FourValues": 4,
"Generator": 0,
Expand All @@ -27,6 +31,7 @@
"White": 0,
"WindRose": 0,
"WindRoseFlex": 6,
"SixValues" : 6,
}

# No changes needed beyond this point
Expand Down Expand Up @@ -119,5 +124,7 @@

json_output = json.dumps(output, indent=4)
# print omitting first and last line containing [ ] of JSON array
print(json_output[1:-1])
#print(json_output[1:-1])
# print omitting first line containing [ of JSON array
print(json_output[1:])
# print(",")

0 comments on commit 2c2d215

Please sign in to comment.