#pragma once #include "ReadEcgLsbCommand.h" namespace Incart::DeviceComplexCommands { class CardiographReadEcgLsbCommand final : public Usb::ReadEcgLsbCommand { private: const float m_lsb = (double)625000/pow(2,24); int32_t m_channelCount; public: CardiographReadEcgLsbCommand(uint32_t uid, int32_t channelCount) : Usb::ReadEcgLsbCommand(uid), m_channelCount(channelCount) { } public: std::shared_ptr execute() override { std::vector lsbList; for (int i = 0; i < m_channelCount; i++) { lsbList.push_back(Usb::SignalLsbInfo{m_lsb, 0}); } emit answerIsReady(this, lsbList, std::make_shared(Usb::DeviceCommand::EStatus::OK)); return std::make_shared(Usb::DeviceCommand::EStatus::OK); } }; } // namespace Incart::DeviceComplexCommands