Hi
When using Flowcode V5 it was so very easy to place two custom images for OFF / MID / ON
Placed on the dashboard panel static picture ON when pressed is replaced with static picture OFF
I have been trying to edit the base switch in V8 and V9 to create a new component and modify to replicate this very simple button press.
Have found it very difficult to navigate through the GUI and the exposed component folders to get this.
Can you provide a working example so I can see how it was created.
Thanks
Simple switch edit
Moderator: Benj
-
- Posts: 11
- Joined: Mon Oct 06, 2014 12:55 pm
- Location: Somerset, UK
- Been thanked: 1 time
- Contact:
Simple switch edit
- Attachments
-
- OFF.png (13.1 KiB) Viewed 2308 times
-
- ON.png (12.62 KiB) Viewed 2308 times
-
- Switch 2png_ON-OFF.fcfx
- (7.03 KiB) Downloaded 151 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Simple switch edit
Hello,
I've made a simple example for you here which should do just about everything you need.
I've also started a bit of a write up here.
https://www.flowcode.co.uk/wiki/index.p ... mpleSwitch
Let me know how you get on.
I've made a simple example for you here which should do just about everything you need.
I've also started a bit of a write up here.
https://www.flowcode.co.uk/wiki/index.p ... mpleSwitch
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Simple switch edit
Sorry spotted a bug in the Ev_Release macro.
Should be this.
Also another in GetSwitchState macro.
Should be this.
Also another in GetSwitchState macro.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 11
- Joined: Mon Oct 06, 2014 12:55 pm
- Location: Somerset, UK
- Been thanked: 1 time
- Contact:
Re: Simple switch edit
Hi Benj,
Thanks for the demo file, Im beginning to understand the structure of component creation, structure and saving created components.
The switchdemo file was very helpful.
There is an issue when I add multiple instances of the newly created component from the component library to the panel and assign separate ports to each off the switches they work as expected,but all switches retain there previous states if pressed in when flowcode is run again.
I have tried to follow what the handle SW_Object is interacting with but need some help .
Cheers Darryn
Thanks for the demo file, Im beginning to understand the structure of component creation, structure and saving created components.
The switchdemo file was very helpful.
There is an issue when I add multiple instances of the newly created component from the component library to the panel and assign separate ports to each off the switches they work as expected,but all switches retain there previous states if pressed in when flowcode is run again.
I have tried to follow what the handle SW_Object is interacting with but need some help .
Cheers Darryn
- Attachments
-
- SwitchDemo2.zip
- (40.09 KiB) Downloaded 168 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Simple switch edit
Hello,
If you wish to reset the switch state then create an event macro for the Simulation start event using the Events tab of the project explorer.
Inside the macro use a calculation to set the following code and that should reset the state on run.
Sw_Pin = State
If you wish to reset the switch state then create an event macro for the Simulation start event using the Events tab of the project explorer.
Inside the macro use a calculation to set the following code and that should reset the state on run.
Sw_Pin = State
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel