[med-svn] [Git][med-team/nutsqlite][upstream] New upstream version 2.0.6

Iain Learmonth gitlab at salsa.debian.org
Tue Sep 15 19:20:33 BST 2020



Iain Learmonth pushed to branch upstream at Debian Med / nutsqlite


Commits:
886a33a0 by Iain R. Learmonth at 2019-01-07T11:25:05+00:00
New upstream version 2.0.6
- - - - -


10 changed files:

- CHANGES
- bigNUT/1sequence.sqlite3
- + bigNUT/gelatin.sqlite3
- bigNUT/load.sqlite3
- + bigNUT/oil.sqlite3
- bigNUT/sequence.sqlite3
- bigNUT/user.sqlite3
- nut.1
- nutdoc.html
- updateNUT.tcl


Changes:

=====================================
CHANGES
=====================================
@@ -1,3 +1,17 @@
+2018-08-31 NUTsqlite-2.0.6 released.
+
+2018-08-31 Glycine dv_default moved down to 5 gm.  Also, bigNUT and GUI do not
+           agree on what's right in weightlog mini-app for 'cutting'.  Decided
+           to go with GUI, which means whenever both fat mass and lean mass
+           gains are positive, lower calories by 20.
+
+2018-08-07 NUTsqlite-2.0.5 released.
+
+2018-08-07 Glycine and Retinol are nutrients that I personally want to control
+           so I added them to the list of Daily Value nutrients in the GUI but
+           neglected to supply a dv default, so there is an error message if
+           you try to use them from the GUI.
+
 2018-06-22 NUTsqlite-2.0.4 released.
 
 2018-06-22 Found a bug in RecipeDone.  100 gram weight record was wrong.


=====================================
bigNUT/1sequence.sqlite3
=====================================
@@ -31,4 +31,20 @@ create temp view z_mn as
 insert into currentmeal select NDB_No, Gm_Wgt, NutrDesc from theusual where meal_name = (select mn from z_mn);
 drop view z_mn;
 
+/*
+  This file implements a gimmick whereby however much gelatin is required to meet the
+  glycine dv has its protein added to the protein dv
+*/
+
+update nutr_def set nutopt = 90.0 + (select nutr_val from nut_in_meals where ndb_no = 19177 and nutrdesc = 'Protein') where nutrdesc = 'Protein';
+
+/*
+ redestribute oil/fat foods in keto meal
+*/
+
+insert into currentmeal values (4047, null, null);
+insert into currentmeal values (4584, null, null);
+insert into currentmeal select ndb_no, case when ndb_no = 4584 then 0.9 else 0.0 end * gm_wgt * third / fat, null from (with first as (select m.ndb_no, gm_wgt, gm_wgt * nutr_val / 100.0 as fat from mealfoods m join nut_data n on m.ndb_no = n.ndb_no and n.nutr_no = 204 where meal_id = (select currentmeal from options) and m.ndb_no in (1145, 4047, 4584)) select *, (select sum(fat) / 3.0 from first) as third from first) where ndb_no in (4047, 4584);
+delete from mealfoods where gm_wgt = 0.0 and ndb_no in (4047, 4584) and meal_id = (select currentmeal from options);
+
 commit;


=====================================
bigNUT/gelatin.sqlite3
=====================================
@@ -0,0 +1,6 @@
+/*
+  This file implements a gimmick whereby however much gelatin is required to meet the
+  glycine dv has its protein added to the protein dv
+*/
+
+update nutr_def set nutopt = 90.0 + (select nutr_val from nut_in_meals where ndb_no = 19177 and nutrdesc = 'Protein') where nutrdesc = 'Protein';


=====================================
bigNUT/load.sqlite3
=====================================
@@ -459,7 +459,7 @@ create table if not exists mealfoods(meal_id int, NDB_No int, Gm_Wgt real, Nutr_
 
 create table if not exists archive_mealfoods(meal_id int, NDB_No int, Gm_Wgt real, meals_per_day integer, primary key(meal_id desc, NDB_No asc, meals_per_day));
 
-/* Table of customary meals which also has has Nutr_No for specification of
+/* Table of customary meals which also has a Nutr_No for specification of
    PCF or automatic portion control.  We call it z_tu so we can define a
    "theusual" view later to better control user interaction.
 */


=====================================
bigNUT/oil.sqlite3
=====================================
@@ -0,0 +1,8 @@
+/*
+ redestribute oil/fat foods in keto meal
+*/
+
+insert into currentmeal values (4047, null, null);
+insert into currentmeal values (4584, null, null);
+insert into currentmeal select ndb_no, case when ndb_no = 4584 then 0.9 else 0.0 end * gm_wgt * third / fat, null from (with first as (select m.ndb_no, gm_wgt, gm_wgt * nutr_val / 100.0 as fat from mealfoods m join nut_data n on m.ndb_no = n.ndb_no and n.nutr_no = 204 where meal_id = (select currentmeal from options) and m.ndb_no in (1145, 4047, 4584)) select *, (select sum(fat) / 3.0 from first) as third from first) where ndb_no in (4047, 4584);
+delete from mealfoods where gm_wgt = 0.0 and ndb_no in (4047, 4584) and meal_id = (select currentmeal from options);


=====================================
bigNUT/sequence.sqlite3
=====================================
@@ -26,9 +26,25 @@ create temp view z_mn as
  with meal (m, mod2) as (
   select options.currentmeal % 100, maxmeal % 2 from options, am_analysis_header
   )
- select case when mod2 = 0 then case when m = 1 then 'Z Breakfast' when m = 2 then 'Z Dinner' else 'Z Supper' end else case when m = 1 then 'Z Breakfast' when m = 2 then 'Z Dinner' else 'Z Supper' end end as mn, m from meal;
+ select case when mod2 = 0 then case when m = 1 then 'K Breakfast' when m = 2 then 'K Dinner' else 'K Supper' end else case when m = 1 then 'K Breakfast' when m = 2 then 'K Dinner' else 'K Supper' end end as mn, m from meal;
 
 insert into currentmeal select NDB_No, Gm_Wgt, NutrDesc from theusual where meal_name = (select mn from z_mn);
 drop view z_mn;
 
+/*
+  This file implements a gimmick whereby however much gelatin is required to meet the
+  glycine dv has its protein added to the protein dv
+*/
+
+update nutr_def set nutopt = 90.0 + (select nutr_val from nut_in_meals where ndb_no = 19177 and nutrdesc = 'Protein') where nutrdesc = 'Protein';
+
+/*
+ redestribute oil/fat foods in keto meal
+*/
+
+insert into currentmeal values (4047, null, null);
+insert into currentmeal values (4584, null, null);
+insert into currentmeal select ndb_no, case when ndb_no = 4584 then 0.9 else 0.0 end * gm_wgt * third / fat, null from (with first as (select m.ndb_no, gm_wgt, gm_wgt * nutr_val / 100.0 as fat from mealfoods m join nut_data n on m.ndb_no = n.ndb_no and n.nutr_no = 204 where meal_id = (select currentmeal from options) and m.ndb_no in (1145, 4047, 4584)) select *, (select sum(fat) / 3.0 from first) as third from first) where ndb_no in (4047, 4584);
+delete from mealfoods where gm_wgt = 0.0 and ndb_no in (4047, 4584) and meal_id = (select currentmeal from options);
+
 commit;


=====================================
bigNUT/user.sqlite3
=====================================
@@ -333,9 +333,10 @@ end;
   We always add a new entry to get a head start on the next cycle, but in this
   case we save the last y-intercepts as the new start.  We also make an
   adjustment to calories:  up 20 calories if both lean mass and fat mass are
-  going down, or down 20 calories if they were both going up and lean mass is
-  going up less than fat mass is.  If fat was going up and and lean was going 
-  down we make no adjustment because, well, we just don't know!
+  going down, or down 20 calories if they were both going up.
+
+  If fat was going up and and lean was going down we make no adjustment because,
+  well, we just don't know!
 */
 
 drop table if exists wlsave;
@@ -343,7 +344,7 @@ create temp table wlsave (weight real, fat real, wldate integer, span integer, t
 
 drop trigger if exists autocal_cutting;
 create temp trigger autocal_cutting after insert on z_wl
-when (select autocal = 2 and weightn > 1 and fatslope > 0.0 and (weightslope - fatslope) > 0.0 and (weightslope - fatslope) < fatslope from z_wslope, z_fslope, options)
+when (select autocal = 2 and weightn > 1 and fatslope > 0.0 and (weightslope - fatslope) > 0.0 from z_wslope, z_fslope, options)
 begin
 delete from wlsave;
 insert into wlsave select weightyintercept, fatyintercept, wldate, span, today from z_wslope, z_fslope, z_span, (select min(wldate) as wldate from z_wl where
@@ -419,7 +420,7 @@ create temp view food_cost_total as select sum(cost) as cost from food_cost;
 */
 
 drop view if exists max_chick;
-CREATE temp VIEW max_chick as with data (ndb_no, shrt_desc, pamount, famount, msre_desc) as (select f.NDB_No, Shrt_Desc, round((select dv / 3.0 - 15.5 from am_dv where nutr_no = 203) / p.Nutr_Val * 100 / origGm_Wgt * Amount * 8) / 8.0, round((select dv / 3.0 - 17.39 from am_dv where nutr_no = 204) / fat.Nutr_Val * 100 / origGm_Wgt * Amount * 8) / 8.0, Msre_Desc from food_des f join nut_data p on f.ndb_no = p.ndb_no and p.nutr_no = 203 join nut_data fat on f.ndb_no = fat.ndb_no and fat.nutr_no = 204 natural join weight where f.NDB_No in (select ndb_no from food_des where ndb_no > 99000 and Shrt_Desc like '%chick%mic%' union select 5088) and Seq = (select min(Seq) from weight where weight.NDB_No = f.NDB_No)) select ndb_no, shrt_desc, case when pamount <= famount then pamount else famount end, msre_desc from data;
+CREATE temp VIEW max_chick as with data (ndb_no, shrt_desc, pamount, famount, msre_desc) as (select f.NDB_No, Shrt_Desc, round((select dv / 3.0 - 15.0 from am_dv where nutr_no = 203) / p.Nutr_Val * 100 / origGm_Wgt * Amount * 8) / 8.0, round((select dv / 3.0 - 17.39 from am_dv where nutr_no = 204) / fat.Nutr_Val * 100 / origGm_Wgt * Amount * 8) / 8.0, Msre_Desc from food_des f join nut_data p on f.ndb_no = p.ndb_no and p.nutr_no = 203 join nut_data fat on f.ndb_no = fat.ndb_no and fat.nutr_no = 204 natural join weight where f.NDB_No in (select ndb_no from food_des where ndb_no > 99000 and Shrt_Desc like '%chick%mic%' union select 5088) and Seq = (select min(Seq) from weight where weight.NDB_No = f.NDB_No)) select ndb_no, shrt_desc, case when pamount <= famount then pamount else famount end, msre_desc from data;
 
 /*
   View showing daily macros and body composition index


=====================================
nut.1
=====================================
@@ -373,7 +373,7 @@ lean mass and loss of fat mass. A cycle begins when there are two weight/bodyfat
 will move calories by a maximum of 20 calories a day. 
 If both lean mass and fat mass are trending down, 
 .B NUT 
-raises calories and starts a new cycle; if both lean mass and fat mass are trending up and fat mass is increasing faster than lean mass,
+raises calories and starts a new cycle; if both lean mass and fat mass are trending up,
 .B NUT
 lowers calories and starts a new cycle.  When fat mass is trending up and lean mass is trending
 down, 


=====================================
nutdoc.html
=====================================
@@ -456,7 +456,7 @@ will move calories by a maximum of 20 calories a day.
 If both lean mass and fat mass are trending down, 
 <B>NUT </B>
 
-raises calories and starts a new cycle; if both lean mass and fat mass are trending up and fat mass is increasing faster than lean mass,
+raises calories and starts a new cycle; if both lean mass and fat mass are trending up,
 <B>NUT</B>
 
 lowers calories and starts a new cycle.  When fat mass is trending up and lean mass is trending


=====================================
updateNUT.tcl
=====================================
@@ -6275,7 +6275,7 @@ update tnutr_def set NutrDesc = 'Fluoride' where Nutr_No = 313;
 update tnutr_def set NutrDesc = 'Manganese' where Nutr_No = 315;
 update tnutr_def set NutrDesc = 'Selenium' where Nutr_No = 317;
 update tnutr_def set NutrDesc = 'Vit. A, IU' where Nutr_No = 318;
-update tnutr_def set NutrDesc = 'Retinol' where Nutr_No = 319;
+update tnutr_def set NutrDesc = 'Retinol', dv_default = 900.0 where Nutr_No = 319;
 update tnutr_def set NutrDesc = 'Vitamin A' where Nutr_No = 320;
 update tnutr_def set NutrDesc = 'B-Carotene' where Nutr_No = 321;
 update tnutr_def set NutrDesc = 'A-Carotene' where Nutr_No = 322;
@@ -6325,7 +6325,7 @@ update tnutr_def set NutrDesc = 'Histidine' where Nutr_No = 512;
 update tnutr_def set NutrDesc = 'Alanine' where Nutr_No = 513;
 update tnutr_def set NutrDesc = 'Aspartic acid' where Nutr_No = 514;
 update tnutr_def set NutrDesc = 'Glutamic acid' where Nutr_No = 515;
-update tnutr_def set NutrDesc = 'Glycine' where Nutr_No = 516;
+update tnutr_def set NutrDesc = 'Glycine', dv_default = 5.0 where Nutr_No = 516;
 update tnutr_def set NutrDesc = 'Proline' where Nutr_No = 517;
 update tnutr_def set NutrDesc = 'Serine' where Nutr_No = 518;
 update tnutr_def set NutrDesc = 'Hydroxyproline' where Nutr_No = 521;
@@ -6596,7 +6596,7 @@ dbmem eval {commit}
 }
 
 db eval {BEGIN}
-db eval {insert or ignore into z_tcl_version values(null, 'NUTsqlite 2.0.4', NULL)}
+db eval {insert or ignore into z_tcl_version values(null, 'NUTsqlite 2.0.6', NULL)}
 db eval {delete from z_tcl_code}
 db eval {insert or replace into z_tcl_code values('Main',$Main)}
 db eval {insert or replace into z_tcl_code values('Make_GUI_WinMac',$Make_GUI_WinMac)}



View it on GitLab: https://salsa.debian.org/med-team/nutsqlite/-/commit/886a33a0905835e0dd829dca0aef83f939448180

-- 
View it on GitLab: https://salsa.debian.org/med-team/nutsqlite/-/commit/886a33a0905835e0dd829dca0aef83f939448180
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200915/1363a9f7/attachment-0001.html>


More information about the debian-med-commit mailing list