WasatchPhotonics / Wasatch.Swift

Demonstration application for controlling Wasatch Photonics BLE spectrometers from iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scope Mode

Overview

A simple iPhone app controlling a Wasatch Photonics SiG-785 Raman spectrometer.

Building

Dependencies

  • XCode 10.1 (Swift 4.2.1)
  • jazzy (render docs)

CocoaPods

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.)

Charting

XCode note: make following patch in Chart.swift:

< lineLayer.lineJoin = kCALineJoinBevel
> lineLayer.lineJoin = CAShapeLayerLineJoin.bevel

References

I'm new to Xcode and Swift, so leaving some breadcrumbs. These were all useful in learning enough Swift to stand-up the demo:

This is the BLE chip used for the initial SiG-BLE design:

Testing

These iPhone apps were also used as 3rd-party confirmation that BLE services were discoverable, and that characteristics could be read and written:

Rendered Documentation

If you have jazzy installed, just type this:

$ make docs

Backlog

Version 1.0

  • 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

Version 2.0

  • 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

Version 3.0

  • Apple Watch (no real point until compound ID working)

Version History

  • 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

Pairing

About

Demonstration application for controlling Wasatch Photonics BLE spectrometers from iOS

License:MIT License


Languages

Language:Swift 94.0%Language:Python 5.9%Language:Makefile 0.1%Language:Ruby 0.1%