Cleanup / refactor "pipe" names for clarity

This commit is contained in:
Charles J. Cliffe
2015-07-30 20:36:06 -04:00
parent 10e35002f1
commit c1774ee96a
5 changed files with 69 additions and 61 deletions
+23 -23
View File
@@ -22,7 +22,7 @@
IMPLEMENT_APP(CubicSDR)
CubicSDR::CubicSDR() : appframe(NULL), m_glContext(NULL), frequency(0), offset(0), ppm(0), snap(1), sampleRate(DEFAULT_SAMPLE_RATE), directSamplingMode(0),
sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqPostDataQueue(NULL), iqVisualQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL) {
sdrThread(NULL), sdrPostThread(NULL), pipeSDRCommand(NULL), pipeSDRIQData(NULL), pipeIQVisualData(NULL), pipeAudioVisualData(NULL), t_SDR(NULL), t_PostSDR(NULL) {
}
@@ -52,24 +52,24 @@ bool CubicSDR::OnInit() {
directSamplingMode = 0;
// Visual Data
iqVisualQueue = new DemodulatorThreadInputQueue();
iqVisualQueue->set_max_num_items(1);
pipeIQVisualData = new DemodulatorThreadInputQueue();
pipeIQVisualData->set_max_num_items(1);
audioVisualQueue = new DemodulatorThreadOutputQueue();
audioVisualQueue->set_max_num_items(1);
pipeAudioVisualData = new DemodulatorThreadOutputQueue();
pipeAudioVisualData->set_max_num_items(1);
// I/Q Data
iqPostDataQueue = new SDRThreadIQDataQueue;
threadCmdQueueSDR = new SDRThreadCommandQueue();
pipeSDRIQData = new SDRThreadIQDataQueue;
pipeSDRCommand = new SDRThreadCommandQueue();
sdrThread = new SDRThread();
sdrThread->setInputQueue("SDRCommandQueue",threadCmdQueueSDR);
sdrThread->setOutputQueue("IQDataOutput",iqPostDataQueue);
sdrThread->setInputQueue("SDRCommandQueue",pipeSDRCommand);
sdrThread->setOutputQueue("IQDataOutput",pipeSDRIQData);
sdrPostThread = new SDRPostThread();
sdrPostThread->setNumVisSamples(16384 * 2);
sdrPostThread->setInputQueue("IQDataInput", iqPostDataQueue);
sdrPostThread->setOutputQueue("IQVisualDataOut", iqVisualQueue);
sdrPostThread->setInputQueue("IQDataInput", pipeSDRIQData);
sdrPostThread->setOutputQueue("IQVisualDataOut", pipeIQVisualData);
std::vector<SDRDeviceInfo *>::iterator devs_i;
@@ -153,11 +153,11 @@ int CubicSDR::OnExit() {
delete sdrPostThread;
delete t_PostSDR;
delete threadCmdQueueSDR;
delete pipeSDRCommand;
delete iqVisualQueue;
delete audioVisualQueue;
delete iqPostDataQueue;
delete pipeIQVisualData;
delete pipeAudioVisualData;
delete pipeSDRIQData;
delete m_glContext;
@@ -203,7 +203,7 @@ void CubicSDR::setFrequency(long long freq) {
frequency = freq;
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_TUNE);
command.llong_value = freq;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
}
long long CubicSDR::getOffset() {
@@ -214,7 +214,7 @@ void CubicSDR::setOffset(long long ofs) {
offset = ofs;
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_SET_OFFSET);
command.llong_value = ofs;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
config.getDevice(dev->getDeviceId())->setOffset(ofs);
@@ -224,7 +224,7 @@ void CubicSDR::setDirectSampling(int mode) {
directSamplingMode = mode;
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_SET_DIRECT_SAMPLING);
command.llong_value = mode;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
config.getDevice(dev->getDeviceId())->setDirectSampling(mode);
@@ -249,11 +249,11 @@ long long CubicSDR::getFrequency() {
}
DemodulatorThreadOutputQueue* CubicSDR::getAudioVisualQueue() {
return audioVisualQueue;
return pipeAudioVisualData;
}
DemodulatorThreadInputQueue* CubicSDR::getIQVisualQueue() {
return iqVisualQueue;
return pipeIQVisualData;
}
DemodulatorMgr &CubicSDR::getDemodMgr() {
@@ -271,7 +271,7 @@ void CubicSDR::setSampleRate(long long rate_in) {
sampleRate = rate_in;
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_SET_SAMPLERATE);
command.llong_value = rate_in;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
setFrequency(frequency);
}
@@ -295,7 +295,7 @@ void CubicSDR::setDevice(int deviceId) {
sdrThread->setDeviceId(deviceId);
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_SET_DEVICE);
command.llong_value = deviceId;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
SDRDeviceInfo *dev = (*getDevices())[deviceId];
DeviceConfig *devConfig = config.getDevice(dev->getDeviceId());
@@ -326,7 +326,7 @@ void CubicSDR::setPPM(int ppm_in) {
SDRThreadCommand command(SDRThreadCommand::SDR_THREAD_CMD_SET_PPM);
command.llong_value = ppm;
threadCmdQueueSDR->push(command);
pipeSDRCommand->push(command);
SDRDeviceInfo *dev = (*getDevices())[getDevice()];