Skip to content
Snippets Groups Projects
Commit 0930455f authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Add unit field to data channel objects

parent 9a25718c
No related branches found
No related tags found
No related merge requests found
Microsoft Visual Studio Solution File, Format Version 11.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
Project("{5A05F353-1D63-394C-DFB0-981BB2309002}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "open-ephys", "open-ephys.vcxproj", "{9C924D66-7DEC-1AEF-B375-DB8666BFB909}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Debug|x64 = Debug|x64
Debug64|Win32 = Debug64|Win32
Debug64|x64 = Debug64|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release64|Win32 = Release64|Win32
Release64|x64 = Release64|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.ActiveCfg = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|Win32.Build.0 = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug|x64.ActiveCfg = Debug|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|Win32.ActiveCfg = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.ActiveCfg = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Debug64|x64.Build.0 = Debug64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|Win32.Build.0 = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release|x64.ActiveCfg = Release|Win32
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|Win32.ActiveCfg = Release64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.ActiveCfg = Release64|x64
{9C924D66-7DEC-1AEF-B375-DB8666BFB909}.Release64|x64.Build.0 = Release64|x64
EndGlobalSection
......
......@@ -179,6 +179,16 @@ float DataChannel::getBitVolts() const
return m_bitVolts;
}
void DataChannel::setDataUnits(String unit)
{
m_unitName = unit;
}
String DataChannel::getDataUnits() const
{
return m_unitName;
}
DataChannel::DataChannelTypes DataChannel::getChannelType() const
{
return m_type;
......
......@@ -201,6 +201,12 @@ public:
/** Returns the bitVolts value for this channel. */
float getBitVolts() const;
/** Sets the unit string */
void setDataUnits(String unit);
/** Gets the data units*/
String getDataUnits() const;
DataChannelTypes getChannelType() const;
//--------- STATUS METHODS ----------//
......@@ -235,6 +241,7 @@ private:
bool m_isEnabled{ true };
bool m_isMonitored{ false };
bool m_isRecording{ false };
String m_unitName{ "uV" };
JUCE_LEAK_DETECTOR(DataChannel);
};
......
......@@ -141,4 +141,9 @@ void DataThread::createExtraEvents(Array<EventChannel*>&)
{}
void DataThread::resizeBuffers()
{}
\ No newline at end of file
{}
String DataThread::getChannelUnits(int chanIndex) const
{
return String::empty;
}
\ No newline at end of file
......@@ -137,6 +137,8 @@ public:
void createTTLChannels();
virtual String getChannelUnits(int chanIndex) const;
protected:
virtual void setDefaultChannelNames();
......
......@@ -929,6 +929,19 @@ int RHD2000Thread::getNumDataOutputs(DataChannel::DataChannelTypes type, int sub
}
}
String RHD2000Thread::getChannelUnits(int chanIndex) const
{
switch (sn->getDataChannel(chanIndex)->getChannelType())
{
case DataChannel::AUX_CHANNEL:
return "mV";
case DataChannel::ADC_CHANNEL:
return "V";
default:
return "uV";
}
}
int RHD2000Thread::getNumTTLOutputs(int subproc) const
{
......
......@@ -126,6 +126,8 @@ public:
String getChannelName (int ch) const;
void setNumChannels (int hsNum, int nChannels);
String getChannelUnits(int chanIndex) const override;
int getHeadstageChannels (int hsNum) const;
int getActiveChannelsInHeadstage (int hsNum) const;
......
......@@ -109,6 +109,13 @@ void SourceNode::updateSettings()
{
dataThread->updateChannels();
resizeBuffers();
int nChans = dataChannelArray.size();
for (int i = 0; i < nChans; i++)
{
String unit = dataThread->getChannelUnits(i);
if (unit.isNotEmpty())
dataChannelArray[i]->setDataUnits(unit);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment