This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Object Vis. Parameters
#1
Hi,

I'm hoping someone could assist me in finding how to change the vis. parameters of an Object.

Currently I am using grp.create to create the group but ultimately I would like to set the following via a resident script.

- Control Type
- Decimal Places
- Min Value
- Value Display

Furthermore,
I would like to be able to add groups to the Tag Map via script. Any help is greatly appreciated.

Thanks in advance,
Brent
Reply
#2
You need to add visparams key to grp.create configuration parameters. Visparams is a Lua table where keys depend on object data type. You can check values by logging objects or inspecting database backup. Tags can be passed as a Lua table as well: https://openrb.com/docs/lua.htm#grp.create
Reply
#3
(03.12.2019, 08:07)admin Wrote: You need to add visparams key to grp.create configuration parameters. Visparams is a Lua table where keys depend on object data type. You can check values by logging objects or inspecting database backup. Tags can be passed as a Lua table as well: https://openrb.com/docs/lua.htm#grp.create
Hi admin,

Could you elaborate any on the visparams and and how it is implemented? 

Kind Regards, 
Brent
Reply
#4
Hi,

Just create 1 object with the desired params and perform a log of this object by log(grp.find('1/1/1'))

In the log you can see how you need to reproduce the fields automatically.

BR,

Erwin
Reply
#5
Example:
Code:
grp.create({
  address = '0/0/1',
  datatype = dt.bool,
  name = 'test',
  visparams = {
    control = 'checkbox'
  },
})
Reply


Forum Jump: