|
@@ -1079,28 +1079,28 @@ class Lampcontrol extends Base_Controller {
|
|
|
$update['induction_delay'] = '10';
|
|
|
}else{ // 蓄电池参数
|
|
|
|
|
|
- $update['system_voltage'] = '12'; // 电池电压
|
|
|
- $update['battery_type'] = '1'; //蓄电池类型
|
|
|
- $update['overvoltage'] = '15.5'; // 超压电压
|
|
|
- $update['char_limit_voltage'] = '15.0'; // 充电限制电压
|
|
|
- $update['equ_char_voltage'] = '14.6'; // 均衡充电电压
|
|
|
- $update['increa_char_voltage'] = '14.4'; // 提升充电电压
|
|
|
- $update['float_char_voltage'] = '13.8'; // 浮充充电电压
|
|
|
- $update['increa_char_return_voltage'] = '13.2'; // 提升充电返回电压
|
|
|
- $update['over_dischar_return_voltage'] = '12.6'; // 过放返回电压
|
|
|
- $update['battery_under_voltage'] = '12.0'; // 欠压警告电压 新增
|
|
|
- $update['over_dischar_voltage'] = '11.1'; // 过放电压
|
|
|
- $update['discharge_limit_voltage'] = '10.6'; // 放电限制电压 新增
|
|
|
- $update['equ_char_time'] = '120'; // 均衡充电时间
|
|
|
- $update['increa_char_time'] = '120'; // 提升充电时间
|
|
|
- $update['balan_char_interval'] = '30'; // 均衡充电间隔
|
|
|
- $update['temper_compen_coeff'] = '5'; // 温度补偿系数
|
|
|
- $update['char_upper_limit_temper'] = '60'; // 上限温度
|
|
|
- $update['char_lower_limit_temper'] = '-30'; // 下限温度
|
|
|
- $update['reduced_start_voltage'] = '11.5'; // 智能功率起始电压
|
|
|
- $update['reduced_stop_voltage'] = '10.0'; // 智能功率结束电压
|
|
|
- $update['light_voltage'] = '5'; // 光控电压
|
|
|
- $update['light_delay_time'] = '20'; // 光控延时时间
|
|
|
+ $update['system_voltage'] = 12; // 电池电压
|
|
|
+ $update['battery_type'] = 1; //蓄电池类型
|
|
|
+ $update['overvoltage'] = 15.5; // 超压电压
|
|
|
+ $update['char_limit_voltage'] = 15.0; // 充电限制电压
|
|
|
+ $update['equ_char_voltage'] = 14.6; // 均衡充电电压
|
|
|
+ $update['increa_char_voltage'] = 14.4; // 提升充电电压
|
|
|
+ $update['float_char_voltage'] = 13.8; // 浮充充电电压
|
|
|
+ $update['increa_char_return_voltage'] = 13.2; // 提升充电返回电压
|
|
|
+ $update['over_dischar_return_voltage'] = 12.6; // 过放返回电压
|
|
|
+ $update['battery_under_voltage'] = 12.0; // 欠压警告电压 新增
|
|
|
+ $update['over_dischar_voltage'] = 11.1; // 过放电压
|
|
|
+ $update['discharge_limit_voltage'] = 10.6; // 放电限制电压 新增
|
|
|
+ $update['equ_char_time'] = 120; // 均衡充电时间
|
|
|
+ $update['increa_char_time'] = 120; // 提升充电时间
|
|
|
+ $update['balan_char_interval'] = 30; // 均衡充电间隔
|
|
|
+ $update['temper_compen_coeff'] = 5; // 温度补偿系数
|
|
|
+ $update['char_upper_limit_temper'] = 60; // 上限温度
|
|
|
+ $update['char_lower_limit_temper'] = -30; // 下限温度
|
|
|
+ $update['reduced_start_voltage'] = 11.5; // 智能功率起始电压
|
|
|
+ $update['reduced_stop_voltage'] = 10.0; // 智能功率结束电压
|
|
|
+ $update['light_voltage'] = 5; // 光控电压
|
|
|
+ $update['light_delay_time'] = 20; // 光控延时时间
|
|
|
|
|
|
}
|
|
|
exit(json_result('0000',$this->response['0000'],$update));
|
|
@@ -1201,8 +1201,8 @@ class Lampcontrol extends Base_Controller {
|
|
|
$info = unpack('H*', $res['msg'])[1];
|
|
|
set_log('battery_setting.txt',$info);
|
|
|
$data['system_voltage'] = substr($info, 18,2) == 'ff' ? '0' : base_convert(substr($info, 18,2),16,10); // 电池电压
|
|
|
- $data['battery_count'] = base_convert(substr($info, 20,1), 16, 10); // 电池串数
|
|
|
- $data['battery_type'] = base_convert(substr($info, 21,1), 16, 10); //蓄电池类型
|
|
|
+ $data['battery_count'] = round(base_convert(substr($info, 20,1), 16, 10)); // 电池串数
|
|
|
+ $data['battery_type'] = round(base_convert(substr($info, 21,1), 16, 10)); //蓄电池类型
|
|
|
$data['overvoltage'] = round(base_convert(substr($info, 22,4), 16, 10)/1000,1); // 超压电压
|
|
|
$data['char_limit_voltage'] = round(base_convert(substr($info, 26,4), 16, 10)/1000,1); // 充电限制电压
|
|
|
$data['equ_char_voltage'] = round(base_convert(substr($info, 30,4), 16, 10)/1000,1); // 均衡充电电压
|
|
@@ -1213,29 +1213,29 @@ class Lampcontrol extends Base_Controller {
|
|
|
$data['battery_under_voltage'] = round(base_convert(substr($info, 50,4), 16, 10)/1000,1); // 欠压警告电压 新增
|
|
|
$data['over_dischar_voltage'] = round(base_convert(substr($info, 54,4), 16, 10)/1000,1); // 过放电压
|
|
|
$data['discharge_limit_voltage'] = round(base_convert(substr($info, 58,4), 16, 10)/1000,1); // 放电限制电压 新增
|
|
|
- $data['equ_char_time'] = base_convert(substr($info, 62,4), 16, 10); // 均衡充电时间
|
|
|
- $data['increa_char_time'] = base_convert(substr($info, 66,4), 16, 10); // 提升充电时间
|
|
|
- $data['balan_char_interval'] = base_convert(substr($info, 70,2), 16, 10); // 均衡充电间隔
|
|
|
- $data['temper_compen_coeff'] = base_convert(substr($info, 72,2), 16, 10); // 温度补偿系数
|
|
|
+ $data['equ_char_time'] = round(base_convert(substr($info, 62,4), 16, 10)); // 均衡充电时间
|
|
|
+ $data['increa_char_time'] = round(base_convert(substr($info, 66,4), 16, 10)); // 提升充电时间
|
|
|
+ $data['balan_char_interval'] = round(base_convert(substr($info, 70,2), 16, 10)); // 均衡充电间隔
|
|
|
+ $data['temper_compen_coeff'] = round(base_convert(substr($info, 72,2), 16, 10)); // 温度补偿系数
|
|
|
|
|
|
$char_lower_limit_temper = base_convert(substr($info, 74,2), 16, 2); // 下限温度
|
|
|
if (substr(substr('00000000'.$char_lower_limit_temper, -8), 0,1) == 1) {
|
|
|
$data['char_lower_limit_temper'] = 0 - base_convert(substr('0000000'.$char_lower_limit_temper, -7), 2, 10);
|
|
|
}else{
|
|
|
- $data['char_lower_limit_temper'] = base_convert($char_lower_limit_temper, 2, 10);
|
|
|
+ $data['char_lower_limit_temper'] = round(base_convert($char_lower_limit_temper, 2, 10));
|
|
|
}
|
|
|
|
|
|
$char_upper_limit_temper = base_convert(substr($info, 76,2), 16, 2); // 上限温度
|
|
|
if (substr(substr('00000000'.$char_upper_limit_temper, -8), 0,1) == 1) {
|
|
|
$data['char_upper_limit_temper'] = 0 - base_convert(substr('0000000'.$char_upper_limit_temper, -7), 2, 10);
|
|
|
}else{
|
|
|
- $data['char_upper_limit_temper'] = base_convert($char_upper_limit_temper, 2, 10);
|
|
|
+ $data['char_upper_limit_temper'] = round(base_convert($char_upper_limit_temper, 2, 10));
|
|
|
}
|
|
|
|
|
|
$data['reduced_start_voltage'] = round(base_convert(substr($info, 78,4), 16, 10)/1000,1); // 智能功率起始电压
|
|
|
$data['reduced_stop_voltage'] = round(base_convert(substr($info, 82,4), 16, 10)/1000,1); // 智能功率结束电压
|
|
|
$data['light_voltage'] = round(base_convert(substr($info, 86,2), 16, 10)/10); // 光控电压
|
|
|
- $data['light_delay_time'] = base_convert(substr($info, 88,2), 16, 10)*10; // 光控延时时间
|
|
|
+ $data['light_delay_time'] = round(base_convert(substr($info, 88,2), 16, 10)*10); // 光控延时时间
|
|
|
|
|
|
exit(json_result('0000',$this->response['0000'],$data));
|
|
|
}else{
|