forked from daneos/lutango
better read attributes test script
This commit is contained in:
parent
fe640b0ae0
commit
b07072a5a8
@ -171,7 +171,7 @@ void push_attr_number(lua_State* L, Tango::DeviceAttribute attr)
|
|||||||
attr >> v;
|
attr >> v;
|
||||||
lua_pushnumber(L, v);
|
lua_pushnumber(L, v);
|
||||||
}
|
}
|
||||||
else if(fmt == Tango::SPECTRUM || fmt == Tango::IMAGE)
|
else if(fmt == Tango::SPECTRUM)
|
||||||
{
|
{
|
||||||
std::vector<T> v;
|
std::vector<T> v;
|
||||||
attr >> v;
|
attr >> v;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
local lut = require "lutango"
|
local lut = require "lutango"
|
||||||
lut.log:set_log_level(lut.log.level.TRACE)
|
lut.log:set_log_level(lut.log.level.TRACE)
|
||||||
|
|
||||||
dp = lut.DeviceProxy(arg[1])
|
local dp = lut.DeviceProxy(arg[1] or "sys/tg_test/1")
|
||||||
|
|
||||||
print("Attempting to write core function")
|
print("Attempting to write core function")
|
||||||
dp.get_attribute_list = 120
|
dp.get_attribute_list = 120
|
||||||
|
|||||||
@ -2,13 +2,21 @@ local lut = require "lutango"
|
|||||||
|
|
||||||
lut.log:set_log_level(lut.log.level.WARNING)
|
lut.log:set_log_level(lut.log.level.WARNING)
|
||||||
|
|
||||||
dp = lut.DeviceProxy(arg[1])
|
local dp = lut.DeviceProxy(arg[1] or "sys/tg_test/1")
|
||||||
al = dp:get_attribute_list()
|
local attrlist = dp:get_attribute_list()
|
||||||
|
|
||||||
for _,v in ipairs(al) do
|
for _,v in ipairs(attrlist) do
|
||||||
if v ~= "no_value" and v ~= "throw_exception" then
|
if v ~= "no_value" and v ~= "throw_exception" then
|
||||||
io.write(v.." = ")
|
local r = dp[v]
|
||||||
print(dp[v])
|
io.write(v.." = "..tostring(r))
|
||||||
|
if type(r) == "table" then
|
||||||
|
io.write(": {")
|
||||||
|
for _,i in ipairs(r) do
|
||||||
|
io.write(tostring(i)..", ")
|
||||||
|
end
|
||||||
|
io.write("}")
|
||||||
|
end
|
||||||
|
print()
|
||||||
else
|
else
|
||||||
print("-- Can't handle that yet: "..v)
|
print("-- Can't handle that yet: "..v)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
local lut = require "lutango"
|
local lut = require "lutango"
|
||||||
lut.log:set_log_level(lut.log.level.WARNING)
|
lut.log:set_log_level(lut.log.level.WARNING)
|
||||||
|
|
||||||
dp = lut.DeviceProxy(arg[1] or "sys/tg_test/1")
|
local dp = lut.DeviceProxy(arg[1] or "sys/tg_test/1")
|
||||||
|
|
||||||
function run_void_cmd(cmd)
|
function run_void_cmd(cmd)
|
||||||
io.write(cmd.."(): ")
|
io.write(cmd.."(): ")
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
local lut = require "lutango"
|
local lut = require "lutango"
|
||||||
lut.log:set_log_level(lut.log.level.WARNING)
|
lut.log:set_log_level(lut.log.level.WARNING)
|
||||||
|
|
||||||
dp = lut.DeviceProxy(arg[1])
|
dp = lut.DeviceProxy(arg[1] or "sys/tg_test/1")
|
||||||
|
|
||||||
dp.ampli = dp.ampli + 1
|
dp.ampli = dp.ampli + 1
|
||||||
local b = dp.boolean_scalar
|
local b = dp.boolean_scalar
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user