Skip to content

Commit

Permalink
Popravki pri prikazu zunanjega hrupa
Browse files Browse the repository at this point in the history
  • Loading branch information
malamalca committed Jul 23, 2024
1 parent 5bd7a26 commit 6131b10
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 19 deletions.
3 changes: 1 addition & 2 deletions src/Calc/Hrup/UdarniHrup/UdarniHrupPoenostavljen.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function analiza($splosniPodatki = null)

// korekcija stranskega prenosa
$this->K = 0;
if (!is_null($this->povrsinskaMasaStranskihElementov) && $this->povrsinskaMasaStranskihElementov > 0) {
if ($this->povrsinskaMasaStranskihElementov > 0) {
$nearestMStranski = array_nearest(
array_keys($this->KLibMDodatnegaSloja),
$this->povrsinskaMasaStranskihElementov
Expand All @@ -178,7 +178,6 @@ public function analiza($splosniPodatki = null)
// zaokroževanje Lnweq je po standardu
$this->Lnw = round($this->Lnweq) - $this->deltaL + $this->K;


$this->Lntw = $this->Lnw - 10 * log10($this->prostorninaSprejemnegaProstora / 30);
}

Expand Down
6 changes: 4 additions & 2 deletions src/Calc/Hrup/ZunanjiHrup/Prostor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Prostor

public float $odmevniCas = 0;
public float $prostornina = 0;
public float $korekcijaBocnegaPrenosa = 0;

public float $Af = 0;

Expand Down Expand Up @@ -119,10 +120,11 @@ public function analiza($splosniPodatki = null)
$this->Sf += $fasada->povrsina;
$sumTau += $fasada->povrsina / $this->Sf * pow(10, -$fasada->Rw / 10);
}
$this->Rw = -10 * log10($sumTau);

$this->Rw = -10 * log10($sumTau) - 10 * log10($this->Sf / $this->Af) + $this->korekcijaBocnegaPrenosa;

// minimalna izolativnost konstrukcij, da se doseže nivo hrupa
$this->minRw = $this->Lzunaj - $this->Lmax + 10 * log10($this->Sf / $this->Af);
$this->minRw = $this->Lzunaj - $this->Lmax;

Log::info(sprintf('"%s": Konec analize zunanjega hrupa - prostor', $this->id));
}
Expand Down
4 changes: 0 additions & 4 deletions src/Command/Hrup/IzracunZunanjegaHrupa.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public function run($projectId = null)
$prostoriOut[] = $prostor->export();
}

if (count($prostoriOut) == 0) {
throw new \Exception('Prostori obstajajo.');
}

App::saveProjectCalculation('Hrup', $projectId, 'zunanjiHrup', $prostoriOut);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public static function dispatch($controllerName, $vars, $area = 'Pures')
$methodName = substr($methodName, 0, -(strlen($extension) + 1));
}

if ($area) {
if ($controllerName !== 'App') {
$controllerClass = 'App\Controller\\' . $area . '\\' . $controllerName . 'Controller';
} else {
$controllerClass = 'App\Controller\\' . $controllerName . 'Controller';
}

// check if action exists
if (!method_exists($controllerClass, $methodName)) {
header('HTTP/1.0 404 Not Found');
Expand Down
52 changes: 44 additions & 8 deletions templates/Hrup/ZunanjiHrup/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@
(<?= $this->numFormat($konstrukcija->C, 0) ?>; <?= $this->numFormat($konstrukcija->Ctr, 0) ?>)
</td>
<td class="center"><?= $this->numFormat($konstrukcija->stevilo, 0) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina, 1) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina, 2) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina / $fasada->povrsina, 2) ?>
<td class="center"><?= $this->numFormat($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C), 0) ?> dB</td>
<td class="center"><?= $this->numFormat($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C), 0) ?> dB
<br />
<?= sprintf('%.1E', $konstrukcija->povrsina * $konstrukcija->stevilo / $fasada->povrsina * pow(10, -($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C)) / 10) * $konstrukcija->stevilo) ?>
</td>
</tr>
<?php
$k++;
Expand Down Expand Up @@ -161,9 +164,12 @@
(<?= $this->numFormat($konstrukcija->C, 0) ?>; <?= $this->numFormat($konstrukcija->Ctr, 0) ?>)
</td>
<td class="center"><?= $this->numFormat($konstrukcija->stevilo, 0) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina, 1) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina, 2) ?>
<td class="center"><?= $this->numFormat($konstrukcija->povrsina / $fasada->povrsina, 2) ?>
<td class="center"><?= $this->numFormat($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C), 0) ?> dB</td>
<td class="center"><?= $this->numFormat($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C), 0) ?> dB
<br />
<?= sprintf('%.1E', $konstrukcija->povrsina * $konstrukcija->stevilo / $fasada->povrsina * pow(10, -($konstrukcija->Rw + ($fasada->vplivPrometa ? $konstrukcija->Ctr : $konstrukcija->C)) / 10) * $konstrukcija->stevilo) ?>
</td>
</tr>
<?php
$k++;
Expand All @@ -174,7 +180,7 @@
<td class="center">&nbsp;</td>
<td class="right strong" colspan="7">Skupaj:</td>
<td class="right strong">R'<sub>w</sub> = </td>
<td class="center strong"><?= $this->numFormat($fasada->Rw, 0) ?> dB</td>
<td class="center strong"><?= $this->numFormat($fasada->Rw, 1) ?> dB</td>
</tr>
<table>
</td>
Expand All @@ -185,12 +191,12 @@
?>

<table width="100%" border="1">
<tr class="title"><th colspan="4"><h3>Skupaj za prostor</h3></th></tr>
<tr class="title"><th colspan="4"><h3>Skupaj za ovoj</h3></th></tr>
<tr>
<td class="strong">Z. št.:</td>
<td class="center strong">Površina fasade<br />[m²]</td>
<td class="center strong">Razmerje površin<br />S<sub>i</sub>/S<sub>f</sub></td>
<td class="center strong">R'<sub>w</sub></td>
<td class="center strong">Ocenjena izolirnost<br />R'<sub>w</sub></td>
</tr>
<?php
$i = 1;
Expand All @@ -200,12 +206,37 @@
<td>Fasada <?= $i ?></td>
<td class="center"><?= $this->numFormat($fasada->povrsina) ?></td>
<td class="center"><?= $this->numFormat($fasada->povrsina / $prostor->Sf, 2) ?>
<td class="center"><?= $this->numFormat($fasada->Rw, 0) ?> dB</td>
<td class="center"><?= $this->numFormat($fasada->Rw, 1) ?> dB</td>
</tr>
<?php
$i++;
}
?>
<tr>
<td class="center">&nbsp;</td>
<td class="right strong">Skupaj ovoj:</td>
<td class="right strong">R'<sub>w</sub> = </td>
<td class="center strong"><?= $this->numFormat($prostor->Rw + 10 * log10($prostor->Sf / $prostor->Af) - $prostor->korekcijaBocnegaPrenosa, 1) ?> dB</td>
</tr>
</table>

<table width="100%" border="1">
<tr class="title"><th colspan="4"><h3>Skupaj za prostor</h3></th></tr>
<tr>
<td class="right strong" colspan="2">Izolirnost ovoja:</td>
<td class="right strong">&nbsp;</td>
<td class="center strong"><?= $this->numFormat($prostor->Rw + 10 * log10($prostor->Sf / $prostor->Af) - $prostor->korekcijaBocnegaPrenosa, 1) ?> dB</td>
</tr>
<tr>
<td class="right strong" colspan="2">Vpliv prostora:</td>
<td class="right strong">&nbsp;</td>
<td class="center strong">- <?= $this->numFormat(10 * log10($prostor->Sf / $prostor->Af), 1) ?> dB</td>
</tr>
<tr>
<td class="right strong" colspan="2">Korekcija bočnega prenosa:</td>
<td class="right strong">&nbsp;</td>
<td class="center strong"><?= $this->numFormat($prostor->korekcijaBocnegaPrenosa, 1) ?> dB</td>
</tr>
<tr>
<td class="right strong" colspan="2">Skupaj:</td>
<td class="right strong">R'<sub>s,w</sub> = </td>
Expand All @@ -222,4 +253,9 @@
<?= round($prostor->Rw, 0) >= round($prostor->minRw, 0) ? 'DA' : 'NE' ?>
</td>
</tr>
<tr>
<td class="right strong" colspan="2">Nivo hrupa v prostoru:</td>
<td class="right strong">L<sub>notri</sub> = </td>
<td class="center strong"><?= $this->numFormat($prostor->Lzunaj - $prostor->Rw, 0) ?> dB</td>
</tr>
</table>
1 change: 1 addition & 0 deletions tests/Hrup/UdarniHrupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function testPrimerStandard12354_2(): void
"naziv": "Talna konstrukcija",
"tip": "horizontalna",
"povrsinskaMasa": 322,
"Lnw": 76,
"dodatniSloji": [
{
"id": "estrih",
Expand Down
2 changes: 1 addition & 1 deletion webroot/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
case 'ProjectImage':
$controllerName = 'App';
$vars['action'] = 'projectImage';
$handler = null;
$handler = $vars['area'];
break;
case 'Index':
$vars['controller'] = 'Projekti';
Expand Down

0 comments on commit 6131b10

Please sign in to comment.