소스 검색

Hard set spacing to 100m

Stephen Dade 5 년 전
부모
커밋
9bc462a2dc
3개의 변경된 파일2개의 추가작업 그리고 13개의 파일을 삭제
  1. 1 3
      app.py
  2. 1 8
      app_test.py
  3. 0 2
      templates/index.html

+ 1 - 3
app.py

@@ -73,13 +73,11 @@ def generate():
             lat = float(request.form['lat'])
             lon = float(request.form['long'])
             radius = int(request.form['radius'])
-            spacing = int(request.form['spacing'])
             assert lat < 90
             assert lon < 180
             assert lat > -90
             assert lon > -180
             radius = clamp(radius, 1, 400)
-            spacing = clamp(spacing, 50, 500)
         except:
             print("Bad data")
             return render_template('generate.html', error = "Error with input")
@@ -88,7 +86,7 @@ def generate():
         uuidkey = str(uuid.uuid1())
 
         # Add this job to the processing queue
-        x.terQ.put((radius, lat, lon, spacing, uuidkey, 'outputTer'))
+        x.terQ.put((radius, lat, lon, 100, uuidkey, 'outputTer'))
         #x.terStats[uuidkey] = "In Queue, pos={0}".format(terQ.qsize())
         x.addStatus(uuidkey, "In Queue, pos={0}".format(x.terQ.qsize()))
 

+ 1 - 8
app_test.py

@@ -28,7 +28,6 @@ def test_homepage(client):
     assert b'<input type="text" id="lat" name="lat" value="-35.363261">' in rv.data
     assert b'<input type="text" id="long" name="long" value="149.165230">' in rv.data
     assert b'<input type="number" id="radius" name="radius" value="100" min="1" max="400">' in rv.data
-    assert b'<input type="number" id="spacing" name="spacing" value="100"  min="50" max="500">' in rv.data
     assert b'<input type="submit" value="Submit" method="post">' in rv.data
 
 def test_status(client):
@@ -68,7 +67,6 @@ def test_badinput(client):
         lat='I am bad data',
         long='echo test',
         radius='1',
-        spacing='100'
     ), follow_redirects=True)
 
     assert b'<title>AP Terrain Generator</title>' in rv.data
@@ -80,7 +78,6 @@ def test_badinput(client):
         lat='206.56',
         long='-400',
         radius='1',
-        spacing='100'
     ), follow_redirects=True)
 
     assert b'<title>AP Terrain Generator</title>' in rv.data
@@ -94,7 +91,6 @@ def test_simplegen(client):
         lat='-35.363261',
         long='149.165230',
         radius='1',
-        spacing='200'
     ), follow_redirects=True)
 
     assert b'<title>AP Terrain Generator</title>' in rv.data
@@ -129,7 +125,6 @@ def test_multigen(client):
         lat='-35.363261',
         long='149.165230',
         radius='1',
-        spacing='200'
     ), follow_redirects=True)
     time.sleep(0.1)
 
@@ -137,7 +132,6 @@ def test_multigen(client):
         lat='-35.363261',
         long='147.165230',
         radius='1',
-        spacing='200'
     ), follow_redirects=True)
     time.sleep(0.1)
 
@@ -145,7 +139,6 @@ def test_multigen(client):
         lat='-30.363261',
         long='137.165230',
         radius='1',
-        spacing='200'
     ), follow_redirects=True)
     time.sleep(0.1)
 
@@ -164,7 +157,7 @@ def test_multigen(client):
     allUuidComplete = []
     while len(allUuid) != len(allUuidComplete):
         time.sleep(1)
-        if time.time() - startime > 50:
+        if time.time() - startime > 120:
             break
         else:
             # check if done

+ 0 - 2
templates/index.html

@@ -10,8 +10,6 @@
   <input type="text" id="long" name="long" value="149.165230"><br>
   <label for="radius">Radius (km):</label><br>
   <input type="number" id="radius" name="radius" value="100" min="1" max="400"><br>
-  <label for="spacing">Grid Spacing (m):</label><br>
-  <input type="number" id="spacing" name="spacing" value="100"  min="50" max="500"><br>
   <br>
   <input type="submit" value="Submit" method="post">
  </form>