Skip to content

Commit

Permalink
Revert "calculate the real ly value"
Browse files Browse the repository at this point in the history
This reverts commit 3122bc9.
  • Loading branch information
bgol committed Dec 23, 2014
1 parent 3122bc9 commit bb73a88
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions commands/nav_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ def run(results, cmdenv, tdb):
maxLy=maxLyPer,
)

totalLy, dirLy = 0.00, 0.00
lastHop, totalLy, dirLy = None, 0.00, 0.00
route.reverse()
for hop in route:
jumpLy = math.sqrt(hop.distToSq(distances[hop][1])) if distances[hop][1] else 0.00
jumpLy = (distances[hop][0] - distances[lastHop][0]) if lastHop else 0.00
totalLy += jumpLy
if cmdenv.detail:
totalLy = math.sqrt(srcSystem.distToSq(hop))
dirLy = math.sqrt(dstSystem.distToSq(hop))
row = ResultRow(
action='Via',
Expand All @@ -155,6 +155,7 @@ def run(results, cmdenv, tdb):
dirLy=dirLy,
)
results.rows.append(row)
lastHop = hop
results.rows[0].action='Depart'
results.rows[-1].action='Arrive'

Expand Down Expand Up @@ -182,7 +183,7 @@ def render(results, cmdenv, tdb):
rowFmt.addColumn("JumpLy", '>', '7', '.2f',
key=lambda row: row.jumpLy)
if cmdenv.detail:
rowFmt.addColumn("Stations", '>', 2,
rowFmt.addColumn("Stations", '>', 2,
key=lambda row: len(row.system.stations))
if cmdenv.detail:
rowFmt.addColumn("DistLy", '>', '7', '.2f',
Expand Down

0 comments on commit bb73a88

Please sign in to comment.