| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 15/06/2008 18:35:19
|
mjbcomputers
Initiate
![[Avatar]](/forum/images/avatar/9a1158154dfa42caddbd0694a4e9bdc8.jpg)
Joined: 21/08/2007 21:07:41
Messages: 48
Location: Colorado
Offline
|
As a wish list item:
It would be nice if you could allow users viewing scada status in the "graphic view" the ability to click on the images as an "on", "off", sort of thing. When editing an images properties, you could add two fields:
Image Click Toggle value 1:
Image Click Toggle value 2:
If I have a device that I want to turn on when I click the image, I would fill the fields out like this:
Image Click Toggle value 1: 0
Image Click Toggle value 2: 1
Bottom Line:
The ability to click on images placed in the "Graphic View" to set a toggle status. I do understand that currently I can move the mouse the top corner and change the value, but I think it would be a nice feature if you could simply click the image.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 10/01/2009 09:35:28
|
cyberoblivion
Initiate
Joined: 02/12/2008 14:21:59
Messages: 49
Offline
|
Craig,
This is something I have been working on as well only thing I was thinking about here is the fact that in logic there could be multiple types of "toggles buttons" to use...
1.) just set a binary value to it's opposite
2.) transition, e.i. set a normally open to closed for a period like 1 second than back to normal state and vise versa for normally closed
3.) set a binary value to its opposite as long as the mousedown action was in effect... I think this is the way most PLC hmi's do it.
However I'm a computer guy not a PLC guy so wanted input. I do know that in PLC logic you can look for different transition types "edges" but not sure the most effective route or if all methods would be desired.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 12/01/2009 01:56:44
|
craig
Initiate
Joined: 06/08/2007 16:50:46
Messages: 144
Offline
|
Personally I set up all the remote controls to the PLC as individual commands. Nothing is interactive or based on mousedown events.
Instead of moving a hydraulic ram out while the operator has their finger on a button (mousedown) the operator gives a command like "move ram out for 5s" or if there is a position sensor "move ram to this position".
I have the PLC programs execute a command on the positive edge transition of a bit set from mango and then the PLC resets that "execute command" bit once the command has started.
An advantage of this setup is that if something happens (ie network failure) and the onmouseup event gets lost the PLC isn't performing the requested action forever. Also latency (which I have lots of) isn't a factor.
I don't know how other people and brands make this work for them
mjbcomputers I think wanted to be able to set a bit without navigating the pop up layer, I know you mentioned this in the thread at http://mango.serotoninsoftware.com/forum/posts/list/128.page as well.
Since it is already possible to set a bit from graphical views I haven't thought too much about adding buttons, but as you said that is what operators are used to seeing.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 28/01/2009 01:05:30
|
cyberoblivion
Initiate
Joined: 02/12/2008 14:21:59
Messages: 49
Offline
|
Here is a simple solution to this...
This isnt how I ended up implementing it but I'm sure most people won't want to modify the DB so you could do it this way very easily.
First in the javascript tag on the views.jsp page you can add
then in the div with
add a onmousedown event handler like this
Thats it.. you can now click on the image to change its value!
you can set the mode in the javascript to toggle, set true, set false, of course you which ever way you choose it will act the same for all...
The script also only allow action on binary type datapoints.
Maybe its usefull for someone who knows..
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 28/01/2009 09:03:47
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Nice work. Coming in 1.6.0 there will be an alternate solution as well. The point and pointView objects have been added to the server-side script graphic renderer, which will provide you with the context you need to call the set point function. There is a bunch of quote escaping to do to turn the server-side script into a client-side script, but i made a binary point toggle-able with the following:
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 28/01/2009 09:12:27
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Oh, note that this script doesn't work in view editing mode. You need to save the view and test the script in read-only mode.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 28/07/2009 22:40:36
|
mjbcomputers
Initiate
![[Avatar]](/forum/images/avatar/9a1158154dfa42caddbd0694a4e9bdc8.jpg)
Joined: 21/08/2007 21:07:41
Messages: 48
Location: Colorado
Offline
|
For some reason MANGO did not like the "pointView.id"... What I did to get it to work was to manually place in the number based upon the graphic views url "http://localhost:8080/mango/views.shtm?viewId=2" so I placed a 2.
var result = "";
result += "<span onclick='mango.view.setPoint("+ point.id+", "+ 2 +", \""+ !value +"\")'>";
if (value)
result += "i'm ON. click me";
else
result += "i'm OFF. click me";
result += "</span>";
return result;
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 29/07/2009 17:19:49
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
The dangers of trusting dated information...
I don't recall what version it was, but somewhere the var was changed from pointView to pointComponent.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 29/07/2009 18:12:18
|
mjbcomputers
Initiate
![[Avatar]](/forum/images/avatar/9a1158154dfa42caddbd0694a4e9bdc8.jpg)
Joined: 21/08/2007 21:07:41
Messages: 48
Location: Colorado
Offline
|
Thanks for the info! I'll change my code!
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 31/10/2009 10:50:54
|
Jokke
Initiate
Joined: 19/10/2009 05:08:44
Messages: 52
Location: Oulu Finland
Offline
|
Hello
The code for clicking the text works nicely. I am more intrested to have image(button/checkbox/light bulb) which can be clicked to togle the value. with such the usability would be better. Is there any new methods for this? How is the "have drinks" in mango example implemeted?
The code posted by cyberoblivion seems intresting. Can you please explain some details. Where is the codes to "in div" and the onmousebutton event handler to be put?
thanks
Jokke
This message was edited 1 time. Last update was at 31/10/2009 10:58:34
|
Mango for HA |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/11/2009 10:34:35
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Hi Jokke,
The "have a drink" control in the sample remote view is coded as follows:
The backing point has a change detector that triggers an event handler after 30 seconds.
If you're more interested in the flashing light toggle, the code for that is:
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/11/2009 13:35:43
|
Jokke
Initiate
Joined: 19/10/2009 05:08:44
Messages: 52
Location: Oulu Finland
Offline
|
Excelent, thanks for the hints. Now I got the image click working. Your example was also simple enough for other js noobs like me .
-Jokke
|
Mango for HA |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 16/08/2010 09:28:55
|
diegoferreira
Initiate
Joined: 07/01/2010 06:09:03
Messages: 6
Offline
|
Hello,
Great topic, but let´s say I wanna alter other datapoint values not related to this server side script.
I tried something like:
And it returns me simple error message box, with no info, and no JS error.
What should be the proper way to set other datapoint values?
Thanks,
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 16/08/2010 11:29:38
|
diegoferreira
Initiate
Joined: 07/01/2010 06:09:03
Messages: 6
Offline
|
Something I tried too:
I set an "input" data point as my reference datapoint, and this is my attempt to configure or set an "output" datapoint by server side script.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 16/08/2010 12:28:14
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Setting of points not added to the view is not allowed because it could violate permissions.
|
Best regards,
Matthew Lohbihler |
|
|
 |
|
|