Community Tip - You can change your system assigned username to something more personal in your community settings. X
Boa tarde, conforme orientação do Ewerton Moreira gostaria de compartilhar uma dificuldade que estou tento no Thingworx View.
Na aplicação que estou construindo os principais componentes possuem Model Items, nesse caso um Compressor, dois Inversores de Frequência e dois Ventiladores.
O equipamento possui monitoramento IoT através do Thingworx Composer. Todos esses componentes que citei possuem propriedades no Thingworx que monitoram seus Status. Então o objetivo é atribuir uma cor específica para os Models Items de acordo com uma propriedade no Thingworx.
Qual a forma que foi feita?
- Inicialmente o teste foi feito com o Model Item Compressor.
- No Composer crei uma propriedade chamada "cor_compressor". E criei um serviço "Cores" com o seguinte script:
if(me.Compressor_TENSAO_COMP > 10.0) {
me.cor_compressor = "rgb(31,131,5)";
}
else me.cor_compressor = "rgb(0,0,0)";
- No Studio associei a propriedade externa "cor_compressor" com "Color" do Model Item Compressor.
Resultado:
A variável é atualizada corretamente (fiz o teste colocando um Label com o Valor na tela), e no preview no PC as cores mudam corretamente:
Porém, no dispositivo (tablet ou Smartphone) o item não muda de cor.
Desde já, agradeço.
Eng Christyam Alcantara
This is an use case that the customer has where he wants to change the model item color based on a property from TWX. He created a service in TWX that sets the variable cor_compressor
if(me.Compressor_TENSAO_COMP > 10.0) {
me.cor_compressor = "rgb(31,131,5)";
}
else me.cor_compressor = "rgb(0,0,0)";
After this they link this property to the model link color.
It is working in the PREVIEW but not in the View App.
Adding @giri for help
Ewerton Moreira Christyam Silva Can you please try the resolution suggested in the article - https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS251748&lang=en_US
giri,
I looked at the support and it is teaching how to change the color. This is already done in the app and it is working in the preview but it is not working in the App.
I will ask Christyam Silva to take a look and try to implement it but what he really wants is that this value is driven from TWX.
Thanks
Ewerton
If that is the case, I would contemplate on connection b/w TWX and Studio/ES, or atleast delay in connection. Also, may be the entity built in TWX is not being accessible.
Hi giri, We tested your recommendation and it is working.
I believe this Application Parameter did the trick. We also were using rgb() instead of rgba().
We were having issues with the gauges updating and it worked when we started using the Application Parameter.\
Sushant Pandey, thanks for helping too!
btw giri Sushant Pandey,
Looks like the solution worked well for Android devices but still did not work for iOS.
Any idea why?
Cheers