Hmm no. I'll give you a couple of pointers, but have you watched the videos in Inductive University to learn about Ignition ? This is a great resource to get started.
Ignition uses two main languages, the python language (this is really Jython but let's not get you lost into details) and the expression language created specifically for ignition.
When using an expression, the functions are different from Python, you can see the syntax of each function using the sigma symbol on the right.
The syntax of the if()
function for the expression language is the following :
if(CONDITION,RESULT IF CONDITION IS TRUE, RESULT IF CONDITION IS FALSE)
.
If you need multiple conditions, then use another if() if the "RESULT IF CONDITION IS FALSE".
In the expression language, "and" is replaced by "&&".
I might be wrong, but you can't use wildcards the way you're using them. [RTP_Particle_Counter]*/...
wont work. If you need a summary of a lot of tag paths, you'll have to do it differently. Have a look at system.tag.query for example or use @pturmel 's module using his tags
function.
You've created a property "state" in the props.style
of your component. Consider creating a custom property instead, as state is not an appropriate property to specify in style. Whenever you need something non-standard, use customs.
It's also better to always declare your custom at root-level or view-level to get rid of the nuisance of dealing with relative or absolute component paths.
Last one, when using a transform on a property, you don't have to assign the return value to the property again, this is automatic.
For example, if you create an expression binding on the custom.state
property of your component, and use the following expression : if({[provider]path/to/tag}, 1, 0)
then your state
custom property will be equal to 1 if the tag is equal to True or 1, else it will be 0. You don't have to specify in the expression this.custom.state = 1
, this is implicit whenever you create a binding on a property. (this is just an example, the if() example here makes no sense as you could just create a tag binding to get the value but just wanted to get my point accross).
Please have a look at Inductive University first. I've given you some pointers but I believe the current knowledge you have will result in development that will have to be refactored later on.
Welcome to the Ignition world, this is a great world, but it requires a bit of knowledge beforehand