Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
492dc574
Commit
492dc574
authored
Nov 15, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reportes
parent
569fe0c5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
53 deletions
+45
-53
minimap.js
reports/static/reports/js/minimap.js
+7
-7
reportImg.js
reports/static/reports/js/reportImg.js
+8
-8
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+10
-10
Reports.html
reports/templates/Reports.html
+5
-4
sclData.html
reports/templates/sclData.html
+7
-7
views.py
reports/views.py
+8
-17
No files found.
reports/static/reports/js/minimap.js
View file @
492dc574
...
...
@@ -73,11 +73,11 @@ let x = '';
if
(
sessionStorage
.
selectedMap
)
{
x
=
sessionStorage
.
selectedMap
;
console
.
log
({
x
})
//
console.log({x})
}
else
{
x
=
'light'
;
console
.
log
({
x
})
//
console.log({x})
}
const
polygonLayer
=
new
ol
.
layer
.
Vector
({
name
:
'polygon'
,
...
...
@@ -144,7 +144,7 @@ map.once('postrender', function (event) {
setOpacity
(
sessionStorage
.
layerOpacity
);
}
console
.
log
(
sessionStorage
)
//
console.log(sessionStorage)
if
(
sessionStorage
.
charttype
)
{
change
(
sessionStorage
.
charttype
);
...
...
@@ -301,7 +301,7 @@ function compare(labels) {
//removeImageLayers();
map
.
addControl
(
ctrl
);
ctrl
.
set
(
'position'
,
0.5
);
//console.log(map.controls)
//
//
console.log(map.controls)
var
labelDateLeft
=
labels
[
0
]
//por default compara la primera y ultima fecha
var
labelDateRight
=
labels
[
labels
.
length
-
1
]
...
...
@@ -370,9 +370,9 @@ function selectLeft(date) {
//selecciona el lado derecho para comparar
function
selectRight
(
date
)
{
console
.
log
(
"---------"
);
console
.
log
(
date
)
console
.
log
(
"---------"
);
//
console.log("---------");
//
console.log(date)
//
console.log("---------");
var
labelDateRight
=
date
;
var
layer_type
=
'TCI'
;
const
right
=
new
ol
.
layer
.
Tile
({
...
...
reports/static/reports/js/reportImg.js
View file @
492dc574
...
...
@@ -26,7 +26,7 @@ document.getElementById("myChart").onclick = function (evt) {
var
firstPoint
=
activePoint
[
0
];
var
label
=
myChart
.
data
.
labels
[
firstPoint
.
_index
];
//console.log(firstPoint._datasetIndex) //indice de la clase a la que pertenece (vegetación, agua, etc.)
//
//
console.log(firstPoint._datasetIndex) //indice de la clase a la que pertenece (vegetación, agua, etc.)
addImageLayer
({
layerDate
:
label
...
...
@@ -35,7 +35,7 @@ document.getElementById("myChart").onclick = function (evt) {
// update date slider
$
(
'input[id="inputRange"]'
).
val
(
firstPoint
.
_index
);
//console.log(myChart.legend.legendItems[firstPoint._datasetIndex].text) //nombre de la capa a la que pertenece (vegetación, agua, etc.)
//
//
console.log(myChart.legend.legendItems[firstPoint._datasetIndex].text) //nombre de la capa a la que pertenece (vegetación, agua, etc.)
//if (!firstPoint) return;
activePoints
.
forEach
(
function
(
value
,
index
)
{
//if(value==firstPoint){
...
...
@@ -66,20 +66,20 @@ function play() {
//****************************
function
scl_on
(
imagePoint
)
{
console
.
log
(
"scl on!!"
)
//
console.log("scl on!!")
label
=
imagePoint
;
//console.log({{SCL_PATH}})
//
//
console.log({{SCL_PATH}})
document
.
getElementById
(
"satImage"
).
src
=
"../../static/reports/tmpImages/repsat_test_dev/{{SCL_PATH}}"
+
label
+
"_SCL_60m_clasificationMap.png"
// $(".next").show();
// $(".prev").show();
}
function
open_big_image
(
image
)
{
console
.
log
(
"Opening big image"
)
console
.
log
(
"image:"
)
console
.
log
(
image
)
//
console.log("Opening big image")
//
console.log("image:")
//
console.log(image)
image_big
=
image
.
replace
(
"/thumbnails"
,
""
);
console
.
log
(
image_big
)
//
console.log(image_big)
window
.
open
(
image_big
)
// $(".next").show();
// $(".prev").show();
...
...
reports/templates/L2ASCL_data.html
View file @
492dc574
...
...
@@ -399,31 +399,31 @@
var
newLegendClickHandler
=
function
(
e
,
legendItem
)
{
var
index
=
legendItem
.
datasetIndex
;
//console.log(e)
console
.
log
(
legendItem
.
datasetIndex
)
console
.
log
(
legendItem
.
text
)
//
//
console.log(e)
//
console.log(legendItem.datasetIndex)
//
console.log(legendItem.text)
var
ch
=
this
.
chart
;
var
meta
=
ch
.
getDatasetMeta
(
index
);
console
.
log
(
meta
.
hidden
)
//
console.log(meta.hidden)
var
layer
=
legendItem
.
text
.
toLowerCase
();
//layer = layer.replace(" ", "_");
layer
=
layer
.
replace
(
/
\s
/g
,
'_'
);
//reeemplaza los espacios con guion bajo
console
.
log
(
layer
)
//
console.log(layer)
var
activePoint
=
ch
.
getElementAtEvent
(
e
);
console
.
log
(
document
.
getElementById
(
"titleMap"
).
textContent
)
//
console.log(document.getElementById("titleMap").textContent)
var
label
=
document
.
getElementById
(
"titleMap"
).
textContent
;
//obtiene la fecha que se está viendo
label
=
label
.
replace
(
/
\/
/g
,
''
);
// reemplaza los diagonales por nada
console
.
log
(
label
)
//
console.log(label)
if
(
meta
.
hidden
){
console
.
log
(
"Mostrar!!!"
)
//
console.log("Mostrar!!!")
SCLlayers
.
push
(
layer
)
document
.
getElementById
(
"scl_"
+
layer
).
src
=
"../../static/reports/tmpImages/repsat_test_dev/{{ SCL_PATH }}"
+
label
+
"_SCL_60m_"
+
layer
+
".png"
}
else
{
console
.
log
(
"Ocultar!!"
)
//
console.log("Ocultar!!")
SCLlayers
.
splice
(
SCLlayers
.
indexOf
(
layer
),
1
);
document
.
getElementById
(
"scl_"
+
layer
).
src
=
""
}
...
...
@@ -455,7 +455,7 @@
onClick
:
newLegendClickHandler
,
}
};
console
.
log
(
config
);
//
console.log(config);
{
%
endautoescape
%
}
</script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/reportImg.js' %}"
></script>
...
...
reports/templates/Reports.html
View file @
492dc574
...
...
@@ -226,7 +226,7 @@
</div>
</div>
<div
id=
"action_buttons{{ product.purchase_id }}"
{%
if
product
.
progress
!=
100
%}
{%
if
product
.
progress
!=
100
or
not
product
.
scl_data
%}
class=
"hidden"
{%
endif
%}
>
<a
title=
"View Report"
{%
if
product
.
initial_folder
%}
...
...
@@ -258,7 +258,9 @@
<i class="fa fa-file-text"></i>
</a-->
</div>
<span
id=
"no_data{{ product.purchase_id }}"
class=
"hidden"
>
No Data
</span>
<span
id=
"no_data{{ product.purchase_id }}"
{%
if
product
.
scl_data
%}
class=
"hidden"
{%
endif
%}
>
No Data
</span>
</td>
</tr>
...
...
@@ -326,8 +328,7 @@
POLYGON
</textarea>
</div>
<button
style=
"float: left; type="
button
"
class=
"btn btn-default"
onclick=
"copyPolygonText()"
>
Copy polygon
</button>
<button
style=
"float: left; type="
class=
"btn btn-default"
onclick=
"copyPolygonText()"
>
Copy polygon
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
...
...
reports/templates/sclData.html
View file @
492dc574
...
...
@@ -567,29 +567,29 @@
showSCLcheckboxes
(
config
.
data
.
datasets
);
{
%
endautoescape
%
}
console
.
log
(
lista_productos
);
//
console.log(lista_productos);
function
next_report
(
number
)
{
let
index
=
lista_productos
.
indexOf
(
number
);
console
.
log
(
index
);
//
console.log(index);
index
++
;
console
.
log
(
index
);
//
console.log(index);
if
(
index
>=
lista_productos
.
length
)
index
=
0
;
console
.
log
(
lista_productos
[
index
]);
//
console.log(lista_productos[index]);
window
.
location
.
replace
(
"../reports/"
+
lista_productos
[
index
]);
}
function
previus_report
(
number
)
{
let
index
=
lista_productos
.
indexOf
(
number
);
console
.
log
(
index
);
//
console.log(index);
index
--
;
console
.
log
(
index
);
//
console.log(index);
if
(
index
<
0
)
index
=
lista_productos
.
length
-
1
;
console
.
log
(
lista_productos
[
index
]);
//
console.log(lista_productos[index]);
window
.
location
.
replace
(
"../reports/"
+
lista_productos
[
index
]);
}
...
...
reports/views.py
View file @
492dc574
...
...
@@ -86,13 +86,6 @@ def report_L2ASCL(request, purchase_id):
}
if
os
.
path
.
exists
(
path
+
reporteDir
+
".pdf"
):
print
(
"si existe"
)
else
:
#PDFGenerator(request, path, reporteDir, datasets,searchInfo)
pass
if
request
.
user
.
is_authenticated
:
product_list
=
Purchase
.
objects
.
values
(
'id'
)
.
filter
(
user_id__in
=
[
request
.
user
.
id
],
...
...
@@ -113,7 +106,7 @@ def report_L2ASCL(request, purchase_id):
producto
[
'id'
],
)
print
(
productList
)
#
print (productList)
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
...
...
@@ -188,9 +181,7 @@ def Reports(request):
initial_folder
=
"."
absolute_path
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/"
if
not
os
.
path
.
exists
(
absolute_path
):
print
(
"folder out noes not exists"
)
else
:
if
os
.
path
.
exists
(
absolute_path
):
for
files
in
os
.
listdir
(
absolute_path
):
if
files
==
'scl_data.json'
:
# +(files)
...
...
@@ -206,7 +197,7 @@ def Reports(request):
zip_path
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
# print(zip_path)
#
#
print(zip_path)
# "../ static / reports / tmpImages / repsat_test_dev / umorales @ centrogeo.edu.mx / "+str(producto['id']) / myzip.zip"
...
...
@@ -301,10 +292,10 @@ def wsProcessProgress(request):
# item = Purchase.objects.get(pk=producto['id'])
# item.progress = progress
# item.save()
print
(
'id: '
+
str
(
producto
[
'id'
])
+
'size: '
+
str
(
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)))
#
print ('id: '+str(producto['id'])+'size: '+ str(os.path.getsize(USERS_PATH + producto['user__email'] + "/" + str(producto['id']) + "/scl_data.json")))
if
os
.
path
.
getsize
(
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/scl_data.json"
)
>
4
:
Data
=
True
print
(
Data
)
#
print (Data)
productList2
.
append
({
...
...
@@ -327,10 +318,10 @@ def wsProcessProgress(request):
# "progress": producto['progress'],
# })
#print (productList2)
#
#
print (productList2)
return
HttpResponse
(
json
.
dumps
(
productList2
))
else
:
print
(
"Error Http404"
)
#
print("Error Http404")
raise
Http404
...
...
@@ -639,7 +630,7 @@ def PDFGenerator(request,purchase_id):
maxi
=
maxi
else
:
maxi
=
data
[
'data'
][
index
]
# print (maxi)
#
#
print (maxi)
values
.
append
([
data
[
'data'
][
index
]])
labels
.
append
(
data
[
'label'
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment