Private
Public Access
1
0

working with go

This commit is contained in:
Sander Roosendaal
2019-12-19 20:53:06 +01:00
parent 921e58eef7
commit a06792553a
2 changed files with 36 additions and 30 deletions

View File

@@ -1523,7 +1523,6 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
if 'go_service' in kwargs:
goservice = kwargs['go_service']
print('Setting goservice to ', goservice)
else:
goservice = False
@@ -1541,7 +1540,6 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
csvfile = f1+'.gz'
csvfile = os.path.abspath(csvfile)
print('csvfile ',csvfile)
# do something with boat type
try:
@@ -1594,38 +1592,42 @@ def handle_otwsetpower(self,f1, boattype, weightvalue,
secret = secret,
silent = False,
),timeout=600)
return response.result
result = response.result
if result == 0:
# send failure email
return 0
else:
boatfile = {
'1x': 'static/rigging/1x.txt',
'2x': 'static/rigging/2x.txt',
'2-': 'static/rigging/2-.txt',
'4x': 'static/rigging/4x.txt',
'4-': 'static/rigging/4-.txt',
'8+': 'static/rigging/8+.txt',
}
try:
rg = rowingdata.getrigging(boatfile[boattype])
except KeyError:
rg = rowingdata.getrigging('static/rigging/1x.txt')
# determine cache file name
physics_cache = 'media/'+str(boattype)+'_'+str(int(weightvalue))
boatfile = {
'1x': 'static/rigging/1x.txt',
'2x': 'static/rigging/2x.txt',
'2-': 'static/rigging/2-.txt',
'4x': 'static/rigging/4x.txt',
'4-': 'static/rigging/4-.txt',
'8+': 'static/rigging/8+.txt',
}
try:
rg = rowingdata.getrigging(boatfile[boattype])
except KeyError:
rg = rowingdata.getrigging('static/rigging/1x.txt')
rowdata.otw_setpower(skiprows=5, mc=weightvalue, rg=rg,
powermeasured=powermeasured,
progressurl=progressurl,
secret=secret,
silent=True,
usetable=usetable,storetable=physics_cache,
)
# determine cache file name
physics_cache = 'media/'+str(boattype)+'_'+str(int(weightvalue))
# save data
rowdata.write_csv(f1, gzip=True)
rowdata.otw_setpower(skiprows=5, mc=weightvalue, rg=rg,
powermeasured=powermeasured,
progressurl=progressurl,
secret=secret,
silent=True,
usetable=usetable,storetable=physics_cache,
)
# save data
rowdata.write_csv(f1, gzip=True)
# continuing for both
update_strokedata(workoutid, rowdata.df, debug=debug)
totaltime = rowdata.df['TimeStamp (sec)'].max(