-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.38.3 New Listener Signals Export, export in Listener Logs and Signals
- Loading branch information
Showing
8 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
namespace App\Controller\Web\Listeners\Export; | ||
|
||
use App\Controller\Web\Listeners\Base; | ||
use App\Repository\ListenerRepository; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
/** | ||
* Class Listeners | ||
* @package App\Controller\Web\Listener\Export | ||
*/ | ||
class Signals extends Base | ||
{ | ||
/** | ||
* @Route( | ||
* "/{_locale}/{system}/listeners/{id}/export/signals", | ||
* requirements={ | ||
* "_locale": "de|en|es|fr", | ||
* "system": "reu|rna|rww" | ||
* }, | ||
* defaults={"id"=""}, | ||
* name="listener_export_signals" | ||
* ) | ||
* @param $_locale | ||
* @param $system | ||
* @param $id | ||
* @param ListenerRepository $listenerRepository | ||
* @return RedirectResponse|Response | ||
*/ | ||
public function controller( | ||
$_locale, | ||
$system, | ||
$id, | ||
ListenerRepository $listenerRepository | ||
) { | ||
if (!$listener = $this->getValidReportingListener($id, $listenerRepository)) { | ||
return $this->redirectToRoute( | ||
'listeners', | ||
[ '_locale' => $_locale, 'system' => $system ] | ||
); | ||
} | ||
$signals = $listenerRepository->getSignalsForListener($id); | ||
$parameters = [ | ||
'_locale' => $_locale, | ||
'title' => strToUpper($system) . ' signals for '.$listener->getName() . " on " . date('Y-m-d'), | ||
'subtitle' => '(' . count($signals) . ' records sorted by Frequency and callsign and Time)', | ||
'system' => $system, | ||
'listener' => $listener, | ||
'signals' => $signals | ||
]; | ||
$parameters = array_merge($parameters, $this->parameters); | ||
$response = $this->render('listener/export/signals.txt.twig', $parameters); | ||
$response->headers->set('Content-Type', 'text/plain'); | ||
return $response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ title }} | ||
{{ subtitle }} | ||
--------------------------------------------------------------------------------------------------- | ||
KHz ID Logs KM Mi PWR GSQ SP ITU Location | ||
--------------------------------------------------------------------------------------------------- | ||
{% for signal in signals %} | ||
{{ | ||
"% -8s" | format((0 + signal.khz)) }} {{ | ||
"% -10s" | format(signal.call) }} {{ | ||
"% 6s" | format(signal.logs) }} {{ | ||
"% 5s" | format(signal.dxKm) }} {{ | ||
"% 5s" | format(signal.dxMiles) }} {{ | ||
"% 5s" | format(signal.pwr ? signal.pwr : '') }} {{ | ||
"% 6s" | format(signal.gsq) }} {{ | ||
"% 2s" | format(signal.sp) }} {{ | ||
"% 3s" | format(signal.itu) }} {{ | ||
signal.qth|raw | ||
}} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters