Difference between revisions of "Telewave"

From W9CR
Jump to navigation Jump to search
(Pretty print PHP)
 
Line 1: Line 1:
 
Telewave [http://www.telewave.com/technical.html gives out] their patterns in a few formats.  I've convert the Planet formatted .pat files to radio mobile format using this php code.  It will produce a output of exactly 720 lines matching the [http://radiomobile.pe1mew.nl/?The_program:File_formats:Antenna_.ant_format_%28V3%29 V3 .ant file format] radio mobile uses.
 
Telewave [http://www.telewave.com/technical.html gives out] their patterns in a few formats.  I've convert the Planet formatted .pat files to radio mobile format using this php code.  It will produce a output of exactly 720 lines matching the [http://radiomobile.pe1mew.nl/?The_program:File_formats:Antenna_.ant_format_%28V3%29 V3 .ant file format] radio mobile uses.
  
 
+
<nowiki><?
  <?
+
if (!isset($argv[1])) {
  if (!isset($argv[1]) ) {   echo "usage: php convert.php patfile\n";
+
    echo "usage: php convert.php patfile\n";
  return; } else { $pat=$argv[1]; }
+
    return;
  $s=file_get_contents($pat); $r = preg_split('/\R/', $s); if
+
} else {
  (count($r)<1) echo "Invalid file type\n"; $p=1;
+
    $pat = $argv[1];
  foreach ($r as $l=>$k) { $ln=$l+1; if($ln==547 || $ln==727) {continue;}
+
}
  if (preg_match("/((?:-){0,1}\d{1,3},((?:-){0,1}\d{1,3}\.\d{2}))/s",
+
$s = file_get_contents($pat);
  $k,$mt)) { $p=0; echo $mt[2] . "\r\n"; } }
+
$r = preg_split('/\R/', $s);
  if ($p==1) echo ("Invalid file type\n");
+
if (count($r) < 1)
  ?>
+
    echo "Invalid file type\n";
 +
$p = 1;
 +
foreach ($r as $l => $k) {
 +
    $ln = $l + 1;
 +
    if ($ln == 547 || $ln == 727) {
 +
        continue;
 +
    }
 +
    if (preg_match("/((?:-){0,1}\d{1,3},((?:-){0,1}\d{1,3}\.\d{2}))/s", $k, $mt)) {
 +
        $p = 0;
 +
        echo $mt[2] . "\r\n";
 +
    }
 +
}
 +
if ($p == 1)
 +
    echo ("Invalid file type\n");
 +
?></nowiki>
  
 
Here is a [[media:Telewave RM.zip|Zip]] of all the converted files, please place the .ant files into the directory of radio mobile and restart the program.
 
Here is a [[media:Telewave RM.zip|Zip]] of all the converted files, please place the .ant files into the directory of radio mobile and restart the program.

Latest revision as of 20:24, 30 January 2016

Telewave gives out their patterns in a few formats. I've convert the Planet formatted .pat files to radio mobile format using this php code. It will produce a output of exactly 720 lines matching the V3 .ant file format radio mobile uses.

<?
if (!isset($argv[1])) {
    echo "usage: php convert.php patfile\n";
    return;
} else {
    $pat = $argv[1];
}
$s = file_get_contents($pat);
$r = preg_split('/\R/', $s);
if (count($r) < 1)
    echo "Invalid file type\n";
$p = 1;
foreach ($r as $l => $k) {
    $ln = $l + 1;
    if ($ln == 547 || $ln == 727) {
        continue;
    }
    if (preg_match("/((?:-){0,1}\d{1,3},((?:-){0,1}\d{1,3}\.\d{2}))/s", $k, $mt)) {
        $p = 0;
        echo $mt[2] . "\r\n";
    }
}
if ($p == 1)
    echo ("Invalid file type\n");
?>

Here is a Zip of all the converted files, please place the .ant files into the directory of radio mobile and restart the program.