XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 1st, 2025, 8:31 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: April 28th, 2019, 1:54 am 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
Is it possible to link the wind direction to a Rotator on Android?

As far as I can see I only have winddirection as a string ( N-E etc.) or in Degrees but the Rotator works with percentage. And without scripting support on Android I can't convert degrees to percentage.

Are there any plans to add scripting to Android?
Most phones are powerful enough to support this nowadays I would think l.


Top
 Profile  
 
PostPosted: April 28th, 2019, 9:28 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Hello JuzerNeem.
Using js to the app is not about phone's capabilities but if can support it. It's all about programing language that the Android OS can run.
I had asked Tony about it since from the first beta version and he told me that the app doesn't support js.
I don't know if using the Android Studio development engine can go further.. because in the last version the app has been updated to SDK26 and ported to Android Studio from Eclipse. I will reply to you when I talk to Tony and ask him again..

Meanwhile to have a working wind needle, you can do it by creating manually pngs (16) for each direction assigning the wind tag en direction.

https://cdn.windfinder.com/prod/images/ ... 830332.png

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: April 28th, 2019, 12:05 pm 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
OK,
Thank you for your answer.

Can you direct me to an (Android) example or documentation of how to get the correct image for a direction ?
I have created a subdirectory with images for all directions and added an image object to the Widget with a Directions\{curWindDirectionEn}.png tag for Binding Core

But it doesn't work. I added a Text object and also bound it to ${curWindDirectionEn} and I get N, but the image N.png isn't loaded.


Attachments:
WindArrow.jpg
WindArrow.jpg [ 280.51 KiB | Viewed 22842 times ]
Top
 Profile  
 
PostPosted: April 28th, 2019, 12:42 pm 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
WindSpeed is in km/h. Would you know of a way to show speed in other units (kts or Bft) on Android ?

Also with images ? That would mean a lot of them since Windspeed has a decimal. From 0.0 to 120.0 would mean 1200 images!


Top
 Profile  
 
PostPosted: April 28th, 2019, 1:49 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
JuzerNeem wrote:
WindSpeed is in km/h. Would you know of a way to show speed in other units (kts or Bft) on Android ?

Also with images ? That would mean a lot of them since Windspeed has a decimal. From 0.0 to 120.0 would mean 1200 images!

1. You can switch the Metric/Imperial units using or the right click built-in accuweather tagdode "!SwitchUnit" or from the Weather Details screen/options
Check these tutorials
viewforum.php?f=23

2. For the wind images, of course you don't have to create 1200 images! As I see from your screeshots you have created 16 pngs and used the "${curWindDirectionEn}" as I suggested. Good. But it doesn't work? :?
For the text you can't attach function with pngs. Text is text and it will show directly the value using the above tag.

I need to test it by myself and made a demo widget to see how it works. To be honest I don't use that because of the difficulty to assign directly wind angle and rotator. Let me see and I will reply asap.

PM: I always create widgets on the pc and then pass them to my phone. It's much easier and faster.
So I need to test in case that there is actually a bug with this tag and its function with pngs/rotator.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: April 28th, 2019, 2:58 pm 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
Thank you for your help.

I don't think switching to imperial units will change the km/h to kts (knots) or Bft (Beaufort). These
are special units for expressing windspeeds and need a calculation to convert from km/h.

I just used the Text object to check what value I was getting from Accuweather.
And you're right: developing on PC and then sending to phone is a very convenient way of working. I already was doing that.


Top
 Profile  
 
PostPosted: April 28th, 2019, 3:26 pm 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Yes, the knots and Beaufort are separate and different values. I meant the switching between km/h and mph.
Until now XWidget doesn't have tags for knots and Beaufort, so yes it will be a good idea as suggestion/feature request for the nexr version/s.

Could you please attach a .zip here with your 16png images to test? Because I don't have similar images and I should create them from the scratch..

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: April 29th, 2019, 12:05 am 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
JimKing,

These are the direction images.

THX!


Attachments:
directions.zip [409.35 KiB]
Downloaded 422 times
Top
 Profile  
 
PostPosted: April 29th, 2019, 1:13 am 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
Jimking wrote:
2. For the wind images, of course you don't have to create 1200 images!

I meant 1200 images for the WindSpeed needed as a 'trick' to convert from km/h to kts or Bft.
Or do you know of a better way ?


Top
 Profile  
 
PostPosted: April 29th, 2019, 2:43 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
JuzerNeem wrote:
Jimking wrote:
2. For the wind images, of course you don't have to create 1200 images!

I meant 1200 images for the WindSpeed needed as a 'trick' to convert from km/h to kts or Bft.
Or do you know of a better way ?

No I don't think that we can do more. The best way is to wait Tony to add the tag code for this..

I downloaded the .zip and I'm testing it..

EDIT: The wind directions arrows are wrong JuzerNeem.
Should be with these angles. I'll rename them..


Attachments:
wind_directions.42830332.png
wind_directions.42830332.png [ 56.8 KiB | Viewed 22822 times ]

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: April 29th, 2019, 3:02 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Here are the fixed version of the images and the demo wind widget.
..and works fine! You widget didn't work because the images were wrong :)
Use the right click option to change location and units


Attachments:
wind.zip [537.21 KiB]
Downloaded 421 times
directionsfixed.zip [409.51 KiB]
Downloaded 438 times

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/
Top
 Profile  
 
PostPosted: April 29th, 2019, 3:03 am 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
Are you sure they are wrong...
Since I want to make a widget for kite-, windsurfing and sailing I want the arrow to point in direction the wind is blowing to , not from where the wind is blowing.

So with North wind the arrow should point downwards.


Top
 Profile  
 
PostPosted: April 29th, 2019, 3:09 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Absolutely JuzerNeem. The cardinal points never change! Test the widget and see that works fine.
Accuweather and in general the weather services show the direction of the blowing wind NOT the opposite.

The tag says > Current Wind Direction

If you want to show the direction for today or next day/s , then you need to use other tag from the list

This is how it works.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: April 29th, 2019, 4:03 am 
Offline
User avatar

Joined: September 10th, 2018, 6:50 am
Posts: 21
Yes, it works.

Thank you, expect a XWidget for watersporters in the (I hope) near future!

And I've added a request for the additional tags: viewtopic.php?f=3&t=6993


Top
 Profile  
 
PostPosted: April 29th, 2019, 5:58 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
Thank you. :)

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group