@extends('layouts.app') @section('center') @php use Carbon\Carbon; $offlineAfterMinutes = 60; $totalDevices = count($data); $onlineCount = 0; $offlineCount = 0; $offCount = 0; foreach ($data as $device) { if (!empty($device->server_time_update_our_value)) { $lastTime = Carbon::parse($device->server_time_update_our_value); $minutesDiff = now()->diffInMinutes($lastTime); } else { $minutesDiff = 999999; } if (($device->auxr_status ?? 0) == 1) { if ($minutesDiff > $offlineAfterMinutes) { $offlineCount++; } else { $onlineCount++; } } else { $offCount++; } } @endphp
| Total Current: {{ number_format($sumCurrent, 2) }} Amps |
| Voltage: {{ number_format($avgVoltage, 2) }} Volts |
| Power Factor: {{ $displayPf }} |
| Apparent Power: {{ number_format($totalKva, 2) }} KVA |
| Active Power: {{ number_format($totalKw, 2) }} KW |
| Consumption: {{ number_format($totalConsumption, 2) }} kWh |