|
Rank: Newbie
Joined: 5/25/2017 Posts: 3 Location: Stuttgart, Germany
|
Hey guys, hope you can help me out. I've got some (i think they are) basic questions regarding Altova Mobile Together. I am creating an automatic watering machine for my plants with an Arduino Uno as the controlling unit. It has like 5 Sensors which detect several Values like Temperature, Humidity and so on. These Values i want to show in an App that i am programming.
What i've got so far is that the Arduino is working completely. The Values of the different sensors are sent so a Cloud (thingspeak) and i can see them in my app. Now what i want to do is some more features for the app. Problem is that i am working with XPATH for the first time and i have some problems with it coming from java/C#. I am able to request the values from the cloud so far.
1. I want to set a background. The design of the App is something like windows 95'ish, not very nice, though kinda handy, but i want a bit "modern" one. I want to set background with a .jpg/.png that i already created. How do i set this? 1.1. The labels that i use to show come Text are now light grey. I want them to be at let's say 50% transparency. Is there any way to achieve this?
2. I need something like that: if (cloud_value x < 100) then setLabel1 to "TEXT" else setLabel1 to "ANOTHERTEXT" As i said coming from java i found no way to program this and this is kind of crucial.
3. I want to implement a picture/graph from a website. Now this seems to be so super easy but i had so much troubles with it. I tried to implement a picture by an URL but it didnt work out for me. I just dont get it how it works. I am not sure if you can see it but this is the graph: https://thingspeak.com/channels/260203/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15
4. I want to show if its in the morning (8-12 am), the evening (...) and so on. So i need to kinda read the actual time from the device. Is that possible? After that i guess its another "if"-expression as in question 2.
Well that it for now. I know its a lot but i hope these questions are so basic that you guys can help me out.
Best regards, Rene
EDIT: Problem 2 is kinda solved. I got some problems with the values but finally found how to get the if expression done. For problem 3 i now found out that the link does not redirect to a picture. Is there a way that i can do q quickzoom to the homepage? Means i use a frame like a window and in it you see the http with the chart on it?
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 564
|
Hi, montesa. Please be aware that Altova provides a dedicated MobileTogether support forum which I recommend you use for that subject in the future.
1. It's not presently possible to set a background image for a page, but it's something which will be taken under consideration as a feature request.
1.1. Regarding the text color of your labels, wouldn't simply setting them to a lighter shade of grey solve this requirement? If not, some clarification how transparency (or translucency) would be a better solution would be helpful.
2. It's possible to set the text of the label depending on an XPath expression by selecting the "Text" property for the label in the Styles & Properties pane, then clicking the "Edit XPath" icon near the top of that pane. For example, if your MobileTogether project has a global variable x, then the expression "if ( $x < 100 ) then 'x is less than 100!' else 'x is not less than 100!'" would do the kind of thing you describe as demonstrated by the attached example.
3. The URL you provided returns only the text, "Invalid Channel." Certainly it's possible to add images to your design as described in the documentation. If you could describe the trouble you had perhaps we can advise you better (though I suggest doing so on the MobileTogether forum I previously described).
4. The XPath function current-time() can be used in conjunction with an if-else to implement this. The attached example includes a demonstration.File Attachment(s): example.mtd (4kb) downloaded 880 time(s).
|
|
Rank: Newbie
Joined: 5/25/2017 Posts: 3 Location: Stuttgart, Germany
|
Thanks K101 for your fast answer!
1. I understand that its not possible. Then following that point 1.1. you can simply ignore. To make it look really nice i think it would be nice that if you could set a background picture that it 'shines' through a label. So that you can still see what the picture is about. Thats why i would like transparency. Regarding that there is no opportunity to set a background i think there is no sense in changing the transparency of the filling color.
2. Thanks for your help, it now works properly as i would want it to work.
3. I kinda figured that out too. I thought it would be a .png picture of the graph. I came around the solution that i implemented a button that opens the URL of the graph.
4. Thanks, i will use this. Helps me alot!
Big thanks to you for your really quick answer!
Best regards, Rene
|
|
Rank: Newbie
Joined: 5/25/2017 Posts: 3 Location: Stuttgart, Germany
|
Okay maybe one last thing.
Since the changes work perfect so far im still working on these graphs. They are displayed on a homepage.
I want to be able to click on a button i already implemented and open the Homepage in the currently used browser. Is there a way?
|
|
Rank: Advanced Member
Joined: 2/27/2009 Posts: 564
|
Sure, you should simply be able to use the Open URL/File action.
|
|
guest |