23 #include "dcm_utils.h" 31 set_value(AL::ALPtr<AL::DCMProxy> &
dcm,
32 const std::string &device,
const std::string &kind,
33 float value,
int time)
35 AL::ALValue cmd, actcmd, actpos;
37 cmd.arrayPush(device); cmd.arrayPush(kind);
38 actpos.arrayPush(value); actpos.arrayPush(time);
39 actcmd.arrayPush(actpos); cmd.arrayPush(actcmd);
45 std::vector<std::string>
46 get_devices(AL::ALPtr<AL::DCMProxy> &dcm, AL::ALPtr<AL::ALMemoryProxy> &almem,
49 AL::ALValue names = almem->getDataListName();
50 std::string subd_prefix = dcm->getPrefix()[0];
52 std::vector<std::string> rv;
55 for (
unsigned int i = 0; i < names.getSize(); ++i) {
56 std::string name = names[i];
57 if ( name.compare(0, subd_prefix.length(), subd_prefix) == 0 ) {
58 if ( name.compare(name.length() - 5, 5,
"/Type") == 0 ) {
59 std::string dtype = almem->getData(name, 0);
60 std::string base_path = name.substr(0, name.length() - 5);
61 if ( dtype == type ) {
62 rv.push_back(base_path);