Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Check every value against Ocean Insight's protocol documentation for the model a

## If you have an instrument but do not write code

Open Spektra, press **Connect HDX** and select your instrument. If it is not supported yet, Spektra shows a
Open Spektra, press **Connect** and select your instrument. If it is not supported yet, Spektra shows a
report and an **Open a GitHub issue** button that fills in the issue for you; you can read everything before
submitting. If your instrument opens as *experimental*, please report whether spectra, wavelengths and
exposure look right. Someone with the hardware is needed to verify a profile anyway.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Application: <https://berameric.github.io/spektra/> · Version 2.0.0 ([changelog
## Getting started

1. Open <https://berameric.github.io/spektra/> in Google Chrome or Microsoft Edge.
2. Connect the HDX and press **Connect HDX**; select the instrument in the browser's device dialog.
2. Connect the HDX and press **Connect**; select the instrument in the browser's device dialog.
3. Press **Live** for continuous acquisition or **Acquire** for a single spectrum.

On first start, Spektra checks the operating system and browser and lists any preparation still required
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
<div class="conn" id="conn">
<span class="led" id="led"></span><span id="devInfo">No device</span>
<span class="sim-badge" id="simBadge" hidden title="Development mode (?mock): a simulated HDX replaces the USB device">SIMULATED</span>
<button class="conn-x" id="disconnectBtn" hidden title="Disconnect the HDX" aria-label="Disconnect the HDX"><svg class="i"><use href="#i-unplug"/></svg></button>
<button class="conn-x" id="disconnectBtn" hidden title="Disconnect the spectrometer" aria-label="Disconnect the spectrometer"><svg class="i"><use href="#i-unplug"/></svg></button>
</div>
<button id="connectBtn" class="btn primary"><svg class="i ico"><use href="#i-plug"/></svg><span class="spin" aria-hidden="true"></span><span id="connectText">Connect<span class="lbl"> HDX</span></span></button>
<button id="connectBtn" class="btn primary"><svg class="i ico"><use href="#i-plug"/></svg><span class="spin" aria-hidden="true"></span><span id="connectText">Connect</span></button>
</div>

<div class="bar-zone bar-center" role="group" aria-label="Measurement">
Expand Down Expand Up @@ -147,7 +147,7 @@
<div id="plot" class="plot"></div>
<div class="overview" id="overview" hidden><canvas id="ovCanvas" title="Drag the window to move the view"></canvas></div>
<div class="plot-empty" id="plotEmpty">
<p class="empty-note" id="emptyNote" hidden><b>No spectrum yet</b>Connect the HDX, then press Live or Acquire.</p>
<p class="empty-note" id="emptyNote" hidden><b>No spectrum yet</b>Connect the spectrometer, then press Live or Acquire.</p>
<div class="guide" id="guide">
<div class="guide-head">
<b>Getting started</b>
Expand All @@ -156,7 +156,7 @@
<ol id="guideSteps">
<li data-step="connect">
<span class="gs-mark"><svg class="i"><use href="#i-check"/></svg></span>
<span class="gs-text">Connect the HDX<small id="guideConnectText">Plug it in over USB and choose it in the browser’s dialog.</small></span>
<span class="gs-text">Connect the spectrometer<small id="guideConnectText">Plug it in over USB and choose it in the browser’s dialog.</small></span>
<button class="btn small" data-act="connect">Connect</button>
</li>
<li data-step="dark">
Expand Down
4 changes: 2 additions & 2 deletions src/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function exportSpectrum() {
if (!S.frame) return;
const { wl, inten } = S.frame;
const { offset, factor } = energySpectrum(wl, inten);
const lines = metaHeader("Spektra — HDX spectrum", [
const lines = metaHeader("Spektra — spectrum", [
"# intensity: counts per pixel",
`# intensity_per_mev: Jacobian conversion (intensity - ${offset.toFixed(1)} offset) / pixel width in meV, i.e. I(lambda)*lambda^2/hc`,
]);
Expand Down Expand Up @@ -80,7 +80,7 @@ export function exportPlotPng() {
export function exportPeaks() {
if (!S.frame || !S.peaks.length) return;
const range = S.sel ? `${S.sel.lo.toFixed(3)}-${S.sel.hi.toFixed(3)} nm` : "whole spectrum";
const lines = metaHeader("Spektra — HDX detected peaks", [
const lines = metaHeader("Spektra — detected peaks", [
`# search_range: ${range}`,
perMev()
? "# measured_on: energy axis, Jacobian-converted (height in counts/meV, area in counts)"
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Spektra, browser software for the Ocean Insight HDX: live uPlot spectrum, nm/eV axis, range selection and peak detection.
// Spektra, browser software for Ocean Insight spectrometers (verified on the HDX): live uPlot spectrum, nm/eV axis, range selection and peak detection.
// Entry point: connects the page controls to the modules and starts the app.

import { acquireOnce, applyIntegration, clearDark, connect, takeDark, toggleLive, watchDevice } from "./acquisition.js";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function updateUi() {
// Opening the device can take a few seconds (longer on phones): say so on the button itself
const connecting = S.busy && !c;
$("connectBtn").classList.toggle("busy", connecting);
$("connectText").innerHTML = connecting ? "Connecting…" : 'Connect<span class="lbl"> HDX</span>';
$("connectText").innerHTML = connecting ? "Connecting…" : "Connect";
$("disconnectBtn").hidden = !c;
$("conn").classList.toggle("on", c);
$("led").className = `led${c ? " on" : ""}${S.live ? " live" : ""}`;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/diag.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function draw(canvas, series) {
let report = null;

async function run() {
if (!S.dev) { toast("Connect the HDX first", "bad", 3000, "diag"); return; }
if (!S.dev) { toast("Connect the spectrometer first", "bad", 3000, "diag"); return; }
if (S.live || S.busy) { toast("Stop Live first", "bad", 3000, "diag"); return; }
S.busy = true;
$("diagRun").disabled = true;
Expand Down
22 changes: 11 additions & 11 deletions src/ui/environment.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Start-up system check: detects the OS and browser and explains what is still needed to reach the HDX.
// Start-up system check: detects the OS and browser and explains what is still needed to reach the spectrometer.

import { MOCK, STORE_ENV } from "../config.js";
import { usbSupported } from "../device/index.js";
Expand All @@ -18,7 +18,7 @@ function detectPlatform() {
return { os, browser };
}

/** What this computer and browser still need before the HDX can be used. */
/** What this computer and browser still need before the spectrometer can be used. */
function environmentNotes({ os, browser }) {
const notes = [];
if (os === "iOS") {
Expand All @@ -44,25 +44,25 @@ function environmentNotes({ os, browser }) {
if (os === "Android" && usbSupported()) {
notes.push({
level: "setup", title: "Android: connect over USB OTG",
html: "<p>Connect the HDX (on its own power supply) with a USB-C (OTG) adapter or cable, "
+ "and hold the phone sideways.</p>",
html: "<p>Connect the spectrometer with a USB-C (OTG) adapter or cable, and hold the phone sideways. "
+ "The HDX runs on its own power supply.</p>",
});
}
if (os === "Windows") {
notes.push({
level: "setup", title: "Windows: install the WinUSB driver once",
html: "<ol><li>Plug in the HDX and run <a href=\"https://zadig.akeo.ie\" target=\"_blank\" rel=\"noopener\">Zadig</a> (no installation needed).</li>"
+ "<li>Choose <i>Options → List All Devices</i> and select the HDX (USB ID <code>2457</code> <code>2003</code>).</li>"
html: "<ol><li>Plug in the spectrometer and run <a href=\"https://zadig.akeo.ie\" target=\"_blank\" rel=\"noopener\">Zadig</a> (no installation needed).</li>"
+ "<li>Choose <i>Options → List All Devices</i> and select the spectrometer (USB ID <code>2457</code> and its product ID, <code>2003</code> for the HDX).</li>"
+ "<li>Select <b>WinUSB</b> as the driver and press <i>Replace Driver</i> or <i>Install Driver</i>.</li></ol>"
+ "<p>Needed once per computer. Afterwards OceanView no longer sees the HDX until its driver is restored in Device Manager.</p>",
+ "<p>Needed once per computer. Afterwards OceanView no longer sees the spectrometer until its driver is restored in Device Manager.</p>",
});
}
if (os === "Linux") {
notes.push({
level: "setup", title: "Linux: allow USB access once",
html: "<p>Create <code>/etc/udev/rules.d/99-ocean-hdx.rules</code> with:</p>"
+ "<pre>SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2457\", ATTR{idProduct}==\"2003\", MODE=\"0666\"</pre>"
+ "<p>then run <code>sudo udevadm control --reload-rules &amp;&amp; sudo udevadm trigger</code> and replug the HDX.</p>",
+ "<p>then run <code>sudo udevadm control --reload-rules &amp;&amp; sudo udevadm trigger</code> and replug the spectrometer. For a model other than the HDX, use its product ID or leave <code>ATTR{idProduct}</code> out.</p>",
});
}
return notes;
Expand All @@ -78,10 +78,10 @@ export function checkEnvironment(force = false) {
$("envSystem").textContent = `${env.browser} on ${env.os}`;
$("envList").innerHTML = notes.length
? notes.map((n) => `<li class="env-${n.level}"><h4>${n.title}</h4>${n.html}</li>`).join("")
: "<li class=\"env-ready\"><h4>Ready</h4><p>This browser supports WebUSB and this system needs no driver. Plug in the HDX and press Connect.</p></li>";
$("envTitle").textContent = blocking ? "This browser cannot connect to the HDX" : notes.length ? "Before you connect" : "System check";
: "<li class=\"env-ready\"><h4>Ready</h4><p>This browser supports WebUSB and this system needs no driver. Plug in the spectrometer and press Connect.</p></li>";
$("envTitle").textContent = blocking ? "This browser cannot connect to the spectrometer" : notes.length ? "Before you connect" : "System check";
$("envHideRow").hidden = blocking || !notes.length;
// A browser that cannot reach the HDX at all: the notice stays until the page is opened elsewhere
// A browser that cannot reach the spectrometer at all: the notice stays until the page is opened elsewhere
$("envDlg").dataset.blocking = blocking ? "1" : "";
$("envActions").hidden = blocking;
$("envDlg").showModal();
Expand Down
Loading