| | |
| | | <td><input type="text" id="battInfo_home_name" readonly="readonly" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>电池标称容量(AH)</th>
|
| | | <th>电池标称内阻(uΩ)</th>
|
| | | <th>电池标称容量(1~6000.0AH)</th>
|
| | | <th>电池标称内阻(1~60000uΩ)</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_nom_cap" value=""></td>
|
| | | <td><input type="text" id="battInfo_nom_res" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>电池组数</th>
|
| | | <th>每组电池单体数量</th>
|
| | | <th>电池组数(1~2)</th>
|
| | | <th>每组电池单体数量(1~300 )</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_batt_num" value=""></td>
|
| | | <td><input type="text" id="battInfo_batt_mon_num" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>单体标称电压(V)</th>
|
| | | <th>电池组端标称电压(V)</th>
|
| | | <th>单体标称电压(0.1~20.0V)</th>
|
| | | <th>电池组端标称电压(0.1~600.0V)</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_batt_nom_vol" value=""></td>
|
| | | <td><input type="text" id="battInfo_group_nom_vol" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>电池标称温度(℃)</th>
|
| | | <th>电池浮充电压阀值(V)</th>
|
| | | <th>电池标称温度(0.1~60.0℃)</th>
|
| | | <th>电池浮充电压阀值(0.1~60.0V)</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_batt_nom_temp" value=""></td>
|
| | | <td><input type="text" id="battInfo_batt_float_vol" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>电池浮充电流阀值(A)</th>
|
| | | <th>在线电压低阀值(V)</th>
|
| | | <th>电池浮充电流阀值(0.1~30.0A)</th>
|
| | | <th>在线电压低阀值(0.1~60.0V)</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_batt_float_curr" value=""></td>
|
| | | <td><input type="text" id="battInfo_online_low_vol" value=""></td>
|
| | | </tr>
|
| | | <tr>
|
| | | <th>电池组连接类型</th>
|
| | | <th>电池组连接类型(0~1)</th>
|
| | | </tr>
|
| | | <tr>
|
| | | <td><input type="text" id="battInfo_batt_link_type" value=""></td>
|
| | |
| | | </div>
|
| | | <div class="popup-footer">
|
| | | <input type="button" name="" id="battInfo_read" value="读取" >
|
| | | <input type="button" name="" id="battInfo_en" class="status-change-set " value="设置" >
|
| | | <input type="button" name="" id="battInfo_en" class="status-change-set whyc-btn-disabled" value="设置" >
|
| | | </div>
|
| | | </div>
|
| | |
|
| | |
| | | // 电池参数
|
| | | var battCMD = GLOBAL.CMD.batt; // cmd命令
|
| | | var battPopup = GLOBAL.battInfoPopup; // 电池参数模块
|
| | | battPopup.testVal(); // 设置面板的取值范围
|
| | | $('#battInfoBtn').click(function() {
|
| | | // 获取电池信息
|
| | | var batt = getBatt();
|
| | | // console.log(batt);
|
| | | var temp = {
|
| | | dev_id: batt.FBSDeviceId
|
| | | };
|
| | |
| | | var load = layer.load(1);
|
| | | battPopup.search(temp, batt, function(res, binf) {
|
| | | layer.close(load);
|
| | | // console.log(res);
|
| | | battInfo_popup.showPopup(); // 显示battInfo_popup弹出框和遮罩层
|
| | | });
|
| | | battInfo_popup.showPopup(); // 显示battInfo_popup弹出框和遮罩层
|
| | | |
| | | });
|
| | |
|
| | | // 点击设定
|
| | | $('#battInfo_en').click(function() {
|
| | | if($(this).hasClass('whyc-btn-disabled')) {
|
| | | return;
|
| | | }
|
| | | // 设置电池参数面板信息
|
| | | var load = layer.load(1);
|
| | | battPopup.set(function(res) {
|
| | |
| | |
|
| | | // 点击读取
|
| | | $('#battInfo_read').click(function() {
|
| | | var batt = getBatt();
|
| | | var temp = {
|
| | | dev_id: batt.FBSDeviceId
|
| | | };
|
| | | // 设置电池参数面板信息
|
| | | var load = layer.load(1);
|
| | | battPopup.read(function(res) {
|
| | | layer.close(load);
|
| | | layer.msg('获取参数成功');
|
| | | // console.log(res);
|
| | | if(res.code == 1) {
|
| | | battPopup.search(temp, batt, function(res, binf) {
|
| | | layer.close(load);
|
| | | layer.msg('获取参数成功');
|
| | | });
|
| | | }else {
|
| | | layer.msg('获取参数失败'); |
| | | }
|
| | | |
| | | });
|
| | | });
|
| | |
|
| | |
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | console.log(rs);
|
| | | //console.log(rs);
|
| | | }
|
| | | ,complete: function() {
|
| | | layer.close(load);
|
| | |
| | | gl.namespace('battInfoPopup');
|
| | | // 模块依赖GLOBAL.CMD.batt模块
|
| | | var cmd = GLOBAL.CMD.batt;
|
| | | |
| | | // 数据校验
|
| | | function testVal() {
|
| | | // 电池标称容量
|
| | | $('#battInfo_nom_cap').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 1,
|
| | | max: 6000,
|
| | | msg: '取值范围1~6000.0'
|
| | | });
|
| | | |
| | | // 电池标称内阻
|
| | | $('#battInfo_nom_res').testVal({
|
| | | pattern: /^[0-9]{1,4}$/,
|
| | | regVal: true,
|
| | | min: 1,
|
| | | max: 60000,
|
| | | msg: '取值范围1~60000'
|
| | | });
|
| | | |
| | | // 电池组数
|
| | | $('#battInfo_batt_num').testVal({
|
| | | pattern: /^[0-9]{1,4}$/,
|
| | | regVal: true,
|
| | | min: 1,
|
| | | max: 2,
|
| | | msg: '取值范围1~2'
|
| | | });
|
| | | |
| | | // 每组电池单体数量
|
| | | $('#battInfo_batt_mon_num').testVal({
|
| | | pattern: /^[0-9]{1,4}$/,
|
| | | regVal: true,
|
| | | min: 1,
|
| | | max: 300,
|
| | | msg: '取值范围1~300'
|
| | | });
|
| | | |
| | | // 单体标称电压
|
| | | $('#battInfo_batt_nom_vol').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 20,
|
| | | msg: '取值范围0.1~20.0'
|
| | | });
|
| | | |
| | | // 电池组端标称电压
|
| | | $('#battInfo_group_nom_vol').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 600,
|
| | | msg: '取值范围0.1~600.0'
|
| | | });
|
| | | |
| | | // 电池标称温度
|
| | | $('#battInfo_batt_nom_temp').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 60,
|
| | | msg: '取值范围0.1~60.0'
|
| | | });
|
| | | |
| | | // 电池浮充电压阀值
|
| | | $('#battInfo_batt_float_vol').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 60,
|
| | | msg: '取值范围0.1~60.0'
|
| | | });
|
| | | |
| | | // 电池浮充电流阀值
|
| | | $('#battInfo_batt_float_curr').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 30,
|
| | | msg: '取值范围0.1~30.0'
|
| | | });
|
| | | |
| | | // 在线电压低阀值
|
| | | $('#battInfo_online_low_vol').testVal({
|
| | | pattern: /^[0-9]{1,4}(\.[0-9]{0,1})?$/,
|
| | | regVal: true,
|
| | | min: 0.1,
|
| | | max: 60,
|
| | | msg: '取值范围0.1~60.0'
|
| | | });
|
| | | |
| | | // 电池组连接类型
|
| | | $('#battInfo_batt_link_type').testVal({
|
| | | pattern: /^[0-9]{1,4}$/,
|
| | | regVal: true,
|
| | | min: 0,
|
| | | max: 1,
|
| | | msg: '取值范围0~1'
|
| | | });
|
| | | |
| | | // 内容改变设置值
|
| | | $('#battInfo_popup input[type=text]').on('input propertychange focus', function() {
|
| | | setEnStatus();
|
| | | });
|
| | | }
|
| | | |
| | | // 将testVal添加到battInfoPopup命名空间下
|
| | | gl.battInfoPopup.testVal = testVal;
|
| | | |
| | | // 查询机房的信息
|
| | | function search(temp, binf, callback) {
|
| | | // 查询电池参数
|
| | |
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | |
| | | init();
|
| | | // 设置面板信息
|
| | | setParam(rs, binf);
|
| | | if(isFunction(callback)) {
|
| | |
| | |
|
| | | // 读取信息
|
| | | function read(callback) {
|
| | | var param = getParam();
|
| | | var param = {
|
| | | dev_ip: $('#battInfo_ip').val() // 设备的ip
|
| | | ,dev_id: $('#battInfo_dev_id').val() // 设备的id
|
| | | ,num: cmd.get // 获取的命令
|
| | | ,STD_CAP: 0 // 电池标称容量(AH)
|
| | | ,STD_RES: 0 // 电池标称内阻(uΩ)
|
| | | ,BattGroupCount: 0 // 电池组数
|
| | | ,EachGroupBattCount: 0 // 每组电池单体数量
|
| | | ,MonomerVol: 0 // 单体标称电压(V)
|
| | | ,GroupVol: 0 // 电池组端标称电压(V)
|
| | | ,BattTemp: 0 // 电池标称温度(℃)
|
| | | ,FloatChargeVol: 0 // 电池浮充电压阀值(V)
|
| | | ,FloatChargeCurr: 0 // 电池浮充电流阀值(A)
|
| | | ,OnlineVolLow: 0 // 在线电压低阀值(V)
|
| | | ,GroupConnType: 0 // 电池组连接类型 |
| | | };
|
| | | param.num = cmd.get;
|
| | | //console.log(param);
|
| | | //return;
|
| | |
|
| | | // 读取电池参数
|
| | | $.ajax({
|
| | |
| | | ,dataType: 'json'
|
| | | ,success: function(res) {
|
| | | var rs = JSON.parse(res.result);
|
| | | // console.log(rs);
|
| | | // 根据读取到的信息设置面板的信息
|
| | | //setParam(rs);
|
| | | // setParam(rs);
|
| | |
|
| | | // 回调内容
|
| | | if(isFunction(callback)) {
|
| | |
| | | var rs = {};
|
| | | rs.dev_ip = $('#battInfo_ip').val(); // 设备的ip
|
| | | rs.dev_id = $('#battInfo_dev_id').val(); // 设备的id
|
| | | rs.num = cmd.set; // 设置的命名
|
| | | rs.num = cmd.set; // 设置的命令
|
| | | rs.STD_CAP = $('#battInfo_nom_cap').val(); // 电池标称容量(AH)
|
| | | rs.STD_RES = $('#battInfo_nom_res').val(); // 电池标称内阻(uΩ)
|
| | | rs.BattGroupCount = $('#battInfo_batt_num').val(); // 电池组数
|
| | |
| | | rs.GroupConnType = $('#battInfo_batt_link_type').val(); // 电池组连接类型
|
| | | return rs;
|
| | | }
|
| | | |
| | | // 初始化表格内容
|
| | | function init(data) {
|
| | | //console.log(battInfo_popup);
|
| | | var _popup = battInfo_popup.popup;
|
| | | _popup.find('input[type=text]').removeClass('error-data');
|
| | | _popup.find('.status-change-set').removeClass('whyc-btn-disabled');
|
| | | _popup.data = data;
|
| | | }
|
| | | |
| | | // 设置面板的设置按钮的状态
|
| | | function setEnStatus() {
|
| | | var _popup = battInfo_popup.popup;
|
| | | var iptList = _popup.find('input[type=text]');
|
| | | var setEn = _popup.find('.status-change-set');
|
| | | var isError = false;
|
| | | iptList.each(function() {
|
| | | if($(this).hasClass('error-data')) {
|
| | | isError = true;
|
| | | }
|
| | | });
|
| | | |
| | | if(isError) {
|
| | | _popup.find('.status-change-set').addClass('whyc-btn-disabled');
|
| | | }else {
|
| | | _popup.find('.status-change-set').removeClass('whyc-btn-disabled');
|
| | | }
|
| | | }
|
| | | })(jQuery, window, document, GLOBAL); |