XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Temperature and Rotator? https://www.bbs.xwidget.com/viewtopic.php?f=3&t=5011 |
Page 1 of 1 |
Author: | Jimking [ September 12th, 2014, 4:39 pm ] |
Post subject: | Temperature and Rotator? |
It will be great if we can combine somehow the temperature with the "rotator" object, so we will can create analog temp meters.. ![]() I don't know if I'm missing something, but as I know this can be done only with this tag "folder\${curTemp}.png" but we need to have the needle images from -50 to 50oC.. Right? |
Author: | hamid [ September 13th, 2014, 12:20 am ] |
Post subject: | Re: Temperature and Rotator? |
i think you mean to have accuweathercore units also in percent, right? edit1: since the start and end degrees can be different, it may get vary, edit2: currently, it can be done: using the script code to make a percent unit based on your specified limitations (start&end degrees) |
Author: | Jimking [ September 13th, 2014, 12:33 am ] |
Post subject: | Re: Temperature and Rotator? |
Yes.. Somehow... ![]() |
Author: | Jimking [ September 13th, 2014, 2:03 am ] | |||
Post subject: | Re: Temperature and Rotator? | |||
hamid wrote: i think you mean to have accuweathercore units also in percent, right? edit1: since the start and end degrees can be different, it may get vary, edit2: currently, it can be done: using the script code to make a percent unit based on your specified limitations (start&end degrees) I checked my design and the needle has: StartAngle: -135 EndAngle: 270 Temperature in C. I have two face "clock" images with both temp units F and C.. The fact is that I already have 121 images with the movement of the needle. I tried to select some of them to match with the above values, but is not accurate at all.. This is a port from an Android app.
|
Author: | Jimking [ September 13th, 2014, 2:20 am ] |
Post subject: | Re: Temperature and Rotator? |
If you think that is possible without to much work ok.. But if you see that is complicated, leave it.. I had already abbandon the idea of the extra temp meter. |
Author: | hamid [ September 13th, 2014, 3:08 am ] |
Post subject: | Re: Temperature and Rotator? |
it's not so hard, it can be done using script code and rotator object, with only 1 needle image ======== about your methode (binding methode): it can done also in that way, the problem with your work was: 1. the image names are wrong, it should be in C temperature degrees, it should be named -50 to 50 2. you should use an image object to load the images, not the rotator object |
Author: | hamid [ September 13th, 2014, 4:06 am ] |
Post subject: | Re: Temperature and Rotator? |
and here's an example of your method: Attachment: notes: 1. i have used your bg image, although it has a needle inside, 2. the needle images are renamed, so you can use them on your widget ============= edit1: but i think using Script method is better, since it will use one needle image, so it will reduces file size edit2: i don't know a city that have negative temp right now, if you know any, test it with that ![]() |
Author: | Jimking [ September 13th, 2014, 4:08 am ] |
Post subject: | Re: Temperature and Rotator? |
Let me check... Quote: the problem with your work was: 1. the image names are wrong, it should be in C temperature degrees, it should be named -50 to 50 2. you should use an image object to load the images, not the rotator object Was the first thing that I did (rename all from -50 to 50 and use image object) The problem is that the default needle images that I sent you (that were inside the original design) are 121 and I need less.. 50 images for (-) temp, 50 images for (+) temp and 1 image for 0 temp. I tested but especially one high temps the needle is not accurate at all.. |
Author: | hamid [ September 13th, 2014, 4:16 am ] |
Post subject: | Re: Temperature and Rotator? |
did you used my example widget? what do you mean by not accurate? can you add a image for it? edit: ok, now i found what you mean, your images are not match with the original image, you should adjust them based on bg image, since the bg's range is not accurate maybe my example widget can be helpful on choosing which one match the bg, change the binding tag with numbers to find out which one match you can specially test it with "redarrow_30.png", and you will see the difference between bg's 30degree ============== or we can use script code instead |
Author: | Jimking [ September 13th, 2014, 4:26 am ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: did you used my example widget? what do you mean by not accurate? can you add a image for it? Yes I mean your example.. At the test widget that you send me, add a right click option to change location and make some tests. For the high temps the needle goes "out".. If you can do it though script with the angle values that I wrote you... |
Author: | hamid [ September 13th, 2014, 4:42 am ] |
Post subject: | Re: Temperature and Rotator? |
i have edited my above post, check it again the script method is easier, and will use lower file size |
Author: | Jimking [ September 13th, 2014, 5:41 am ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: i have edited my above post, check it again the script method is easier, and will use lower file size Sorry for the delay but I had to go out for a while.. Yes I think this is better than make tests again and again and as you said we will use only one image. I have to send you the background and the needle png? Because I will use the same needle image that I used for the clock panel/seconds hand, not one of the images that I sent you.. |
Author: | hamid [ September 13th, 2014, 6:44 am ] |
Post subject: | Re: Temperature and Rotator? |
here's the script version: Attachment: Note: the code doesn't need any changes for your widget, just you need to change or adjust the images if it needed ========== question: is there any less/more than 50degree available somewhere? if there is, i can make it to go a little more than 50 to show the overload degrees |
Author: | Jimking [ September 13th, 2014, 7:41 am ] |
Post subject: | Re: Temperature and Rotator? |
Thanks for the script! I'm testing it right now.. Quote: question: is there any less/more than 50degree available somewhere? if there is, i can make it to go a little more than 50 to show the overload degrees You need a place with less/more 50degree..?? Maybe places at the Equator and North Pole!! If someone there will use XWidget and this widget I'm sorry but he/she will have a little "loss of degrees"! ![]() |
Author: | Jimking [ September 13th, 2014, 7:45 am ] |
Post subject: | Re: Temperature and Rotator? |
Quote: just you need to change or adjust the images if it needed At the last widget with script the needle doesn't move and is stuck on -50.. ![]() |
Author: | hamid [ September 13th, 2014, 7:51 am ] |
Post subject: | Re: Temperature and Rotator? |
it will change when accuweathercore updates edit: if you like: i can make it to show the value before update (show old temp), to do this, just need to: 1. use a text object 2. and bind to [%curTemp] 3. and use the function in the text-Object's [onchange] Event edit2: i have the text object already in my widget, just you need to add the function name to the [onchange] event of text Object |
Author: | Jimking [ September 13th, 2014, 8:18 am ] |
Post subject: | Re: Temperature and Rotator? |
Hey man are you sure that you send me the right file..? I press manually weather/core update in the designer by nothing happens.. The needle is still on -50... Even because I see two tags "OnEnter", "OnLeave" that don't appear in the script.. |
Author: | hamid [ September 13th, 2014, 8:31 am ] |
Post subject: | Re: Temperature and Rotator? |
don't you remember the accuweathercore update function, it only update when Xwidget update from Accuweather site, not when you press update, also check that if you're using C degrees, not F, currently it only support C, if you want it for F, you should send me max&min degrees for F |
Author: | Jimking [ September 13th, 2014, 8:48 am ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: don't you remember the accuweathercore update function, it only update when Xwidget update from Accuweather site, not when you press update, also check that if you're using C degrees, not F, currently it only support C, if you want it for F, you should send me max&min degrees for F All this time when I press the "Update" button in the designer the weather updates in this moment. ![]() There is a way to change it according the weather LOCAL update time, not the server's time..... If not there is no sense have a temp meter that until the first update time on accuweather server will not show anything... And is for C degrees.. I also have an image for F degrees but first we need to fix the way will work.. Look, I don't know if you want to try but seems a headache to me....! ![]() |
Author: | hamid [ September 13th, 2014, 9:13 am ] |
Post subject: | Re: Temperature and Rotator? |
ok, i have added another version: Attachment: it will automatically change to C unit, also it will use textonupdate, so it will work when you start the widget (old or new value) Quote: All this time when I press the "Update" button in the designer the weather updates in this moment. don't you forget something, there's a script code in widget, it needs to be executed in debug mode |
Author: | Jimking [ September 13th, 2014, 9:41 am ] |
Post subject: | Re: Temperature and Rotator? |
Quote: don't you forget something, there's a script code in widget, it needs to be executed in debug mode The prev version didn't work for me even in debug mode.. But this last one works!!! Congrats ![]() For the F degrees version if I understand, after I change the other background image, I will change the !SetCelcius part to !SetFahrenheit, and what else? Because the image that I will use has the same start/end values but goes from -60 to 120.. Can be done? If not don't worry! Will work only with Celcius... |
Author: | hamid [ September 13th, 2014, 9:53 am ] |
Post subject: | Re: Temperature and Rotator? |
Quote: The prev version didn't work for me even in debug mode.. prev version did't worked because it waits for new update,But this last one works!!! Congrats ![]() now, in new version, it shows the old value until the update happens Quote: For the F degrees version if I understand, after I change the other background image, I will change the !SetCelcius part to !SetFahrenheit, and what else? Because the image that I will use has the same start/end values but goes from -60 to 120.. Can be done? If not don't worry! Will work only with Celcius... it can be done, but send me the image for clarification, it just needs a bit more coding |
Author: | Jimking [ September 13th, 2014, 9:57 am ] | ||
Post subject: | Re: Temperature and Rotator? | ||
Quote: it can be done, but send me the image for clearification, it just needs a bit more coding Here the image for F.. Thanks! ![]()
|
Author: | hamid [ September 13th, 2014, 11:10 am ] |
Post subject: | Re: Temperature and Rotator? |
Quote: looks like there is a bug in unit changing of accuweathercore, 1. it doesn't save to ini 2. it doesn't update ${curTemp} in debug mode can you test these? sorry, i was wrong, i forget to remove the setcelcius command from the code, so it was always get back to celcius, so no problem with the core |
Author: | Jimking [ September 13th, 2014, 2:39 pm ] |
Post subject: | Re: Temperature and Rotator? |
Ok hamid..take your time and send me the script for the Fahrenheit, when you're ready.. I'm going to continue the designing part, because I need to add some more things... EDIT: The design part is finished.. There were many things to do.. So I'm waiting your last part / Fahrenheit meter, and after I will add it to the widget, it will be ready for upload. ![]() Thanks man.........I really appreciate. |
Author: | hamid [ September 13th, 2014, 5:09 pm ] |
Post subject: | Re: Temperature and Rotator? |
it's ready: Attachment: ========= Notes: 1. the script automatically detects both C and F, 2. if you want the old values before update, but don't want text object, you can invisible the text object after you have done designing, send it to me to optimize the code if needed |
Author: | Jimking [ September 14th, 2014, 12:53 am ] |
Post subject: | Re: Temperature and Rotator? |
Thanks a lot man! I will test it as soon as possible and I will reply! |
Author: | Jimking [ September 14th, 2014, 3:36 am ] |
Post subject: | Re: Temperature and Rotator? |
Here is the final version. ALL WORK OK! Check the right click options and the on top buttons! ![]() (I had to make a little trick to combine both C and F panels. Since the text object that has the "OnChange" tag and the "rotator" must be twice, one for temp in C and one for F, I added a second core and I copied the scipt changing the text1->2 and rotator1->2).. viewtopic.php?f=11&t=5015 |
Author: | hamid [ September 14th, 2014, 11:04 am ] |
Post subject: | Re: Temperature and Rotator? |
i'm a little busy today, i'll check it later, for now, i have some questions: 1. shouldn't there be a button on the bottom of slidepanels (on the symbol) to make the slidepanel go up 2. what is the hole, is it going to be a button or just a hole? 3. what are the prev & next buttons do on the top of the tree of widget, (i couldn't find where they will be displayed 4. i think the changing between C & F degrees doesn't work (see the temp text), i don't have time to test it right now 5. is having 2 weathercore doesn't need to use 2 menuitem for setting their configuration, i think we could use only one weathercore in widget, since the conversion between C and F is easy 6. making weather slided at first, and then using calendar button doesn't slideback the weather slidepanel |
Author: | Jimking [ September 14th, 2014, 11:24 am ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: i'm a little busy today, i'll check it later, for now, i have some questions: 1. shouldn't there be a button on the bottom of slidepanels (on the symbol) to make the slidepanel go up 2. what is the hole, is it going to be a button or just a hole? 3. what are the prev & next buttons do on the top of the tree of widget, (i couldn't find where they will be displayed 4. i think the changing between C & F degrees doesn't work (see the temp text), i don't have time to test it right now 5. is having 2 weathercore doesn't need to use 2 menuitem for setting their configuration, i think we could use only one weathercore in widget, since the conversion between C and F is easy 6. making weather slided at first, and then using calendar button doesn't slideback the weather slidepanel All work fine hamid! If you want to check do it, but really, I think is not necessary...!!! ![]() Hey, so many questions! ![]() Well..... 1. Is just a visual part to show the "movement".. 2. Same for the hole. Part of the design.. 3. Since there are other components above calendar slidepanel, the buttons were not clickable. So I added only the arrow images in the slidepanels and on top two empty images assigning the same function. These virtual buttons are hidden when the calendar panel is in. 4. Work hamid! I have already test it. Just use the right click option to navigate between the two modes 5. There are two different panels and was the only way. Ok, maybe you can do it with another way, but since the things work why spend more time?? 6. The user use the weather/calendar button for open and close! When the user will want to open both, needs to close the other first. Logical and simple... Thanks again |
Author: | hamid [ September 14th, 2014, 1:07 pm ] |
Post subject: | Re: Temperature and Rotator? |
Quote: 5. There are two different panels and was the only way. Ok, maybe you can do it with another way, but since the things work why spend more time?? when you change location, the C and F panel will show you different location, so this is not working, i'll fix it later Quote: 6. The user use the weather/calendar button for open and close! When the user will want to open both, needs to close the other first. Logical and simple... why should it be that way when we could hide it just by one command? at least it should get on top when its button clicked ============ i think these are necessary, i'll fix them later, ================== and maybe having this may be good: Quote: Quote: 1. shouldn't there be a button on the bottom of slidepanels (on the symbol) to make the slidepanel go up 1. Is just a visual part to show the "movement"..============== edit: Quote: 4. Work hamid! I have already test it. Just use the right click option to navigate between the two modes the reason that it was not working for me was this: accweathercore will uses its last settings for C and F on startup, so it has changed to F , for my C core, there should be used a code to force each core use their own unit, i'll fix this, if i kept both cores |
Author: | Jimking [ September 14th, 2014, 2:20 pm ] |
Post subject: | Re: Temperature and Rotator? |
I understand all the parts.. If you want to edit and fix these part of the script.. It's up to you! ![]() Quote: there should be used a code to force each core use their own unit, i'll fix this, if i kept both cores Sorry but why we need a code for this..? The cores are two, right? When you click on it you can select which type of units will load on startup! So I selected "metric" for the one with C and "imperial" for the other. So each core will show separately what I selected. And without any right click option to change unit, they will stay like this! |
Author: | hamid [ September 14th, 2014, 2:52 pm ] |
Post subject: | Re: Temperature and Rotator? |
Quote: So I selected "metric" for the one with C and "imperial" for the other. So each core will show separately what I selected. these are design time settings,they can be overridden if some other settings exist, or if user change them, then it will show F degrees on your C meter and vice-versa, and makes it confusing the accuweathercore works different than other cores, it stores some settings in some other place, so it will override the widget's specified settings if accuweathercore have been used in some other widget, i think its priority is this way: 1. theme.ini (user-config for opened widget) 2. settings.ini (last used settings) 3. main.xul (settings have been set when designing) Quote: And without any right click option to change unit, they will stay like this! it can be changed through [change location] dialog, so there is a rightclick menu for it |
Author: | Jimking [ September 14th, 2014, 3:30 pm ] |
Post subject: | Re: Temperature and Rotator? |
Quote: these are design time settings, they can be overridden if some other settings exist, or if user change them, then it will show F degrees on your C meter and vice-versa, and makes it confusing it can be changed through [change location] dialog, so there is a rightclick menu for it Maybe I'm thinking in more simple way I don't know.. Since I added 2 right click options one for "C" and one for "F" and the user will use only these, then with the right click "change location" the user will change only the location and without any right click option for "change temp unit" to confuse, really I don't see any meaning of all this....... It's good to think complex, but not always.. Quote: i think its priority is this way: 1. theme.ini (user-config for opened widget) 2. settings.ini (last used settings) 3. main.xul (settings have been set when designing) You know better...Take your time and do your best.. |
Author: | hamid [ September 14th, 2014, 3:31 pm ] |
Post subject: | Re: Temperature and Rotator? |
isn't this code suppose to be for this widget? ![]() http://bbs.xwidget.com/viewtopic.php?f=8&t=5012#p9805 i still couldn't found why you're always in hurry to release the widget ![]() |
Author: | Jimking [ September 14th, 2014, 4:22 pm ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: isn't this code suppose to be for this widget? ![]() http://bbs.xwidget.com/viewtopic.php?f=8&t=5012#p9805 i still couldn't found why you're always in hurry to release the widget ![]() Haha! Yes! ![]() I had posted this before create this topic! As I told you, at the beginning I was thinking to create only a clock widget, without weather panels,temperature etc... Quote: i still couldn't found why you're always in hurry to release the widget Maybe I'm too too enthusiastic to share a widget sometime! ![]() |
Author: | Jimking [ September 14th, 2014, 4:35 pm ] |
Post subject: | Re: Temperature and Rotator? |
...I have to go to bed hamid..It's late here 02:30 am.. If you make any comment I will read it tomorrow... ![]() |
Author: | hamid [ September 15th, 2014, 1:43 pm ] |
Post subject: | Re: Temperature and Rotator? |
questions: 1. should it make menuitems check&uncheck? 2. which items should have saveini? |
Author: | Jimking [ September 15th, 2014, 2:16 pm ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: questions: 1. should it have menuitems check/uncheck? 2. which items should have saveini? Sorry for the delay but I have some problems with my connection 1. It will be ok, but not essential.. I added the "ON/OFF" these in the right click options for that reason.. 2. If you check the right click options, I added some customization options, like background metal on/off, blink on/off, clock face... You need to check the right click options.. pm: If you want to give me a hand with the save ini please check this: viewtopic.php?f=8&t=5012&p=9804#p9804 Is just two layers, and I would like the selection to be saved on widgetload.. Thanks! |
Author: | hamid [ September 15th, 2014, 2:44 pm ] |
Post subject: | Re: Temperature and Rotator? |
i have added saveini for these: light,metal,time,date does it needed for these: 1. Clock/Cel/Fahr mode? 2. slidepanels? |
Author: | Jimking [ September 15th, 2014, 3:12 pm ] |
Post subject: | Re: Temperature and Rotator? |
hamid wrote: i have added saveini for these: light,metal,time,date does it needed for these: 1. Clock/Cel/Fahr mode? 2. slidepanels? For the slidepanels no since that both should be hidden anyway.. For the "Clock/Cel/Fahr mode", you think that we should add it? For example if the user wants to have it only for temp meter at first run..? Hmm.. Maybe yes.. |
Author: | hamid [ September 16th, 2014, 3:19 am ] |
Post subject: | Re: Temperature and Rotator? |
ok, it's ready: Attachment: Notes: 1. you should add deleted images&fonts to widget 2. you should adjust the objects' position if they needed ========== Changes: 1. Added: Saveini and menuitem checking for menuitems 2. fixed: location changing by removing one of the accuweathercores and changed the code to work only with one 3. fixed: celcius/fahrenheit changing by changing the textonchange function in the code 4. fixed: slidepanels to not get in the behind of another; now when you slide one, other one will slide-back 5. changed: position of [time] and [date] objects to [timee] object in the widget tree; to be compatible with changing clock mode and saveini; (also i have adjusted the position of them in new place; check the position of them to be adjusted) |
Author: | Jimking [ September 16th, 2014, 3:44 am ] |
Post subject: | Re: Temperature and Rotator? |
You did a lot of work..! ![]() I'll check and reply as soon as possible.. Edit: Quote: 1. you should add deleted images&fonts to widget 2. you should adjust the objects' position if they needed Is installed over the previous/my final version so I didn't have to do anything! And all seem to work ok of course ![]() Thanks a bunch hamid!!! |
Author: | hamid [ September 16th, 2014, 9:59 am ] |
Post subject: | Re: Temperature and Rotator? |
i have created an alternate version, maybe i don't wanna end up the work ![]() i created this because i couldn't decide which way will be better, so i decide to made both of them, Attachment: this one will change C/F itself without effecting the core's unit, the difference from previous version can be seen here: 1. you can change the unit and see in that unit in the accuweathercore weather info dialog, without effecting main text&rotator, (but it will effect on Weather-Slidepanel) 2. you can see the Weather-Slidepanel in the unit that choose in accuweathercore, so the unit doesn't change when change between clock/celsius/fahrenheit =========== in previous version these are this way: 1. you could only change weathercore unit and see it in the wether info dialog when you're using clock mode 2. Weather-Slidepanel would be shown in the unit of last layer mode that you have used in the widget |
Author: | Jimking [ September 16th, 2014, 2:28 pm ] |
Post subject: | Re: Temperature and Rotator? |
Haha! Nice work man. ![]() |
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |