Skip to content

Commit

Permalink
Update Scan Times
Browse files Browse the repository at this point in the history
Scan time = Markers * Scantime(10) / TotalAccounts
  • Loading branch information
RedSparr0w committed Aug 7, 2016
1 parent 23c985f commit e6aba4d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ConfigGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
var map;
var myLatLng;
$scope.color = ["#2ecc71","#3498db","#9b59b6","#e74c3c","#1abc9c","#e67e22","#f1c40f"];
$scope.total = 0;
$scope.scanTime = 10;
$scope.setConfig = function(){
$scope.configuration = JSON.parse(localStorage.getItem("Configuration")) || {"PoGoAccounts": [{"PTCUsername":"","PTCPassword":"","GAUsername":"","GAPassword":""}],"TwitterConsumerToken":"CONSUMERKEY","TwitterConsumerSecret":"CONSUMERSECRET","TwitterAccessToken":"ACCESSTOKEN","TwitterAccessSecret":"ACCESSSECRET","RateLimit":0,"MinimumLifeExpectancy":300,"ExcludedPokemon":[10,11,13,14,15,16,17,18,19,20,21,22,23,29,30,32,33,35,39,41,42,43,46,47,48,49,52,54,56,60,63,69,72,73,74,86,90,92,96,98,100,116,118,120,125,129,133],"PriorityPokemon":[3,6,9,26,38,59,62,65,68,78,80,94,103,105,106,107,112,113,115,122,130,131,132,142,143,144,145,146,149,150,151],"TagPokemon":true,"TagRegion":true,"CustomTags":["PokemonGo","Bellingham"],"RegularTweet":"A wild {0} appeared!\nIt will be {1} {2} {3} until {4}.\n{5}","PriorityTweet":"BREAKING NEWS!\n{0} has appeared {1} {2} {3}!\nHurry, it will vanish at {4}!\n{5}","PokemonOverrides":[{"Kind":16,"Display":"BirdBrain"},{"Kind":19,"Display":"BarneyMouse"}],"Regions":[{"Name":"Highschool","Prefix":"around the","Suffix":"","Locations":[{"Latitude":48.757564,"Longitude":-122.474716},{"Latitude":48.75755,"Longitude":-122.47183},{"Latitude":48.755315,"Longitude":-122.471862}],"Markers":[]},{"Name":"Downtown","Prefix":"in the","Suffix":"area","Locations":[{"Latitude":48.747813,"Longitude":-122.478256},{"Latitude":48.748513,"Longitude":-122.479576},{"Latitude":48.749277,"Longitude":-122.478138},{"Latitude":48.750331,"Longitude":-122.476668},{"Latitude":48.749831,"Longitude":-122.474853}],"Markers":[]},{"Name":"Aslan Brewing","Prefix":"near the","Suffix":"Company","Locations":[{"Latitude":48.748414,"Longitude":-122.474694}],"Markers":[]}]};
if ( !$scope.configuration.hasOwnProperty("PoGoAccounts") ){
Expand Down Expand Up @@ -176,7 +176,6 @@
currentId = $scope.configuration.Regions[area].Markers.indexOf(this);
$scope.configuration.Regions[area].Markers.splice(currentId,1);
});
$scope.getTotal();
}
$scope.deleteMarker = function(Lat,Lng,area) {
swal({
Expand Down Expand Up @@ -258,7 +257,6 @@
});
v.Locations = [];
});
$scope.getTotal();
try{
Materialize.updateTextFields();
$scope.$apply();
Expand All @@ -277,10 +275,11 @@
dlAnchorElem.click();
}
$scope.getTotal = function(){
$scope.total = 0;
total = 0;
$.each($scope.configuration.Regions,function(i,v){
$scope.total += (v.Markers.length + v.Locations.length) * 5;
total += (v.Markers.length + v.Locations.length);
});
return total;
}
$scope.loadFile = function() {
if (typeof window.FileReader !== 'function') {
Expand Down Expand Up @@ -581,12 +580,12 @@
<input autocomplete="off" ng-placeholder=" - " id="Prefix" type="text" ng-model="area.Suffix">
<label for="Prefix" class="active">Suffix</label>
</div>
<p>Time to Scan: {{ ((area.Locations.length + area.Markers.length) *5).toString().toHHMMSS() }}</p>
<p>Time to Scan: {{ (((area.Locations.length + area.Markers.length) * scanTime) / configuration.PoGoAccounts.length).toString().toHHMMSS() }}</p>
<a class="waves-effect waves-light btn red" data-ng-click="RemoveArea()">Remove</a>
</div>
</li>
</ul>
<p class="center"><strong>Total Scan Time: {{ total.toString().toHHMMSS() }}</strong></p>
<p class="center"><strong>Total Scan Time: {{ ((getTotal() * scanTime) / configuration.PoGoAccounts.length).toString().toHHMMSS() }}</strong></p>
<a class="waves-effect waves-light btn blue-grey darken-4" data-ng-click="AddArea()">Add Area</a>
</div>
</li>
Expand Down

0 comments on commit e6aba4d

Please sign in to comment.