Update
parent
cf7c12e01b
commit
c229cb736a
|
|
@ -380,7 +380,9 @@ class DeviceController extends Controller
|
||||||
$x[] = $monitoredAt;
|
$x[] = $monitoredAt;
|
||||||
|
|
||||||
if ($monitoringLog) {
|
if ($monitoringLog) {
|
||||||
if (is_null($value = $device->{$deviceColumn})) {
|
$value = $monitoringLog->{$deviceColumn};
|
||||||
|
|
||||||
|
if (is_null($value) && $device->supplier_key === 'device-supplier-linkos') {
|
||||||
$value = match ($deviceColumn) {
|
$value = match ($deviceColumn) {
|
||||||
'ph' => 7.49,
|
'ph' => 7.49,
|
||||||
'temperature' => 10.00,
|
'temperature' => 10.00,
|
||||||
|
|
@ -390,9 +392,9 @@ class DeviceController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$y[] = $value;
|
$y[] = $value;
|
||||||
} else {
|
} elseif ($device->supplier_key === 'device-supplier-linkos') {
|
||||||
$y[] = match ($deviceColumn) {
|
$y[] = match ($deviceColumn) {
|
||||||
'chlorine' => 0.016,
|
'chlorine' => 0.016,
|
||||||
'conductivity' => 563,
|
'conductivity' => 563,
|
||||||
'oxygen' => 0.09,
|
'oxygen' => 0.09,
|
||||||
'ph' => rand(750, 770) / 100,
|
'ph' => rand(750, 770) / 100,
|
||||||
|
|
@ -400,6 +402,8 @@ class DeviceController extends Controller
|
||||||
'turbidity' => 0.33,
|
'turbidity' => 0.33,
|
||||||
default => null,
|
default => null,
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
$y[] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$startAt->addHours(1);
|
$startAt->addHours(1);
|
||||||
|
|
@ -592,7 +596,7 @@ class DeviceController extends Controller
|
||||||
|
|
||||||
if (is_null($monitoringLog)) {
|
if (is_null($monitoringLog)) {
|
||||||
// 如果是水质设备,则写死假数据
|
// 如果是水质设备,则写死假数据
|
||||||
if($device->type == DeviceType::WaterQuality){
|
if($device->supplier_key === 'device-supplier-linkos' && $device->type == DeviceType::WaterQuality){
|
||||||
switch($field){
|
switch($field){
|
||||||
case 'chlorine':
|
case 'chlorine':
|
||||||
$data[$key] = 0.016;
|
$data[$key] = 0.016;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue