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

Adapt eCube to new version of sourcenode code

parent 64cb71df
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@
<Optimization>Disabled</Optimization>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<AdditionalIncludeDirectories>..\..\JuceLibraryCode;..\..\JuceLibraryCode\modules;../../Resources/windows-libs/HDF5/include;../../Resources/windows-libs/ZeroMQ/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;DEBUG;_DEBUG;NOMINMAX;ZEROMQ;JUCER_VS2013_78A5020=1;JUCE_APP_VERSION=0.3.4;JUCE_APP_VERSION_HEX=0x304;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ECUBE_COMPILE;WIN32;_WINDOWS;DEBUG;_DEBUG;NOMINMAX;ZEROMQ;JUCER_VS2013_78A5020=1;JUCE_APP_VERSION=0.3.4;JUCE_APP_VERSION_HEX=0x304;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader />
......
......@@ -128,12 +128,6 @@ public:
return false;
}
/** Returns the number of ADC channels of the data source.*/
virtual int getNumADCchannels()
{
return 0;
}
/** Changes the names of channels, if the thread needs custom names. */
void updateChannels();
......
......@@ -298,7 +298,7 @@ EcubeThread::EcubeThread(SourceNode* sn) : DataThread(sn), numberingScheme(1), a
pDevInt->buf_timestamp_locked = false;
setDefaultChannelNamesAndType();
setDefaultChannelNames();
}
catch (_com_error& e)
......@@ -308,24 +308,11 @@ EcubeThread::EcubeThread(SourceNode* sn) : DataThread(sn), numberingScheme(1), a
}
}
void EcubeThread::getChannelsInfo(StringArray &Names_, Array<ChannelType> &type_, Array<int> &stream_, Array<int> &originalChannelNumber_, Array<float> &gains_)
{
Names_ = Names;
type_ = type;
stream_ = stream;
originalChannelNumber_ = originalChannelNumber;
gains_ = gains;
}
/* This will give default names & gains to channels, unless they were manually modified by the user
In that case, the query channelModified, will return the values that need to be put */
void EcubeThread::setDefaultChannelNamesAndType()
void EcubeThread::setDefaultChannelNames()
{
Names.clear();
type.clear();
stream.clear();
gains.clear();
originalChannelNumber.clear();
String prefix;
ChannelType common_type;
......@@ -352,31 +339,23 @@ void EcubeThread::setDefaultChannelNamesAndType()
for (int i = 0; i < numch; i++)
{
Names.add(prefix + String(i));
gains.add(getBitVolts(i));
type.add(common_type);
originalChannelNumber.add(i);
ChannelCustomInfo ci;
ci.name = prefix + String(i);
ci.gain = getBitVolts(i);
channelInfo.set(i, ci);
}
stream.add(0);
}
void EcubeThread::updateChannelNames()
bool EcubeThread::usesCustomNames()
{
setDefaultChannelNamesAndType();
for (int i = 0; i < sn->channels.size(); i++)
{
sn->channels[i]->setName(Names[i]);
sn->channels[i]->bitVolts = gains[i];
sn->channels[i]->setType(type[i]);
}
return true;
}
void EcubeThread::setDefaultNamingScheme(int scheme)
{
numberingScheme = scheme;
setDefaultChannelNamesAndType();
setDefaultChannelNames();
}
......@@ -432,16 +411,6 @@ int EcubeThread::getNumEventChannels()
return 0;
}
int EcubeThread::getNumADCchannels()
{
if (pDevInt->data_format == EcubeDevInt::dfInterleavedChannelsAnalog)
return 32;
else if(pDevInt->data_format == EcubeDevInt::dfDigital)
return 64;
else
return 0;
}
float EcubeThread::getSampleRate()
{
return m_samplerate;
......
......@@ -85,9 +85,6 @@ public:
/** Returns the number of event channels of the data source.*/
virtual int getNumEventChannels();
/** Returns the number of ADC channels of the data source.*/
virtual int getNumADCchannels();
/** Returns the sample rate of the data source.*/
virtual float getSampleRate();
......@@ -96,25 +93,17 @@ public:
virtual float getBitVolts(Channel* chan);
virtual void getChannelsInfo(StringArray &Names, Array<ChannelType> &type, Array<int> &stream, Array<int> &originalChannelNumber, Array<float> &gains);
void setDefaultNamingScheme(int scheme);
/** Changes the names of channels, if the thread needs custom names. */
virtual void updateChannelNames();
bool usesCustomNames();
// Custom thread control functions
void setSpeakerVolume(double volume);
void setSpeakerChannel(unsigned short channel);
private:
void setDefaultChannelNamesAndType();
// used for data stream names...
int numberingScheme;
StringArray Names;
Array<ChannelType> type;
Array<float> gains;
Array<int> stream;
Array<int> originalChannelNumber;
int numberingScheme;
void setDefaultChannelNames();
ScopedPointer<EcubeDevInt> pDevInt;
......
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