mirror of https://github.com/EspoTek/Labrador.git
isoBuffer stores raw pointer
This commit is contained in:
parent
b4f54d5d99
commit
5e185ba08c
|
@ -29,15 +29,15 @@ constexpr double kTriggerSensitivityMultiplier = 4;
|
||||||
isoBuffer::isoBuffer(QWidget* parent, int bufferLen, isoDriver* caller, unsigned char channel_value)
|
isoBuffer::isoBuffer(QWidget* parent, int bufferLen, isoDriver* caller, unsigned char channel_value)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_channel(channel_value)
|
, m_channel(channel_value)
|
||||||
, m_buffer(std::make_unique<short[]>(bufferLen*2))
|
, m_bufferPtr(std::make_unique<short[]>(bufferLen*2))
|
||||||
, m_bufferLen(bufferLen)
|
, m_bufferLen(bufferLen)
|
||||||
, m_samplesPerSecond(bufferLen/21.0/375*VALID_DATA_PER_375)
|
, m_samplesPerSecond(bufferLen/21.0/375*VALID_DATA_PER_375)
|
||||||
, m_sampleRate_bit(bufferLen/21.0/375*VALID_DATA_PER_375*8)
|
, m_sampleRate_bit(bufferLen/21.0/375*VALID_DATA_PER_375*8)
|
||||||
, m_virtualParent(caller)
|
, m_virtualParent(caller)
|
||||||
{
|
{
|
||||||
|
m_buffer = m_bufferPtr.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void isoBuffer::insertIntoBuffer(short item)
|
void isoBuffer::insertIntoBuffer(short item)
|
||||||
{
|
{
|
||||||
m_buffer[m_back] = item;
|
m_buffer[m_back] = item;
|
||||||
|
|
|
@ -98,7 +98,8 @@ public:
|
||||||
bool m_serialAutoScroll = true;
|
bool m_serialAutoScroll = true;
|
||||||
|
|
||||||
// Internal Storage
|
// Internal Storage
|
||||||
std::unique_ptr<short[]> m_buffer;
|
std::unique_ptr<short[]> m_bufferPtr;
|
||||||
|
short* m_buffer;
|
||||||
uint32_t m_back = 0;
|
uint32_t m_back = 0;
|
||||||
uint32_t m_insertedCount = 0;
|
uint32_t m_insertedCount = 0;
|
||||||
uint32_t m_bufferLen;
|
uint32_t m_bufferLen;
|
||||||
|
|
Loading…
Reference in New Issue