Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARRUS-116: Exposed the number of us4oems and FPGA temperature in the us4r API. #249

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arrus/core/api/devices/us4r/Us4OEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Us4OEM : public Device, public TriggerGenerator {

virtual double getSamplingFrequency() = 0;

virtual float getFPGATemperature() = 0;

Us4OEM(Us4OEM const&) = delete;
Us4OEM(Us4OEM const&&) = delete;
void operator=(Us4OEM const&) = delete;
Expand Down
10 changes: 10 additions & 0 deletions arrus/core/api/devices/us4r/Us4R.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ class Us4R : public DeviceWithComponents {
*/
virtual void setRxSettings(const RxSettings &settings) = 0;

/**
* Returns the number of us4OEM modules that are used in this us4R system.
*/
virtual uint8_t getNumberOfUs4OEMs() = 0;

/**
* Returns us4R device sampling frequency.
*/
virtual float getSamplingFrequency() const = 0;

virtual void start() = 0;
virtual void stop() = 0;

Expand Down
8 changes: 8 additions & 0 deletions arrus/core/devices/us4r/Us4RImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,12 @@ void Us4RImpl::setActiveTermination(std::optional<uint16> value) {
setRxSettings(newRxSettings);
}

uint8_t Us4RImpl::getNumberOfUs4OEMs() {
return us4oems.size();
}

float Us4RImpl::getSamplingFrequency() const {
return us4oems[0]->getSamplingFrequency();
}

}
2 changes: 2 additions & 0 deletions arrus/core/devices/us4r/Us4RImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class Us4RImpl : public Us4R {
void setLpfCutoff(uint32 value) override;
void setDtgcAttenuation(std::optional<uint16> value) override;
void setActiveTermination(std::optional<uint16> value) override;
uint8_t getNumberOfUs4OEMs() override;
float getSamplingFrequency() const override;

private:
UltrasoundDevice *getDefaultComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class MockUs4OEM : public Us4OEMImplBase {
(override));
MOCK_METHOD(Interval<Voltage>, getAcceptedVoltageRange, (), (override));
MOCK_METHOD(double, getSamplingFrequency, (), (override));
MOCK_METHOD(float, getFPGATemperature, (), (override));
MOCK_METHOD(void, startTrigger, (), (override));
MOCK_METHOD(void, stopTrigger, (), (override));
MOCK_METHOD(void, start, (), (override));
Expand Down
4 changes: 3 additions & 1 deletion arrus/core/devices/us4r/us4oem/Us4OEMImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ inline void Us4OEMImpl::setActiveTerminationAfe(std::optional<uint16> param, boo
}
}


float Us4OEMImpl::getFPGATemperature() {
return ius4oem->GetFPGATemp();
}

}
1 change: 1 addition & 0 deletions arrus/core/devices/us4r/us4oem/Us4OEMImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class Us4OEMImpl : public Us4OEMImplBase {

std::vector<uint8_t> getChannelMapping() override;
void setRxSettings(const RxSettings &newSettings) override;
float getFPGATemperature() override;

private:
using Us4OEMBitMask = std::bitset<Us4OEMImpl::N_ADDR_CHANNELS>;
Expand Down