Skip to content

Commit

Permalink
Changed goal to value for bps
Browse files Browse the repository at this point in the history
  • Loading branch information
wardru committed Nov 21, 2023
1 parent 4355699 commit f9953c3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ set(SPDLOG_FMT_EXTERNAL 1)
find_package(spdlog REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(PahoMqttCpp REQUIRED)
find_package(magic_enum REQUIRED)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(GTest REQUIRED)
Expand Down Expand Up @@ -55,7 +54,6 @@ target_link_libraries(${LIBRARY_NAME}
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:PahoMqttCpp::paho-mqttpp3-static>
spdlog::spdlog
nlohmann_json::nlohmann_json
magic_enum::magic_enum
)

if (CMAKE_SYSTEM_NAME MATCHES "Windows" AND BUILD_SHARED_LIBS)
Expand Down
1 change: 0 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def requirements(self):
self.requires("paho-mqtt-cpp/[>=1.2.0]")
self.requires("spdlog/[>=1.11.0]")
self.requires("nlohmann_json/[>=3.11.2]")
self.requires("magic_enum/[>=0.9.2]")
if self.settings.os == "Linux":
self.requires("gtest/cci.20210126")
self.requires("cppcheck/[>=2.10]")
Expand Down
2 changes: 0 additions & 2 deletions source/pza/core/client.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <nlohmann/json.hpp>
#include <spdlog/spdlog.h>

#include <magic_enum.hpp>

#include <pza/core/core.hxx>
#include <pza/core/device_factory.hxx>
#include <pza/utils/json.hxx>
Expand Down
4 changes: 1 addition & 3 deletions source/pza/core/device_factory.hxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include <magic_enum.hpp>

#include <pza/core/device.hxx>
#include <pza/devices/bps.hxx>

Expand All @@ -26,4 +24,4 @@ namespace pza
private:
using factory_function = std::function<device::ptr(const std::string &group, const std::string &name)>;
};
};
};
10 changes: 5 additions & 5 deletions source/pza/interfaces/bps_chan_ctrl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ bps_chan_ctrl::bps_chan_ctrl(device *device, const std::string &name)
_att_current("current"),
_enable("enable")
{
_att_voltage.add_rw_field<double>("goal");
_att_voltage.add_rw_field<double>("value");
_att_voltage.add_ro_field<double>("min");
_att_voltage.add_ro_field<double>("max");
_att_voltage.add_ro_field<int>("decimals");

_att_current.add_rw_field<double>("goal");
_att_current.add_rw_field<double>("value");
_att_current.add_ro_field<double>("min");
_att_current.add_ro_field<double>("max");
_att_current.add_ro_field<int>("decimals");
Expand All @@ -36,7 +36,7 @@ int bps_chan_ctrl::set_voltage(double volts)
return -1;
}

return _att_voltage.get_field<double>("goal").set(volts);
return _att_voltage.get_field<double>("value").set(volts);
}

int bps_chan_ctrl::set_current(double amps)
Expand All @@ -49,7 +49,7 @@ int bps_chan_ctrl::set_current(double amps)
return -1;
}

return _att_current.get_field<double>("goal").set(amps);
return _att_current.get_field<double>("value").set(amps);
}

int bps_chan_ctrl::set_enable(bool enable)
Expand All @@ -75,4 +75,4 @@ void bps_chan_ctrl::add_enable_callback(const std::function<void(bool)> &callbac
void bps_chan_ctrl::remove_enable_callback(const std::function<void(bool)> &callback)
{
_enable.get_field<bool>("value").remove_get_callback(callback);
}
}

0 comments on commit f9953c3

Please sign in to comment.