Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!f_MODE_SETTING){
- /*urin mode*/
- if(((accumulateWT - past_weight[past_weight_cnt]) > 100) && g_weight==0){
- g_weight = (accumulateWT - past_weight[past_weight_cnt]);
- }
- if(!f_UrinWeight_Set){
- /*urin bag weight 45g*/
- if(past_weight[past_weight_cnt] < 5 && (accumulateWT - past_weight[past_weight_cnt]) > 35 && past_weight_cnt <5){
- past_weight_buff_clr();
- g_weight = (accumulateWT - past_weight[past_weight_cnt]);
- f_UrinWeight_Set=SET;
- }
- }
- /*in 1hour*/
- if(!f_AFTER_1_HOUR){
- if(past_weight_cnt>2 && (accumulateWT-g_weight)>0){
- //weightPerHour= (accumulateWT*360)/past_weight_cnt;
- //181217 weightPerHour =(accumulateWT-g_weight)* 10;
- //181217 weightPerHour *=36;
- //181217 weightPerHour/=past_weight_cnt;
- weightPerHour =(accumulateWT-g_weight);
- }
- else weightPerHour = 0;
- if(past_weight_cnt >= 359)f_AFTER_1_HOUR = SET;
- }
- /*after 1 hour*/
- else{
- if(accumulateWT >=past_weight[past_weight_cnt])weightPerHour = accumulateWT-g_weight-past_weight[past_weight_cnt];
- else weightPerHour=past_weight[past_weight_cnt]-accumulateWT;
- }
- /* past weight save */
- if((accumulateWT > g_weight))past_weight[past_weight_cnt]=accumulateWT-g_weight;
- else past_weight[past_weight_cnt]=0;
- /* count++ */
- if(past_weight[past_weight_cnt] > 1000) tmp=100;
- else if(past_weight[past_weight_cnt] >500) tmp=50;
- else if(past_weight[past_weight_cnt] >100) tmp=30;
- else if(past_weight[past_weight_cnt] >50) tmp=10;
- else tmp=5;
- if(accumulateWT < (past_weight[past_weight_cnt]-tmp)) NOP(); /* Reduced weight */
- else{
- if(past_weight_cnt >= 359)past_weight_cnt = 0;
- else past_weight_cnt++;
- }
- }
- else{ //ringer mode
- if(past_weight_cnt ==0){
- if(ul_loadcelldata_pastvalue <= ul_loadcelldata){
- weightPerHour = 0;
- ul_loadcelldata_pastvalue = ul_loadcelldata;
- }
- else{
- if((ul_loadcel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement