Closed jywarren closed 3 years ago
Hi @jywarren, I wanted to know your thoughts on using rear camera for live capture feed instead of the front camera on mobile devices. Since, I think with rear camera it is easier for the users to align the spectral data while seeing the full un-obstructed preview on their screens. Or better if we give users the option to switch between front and rear camera perspectives. 🤔
It's very true - camera direction selection is critical! I believe this can be achieved with the new capture code and I've made a brief note of it here: https://github.com/publiclab/spectral-workbench.js/issues/190
There are links to camera configuration settings there; my understanding is that if we configure it correctly we'll get rear camera as default. I think the ability to 'switch' cameras might possibly be a distinct issue. Feel free to create and/or expand issues on these! Thanks a lot!
This is essentially complete, due to great work by @waridrox!!!
There are some follow-ups. Let's move to https://github.com/publiclab/spectral-workbench/issues/645 for them.
Copying in info from https://github.com/publiclab/plots2/issues/9257 !
Our newly revamped and tested library at spectral-workbench.js was designed to work both on its own (https://github.com/publiclab/spectral-workbench.js/) or as a JavaScript component in a larger system, the spectralworkbench.org Rails application. Work on the standalone library is nearly complete and this project will take on the integration of the newly revamped and re-organized code into the parent Rails application, following a pattern shown at https://github.com/publiclab/inline-markdown-editor for housing a JS project within a Rails project. Parts of this project are already included for displaying saved and graphed data at pages like https://spectralworkbench.org/spectrums/205427 (see integration at https://github.com/publiclab/spectral-workbench/blob/98dbde7a881788f7bd48db59eee616d6de70054b/app/views/spectrums/show2.html.erb#L22-L29), but the new code will replace the live capture interface at https://spectralworkbench.org/capture/, and will need to be able to access the following server-side resources and routes:
The current JavaScript code at https://spectralworkbench.org/capture performs all of this, and should be saved at https://spectralworkbench.org/capture/legacy, while the new code should be launched first at https://spectralworkbench.org/capture/new and compared for feature parity with the legacy version before any legacy systems are move or modified. The project will also require some Rails full-stack system tests to confirm functionality in the new UI.
And some clarifying comments here as well:
/app/views/spectrums/show2.html.erb
- so for this,/app/views/capture/index2.html.erb
perhaps? That way we don't risk the current working version while trying to integrate the new one.The Rails app should manage all user data! We should be able to "build in" the JS functionality for the capture interface similarly for how we did for the spectrum display interface, with the Rails app managing all the stateful back-end and database and even data management, and a pretty minimal "handoff" of new data from the capture interface to the "host" Rails app. See how the original JS code from long ago managed both saving new spectra (using an HTML form on the page to submit) and fetching calibration data: https://github.com/publiclab/spectral-workbench/blob/main/app/assets/javascripts/capture.js#L356-L385 You can see where the server responds to these requests on the server side in this controller: https://github.com/publiclab/spectral-workbench/blob/main/app/controllers/capture_controller.rb
Much of the new capture interface at https://publiclab.github.io/spectral-workbench.js/examples/new-capture/ is already written, but there may need to be some new code adapted from the previous version for:
This is still a pretty substantial project but it's nowhere near a rewrite of the capture interface itself! I hope this is helpful!
This is quite a large project and would have to be broken up into smaller parts. It would also involve coding in both this repository as well as https://github.com/publiclab/spectral-workbench/
Thank you!!!