OS/2, eCS & ArcaOS - Technical > Programming
Desktop Weather
Doug Bissett:
--- Quote ---I've only added a few of the required OS/2 icons (native OS/2 .ico files) to the weather.dll and it doesn't change them in the script (yet) because of that, so you'll only get the sun as it is now.
--- End quote ---
Okay, that explains it...
--- Quote ---Anyone who feel like it can create a full set of nice icons (native OS/2 .ico files) can send them to me. ;)
--- End quote ---
Where do I get the original icons, or do you mean the ones in Weather.zip? PMView should convert them. Those icons don't seem to be used anyway (but that could be caused by the lack of bigicon support).
--- Quote ---The script use some services to try to locate you. The location is often based on the nearest station that your ISP allow that service to spot, so it may be your ISPs headquarters...
OpenWeather also need to have weather information for the area you live in.
--- End quote ---
It looks like the problem is with openweather. They only seem to know about major airports (although that doesn't explain why, or how, it chose Lethbridge (500 KM, small city, not listed) over Edmonton (25 KM Capital of Alberta, listed - the airport is about 50 KM from here, and it seems to be in a completely different weather area). The ISP is based in Vancouver (different province, on the other side of a couple of mountain ranges), but the Alberta branch is in Edmonton. Other weather services seem to be able to figure it out.
I also need to know what CityID is supposed to be. Currently, it says "(not_defined" with only one bracket. I would also like to know where that information is stored (I hope it is NOT in one of the system INI files - they grow too big without help).
--- Quote ---Ohh, make a copy of bigicons.txt and place it in the bigicons folder in case something happen... like you restart your computer and you have 1+ desktop widget.
--- End quote ---
I can find no bigicons.txt or bigicons folder, but that could be because I don't use bigicons. I do see a new icon added to the desktop at every program restart. The new icon is always in the upper left corner, partly off screen, which causes a scroll bar to appear (including when it updates, if I don't move it). If I accidentally click the scroll bar, it moves all of my icons to the right. It also always goes through the setup, even though the data is obviously stored somewhere.
Thanks...
Jan-Erik Lärka:
--- Quote from: Doug Bissett on September 02, 2015, 05:48:16 pm ---
--- Quote ---Anyone who feel like it can create a full set of nice icons (native OS/2 .ico files) can send them to me. ;)
--- End quote ---
Where do I get the original icons, or do you mean the ones in Weather.zip? PMView should convert them. Those icons don't seem to be used anyway (but that could be caused by the lack of bigicon support).
--- End quote ---
I used PMView and the OS/2 icon editor to create 3 or 4 icons that I included with weather.dll (contained within weather.zip) from the png files downloaded from the weather service you see when you use PNG Desktop.
--- Quote ---The script use some services to try to locate you. The location is often based on the nearest station that your ISP allow that service to spot, so it may be your ISPs headquarters...
OpenWeather also need to have weather information for the area you live in.
--- End quote ---
--- Quote from: Doug Bissett on September 02, 2015, 05:48:16 pm ---It looks like the problem is with openweather. They only seem to know about major airports (although that doesn't explain why, or how, it chose Lethbridge (500 KM, small city, not listed) over Edmonton (25 KM Capital of Alberta, listed - the airport is about 50 KM from here, and it seems to be in a completely different weather area). The ISP is based in Vancouver (different province, on the other side of a couple of mountain ranges), but the Alberta branch is in Edmonton. Other weather services seem to be able to figure it out.
I also need to know what CityID is supposed to be. Currently, it says "(not_defined" with only one bracket. I would also like to know where that information is stored (I hope it is NOT in one of the system INI files - they grow too big without help).
--- End quote ---
You can specify CityID instead of the name as OpenWeather use that to identify the city.
It's a 12 character long string, thus the missing ")" in "(not defined)".
The information/data is stored as EA with the script file weather.cmd, clear that information and you can start over.
--- Quote ---Ohh, make a copy of bigicons.txt and place it in the bigicons folder in case something happen... like you restart your computer and you have 1+ desktop widget.
--- End quote ---
--- Quote from: Doug Bissett on September 02, 2015, 05:48:16 pm ---I can find no bigicons.txt or bigicons folder, but that could be because I don't use bigicons. I do see a new icon added to the desktop at every program restart. The new icon is always in the upper left corner, partly off screen, which causes a scroll bar to appear (including when it updates, if I don't move it). If I accidentally click the scroll bar, it moves all of my icons to the right. It also always goes through the setup, even though the data is obviously stored somewhere.
Thanks...
--- End quote ---
The create icon function never tries to position the new object, so you'll have to move it by hand.
There should only be one icon on the desktop with the id "<wps_weather>". If you delete it, but not the program object in the startup folder that fetch the data you'll get a new desktop object at every desktop restart.
Delete "Update WEATHER" in the startup folder to get rid of the new desktop weather object.
//Jan-Erik
Doug Bissett:
--- Quote ---I used PMView and the OS/2 icon editor to create 3 or 4 icons that I included with weather.dll (contained within weather.zip) from the png files downloaded from the weather service you see when you use PNG Desktop.
--- End quote ---
Okay, I tried it on my test machine that has the PNG desktop support installed. It appears to be okay, but I still don't know where I can get the icons, to convert them to normal OS/2 icons. That should be a matter of opening the PNG in PMView, and save them as OS/2 icons, but where do I get the png files?.
--- Quote ---You can specify CityID instead of the name as OpenWeather use that to identify the city.
--- End quote ---
But what is the City ID? Where would I find that? If I just type in "Edmonton", it finds Edmonton Australia. About as far away from here as you can get, without leaving the planet.
--- Quote ---There should only be one icon on the desktop with the id "<wps_weather>". If you delete it, but not the program object in the startup folder that fetch the data you'll get a new desktop object at every desktop restart.
Delete "Update WEATHER" in the startup folder to get rid of the new desktop weather object.
--- End quote ---
??? This doesn't make sense. How do you start the program if it isn't in the startup folder? I didn't put it in the startup folder, but it seems to put itself back there if I don't immediately exit the setup, and the setup pops up every time I restart the system, demanding a new configuration, or at least an Exit. The old icon is still there.
I guess I just don't understand how this works, which makes it difficult to set it up. It also doesn't help that it isn't properly detecting my location (which could change, at every update, when I use my laptop for a trip).
Jan-Erik Lärka:
Double click on the desktop object and the SmartGuide will open up.
Click next until you reach the tab "Symbols". Copy the link there to you web browser and add "http://" in front and "/01d.png" after. Replace "01d.png" with "01n.png" for the night version, "02d.png", "02n.png" etc. until 23, then jump to "50d.png" and "50n.png".
Visit http://openweathermap.org and type your city name "Edmonton", select the right place (if a list with many appear) and look for the address such as http://openweathermap.org/city/5946768 and the numbers at the end (5946768), that's OpenWeathers CityID.
The script create two program objects, one that will run the script and update the weather information and another on the desktop and look good :) and can show you the SmartGuide if you click on it so you shouldn't have the /// background obscuring the view.
Yes, it should detect the right location and that is also something that has to be corrected as the script contain links to more than one service to locate the position, but all seem to reply with slightly different JSon structures that I haven't figured out yet. Your tests and help is very much appreciated to help me find out what to change and adjust.
//Jan-Erik
ivan:
Hi Jan-Erik,
I thought I would see how this works on a standard OS/2 machine.
I ran weather.cmd from a command window. It downloaded some images and then placed an icon on the desktop (got00079.jpg) and left the command window static at 93% (got00080.jpg) and that is it.
There is no way that I can get anything that allows me to enter a city or any other information.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version