diff --git a/lib/obp60task/Create_new_pages.txt b/lib/obp60task/Create_new_pages.txt index 6bd0e86..5ad71fd 100644 --- a/lib/obp60task/Create_new_pages.txt +++ b/lib/obp60task/Create_new_pages.txt @@ -1,17 +1,6 @@ -git remote add upstream /url/to/original/repo -git fetch upstream -git checkout master -git reset --hard upstream/master -git push origin master --force - -https://github.com/norbert-walter/esp32-nmea2000-obp60 - - -cd /workspace/esp32-nmea2000-obp60 -bash /workspace/esp32-nmea2000-obp60/lib/obp60task/run - 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 +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 + diff --git a/lib/obp60task/gen_set.pl b/lib/obp60task/gen_set.pl index 35fb2db..a83bda2 100755 --- a/lib/obp60task/gen_set.pl +++ b/lib/obp60task/gen_set.pl @@ -1,13 +1,10 @@ #!/bin/perl -w -#A tool to generate that part of config.json that deals with pages and Fields. +#A tool to generate that part of config.json that deals with pages and fields. -use List::Util qw( min max ); - - -#List of all Pages and the number of parameters they expect. +#List of all pages and the number of parameters they expect. %NoOfFieldsPerPage=qw( ApparentWind 0 - Autobahn 0 + XTETrack 0 Battery2 0 Battery 0 BME280 0 @@ -28,14 +25,23 @@ WindRose 0 WindRoseFlex 6 ); -# No changes neede beyond this pint +# No changes needed beyond this point +#max number of pages supported by OBP60 $NoOfPages=10; +#Default selection for each page @Defaults=qw(Voltage WindRose OneValue TwoValues ThreeValues FourValues FourValues2 Clock RollPitch Battery2); @Numbers=qw(one two three four five six seven eight nine ten); @Pages=sort(keys(%NoOfFieldsPerPage)); -$MaxNoOfFieldsPerPage=max(values(%NoOfFieldsPerPage)); +$MaxNoOfFieldsPerPage=0; # inital value, gets updated with maximum entry from %NoOfFieldsPerPage +#find max. number of fields without additional modules + foreach (values(%NoOfFieldsPerPage)){ + if ($_ > $MaxNoOfFieldsPerPage){ + $MaxNoOfFieldsPerPage=$_; + } + } + for ($PageNo=1;$PageNo<=$NoOfPages;$PageNo++){ print "{\n"; print "\t","\"name\": \"page", $PageNo,"type\",\n"; @@ -59,7 +65,6 @@ for ($vp=$PageNo;$vp<=$NoOfPages;$vp++){ print '"{visiblePages":"',$vp,'"},'; } - #"visiblePages":"2"},{"visiblePages":"3"},{"visiblePages":"4"},{"visiblePages":"5"},{"visiblePages":"6"},{"visiblePages":"7"},{"visiblePages":"8"},{"visiblePages":"9"},{"visiblePages":"10"} print "\b",']',"\n"; print '},',"\n"; for ($FieldNo=1; $FieldNo<=$MaxNoOfFieldsPerPage;$FieldNo++){ @@ -78,12 +83,8 @@ if($NoOfFieldsPerPage{$page}>=$FieldNo){ print '{"page1type":"',$page,'"},'; } - - #{"page1type":"OneValue"},{"page1type":"TwoValues"},{"page1type":"ThreeValues"},{"page1type":"FourValues"},{"page1type":"FourValues2"},{"page1type":"WindRoseFlex"} } print "\b],\n"; print '},',"\n"; } } - - diff --git a/lib/obp60task/git_commands.txt b/lib/obp60task/git_commands.txt index ffda6ea..39d3fda 100644 --- a/lib/obp60task/git_commands.txt +++ b/lib/obp60task/git_commands.txt @@ -1,4 +1,12 @@ git status git fetch upstream git diff --name-status upstream/master -git checkout upstream/master platformio.ini \ No newline at end of file +git checkout upstream/master platformio.ini + +# how to reset my Repo to match norbert'status + +git remote add upstream https://github.com/norbert-walter/esp32-nmea2000-obp60 +git fetch upstream +git checkout master +git reset --hard upstream/master +git push origin master --force \ No newline at end of file diff --git a/lib/obp60task/howto_compile.txt b/lib/obp60task/howto_compile.txt new file mode 100644 index 0000000..a5d28ce --- /dev/null +++ b/lib/obp60task/howto_compile.txt @@ -0,0 +1,2 @@ +cd /workspace/esp32-nmea2000-obp60 +bash /workspace/esp32-nmea2000-obp60/lib/obp60task/run \ No newline at end of file