Skip to content

Commit

Permalink
Make Mark Step button immediately start next step; Start in Step 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hobinjk-ptc committed Apr 4, 2024
1 parent f7f38ce commit 6eda915
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
7 changes: 0 additions & 7 deletions tools/spatialAnalytics/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ img {
margin-top: calc(50% - 19px);
}

.iconBackground.start {
border-color: green;
}
.iconBackground.end {
border-color: red;
}

.markStepIcon.pressed {
filter: brightness(0.5);
}
Expand Down
22 changes: 8 additions & 14 deletions tools/spatialAnalytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ recordingIcon.addEventListener('pointerup', function() {
case RecordingState.empty:
setRecordingState(RecordingState.recording);
startTime = Date.now();
regionCardStartTime = startTime;
spatialInterface.analyticsSetDisplayRegion({
recordingState,
startTime,
Expand Down Expand Up @@ -157,20 +158,13 @@ markStepIcon.addEventListener('pointerup', function() {
if (recordingState !== RecordingState.recording) {
return;
}
if (regionCardStartTime > 0) {
let regionCardEndTime = Date.now();
appendRegionCard({
startTime: regionCardStartTime,
endTime: regionCardEndTime,
});
regionCardStartTime = -1;
markStepIcon.parentNode.classList.remove('end');
markStepIcon.parentNode.classList.add('start');
} else {
regionCardStartTime = Date.now();
markStepIcon.parentNode.classList.remove('start');
markStepIcon.parentNode.classList.add('end');
}
let regionCardEndTime = Date.now();
appendRegionCard({
startTime: regionCardStartTime,
endTime: regionCardEndTime,
});
// Immediately start next regionCard
regionCardStartTime = regionCardEndTime;
});

let lastSetDisplayRegion = {};
Expand Down

0 comments on commit 6eda915

Please sign in to comment.