Skip to content

Commit

Permalink
#523 Chronice fix second loss
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Mar 27, 2024
1 parent 1923fe5 commit 0c23bad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion private/api/chronice.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def chronice(body, target, fromFormat, time):
def sclk2lmst(sclk, target):
if target == 'msl':
s = sclk.split('/')[1].split(':')
return f'SOL-{s[0]}M{s[1]}:{s[2]}:{s[3]}'
seconds = str(round(float(s[3] + '.' + s[4]))).zfill(2)
return f'SOL-{s[0]}M{s[1]}:{s[2]}:{seconds}'
def lmst2sclk(lmst, target, partition = 1):
if target == 'msl':
s = lmst.replace(' ', ':').replace('-', ':').replace('M', ':').split(':')
Expand Down
7 changes: 6 additions & 1 deletion src/essence/Tools/Shade/ShadeTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ let ShadeTool = {
},
sunColor: '#d2db58',
earthColor: '#58dbb8',
_lastConvertedMs: '000',
initialize: function () {
this.vars = L_.getToolVars('shade')

Expand Down Expand Up @@ -859,7 +860,10 @@ let ShadeTool = {
body: body,
target: options.observer,
from: 'utc',
time: TimeControl.getEndTime(),
time: TimeControl.getEndTime().replace(
'.000Z',
`.${ShadeTool._lastConvertedMs}Z`
),
},
function (s) {
try {
Expand Down Expand Up @@ -943,6 +947,7 @@ let ShadeTool = {
'black'
)
} else {
ShadeTool._lastConvertedMs = s.result.split('.')[1] || '000'
TimeControl.setTime(
TimeControl.getStartTime(),
s.result.replace(' ', 'T') + 'Z'
Expand Down

0 comments on commit 0c23bad

Please sign in to comment.