Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. if(!f_MODE_SETTING){
  2. /*urin mode*/
  3. if(((accumulateWT - past_weight[past_weight_cnt]) > 100) && g_weight==0){
  4. g_weight = (accumulateWT - past_weight[past_weight_cnt]);
  5. }
  6. if(!f_UrinWeight_Set){
  7. /*urin bag weight 45g*/
  8. if(past_weight[past_weight_cnt] < 5 && (accumulateWT - past_weight[past_weight_cnt]) > 35 && past_weight_cnt <5){
  9. past_weight_buff_clr();
  10. g_weight = (accumulateWT - past_weight[past_weight_cnt]);
  11.  
  12. f_UrinWeight_Set=SET;
  13. }
  14. }
  15. /*in 1hour*/
  16. if(!f_AFTER_1_HOUR){
  17. if(past_weight_cnt>2 && (accumulateWT-g_weight)>0){
  18. //weightPerHour= (accumulateWT*360)/past_weight_cnt;
  19. //181217 weightPerHour =(accumulateWT-g_weight)* 10;
  20. //181217 weightPerHour *=36;
  21. //181217 weightPerHour/=past_weight_cnt;
  22. weightPerHour =(accumulateWT-g_weight);
  23. }
  24. else weightPerHour = 0;
  25. if(past_weight_cnt >= 359)f_AFTER_1_HOUR = SET;
  26.  
  27.  
  28. }
  29. /*after 1 hour*/
  30. else{
  31. if(accumulateWT >=past_weight[past_weight_cnt])weightPerHour = accumulateWT-g_weight-past_weight[past_weight_cnt];
  32. else weightPerHour=past_weight[past_weight_cnt]-accumulateWT;
  33. }
  34.  
  35. /* past weight save */
  36. if((accumulateWT > g_weight))past_weight[past_weight_cnt]=accumulateWT-g_weight;
  37. else past_weight[past_weight_cnt]=0;
  38.  
  39.  
  40.  
  41. /* count++ */
  42. if(past_weight[past_weight_cnt] > 1000) tmp=100;
  43. else if(past_weight[past_weight_cnt] >500) tmp=50;
  44. else if(past_weight[past_weight_cnt] >100) tmp=30;
  45. else if(past_weight[past_weight_cnt] >50) tmp=10;
  46. else tmp=5;
  47.  
  48.  
  49. if(accumulateWT < (past_weight[past_weight_cnt]-tmp)) NOP(); /* Reduced weight */
  50. else{
  51. if(past_weight_cnt >= 359)past_weight_cnt = 0;
  52. else past_weight_cnt++;
  53. }
  54. }
  55.  
  56. else{ //ringer mode
  57. if(past_weight_cnt ==0){
  58. if(ul_loadcelldata_pastvalue <= ul_loadcelldata){
  59. weightPerHour = 0;
  60. ul_loadcelldata_pastvalue = ul_loadcelldata;
  61. }
  62. else{
  63. if((ul_loadcel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement