X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_routesearch;h=3f65fc3ca0aff7f15a35581c4e34fe9a38edb0c0;hb=43454422b2df5e0dcfe144fcb871a2b6f9c1a3d0;hp=2816086c068c9ed39a92e2e0221c649048f3dee9;hpb=29010a75143814a91b4f5200454bea879280e7c1;p=ypp-sc-tools.db-test.git diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 2816086..3f65fc3 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -42,6 +42,7 @@ $islandstring => ''; $capacitystring => ''; $lossperleague => ''; $capitalstring => ''; +$minprofitstring => ''; $distance => ''; $prselector $someresults @@ -89,15 +90,14 @@ This feature is not available from the "drop down menus" interface.   Maximum distance: - <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml', - thingstring => 'distance', emsgstore => \$emsg, - onresults => sub { ($maxdist)= @_; } &> - size=10 - + <& qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml', + thingstring => 'distance', emsgstore => \$emsg, boxopts => 'size=10', + onresults => sub { ($maxdist)= @_; } + &> -% my $ours= sub { $_[0] =~ m/^lossperleague|^islandstring|^capitalstring|^capacitystring|^distance/; }; +% my $ours= sub { $_[0] =~ m/^lossperleague|^islandstring|^capitalstring|^capacitystring|^minprofitstring|^distance/; }; <& "lookup:formhidden", ours => $ours &> % } @@ -112,10 +112,12 @@ if (!$emsg && $maxdist > $maxmaxdist) { " supported, sorry."; } -$emsgokorprint->($emsg) or return; -@islandids or return; -$allargs->{'submit'} or return; -defined $routeparams->{MaxMass} or defined $routeparams->{MaxVolume} or return; +print(""), return + unless $emsgokorprint->($emsg) + and @islandids + and $allargs->{'submit'} + and (defined $routeparams->{MaxMass} or + defined $routeparams->{MaxVolume}); #---------- prepare island names ---------- @@ -145,7 +147,7 @@ foreach my $k (qw(MaxMass MaxVolume MaxCapital)) { } push @rsargs, defined $routeparams->{LossPerLeaguePct} ? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9; -push @rsargs, '0'; +push @rsargs, 0; #$routeparams->{MinProfit}; push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea; push @rsargs, $ARGS{RouteSearchType} ? 'circ' : 'any'; push @rsargs, @islandids; @@ -255,7 +257,7 @@ YARRG website still runs quickly.

If you submitted several searches and gave up on them (eg by hitting -`back' or `stop' in your browser), be aware that that doesn't +"back" or "stop" in your browser), be aware that that doesn't generally stop the search process at the server end. So it's best to avoid asking for large searches that you're not sure about. @@ -296,7 +298,6 @@ $someresults->(); Start Via Finish - % my $datarow=0; % my %sortkeys; @@ -344,6 +345,8 @@ $someresults->();

Notes

Per league values count each island visited as one -(additional) league; the `Dist.' column is however the actual distance +(additional) league; the "Dist." column is however the actual distance to be sailed. All profit figures are somewhat approximate; get a complete trading plan for a route for accurate information. + +