Changeset 406


Ignore:
Timestamp:
2015-08-13 23:01:41 (10 years ago)
Author:
amg0
Message:

different up cycle time and down cycle time

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/J_IPX800.js

    r404 r406  
    8787    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.'; 
    8888    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 )'; 
    9090    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'; 
    9191    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'; 
     
    177177{ 
    178178    // 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)?)*$/;  
    180180    return(reg.test(v)); 
    181181} 
  • TabularUnified trunk/L_IPX800.lua

    r404 r406  
    55local version = "v0.49" 
    66local UI7_JSON_FILE= "D_IPX800_UI7.json" 
     7local DEFAULT_DELAY = 60 
    78 
    89local http = require("socket.http") 
     
    573574                return tbl 
    574575            end 
    575             -- t = W-2-3-30 
     576            -- t = W-2-3-30-40 
    576577            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 
    577586            return tbl 
    578587        end 
     
    676685        old = tonumber(old) 
    677686        local percentage = math.abs(newLoadlevelTarget - old) 
     687        local whichdelay = 4 
    678688        -- W-2-3-30 
    679689        if (action=="up") then 
    680690            setLoadLevel(lul_device,newLoadlevelTarget) 
    681691            setIPXLed(lul_device,ipxnum,1)      -- relay for up is this altid 
     692            whichdelay=4 
    682693        elseif (action=="down") then 
    683694            setLoadLevel(lul_device,newLoadlevelTarget) 
    684695            setIPXLed(lul_device,tonumber(options[3])-1,1)  -- relay for down is #3 
     696            whichdelay=5 
    685697        elseif (action=="stop") then 
    686698            setIPXLed(lul_device,tonumber(options[2])-1,1)  -- relay for stop is #2 
     
    689701        if (newLoadlevelTarget~=0) and (newLoadlevelTarget~=100) then 
    690702            -- 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) 
    692704            debug(string.format("Programming stop in %d seconds",delay)) 
    693705            local data = {} 
Note: See TracChangeset for help on using the changeset viewer.