mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-04-02 10:21:01 +01:00
remove exact station
This commit is contained in:
@@ -164,15 +164,11 @@ class EntranceForm(ModelForm):
|
||||
)
|
||||
tag_station = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.TextInput(attrs={"size": "50"}), label="Tag station: Survex station id, e.g. 1623.p2023-xx-01"
|
||||
)
|
||||
exact_station = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.TextInput(attrs={"size": "50"}), label="Exact station: Survex station id, e.g. 1623.2023-xx-01.2"
|
||||
widget=forms.TextInput(attrs={"size": "50"}), label="Tag station: Survex station id, e.g. 1623.p2023-aa-01"
|
||||
)
|
||||
other_station = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.TextInput(attrs={"size": "50"}), label="Other station: Survex station id, e.g. 1623.2023-xx-01.33"
|
||||
widget=forms.TextInput(attrs={"size": "50"}), label="Other station: Survex station id, e.g. 1623.gps2018-aa-01"
|
||||
)
|
||||
|
||||
lat_wgs84 = forms.CharField(
|
||||
@@ -181,10 +177,10 @@ class EntranceForm(ModelForm):
|
||||
long_wgs84 = forms.CharField(
|
||||
required=False, widget=forms.TextInput(attrs={"size": "10"}), label="Longitude (WSG84) - if no other location"
|
||||
)
|
||||
alt = forms.CharField(required=False, label="Altitude (m)")
|
||||
alt = forms.CharField(required=False, label="Altitude (m) - from GPS if you have it, but let it settle.")
|
||||
url = forms.CharField(required=False, label="URL [usually blank]", widget=forms.TextInput(attrs={"size": "45"}))
|
||||
|
||||
field_order = ['name', 'entrance_description', 'explorers', 'map_description', 'location_description', 'lastvisit', 'approach', 'underground_description', 'photo', 'marking_comment', 'findability_description', 'other_description', 'bearings', 'tag_station', 'exact_station', 'other_station', 'easting', 'northing', 'lat_wgs84', 'long_wgs84', 'alt', 'url']
|
||||
field_order = ['name', 'entrance_description', 'explorers', 'map_description', 'location_description', 'lastvisit', 'approach', 'underground_description', 'photo', 'marking_comment', 'findability_description', 'other_description', 'bearings', 'tag_station', 'other_station', 'easting', 'northing', 'lat_wgs84', 'long_wgs84', 'alt', 'url']
|
||||
|
||||
class Meta:
|
||||
model = Entrance
|
||||
|
||||
@@ -256,7 +256,6 @@ class Entrance(TroggleModel):
|
||||
url = models.CharField(max_length=300, blank=True, null=True)
|
||||
|
||||
tag_station = models.TextField(blank=True, null=True)
|
||||
exact_station = models.TextField(blank=True, null=True)
|
||||
other_station = models.TextField(blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
@@ -298,9 +297,6 @@ class Entrance(TroggleModel):
|
||||
letter = ce.entranceletter
|
||||
print(f"### LETTER {letter}")
|
||||
return letter
|
||||
|
||||
def exact_location(self):
|
||||
return self.single(self.exact_station)
|
||||
|
||||
def other_location(self):
|
||||
return self.single(self.other_station)
|
||||
@@ -313,12 +309,6 @@ class Entrance(TroggleModel):
|
||||
return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
|
||||
except:
|
||||
return r + f"{self.tag_station} Tag Station not in dataset"
|
||||
if self.exact_station:
|
||||
try:
|
||||
s = SurvexStation.objects.lookup(self.exact_station)
|
||||
return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
|
||||
except:
|
||||
return r + f"{self.tag_station} Exact Station not in dataset"
|
||||
if self.other_station:
|
||||
try:
|
||||
s = SurvexStation.objects.lookup(self.other_station)
|
||||
@@ -334,8 +324,6 @@ class Entrance(TroggleModel):
|
||||
def best_station(self):
|
||||
if self.tag_station:
|
||||
return self.tag_station
|
||||
if self.exact_station:
|
||||
return self.exact_station
|
||||
if self.other_station:
|
||||
return self.other_station
|
||||
|
||||
@@ -433,11 +421,6 @@ class Entrance(TroggleModel):
|
||||
station = SurvexStation.objects.get(name = self.tag_station)
|
||||
except:
|
||||
pass
|
||||
if self.exact_station:
|
||||
try:
|
||||
station = SurvexStation.objects.get(name = self.exact_station)
|
||||
except:
|
||||
pass
|
||||
if station:
|
||||
return station.latlong()
|
||||
|
||||
|
||||
@@ -265,10 +265,8 @@ def prospecting_image(request, name):
|
||||
E, N = e.easting, e.northing
|
||||
if e.tag_station:
|
||||
st = e.tag_station
|
||||
elif e.exact_station:
|
||||
st = e.exact_station
|
||||
elif e.exact_station:
|
||||
st = e.exact_station
|
||||
elif e.other_station:
|
||||
st = e.other_station
|
||||
else:
|
||||
# print(f' No tag - {e.name} ')
|
||||
continue
|
||||
|
||||
@@ -286,11 +286,7 @@ def eastings(request):
|
||||
if ts:
|
||||
e.tag_ts = SurvexStation.objects.get(name=ts)
|
||||
#print(f"{e} {e.tag_ts} {e.tag_ts.lat()} {e.tag_ts.long()}")
|
||||
|
||||
es = e.exact_station
|
||||
if es:
|
||||
e.tag_es = SurvexStation.objects.get(name=es)
|
||||
#print(f"{e} {e.tag_es} {e.tag_es.lat()} {e.tag_es.long()}")
|
||||
|
||||
|
||||
os = e.other_station
|
||||
if os:
|
||||
@@ -305,7 +301,7 @@ def eastings(request):
|
||||
|
||||
entrances = Entrance.objects.all()
|
||||
for e in entrances:
|
||||
if e.exact_station:
|
||||
if e.other_station:
|
||||
ents.add(e)
|
||||
add_stations(e)
|
||||
# if e.easting or e.northing:
|
||||
|
||||
Reference in New Issue
Block a user