Replies: 2 comments
-
Bonjour, voilà le composite que vous voulez je pense, il faut lier à la valeur de votre PID et conditionner l'affichage de votre image par script presque comme vous l'aviez fait.
Attention cependant, j'ai remarqué que vos images n'ont pas toutes la même taille ce qui peut gêner pour le reste de l'interface, il vous faudrait soit agrandir les images à la tailles de celles qui prend le plus de place ou alors prévoir l'espace nécessaire pour permettre un affichage correct |
Beta Was this translation helpful? Give feedback.
0 replies
-
Parfait! Ca fonctionne |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bonjour,
Je souhaite réaliser un composite multi-images a partir d'une variable analogique
Par exemple: En fonction d'une sortie PID 0-100%, je voudrais avoir plusieurs images qui représentent une Vanne 3 voies qui s'ouvre avec Valeur=0% -> image 1 / 0<Valeur<=10% -> Image 2 / etc...
J'ai commencé à éditer ce composite, mais impossible de le faire fonctionner:
SYNAPPS-STUDIO-COMPOSITE|{"config":{"key":"composite6","name":"Vanne 3 Voies","properties":{"width":"200px"},"additionalDefs":{"img0":{"type":"picture","value":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAABNCAYAAADzaadsAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAPrSURBVHhe7ZtLTxNRFID5FSiBUkot5SHyRuTRBy2VpoA8GlABERIeokAagWBcGGOMiejGnTs3Bv0FGhMwMWKIiYkJBI3EhWBMMJHIxnR37BkzI+2cgZnptDNt7uJLbm7nnjlf7/TMGUozACCtEU28XH4FoZvzhuLX3l4kteg85SKaYIJHMDYzCf0jQ+Dv7IC2ni5uPBGaJo+ViyEEB0dHwF5yEjKPZ5OUVlRyx1Brj0JXwemF6+A+6yOlKPBYXEPFkkI3wZFr42CzF5Mih4Fr8FKmYlLoJlh8qowUkANeslRMCl0EfW0BMnElYBGiYseSdEG8NLOyc8mk1YCxcEcPgp9Vj9/PcfvOXVh69hxWV98JrG9sRNKNzp1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qMiAEVyJKIXcTm7JFIsTbTOzFDptd6TEitjUybUuOG1iseHAZZVI2K0QsSnediKR4bKzyjJlCsuU3LBMGWCZMollSm7ck6b+/fYT/LBthVBkuLy+thJ/PNN+W7n2zzmSqTcgQnVx5swZochw4cpfOW60UV1YpkIQV6aYRcWLhULDYf/4ARpKPW400QW+3LcP+QULhWKNcLk9eOLJp2gY9ZjRRhi82xEG724w538WmU6yN6czYQAAAABJRU5ErkJggg=="},"txtValeur":{"type":"number","label":"Mesure","value":0}}},"leadActor":{"type":"layout/stack","key":"stackRoot","children":[{"type":"display/text","key":"textValeur","bindings":{"properties.content":"[email protected]"},"events":{"properties/content/onValueChanged":["return parseFloat(context.utils.isNone(context.value) ? 0 : context.value);"]}},{"type":"display/image","key":"image2","additionalDefs":{"Valeur":{"type":"number"}},"additionals":{"Valeur":0},"properties":{"horizontalAlignment":"expand","verticalAlignment":"expand"},"bindings":{"properties.content":"[email protected]","additionals.Valeur":"actor#[email protected]"},"events":{"properties/content/binding/onReadTransform":["var maValeur = context.value;","var monImage","","if (maValeur = 0) {"," this.properties.monImage = this.stage.properties.img0","};","","if (0 < maValeur < 10) {"," this.properties.monImage = this.stage.properties.img1","};","","if (10 <= maValeur < 20) {"," this.properties.monImage = this.stage.properties.img2","};","","if (20 <= maValeur < 30) {"," this.properties.monImage = this.stage.properties.img3","};","","return monImage;"],"additionals/Valeur/onValueChanged":["return context.utils.isNone(context.value) ? 0 : context.value;"]}}],"properties":{"orientation":"horizontal"}}}
Merci d'avance de votre retour
Beta Was this translation helpful? Give feedback.
All reactions