A simple iPhone app controlling a Wasatch Photonics SiG-785 Raman spectrometer.
- XCode 10.1 (Swift 4.2.1)
- jazzy (render docs)
On MacOS, install CocoaPod package manager using HomeBrew:
$ brew install cocoapods
To install pods used by SiGDemo, use:
$ git clone git@github.com:WasatchPhotonics/Wasatch.Swift.git
$ cd Wasatch.Swift
$ pod install
The current version of SwiftCharts seems to have a single line that needed changed...something about a bevel. Xcode knew how to fix it, but I had to use "Manage Schemes" to expose the SwiftCharts scheme for editing in Xcode, then a ⌘-B to build the framework and find the problematic line.
(Note that Jazzy installation seems to prefer gem over brew...YMMV.)
XCode note: make following patch in Chart.swift:
< lineLayer.lineJoin = kCALineJoinBevel
> lineLayer.lineJoin = CAShapeLayerLineJoin.bevel
I'm new to Xcode and Swift, so leaving some breadcrumbs. These were all useful in learning enough Swift to stand-up the demo:
- Bucky Tutorials
- Stanford Course
- Stack Views
- Zero to BLE
- Core Bluetooth
- Bluetooth SIG membership
- DataControllers and State
- Progress Rings
This is the BLE chip used for the initial SiG-BLE design:
These iPhone apps were also used as 3rd-party confirmation that BLE services were discoverable, and that characteristics could be read and written:
If you have jazzy
installed, just type this:
$ make docs
- support in-app dark correction
- add "desc" note field
- add fields to specify URL for cloud upload
- add SW "Raman" mode where laser is enabled prior to ACQUIRE, and disabled as soon as the first spectrum packet is received
- refresh BLE table on disconnect
- support compound matching / identification
- make BLE screen more like Settings
- two sections, "Connected" and "Available"
- add little blue checkmark by connected device
- change RSSI percentage to WiFi range icon
- Apple Watch (no real point until compound ID working)
- 2019-01-23 1.1.0
- moved to GitHub / MIT license
- 2019-01-21 1.0.2
- added responseRequired BLE setting (default off)
- 2019-01-21 1.0.1
- added timing metrics
- 2019-01-21 1.0.0
- added logical version number on Admin screen
- added AppSettings to persist uuid -> SN mapping
- 2019-01-08 0.7.15
- added iPhone device info to metadata
- tweaks for iPhone 8 Plus form-factor
- 2019-01-07 0.7.14
- added serialNumber and model to metadata
- add serialNumber to saved filenames
- wait one integration time before attempting to read newly commanded spectrum
- ignore (extrapolate) first/last 4 pixels on SiG spectra
- always disable laser on leaving scope view
- expanded Pair row somewhat to fully show UUID
- added aggregate-daily.py
- 2019-01-03 0.7.13
- enabled selectable x-axis unit in Scope mode
- 2019-01-03 0.7.12
- save Measurement in JSON
- add metadata and optional fields to CSV
- battery delegates are updated on ViewController appearance
- highlight connected unit on re-visiting Pair screen
- EEPROM strings cleaned up
- 2019-01-02 0.7.11
- updated logos
- 2018-12-27 0.7.10
- X-Axis UIPicker works (graph still hardcoded to pixels)
- initial values for integration time, gain set correctly
- battery works better
- added "Simulation" banner (breaks laser)
- fair bit of application testing
- 2018-12-27 0.7.9
- added partial spectral display for Scope
- added circular progress bar for EEPROM load
- 2018-12-27 0.7.8
- tested integration time, gain, laser enable
- 2018-12-27 0.7.7
- split-out EEPROMViewController from SettingsViewController
- 2018-12-26 0.7.6
- switch spectra to little-endian
- 2018-12-26 0.7.5
- restore EEPROM logging at connection
- 2018-12-26 0.7.4
- changed HTTP POST to HTTPS
- 2018-12-26 0.7.3
- added SiG battery icon
- 2018-12-24 0.7.2
- populated EEPROM fields in Settings page (untested)
- display battery charge level
- 2018-12-19 0.7.1
- EEPROM actually works
- 2018-12-19 0.7.0
- switched to prototype BLE ICD
- added EEPROM
- 2018-11-20 0.6.0
- save spectra to HTTP POST
- 2018-11-20 0.5.0
- first spectrum read from live spectrometer
- 2018-11-12 0.1.0
- initial storyboard stubs