Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-09-21 15:18:51

rexpeter
Member
Registered: 2016-09-06
Posts: 67

Image Changer example request

Hi,

I'm intending to use some animations of a simply drawing presenting for instance a bulb that is either ON or OFF indicated by a different color.
How to implement that?
I assume the Image Changer would be the tool for that, but I don't understand how to use that one.
If there is anything written or used as example somewhere, that would be great.

Thanks,
Peter

Offline

#2 2018-09-24 21:24:24

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Image Changer example request

Hi Peter,

thank you for your question. Image Changer could be used to achieve described behaviour however it is also possible to use just "opacity" animation (ON image shown/ OFF hidden and vice versa). For more complicated cases I would go for the image changer.
The documentation can be found here: https://www.rexygen.com/doc/PDF/ENGLISH … df#page=22

Please, be aware that there are documentation generator accidentally discarded brackets "{}" in "imagePath" parameter. The "imagePath" parameter in case of using "appendKey" option should look like: /hmi/images/img-{0}.png
The substring "{0}" in the file name will be replaced with any current read value (number, string, ...).)

I also recommend you to have a look at example "0301 - 08 HMI Animation DEMO" which is part of installation. It will give you an idea how to use various animations in REXYGEN HMI Designer.

Hope it will help you. If you run into any troubles, let me know.

Cheers, Tomas

Offline

#3 2018-09-24 22:23:52

rexpeter
Member
Registered: 2016-09-06
Posts: 67

Re: Image Changer example request

Thanks a lot Tomas,
I will have a look at it and give it a trial.

Best regards,
Peter

Offline

#4 2018-11-01 19:22:07

rexpeter
Member
Registered: 2016-09-06
Posts: 67

Re: Image Changer example request

Hi Tomas,

Thanks for your assistance.
It is clear now to me and for the convenience of others I have posted an example project (edited by admin, see next post for explanation).

screenshot_Imagechanger.png

This is how the HMI looks like with factually 5 "images" that will change upon pressing the "demo button".
The images show the settings of the component.
The last image is showing where and HOW the files are stored in the HMI folder.

Edited by admin, see next post for explanation:
NOTE: please make sure you have switched OFF the GenerateRexHMI parameter in the HMI block!
HMI-block-properties.png
If you have that one ON, the HMI folder will be overwritten and all the images that you want to show will be gone!

Regards,
Peter

Last edited by jaroslav_sobota (2018-11-02 12:38:25)

Offline

#5 2018-11-02 12:32:38

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: Image Changer example request

Hi Peter,
thanks for the example! Though I had to modify it a bit and here is the updated example project.

Let me explain the modifications:

  1. The PNG pictures should be placed in the hmisrc/images subfolder inside the project folder. That way all the pictures will be included in the resulting HMI. See the HMI block documentation for details.

  2. The HMI:GenerateRexHMI parameter should be set to on. That way the SVG source file is automatically processed during project compilation, giving you the most up-to-date HMI without any effort.

  3. It is recommended not to remove the block type from its name, so I changed the name of the block in your task to CNI_ImageChanger.

  4. I have updated the connection strings in the SVG file, so that it correlates with step 3.

  5. I have updated the description in the SVG file (information about path)

The resulting HMI looks like this:
ImageChangerHMI.png

I also noticed there is some bug in the Switch element, which prevents it from animating. Normally the switch is supposed to rotate as you click it.

Thanks again for your post!

Kind regards,
Jaroslav

Offline

#6 2018-11-04 20:35:23

rexpeter
Member
Registered: 2016-09-06
Posts: 67

Re: Image Changer example request

Hi Jaroslav,

Thank you for the update on this. This certainly will help as there are things that I was not aware of, just figured out by trial and error. Now I'm getting a learning lesson from a professional :-)
Thanks a lot, this helps me and I hope others will benefit of this as well.

Best regards,
Peter

Offline

Board footer

Powered by FluxBB