From c4dc63dbfd41e328efd1d129ad14b1560081cd2a Mon Sep 17 00:00:00 2001 From: bparks13 Date: Wed, 5 Nov 2025 13:40:43 -0500 Subject: [PATCH 1/4] Add input ranges for channels - Neuropixels channels are left as the default so they can be automatically or manually scaled --- Source/Devices/AnalogIO.cpp | 6 +++++- Source/Devices/Bno055.cpp | 34 ++++++++++++++++++++++++++------ Source/Devices/DigitalIO.cpp | 10 ++++++++-- Source/Devices/HarpSyncInput.cpp | 6 +++++- Source/Devices/MemoryMonitor.cpp | 6 +++++- Source/Devices/Neuropixels1e.cpp | 9 +++++++-- Source/Devices/Neuropixels1f.cpp | 8 ++++++-- Source/Devices/Neuropixels2e.cpp | 4 +++- Source/Devices/PolledBno055.cpp | 33 +++++++++++++++++++++++++------ Source/OnixDevice.h | 28 +++++++++++++++++++++++++- Source/OnixSource.cpp | 1 + 11 files changed, 122 insertions(+), 23 deletions(-) diff --git a/Source/Devices/AnalogIO.cpp b/Source/Devices/AnalogIO.cpp index 5c0cc0d..3d28db7 100644 --- a/Source/Devices/AnalogIO.cpp +++ b/Source/Devices/AnalogIO.cpp @@ -27,6 +27,8 @@ using namespace OnixSourcePlugin; AnalogIO::AnalogIO (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr oni_ctx) : OnixDevice (name, hubName, AnalogIO::getDeviceType(), deviceIdx_, oni_ctx) { + const ContinuousChannel::InputRange inputRange { -10.0f, 10.0f }; + StreamInfo analogInputStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), name, "AnalogInput" }), "Analog Input data", @@ -38,7 +40,9 @@ AnalogIO::AnalogIO (std::string name, std::string hubName, const oni_dev_idx_t d getVoltsPerDivision (AnalogIOVoltageRange::TenVolts), // NB: +/- 10 Volts "V", {}, - { "input" }); + { "input" }, + {}, + { inputRange }); streamInfos.add (analogInputStream); for (int i = 0; i < numFrames; i++) diff --git a/Source/Devices/Bno055.cpp b/Source/Devices/Bno055.cpp index 14547ef..5341ab8 100644 --- a/Source/Devices/Bno055.cpp +++ b/Source/Devices/Bno055.cpp @@ -30,6 +30,11 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic auto streamIdentifier = getStreamIdentifier(); std::string port = getPortName (deviceIdx); + + const ContinuousChannel::InputRange eulerYawRange { 0.0f, 360.0f }; + const ContinuousChannel::InputRange eulerRollRange { -180.0f, 180.0f }; + const ContinuousChannel::InputRange eulerPitchRange { -90.0f, 90.0f }; + StreamInfo eulerAngleStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Euler" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Euler angle", @@ -42,9 +47,12 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "Degrees", { "Y", "R", "P" }, "euler", - { "y", "r", "p" }); + { "y", "r", "p" }, + { eulerYawRange, eulerRollRange, eulerPitchRange }); streamInfos.add (eulerAngleStream); + const ContinuousChannel::InputRange quaternionRange { -1.0f, 1.0f }; + StreamInfo quaternionStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Quaternion" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Quaternion", @@ -57,9 +65,12 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "u", // NB: Quaternion data is unitless by definition { "W", "X", "Y", "Z" }, "quaternion", - { "w", "x", "y", "z" }); + { "w", "x", "y", "z" }, + { quaternionRange }); streamInfos.add (quaternionStream); + const ContinuousChannel::InputRange accelerationRange { -100.0f, 100.0f }; + StreamInfo accelerationStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Acceleration" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Acceleration", @@ -72,9 +83,12 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "m/s^2", { "X", "Y", "Z" }, "acceleration", - { "x", "y", "z" }); + { "x", "y", "z" }, + { accelerationRange }); streamInfos.add (accelerationStream); + const ContinuousChannel::InputRange gravityRange { -10.0f, 10.0f }; + StreamInfo gravityStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Gravity" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Gravity", @@ -87,9 +101,12 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "m/s^2", { "X", "Y", "Z" }, "gravity", - { "x", "y", "z" }); + { "x", "y", "z" }, + { gravityRange }); streamInfos.add (gravityStream); + const ContinuousChannel::InputRange temperatureRange { 0.0f, 100.0f }; + StreamInfo temperatureStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Temperature", @@ -101,9 +118,13 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic 1.0f, "Celsius", { "" }, - "temperature"); + "temperature", + {}, + { temperatureRange }); streamInfos.add (temperatureStream); + const ContinuousChannel::InputRange calibrationRange { 0.0f, 3.0f }; + StreamInfo calibrationStatusStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Calibration status", @@ -116,7 +137,8 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "", { "Mag", "Acc", "Gyr", "Sys" }, "calibration", - { "magnetometer", "acceleration", "gyroscope", "system" }); + { "magnetometer", "acceleration", "gyroscope", "system" }, + { calibrationRange }); streamInfos.add (calibrationStatusStream); for (int i = 0; i < numFrames; i++) diff --git a/Source/Devices/DigitalIO.cpp b/Source/Devices/DigitalIO.cpp index acd6de9..e81e935 100644 --- a/Source/Devices/DigitalIO.cpp +++ b/Source/Devices/DigitalIO.cpp @@ -28,6 +28,8 @@ using namespace OnixSourcePlugin; DigitalIO::DigitalIO (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr oni_ctx) : OnixDevice (name, hubName, DigitalIO::getDeviceType(), deviceIdx_, oni_ctx) { + const ContinuousChannel::InputRange digitalRange { 0.0f, 1.0f }; + StreamInfo digitalInputStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), name, "DigitalInputs" }), "Digital Inputs data", @@ -39,7 +41,9 @@ DigitalIO::DigitalIO (std::string name, std::string hubName, const oni_dev_idx_t 1.0, "u", // NB: Digital data is unitless by definition {}, - { "input" }); + { "input" }, + {}, + { digitalRange }); streamInfos.add (digitalInputStream); StreamInfo digitalButtonStream = StreamInfo ( @@ -53,7 +57,9 @@ DigitalIO::DigitalIO (std::string name, std::string hubName, const oni_dev_idx_t 1.0, "u", // NB: Digital data is unitless by definition { "Moon", "Triangle", "X", "Check", "Circle", "Square" }, - { "input" }); + { "input" }, + {}, + { digitalRange }); streamInfos.add (digitalButtonStream); eventCodes.fill (0); diff --git a/Source/Devices/HarpSyncInput.cpp b/Source/Devices/HarpSyncInput.cpp index 9e24cc8..4ae867b 100644 --- a/Source/Devices/HarpSyncInput.cpp +++ b/Source/Devices/HarpSyncInput.cpp @@ -29,6 +29,8 @@ HarpSyncInput::HarpSyncInput (std::string name, std::string hubName, const oni_d { setEnabled (false); + const ContinuousChannel::InputRange harpTimeRange { 0.0f, 1000.0f }; + StreamInfo harpTimeStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), getName(), "HarpTime" }), "Harp clock time corresponding to the local acquisition ONIX clock count", @@ -40,7 +42,9 @@ HarpSyncInput::HarpSyncInput (std::string name, std::string hubName, const oni_d 1.0f, "s", { "" }, - "harptime"); + "harptime", + {}, + { harpTimeRange }); streamInfos.add (harpTimeStream); for (int i = 0; i < numFrames; i++) diff --git a/Source/Devices/MemoryMonitor.cpp b/Source/Devices/MemoryMonitor.cpp index 8843852..4398fdd 100644 --- a/Source/Devices/MemoryMonitor.cpp +++ b/Source/Devices/MemoryMonitor.cpp @@ -77,6 +77,8 @@ void MemoryMonitorUsage::stopAcquisition() MemoryMonitor::MemoryMonitor (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr oni_ctx) : OnixDevice (name, hubName, MemoryMonitor::getDeviceType(), deviceIdx_, oni_ctx) { + const ContinuousChannel::InputRange percentRange { 0.0f, 100.0f }; + StreamInfo percentUsedStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), getName(), "PercentUsed" }), "Percent of available memory that is currently used", @@ -88,7 +90,9 @@ MemoryMonitor::MemoryMonitor (std::string name, std::string hubName, const oni_d 1.0f, "%", { "" }, - "percent"); + "percent", + {}, + { percentRange }); streamInfos.add (percentUsedStream); } diff --git a/Source/Devices/Neuropixels1e.cpp b/Source/Devices/Neuropixels1e.cpp index ae9a995..05f3a0f 100644 --- a/Source/Devices/Neuropixels1e.cpp +++ b/Source/Devices/Neuropixels1e.cpp @@ -79,6 +79,7 @@ Neuropixels1e::Neuropixels1e (std::string name, std::string hubName, const oni_d : Neuropixels1 (name, hubName, OnixDeviceType::NEUROPIXELSV1E, deviceIdx_, ctx_) { std::string port = getPortName (getDeviceIdx()); + StreamInfo apStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), STREAM_NAME_AP }), "Neuropixels 1.0 AP band data stream", @@ -90,7 +91,9 @@ Neuropixels1e::Neuropixels1e (std::string name, std::string hubName, const oni_d 0.195f, "uV", {}, - "ap"); + "ap", + {}, + {}); streamInfos.add (apStream); StreamInfo lfpStream = StreamInfo ( @@ -104,7 +107,9 @@ Neuropixels1e::Neuropixels1e (std::string name, std::string hubName, const oni_d 0.195f, "uV", {}, - "lfp"); + "lfp", + {}, + {}); streamInfos.add (lfpStream); defineMetadata (settings[0].get()); diff --git a/Source/Devices/Neuropixels1f.cpp b/Source/Devices/Neuropixels1f.cpp index e7e77cd..620d1af 100644 --- a/Source/Devices/Neuropixels1f.cpp +++ b/Source/Devices/Neuropixels1f.cpp @@ -78,7 +78,9 @@ Neuropixels1f::Neuropixels1f (std::string name, std::string hubName, const oni_d 0.195f, "uV", {}, - "ap"); + "ap", + {}, + {}); streamInfos.add (apStream); StreamInfo lfpStream = StreamInfo ( @@ -92,7 +94,9 @@ Neuropixels1f::Neuropixels1f (std::string name, std::string hubName, const oni_d 0.195f, "uV", {}, - "lfp"); + "lfp", + {}, + {}); streamInfos.add (lfpStream); defineMetadata (settings[0].get()); diff --git a/Source/Devices/Neuropixels2e.cpp b/Source/Devices/Neuropixels2e.cpp index fbce27b..1638f5a 100644 --- a/Source/Devices/Neuropixels2e.cpp +++ b/Source/Devices/Neuropixels2e.cpp @@ -67,7 +67,9 @@ void Neuropixels2e::createDataStream (int n) 0.195f, "uV", {}, - "ap"); + "ap", + {}, + {}); streamInfos.add (apStream); } diff --git a/Source/Devices/PolledBno055.cpp b/Source/Devices/PolledBno055.cpp index db8cc37..5c5643c 100644 --- a/Source/Devices/PolledBno055.cpp +++ b/Source/Devices/PolledBno055.cpp @@ -31,6 +31,10 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev { auto streamIdentifier = getStreamIdentifier(); + const ContinuousChannel::InputRange eulerYawRange { 0.0f, 360.0f }; + const ContinuousChannel::InputRange eulerRollRange { -180.0f, 180.0f }; + const ContinuousChannel::InputRange eulerPitchRange { -90.0f, 90.0f }; + std::string port = getPortName (deviceIdx); StreamInfo eulerAngleStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Euler" }), @@ -44,9 +48,12 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "Degrees", { "Y", "R", "P" }, "euler", - { "y", "r", "p" }); + { "y", "r", "p" }, + { eulerYawRange, eulerRollRange, eulerPitchRange }); streamInfos.add (eulerAngleStream); + const ContinuousChannel::InputRange quaternionRange { -1.0f, 1.0f }; + StreamInfo quaternionStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Quaternion" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Quaternion", @@ -59,9 +66,12 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "", { "W", "X", "Y", "Z" }, "quaternion", - { "w", "x", "y", "z" }); + { "w", "x", "y", "z" }, + { quaternionRange }); streamInfos.add (quaternionStream); + const ContinuousChannel::InputRange accelerationRange { -100.0f, 100.0f }; + StreamInfo accelerationStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Acceleration" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Acceleration", @@ -74,9 +84,12 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "m / s ^ 2", { "X", "Y", "Z" }, "acceleration", - { "x", "y", "z" }); + { "x", "y", "z" }, + { accelerationRange }); streamInfos.add (accelerationStream); + const ContinuousChannel::InputRange gravityRange { -10.0f, 10.0f }; + StreamInfo gravityStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Gravity" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Gravity", @@ -89,9 +102,12 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "m/s^2", { "X", "Y", "Z" }, "gravity", - { "x", "y", "z" }); + { "x", "y", "z" }, + { gravityRange }); streamInfos.add (gravityStream); + const ContinuousChannel::InputRange temperatureRange { 0.0f, 100.0f }; + StreamInfo temperatureStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Temperature", @@ -103,9 +119,13 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev 1.0f, "Celsius", { "" }, - "temperature"); + "temperature", + {}, + { temperatureRange }); streamInfos.add (temperatureStream); + const ContinuousChannel::InputRange calibrationRange { 0.0f, 3.0f }; + StreamInfo calibrationStatusStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }), "Bosch Bno055 9-axis inertial measurement unit (IMU) Calibration status", @@ -118,7 +138,8 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "", { "Mag", "Acc", "Gyr", "Sys" }, "calibration", - { "magnetometer", "acceleration", "gyroscope", "system" }); + { "magnetometer", "acceleration", "gyroscope", "system" }, + { calibrationRange }); streamInfos.add (calibrationStatusStream); for (int i = 0; i < NumFrames; i++) diff --git a/Source/OnixDevice.h b/Source/OnixDevice.h index 1ff9dcf..4708008 100644 --- a/Source/OnixDevice.h +++ b/Source/OnixDevice.h @@ -74,7 +74,8 @@ struct StreamInfo std::string units, std::vector channelNameSuffixes, std::string channelIdentifierDataType, - std::vector channelIdentifierSubTypes = {}) + std::vector channelIdentifierSubTypes, + std::vector inputRanges) { m_name = name; m_description = description; @@ -88,6 +89,7 @@ struct StreamInfo m_channelNameSuffixes = channelNameSuffixes; m_channelIdentifierDataType = channelIdentifierDataType; m_channelIdentifierSubTypes = channelIdentifierSubTypes; + channelInputRanges = inputRanges; if (m_numChannels != m_channelNameSuffixes.size()) { @@ -127,6 +129,28 @@ struct StreamInfo } } } + + if (channelInputRanges.size() == 0) + { + LOGE ("Must specify at least one channel input range."); + + channelInputRanges.push_back (ContinuousChannel::InputRange()); + } + else + { + ContinuousChannel::InputRange range = channelInputRanges[0]; + + if (channelInputRanges.size() == 1) + { + channelInputRanges.assign (m_numChannels, range); + } + else if (m_numChannels != channelInputRanges.size()) + { + LOGE ("Invalid number of channel input ranges given. Must either be one input range for all channels, or the same number of input ranges as channels."); + + channelInputRanges.assign (m_numChannels, range); + } + } }; std::string getName() const { return m_name; } @@ -141,6 +165,7 @@ struct StreamInfo std::vector getChannelNameSuffixes() const { return m_channelNameSuffixes; } std::string getChannelIdentifierDataType() const { return m_channelIdentifierDataType; } std::vector getChannelIdentifierSubTypes() const { return m_channelIdentifierSubTypes; } + ContinuousChannel::InputRange getChannelInputRange (int index) const { return channelInputRanges.at (index); } private: std::string m_name = "name"; @@ -155,6 +180,7 @@ struct StreamInfo std::vector m_channelNameSuffixes = { "suffixes" }; std::string m_channelIdentifierDataType = "datatype"; std::vector m_channelIdentifierSubTypes = { "subtypes" }; + std::vector channelInputRanges = {}; }; using OnixDeviceMap = std::map; diff --git a/Source/OnixSource.cpp b/Source/OnixSource.cpp index 76946ba..c4ddb27 100644 --- a/Source/OnixSource.cpp +++ b/Source/OnixSource.cpp @@ -991,6 +991,7 @@ void OnixSource::addCombinedStreams (DataStream::Settings dataStreamSettings, }; continuousChannels->add (new ContinuousChannel (channelSettings)); continuousChannels->getLast()->setUnits (streamInfo.getUnits()); + continuousChannels->getLast()->inputRange = streamInfo.getChannelInputRange (chan); } } } From de415d3e9e69da521c57ebb7177160ed26ee1926 Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Thu, 13 Nov 2025 09:37:51 -0800 Subject: [PATCH 2/4] Make input ranges symmetric Aligns with LFP Viewer conventions for improved visualization consistency --- Source/Devices/Bno055.cpp | 6 +++--- Source/Devices/PolledBno055.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Devices/Bno055.cpp b/Source/Devices/Bno055.cpp index 5341ab8..0350e87 100644 --- a/Source/Devices/Bno055.cpp +++ b/Source/Devices/Bno055.cpp @@ -31,7 +31,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic std::string port = getPortName (deviceIdx); - const ContinuousChannel::InputRange eulerYawRange { 0.0f, 360.0f }; + const ContinuousChannel::InputRange eulerYawRange { -360.0f, 360.0f }; const ContinuousChannel::InputRange eulerRollRange { -180.0f, 180.0f }; const ContinuousChannel::InputRange eulerPitchRange { -90.0f, 90.0f }; @@ -105,7 +105,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic { gravityRange }); streamInfos.add (gravityStream); - const ContinuousChannel::InputRange temperatureRange { 0.0f, 100.0f }; + const ContinuousChannel::InputRange temperatureRange { -100.0f, 100.0f }; StreamInfo temperatureStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }), @@ -123,7 +123,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic { temperatureRange }); streamInfos.add (temperatureStream); - const ContinuousChannel::InputRange calibrationRange { 0.0f, 3.0f }; + const ContinuousChannel::InputRange calibrationRange { -3.0f, 3.0f }; StreamInfo calibrationStatusStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }), diff --git a/Source/Devices/PolledBno055.cpp b/Source/Devices/PolledBno055.cpp index 5c5643c..358fd53 100644 --- a/Source/Devices/PolledBno055.cpp +++ b/Source/Devices/PolledBno055.cpp @@ -31,7 +31,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev { auto streamIdentifier = getStreamIdentifier(); - const ContinuousChannel::InputRange eulerYawRange { 0.0f, 360.0f }; + const ContinuousChannel::InputRange eulerYawRange { -360.0f, 360.0f }; const ContinuousChannel::InputRange eulerRollRange { -180.0f, 180.0f }; const ContinuousChannel::InputRange eulerPitchRange { -90.0f, 90.0f }; @@ -106,7 +106,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev { gravityRange }); streamInfos.add (gravityStream); - const ContinuousChannel::InputRange temperatureRange { 0.0f, 100.0f }; + const ContinuousChannel::InputRange temperatureRange { -100.0f, 100.0f }; StreamInfo temperatureStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }), @@ -124,7 +124,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev { temperatureRange }); streamInfos.add (temperatureStream); - const ContinuousChannel::InputRange calibrationRange { 0.0f, 3.0f }; + const ContinuousChannel::InputRange calibrationRange { -3.0f, 3.0f }; StreamInfo calibrationStatusStream = StreamInfo ( OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }), From 76e165941a84b317c220ee988f9c9de47607c7f2 Mon Sep 17 00:00:00 2001 From: bparks13 Date: Fri, 14 Nov 2025 10:38:06 -0500 Subject: [PATCH 3/4] Update ranges based on testing --- Source/Devices/HarpSyncInput.cpp | 4 +--- Source/Devices/MemoryMonitor.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Devices/HarpSyncInput.cpp b/Source/Devices/HarpSyncInput.cpp index 4ae867b..837ef7a 100644 --- a/Source/Devices/HarpSyncInput.cpp +++ b/Source/Devices/HarpSyncInput.cpp @@ -29,8 +29,6 @@ HarpSyncInput::HarpSyncInput (std::string name, std::string hubName, const oni_d { setEnabled (false); - const ContinuousChannel::InputRange harpTimeRange { 0.0f, 1000.0f }; - StreamInfo harpTimeStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), getName(), "HarpTime" }), "Harp clock time corresponding to the local acquisition ONIX clock count", @@ -44,7 +42,7 @@ HarpSyncInput::HarpSyncInput (std::string name, std::string hubName, const oni_d { "" }, "harptime", {}, - { harpTimeRange }); + {}); streamInfos.add (harpTimeStream); for (int i = 0; i < numFrames; i++) diff --git a/Source/Devices/MemoryMonitor.cpp b/Source/Devices/MemoryMonitor.cpp index 4398fdd..a569e79 100644 --- a/Source/Devices/MemoryMonitor.cpp +++ b/Source/Devices/MemoryMonitor.cpp @@ -77,7 +77,7 @@ void MemoryMonitorUsage::stopAcquisition() MemoryMonitor::MemoryMonitor (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr oni_ctx) : OnixDevice (name, hubName, MemoryMonitor::getDeviceType(), deviceIdx_, oni_ctx) { - const ContinuousChannel::InputRange percentRange { 0.0f, 100.0f }; + const ContinuousChannel::InputRange percentRange { -100.0f, 100.0f }; StreamInfo percentUsedStream = StreamInfo ( OnixDevice::createStreamName ({ getHubName(), getName(), "PercentUsed" }), From 8e18d224086900244dd47eb07ee42275fa7841dc Mon Sep 17 00:00:00 2001 From: bparks13 Date: Fri, 14 Nov 2025 15:34:15 -0500 Subject: [PATCH 4/4] Corrected units for visualization --- Source/Devices/Bno055.cpp | 6 +++--- Source/Devices/PolledBno055.cpp | 8 ++++---- Source/OnixDevice.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Devices/Bno055.cpp b/Source/Devices/Bno055.cpp index 0350e87..2847942 100644 --- a/Source/Devices/Bno055.cpp +++ b/Source/Devices/Bno055.cpp @@ -44,7 +44,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "Eul", ContinuousChannel::Type::AUX, eulerAngleScale, - "Degrees", + "Deg.", { "Y", "R", "P" }, "euler", { "y", "r", "p" }, @@ -62,7 +62,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "Quat", ContinuousChannel::Type::AUX, quaternionScale, - "u", // NB: Quaternion data is unitless by definition + "", // NB: Quaternion data is unitless by definition { "W", "X", "Y", "Z" }, "quaternion", { "w", "x", "y", "z" }, @@ -116,7 +116,7 @@ Bno055::Bno055 (std::string name, std::string hubName, const oni_dev_idx_t devic "Temp", ContinuousChannel::Type::AUX, 1.0f, - "Celsius", + String::fromUTF8 ("\xc2\xb0") + String ("C"), // NB: "\xc2\xb0" --> degree symbol { "" }, "temperature", {}, diff --git a/Source/Devices/PolledBno055.cpp b/Source/Devices/PolledBno055.cpp index 358fd53..2f50220 100644 --- a/Source/Devices/PolledBno055.cpp +++ b/Source/Devices/PolledBno055.cpp @@ -45,7 +45,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "Eul", ContinuousChannel::Type::AUX, EulerAngleScale, - "Degrees", + "Deg.", { "Y", "R", "P" }, "euler", { "y", "r", "p" }, @@ -63,7 +63,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "Quat", ContinuousChannel::Type::AUX, QuaternionScale, - "", + "", // NB: Quaternion data is unitless by definition { "W", "X", "Y", "Z" }, "quaternion", { "w", "x", "y", "z" }, @@ -81,7 +81,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "Acc", ContinuousChannel::Type::AUX, AccelerationScale, - "m / s ^ 2", + "m/s^2", { "X", "Y", "Z" }, "acceleration", { "x", "y", "z" }, @@ -117,7 +117,7 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev "Temp", ContinuousChannel::Type::AUX, 1.0f, - "Celsius", + String::fromUTF8 ("\xc2\xb0") + String ("C"), // NB: "\xc2\xb0" --> degree symbol { "" }, "temperature", {}, diff --git a/Source/OnixDevice.h b/Source/OnixDevice.h index 4708008..5ca40c6 100644 --- a/Source/OnixDevice.h +++ b/Source/OnixDevice.h @@ -71,7 +71,7 @@ struct StreamInfo std::string channelPrefix, ContinuousChannel::Type channelType, float bitVolts, - std::string units, + String units, std::vector channelNameSuffixes, std::string channelIdentifierDataType, std::vector channelIdentifierSubTypes, @@ -161,7 +161,7 @@ struct StreamInfo std::string getChannelPrefix() const { return m_channelPrefix; } ContinuousChannel::Type getChannelType() const { return m_channelType; } float getBitVolts() const { return m_bitVolts; } - std::string getUnits() const { return m_units; } + String getUnits() const { return m_units; } std::vector getChannelNameSuffixes() const { return m_channelNameSuffixes; } std::string getChannelIdentifierDataType() const { return m_channelIdentifierDataType; } std::vector getChannelIdentifierSubTypes() const { return m_channelIdentifierSubTypes; } @@ -176,7 +176,7 @@ struct StreamInfo std::string m_channelPrefix = "channelPrefix"; ContinuousChannel::Type m_channelType = ContinuousChannel::Type::INVALID; float m_bitVolts = 1.0f; - std::string m_units = "units"; + String m_units = "units"; std::vector m_channelNameSuffixes = { "suffixes" }; std::string m_channelIdentifierDataType = "datatype"; std::vector m_channelIdentifierSubTypes = { "subtypes" };