临时给予大屏水质设备假数据

dev
vine_liutk 2023-03-22 19:55:59 +08:00
parent e315b4479c
commit b2c13ed29b
1 changed files with 21 additions and 0 deletions

View File

@ -245,6 +245,27 @@ class DeviceController extends Controller
}else{
$data[$device->monitoring_point][$_key] = $_dataList[$_key][$deviceColumn] ?? null;
}
}else{//临时写一些假数据
switch($deviceColumn){
case 'chlorine':
$data[$device->monitoring_point][$_key] = 0;
break;
case 'conductivity':
$data[$device->monitoring_point][$_key] = 563 ;//电导率
break;
case 'oxygen':
$data[$device->monitoring_point][$_key] = 0.09;//含氧量
break;
case 'ph':
$data[$device->monitoring_point][$_key] = rand(750, 770) / 100;
break;
case 'temperature':
$data[$device->monitoring_point][$_key] = rand(1400, 1600) / 100;
break;
case 'turbidity':
$data[$device->monitoring_point][$_key] = 0.33;
break;
}
}
}
}