diff options
author | Mark Wells <mark@freeside.biz> | 2016-04-22 11:58:19 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-04-26 12:21:55 -0700 |
commit | 50e995d8cac4bd4de8e254d7f8f1e885e9ef242e (patch) | |
tree | 98f2388bbccc7cf9d3672d38608144d6b86c0470 /FS/FS/tower_sector.pm | |
parent | dbc1708a990566955eefe3437eb97a1340904f65 (diff) |
UI to show sector coverage maps, #37802
Diffstat (limited to 'FS/FS/tower_sector.pm')
-rw-r--r-- | FS/FS/tower_sector.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/FS/FS/tower_sector.pm b/FS/FS/tower_sector.pm index 8b4c222..3fadc86 100644 --- a/FS/FS/tower_sector.pm +++ b/FS/FS/tower_sector.pm @@ -2,6 +2,7 @@ package FS::tower_sector; use base qw( FS::Record ); use Class::Load qw(load_class); +use File::Path qw(make_path); use Data::Dumper; use strict; @@ -253,13 +254,17 @@ PARAMS must include 'sectornum'. sub process_generate_coverage { my $job = shift; my $param = shift; - warn Dumper($param); - $job->update_statustext('0,generating map'); + $job->update_statustext('0,generating map') if $job; my $sectornum = $param->{sectornum}; - my $sector = FS::tower_sector->by_key($sectornum); + my $sector = FS::tower_sector->by_key($sectornum) + or die "sector $sectornum does not exist"; my $tower = $sector->tower; load_class('Map::Splat'); + # since this is still experimental, put it somewhere we can find later + my $workdir = "$FS::UID::cache_dir/cache.$FS::UID::datasrc/" . + "generate_coverage/sector$sectornum-". time; + make_path($workdir); my $splat = Map::Splat->new( lon => $tower->longitude, lat => $tower->latitude, @@ -271,6 +276,7 @@ sub process_generate_coverage { v_width => $sector->v_width, max_loss => $sector->margin, min_loss => $sector->margin - 80, + dir => $workdir, ); $splat->calculate; |