@ -0,0 +1,82 @@ |
|||||||
|
from datetime import datetime |
||||||
|
from config import db, ma |
||||||
|
|
||||||
|
''' |
||||||
|
Note on Duplication Levels |
||||||
|
====================================================================== |
||||||
|
While the code in this file seems very duplicated, it is just the |
||||||
|
result of using SQL-Alchemy (ORM) and the repetitive nature of the |
||||||
|
project as a whole. At the time of writing, the expected amount of |
||||||
|
devices is six. They must keep their info. separate from each other. |
||||||
|
This means a table in the database for each device. This is the main |
||||||
|
cause for the repetitive/duplicated code. Because this project has |
||||||
|
fixed requirements, the hard-coded nature is a trade-off because of |
||||||
|
this. If the project increases the amount of devices it uses, this |
||||||
|
will probably need to be refactored. |
||||||
|
''' |
||||||
|
|
||||||
|
class Device1(db.Model): |
||||||
|
__tablename__ = "device1" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device1Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device1 |
||||||
|
sqla_session = db.session |
||||||
|
|
||||||
|
class Device2(db.Model): |
||||||
|
__tablename__ = "device2" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device2Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device2 |
||||||
|
sqla_session = db.session |
||||||
|
|
||||||
|
class Device3(db.Model): |
||||||
|
__tablename__ = "device3" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device3Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device3 |
||||||
|
sqla_session = db.session |
||||||
|
|
||||||
|
class Device4(db.Model): |
||||||
|
__tablename__ = "device4" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device4Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device4 |
||||||
|
sqla_session = db.session |
||||||
|
|
||||||
|
class Device5(db.Model): |
||||||
|
__tablename__ = "device5" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device5Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device5 |
||||||
|
sqla_session = db.session |
||||||
|
|
||||||
|
class Device6(db.Model): |
||||||
|
__tablename__ = "device6" |
||||||
|
id = db.Column(db.Integer, primary_key=True) |
||||||
|
time = db.Column(db.DateTime, default=datetime.utcnow) |
||||||
|
status = db.Column(db.String) |
||||||
|
|
||||||
|
class Device6Schema(ma.ModelSchema): |
||||||
|
class Meta: |
||||||
|
model = Device6 |
||||||
|
sqla_session = db.session |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 8.9 KiB |
@ -0,0 +1,2 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig> |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,41 @@ |
|||||||
|
{ |
||||||
|
"name": "App", |
||||||
|
"icons": [ |
||||||
|
{ |
||||||
|
"src": "\/android-icon-36x36.png", |
||||||
|
"sizes": "36x36", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "0.75" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "\/android-icon-48x48.png", |
||||||
|
"sizes": "48x48", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "1.0" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "\/android-icon-72x72.png", |
||||||
|
"sizes": "72x72", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "1.5" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "\/android-icon-96x96.png", |
||||||
|
"sizes": "96x96", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "2.0" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "\/android-icon-144x144.png", |
||||||
|
"sizes": "144x144", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "3.0" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "\/android-icon-192x192.png", |
||||||
|
"sizes": "192x192", |
||||||
|
"type": "image\/png", |
||||||
|
"density": "4.0" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
@ -1,3 +1,66 @@ |
|||||||
html { |
html { |
||||||
font-size: 12px; |
font-family: arial, sans-serif; |
||||||
|
background: #f5f5f5; |
||||||
|
color: #424242; |
||||||
} |
} |
||||||
|
|
||||||
|
main { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
padding: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
main div { |
||||||
|
max-width: 800px; |
||||||
|
left-margin: auto; |
||||||
|
right-margin: auto; |
||||||
|
} |
||||||
|
|
||||||
|
main div .header { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
main div .header img { |
||||||
|
width: 50px; |
||||||
|
} |
||||||
|
|
||||||
|
main div .header h1 { |
||||||
|
text-align: center; |
||||||
|
font-size: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
main div .status-bar { |
||||||
|
display: flex; |
||||||
|
margin: 5px; |
||||||
|
flex-wrap: wrap; |
||||||
|
justify-content: space-evenly; |
||||||
|
padding: 20px; |
||||||
|
border-top: 2px solid #424242; |
||||||
|
border-bottom: 2px solid #424242; |
||||||
|
} |
||||||
|
|
||||||
|
.meter { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
|
||||||
|
main div .status-bar .meter img { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.meter p { |
||||||
|
padding: 0px; |
||||||
|
margin: 0px; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
main div h2 { |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
@ -1 +1,17 @@ |
|||||||
<!-- need to add favicons at some point... --> |
<link rel="apple-touch-icon" sizes="57x57" href="{{ url_for('static', filename='favicons/apple-icon-57x57.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="{{ url_for('static', filename='favicons/apple-icon-60x60.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="{{ url_for('static', filename='favicons/apple-icon-72x72.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="{{ url_for('static', filename='favicons/apple-icon-76x76.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="{{ url_for('static', filename='favicons/apple-icon-114x114.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="{{ url_for('static', filename='favicons/apple-icon-120x120.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="{{ url_for('static', filename='favicons/apple-icon-144x144.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="{{ url_for('static', filename='favicons/apple-icon-152x152.png') }}"> |
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='favicons/apple-icon-180x180.png') }}"> |
||||||
|
<link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='favicons/android-icon-192x192.png') }}"> |
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicons/favicon-32x32.png') }}"> |
||||||
|
<link rel="icon" type="image/png" sizes="96x96" href="{{ url_for('static', filename='favicons/favicon-96x96.png') }}"> |
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicons/favicon-16x16.png') }}"> |
||||||
|
<link rel="manifest" href="{{ url_for('static', filename='favicons/manifest.json') }}"> |
||||||
|
<meta name="msapplication-TileColor" content="#ffffff"> |
||||||
|
<meta name="msapplication-TileImage" content="{{ url_for('static', filename='favicons/ms-icon-144x144.png') }}"> |
||||||
|
<meta name="theme-color" content="#ffffff"> |
||||||
|
@ -1,4 +1,81 @@ |
|||||||
{% extends "layout.html" %} |
{% extends "layout.html" %} |
||||||
{% block content %} |
{% block content %} |
||||||
<h1>Return to Ritherdon Project</h1> |
<main> |
||||||
|
|
||||||
|
<div> |
||||||
|
|
||||||
|
<div class="header"> |
||||||
|
<img src="{{ url_for('static', filename='images/logo.png') }}" alt="logo"/> |
||||||
|
<h1>Return to Ritherdon Project</h1> |
||||||
|
</div> |
||||||
|
|
||||||
|
<h2>Artwork Status</h2> |
||||||
|
|
||||||
|
<div class="status-bar"> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 1"].status) }}" alt="logo"/> |
||||||
|
<p>Factory 1</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 2"].status) }}" alt="logo"/> |
||||||
|
<p>Factory 2</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 3"].status) }}" alt="logo"/> |
||||||
|
<p>Factory 3</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 4"].status) }}" alt="logo"/> |
||||||
|
<p>Gallery 1</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 5"].status) }}" alt="logo"/> |
||||||
|
<p>Gallery 2</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="meter"> |
||||||
|
<img src="{{ url_for('static', filename='images/%s.png' % data["device 6"].status) }}" alt="logo"/> |
||||||
|
<p>Gallery 3</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
|
||||||
|
<h2>About the Project</h2> |
||||||
|
|
||||||
|
<p> |
||||||
|
"Return to Ritherdon" is a two year residency at Ritherdon & Co Ltd, a manufacturer of metal enclosures based in Darwen, Lancashire U.K. |
||||||
|
</p> |
||||||
|
|
||||||
|
<h2>About the Artist: Nicola Ellis</h2> |
||||||
|
|
||||||
|
<p>Nicola is interested in the properties, value, function and circulation of materials. She has a current focus on metals and the companies that work with them, her work draws on the visual and spoken language of industry operations, fabrication and profiling processes. The parameters for her sculpture, installation, drawings and videos include relationships between people, businesses and technology. |
||||||
|
</p> |
||||||
|
|
||||||
|
<h2>About the Gallery: Castlefield Gallery</h2> |
||||||
|
|
||||||
|
<p> |
||||||
|
Established by artists in 1984, Castlefield Gallery is the first public contemporary visual art gallery to have opened in Manchester. The arrival of Castlefield Gallery in the city was a significant catalyst of what became a period of rapid cultural growth, and the increase of the presence of visual artists in the city and city region. As a registered charity, our mission drives our work to focus on artistic and career development for artists, as well as deepening audiences’ relationship to contemporary art. Over the last three decades we have become an integral part of the North of England’s cultural fabric and a vital support to artists across the North West and further afield. |
||||||
|
</p> |
||||||
|
|
||||||
|
<h2>About this Website</h2> |
||||||
|
|
||||||
|
<p> |
||||||
|
This website is part of an, unnamed, artwork which is part of the "Return to Ritherdon" project. |
||||||
|
</p> |
||||||
|
|
||||||
|
<h2>Links</h2> |
||||||
|
<ul> |
||||||
|
<li><a href="http://www.nicolaellis.com/" title="Click this to visit Nicola's personal website.">Nicola's Personal Website</a></li> |
||||||
|
<li><a href="https://www.castlefieldgallery.co.uk/" title="Click this to visit Castlefield's website.">Castlefield's Website</a></li> |
||||||
|
<li><a href="{{ url_for('/api./api_swagger_ui_index') }}" title="Click this to inspect this site's A.P.I.">Swagger A.P.I.</a></li> |
||||||
|
</ul> |
||||||
|
|
||||||
|
</div> |
||||||
|
|
||||||
|
</main> |
||||||
{% endblock content %} |
{% endblock content %} |
||||||
|