Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Macros, Scripts, and Formulas Repository
 PowerHome Messageboard : PowerHome Macros, Scripts, and Formulas Repository
Subject Topic: Tigra Slider Web Control Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ginigma
Senior Member
Senior Member


Joined: June 18 2006
Location: United States
Online Status: Offline
Posts: 127
Posted: March 26 2008 at 18:42 | IP Logged Quote ginigma

Tigra Slider Web Control
Using the controls from http://www.softcomplex.com/products/tigra_slider_control/, I was able to create the slider controls I was looking for my Insteon based lighting. Dave modified the slider.js file (renamed slider_ph.js) that comes with that package to embed the /ph-cgi/devicebtn command (which is set for Insteon. If you want to use something different, e.g. X10, search that file for the devicebtn command and make the appropriate changes.) Overwrite the original slider.js file with the slider_ph.js file.
2008-03-26_184115_slider_ph.zip
Other changes to the original Tigra code include:
  • There is an additional variable value in the "A_INIT" section called "s_lightid". This is where you type your Insteon Device ID for a particular slider.
  • Inclusion of an inline frame to redirect the output of the Insteon lighting commands. Without this, it won't work (slider.js has been modified to work with this). The inline frame allows you to change your lighting without refreshing the entire page.


I've put the control in a table cell. The whole table is within a form, with the following settings:
<form action="Lighting-FamRoom.psp" method="get" name="Lighting-FamRoomSlider">

The code in the cell looks like this:
<input name="sliderValue" id="slider1" type="hidden" size="3">
<script language="JavaScript">
     var A_TPL = {
           'b_vertical'     : false,
           'b_watch'     : false,
           'n_minValue'     : 0,
           'n_maxValue'     : 100,
           'n_step'     : 2,
           'n_controlWidth': 280,
           'n_controlHeight': 30,
           'n_sliderWidth'     : 40,
           'n_sliderHeight': 40,
           'n_pathLeft'     : 0,
           'n_pathTop'     : -5,
           'n_pathLength'     : 240,
           's_imgControl'     : 'images/imgSliderControl4.png',
           's_imgSlider'     : 'images/imgSliderButton.png',
           'n_zIndex'     : 1
     }
     var A_INIT1 = {
           's_form'     : 0,
           's_name'     : 'slider1',
           's_lightid'     : 'FAMILY ROOM 01',
           'n_value'     : <% int(ph_getinsteonlevel("FAMILY ROOM 01"))*100/255 %>
     }
     new slider(A_INIT1, A_TPL);
</script>

Obviously some info in there needs to be customized to your situation, but the name:value pairs are well documented in the Tigra documentation.
Additional slider controls can be put on the page just by adding additional "A_INIT" sections. This is discussed in the Tigra documentation.

The inline frame has the following settings:
<iframe src="/ph-cgi/blank?type=0" id="output" name="output" style="display:none"></iframe>

Thanks to Dave (and TonyNo for other PSP answers) for getting this to work.


__________________
Insteon (40 devices) ^ PowerHome (435 links) ^ Logitech Harmony 880
Back to Top View ginigma's Profile Search for other posts by ginigma Visit ginigma's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum