Files
2026-09-03 12:21:17 +02:00

93 lines
5.2 KiB
PHP

@props([
'throttle' => null, // strefa oceny dławienia: green|yellow|red|null
'loss' => null, // strefa oceny strat liniowych
'on' => false, // czy pompa załączona
'grey' => false, // tryb bez oceny (SPM - inne)
'type' => 'SPM', // etykieta typu (BASE/OPT/FULL)
])
@php
// Dynamiczny schemat układu pompowego (zastępuje statyczne PNG SPM_*).
// Kolory podstawiane wg ocen: zawór dławiący = dławienie, rurociąg = straty.
$zc = ['green' => '#2e7d32', 'yellow' => '#f9a825', 'red' => '#c62828'];
$valveColor = $grey ? '#9aa6a8' : ($zc[$throttle] ?? '#9aa6a8');
$pipeColor = $grey ? '#9aa6a8' : ($zc[$loss] ?? '#9aa6a8');
$pumpColor = $on ? '#16a34a' : '#9aa6a8';
$label = '#2f3e45'; // stały ciemny - schemat na jasnym podkładzie w obu motywach
@endphp
<svg viewBox="0 0 360 480" class="w-full h-auto max-h-[28rem] mx-auto" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="ws-ground" width="8" height="8" patternTransform="rotate(45)" patternUnits="userSpaceOnUse">
<line x1="0" y1="0" x2="0" y2="8" stroke="#b9a58c" stroke-width="2"/>
</pattern>
</defs>
{{-- ===== Instalacja powierzchniowa (tłoczenie) ===== --}}
{{-- pion z głowicy do poziomu --}}
<rect x="156" y="60" width="8" height="62" fill="{{ $pipeColor }}"/>
{{-- kolano + rurociąg tłoczny poziomy --}}
<path d="M156 64 H300" stroke="{{ $pipeColor }}" stroke-width="8" fill="none"/>
{{-- zawór dławiący (kolor = ocena dławienia) --}}
<g>
<polygon points="214,52 214,76 238,52 238,76" fill="{{ $valveColor }}" stroke="#3b3b3b" stroke-width="1.2"/>
<line x1="226" y1="48" x2="226" y2="40" stroke="#3b3b3b" stroke-width="2"/>
<rect x="219" y="36" width="14" height="5" rx="1" fill="#3b3b3b"/>
</g>
{{-- manometry p1 / p2 --}}
<circle cx="196" cy="46" r="9" fill="#ffffff" stroke="#3b3b3b" stroke-width="1.5"/>
<line x1="196" y1="55" x2="196" y2="61" stroke="#3b3b3b" stroke-width="2"/>
<text x="196" y="32" font-size="11" font-weight="600" fill="{{ $label }}" text-anchor="middle">p₁</text>
<circle cx="258" cy="46" r="9" fill="#ffffff" stroke="#3b3b3b" stroke-width="1.5"/>
<line x1="258" y1="55" x2="258" y2="61" stroke="#3b3b3b" stroke-width="2"/>
<text x="258" y="32" font-size="11" font-weight="600" fill="{{ $label }}" text-anchor="middle">p₂</text>
{{-- przepływomierz Q --}}
<rect x="280" y="55" width="20" height="18" rx="2" fill="#ffffff" stroke="#3b3b3b" stroke-width="1.5"/>
<text x="290" y="68" font-size="10" font-weight="700" fill="#3b3b3b" text-anchor="middle">Q</text>
{{-- wylot --}}
<path d="M300 64 H324 M318 58 L324 64 L318 70" stroke="#3b3b3b" stroke-width="2.5" fill="none"/>
{{-- ===== Grunt ===== --}}
<rect x="0" y="122" width="360" height="14" fill="url(#ws-ground)"/>
<line x1="0" y1="122" x2="360" y2="122" stroke="#8f706c" stroke-width="1.5"/>
{{-- ===== Otwór studni (obudowa) ===== --}}
<line x1="138" y1="122" x2="138" y2="452" stroke="#5b6566" stroke-width="3"/>
<line x1="182" y1="122" x2="182" y2="452" stroke="#5b6566" stroke-width="3"/>
<line x1="138" y1="452" x2="182" y2="452" stroke="#5b6566" stroke-width="3"/>
{{-- woda (zwierciadło dynamiczne) --}}
<rect x="140" y="232" width="40" height="219" fill="#cfeaf5" opacity="0.65"/>
{{-- zwierciadło statyczne Hst (przerywane) --}}
<line x1="140" y1="206" x2="180" y2="206" stroke="#1565c0" stroke-width="1.4" stroke-dasharray="4 3"/>
<text x="188" y="209" font-size="10" fill="{{ $label }}">H<tspan baseline-shift="sub" font-size="7">st</tspan></text>
{{-- zwierciadło dynamiczne Hd --}}
<line x1="140" y1="232" x2="180" y2="232" stroke="#1565c0" stroke-width="2"/>
<text x="188" y="235" font-size="10" fill="{{ $label }}">H<tspan baseline-shift="sub" font-size="7">d</tspan></text>
{{-- rurociąg pionowy (kolor = straty liniowe) --}}
<rect x="156" y="122" width="8" height="262" fill="{{ $pipeColor }}"/>
{{-- ===== Agregat pompowy ===== --}}
{{-- pompa --}}
<rect x="150" y="384" width="20" height="38" rx="3" fill="{{ $pumpColor }}" stroke="#2f3e45" stroke-width="1.5"/>
{{-- silnik --}}
<rect x="152" y="422" width="16" height="22" rx="2" fill="#46555d"/>
{{-- króciec ssawny --}}
<line x1="160" y1="444" x2="160" y2="450" stroke="#46555d" stroke-width="3"/>
{{-- ciśnienie tłoczne pompy Pp --}}
<circle cx="160" cy="372" r="7" fill="#ffffff" stroke="#3b3b3b" stroke-width="1.3"/>
<text x="172" y="362" font-size="10" fill="{{ $label }}">P<tspan baseline-shift="sub" font-size="7">p</tspan></text>
{{-- etykieta typu + opis (prawa strona) --}}
<text x="214" y="150" font-size="13" font-weight="700" fill="{{ $label }}">{{ $type }}</text>
<text x="214" y="170" font-size="9" fill="{{ $label }}">Układ mierzy:</text>
<text x="214" y="182" font-size="9" fill="{{ $label }}">p₁, p₂, P<tspan baseline-shift="sub" font-size="6.5">p</tspan>, Q,</text>
<text x="214" y="194" font-size="9" fill="{{ $label }}">położenie zwierciadła:</text>
<text x="214" y="206" font-size="9" fill="{{ $label }}">H<tspan baseline-shift="sub" font-size="6.5">d</tspan>, H<tspan baseline-shift="sub" font-size="6.5">st</tspan></text>
</svg>