Skip to content
Open
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
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
40 changes: 31 additions & 9 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 @@ -39,12 +44,15 @@ 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" });
{ "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 @@ -54,12 +62,15 @@ 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" });
{ "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 @@ -99,11 +116,15 @@ 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");
"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
4 changes: 3 additions & 1 deletion Source/Devices/HarpSyncInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ HarpSyncInput::HarpSyncInput (std::string name, std::string hubName, const oni_d
1.0f,
"s",
{ "" },
"harptime");
"harptime",
{},
{});
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 { -100.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
41 changes: 31 additions & 10 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 @@ -41,12 +45,15 @@ 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" });
{ "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 @@ -56,12 +63,15 @@ 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" });
{ "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 @@ -71,12 +81,15 @@ 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" });
{ "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 @@ -101,11 +117,15 @@ 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");
"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