This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

acces to LM standard directories and files
#1
Hi all,

could you indicate to me how to know the directories names (and paths) of a HomeLYnk/SpaceLYnk machine ?
My objective to reach is to update an image in a plan, using JS, using standard user graphic library.

Secondary question : have you got a doc to use ftp mecanism (or other) to upload file (as graphical one...) ?

Thank's in advance and have a very good week.

Dominique
Reply
#2
Plan images cannot be accessed via FTP. When accessing FTP with apps logic, there's user directory which is accessible from HTTP as http://LM_IP/user/
Reply
#3
Hi,

You probably want to change the image source dynamic on a KNX value, you can do that like this:

1) Add a few icons to the icons tab, and name them icon_1.png, icon_2.png, icon_3.png etcetera
2) Add a byte object (40/1/15 in this sample)
3) Add a image element to the visu with a additional class (in the sample it's "icoon" and don't use "icon" as its a default used class) 
4) Use this custom JS to make it happen
Code:
$(function(){
 if (typeof grp != 'undefined') {
   grp.listen('40/1/15', function(object, state) {
     $('.icoon').find('img').attr('src', '/scada/resources/img/icon_' + object.value + '.png')
   }, true);
 }
});
BR,

Erwin
Reply
#4
Hi Erwin,

it works !..
I change "/scada/resources/img" to "/scada/resources/icons" to reach icons libray.

PS : I could have used Inspector in the webpage, sorry for taking time with this question.

Have a good monday,
Dominique
Reply
#5
Hi,

No problem, most scripts i share are already created for projects, and then it's a matter of copy/paste. This one was created to have a dynamic weather icon on a site.

BR,

Erwin
Reply
#6
Hi,

And why do not to use directly "Additional Icons"?

BR
JMM

   
Jean-Marc
Reply
#7
Hi,

Yes also possible, this is just to show you can do whatever you like ..

With this method you can also change background images dynamic, by using the plan ID #layout-x, something that you won't be able to do normally.

On the site where we used this we had a image URL from the service that we used to have dynamic images from the internet, that you won't be able to do from object level. 

There are so many ways to Rome (: 

BR,

Erwin
Reply


Forum Jump: