- Timestamp:
- Jul 23, 2015, 3:21:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/tools/EcnlControllerUI/EcnlCtrlUI/js/ctrlui.js
r108 r125 18 18 this.$m_WampClient.addOpenCallback(ss.mkdel(this, this.$wampClientConnected)); 19 19 this.$m_WampClient.addCloseCallback(ss.mkdel(this, this.$wampClientDisconnected)); 20 this.$m_WampClient.connect('ws://' + window.location.host + '/webapi .ashx');20 this.$m_WampClient.connect('ws://' + window.location.host + '/webapi'); 21 21 }; 22 22 $CtrlUI.__typeName = 'CtrlUI'; … … 2617 2617 this.get_propertyList().change(ss.thisFix(ss.mkdel(this, this.propertyChange))); 2618 2618 this.get_setInitParamsBtn().click(ss.thisFix(ss.mkdel(this, this.$setInitParams))); 2619 this.get_getInitParamsBtn().click(ss.thisFix(ss.mkdel(this, this.$getInitParams))); 2619 2620 }, 2620 2621 $initClassGroups: function(data) { … … 2808 2809 //接続スイッチがOn && m_WampClient.isConnecting() == false 2809 2810 if (connect && !this.$m_WampClient.isConnecting()) { 2810 this.$m_WampClient.connect('ws://' + window.location.host + '/webapi .ashx');2811 this.$m_WampClient.connect('ws://' + window.location.host + '/webapi'); 2811 2812 } 2812 2813 else if (!connect && this.$m_WampClient.isConnecting()) { … … 3041 3042 $setInitParams: function(elem, e) { 3042 3043 var macaddrfrm = new RegExp('([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2}):([0-9A-Fa-f]{2})'); 3044 var ipaddrfrm = new RegExp('([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})'); 3043 3045 var m = macaddrfrm.exec(this.get_macAddrTxt().val()); 3044 3046 if (ss.isNullOrUndefined(m)) { 3045 3047 return; 3046 3048 } 3047 var ma1 = parseInt(m[1], 16); 3048 var ma2 = parseInt(m[2], 16); 3049 var ma3 = parseInt(m[3], 16); 3050 var ma4 = parseInt(m[4], 16); 3051 var ma5 = parseInt(m[5], 16); 3052 var ma6 = parseInt(m[6], 16); 3053 this.$m_WampClient.sendCall('{}', 'jp.toppers.ecnl.procedure.setInitParams', '[]', '{"macAddr":[' + ma1 + ',' + ma2 + ',' + ma3 + ',' + ma4 + ',' + ma5 + ',' + ma6 + ']}', ss.mkdel(this, this.setInitParamsRes)); 3049 var macAddr = '"macAddr":[' + parseInt(m[1], 16) + ',' + parseInt(m[2], 16) + ',' + parseInt(m[3], 16) + ',' + parseInt(m[4], 16) + ',' + parseInt(m[5], 16) + ',' + parseInt(m[6], 16) + ']'; 3050 var dhcpEnable = '"dhcpEnable":' + this.get_dhcpEnableCb().prop('checked').toString(); 3051 m = ipaddrfrm.exec(this.get_ipAddrTxt().val()); 3052 if (ss.isNullOrUndefined(m)) { 3053 return; 3054 } 3055 var ipAddr = '"ipAddr":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']'; 3056 m = ipaddrfrm.exec(this.get_netmaskTxt().val()); 3057 if (ss.isNullOrUndefined(m)) { 3058 return; 3059 } 3060 var netmask = '"netmask":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']'; 3061 m = ipaddrfrm.exec(this.get_gatewayTxt().val()); 3062 if (ss.isNullOrUndefined(m)) { 3063 return; 3064 } 3065 var gateway = '"gateway":[' + parseInt(m[1]) + ',' + parseInt(m[2]) + ',' + parseInt(m[3]) + ',' + parseInt(m[4]) + ']'; 3066 this.$m_WampClient.sendCall('{}', 'jp.toppers.ecnl.procedure.setInitParams', '[]', '{' + macAddr + ',' + dhcpEnable + ',' + ipAddr + ',' + netmask + ',' + gateway + '}', ss.mkdel(this, this.setInitParamsRes)); 3054 3067 }, 3055 3068 setInitParamsRes: function(args) { … … 3079 3092 return; 3080 3093 } 3081 var macaddr = ss.cast(ss.cast(args, Array)[4].macAddr, Array); 3094 var param = ss.cast(args, Array)[4]; 3095 var macaddr = ss.cast(param.macAddr, Array); 3082 3096 this.get_macAddrTxt().val(ss.formatString('{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}', macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5])); 3097 var dhcpEnable = !!param.dhcpEnable; 3098 this.get_dhcpEnableCb().prop('checked', dhcpEnable).checkboxradio('refresh'); 3099 var ipaddr = ss.cast(param.ipAddr, Array); 3100 this.get_ipAddrTxt().val(ss.formatString('{0}:{1}:{2}:{3}', ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3])); 3101 var netmask = ss.cast(param.netmask, Array); 3102 this.get_netmaskTxt().val(ss.formatString('{0}:{1}:{2}:{3}', netmask[0], netmask[1], netmask[2], netmask[3])); 3103 var gateway = ss.cast(param.gateway, Array); 3104 this.get_gatewayTxt().val(ss.formatString('{0}:{1}:{2}:{3}', gateway[0], gateway[1], gateway[2], gateway[3])); 3083 3105 }, 3084 3106 get_setPropertyBtn: function() { … … 3117 3139 get_macAddrTxt: function() { 3118 3140 return $('#txt_mac_addr', $CtrlUI.$page); 3141 }, 3142 get_dhcpEnableCb: function() { 3143 return $('#cb_dhcp_enable', $CtrlUI.$page); 3144 }, 3145 get_ipAddrTxt: function() { 3146 return $('#txt_ip_addr', $CtrlUI.$page); 3147 }, 3148 get_netmaskTxt: function() { 3149 return $('#txt_netmask', $CtrlUI.$page); 3150 }, 3151 get_gatewayTxt: function() { 3152 return $('#txt_gateway', $CtrlUI.$page); 3119 3153 }, 3120 3154 pinMode_Change: function(fieldset, pin) {
Note:
See TracChangeset
for help on using the changeset viewer.