Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 19, 2024
1 parent 2071445 commit 43313cb
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 62 deletions.
132 changes: 78 additions & 54 deletions src/Channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,155 +39,179 @@ class Channel
/**
* @brief Copy constructor
*/
Channel(const Channel& other) = default;
Channel(const Channel& other) = default;

/**
* @brief Move constructor
*/
Channel(Channel&& other) = default;
/**
* @brief Move constructor
*/
Channel(Channel&& other) = default;

/**
* @brief Assignment operator
*/
Channel& operator=(const Channel& other) = default;
/**
* @brief Assignment operator
*/
Channel& operator=(const Channel& other) = default;

/**
* @brief Move assignment operator
*/
Channel& operator=(Channel&& other) = default;
/**
* @brief Move assignment operator
*/
Channel& operator=(Channel&& other) = default;

/**
/**
* @brief Getter for conversion factor
* @return The conversion value.
*/
inline float getConversion() const { return m_bitVolts / m_conversion; }

/**
/**
* @brief Getter for sampling rate of the channel.
* @return The sampling rate value.
*/
inline float getSamplingRate() const { return m_samplingRate; }
inline float getSamplingRate() const { return m_samplingRate; }

/**
/**
* @brief Getter for bitVolts floating point value of microvolts per bit
* @return The bitVolts value.
*/
inline float getBitVolts() const { return m_bitVolts; }
inline float getBitVolts() const { return m_bitVolts; }

/**
/**
* @brief Get the name of the array group the channel belongs to.
* @return The groupName value.
*/
inline std::string getGroupName() const { return m_groupName; }
inline std::string getGroupName() const { return m_groupName; }

/**
/**
* @brief Get the name of the channel
* @return The name value.
*/
inline std::string getName() const { return m_name; }
inline std::string getName() const { return m_name; }

/**
/**
* @brief Get the array group index the channel belongs to
* @return The groupIndex value.
*/
inline SizeType getGroupIndex() const { return m_groupIndex; }
inline SizeType getGroupIndex() const { return m_groupIndex; }

/**
/**
* @brief Get the index of the channel within the recording array.
* @return The localIndex value.
*/
inline SizeType getLocalIndex() const { return m_localIndex; }
inline SizeType getLocalIndex() const { return m_localIndex; }

/**
/**
* @brief Get the index of the channel across the recording system.
* @return The globalIndex value.
*/
inline SizeType getGlobalIndex() const { return m_globalIndex; }
inline SizeType getGlobalIndex() const { return m_globalIndex; }

/**
/**
* @brief Get the coordinates of channel (x, y, z) within the recording array.
* @return The position value.
*/
inline const std::array<float, 3>& getPosition() const { return m_position; }
inline const std::array<float, 3>& getPosition() const { return m_position; }

/**
/**
* @brief Get comments about the channel
* @return The comments value.
*/
inline std::string getComments() const { return m_comments; }
inline std::string getComments() const { return m_comments; }

/**
/**
* @brief Set comments about the channel.
* @param comments The comments to set.
*/
inline void setComments(const std::string& comments) { m_comments = comments; }
inline void setComments(const std::string& comments)
{
m_comments = comments;
}

/**
/**
* @brief Set coordinates of channel (x, y, z) within the recording array.
* @param position The position to set.
*/
inline void setPosition(const std::array<float, 3>& position) { m_position = position; }
inline void setPosition(const std::array<float, 3>& position)
{
m_position = position;
}

/**
/**
* @brief Set index of channel across the recording system.
* @param globalIndex The globalIndex to set.
*/
inline void setGlobalIndex(const SizeType globalIndex) { m_globalIndex = globalIndex; }
inline void setGlobalIndex(const SizeType globalIndex)
{
m_globalIndex = globalIndex;
}

/**
/**
* @brief Set index of channel within the recording array.
* @param localIndex The localIndex to set.
*/
inline void setLocalIndex(const SizeType localIndex) { m_localIndex = localIndex; }
inline void setLocalIndex(const SizeType localIndex)
{
m_localIndex = localIndex;
}

/**
/**
* @brief Set index of array group the channel belongs to.
* @param groupIndex The groupIndex to set.
*/
inline void setGroupIndex(const SizeType groupIndex) { m_groupIndex = groupIndex; }
inline void setGroupIndex(const SizeType groupIndex)
{
m_groupIndex = groupIndex;
}

/**
/**
* @brief Set name of the channel.
* @param name The name to set.
*/
inline void setName(const std::string& name) { m_name = name; }
inline void setName(const std::string& name) { m_name = name; }

/**
/**
* @brief Set name of the array group the channel belongs to.
* @param groupName The groupName to set.
*/
inline void setGroupName(const std::string& groupName) { m_groupName = groupName; }
inline void setGroupName(const std::string& groupName)
{
m_groupName = groupName;
}

/**
/**
* @brief Set conversion factor.
* @param conversion The conversion to set.
*/
inline void setConversion(const float conversion) { m_conversion = conversion; }
inline void setConversion(const float conversion)
{
m_conversion = conversion;
}

/**
/**
* @brief Set sampling rate of the channel.
* @param samplingRate The samplingRate to set.
*/
inline void setSamplingRate(const float samplingRate) { m_samplingRate = samplingRate; }
inline void setSamplingRate(const float samplingRate)
{
m_samplingRate = samplingRate;
}

/**
/**
* @brief Set floating point value of microvolts per bit
* @param bitVolts The bitVolts to set.
*/
inline void setBitVolts(const float bitVolts) { m_bitVolts = bitVolts; }
inline void setBitVolts(const float bitVolts) { m_bitVolts = bitVolts; }

private:
/**
* @brief Comments about the channel.
*/
std::string m_comments;

/**
/**
* @brief Coordinates of channel (x, y, z) within the recording array.
*/
std::array<float, 3> m_position;

/**
/**
* @brief Index of channel across the recording system.
*/
SizeType m_globalIndex;
Expand Down
9 changes: 5 additions & 4 deletions tests/examples/testWorkflowExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ TEST_CASE("workflowExamples")
const auto& channelVector = mockRecordingArrays[i];
for (const auto& channel : channelVector) {
// copy data into buffer
std::copy(mockData[channel.getGlobalIndex()].begin() + samplesRecorded,
mockData[channel.getGlobalIndex()].begin() + samplesRecorded
+ bufferSize,
dataBuffer.begin());
std::copy(
mockData[channel.getGlobalIndex()].begin() + samplesRecorded,
mockData[channel.getGlobalIndex()].begin() + samplesRecorded
+ bufferSize,
dataBuffer.begin());
std::copy(mockTimestamps.begin() + samplesRecorded,
mockTimestamps.begin() + samplesRecorded + bufferSize,
timestampsBuffer.begin());
Expand Down
9 changes: 5 additions & 4 deletions tests/testRecordingWorkflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ TEST_CASE("writeContinuousData", "[recording]")
const auto& channelVector = mockRecordingArrays[i];
for (const auto& channel : channelVector) {
// copy data into buffer
std::copy(mockData[channel.getGlobalIndex()].begin() + samplesRecorded,
mockData[channel.getGlobalIndex()].begin() + samplesRecorded
+ bufferSize,
dataBuffer.begin());
std::copy(
mockData[channel.getGlobalIndex()].begin() + samplesRecorded,
mockData[channel.getGlobalIndex()].begin() + samplesRecorded
+ bufferSize,
dataBuffer.begin());
std::copy(mockTimestamps.begin() + samplesRecorded,
mockTimestamps.begin() + samplesRecorded + bufferSize,
timestampsBuffer.begin());
Expand Down

0 comments on commit 43313cb

Please sign in to comment.