wzh 5 лет назад
Родитель
Сommit
72c321bbe9
1 измененных файлов с 7 добавлено и 4 удалено
  1. 7 4
      api/application/controllers/Lampcontrol.php

+ 7 - 4
api/application/controllers/Lampcontrol.php

@@ -786,6 +786,7 @@ class Lampcontrol extends Base_Controller {
             
         // }
         $data['battery_count'] = 1;
+
         $data['overvoltage']                  = $this->input->post('overvoltage',true);  // 超压电压
         $data['char_limit_voltage']            = $this->input->post('char_limit_voltage',true);  // 充电限制电压
         $data['equ_char_voltage']               = $this->input->post('equ_char_voltage',true); // 均衡充电电压
@@ -798,7 +799,9 @@ class Lampcontrol extends Base_Controller {
         $data['discharge_limit_voltage']               = $this->input->post('discharge_limit_voltage',true) * 60;  // 放电限制电压 新增
         $data['equ_char_time']               = $this->input->post('equ_char_time',true) * 60;  // 均衡充电时间
         $data['increa_char_time']               = $this->input->post('increa_char_time',true) * 60;  // 提升充电时间
+
         $data['balan_char_interval']               = $this->input->post('balan_char_interval',true);  // 均衡充电间隔
+
         $data['temper_compen_coeff']               = $this->input->post('temper_compen_coeff',true);  // 温度补偿系数
         $data['char_lower_limit_temper']           = $this->input->post('char_lower_limit_temper',true);  // 下限温度
         $data['char_upper_limit_temper']           = $this->input->post('char_upper_limit_temper',true);  // 上限温度
@@ -812,14 +815,14 @@ class Lampcontrol extends Base_Controller {
         $lampData = $this->Lamp_model->get_one($where,'projectid,address,number');
         $sendData = '';
         foreach ($data as $k=>$v) {
-            if ($k == 'light_voltage' || $k == 'balan_char_interval' || $k == 'temper_compen_coeff') {
+            if ($k == 'light_voltage' || $k == 'balan_char_interval' || $k == 'temper_compen_coeff' || $k == 'light_delay_time') {
                 $word = substr('00'.base_convert($v, 10, 16), -2);
             }elseif ($k == 'char_upper_limit_temper' || $k == 'char_lower_limit_temper') {
                 if ($v < 0){
-                    $word = '1'.substr('0000000000000000'.base_convert(substr('0000'.base_convert(abs($v), 10, 16), -4), 16, 2), -15);
-                    $word = substr('0000'.base_convert($word, 2, 16), -4);
+                    $word = '1'.substr('00000000'.base_convert(substr('0000'.base_convert(abs($v), 10, 16), -4), 16, 2), -7);
+                    $word = substr('00'.base_convert($word, 2, 16), -2);
                 }else{
-                    $word = substr('0000'.base_convert($v, 10, 16), -4);
+                    $word = substr('00'.base_convert($v, 10, 16), -2);
                 }
             }elseif ($k == 'battery_type' || $k == 'battery_count') {
                 $word = substr('0'.base_convert($v, 10, 16), -1);