changed to db for fit streams
This commit is contained in:
@@ -87,12 +87,59 @@
|
||||
<!-- Single Activity Pane -->
|
||||
<div class="tab-pane fade" id="single-pane" role="tabpanel">
|
||||
<form id="singleForm" class="row g-3 align-items-end">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-4">
|
||||
<label for="activityId" class="form-label">Activity ID</label>
|
||||
<input type="number" class="form-control" id="activityId" placeholder="e.g. 12345" required>
|
||||
<div class="form-text">Enter the ID of the activity to slice into segments.</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-8">
|
||||
<!-- Submit Button moved below sliders? Or Keep here? -->
|
||||
<!-- Let's put parsing options in a card/accordion -->
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">Parsing Options</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="pauseLimit" class="form-label">Pause Threshold: <span
|
||||
id="pauseVal">10</span>s</label>
|
||||
<input type="range" class="form-range" id="pauseLimit" min="0" max="120"
|
||||
step="1" value="10"
|
||||
oninput="document.getElementById('pauseVal').textContent=this.value">
|
||||
<div class="form-text small">Split segment if stopped longer than this.</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="rdpEpsilon" class="form-label">Smoother (RDP): <span
|
||||
id="rdpVal">10</span>m</label>
|
||||
<input type="range" class="form-range" id="rdpEpsilon" min="1" max="50" step="1"
|
||||
value="10"
|
||||
oninput="document.getElementById('rdpVal').textContent=this.value">
|
||||
<div class="form-text small">Higher values simplify path more (ignores small
|
||||
wiggles).</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="turnAngle" class="form-label">Turn Threshold: <span
|
||||
id="turnVal">60</span>°</label>
|
||||
<input type="range" class="form-range" id="turnAngle" min="10" max="120"
|
||||
step="5" value="60"
|
||||
oninput="document.getElementById('turnVal').textContent=this.value">
|
||||
<div class="form-text small">Split segment if sharp turn detected.</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="minLength" class="form-label">Min Length: <span
|
||||
id="lenVal">100</span>m</label>
|
||||
<input type="range" class="form-range" id="minLength" min="50" max="1000"
|
||||
step="50" value="100"
|
||||
oninput="document.getElementById('lenVal').textContent=this.value">
|
||||
<div class="form-text small">Ignore segments shorter than this.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-3">
|
||||
<button type="submit" class="btn btn-primary w-100" id="singleSearchBtn">
|
||||
<span class="spinner-border spinner-border-sm d-none" role="status"
|
||||
aria-hidden="true"></span>
|
||||
@@ -327,7 +374,13 @@
|
||||
const response = await fetch('/api/discovery/single', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ activity_id: parseInt(actId) })
|
||||
body: JSON.stringify({
|
||||
activity_id: parseInt(actId),
|
||||
pause_threshold: parseFloat(document.getElementById('pauseLimit').value),
|
||||
rdp_epsilon: parseFloat(document.getElementById('rdpEpsilon').value),
|
||||
turn_threshold: parseFloat(document.getElementById('turnAngle').value),
|
||||
min_length: parseFloat(document.getElementById('minLength').value)
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) throw new Error('Single Analysis failed');
|
||||
@@ -444,16 +497,16 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const actId = urlParams.get('activity_id');
|
||||
|
||||
|
||||
if (actId) {
|
||||
// Switch to single tab
|
||||
const tabEl = document.getElementById('single-tab');
|
||||
const tab = new bootstrap.Tab(tabEl);
|
||||
tab.show();
|
||||
|
||||
|
||||
// Fill ID
|
||||
document.getElementById('activityId').value = actId;
|
||||
|
||||
|
||||
// Trigger search
|
||||
document.getElementById('singleSearchBtn').click();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user