mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Fixed position of leg values
This commit is contained in:
1 parent
93a8ff9f92
commit
706e29ca54
2 files changed
+11
-7
No files matched your search
@@ -321,7 +321,7 @@ def liveRaceInformation(configurator):
|
||||
# check for cases where calculations from backend yield
|
||||
# strange numbers - this happens in cases where the competitor
|
||||
# has no speed during mark passing
|
||||
if k in ['Infinity', 'Infinite']:
|
||||
if k in ['Infinity', 'Infinite'] or float(k) > 150000.0:
|
||||
|
||||
# use a magic number (that is very unlikely to occur)
|
||||
# to indicate that competitor has no speed
|
||||
|
||||
@@ -572,14 +572,18 @@ def moderatorLiveData(context, request):
|
||||
|
||||
markranks[racecounter] = markranks[racecounter] + competitor.marks[real_racepos]
|
||||
|
||||
# prepare values according to UI
|
||||
# UI: RANK, DSTTRAV, SPEED, VMG, SGAP, DSTGO, ETA
|
||||
# INTERN: RANK, AVGSPEED, DSTRV, VMG, AVMG, SGAP, ETA, DSTGO
|
||||
iv = competitor.values[real_racepos]
|
||||
newvalues = [iv[0], iv[2], iv[1], iv[3], iv[5], iv[-1], iv[-2]]
|
||||
|
||||
for valpos in range(len(newvalues)):
|
||||
newvalues[valpos] = ['%.2f' % val for val in newvalues[valpos]]
|
||||
newvalues = iv
|
||||
for valpos in range(len(iv)):
|
||||
nv = ['%.2f' % (val < 15000 and val or 0.0) for val in newvalues[valpos]]
|
||||
|
||||
# prepare values according to UI
|
||||
# UI: RANK, DSTTRAV, SPEED, VMG, SGAP, DSTGO, ETA
|
||||
# INTERN: RANK, AVGSPEED, DSTRV, VMG, AVMG, SGAP, ETA, DSTGO
|
||||
if nv:
|
||||
nv = [nv[0], nv[2], nv[1], nv[3], nv[5], nv[-1], nv[-2]]
|
||||
newvalues[valpos] = nv
|
||||
|
||||
legvalues[racecounter] = legvalues[racecounter] + newvalues
|
||||
|
||||
|
||||
Reference in new issue
Block a user