@php $fmt = fn ($v, $d = 2) => $v === null || $v === '' ? '-' : number_format(round((float) $v, $d), $d, ',', ' '); // Klasy komórki oceny wg strefy. $zoneCell = [ 'green' => 'bg-green-100 text-green-900 dark:bg-green-900/30 dark:text-green-200', 'yellow' => 'bg-amber-100 text-amber-900 dark:bg-amber-900/30 dark:text-amber-200', 'red' => 'bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200', ]; $zoneHex = ['green' => '#2e7d32', 'yellow' => '#f9a825', 'red' => '#c62828']; // Kolor punktu pracy na wykresie Hp = ocena H=f(Q) (jak Evaluation4_HfQ w legacy). $hfqZone = $assessments['hfq']['zone'] ?? null; $hfqColor = $hfqZone ? $zoneHex[$hfqZone] : '#5b6566'; $spmType = 'SPM - '.strtoupper(str_replace(['images/spm_', '.png'], '', $spmImage)); $rows = [ ['Przedział Q', $assessments['q'] ?? null], ['H = f(Q)', $assessments['hfq'] ?? null], ['Dławienie', $assessments['throttle'] ?? null], ['Straty liniowe', $assessments['loss'] ?? null], ]; $isOn = $onoff && $onoff->DRD_VALUE === 'ON'; @endphp
@if (session('status'))
{{ session('status') }}
@endif @if (session('error'))
{{ session('error') }}
@endif {{-- Nagłówek --}}
← Eksploatacja studni

{{ $well->well_name }}

@if ($isOn) Załączona @else Wyłączona @endif
{{-- ===== LEWA KOLUMNA ===== --}}
{{-- Oceny pracy układu pompowego --}}
Oceny pracy układu pompowego
@if ($assessments === null)

Studnia typu „SPM - inne" - brak automatycznej oceny.

@else @foreach ($rows as [$label, $a]) @endforeach
{{ $label }} {{ $a['text'] ?? 'Brak oceny' }}
@endif
{{-- Układ pompowy + schemat SPM --}}
Układ pompowy - {{ $well->well_name }}
Ujęcie / Bariera
{{ $well->bariera ?: '-' }}
Pompa
{{ $well->pump_name ?: '-' }} {{ $well->pump_no ? '· '.$well->pump_no : '' }}
Silnik
{{ $well->engine_name ?: '-' }} {{ $well->engine_no ? '· '.$well->engine_no : '' }}
Qn [m³/min]
{{ $fmt($qnMin, 3) }}
{{-- Status diagnostyki --}} @if ((int) $diag === 2) Diagnostyka: błąd @elseif ((int) $diag === 1) Diagnostyka: ostrzeżenie @else Diagnostyka: OK @endif
@if ($measurement)

Data odpytania SYNDIS: {{ $measurement->date }}

@endif
{{-- Stan pracy --}}
Stan pracy - {{ $isOn ? 'Załączona' : 'Wyłączona' }} @if ($onoff) [{{ $onoff->DRD_AUDIT_DATE }}] @endif
ON
OFF
@if ($onoff && ! empty($onoff->reason))
Powód: {{ $onoff->reason }}
@endif
{{-- Akcje - pod stanem pracy (siatka 2-kol, jak na stronie parametrów) --}}
Parametry pracy układu
@csrf Pobierz aktualne dane
{{-- ===== PRAWA KOLUMNA ===== --}}
{{-- Ocena energochłonności --}}
Ocena energochłonności
@if ($energy) @else
Brak oceny
@endif
{{-- Wysokość podnoszenia --}}
Wysokość podnoszenia
@if ($hPlot) @else

Brak danych próby pompy.

@endif
{{-- Sprawność --}}
Sprawność
@if ($etaPlot) @else

Brak danych próby pompy.

@endif