Skip to content

Commit

Permalink
Merge pull request #6 from ayushzenith/master
Browse files Browse the repository at this point in the history
Daniel code changes
  • Loading branch information
ayushzenith authored Aug 9, 2018
2 parents eb3e73c + 6b29af1 commit 90bddf9
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 189 deletions.
1 change: 1 addition & 0 deletions GaugeProjectApache/py/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import argparse
import pandas as pd
import time
import datetime
from bacnet_gateway_requests import get_value_and_units

def myFunction(facility):
Expand Down
115 changes: 80 additions & 35 deletions GaugeProjectApache/py/dollars.html
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,52 +1,97 @@
<!DOCTYPE html>
<html lang="en">

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Electricity Statistics Dashboard</title>
<style>
button.button {
background-color: transparent;
border: 2px solid black;
font-size: 12pt;
padding: 8px 16px;
color: black;
border-radius: 4px;
align: center;
}
button.button:hover {
background-color: black;
color: white;
cursor: pointer;
}
a {
text-decoration: none;
}

button.button {
transition: 1s all ease;
background-color: transparent;
font-size: 12pt;
padding: 8px 45px;
color: black;
border-radius: 8px;
margin: 4px auto;
display: block;
}

button.button:hover {
color: white;
cursor: pointer;
}

#btn-1:hover{
background-color: #f57970;
}

#btn-2:hover{
background-color: #4ab3a9;
}

#btn-3:hover{
background-color: #7683c9;
}

#btn-4:hover{
background-color: #fdd14f;
}

@media screen and (max-width: 1012px) {
aside {
width: 100% !important;
}

#mySVG {
width: 100% !important;
}
}
</style>

</head>


<body style="background-color: #f9f9f9;">
<h1 align="center" style="font-family: monospace">Electricity Statistics Dashboard</h1>
<div style="float:left; padding-top: 20%; padding-left: 10%">
<a href="kW.html"><button class="button" style="padding: 8px 45px;"> kW<br></button></a><br>
<a href="kWh.html"><button class="button" style="padding: 8px 41px;"> kWh<br></button></a><br>
<a href="dollars.html"><button class="button" style="padding: 8px 28px;"> Cost $$</button></a><br>
<a href="kWhHourly.html"><button class="button"> kWh hourly</button></a><br>
</div>
<div id="mySVG" style="float: right; padding-right: 60%">
<object data="dollars.svg" type="image/svg+xml" width="700%"></object>
<aside style="float:left; padding-top: 20%; padding-left: 10%; width: 10%; margin-right: 5%;">
<a href="kW.html">
<button class="button" style="border: 2px solid #f57970;" id="btn-1"> kW<br></button>
</a><br>
<a href="kWh.html">
<button class="button" style="border: 2px solid #4ab3a9;" id="btn-2"> kWh<br></button>
</a><br>
<a href="kWhHourly.html">
<button class="button" style="border: 2px solid #7683c9;" id="btn-3"> kWh (hourly)</button>
</a><br>
<a href="dollars.html">
<button class="button" style="border: 2px solid #fdd14f;" id="btn-4"> Cost</button>
</a><br>
</aside>
<div id="mySVG" style="float: left; width: 75%;">
</div>
<object data="" type="image/svg+xml" width="100%" style="margin: 0 auto; text-align: center; max-height: 80vh;"
id="svg"></object>
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function my_function() {
while(true) {
$("#mySVG").load("dollars.html #mySVG");
await sleep(60000);
console.log("sleep")
}
}
my_function();
</script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

async function load_svg() {
$("#mySVG").load("dollars.html #svg");
await sleep(1000)
let child = document.getElementById('mySVG').firstChild;
child.setAttribute('data', 'dollars.svg')

await sleep(1200);
console.log("sleep")
}

load_svg();
</script>
</body>
</html>
6 changes: 3 additions & 3 deletions GaugeProjectApache/py/dollars.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 80 additions & 36 deletions GaugeProjectApache/py/index.html
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,53 +1,97 @@
<!DOCTYPE html>
<html lang="en">

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Electricity Statistics Dashboard</title>
<style>
button.button {
background-color: transparent;
border: 2px solid black;
font-size: 12pt;
padding: 8px 16px;
color: black;
border-radius: 4px;
align: center;
}
button.button:hover {
background-color: black;
color: white;
cursor: pointer;
}
a {
text-decoration: none;
}

button.button {
transition: 1s all ease;
background-color: transparent;
font-size: 12pt;
padding: 8px 45px;
color: black;
border-radius: 8px;
margin: 4px auto;
display: block;
}

button.button:hover {
color: white;
cursor: pointer;
}

#btn-1:hover{
background-color: #f57970;
}

#btn-2:hover{
background-color: #4ab3a9;
}

#btn-3:hover{
background-color: #7683c9;
}

#btn-4:hover{
background-color: #fdd14f;
}

@media screen and (max-width: 1012px) {
aside {
width: 100% !important;
}

#mySVG {
width: 100% !important;
}
}
</style>

</head>


<body style="background-color: #f9f9f9;">
<h1 align="center" style="font-family: monospace">Electricity Statistics Dashboard</h1>
<div style="float:left; padding-top: 20%; padding-left: 10%">
<a href="kW.html"><button class="button" style="padding: 8px 45px;"> kW<br></button></a><br>
<a href="kWh.html"><button class="button" style="padding: 8px 41px;"> kWh<br></button></a><br>
<a href="dollars.html"><button class="button" style="padding: 8px 28px;"> Cost $$</button></a><br>
<a href="kWhHourly.html"><button class="button"> kWh hourly</button></a><br>
</div>
<div id="mySVG" style="float: right; padding-right: 60%">
<object data="kw.svg" type="image/svg+xml" width="700%"></object>
<aside style="float:left; padding-top: 20%; padding-left: 10%; width: 10%; margin-right: 5%;">
<a href="kW.html">
<button class="button" style="border: 2px solid #f57970;" id="btn-1"> kW<br></button>
</a><br>
<a href="kWh.html">
<button class="button" style="border: 2px solid #4ab3a9;" id="btn-2"> kWh<br></button>
</a><br>
<a href="kWhHourly.html">
<button class="button" style="border: 2px solid #7683c9;" id="btn-3"> kWh (hourly)</button>
</a><br>
<a href="dollars.html">
<button class="button" style="border: 2px solid #fdd14f;" id="btn-4"> Cost</button>
</a><br>
</aside>
<div id="mySVG" style="float: left; width: 75%;">
</div>
<object data="" type="image/svg+xml" width="100%" style="margin: 0 auto; text-align: center; max-height: 80vh;"
id="svg"></object>
<script>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function my_function() {
while(true) {
$("#mySVG").load("kW.html #mySVG");
await sleep(60000);
console.log("sleep")
}
}
my_function();
</script>
</body>
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

async function load_svg() {
$("#mySVG").load("kW.html #svg");
await sleep(1000)
let child = document.getElementById('mySVG').firstChild;
child.setAttribute('data', 'kw.svg')

await sleep(1200);
console.log("sleep")
}

load_svg();
</script>
</body>
</html>
Loading

0 comments on commit 90bddf9

Please sign in to comment.