Author Topic: Stack Light  (Read 373 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 3338
    • View Profile
    • AdvancedHMI
Stack Light
« on: March 11, 2017, 04:02:33 PM »
This is essentially a revised version of the stack light. The original stack light depended on fixed images for the various colors both on and off. This stack light uses a grayscale image and modifies the image for each color. This will allow more flexibility in colors.

This is only the base control. It will be necessary to use the StackLight.vb within the standard AdvancedHMI project and change its inheritance to point to this stack light.

The images will need to be added to the project Resources.
« Last Edit: March 12, 2017, 08:34:57 AM by Archie »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 3338
    • View Profile
    • AdvancedHMI
Re: Stack Light
« Reply #1 on: March 12, 2017, 11:56:20 AM »
- Download the 3 images and the vb file
- In Solution Explorer, right click the AdvancedHMIControls project and select Properties
- In the Project Properties select the Resources tab
- Select Add Resource->Add Existing file
- Browse to and select the 3 image files

- In Solution Explorer, expand down the AdvancedHMIControls project
- Right click the PurchasedControls folder and select Add->Existing Item
- Browse to the StackLight2.vb file downloaded from above

- In Solution Explorer under the AdvancedHMIControls project, expand down the Controls folder
- Right click StackLight.vb and select View Code
- Look for the line of code that starts with Inherits
- Change it to this:
Inherits StackLight2

- Rebuild the solution
« Last Edit: March 12, 2017, 11:59:04 AM by Archie »

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Stack Light
« Reply #2 on: March 12, 2017, 12:09:11 PM »
Hi

I gave it a go but I get 40 errors. Is there someting I misted??

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 3338
    • View Profile
    • AdvancedHMI
Re: Stack Light
« Reply #3 on: March 12, 2017, 12:21:31 PM »
You did not add the images to the resources

- Download the 3 images and the vb file
- In Solution Explorer, right click the AdvancedHMIControls project and select Properties
- In the Project Properties select the Resources tab
- Select Add Resource->Add Existing file
- Browse to and select the 3 image files

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Stack Light
« Reply #4 on: March 12, 2017, 12:39:36 PM »
Thanks verry much. I went to the wrong resorces map. Now it is working like a charm.

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Stack Light
« Reply #5 on: May 02, 2017, 11:53:07 AM »
I changed the stacklight control a bit. Now You can have 5 lights and with all off them you can choose out of 6 colors.
Namely red, green, amber, yellow, white and blue.
Download these files and the image files from above. Then first delete the stacklight control from the controls folder. Than go to the AdvancedHMIControls project and then go to add -> existing item. And add the two files.
For the three images. You should do this.

In Solution Explorer, right click the AdvancedHMIControls project and select Properties
- In the Project Properties select the Resources tab
- Select Add Resource->Add Existing file
- Browse to and select the 3 image files

After thet rebuild and done.
When you like to use the stacklight use the "StackLightHMI_5Pos" from the toolbox.
I hope it will be of any use to someone.