c1_voltage:
3.5999
. . 3.588 . 3.576 . . 3.565 . 3.5 3.55 . . 3.6578 . . 3.7 . . 3.766 . . 3.8
My logic is: i have a set of values for c1_voltage which is in the following order mentioned above. It decreases from 3.5999 ,....3.56,...3.6 ,,,, then increases from 3.6 ,....3.7,......3.8
So when it starts decreasing from 3.599 till it reaches 3.6 and then increases to 3.8 , i want to calculate all the avg current samples corresponding to that c1_voltage.
Can some one help me in my code snippet with if statements for this decreasing - increasing - order.
--- code in PYTHON ---
Code snippet need to be modified in:
if 3.6 > val['c1_voltage'] <= 3.8:
# Channel 2
# - Start calculating the new_avg on c2_current (from the csv, look into every value on c2_current (i.e column 4) and correspondingly compare with that particular value on c1_voltage(column 2 of the csv))
if c2_calculating3638 == False:
c2_calculating3638 = True
c2_starttime3638 = float(tm)
c23638_num_of_samples = 0
new_sum_c2_current = 0
new_avg_c2_current = 0
else:
c23638_num_of_samples = c23638_num_of_samples + 1
new_sum_c2_current = new_sum_c2_current + val['c2_current']
else:
if c2_calculating3638 == True:
c2_calculating3638 = False
c2_endtime3638 = float(tm)
new_avg_c2_current = new_sum_c2_current / c23638_num_of_samples
if new_avg_c2_current > wifi_wake_current:
report(fulltime, tm, 'BUG on Wifi when 3.6 < VBAT <= 3.8V, new_avg_c2_current (%s) > wifi_wake_current (%s) on channel 2' % (str(new_avg_c2_current), str(wifi_wake_current)))
Aucun commentaire:
Enregistrer un commentaire