re-connecting or re-load button

59 views
Skip to first unread message

Joep

unread,
Mar 27, 2012, 3:42:26 PM3/27/12
to comman...@googlegroups.com
Is it possible to make a re-connecting or re-load button?
I'm thinking about this to easely re-connect when a connection is lost.
 
Now my clients have to close the app and fire it again.
I have tried cf://www.mywebsite.com/project.gui but that's not what i'm looking for.
It closes iViewer down and when opening again it fires up the gui.
 
Thanks in advance,
 
Joep

Florent Pillet

unread,
Mar 27, 2012, 4:12:57 PM3/27/12
to comman...@googlegroups.com
We're in the process of fixing the reconnection issues. Please be patient.

In the meantime, to make a disconnect / reconnect button, you can use a bit
of JavaScript that will do a CF.setSystemProperties() on each system and disable then
enable it.

Florent

--
Florent Pillet - Software Engineering Lead
www.commandfusion.com

Joep van den Aker

unread,
Mar 27, 2012, 4:31:05 PM3/27/12
to comman...@googlegroups.com
Hi Florrent,

I know you are working hard to solve the conection problems and i
still believe in a good solution but it's not only your problem i
guess.
My costumers walk from one room to another and then the connection can
also be lost.
Most people don't understand why that can happen and then it might be
easier to say that they have to push a button to reconnect. I now it's
not the nicest solution but i think it can be effective.

Can you help me with the Javascript on how to do this using
CF.setSystemProperties() please?

Op 27 mrt. 2012 om 22:13 heeft Florent Pillet <fpi...@gmail.com> het
volgende geschreven:

> --
> You received this message because you are subscribed to the Google Groups "CommandFusion" group.
> To post to this group, send email to comman...@googlegroups.com.
> To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.
>

Florent Pillet

unread,
Mar 27, 2012, 4:42:37 PM3/27/12
to comman...@googlegroups.com
Here is an example. To use this code, simply edit your button in guiDesigner
and set its JavaScript field to: onDisconnectReconnectAll();

// Toggle the enabled state of all systems, forcing a disconnection
// then a reconnection. Use a small delay (1/10s) after disconnection
// to not stress remote systems
function onDisconnectReconnectAll() {
enableAllSystems(false);
setTimeout(function() {
enableAllSystems(true);
}, 100);
}

// Function to enable or disable all systems. Disabling a
// system disconnects it, enabling it lets it connect if it is
// not already enabled.
function enableAllSystems(onOrOff) {
for (var name in CF.systems) {
if (CF.systems.hasOwnProperty(name)) {
CF.setSystemProperties(name, {enabled: onOrOff});
}
}
}

On Mar 27, 2012, at 10:31 PM, Joep van den Aker wrote:

> Can you help me with the Javascript on how to do this using
> CF.setSystemProperties() please?

--

Joep van den Aker

unread,
Mar 27, 2012, 4:45:21 PM3/27/12
to comman...@googlegroups.com
Florrent thank you very much for your help!
I'm a very happy CF user :)

Keep up the good work!

Op 27 mrt. 2012 om 22:42 heeft Florent Pillet <fpi...@gmail.com> het
volgende geschreven:

> Here is an example. To use this code, simply edit your button in guiDesigner

motech

unread,
Jun 3, 2012, 1:39:07 PM6/3/12
to comman...@googlegroups.com
can anyone explain to me how to do this exactly?
is onDisconnectReconnectAll(); just the name that goes in the java script field 

and the following goes in to a js file ?

// Toggle the enabled state of all systems, forcing a disconnection
// then a reconnection. Use a small delay (1/10s) after disconnection
// to not stress remote systems
function onDisconnectReconnectAll() {
    enableAllSystems(false);
    setTimeout(function() {
        enableAllSystems(true);
    }, 100);
}

// Function to enable or disable all systems. Disabling a
// system disconnects it, enabling it lets it connect if it is
// not already enabled.
function enableAllSystems(onOrOff) {
    for (var name in CF.systems) {
        if (CF.systems.hasOwnProperty(name)) {
            CF.setSystemProperties(name, {enabled: onOrOff});
        }
    }
}



if so, what infomation in that js file do i need to customize for my system (my processor ip address is 192.168.1.10 at port 41791)
also do i need to name this file something specific and do i need to put this file somewhere more specific other then the same folder the gui is in?


thanks in advance.
would love to get this working.


Joep van den Aker

unread,
Jun 3, 2012, 1:56:16 PM6/3/12
to comman...@googlegroups.com
Yes that's correct.
I use this script as well. It works for me.
It does exactly what it says disconnect and reconnect all the used systems.
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/cL9pLIAP5YgJ.

Jarrod Bell

unread,
Jun 3, 2012, 9:00:32 PM6/3/12
to comman...@googlegroups.com
You can call the script filename anything, then save it in the same folder as your .gui file.
Then in guiDesigner > Project Properties > Script Manager... add your script.

Jarrod
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/cL9pLIAP5YgJ.
Reply all
Reply to author
Forward
0 new messages