This page has been translated from Italian
Bookmark and Share

I have just been released on CPAN Perl module to interface to files. net program simulating electromagnetic propagation Mobile Radio .

Currently the module is one thing, reading a file. Net created by Radio Mobile and analyzes all information by creating an object model file . This object model can be used, for example, to insert the information contained in a database.

For example, this piece of code,

use RadioMobile;
my $rm = new RadioMobile();
$rm->file('net1.net');
$rm->parse;

my $header = $rm->header;
my $units  = $rm->units;

foreach my $idxUnit (0..$header->unitCount-1) {
        my $unit = $units->at($idxUnit);
        printf("%s at lon %s and lat %s\n", $unit->name,
          $unit->lon, $unit->lat);
}

produce come risultato roba di questo genere


Unit  1 at lon 43.4223 and lat 13.4353
Unit  2 at lon 43.43242 and lat 13.4244
Unit  3 at lon 0 and lat 0
Unit  4 at lon 0 and lat 0
Unit  5 at lon 0 and lat 0
Unit  6 at lon 0 and lat 0
Unit  7 at lon 0 and lat 0
Unit  8 at lon 0 and lat 0
Unit  9 at lon 0 and lat 0
Unit 10 at lon 0 and lat 0

Quanto prima, in una prossima versione, vedrò di realizzare la “magia” opposta ossia, da informazioni, caricate ad esempio da un database, andare a creare un file .net ex-novo, da dare poi in pasto a Radio Mobile.

Questo articolo è stato visto 118 volta

Lascia un commento

 

/me corre

Allenamento

Corse

Categorie

Questo articolo è stato visto 118 volta

Lascia un commento

 

/me corre

Allenamento

Corse

Categorie