forked from expo/troggle
Show coordinates for entrance
Use filter to find coordinates
This commit is contained in:
@@ -28,6 +28,10 @@ class SurvexBlockAdmin(TroggleModelAdmin):
|
|||||||
inlines = (RoleInline,)
|
inlines = (RoleInline,)
|
||||||
|
|
||||||
|
|
||||||
|
class SurvexStationAdmin(TroggleModelAdmin):
|
||||||
|
search_fields = ('name', 'block__name')
|
||||||
|
|
||||||
|
|
||||||
class ScannedImageInline(admin.TabularInline):
|
class ScannedImageInline(admin.TabularInline):
|
||||||
model = ScannedImage
|
model = ScannedImage
|
||||||
extra = 4
|
extra = 4
|
||||||
@@ -136,7 +140,7 @@ admin.site.register(ScannedImage)
|
|||||||
|
|
||||||
admin.site.register(SurvexDirectory)
|
admin.site.register(SurvexDirectory)
|
||||||
admin.site.register(SurvexFile)
|
admin.site.register(SurvexFile)
|
||||||
admin.site.register(SurvexStation)
|
admin.site.register(SurvexStation, SurvexStationAdmin)
|
||||||
admin.site.register(SurvexBlock)
|
admin.site.register(SurvexBlock)
|
||||||
admin.site.register(SurvexPersonRole)
|
admin.site.register(SurvexPersonRole)
|
||||||
admin.site.register(SurvexScansFolder)
|
admin.site.register(SurvexScansFolder)
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ class CaveAndEntrance(models.Model):
|
|||||||
cave = models.ForeignKey('Cave')
|
cave = models.ForeignKey('Cave')
|
||||||
entrance = models.ForeignKey('Entrance')
|
entrance = models.ForeignKey('Entrance')
|
||||||
entrance_letter = models.CharField(max_length=20,blank=True,null=True)
|
entrance_letter = models.CharField(max_length=20,blank=True,null=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return unicode(self.cave) + unicode(self.entrance_letter)
|
return unicode(self.cave) + unicode(self.entrance_letter)
|
||||||
|
|
||||||
@@ -605,6 +606,7 @@ class Entrance(TroggleModel):
|
|||||||
|
|
||||||
def exact_location(self):
|
def exact_location(self):
|
||||||
return SurvexStation.objects.lookup(self.exact_station)
|
return SurvexStation.objects.lookup(self.exact_station)
|
||||||
|
|
||||||
def other_location(self):
|
def other_location(self):
|
||||||
return SurvexStation.objects.lookup(self.other_station)
|
return SurvexStation.objects.lookup(self.other_station)
|
||||||
|
|
||||||
@@ -617,19 +619,22 @@ class Entrance(TroggleModel):
|
|||||||
'R': 'Refindable:'}[self.findability]
|
'R': 'Refindable:'}[self.findability]
|
||||||
if self.tag_station:
|
if self.tag_station:
|
||||||
try:
|
try:
|
||||||
s = SurvexStation.objects.lookup(self.tag_station)
|
s = SurvexStation.objects.filter(name=self.tag_station)[:1]
|
||||||
|
s = s[0]
|
||||||
return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
|
return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
|
||||||
except:
|
except:
|
||||||
return r + "%s Tag Station not in dataset" % self.tag_station
|
return r + "%s Tag Station not in dataset" % self.tag_station
|
||||||
if self.exact_station:
|
if self.exact_station:
|
||||||
try:
|
try:
|
||||||
s = SurvexStation.objects.lookup(self.exact_station)
|
s = SurvexStation.objects.filter(name=self.exact_station)[:1]
|
||||||
|
s = s[0]
|
||||||
return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
|
return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
|
||||||
except:
|
except:
|
||||||
return r + "%s Exact Station not in dataset" % self.tag_station
|
return r + "%s Exact Station not in dataset" % self.tag_station
|
||||||
if self.other_station:
|
if self.other_station:
|
||||||
try:
|
try:
|
||||||
s = SurvexStation.objects.lookup(self.other_station)
|
s = SurvexStation.objects.filter(name=self.other_station)[:1]
|
||||||
|
s = s[0]
|
||||||
return r + "%0.0fE %0.0fN %0.0fAlt %s" % (s.x, s.y, s.z, self.other_description)
|
return r + "%0.0fE %0.0fN %0.0fAlt %s" % (s.x, s.y, s.z, self.other_description)
|
||||||
except:
|
except:
|
||||||
return r + "%s Other Station not in dataset" % self.tag_station
|
return r + "%s Other Station not in dataset" % self.tag_station
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ def GetTripPersons(trippeople, expedition, logtime_underground):
|
|||||||
round_bracket_regex = re.compile(r"[\(\[].*?[\)\]]")
|
round_bracket_regex = re.compile(r"[\(\[].*?[\)\]]")
|
||||||
for tripperson in re.split(r",|\+|&|&(?!\w+;)| and ", trippeople):
|
for tripperson in re.split(r",|\+|&|&(?!\w+;)| and ", trippeople):
|
||||||
tripperson = tripperson.strip()
|
tripperson = tripperson.strip()
|
||||||
|
tripperson = tripperson.strip('.')
|
||||||
mul = re.match(r"<u>(.*?)</u>$(?i)", tripperson)
|
mul = re.match(r"<u>(.*?)</u>$(?i)", tripperson)
|
||||||
if mul:
|
if mul:
|
||||||
tripperson = mul.group(1).strip()
|
tripperson = mul.group(1).strip()
|
||||||
@@ -183,9 +184,6 @@ def Parseloghtmltxt(year, expedition, txt):
|
|||||||
continue
|
continue
|
||||||
tripid, tripid1, tripdate, trippeople, triptitle, triptext, tu = s.groups()
|
tripid, tripid1, tripdate, trippeople, triptitle, triptext, tu = s.groups()
|
||||||
ldate = ParseDate(tripdate.strip(), year)
|
ldate = ParseDate(tripdate.strip(), year)
|
||||||
#assert tripid[:-1] == "t" + tripdate, (tripid, tripdate)
|
|
||||||
#trippeople = re.sub(r"Ol(?!l)", "Olly", trippeople)
|
|
||||||
#trippeople = re.sub(r"Wook(?!e)", "Wookey", trippeople)
|
|
||||||
triptitles = triptitle.split(" - ")
|
triptitles = triptitle.split(" - ")
|
||||||
if len(triptitles) >= 2:
|
if len(triptitles) >= 2:
|
||||||
tripcave = triptitles[0]
|
tripcave = triptitles[0]
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines):
|
|||||||
print('QM res station %s' % qm_resolve_station)
|
print('QM res station %s' % qm_resolve_station)
|
||||||
print('QM notes %s' % qm_notes)
|
print('QM notes %s' % qm_notes)
|
||||||
|
|
||||||
# If the QM isn't resolved (has a resolving station) thn load it
|
# If the QM isn't resolved (has a resolving station) then load it
|
||||||
if not qm_resolve_section or qm_resolve_section is not '-' or qm_resolve_section is not 'None':
|
if not qm_resolve_section or qm_resolve_section is not '-' or qm_resolve_section is not 'None':
|
||||||
from_section = models.SurvexBlock.objects.filter(name=qm_from_section)
|
from_section = models.SurvexBlock.objects.filter(name=qm_from_section)
|
||||||
# If we can find a section (survex note chunck, named)
|
# If we can find a section (survex note chunck, named)
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ div.linear-scale-caption {
|
|||||||
}
|
}
|
||||||
#frame .tab {
|
#frame .tab {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0px;lass="cavedisplay"
|
right: 0px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -515,6 +515,9 @@ div#scene {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ent.entrance.exact_station %}
|
{% if ent.entrance.exact_station %}
|
||||||
<dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} {{ ent.entrance.exact_location.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m</dd>
|
<dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} {{ ent.entrance.exact_location.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m</dd>
|
||||||
|
{% endif %}
|
||||||
|
{% if ent.entrance.find_location %}
|
||||||
|
<dt>Coordinates</dt><dd>{{ ent.entrance.find_location|safe }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ent.entrance.other_station %}
|
{% if ent.entrance.other_station %}
|
||||||
<dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }}
|
<dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }}
|
||||||
|
|||||||
Reference in New Issue
Block a user