Author |
|
nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: August 21 2007 at 14:57 | IP Logged
|
|
|
I have no idea why I did this. It's not very practical, but here is a sort of working slider. It requires 2 macros, 2 buttons - you click on the top button to brighten and the bottom button to dim. But the buttons do 'slide' up and down. Maybe it will give someone else some GOOD ideas.
The first macro is for the brighten button AG1:
insert into macroheader values ('SLIDER TEST','test to see if I can get ',0,0,1);
insert into macrodetail values ('SLIDER TEST',1,16,'',NULL,'if(ph_getinsteonlevel("COMPUTER LIGHT1")>205,1,3)',0,'');
insert into macrodetail values ('SLIDER TEST',2,38,'',0,'ph_insteon("COMPUTER LIGHT1",ion,255)',0,'');
insert into macrodetail values ('SLIDER TEST',3,16,'',NULL,'2',0,'');
insert into macrodetail values ('SLIDER TEST',4,38,'',0,'ph_insteon("COMPUTER LIGHT1",ion,(ph_getinsteonlevel("COMPUTER LIGHT1")+50))
',0,'');
insert into macrodetail values ('SLIDER TEST',5,31,'',NULL,'.1',0,'');
insert into macrodetail values ('SLIDER TEST',6,15,'[LOCAL1]',NULL,'ph_getinsteonlevel("COMPUTER LIGHT1")',0,'');
insert into macrodetail values ('SLIDER TEST',7,38,'',0,'ph_setccobjy("INSTEON","AG1",(702-([LOCAL1]*2.00)))
',0,'');
insert into macrodetail values ('SLIDER TEST',8,38,'',0,'ph_setccobjy("INSTEON","AG2",(742-([LOCAL1]*2.00)))',0,'');
insert into macrodetail values ('SLIDER TEST',9,24,'No TTS',2,'"[LOCAL1]"',1,'');
insert into macrodetail values ('SLIDER TEST',10,38,'',0,'ph_setccobjtext("INSTEON","GB1"," &nb sp; [LOCAL1] ")',0,'');
The second macro is for the dim button AG2 :
insert into macroheader values ('SLIDER TEST2','test to see if I can get ',0,0,1);
insert into macrodetail values ('SLIDER TEST2',1,16,'',NULL,'if(ph_getinsteonlevel("COMPUTER LIGHT1")<55,1,3)',0,'');
insert into macrodetail values ('SLIDER TEST2',2,38,'',0,'ph_insteon("COMPUTER LIGHT1",ioff,0)',0,'');
insert into macrodetail values ('SLIDER TEST2',3,16,'',NULL,'2',0,'');
insert into macrodetail values ('SLIDER TEST2',4,38,'',0,'ph_insteon("COMPUTER LIGHT1",ion,(ph_getinsteonlevel("COMPUTER LIGHT1")-50))
',0,'');
insert into macrodetail values ('SLIDER TEST2',5,31,'',NULL,'1',1,'');
insert into macrodetail values ('SLIDER TEST2',6,15,'[LOCAL1]',NULL,'ph_getinsteonlevel("COMPUTER LIGHT1")',0,'');
insert into macrodetail values ('SLIDER TEST2',7,38,'',0,'ph_setccobjy("INSTEON","AG1",(702-([LOCAL1]*2.00)))',0,'');
insert into macrodetail values ('SLIDER TEST2',8,38,'',0,'ph_setccobjy("INSTEON","AG2",(742-([LOCAL1]*2)))',0,'');
insert into macrodetail values ('SLIDER TEST2',9,24,'No TTS',2,'"[LOCAL1]"',1,'');
insert into macrodetail values ('SLIDER TEST2',10,38,'',1,'ph_setccobjtext("INSTEON","GB1"," &n bsp; [LOCAL1] ")',0,'');
GB1 is the background group box. The label changes as the slider moves up and down.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: August 21 2007 at 15:04 | IP Logged
|
|
|
Heh,
By sliders, you must be talking about the recent screenshot of some of my lamps .
What Ive done here is basically created a background rectangle control that does absolutely nothing than represent the top, bottom, and in-between ranges of the "slider".
The "slider", does not actually slide, but instead allows you to click (or finger press on my touchscreen) anywhere along the slider range to control the light. What you cant see are the 20 (for 5% increments) "Action Text" objects stacked over the range rectangle (and slightly overlapping) without a border, transparent background, and no text. Each action rectangle calls a macro with parameters passing what light is being controlled and what increment percent is being activated. One macro controls all lights and is primarily based off of naming conventions of the controls. The macro sends the appropriate Insteon commands to the light and sets the previous controls background color to transparent and the newly pressed controls background color to blue. Device change triggers keeps the appropriate action text increment synchronized for local and other changes.
I'll detail this in detail after .12 since a couple of changes will be available that will make this even easier.
Dave.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: August 21 2007 at 15:09 | IP Logged
|
|
|
Whoa, Noel...awesome! I never thought of doing something like this, but your sample looks great!! Great work and just another idea on how to implement a slider.
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: August 21 2007 at 20:10 | IP Logged
|
|
|
Alrighty! Two good ideas!
|
Back to Top |
|
|
nadler Super User
Joined: February 25 2006 Location: United States
Online Status: Offline Posts: 354
|
Posted: August 24 2007 at 18:14 | IP Logged
|
|
|
Again, I don't know why I'm doing this, but here is yet another way to make a slider in the control center.
I used Dave's idea of transparent boxes and the formula and macro I used in the previous example. This is a much more useful and practical slider. Since pictures are said to be worth a 1000 words, here's both:
For each slider you create 6 (or more) action text boxes that are identical. Each box has an Action of RAWFORMULA. The raw formula is:
ph_insteon("Your Light",ion,0) + ph_macro ("SLIDER TEST4").
The 0 in the above formula represents the intensity of the light. Change the 0 in each formula for each box to a progressively higher number. I used 0,50,100,150,200,255 in this example but you can use other intensity numbers or use more boxes to get a finer gradation of intensity. I also labeled each box with its intensity so if I started to move around the boxes by accident, I won't get confused. But you don't have to label them. Make sure the background color of each box is the same color as the group box you are going to create next.
Also create a group box that serves as the background (lime green in the picture), a rectangle that is long and skinny that is the black vertical line, and a action graphic button. You can use any graphic. I used one that came with PH.
It's a good idea to write down the ID (name) of each box you've created (unless your memory is better than mine)because you will need them in the macro you create later.
Assemble the slider by placing the Lime green group box over the action text boxes. At this point bring the Lime Green Group box to the front (using the toolbar button up top of your screen). You should no longer see the action text boxes. If you do, make whatever adjustments are necessary. Place the black rectangle and then the actual slider button on the Lime Green Group box. Use the bring to front and send to back toolbar buttons as necessary. SAVE YOUR WORK!
To see what you've created you actually have to close the control center and then reopen it. You should see the slider. It won't slide up and down yet, but it should turn on and off the light in the various degrees of intensity that you set in each box.
The SLIDER TEST4 macro which each action text button calls when it is pressed is the brains behind the movement of the slider button.
After one of the transparent action text boxes is pressed the light it controls is turned on to the intensity set by the rawformula. The macro is then called and that light's intensity is read and saved in a local variable. The slider button is then moved on its y axis based on the intensity that is contained in the local variable. The label of the Lime green group box is also set to that intensity.
In the macro below 'AG1' is the name of my first slider button, LB1 is the name of my second slider button and GB2, GB2_1 are the names of the Lime Green boxes.
634 in the macro is the y axis of my slider buttons starting location. The intensity number of the light is then subtracted and the result multiplied by 2. Depending on your box size and the length of travel of you slider - these numbers would be different for you. Have fun playing with these numbers.
If anything needs further explanation, please let me know.
insert into macroheader values ('SLIDER TEST4','test to see if I can get ',0,0,1);
insert into macrodetail values ('SLIDER TEST4',1,37,'',NULL,'The first line waits to make sure the macro is not faster than the actual light change',0,'');
insert into macrodetail values ('SLIDER TEST4',2,31,'',NULL,'.5',0,'');
insert into macrodetail values ('SLIDER TEST4',3,37,'',NULL,'Next to lines reads the intensity of the 2 lights and sets 2 local variables to their intensity',0,'');
insert into macrodetail values ('SLIDER TEST4',4,15,'[LOCAL1]',NULL,'ph_getinsteonlevel("Your Light 1")',0,'');
insert into macrodetail values ('SLIDER TEST4',5,15,'[LOCAL2]',NULL,'ph_getinsteonlevel("Your Light 2")',0,'');
insert into macrodetail values ('SLIDER TEST4',6,37,'',NULL,'The next 2 lines sets the sliders on the y axis',0,'');
insert into macrodetail values ('SLIDER TEST4',7,38,'',1,'ph_setccobjy("INSTEON","AG1",(634-([LOCAL1]*2.00)))
',0,'');
insert into macrodetail values ('SLIDER TEST4',8,38,'',1,'ph_setccobjy("INSTEON","LB1",(634-([LOCAL2]*2.00)))',0,'');
insert into macrodetail values ('SLIDER TEST4',9,37,'',NULL,'The next 2 lines sets the LABELS on each group box to the intensity of the light(s)',0,'');
insert into macrodetail values ('SLIDER TEST4',10,38,'',1,'ph_setccobjtext("INSTEON","GB2"," &n bsp; [LOCAL2] ")',0,'');
insert into macrodetail values ('SLIDER TEST4',11,38,'',1,'ph_setccobjtext("INSTEON","GB2_1"," [LOCAL1] ")',0,'');
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: September 04 2007 at 05:35 | IP Logged
|
|
|
OK, I just release another beta version that supports the remote clients to be embedded into my eHome client. Also added 1024*768 screen support. (and yeah, I am working on a REAL help file)
More Powerhome integration on the way in my next release.
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: October 07 2007 at 05:25 | IP Logged
|
|
|
Just thought I would post a pic of the ehome - powerhome screen designer.
Five controls are supported.
1-button in 5 styles
2-label
3-picture box (on and off pics) supports alpha channel PNG as well as JPG,BMP...
4-slider
5-mini browser (good for pointing to cam web pages)
Once I get this finished I am going to get the Powerhome UDP and socket interface setup.
editor --
theme designer --
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
sharby Groupie
Joined: May 13 2007 Location: United States
Online Status: Offline Posts: 50
|
Posted: October 07 2007 at 23:41 | IP Logged
|
|
|
I want this!
-=*Sharby*=-
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: October 15 2007 at 10:52 | IP Logged
|
|
|
Butt Boy??
Looking good Steve. Im going to have to play with this too!
Dave.
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: October 18 2007 at 04:25 | IP Logged
|
|
|
Well... But boy is my son. I sent him this pic the other day. He is a programmer too and finaly finished a side project. As for the name... When he was 8 yrs old it was the part of his body he did most of his thinking with
Well, the basic designer is done. I am creating the player for it now and then will create the 'assign powerhome device to buttons' code.
Also added states to the buttons. So each button can now have on and off status. (shows red or green icon)
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: November 05 2007 at 14:39 | IP Logged
|
|
|
Well. Just wanted to say I am watching the UDP message fly by in my eHome code. Good job Dave!!! Now... What do i do with them?
Update.
The eHome screen designer and screen player are done. I am now working on the UDP and PH Socket interface.
If anyone is interested in doing some Beta testing for the powerhome - eHome screen designer... Please sign up on my eHome forum and let me know. I am hoping to have a early Beta out this next week.
Thanks!
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: November 09 2007 at 17:07 | IP Logged
|
|
|
Well...
This is a working eHome -Powerhome X-10 and macro screen shot. Buttons on the left are tied into X-10 devices as well as the PNG pics. (this is true 2 way communications thanks to Dave's UDP code and the socket server) Action buttons an the right are calling powerhome macros. And you get to see a web pic of traffic in eastern Europe thanks to the build in mini browser. (IP web cam anybody?) Still working on Insteon devices!! All in all it took me 5 minutes to build this screen. But thats because I let Dave do all the heavy work
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: November 09 2007 at 17:22 | IP Logged
|
|
|
Looking better and better!
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: November 09 2007 at 17:52 | IP Logged
|
|
|
Nice.
With the info in this thread maybe a slider gadget for dimming will be available?
Manny
__________________ PowerHomeFanSite/Guestbook
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: November 09 2007 at 18:02 | IP Logged
|
|
|
Manny!! This is all YOUR fault!!! Everybody, thank Manny. If it was not for him the eHome - Powerhome would of never happened.
And oh yes, the dimmer is there. Just got to hook it up to the powerhome messages. its one of the built in controls. I wrote the slider control control for you many months ago. :)
All your fault!!!!
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: November 09 2007 at 18:08 | IP Logged
|
|
|
What time is it over there, Steve?
3PM here.
__________________ PowerHomeFanSite/Guestbook
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: November 09 2007 at 18:13 | IP Logged
|
|
|
1:00 in the morning. :)
I got my 13 hrs of programming in today!!!
And i owe you a program.
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: November 09 2007 at 18:16 | IP Logged
|
|
|
Keep going; I'll sleep for you.
__________________ PowerHomeFanSite/Guestbook
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: November 09 2007 at 18:23 | IP Logged
|
|
|
Manny wrote:
Keep going; I'll sleep for you. |
|
|
Thanks Manny! I always can count on you for sleeping!!!
And I do owe you a program if you still need one.
Edited by eHomeCreations - November 09 2007 at 18:24
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
Manny Senior Member
Joined: March 23 2003 Location: United States
Online Status: Offline Posts: 172
|
Posted: November 09 2007 at 20:26 | IP Logged
|
|
|
Great I'll contact you offline...
__________________ PowerHomeFanSite/Guestbook
|
Back to Top |
|
|
|
|