-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed redis source code * Removing extra files and try to Give appropriate naming of function and folders * trying to resolve conflict * templet changes() * adding SMAVG and WMAVG
- Loading branch information
Showing
10 changed files
with
401 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
celery -A website worker -c1 -l info | ||
celery -A website beat -l info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
$('#dddd').on('click', function() { | ||
var gap = { | ||
"fc": $("#fc").val(), | ||
// to: $("#to").val(), | ||
}; | ||
console.log("adsfadsfdff"); | ||
console.log(gap); | ||
console.log(gap.fc); | ||
var csrftoken = getCookie('csrftoken'); | ||
$.ajaxSetup({ | ||
beforeSend: function(xhr, settings) { | ||
xhr.setRequestHeader("X-CSRFToken", csrftoken); | ||
} | ||
}); | ||
$.ajax({ | ||
type: 'POST', | ||
url: '/show_forecasted_smavg_data/', | ||
data: gap, | ||
success: function(x){ | ||
console.log(x); | ||
fun1(x); | ||
}, | ||
}); | ||
}); | ||
|
||
const fun1 = function(data){ | ||
console.log('asdgf',data); | ||
console.log("ooooooooooooooooooooooooooooooo"); | ||
let load = data; | ||
console.log(load.forecasted_Load); | ||
// let datee = (parseInt(tarikh[8]+tarikh[9]) + i).toString() + '-' + tarikh[5]+tarikh[6] +'-'+tarikh[0]+tarikh[1]+tarikh[2]+tarikh[3]; | ||
var chart = c3.generate({ | ||
bindto: '#Forecasting', | ||
data: { | ||
x: 'x', | ||
xFormat:'%H:%M', | ||
columns: load.forecasted_Load, | ||
}, | ||
axis: { | ||
y: { | ||
label:{ | ||
text:'POWER IN MW', | ||
position: 'outer-middle', | ||
}, | ||
}, | ||
x: { | ||
label:{ | ||
text: 'Time', | ||
position:'outer-right', | ||
}, | ||
type: 'timeseries', | ||
tick:{ | ||
format:'%H:%M' | ||
} | ||
} | ||
}, | ||
point: { | ||
show: false | ||
}, | ||
// zoom: { | ||
// enabled:true, | ||
// rescale:true, | ||
// extent: [1, 100], | ||
// }, | ||
grid: { | ||
x: { | ||
show: true, | ||
}, | ||
y: { | ||
show: true, | ||
}, | ||
}, | ||
}); | ||
}; | ||
|
||
function getCookie(name) { | ||
var cookieValue = null; | ||
if (document.cookie && document.cookie !== '') { | ||
var cookies = document.cookie.split(';'); | ||
for (var i = 0; i < cookies.length; i++) { | ||
var cookie = jQuery.trim(cookies[i]); | ||
// Does this cookie string begin with the name we want? | ||
if (cookie.substring(0, name.length + 1) === (name + '=')) { | ||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | ||
break; | ||
} | ||
} | ||
} | ||
return cookieValue; | ||
} | ||
|
||
// $(document).ready(function(){ | ||
// $('#kp').on('click', function(){ | ||
// console.log("ooooooooooooooooooooooooooooooo"); | ||
// let load = data; | ||
// // let datee = (parseInt(tarikh[8]+tarikh[9]) + i).toString() + '-' + tarikh[5]+tarikh[6] +'-'+tarikh[0]+tarikh[1]+tarikh[2]+tarikh[3]; | ||
// var chart = c3.generate({ | ||
// bindto: '#d', | ||
// data: { | ||
// x: 'x', | ||
// xFormat:'%H:%M', | ||
// columns: load.Load, | ||
// }, | ||
// axis: { | ||
// y: { | ||
// label:{ | ||
// text:'POWER IN MW', | ||
// position: 'outer-middle', | ||
// }, | ||
// }, | ||
// x: { | ||
// label:{ | ||
// text: 'Time', | ||
// position:'outer-center', | ||
// }, | ||
// type: 'timeseries', | ||
// tick:{ | ||
// format:'%H:%M' | ||
// } | ||
// } | ||
// }, | ||
// zoom: { | ||
// enabled:true, | ||
// rescale:true, | ||
// extent: [1, 100], | ||
// }, | ||
// grid: { | ||
// x: { | ||
// show: true, | ||
// }, | ||
// y: { | ||
// show: true, | ||
// }, | ||
// }, | ||
// }); | ||
// }); | ||
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
|
||
import sys,os | ||
djangoproject_home="website" | ||
sys.path.append(djangoproject_home) | ||
os.environ['DJANGO_SETTINGS_MODULE'] = 'website.settings' | ||
from .models import CSV | ||
import csv,datetime | ||
for i in range(10,11): | ||
import django | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'website.settings') | ||
django.setup() | ||
from swag.models import CSV | ||
import csv, datetime | ||
|
||
for i in range(22,24): | ||
a = 1+i; | ||
print(a); | ||
link = "static/SLDC_Data/2018/02/"+str(a).zfill(2)+"-02-2018.csv" | ||
link = "static/SLDC_Data/2018/03/"+str(a).zfill(2)+"-03-2018.csv" | ||
dataReader = csv.reader(open(link), delimiter=',', quotechar='"') | ||
for row in dataReader: | ||
data = CSV() | ||
data.timestamp = row[0] | ||
data.load_value = row[1] | ||
data.date = datetime.date(2018,2,a) | ||
data.save() | ||
data = CSV.objects.create(timestamp = row[0], load_value = row[1], date = datetime.date(2018,3,a)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.