Skip to content

Commit 59fafc1

Browse files
committed
Remove extraneous override methods
- Cleaned up comments, moved definitions out of header files
1 parent 13c07ec commit 59fafc1

File tree

11 files changed

+95
-93
lines changed

11 files changed

+95
-93
lines changed

Source/Devices/Bno055.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ void Bno055::startAcquisition()
153153
sampleNumber = 0;
154154
}
155155

156-
void Bno055::stopAcquisition()
157-
{
158-
OnixDevice::stopAcquisition();
159-
currentFrame = 0;
160-
sampleNumber = 0;
161-
}
162-
163156
void Bno055::addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers)
164157
{
165158
sourceBuffers.add(new DataBuffer(numberOfChannels, (int)sampleRate * bufferSizeInSeconds));

Source/Devices/Bno055.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,9 @@ namespace OnixSourcePlugin
4242
Bno055(std::string name, std::string hubName, const oni_dev_idx_t, std::shared_ptr<Onix1> ctx);
4343

4444
int configureDevice() override;
45-
46-
/** Update the settings of the device */
4745
bool updateSettings() override;
48-
49-
/** Starts probe data streaming */
5046
void startAcquisition() override;
51-
52-
/** Stops probe data streaming*/
53-
void stopAcquisition() override;
54-
5547
void processFrames() override;
56-
5748
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
5849

5950
static OnixDeviceType getDeviceType();

Source/Devices/DigitalIO.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ void DigitalIO::startAcquisition()
6666
{
6767
}
6868

69+
void DigitalIO::addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers)
70+
{
71+
}
72+
6973
EventChannel::Settings DigitalIO::getEventChannelSettings(DataStream* stream)
7074
{
7175
EventChannel::Settings settings{

Source/Devices/DigitalIO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace OnixSourcePlugin
7474
int configureDevice() override;
7575
bool updateSettings() override;
7676
void startAcquisition() override;
77-
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override {};
77+
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
7878
void processFrames() override;
7979

8080
EventChannel::Settings getEventChannelSettings(DataStream* stream);

Source/Devices/HarpSyncInput.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,10 @@ namespace OnixSourcePlugin
4646
public:
4747
HarpSyncInput(std::string name, std::string hubName, const oni_dev_idx_t, std::shared_ptr<Onix1> oni_ctx);
4848

49-
/** Configures the device so that it is ready to stream with default settings */
5049
int configureDevice() override;
51-
52-
/** Update the settings of the device */
5350
bool updateSettings() override;
54-
55-
/** Starts probe data streaming */
5651
void startAcquisition() override;
57-
58-
59-
/** Given the sourceBuffers from OnixSource, add all streams for the current device to the array */
6052
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
61-
6253
void processFrames() override;
6354

6455
static OnixDeviceType getDeviceType();

Source/Devices/MemoryMonitor.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@ namespace OnixSourcePlugin
4343
public:
4444
MemoryMonitor(std::string name, std::string hubName, const oni_dev_idx_t, std::shared_ptr<Onix1> oni_ctx);
4545

46-
/** Configures the device so that it is ready to stream with default settings */
4746
int configureDevice() override;
48-
49-
/** Update the settings of the device */
5047
bool updateSettings() override;
51-
52-
/** Starts probe data streaming */
5348
void startAcquisition() override;
54-
55-
/** Given the sourceBuffers from OnixSource, add all streams for the current device to the array */
5649
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
57-
5850
void processFrames() override;
5951

6052
float getLastPercentUsedValue();

Source/Devices/Neuropixels2e.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ Neuropixels2e::Neuropixels2e(std::string name, std::string hubName, const oni_de
4040
eventCodes[i] = 0;
4141
}
4242

43+
Neuropixels2e::~Neuropixels2e()
44+
{
45+
if (serializer != nullptr)
46+
{
47+
selectProbe(NoProbeSelected);
48+
serializer->WriteByte((uint32_t)DS90UB9x::DS90UB9xSerializerI2CRegister::GPIO10, DefaultGPO10Config);
49+
}
50+
51+
if (deviceContext != nullptr && deviceContext->isInitialized())
52+
deviceContext->setOption(ONIX_OPT_PASSTHROUGH, 0);
53+
}
54+
4355
void Neuropixels2e::createDataStream(int n)
4456
{
4557
StreamInfo apStream = StreamInfo(

Source/Devices/Neuropixels2e.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,13 @@ namespace OnixSourcePlugin
5353
public:
5454
Neuropixels2e(std::string name, std::string hubName, const oni_dev_idx_t, std::shared_ptr<Onix1>);
5555

56-
~Neuropixels2e()
57-
{
58-
if (serializer != nullptr)
59-
{
60-
selectProbe(NoProbeSelected);
61-
serializer->WriteByte((uint32_t)DS90UB9x::DS90UB9xSerializerI2CRegister::GPIO10, DefaultGPO10Config);
62-
}
63-
64-
if (deviceContext != nullptr && deviceContext->isInitialized())
65-
deviceContext->setOption(ONIX_OPT_PASSTHROUGH, 0);
66-
}
56+
~Neuropixels2e();
6757

6858
int configureDevice() override;
69-
70-
/** Update the settings of the device */
7159
bool updateSettings() override;
72-
73-
/** Starts probe data streaming */
7460
void startAcquisition() override;
75-
76-
/** Stops probe data streaming*/
7761
void stopAcquisition() override;
78-
7962
void processFrames() override;
80-
8163
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
8264

8365
int getNumProbes() const;
@@ -99,19 +81,14 @@ namespace OnixSourcePlugin
9981
void writeShiftRegister(uint32_t srAddress, std::bitset<N> bits);
10082

10183
void setGainCorrectionFile(int index, std::string filename);
102-
10384
std::string getGainCorrectionFile(int index);
10485

10586
// INeuropixel Methods
10687

10788
std::vector<int> selectElectrodeConfiguration(int electrodeConfigurationIndex) override;
108-
10989
uint64_t getProbeSerialNumber(int index) override;
110-
11190
void defineMetadata(ProbeSettings<NeuropixelsV2eValues::numberOfChannels, NeuropixelsV2eValues::numberOfElectrodes>*, int);
112-
11391
void setSettings(ProbeSettings<numberOfChannels, numberOfElectrodes>* settings_, int index) override;
114-
11592
static OnixDeviceType getDeviceType();
11693

11794
private:

Source/Devices/OutputClock.cpp

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int OutputClock::configureDevice()
3939
if (deviceContext == nullptr || !deviceContext->isInitialized())
4040
throw error_str("Device context is not initialized properly for " + getName());
4141

42-
setEnabled(true);
42+
setEnabled(true);
4343
return ONI_ESUCCESS;
4444
};
4545

@@ -63,3 +63,66 @@ bool OutputClock::updateSettings()
6363

6464
return true;
6565
}
66+
67+
void OutputClock::startAcquisition()
68+
{
69+
}
70+
71+
void OutputClock::addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers)
72+
{
73+
}
74+
75+
void OutputClock::addFrame(oni_frame_t* frame)
76+
{
77+
oni_destroy_frame(frame);
78+
}
79+
80+
void OutputClock::processFrames()
81+
{
82+
}
83+
84+
double OutputClock::getFrequencyHz() const
85+
{
86+
return frequencyHz;
87+
}
88+
89+
void OutputClock::setFrequencyHz(double frequency)
90+
{
91+
frequencyHz = frequency;
92+
}
93+
94+
int32_t OutputClock::getDutyCycle() const
95+
{
96+
return dutyCycle;
97+
}
98+
99+
void OutputClock::setDutyCycle(int32_t dutyCycle_)
100+
{
101+
dutyCycle = dutyCycle_;
102+
}
103+
104+
int32_t OutputClock::getDelay() const
105+
{
106+
return delay;
107+
}
108+
109+
void OutputClock::setDelay(int32_t delay_)
110+
{
111+
delay = delay_;
112+
}
113+
114+
bool OutputClock::getGateRun() const
115+
{
116+
return gateRun;
117+
}
118+
119+
void OutputClock::setGateRun(bool gate, bool writeToRegister)
120+
{
121+
gateRun = gate;
122+
if (writeToRegister) writeGateRunRegister();
123+
}
124+
125+
void OutputClock::writeGateRunRegister()
126+
{
127+
deviceContext->writeRegister(deviceIdx, (oni_reg_addr_t)OutputClockRegisters::GATE_RUN, gateRun ? 1 : 0);
128+
}

Source/Devices/OutputClock.h

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,24 @@ namespace OnixSourcePlugin
4545
public:
4646
OutputClock(std::string name, std::string hubName, const oni_dev_idx_t, std::shared_ptr<Onix1> oni_ctx);
4747

48-
/** Device is always enabled */
4948
int configureDevice() override;
50-
51-
/** Update the settings of the device */
5249
bool updateSettings() override;
50+
void startAcquisition() override;
51+
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override;
52+
void addFrame(oni_frame_t* frame) override;
53+
void processFrames() override;
5354

54-
/** Starts probe data streaming */
55-
void startAcquisition() override {};
56-
57-
/** Stops probe data streaming*/
58-
void stopAcquisition() override {};
59-
60-
/** Given the sourceBuffers from OnixSource, add all streams for the current device to the array */
61-
void addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers) override {};
62-
63-
void addFrame(oni_frame_t* frame) override { oni_destroy_frame(frame); }
64-
65-
void processFrames() override {};
66-
67-
double getFrequencyHz() const { return frequencyHz; }
68-
69-
void setFrequencyHz(double frequency) { frequencyHz = frequency; }
70-
71-
int32_t getDutyCycle() const { return dutyCycle; }
72-
73-
void setDutyCycle(int32_t dutyCycle_) { dutyCycle = dutyCycle_; }
74-
75-
int32_t getDelay() const { return delay; }
55+
double getFrequencyHz() const;
56+
void setFrequencyHz(double frequency);
7657

77-
void setDelay(int32_t delay_) { delay = delay_; }
58+
int32_t getDutyCycle() const;
59+
void setDutyCycle(int32_t dutyCycle_);
7860

79-
bool getGateRun() const { return gateRun; }
61+
int32_t getDelay() const;
62+
void setDelay(int32_t delay_);
8063

81-
void setGateRun(bool gate, bool writeToRegister = false)
82-
{
83-
gateRun = gate;
84-
if (writeToRegister) writeGateRunRegister();
85-
}
64+
bool getGateRun() const;
65+
void setGateRun(bool gate, bool writeToRegister = false);
8666

8767
static OnixDeviceType getDeviceType();
8868

@@ -94,7 +74,7 @@ namespace OnixSourcePlugin
9474

9575
bool gateRun = true;
9676

97-
void writeGateRunRegister() { deviceContext->writeRegister(deviceIdx, (oni_reg_addr_t)OutputClockRegisters::GATE_RUN, gateRun ? 1 : 0); }
77+
void writeGateRunRegister();
9878

9979
JUCE_LEAK_DETECTOR(OutputClock);
10080
};

0 commit comments

Comments
 (0)