Schema chnages documn

This commit is contained in:
Philip Sargent 2023-01-30 22:27:46 +00:00
parent b015f081e5
commit 6da2962212
7 changed files with 87 additions and 84 deletions

BIN
handbook/i/trogclass-2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -10,19 +10,21 @@
<h1>Troggle UML Class Diagrams</h1> <h1>Troggle UML Class Diagrams</h1>
<style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style> <style>figure {font-weight: bold; font-size: small; font-family: sans-serif;font-variant-caps: small-caps;}</style>
<div class="onright">
<figure>
<a href="https://yuml.me/mkay2100/edit/Troggle-1"><img alt="Troggle UML Class Diagram" src="../i/trogclass-1.jpg"></a>
<br><figcaption>Class Diagram - Essential Level (draft - to be corrected)</figcaption>
</figure>
</div>
<p>This shows the major "things" in troggle and how they relate to each other. <p>This shows the major "things" in troggle and how they relate to each other.
<p>So <strong>a survex (SVX) file</strong> is dated to a particular day during the expedition and usually has between 1 and 3 people associated with it. <p>So <strong>a survex (SVX) file</strong> is dated to a particular day during the expedition and usually has between 1 and 3 people associated with it.
<p>A <strong>Logbook entry</strong> has several people involved and may relate to a cave. It will be dated to a day during the expedition. <p>A <strong>Logbook entry</strong> has several people involved and may relate to a cave. It will be dated to a day during the expedition.
<p>Although the volume of data in troggle is small, the complexity is significantly intricate that "modern" (i.e. from the mid 1990s) system design tools are compact and useful. <p>Although the volume of data in troggle is small, the complexity is significantly intricate that "modern" (i.e. from the mid 1990s) system design tools are compact and useful.
<div class="centre">
<figure>
<a href="https://yuml.me/mkay2100/edit/Troggle-2"><img alt="Troggle UML Class Diagram" src="../i/trogclass-2.jpg" ></a>
<br><figcaption>Class Diagram - Essential Level (simplified)</figcaption>
</figure>
</div>
<h3>Design Diagrams</h3> <h3>Design Diagrams</h3>
<p>Analysis of expo and design of troggle is done using <a href="#cookanddaniels">three levels</a>: <p>Analysis of expo and design of troggle is done using <a href="#cookanddaniels">three levels</a>:
<style> <style>
@ -34,7 +36,7 @@ ul, ol {padding-inline-start: 1em;}
<li>The '<strong>specification</strong>' level. <li>The '<strong>specification</strong>' level.
<li>The '<strong>implementation</strong>' level. <li>The '<strong>implementation</strong>' level.
</ol> </ol>
<p>As anyone reading this has probably been on expo and you might think that we can skip the <strong>real-world level</strong>. Not so: the multiplicities (the number of participants in the association) of the relationships between the different cave survey artefacts can be surprising. <p>As anyone reading this has probably been on expo and you might think that we can skip the <strong>real-world level</strong>. Not so: the multiplicities and cardinalities (the number of participants in the association) of the relationships between the different cave survey artefacts can be surprising. See the diagram above: a Wallet can be associated with more than one Survex file, and a Survex File can be associated with more than one Wallet.
<p>The <strong>specification level</strong> is where the action is. <p>The <strong>specification level</strong> is where the action is.
This is where we decide which aspects of the real world <em>we will ignore</em> and what <em>extra concepts</em> we need to make things work. This is where we decide which aspects of the real world <em>we will ignore</em> and what <em>extra concepts</em> we need to make things work.
<p>So <em>we ignore</em> who is resident at top-camp (even though today we record this religiously because of the tax implications for the GastHof at base). We <em>do</em> need to track the in-computer associations between survex files: the <var>*include</var> tree, what directories they live in, what wallet-directory they relate to, and all the individual survex blocks of survey measurements within each survex file. <p>So <em>we ignore</em> who is resident at top-camp (even though today we record this religiously because of the tax implications for the GastHof at base). We <em>do</em> need to track the in-computer associations between survex files: the <var>*include</var> tree, what directories they live in, what wallet-directory they relate to, and all the individual survex blocks of survey measurements within each survex file.
@ -64,21 +66,16 @@ The purpose of class diagram is to model the static view of an application: the
<p> <p>
You can edit your own version to revise this when it becomes outdated. <br>This is the entire source code that generates the diagram: You can edit your own version to revise this when it becomes outdated. <br>This is the entire source code that generates the diagram:
<pre><code style ="font-size:x-small"> <pre><code style ="font-size:x-small">
// Troggle Class Diagram // Troggle Class Diagram (update 2023-01-30)
// ------------------------------ // -----------------------------------------
// Chain elements like this // Chain elements like this
[SVX file]<>-wallet 1..*> [SVX file{bg:lightblue}]<>-wallet 1..*>[Wallet{bg:red}]++-1..*>[Scanned Note]
[Wallet]++-1..*>[Scanned Note]
[Wallet]++-1..*>[Scanned CentreLine] [Wallet]++-1..*>[Scanned CentreLine]
[Scanned CentreLine]++-1..*> [Scanned CentreLine]++-1..*>[Drawing{bg:turquoise}]
[Drawing{bg:turquoise}]
[People{bg:wheat}]<-> [People{bg:wheat}]<->[LogBook Entry{bg:violet}]
[LogBook Entry{bg:violet}]
[People]1..3<->[SVX file] [People]1..3<->[SVX file]
@ -89,17 +86,32 @@ You can edit your own version to revise this when it becomes outdated. <br>This
// note: // note:
[Cave]-.-[Drawing{bg:turquoise}] [Cave]-.-[Drawing{bg:turquoise}]
[Expedition{bg:green}]1<>-1..* [Expedition{bg:green}]1<>-1..*[LogBook Entry]
[ExpeditionDay{bg:green}]<>-
[LogBook Entry]
[ExpeditionDay]1<>-1..*[SVX file] [SurvexBlock{bg:lightblue}]1<>-1..*[SVX file]
[PersonExpedition{bg:yellowgreen}]1<-1 [SurvexBlock{bg:lightblue}]1<>-1..*[Wallet]
[People{bg:wheat}]
[ExpeditionDay]1..*--1.* [SurvexBlock{bg:lightblue}]1..*<>-1[Cave]
[PersonExpedition{bg:yellowgreen}]
[SurvexBlock{bg:lightblue}]1..*<>-1[Expedition]
[SurvexBlock{bg:lightblue}]1..*<>-1[SurvexBlock]
[PersonExpedition{bg:yellowgreen}]1->1[People{bg:wheat}]
[PersonExpedition{bg:yellowgreen}]1<-1[SurvexTeamMember{bg:yellowgreen}]
[PersonLogEntry{bg:orange}]->[LogBook Entry{bg:violet}]
[PersonLogEntry{bg:orange}]->[PersonExpedition]
[SurvexTeamMember{bg:yellowgreen}]1-.-1[People{bg:wheat}]
[SurvexTeamMember{bg:yellowgreen}]1<-1[SurvexBlock]
[Expedition]1..*<-1[PersonExpedition{bg:yellowgreen}]
</code></pre> </code></pre>
<h3 id="cookanddaniels">Cook & Daniels - Three Levels</h3> <h3 id="cookanddaniels">Cook & Daniels - Three Levels</h3>

View File

@ -168,10 +168,13 @@ surveys in files in more than one directory then the *equates should go in the
/204/204.svx file, but at this stage it is probably worth enlisting the help of /204/204.svx file, but at this stage it is probably worth enlisting the help of
someone who knows the structure of the data inside-out! <br /><br /> someone who knows the structure of the data inside-out! <br /><br />
<li>You should now find that if you run survex on one of the master files <li>You should now find that if you run survex on one of the master files
(all.svx, 204.svx, smk-system.svx, etc.) which includes the area of (
<a href="/survexfile/1623-and-1626-no-schoenberg-hs">1623-and-1626-no-schoenberg-hs.svx</a>,
<a href="/survexfile/204">204.svx</a>,
<a href="/survexfile/smk-system">smk-system.svx</a>
, etc.) which includes the area of
your new survey, it is linked in and will show up when you use the resultant your new survey, it is linked in and will show up when you use the resultant
.3d file in vven. Using 204.svx should give info on how long and how .3d file in aven. </li>
deep the cave is now.</li>
</ul> </ul>
<p>Now you have been typing this on the expo laptop, and before you let someone <p>Now you have been typing this on the expo laptop, and before you let someone

BIN
handbook/t/trogclass-2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -10,8 +10,8 @@
<h1>Troggle Data Model (python)</h1> <h1>Troggle Data Model (python)</h1>
<h3>Troggle data architecture</h3> <h3>Troggle data architecture</h3>
Auto-generated on 3 April 2020 with <var>troggle$ python3 manage.py inspectdb</var>. (Omitting all the 'Meta' sub-classes.)<br> Auto-generated on 3 April 2020 with <var>troggle$ python3 manage.py inspectdb</var>. (Omitting all the 'Meta' sub-classes. )<br>
Several classes have been edited out of this file between then and 25 July 2020 as they have been deleted as troggle has been tidied up. Several classes have been edited out of this file between then and 30 January 2023 as they have been deleted as troggle has been tidied up.
<p>All the classes below inherit from the django class (models.Model) and are thereby made persistent in the database. All <a href="https://docs.djangoproject.com/en/1.11/ref/models/fields/">persistent instance variables</a> are defined with e.g. "models.BooleanField()" types which is why they look so strange to a normal python programmer. <p>All the classes below inherit from the django class (models.Model) and are thereby made persistent in the database. All <a href="https://docs.djangoproject.com/en/1.11/ref/models/fields/">persistent instance variables</a> are defined with e.g. "models.BooleanField()" types which is why they look so strange to a normal python programmer.
<p>See <a href="/admin/doc/models/">the online auto-documentation</a> for the current set of core objects and their instance variables and foreign keys (anything below with "models.ForeignKey" in the type field is a foreign key. <br> <p>See <a href="/admin/doc/models/">the online auto-documentation</a> for the current set of core objects and their instance variables and foreign keys (anything below with "models.ForeignKey" in the type field is a foreign key. <br>
This webpage is manually maintained and may be out of date.<code><pre><span style="color: green"># This is an auto-generated Django model module. This webpage is manually maintained and may be out of date.<code><pre><span style="color: green"># This is an auto-generated Django model module.
@ -24,11 +24,10 @@ This webpage is manually maintained and may be out of date.<code><pre><span styl
# Also note: You'll have to insert the output of 'django-admin.py sqlcustom [app_label]' # Also note: You'll have to insert the output of 'django-admin.py sqlcustom [app_label]'
# into your database.</span> # into your database.</span>
from __future__ import unicode_literals
from django.db import models from django.db import models
<span style="color: lime">class</span> <span style="color:blue"><b>CoreArea</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Area</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -38,7 +37,7 @@ from django.db import models
<span style="color:blue">parent</span> = models.<span style="color:blue">ForeignKey</span> ('self', blank=True, null=True) <span style="color:blue">parent</span> = models.<span style="color:blue">ForeignKey</span> ('self', blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreCave</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Cave</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -63,27 +62,27 @@ from django.db import models
filename = models.CharField(max_length=200) filename = models.CharField(max_length=200)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreCaveArea</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>CaveArea</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
cave_id = models.IntegerField() cave_id = models.IntegerField()
<span style="color:blue">area</span> = models.<span style="color:blue">ForeignKey</span> (CoreArea) <span style="color:blue">area</span> = models.<span style="color:blue">ForeignKey</span> (CoreArea)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreCaveandentrance</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Caveandentrance</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
cave_id = models.IntegerField() cave_id = models.IntegerField()
entrance_id = models.IntegerField() entrance_id = models.IntegerField()
entrance_letter = models.CharField(max_length=20, blank=True) entrance_letter = models.CharField(max_length=20, blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreCaveslug</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Caveslug</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
cave_id = models.IntegerField() cave_id = models.IntegerField()
slug = models.CharField(unique=True, max_length=50) slug = models.CharField(unique=True, max_length=50)
primary = models.BooleanField() primary = models.BooleanField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDataissue</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Dataissue</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -92,7 +91,7 @@ from django.db import models
message = models.CharField(max_length=400, blank=True) message = models.CharField(max_length=400, blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreEntrance</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Entrance</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -121,14 +120,14 @@ from django.db import models
cached_primary_slug = models.CharField(max_length=200, blank=True) cached_primary_slug = models.CharField(max_length=200, blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreEntranceslug</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Entranceslug</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
entrance_id = models.IntegerField() entrance_id = models.IntegerField()
slug = models.CharField(unique=True, max_length=50) slug = models.CharField(unique=True, max_length=50)
primary = models.BooleanField() primary = models.BooleanField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreExpedition</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Expedition</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -136,20 +135,11 @@ from django.db import models
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreExpeditionday</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Logbookentry</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField()
non_public = models.BooleanField()
<span style="color:blue">expedition</span> = models.<span style="color:blue">ForeignKey</span> (CoreExpedition)
date = models.DateField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreLogbookentry</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
date = models.DateField() date = models.DateField()
<span style="color:blue">expeditionday</span> = models.<span style="color:blue">ForeignKey</span> (CoreExpeditionday, blank=True, null=True)
<span style="color:blue">expedition</span> = models.<span style="color:blue">ForeignKey</span> (CoreExpedition, blank=True, null=True) <span style="color:blue">expedition</span> = models.<span style="color:blue">ForeignKey</span> (CoreExpedition, blank=True, null=True)
title = models.CharField(max_length=200) title = models.CharField(max_length=200)
cave_slug = models.CharField(max_length=50) cave_slug = models.CharField(max_length=50)
@ -160,7 +150,7 @@ from django.db import models
entry_type = models.CharField(max_length=50, blank=True) entry_type = models.CharField(max_length=50, blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CorePerson</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Person</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -174,7 +164,7 @@ from django.db import models
user_id = models.IntegerField(unique=True, blank=True, null=True) user_id = models.IntegerField(unique=True, blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CorePersonexpedition</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Personexpedition</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -183,10 +173,10 @@ from django.db import models
slugfield = models.CharField(max_length=50, blank=True) slugfield = models.CharField(max_length=50, blank=True)
is_guest = models.BooleanField() is_guest = models.BooleanField()
expo_committee_position = models.CharField(max_length=200, blank=True) expo_committee_position = models.CharField(max_length=200, blank=True)
nickname = models.CharField(max_length=100, blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CorePersontrip</b></span>(models.Model):
<span style="color: lime">class</span> <span style="color:blue"><b>PersonLogbookEntry</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -196,7 +186,7 @@ from django.db import models
is_logbook_entry_author = models.BooleanField() is_logbook_entry_author = models.BooleanField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreQm</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Qm</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
new_since_parsing = models.BooleanField() new_since_parsing = models.BooleanField()
non_public = models.BooleanField() non_public = models.BooleanField()
@ -213,14 +203,13 @@ from django.db import models
comment = models.TextField(blank=True) comment = models.TextField(blank=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexblock</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexblock</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
<span style="color:blue">parent</span> = models.<span style="color:blue">ForeignKey</span> ('self', blank=True, null=True) <span style="color:blue">parent</span> = models.<span style="color:blue">ForeignKey</span> ('self', blank=True, null=True)
text = models.TextField() text = models.TextField()
cave_id = models.IntegerField(blank=True, null=True) cave_id = models.IntegerField(blank=True, null=True)
date = models.DateField(blank=True, null=True) date = models.DateField(blank=True, null=True)
expeditionday_id = models.IntegerField(blank=True, null=True)
expedition_id = models.IntegerField(blank=True, null=True) expedition_id = models.IntegerField(blank=True, null=True)
<span style="color:blue">survexfile</span> = models.<span style="color:blue">ForeignKey</span> ('CoreSurvexfile', blank=True, null=True) <span style="color:blue">survexfile</span> = models.<span style="color:blue">ForeignKey</span> ('CoreSurvexfile', blank=True, null=True)
begin_char = models.IntegerField() begin_char = models.IntegerField()
@ -229,21 +218,21 @@ from django.db import models
totalleglength = models.FloatField() totalleglength = models.FloatField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexdirectory</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexdirectory</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
path = models.CharField(max_length=200) path = models.CharField(max_length=200)
cave_id = models.IntegerField(blank=True, null=True) cave_id = models.IntegerField(blank=True, null=True)
primarysurvexfile_id = models.IntegerField(blank=True, null=True) primarysurvexfile_id = models.IntegerField(blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexfile</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexfile</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
path = models.CharField(max_length=200) path = models.CharField(max_length=200)
<span style="color:blue">survexdirectory</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexdirectory, blank=True, null=True) <span style="color:blue">survexdirectory</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexdirectory, blank=True, null=True)
cave_id = models.IntegerField(blank=True, null=True) cave_id = models.IntegerField(blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexleg</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexleg</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
block_id = models.IntegerField() block_id = models.IntegerField()
<span style="color:blue">stationfrom</span> = models.<span style="color:blue">ForeignKey</span> ('CoreSurvexstation') <span style="color:blue">stationfrom</span> = models.<span style="color:blue">ForeignKey</span> ('CoreSurvexstation')
@ -253,31 +242,30 @@ from django.db import models
clino = models.FloatField() clino = models.FloatField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexpersonrole</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexpersonrole</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
<span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock) <span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock)
nrole = models.CharField(max_length=200, blank=True) nrole = models.CharField(max_length=200, blank=True)
personname = models.CharField(max_length=100) personname = models.CharField(max_length=100)
person_id = models.IntegerField(blank=True, null=True) person_id = models.IntegerField(blank=True, null=True)
personexpedition_id = models.IntegerField(blank=True, null=True) personexpedition_id = models.IntegerField(blank=True, null=True)
persontrip_id = models.IntegerField(blank=True, null=True) personlogbookentry_id = models.IntegerField(blank=True, null=True)
expeditionday_id = models.IntegerField(blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexscansfolder</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexscansfolder</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
fpath = models.CharField(max_length=200) fpath = models.CharField(max_length=200)
walletname = models.CharField(max_length=200) walletname = models.CharField(max_length=200)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexscansingle</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexscansingle</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
ffile = models.CharField(max_length=200) ffile = models.CharField(max_length=200)
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
<span style="color:blue">survexscansfolder</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansfolder, blank=True, null=True) <span style="color:blue">survexscansfolder</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansfolder, blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvexstation</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survexstation</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
block_id = models.IntegerField() block_id = models.IntegerField()
@ -287,14 +275,14 @@ from django.db import models
z = models.FloatField(blank=True, null=True) z = models.FloatField(blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreSurvextitle</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Survextitle</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
<span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock) <span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock)
title = models.CharField(max_length=200) title = models.CharField(max_length=200)
cave_id = models.IntegerField(blank=True, null=True) cave_id = models.IntegerField(blank=True, null=True)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfile</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>Dwgfile</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
dwgpath = models.CharField(max_length=200) dwgpath = models.CharField(max_length=200)
dwgname = models.CharField(max_length=200) dwgname = models.CharField(max_length=200)
@ -303,31 +291,31 @@ from django.db import models
npaths = models.IntegerField() npaths = models.IntegerField()
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfileSurvexblocks</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>DwgfileSurvexblocks</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
dwgfile_id = models.IntegerField() dwgfile_id = models.IntegerField()
<span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock) <span style="color:blue">survexblock</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexblock)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfileSurvexscans</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>DwgfileSurvexscans</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
dwgfile_id = models.IntegerField() dwgfile_id = models.IntegerField()
<span style="color:blue">survexscansingle</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansingle) <span style="color:blue">survexscansingle</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansingle)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfileSurvexscansfolders</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>DwgfileSurvexscansfolders</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
dwgfile_id = models.IntegerField() dwgfile_id = models.IntegerField()
<span style="color:blue">survexscansfolder</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansfolder) <span style="color:blue">survexscansfolder</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvexscansfolder)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfileSurvextitles</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>DwgfileSurvextitles</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
dwgfile_id = models.IntegerField() dwgfile_id = models.IntegerField()
<span style="color:blue">survextitle</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvextitle) <span style="color:blue">survextitle</span> = models.<span style="color:blue">ForeignKey</span> (CoreSurvextitle)
<span style="color: lime">class</span> <span style="color:blue"><b>CoreDwgfileDwgcontains</b></span>(models.Model): <span style="color: lime">class</span> <span style="color:blue"><b>DwgfileDwgcontains</b></span>(models.Model):
id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span> id = models.IntegerField(<span style="color: magenta">primary_key</span> =True) <span style="color: green"># AutoField?</span>
from_dwgfile_id = models.IntegerField() from_dwgfile_id = models.IntegerField()
to_dwgfile_id = models.IntegerField() to_dwgfile_id = models.IntegerField()

View File

@ -1,5 +1,5 @@
The folders for each year are for general gpx files from recorded tracks, The folders for each year are for general gpx files from recorded tracks,
which will be included as surface legs in all.svx. which will be included as surface legs in '1623-and-1626-no-schoenberg-hs.svx'.
gpx_publish is for creating exportable files to personal gps devices or smart phones. gpx_publish is for creating exportable files to personal gps devices or smart phones.
The master copy of this file is kept at :loser:/gpx/README The master copy of this file is kept at :loser:/gpx/README
@ -29,7 +29,8 @@ etc. The file must be present even if empty.
requires the gpx2survex program (https://github.com/mshinwell/gps2survex; requires the gpx2survex program (https://github.com/mshinwell/gps2survex;
installation instructions to follow). installation instructions to follow).
5. Run "cavern all.svx" at the toplevel then "aven all.3d". Check that the 5. Run "cavern 1623-and-1626-no-schoenberg-hs.svx" at the toplevel then
"aven 1623-and-1626-no-schoenberg-hs.3d". Check that the
tracks appear as expected when fixed points / surface surveys are enabled. tracks appear as expected when fixed points / surface surveys are enabled.
6. Commit everything to hg and push. 6. Commit everything to hg and push.

View File

@ -29,7 +29,7 @@ The core of the troggle software is the data architecture: the set of tables int
<figure> <figure>
<a href="../i/troggle-tables.jpg"> <a href="../i/troggle-tables.jpg">
<img src="../t/troggle-tables-small.jpg" /></a> <img src="../t/troggle-tables-small.jpg" /></a>
<br><figcaption>Tables (Objects)</figcaption> <br><figcaption>Tables (Objects) - wildly out of date</figcaption>
</figure> </figure>
</div> </div>
<div style="flex: 50%"> <div style="flex: 50%">
@ -43,21 +43,20 @@ The core of the troggle software is the data architecture: the set of tables int
Also there have been tables added to the core representation which are not included in this old diagram, e.g. Scannedimage, Survexdirectory, Survexscansfolder, Survexscansingle, Tunnelfile, TunnelfileSurvexscansfolders, Survey. See <a href="datamodel.html">Troggle data model</a> python code (15 May 2020) and click on the Class Diagram below on the right. Also there have been tables added to the core representation which are not included in this old diagram, e.g. Scannedimage, Survexdirectory, Survexscansfolder, Survexscansingle, Tunnelfile, TunnelfileSurvexscansfolders, Survey. See <a href="datamodel.html">Troggle data model</a> python code (15 May 2020) and click on the Class Diagram below on the right.
<div class="onright"> <div class="onright">
<figure> <figure>
<a href="../l/trogclass-1.html"><img src="../t/trogclass-1.jpg"></a> <a href="../l/trogclass-1.html"><img src="../t/trogclass-2.jpg"></a>
<br><figcaption>Class Diagram (draft)</figcaption> <br><figcaption>Class Diagram<br />(Click to enlarge)</figcaption>
</figure> </figure>
</div> </div>
<h3>Purpose</h3> <h3>Purpose</h3>
<p>The reasons why we have an online system at all are described in our <a href="../website-history.html">website history</a>. <p>The reasons why we have an online system at all are described in our <a href="../website-history.html">website history</a>.
<p>There is an introductory article "<a href="/expofiles/documents/troggle/troggle2020.pdf" download>Troggle: a revised system for cave data management</a>". <p>There is an introductory article "<a href="/expofiles/documents/troggle/troggle2020.pdf" download>Troggle: a revised system for cave data management</a>".
<h3>Implementation in software</h3> <h3>Implementation in software</h3>
<p><a href="http://www.djangoproject.com/"><img class="onright" src="https://www.djangoproject.com/m/img/badges/djangopowered126x54.gif" border="0" alt="Powered by Django." title="Powered by Django." /></a>
Troggle is written in Python (about 9,200 lines excluding comments) and is built on the Django framework. Before starting to work on Troggle it might be a good idea to run through an initial install and exploration of <a href="https://code.djangoproject.com/wiki/Tutorials">a tutorial Django project</a> to get the Django concepts bedded down - which are not at all obvious and some exist only within Django.
<p> <p>
Troggle is written in Python (about 11,000 lines excluding comments) and is built on the Django framework. Before starting to work on Troggle it might be a good idea to run through an initial install and exploration of <a href="https://code.djangoproject.com/wiki/Tutorials">a tutorial Django project</a> to get the Django concepts bedded down - which are not at all obvious and some exist only within Django.
Django is the thing that puts the survey data in a database in a way that helps us write far less code to get it in and out again, and provides templates which make it quicker to maintain all the webpages. <p>Django is the thing that puts the survey data in a database in a way that helps us write far less code to get it in and out again, and provides templates which make it quicker to maintain all the webpages. <a href="http://www.djangoproject.com/"><img class="onright" src="https://www.djangoproject.com/m/img/badges/djangopowered126x54.gif" border="0" alt="Powered by Django." title="Powered by Django." /></a>
See the <a href="https://docs.djangoproject.com/en/dev/misc/design-philosophies/">django design philosophy</a> for why we chose it: while django comes with a full stack (db, request/response, URL mapping, HTML templates) the layers of the stack are independent and individually replaceable. See the <a href="https://docs.djangoproject.com/en/dev/misc/design-philosophies/">django design philosophy</a> for why we chose it: while django comes with a full stack (db, request/response, URL mapping, HTML templates) the layers of the stack are independent and individually replaceable.
<p>We have to keep up to date with new rleases of django, see <a href="trogdjango.html">Upgrading Django for Troggle</a>. <p>We have to keep up to date with new rleases of django, see <a href="trogdjango.html">Upgrading Django for Troggle</a>.
@ -84,7 +83,7 @@ See the <a href="https://docs.djangoproject.com/en/dev/misc/design-philosophies/
<h3>Files generated by troggle</h3> <h3>Files generated by troggle</h3>
<p>There are only two places where this happens. This is where online forms are used to create cave entrance records and cave records. These are created in the database but also exported as files so that when troggle is rebuilt and data reimported the new cave data is there. <p>There are only three places where this happens. This is where online forms are used to create cave entrance records and cave records, and where a form is used to record the information about a wallet. These are created in the database but also exported as files so that when troggle is rebuilt and data reimported the new cave data is there. Any page in this handbook can also be edited online and the page is saved as a file - and registered with the version control system.
<hr /> <hr />