Changeset 406
- Timestamp:
- 2015-08-13 23:01:41 (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/J_IPX800.js ¶
r404 r406 87 87 var htmlrefresh = 'Update Frequency:</td><td><input id="updatefrequency" size="5" min="0" max="9999" type="number" value="'+updatefrequency+'" onchange="ipx_SetUpdateFrequency(' + deviceID + ', \'UpdateFrequency\', this.value)"> seconds.'; 88 88 var htmlpushmsg = 'you can also configure a PUSH from the ipx800 with the following path: /data_request?id=lr_IPX800_Handler&mac=$M&deviceID='+deviceID; 89 var htmloutput = 'Show Output Relays:</td><td><input id="ipx800_OutputRelays" type="text" size="15" value="'+outputRelays+'" onchange="ipx_SetOutputRelays(' + deviceID + ', \'OutputRelays\', this.value);">'+' csv list of numbers (1..32) & optional type W for window cover.ex: 1,5,6 or 1W-2-3-30 ,5,6 for up,"W","-",stop,"-",down,"-",cycle duration in sec. Relays must be configured in pulse mode for window cover )';89 var htmloutput = 'Show Output Relays:</td><td><input id="ipx800_OutputRelays" type="text" size="15" value="'+outputRelays+'" onchange="ipx_SetOutputRelays(' + deviceID + ', \'OutputRelays\', this.value);">'+' csv list of numbers (1..32) & optional type W for window cover.ex: 1,5,6 or 1W-2-3-30-40,5,6 for up,"W","-",stop,"-",down,"-",up cycle,"-",down cycle duration in sec. Relays must be configured in pulse mode for window cover )'; 90 90 var htmlinput = 'Show Digital Input:</td><td><input id="ipx800_InputRelays" type="text" size="15" value="'+inputRelays+'" onchange="ipx_SetInputRelays(' + deviceID + ', \'InputRelays\', this.value);">'+' csv list of numbers & optional type : 1,2 or 1P,2M'; 91 91 var htmlanainput = 'Show Analog Inputs:</td><td><input id="ipx800_AnalogInputs" type="text" size="15" value="'+analogInputs+'" onchange="ipx_SetAnalogInputs(' + deviceID + ', \'AnalogInputs\', this.value);">'+' csv list of numbers & optional type TLH : 1,2 or 1T,2L'; … … 177 177 { 178 178 // ex: 1W-2-3-20,2,3W-2-3-40,3W-2-3-40 179 var reg = /^(\d+(W-\d+-\d+(-\d+) ?|P)?)+(,\d+(W-\d+-\d+(-\d+)?|P)?)*$/;179 var reg = /^(\d+(W-\d+-\d+(-\d+)*|P)?)+(,\d+(W-\d+-\d+(-\d+)*|P)?)*$/; 180 180 return(reg.test(v)); 181 181 } -
TabularUnified trunk/L_IPX800.lua ¶
r404 r406 5 5 local version = "v0.49" 6 6 local UI7_JSON_FILE= "D_IPX800_UI7.json" 7 local DEFAULT_DELAY = 60 7 8 8 9 local http = require("socket.http") … … 573 574 return tbl 574 575 end 575 -- t = W-2-3-30 576 -- t = W-2-3-30-40 576 577 tbl = t:split("-") 578 if (tbl[4]==nil) then 579 tbl[4]=DEFAULT_DELAY 580 tbl[5]=DEFAULT_DELAY 581 else 582 if (tbl[5]==nil) then 583 tbl[5]=tbl[4] 584 end 585 end 577 586 return tbl 578 587 end … … 676 685 old = tonumber(old) 677 686 local percentage = math.abs(newLoadlevelTarget - old) 687 local whichdelay = 4 678 688 -- W-2-3-30 679 689 if (action=="up") then 680 690 setLoadLevel(lul_device,newLoadlevelTarget) 681 691 setIPXLed(lul_device,ipxnum,1) -- relay for up is this altid 692 whichdelay=4 682 693 elseif (action=="down") then 683 694 setLoadLevel(lul_device,newLoadlevelTarget) 684 695 setIPXLed(lul_device,tonumber(options[3])-1,1) -- relay for down is #3 696 whichdelay=5 685 697 elseif (action=="stop") then 686 698 setIPXLed(lul_device,tonumber(options[2])-1,1) -- relay for stop is #2 … … 689 701 if (newLoadlevelTarget~=0) and (newLoadlevelTarget~=100) then 690 702 -- if percent is not 100 , we need to stop a STOP command after some time 691 local delay = math.floor(tonumber(options[ 4]) * math.abs(newLoadlevelTarget-old)/100)703 local delay = math.floor(tonumber(options[whichdelay]) * math.abs(newLoadlevelTarget-old)/100) 692 704 debug(string.format("Programming stop in %d seconds",delay)) 693 705 local data = {}
Note: See TracChangeset
for help on using the changeset viewer.