called from svelte sprinter-data : directory list of all books for a project.
At the bottom, there is a button to add a book.
sprinter data : {}
sprinter is the data from 1 sprinter book.
Key built from project name and project code (first 4 digits): projects/{project}/{projectCode}-sprinter-data-{fw_ptNo1}.json
to list the projects use s3cmd ls s3://cb-survey/projects/
Loops Data Page
page at /loops aggregate all measures for a project.
contains one or several loops.
each loop has a summary and a report, showing distance, elevation, error, grades.
each line (leg) is a loop-item, stationId and checkbox are editable.
a blank stationId should be understood as an invalid leg.
onMount calls get-loops-data with project name.
edit row allows to edit stationId
Method: get_loops_data
method: get-loops_data parameter: projectName.
first: get list of books (called jobs so far - to be fixed).
jobNo is a counter incremented for each book.
get data (legs) for each book, and set leg.jobNo to jobNo.
return concatenate all legs for each book.
Export CSV
EXPERIMENTAL
export 2 files: the loop data for a project in json format, and in CSV format.
initiated in component loop-report.svelte
problem is (june 28) : checkboxes changes not updated in sdata.
checkbox change done in loop-item
Loop Item active checkbox
bind:checked={row.active}
on:change={checkbox_onChange.bind(row)}
checkbox_onChange → sdata_timeStamp.set(new Date()) reactive
→ fire autorun@19 in loops.svelte because sdata_timeStamp is a global variable (router.js)
autorun@19 does a resync_loop, and update loops_data global (router.js)
export_csv should directly use that global variable (reactive)
too many reactive variables, need cleaning.
Error detection
done by the client when importing a book.
detect_double_reading will deactivate wrong readings.
a leg will be deactivated if part of a group of almost identical distance,
and not the last one of the group. In other words we keep only the last reading of a group.
another case will be when the reading has no stationId.
ATTENTION detect_double_reading is defined twice: sprinter-data-edit.svelte
and sprinter-panel-svelte.
This should be done also in rsync : autorun@19
OMG: call the function with option {auto:true} SHOULD BE THE DEFAULT.
popup: edit loop item
Modal3_editRow
autorun@47 listen to $editRow_data
then editRow_openModal copy the row into _editRow
editRow_apply will update and close the popup
editRow_apply is a global reactive variable.
activation popup is done in loop-item: editRow_data.set(row)
any click holding ALt key.
split loop at fix points
Alt key + click on ptNo.
This is like setting a FIX point.
How to revert that decision : click again (toggle)