Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion Source/Devices/AnalogIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ using namespace OnixSourcePlugin;
AnalogIO::AnalogIO (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr<Onix1> 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",
Expand All @@ -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++)
Expand Down
34 changes: 28 additions & 6 deletions Source/Devices/Bno055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 { -360.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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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 { -100.0f, 100.0f };

StreamInfo temperatureStream = StreamInfo (
OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }),
"Bosch Bno055 9-axis inertial measurement unit (IMU) Temperature",
Expand All @@ -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 { -3.0f, 3.0f };

StreamInfo calibrationStatusStream = StreamInfo (
OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }),
"Bosch Bno055 9-axis inertial measurement unit (IMU) Calibration status",
Expand All @@ -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++)
Expand Down
10 changes: 8 additions & 2 deletions Source/Devices/DigitalIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ using namespace OnixSourcePlugin;
DigitalIO::DigitalIO (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr<Onix1> 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",
Expand All @@ -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 (
Expand All @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion Source/Devices/HarpSyncInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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++)
Expand Down
6 changes: 5 additions & 1 deletion Source/Devices/MemoryMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ void MemoryMonitorUsage::stopAcquisition()
MemoryMonitor::MemoryMonitor (std::string name, std::string hubName, const oni_dev_idx_t deviceIdx_, std::shared_ptr<Onix1> 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",
Expand All @@ -88,7 +90,9 @@ MemoryMonitor::MemoryMonitor (std::string name, std::string hubName, const oni_d
1.0f,
"%",
{ "" },
"percent");
"percent",
{},
{ percentRange });
streamInfos.add (percentUsedStream);
}

Expand Down
9 changes: 7 additions & 2 deletions Source/Devices/Neuropixels1e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 (
Expand All @@ -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());
Expand Down
8 changes: 6 additions & 2 deletions Source/Devices/Neuropixels1f.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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());
Expand Down
4 changes: 3 additions & 1 deletion Source/Devices/Neuropixels2e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ void Neuropixels2e::createDataStream (int n)
0.195f,
"uV",
{},
"ap");
"ap",
{},
{});
streamInfos.add (apStream);
}

Expand Down
33 changes: 27 additions & 6 deletions Source/Devices/PolledBno055.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ PolledBno055::PolledBno055 (std::string name, std::string hubName, const oni_dev
{
auto streamIdentifier = getStreamIdentifier();

const ContinuousChannel::InputRange eulerYawRange { -360.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" }),
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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 { -100.0f, 100.0f };

StreamInfo temperatureStream = StreamInfo (
OnixDevice::createStreamName ({ port, getHubName(), getName(), "Temperature" }),
"Bosch Bno055 9-axis inertial measurement unit (IMU) Temperature",
Expand All @@ -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 { -3.0f, 3.0f };

StreamInfo calibrationStatusStream = StreamInfo (
OnixDevice::createStreamName ({ port, getHubName(), getName(), "Calibration" }),
"Bosch Bno055 9-axis inertial measurement unit (IMU) Calibration status",
Expand All @@ -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++)
Expand Down
Loading