X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_routesearch;h=f8a697ac902df640c63bb7b7cd026169014014a6;hp=3f65fc3ca0aff7f15a35581c4e34fe9a38edb0c0;hb=0e1bb2af9a73112c989d90a9009d20bbe9b3a9d0;hpb=43454422b2df5e0dcfe144fcb871a2b6f9c1a3d0 diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 3f65fc3..f8a697a 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -57,6 +57,8 @@ my $emsg; my @warningfs; my @islandids; +my $destspec; + my $maxmaxdist=35; my $maxcpu=90; my $concur_lim=5; @@ -84,6 +86,30 @@ This feature is not available from the "drop down menus" interface. islandids_r => \@islandids, archipelagoes_r => undef &> +% my $searchtype= $ARGS{RouteSearchType}; +% if ($searchtype == 0) { +% $destspec= 'any'; +% } elsif ($searchtype == 1) { +% $destspec= 'circ'; +% } elsif ($searchtype == 2) { + +Destination (one island only): +<& qtextstring, qa => $qa, dbh => $dbh, emsgstore => \$emsg, + thingstring => 'deststring', + prefix => 'ds', boxopts => 'size=40', + onresults => sub { +print STDERR "ONRESULTS @_\n"; + return unless @_; + my ($canonname, $island, $arch) = @{ $_[0] }; + die unless defined $island; + $destspec= $island; + } + &> + +% } else { +% die "$destspec ?"; +% } + <&| enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &>   @@ -116,6 +142,7 @@ print(""), return unless $emsgokorprint->($emsg) and @islandids and $allargs->{'submit'} + and defined $destspec and (defined $routeparams->{MaxMass} or defined $routeparams->{MaxVolume}); @@ -149,7 +176,7 @@ push @rsargs, defined $routeparams->{LossPerLeaguePct} ? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9; push @rsargs, 0; #$routeparams->{MinProfit}; push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea; -push @rsargs, $ARGS{RouteSearchType} ? 'circ' : 'any'; +push @rsargs, $destspec; push @rsargs, @islandids; m/[^-.0-9a-zA-Z]/ and die "$_ $& ?" foreach @rsargs;