Button ligth on an off on the same CF object

416 views
Skip to first unread message

Alexander S Argollo

unread,
Jul 23, 2013, 5:20:08 AM7/23/13
to comman...@googlegroups.com
Hi Guys, somebody can help me, please. 

I made a light turn on and light off for my project in two separated button, each one have light buld (image properties) to sign the feedback. So to each light i have three things, button on, button off and light bulb (image propertie feedback that i use serial join to apply efect on and off). 

I would like to use those three itens on the unique button with include on, off and feeedback but as image properties. I tryed to include a image propertie over a button, but when the CF is running the image desappears under the button. 

Somebody use a JS to fix it associated a specific object on CF?

Please let me know how can i fix it?

BR
Alex

Jarrod Bell

unread,
Jul 23, 2013, 8:01:20 AM7/23/13
to comman...@googlegroups.com
Use an overlay image in your button. You can select two different images, one per button state - just deselect the 'sync states' checkbox in button properties to enable selecting unique images per button state.
Then all you have to do is change the button state.

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexander S Argollo

unread,
Jul 24, 2013, 9:46:52 PM7/24/13
to comman...@googlegroups.com
Hi Jarrod I'll use it. I have a other complementary question. Are you have any idea to make PW-On and PW-off in the same button?

Today I using two different JS function in two different buttons to perform ir on my interface.

BR
Alex

Jarrod Bell

unread,
Jul 24, 2013, 9:49:00 PM7/24/13
to comman...@googlegroups.com
Already replied to you here:
https://groups.google.com/d/msg/commandfusion/uRUfhG30gCU/KWhlzPg8ktgJ

Next time please do not directly reply to a digest email from the group. Reply only to individual messages.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Alexander S Argollo

unread,
Jul 24, 2013, 9:49:57 PM7/24/13
to comman...@googlegroups.com
You could create two different commands, then have each command call the appropriate JS function.
Then have these commands attached to a single button via advanced actions.
Add two action groups, one to fire the first command, another to fire the next.

Then each time the button is pressed, it would fire a different command.

Otherwise, you could use JS to send a command depending on the state of the button, eg:
CF.getJoin("d10", function(j,v) {
  if (v == "1") {
    // call JS function1
  } else {
    // call JS function2
  }
});


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Em terça-feira, 23 de julho de 2013 06h20min08s UTC-3, Alexander S Argollo escreveu:

Alexander S Argollo

unread,
Jul 24, 2013, 10:57:10 PM7/24/13
to comman...@googlegroups.com, jar...@commandfusion.com
Sorry for my wrong action. I can fix it for my self?

Alexander S Argollo

unread,
Jul 24, 2013, 11:27:35 PM7/24/13
to comman...@googlegroups.com, jar...@commandfusion.com
Hi Jarrod, i almost finish my super button (pw_on and pw_off) with a same object. As you told me i made:

> Included on the same button PW_ON and PW_Off on a two command according and JS according the DJ state.
> Included the overlay image to make the effect PW_OFF_ON and PW_ON_OFF when the button was pressed.

But i have in my mind to include on the same button, as i modified according you advise me, the Serial Join image Bulb (ligth on and Ligth off) on a image propertie feedback, as i have on my interface, according my feedback function on JS. I tryed to put the image propertie behind my button, and i didnt found any option to make the priority over the Image Propertie. 

Are you have idea how i can sharing rhe image propertie and the button ON/OFF propertie (on the same button that just working) on the same button or area ?

I just tryed to put the image propertie over the button propertie but it didnt working well, when the bulb feedback was turn on the button was persist to over the bulb image and didn't provide a good effect.



BR
Alex

Jarrod Bell

unread,
Jul 24, 2013, 11:32:37 PM7/24/13
to comman...@googlegroups.com
Use 'Overlay Images' as I suggested earlier. Found in button properties.
Don't use a separate image object in this case.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Nouv Dep

unread,
Jul 25, 2013, 7:09:32 AM7/25/13
to comman...@googlegroups.com

Jarrod,

I have seen this question several times in the recent month/years, including mysef.
Maybe it should be good to make a example project/pluging for this?

Regards

Barry Gordon

unread,
Jul 25, 2013, 7:36:21 AM7/25/13
to comman...@googlegroups.com
I have been a little confused by this thread. 

Is the goal to have a rocker switch type button with one end being on and the other off?  

OR

Is the goal to have a single button which acts as a power toggle for a component that has power on and power off commands but no power toggle command?

Sent from my iPad

Clayton Vicente

unread,
Jul 25, 2013, 7:50:27 AM7/25/13
to comman...@googlegroups.com
I dont know if i understand you guys, but if you are trying to create a toggle button, when the join is 1 will send the power on and when the join is off will send the power off, you can use a single function to send the commands. This function will be used for all your buttons.
- Create a .js file and insert this function

function sendCommand(join,commandOn,CommandOff){
   CF.getJoin(join,function(j,v){
       if(v=="1"){
          CF.runCommand("",commandOn)
       }else{
          CF.runCommand("",commandOff)
      }
   })
}

Now in the buttons that you want to send the commands call the function in the .js field with this

sendCommand(theButtonJoin,theCommandOn,theCommandOff)

Where :
   theButtonJoin is the join of the button("d21" for example)
   theCommandOn is the name of the command for when the button has the digital join = 1, for example "TVLG_PowerOn"
   theCommandOff is the name of the command for when the button has the digital join = 0, for example "TVLG_PowerOff"
So, the final code in the button for put the button "d21" to power on or power off the tv lg will be:
sendCommand("d21","TVLG_PowerOn","TVLG_PowerOff")

You can use this same function for all trigger buttons, you just need to change the the join and the name of the commands.
Clayton


Date: Thu, 25 Jul 2013 13:09:32 +0200
Subject: Re: Button ligth on an off on the same CF object
From: nouveaud...@gmail.com
To: comman...@googlegroups.com

Alexander S Argollo

unread,
Jul 25, 2013, 8:06:27 PM7/25/13
to comman...@googlegroups.com
Hi Guys, i am really confused to use the Overlay Image as Jarrod told me. I using in actually project 2 buttons (button properties) to PW_ON and PW_OFF and a image propertie (lamp Bulb) to get the Feedback/ligth status via SetJoin, as you can see the code below to make sure if the relay was ack or not the command. Could you see below:

CF.setJoin("s200", "Bulb_On_On.png"); // Ligth ON according Regex Feedback to set up the Image Properties.
        CF.setJoin("s200", "Bulb_Off_Off.png"); // Ligth OFF according Regex Feedback to set up the image Properties.


In my first question i would like to marge it (PW_ON/OFF and Ligth status) and use a single button (PW_ON/PW_OFF and ligth feedback), Jarrod advise me to use the advance actions, on Button, and overlay images. I did almost everything as Jarrod advise me, except to change the image according feedback using Overlay Images.

Somebody can help how can i make it (change the ligth bulb statatus according Feedback) using Overlay image?

BR
Alex

Terence

unread,
Jul 25, 2013, 9:44:47 PM7/25/13
to comman...@googlegroups.com
Create a button theme for your button that shows different image for button state on/off
- Go to Theme Manager
- Go to Buttons, you can create a new theme or edit an existing theme
- Double click the theme to go button theme properties.
- Set BG Image "Bulb_Off_Off.png" for Inactive state
- Set BG Image "Bulb_On_On.png" for Active state
- Save the changes and apply the theme to your button by drag & drop the theme to your button

Alexander S Argollo

unread,
Jul 25, 2013, 10:02:37 PM7/25/13
to comman...@googlegroups.com
Hi Terence thanks a lot. I´ve done it. I would like to use it with CF.Feedback (regex parsing that i already have) to set up or change the Image from Bulb_off_off to bulb_on_on as i used with image propertie with CF.SetJoin as i told.

It's possible to use it with a new button structure? 
Or i need to keep my old soluction for button ligth on/off and buld feedback?

Thanks a lot!!!!
BR
Alex

Terence

unread,
Jul 25, 2013, 10:13:52 PM7/25/13
to comman...@googlegroups.com
Tried this?


CF.getJoin("d10", function(j,v) {
  if (v == "1") {
    // call JS function1 to off the button

     CF.setJoin("s200", "Bulb_Off_Off.png");
  } else {
    // call JS function2 to on the button

     CF.setJoin("s200", "Bulb_On_On.png");
  }
});

alexande...@gmail.com

unread,
Jul 26, 2013, 4:52:11 AM7/26/13
to comman...@googlegroups.com
Terence thanks.
I'll try to do this. 
But I think that it will not work, because the button properties object didn't have a Serial Join as Image Properties have. When I change the image properties to button properties to give a unique button I lose the CF.SetJoin.

The button properties object have a Serial Join just to give a text information.

Please are you have a other idea?

Thanks a lot
BR
Alex

Enviado do meu smartphone BlackBerry 10.
De: Terence
Enviada: quinta-feira, 25 de julho de 2013 23h13
Assunto: Re: Button ligth on an off on the same CF object

--
You received this message because you are subscribed to a topic in the Google Groups "CommandFusion Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commandfusion/I6QuSYKOnyU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commandfusio...@googlegroups.com.

Jordan

unread,
Jul 26, 2013, 5:02:11 AM7/26/13
to comman...@googlegroups.com
It is evident that this problem hsa multiple solutions, depending on how the actual interface is built. You can use Button Overlays, a clickthrough image above a generic button, or you can change button Theme based on feedback. You can even attach a tap gesture to an image and use it as a button with an associated JS function. All of the above will work, it all boils down on which one suits the GUI best without overcomplicating things.

This said, I think the thread lacks a significant information, being how the light gets switched on and off: is it a JS function? Is it a Command on a system? Is it from join change sent to a Control System? In my experience these all define a different approach.

Alexander Argollo

unread,
Jul 26, 2013, 5:30:52 AM7/26/13
to comman...@googlegroups.com
Hi Jordan, i already done a 1st approach with a JS with image based on properties and SerialJoin, this solution require a bulb status and button on/of in separated objects. When I changed it to a Overlay image I didn't see how can I use my JS function Feedback based on setJoin to provide a bulb status according the JS command sent to my device. I really want to use it to make sure if the device was receive the command and processed it. If I just use drag and drop status according button overlay approach was give me. I need to combine both solutions unique button with bulb status but the las one according feedback JS script that capture the system message via regex structure.

In relation your answer, yes it's a JS to turn on/off and give bulb the status feedback.

Enviado via iPad

Em 26/07/2013, às 06:02, Jordan <giovanni...@gmail.com> escreveu:

It is evident that this problem hsa multiple solutions, depending on how the actual interface is built. You can use Button Overlays, a clickthrough image above a generic button, or you can change button Theme based on feedback. You can even attach a tap gesture to an image and use it as a button with an associated JS function. All of the above will work, it all boils down on which one suits the GUI best without overcomplicating things.

This said, I think the thread lacks a significant information, being how the light gets switched on and off: is it a JS function? Is it a Command on a system? Is it from join change sent to a Control System? In my experience these all define a different approach.

Il giorno venerdì 26 luglio 2013 10:52:11 UTC+2, Alexander S Argollo ha scritto:
Terence thanks.
I'll try to do this. 
But I think that it will not work, because the button properties object didn't have a Serial Join as Image Properties have. When I change the image properties to button properties to give a unique button I lose the CF.SetJoin.

The button properties object have a Serial Join just to give a text information.

Please are you have a other idea

Bram van der Mooren

unread,
Jul 26, 2013, 5:34:46 AM7/26/13
to comman...@googlegroups.com

If my slider returns a 16 bit HEXvalue, can I easily split the bytes into two 8bits using Gui designer?

My LSB is needed on another location then the MSB.

 

Thanks in advance

 

Bram

Jarrod Bell

unread,
Jul 28, 2013, 7:50:52 AM7/28/13
to comman...@googlegroups.com
If using overlay images, you dont have to change the image path via joins. Just use a different overlay image for each button state (as I recommended, by unchecking 'sync states') and it will change when the button state changes.
You would only have to adjust the button state from your feedback then.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.

Jarrod Bell

unread,
Jul 28, 2013, 7:52:37 AM7/28/13
to comman...@googlegroups.com
Can you explain in more detail what you are trying to do? You can capture and process data in JavaScript to get bit level parsing functionality.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.

Bram van der Mooren

unread,
Jul 28, 2013, 4:45:46 PM7/28/13
to <commandfusion@googlegroups.com>
Jarrod,

I thought maybe there was something what i can use in GUI designer with the token [sliderval].
I have to place the first 8 bits then other data between and then the last 8 bits of the data returned from the Slider.

Thanks for your reply!

Barry Gordon

unread,
Jul 28, 2013, 6:55:30 PM7/28/13
to comman...@googlegroups.com

As Jarrod hinted it is very simple to do in JS.  It really pays to learn enough JS to do these types of computations in JS feedback functions which are called via a watch statement.

Barry Gordon

unread,
Jul 28, 2013, 7:06:32 PM7/28/13
to comman...@googlegroups.com

Jarrod, Florent

 

How about thinking about the following:

 

Allow for the invocation of JS snippets which you already do in some cases. For example have the option to invoke a JS function as the feedback analyzer for a control system. In guiDesigenr if the user picks this choice open a JS editor with a simple empty file so the user can enter his function.  When the user saves the snippet, save it as part of a special JS.module. Put all such snippets in the same JS module which you then automatically include in the guiDesigner file as a JS module.  You could just assume a JS editor exists, i.e. something is handling files with a js extension.

 

 If necessary part of guiDesigner setup could have the user locate his JS editor, and if that is not done do not allow for the above.  

 

Might get some users more comfortable in using JS.

 

just a thought.

 

From: comman...@googlegroups.com [mailto:comman...@googlegroups.com] On Behalf Of Bram van der Mooren
Sent: Sunday, July 28, 2013 4:46 PM
To: <comman...@googlegroups.com>
Subject: Re: Slider use in Gui designer

 

Jarrod,

alexande...@gmail.com

unread,
Jul 28, 2013, 7:28:05 PM7/28/13
to comman...@googlegroups.com
Hi Jarrod thanks a lot. Please would you advise me how can I change my button state according my feedback ‎?

‎Br
Alex 

Enviado do meu smartphone BlackBerry 10.
De: Jarrod Bell
Enviada: domingo, 28 de julho de 2013 08h51

Jarrod Bell

unread,
Jul 28, 2013, 7:34:25 PM7/28/13
to comman...@googlegroups.com
It depends on the data you are receiving. I thought you already had this part working.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


alexande...@gmail.com

unread,
Jul 28, 2013, 7:56:09 PM7/28/13
to comman...@googlegroups.com
Hi Jarrod I testing now. After you wrote this idea for me.

Thanks a lot!
BR
Alex

Enviado do meu smartphone BlackBerry 10.
De: Jarrod Bell
Enviada: domingo, 28 de julho de 2013 20h34
Assunto: Re: Res: Button ligth on an off on the same CF object

Jarrod Bell

unread,
Jul 28, 2013, 8:38:35 PM7/28/13
to comman...@googlegroups.com
I created an example project here which demonstrates using JS with sliders, and bitshifting, etc.
https://github.com/CommandFusion/DemoUserInterfaces/tree/master/SliderJS


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Jarrod Bell

unread,
Jul 28, 2013, 8:42:41 PM7/28/13
to comman...@googlegroups.com
The JS needs to be associated with whatever you are attaching the snippet to - not just in some included file. I agree that the text field for assigning JS calls from buttons, system properties, commands, etc, is a little bland, but it certainly does the job.
Maybe in future we can bring up a nicely formatted code editor window to edit snippets attached to these parts of GUIs, but it will never be an external editor, as the script must be saved alongside the button, etc, (ie. within the GUI XML) not in an external file.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Alexander S Argollo

unread,
Jul 28, 2013, 8:51:35 PM7/28/13
to comman...@googlegroups.com
Hi Jarrod, i testing a lot, to keep synchronous the feedback command and button state, using overlay image. For example when the button was pressed to toggle or change the state when the JS feedback was triggered. I using it:

in the same moment i using another object (image properties) in parallel to see the feedback commnad:

// turn off:
if (matches[7]==1) {
if (start==0) if(ZB.trace) CF.log("ZB.feedback: The Switch ID 1 was selected *** Switch ID 1 was selected ***");
if (matches[20]==00) {
CF.setJoin("s2", "Bulb_Off_Off.png");
CF.SetJoin("d200",0); // i included it to try to keep the button on OFF state. 

//turn on:
      else if (matches[20]==01) {
CF.setJoin("s2", "Bulb_On_On.png");
CF.SetJoin("d200",1);  // i included it to try to keep the button on ON state.


But it is not working as i thought!

Could you, please, advise if it is possible to make?

BR
Alex



--
atenciosamente,
Alexander S Argollo
11-99468494
mailto: alexande...@gmail.com

Jarrod Bell

unread,
Jul 28, 2013, 9:30:20 PM7/28/13
to comman...@googlegroups.com
Make sure your button is not set to simulation momentary or toggle modes. You only want real feedback to change the button.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Barry Gordon

unread,
Jul 29, 2013, 10:54:12 AM7/29/13
to comman...@googlegroups.com

Jarrod,

 

I did not communicate my thought to well.  I had a similar discussion with the Pronto PRO developers when I was working with them.  

 

The option I was discussing would merely place the call to the JS snippet(function) in the provided space.  At the same time it would open an editor to allow the "Snippet" to be as extensive as required. Probably need an "edit" and "new" mode. In the "new" mode guiDesigner would build an empty JS module with a standard name in the project folder and all such code snippets would be placed there with some algorithmically determined function name. Naturally there would need to be an reference placed in the gui file to the special module so it was automatically loaded. The complexity of this option could grow fairly fast into a JS library function which is what was finally done with the Pronto PRO, but alas not too well.

 

Having never been into anything Crestron, I really favor JS as the mechanism for doing things.  I guess it goes back to the old adage, you like what you know.

 

I feel this would allow users to easily integrate JS code into their systems without having to go through all the mechanics of building and integrating a JS module.  Easy once you have done it, a little daunting the first time.

 

O/T: Are either you or Florent going to be at CEDIA in Denver CO USA at the end of September?

Jarrod Bell

unread,
Jul 31, 2013, 7:45:39 PM7/31/13
to comman...@googlegroups.com
I don't think we will be at CEDIA, but it's not totally ruled out for me yet. Florent won't be there.

There are some things we are working on now which relate to your ideas, but any ideas for better guiDesigner work flow are always welcomed!


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Barry Gordon

unread,
Jul 31, 2013, 10:50:14 PM7/31/13
to comman...@googlegroups.com

If you end up planning to attend CEDIA. let me know and perhaps we could do dinner.

Reply all
Reply to author
Forward
0 new messages