diff --git a/arrus/core/api/devices/us4r/Us4R.h b/arrus/core/api/devices/us4r/Us4R.h index 095d4b593..a2b5ac149 100644 --- a/arrus/core/api/devices/us4r/Us4R.h +++ b/arrus/core/api/devices/us4r/Us4R.h @@ -68,6 +68,27 @@ class Us4R : public DeviceWithComponents { */ virtual void setVoltage(Voltage voltage) = 0; + /** + * Returns configured HV voltage. + * + * @return hv voltage value configured on device [V] + */ + virtual unsigned char getVoltage() = 0; + + /** + * Returns measured HV voltage (plus). + * + * @return hv voltage measured by device [V] + */ + virtual float getMeasuredPVoltage() = 0; + + /** + * Returns measured HV voltage (minus). + * + * @return hv voltage measured by devivce [V] + */ + virtual float getMeasuredMVoltage() = 0; + /** * Disables HV voltage. */ diff --git a/arrus/core/devices/us4r/Us4RImpl.cpp b/arrus/core/devices/us4r/Us4RImpl.cpp index 199b7ef41..ec02a38da 100644 --- a/arrus/core/devices/us4r/Us4RImpl.cpp +++ b/arrus/core/devices/us4r/Us4RImpl.cpp @@ -68,6 +68,21 @@ void Us4RImpl::setVoltage(Voltage voltage) { hv.value()->setVoltage(voltage); } +unsigned char Us4RImpl::getVoltage() { + ARRUS_REQUIRES_TRUE(hv.has_value(), "No HV have been set."); + return hv.value()->getVoltage(); +} + +float Us4RImpl::getMeasuredPVoltage() { + ARRUS_REQUIRES_TRUE(hv.has_value(), "No HV have been set."); + return hv.value()->getMeasuredPVoltage(); +} + +float Us4RImpl::getMeasuredMVoltage() { + ARRUS_REQUIRES_TRUE(hv.has_value(), "No HV have been set."); + return hv.value()->getMeasuredMVoltage(); +} + void Us4RImpl::disableHV() { logger->log(LogSeverity::INFO, "Disabling HV"); ARRUS_REQUIRES_TRUE(hv.has_value(), "No HV have been set."); diff --git a/arrus/core/devices/us4r/Us4RImpl.h b/arrus/core/devices/us4r/Us4RImpl.h index 9a66b5e6f..305fdae82 100644 --- a/arrus/core/devices/us4r/Us4RImpl.h +++ b/arrus/core/devices/us4r/Us4RImpl.h @@ -128,6 +128,9 @@ class Us4RImpl : public Us4R { float getSamplingFrequency() const override; void checkState() const override; std::vector getChannelsMask() override; + unsigned char getVoltage() override; + float getMeasuredPVoltage() override; + float getMeasuredMVoltage() override; private: UltrasoundDevice *getDefaultComponent(); diff --git a/arrus/core/devices/us4r/hv/HighVoltageSupplier.h b/arrus/core/devices/us4r/hv/HighVoltageSupplier.h index d5de5d9a5..52ced4b6a 100644 --- a/arrus/core/devices/us4r/hv/HighVoltageSupplier.h +++ b/arrus/core/devices/us4r/hv/HighVoltageSupplier.h @@ -39,6 +39,18 @@ class HighVoltageSupplier : public Device { } } + unsigned char getVoltage() { + return hv->GetHVVoltage(); + } + + float getMeasuredPVoltage() { + return hv->GetMeasuredHVPVoltage(); + } + + float getMeasuredMVoltage() { + return hv->GetMeasuredHVMVoltage(); + } + void disable() { try { hv->DisableHV();