Author Topic: Change stacklight  (Read 1056 times)

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Change stacklight
« on: April 14, 2017, 02:34:47 PM »
Hello all,

I am trying to change the stacklightcontrol in this post:

http://advancedhmi.com/forum/index.php?topic=1676.0

I have now 5 positions and one position I can change the color.
The thing is now that if I sellect the control from the toolbox you can see all 5 postions (so far so good) If I change the fifth position to either "none" of an other color the fift position goes away (stil good).
But if al resellect it it should be enabled again and that is not going oke. I have noticed that it looks like it is enabling but the whole stacklight is drawn wrong the lowest position is now over the base.
I have looked in the code but I can't find anything. I am a complete beginner with VB so it is not so easy for me. I hope that someone can have a look at it.

I have attached the control that i am working on.

Thanks in advance

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Change stacklight
« Reply #1 on: April 15, 2017, 03:20:57 PM »
The original control posted by Archie works fine for adding/removing any of the lights.

You can try using controls attached in this post, which have been modified to have 5 lights (brightness was also slightly modified but can be changed).

It is sufficient to add both controls to the PurchasedControls folder and rebuild the solution (you should consider removing the existing StackLight controls first).

StackLightHMI would be the control that you would drop on the form.
« Last Edit: April 15, 2017, 11:11:43 PM by Godra »

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Change stacklight
« Reply #2 on: April 16, 2017, 09:49:51 AM »
I am yusing the "stacklight2" control to try and modify it to my needs. The "stacklight2" control has 4 positions (if you buy a stacklight it can have up to 5 positions). And in this control every color has his fixed position. I want to try and make the control that you can change the color of all the positions in what you want. (you can buy white, blue, green, yellow, red, amber and a beeper). But it looks like that the control is drawn wrong if I change the white light.
I hope someone can help me.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Change stacklight
« Reply #3 on: April 16, 2017, 11:53:08 AM »
The StackLight control is functional as it is and Archie provided the code so you could modify it to your needs.

Since, as you suggested, you lack programming skills necessary to perform such modifications then I would suggest you place your request in the "Feature Request" category and hopefully that requested feature becomes available in the future.

If you do decide to continue experimenting on your own then here is a tip for you:

The placement of the lights is determined by the image numbers which you can always change inside the RefreshImage sub as well as inside the properties. Starting from the bottom of the StackLight these numbers go in pairs as (0, 1), (2, 3) ... etc