Medium event power stuff done, barring worst case stuff

This commit is contained in:
2020-08-29 23:56:08 +01:00
parent dbe0d35400
commit 9198724748
7 changed files with 317 additions and 61 deletions

View File

@@ -0,0 +1,31 @@
# Generated by Django 3.1 on 2020-08-29 21:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('RIGS', '0047_auto_20200829_2105'),
]
operations = [
migrations.AlterField(
model_name='eventchecklistcrew',
name='end',
field=models.DateTimeField(default=None),
preserve_default=False,
),
migrations.AlterField(
model_name='eventchecklistcrew',
name='role',
field=models.CharField(default=None, max_length=255),
preserve_default=False,
),
migrations.AlterField(
model_name='eventchecklistcrew',
name='start',
field=models.DateTimeField(default=None),
preserve_default=False,
),
]

View File

@@ -0,0 +1,78 @@
# Generated by Django 3.1 on 2020-08-29 22:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('RIGS', '0048_auto_20200829_2201'),
]
operations = [
migrations.AddField(
model_name='eventchecklist',
name='all_rcds_tested',
field=models.BooleanField(default=False, help_text='All circuit RCDs tested?<small>(using test button)</small>'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_earth_fault',
field=models.IntegerField(default=False, help_text='Earth Fault Loop Impedance (Z<small>S</small>)'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_phase_rotation',
field=models.BooleanField(default=False, help_text='Phase Rotation<br><small>(if required)</small>'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_pssc',
field=models.IntegerField(default=False, help_text='Prospective Short Circuit Current'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_voltage_l1',
field=models.IntegerField(default=False),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_voltage_l2',
field=models.IntegerField(default=False),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='fd_voltage_l3',
field=models.IntegerField(default=False),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='labelling',
field=models.BooleanField(default=False, help_text='Appropriate and clear labelling on distribution and cabling?'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='public_sockets_tested',
field=models.BooleanField(default=False, help_text='Public/Performer accessible circuits tested?<small>(using socket tester)</small>'),
preserve_default=False,
),
migrations.AddField(
model_name='eventchecklist',
name='source_rcd',
field=models.BooleanField(default=False, help_text='Source RCD protected?<br><small>(if cable is more than 3m long) </small>'),
preserve_default=False,
),
migrations.AlterField(
model_name='eventchecklist',
name='earthing',
field=models.BooleanField(help_text='Equipment appropriately earthed?<br><small>(truss, stage, generators etc)</small>'),
),
]

View File

@@ -642,7 +642,6 @@ class EventChecklist(models.Model, RevisionMixin):
# General
power_mic = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='checklists', null=True,
verbose_name="Power MIC", on_delete=models.CASCADE, help_text="Who is the Power MIC?")
#vehicles = models.JSONField(help_text="List vehicles and their drivers", default=dict, null=False)
# Safety Checks
safe_parking = models.BooleanField(help_text="Vehicles parked safely?<br><small>(does not obstruct venue access)</small>")
@@ -654,16 +653,28 @@ class EventChecklist(models.Model, RevisionMixin):
hs_location = models.CharField(max_length=255, help_text="Location of Safety Bag/Box")
extinguishers_location = models.CharField(max_length=255, help_text="Location of fire extinguishers")
# Crew Record TODO
# Small Electrical Checks
rcds = models.BooleanField(help_text="RCDs installed where needed and tested?")
supply_test = models.BooleanField(help_text="Electrical supplies tested?<br><small>(using socket tester)</small>")
earthing = models.BooleanField(help_text="Equipment appropriately earthed?<br><small>(truss, stage, etc)</small>")
# Shared electrical checks
earthing = models.BooleanField(help_text="Equipment appropriately earthed?<br><small>(truss, stage, generators etc)</small>")
pat = models.BooleanField(help_text="All equipment in PAT period?")
medium_event = models.BooleanField()
# Medium Electrical Checks
source_rcd = models.BooleanField(help_text="Source RCD protected?<br><small>(if cable is more than 3m long) </small>")
labelling = models.BooleanField(help_text="Appropriate and clear labelling on distribution and cabling?")
# First Distro
fd_voltage_l1 = models.IntegerField(help_text="L1 - N")
fd_voltage_l2 = models.IntegerField(help_text="L2 - N")
fd_voltage_l3 = models.IntegerField(help_text="L3 - N")
fd_phase_rotation = models.BooleanField(help_text="Phase Rotation<br><small>(if required)</small>")
fd_earth_fault = models.IntegerField(help_text="Earth Fault Loop Impedance (Z<small>S</small>)")
fd_pssc = models.IntegerField(help_text="Prospective Short Circuit Current")
all_rcds_tested = models.BooleanField(help_text="All circuit RCDs tested?<small>(using test button)</small>")
public_sockets_tested = models.BooleanField(help_text="Public/Performer accessible circuits tested?<small>(using socket tester)</small>")
@property
def activity_feed_string(self):

View File

@@ -5,7 +5,7 @@
{% block content %}
<div class="row my-3 py-3">
<div class="col-sm-12">
<div class="col-12">
<h3>Event Checklist for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}</h3>
<div class="row">
<div class="col-12 text-right">
@@ -13,74 +13,109 @@
class="hidden-xs">Edit</span></a>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">General</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'power_mic' }}</dt>
<dd class="col-2">
{{ object.power_mic.name }}
</dd>
</dl>
<p>List vehicles and their drivers</p>
<ul>
{% for i in object.vehicles.all %}
<li>{{i}}</li>
{% endfor %}
</ul>
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="card card-default mb-3">
<div class="card-header">General</div>
<div class="card-body">
<dl class="row">
<dt class="col-6">{{ object|help_text:'power_mic' }}</dt>
<dd class="col-6">
{{ object.power_mic.name }}
</dd>
</dl>
<p>List vehicles and their drivers</p>
<ul>
{% for i in object.vehicles.all %}
<li>{{i}}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">Safety Checks</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'safe_parking'|safe }}</dt>
<dd class="col-2">
{{ object.safe_parking|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'safe_packing'|safe }}</dt>
<dd class="col-2">
{{ object.safe_packing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'exits'|safe }}</dt>
<dd class="col-2">
{{ object.exits|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'trip_hazard'|safe }}</dt>
<dd class="col-2">
{{ object.trip_hazard|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'warning_signs'|safe }}</dt>
<dd class="col-2">
{{ object.warning_signs|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'ear_plugs'|safe }}</dt>
<dd class="col-2">
{{ object.ear_plugs|yesno|title }}
</dd>
</dl>
</div>
<div class="col-md-6 col-sm-12">
<div class="card card-default mb-3">
<div class="card-header">Safety Checks</div>
<div class="card-body">
<dl class="row">
<dt class="col-10">{{ object|help_text:'safe_parking'|safe }}</dt>
<dd class="col-2">
{{ object.safe_parking|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'safe_packing'|safe }}</dt>
<dd class="col-2">
{{ object.safe_packing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'exits'|safe }}</dt>
<dd class="col-2">
{{ object.exits|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'trip_hazard'|safe }}</dt>
<dd class="col-2">
{{ object.trip_hazard|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'warning_signs'|safe }}</dt>
<dd class="col-2">
{{ object.warning_signs|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'ear_plugs'|safe }}</dt>
<dd class="col-2">
{{ object.ear_plugs|yesno|title }}
</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="card card-default mb-3">
<div class="card-header">Crew Record</div>
<div class="card-body">
<ul>
{% for i in object.crew.all %}
<li>{{i}}</li>
<table class="table">
<thead>
<tr>
<th scope="col">Crewmember</th>
<th scope="col">Start Time</th>
<th scope="col">Role</th>
<th scope="col">End Time</th>
</tr>
</thead>
<tbody id="crewmemberst">
{% for crew in object.crew.all %}
<tr>
<td>{{crew.crewmember}}</td>
<td>{{crew.start}}</td>
<td>{{crew.role}}</td>
<td>{{crew.end}}</td>
</tr>
{% endfor %}
</ul>
</div>
</tbody>
</table>
</div>
<div class="card card-default mb-3">
<div class="card-header">Power</div>
<div class="card-body">
{% if object.medium_event %}
<span class="badge badge-success">Small Event</span>
<span class="badge badge-warning p-2 my-3">Medium Event</span>
{% else %}
<span class="badge badge-warning">Medium Event</span>
{% endif %}
<span class="badge badge-success p-2 my-3">Small Event</span>
<dl class="row">
<dt class="col-10">{{ object|help_text:'rcds'|safe }}</dt>
<dd class="col-2">
{{ object.rcds|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'supply_test'|safe }}</dt>
<dd class="col-2">
{{ object.supply_test|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'earthing'|safe }}</dt>
<dd class="col-2">
{{ object.earthing|yesno|title }}
</dd>
<dt class="col-10">{{ object|help_text:'pat'|safe }}</dt>
<dd class="col-2">
{{ object.pat|yesno|title }}
</dd>
</dl>
{% endif %}
</div>
</div>
</div>

View File

@@ -77,7 +77,12 @@
});
$('button[data-action=delete]').on('click', function(event) {
event.preventDefault();
$($(this).attr('data-target') + '_' + $(this).attr('data-id')).remove();
$(this).closest('tr').remove();
});
//Somewhat rudimentary way of ensuring people fill in completely (if it hits the database validation the whole table row disappears when the page reloads...)
//the not is to avoid adding it to some of bootstrap-selects extra crap
$('#vehiclest,#crewmemberst').find("select,input[type!='search']").change(function () {
$(this).closest('tr').find('input,select').attr('required', 'true');
});
});
</script>
@@ -255,6 +260,52 @@
<div class="card">
<div class="card-header">Electrical Checks <small>for Medium TEC Events </small></div>
<div class="card-body">
{% include 'partials/checklist_checkbox.html' with formitem=form.source_rcd %}
{% include 'partials/checklist_checkbox.html' with formitem=form.clear_labelling %}
{% include 'partials/checklist_checkbox.html' with formitem=form.earthing %}
{% include 'partials/checklist_checkbox.html' with formitem=form.pat %}
<hr>
<p>Tests at first distro</p>
<table class="table">
<thead>
<tr>
<th scope="col">Test</th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" rowspan="2">Voltage<br><small>(cube meter)</small></th>
<th>{{object|help_text:'fd_voltage_l1'}}</th>
<th>{{object|help_text:'fd_voltage_l2'}}</th>
<th>{{object|help_text:'fd_voltage_l3'}}</th>
</tr>
<tr>
<td>{% render_field form.fd_voltage_l1 class+="form-control" %}</td>
<td>{% render_field form.fd_voltage_l2 class+="form-control" %}</td>
<td>{% render_field form.fd_voltage_l1 class+="form-control" %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_phase_rotation'|safe}}</th>
<td colspan="3">{% render_field form.fd_phase_rotation %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_earth_fault'|safe}}</th>
<td colspan="3">{% render_field form.fd_earth_fault class+="form-control" %}</td>
</tr>
<tr>
<th scope="row">{{object|help_text:'fd_pssc'|safe}}</th>
<td colspan="3">{% render_field form.fd_pssc class+="form-control" %}</td>
</tr>
</tbody>
</table>
<hr>
{% include 'partials/checklist_checkbox.html' with formitem=form.all_rcds_tested %}
{% include 'partials/checklist_checkbox.html' with formitem=form.public_sockets_tested %}
{% include 'partials/ec_power_info.html' %}
</div>
</div>
</div>

View File

@@ -0,0 +1,51 @@
<h3 class="py-3">Threshhold Values</h3>
<div class="row">
<div class="col-md-6 col-sm-12">
<table class="table">
<thead>
<tr>
<th scope="row">RCD Value (mA)</th>
<th scope="row">Max Z<small>S</small> (Ohms)</th>
</tr>
</thead>
<tbody>
<tr>
<td>30</td>
<td>1667</td>
</tr>
<tr>
<td>100</td>
<td>500</td>
</tr>
<tr>
<td>300</td>
<td>167</td>
<tr>
<td>500</td>
<td>100</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6 col-sm-12">
<table class="table">
<thead>
<tr>
<th scope="row">Distro</th>
<th scope="row">Max PSSC (kA)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intel & Toblerone distros</td>
<td>6</td>
</tr>
<tr>
<td>All other distros</td>
<td>10</td>
</tr>
</tbody>
</table>
<p><strong>Voltage Drop on Circuit:</strong> 5% (approx. 12v)</p>
</div>
</div>

View File

@@ -77,7 +77,6 @@
<div class="form-group" data-toggle="tooltip" title="The date/time at which TEC have access to the venue">
<label for="{{ form.access_at.id_for_label }}"
class="col-sm-4 control-label">{{ form.access_at.label }}</label>
<div class="col-sm-8">
{% render_field form.access_at class+="form-control" step="60" %}
</div>