Misfiring cylinder visible for gas engine

This commit is contained in:
Nikhil Kadam
2025-05-16 15:16:10 +05:30
parent 2cad19e740
commit d2c1ba578e

View File

@@ -1403,10 +1403,10 @@ class TelemetryController extends Controller
return response()->json(['success' => true, 'message' => 'Device not found'], 404);
}
$data = Cache::remember($cacheKey, now()->addHours(value: 1), function () use ($deviceId) {
// $data = Cache::remember($cacheKey, now()->addHours(value: 1), function () use ($deviceId) {
$device = Device::find($deviceId, ['device_profile_id', 'type']);
$profileId = $device->device_profile_id;
$isGasEngine = $device->type === 'Gas Engine Profile';
$isGasEngine = $device->type === 'Gas Engine';
$cylindersToShow = ['Compression Condition','Injection Condition','Bearing Condition','Condition of Cyl Moving Parts'];
if ($isGasEngine) {
@@ -1476,10 +1476,10 @@ class TelemetryController extends Controller
];
}
return ['success' => true, 'data' => $data];
});
$response = ['success' => true, 'data' => $data];
// });
return response()->json($data);
return response()->json($response);
} catch (Exception $e) {
return response()->json(['success' => false, 'message' => $e->getMessage()], 500);