Added packet debug on web UI
This commit is contained in:
@@ -2,8 +2,34 @@
|
||||
|
||||
namespace App\Classes;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
abstract class FTN
|
||||
{
|
||||
public function __get($key)
|
||||
{
|
||||
switch ($key) {
|
||||
case 'fftn':
|
||||
return sprintf('%d:%d/%d.%d',
|
||||
$this->fz,
|
||||
$this->fn,
|
||||
$this->ff,
|
||||
$this->fp,
|
||||
);
|
||||
|
||||
case 'tftn':
|
||||
return sprintf('%d:%d/%d.%d',
|
||||
$this->tz,
|
||||
$this->tn,
|
||||
$this->tf,
|
||||
$this->tp,
|
||||
);
|
||||
|
||||
default:
|
||||
throw new \Exception('Unknown key: '.$key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a line is a kludge line.
|
||||
*
|
||||
@@ -20,12 +46,18 @@ abstract class FTN
|
||||
|
||||
/**
|
||||
* This function creates our unpack header
|
||||
*
|
||||
* @param array $pack
|
||||
* @return string
|
||||
*/
|
||||
protected function unpackheader(array $pack)
|
||||
protected function unpackheader(array $pack): string
|
||||
{
|
||||
return join('/',array_values(collect($pack)
|
||||
->sortBy(function($k,$v) {return $k[0];})
|
||||
->transform(function($k,$v) {return $k[1].$v;})->toArray()));
|
||||
return join('/',
|
||||
collect($pack)
|
||||
->sortBy(function($k,$v) {return $k[0];})
|
||||
->transform(function($k,$v) {return $k[1].$v;})
|
||||
->values()
|
||||
->toArray()
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user