Skip to content
Snippets Groups Projects
Commit 2e2664d6 authored by Nour's avatar Nour
Browse files

error fixed

parent 84bbcad4
No related branches found
No related tags found
No related merge requests found
......@@ -87,14 +87,9 @@ def case_id(filename):
#temporary choice of cases until I figure out where the actual function from backend is.
#give the list here in selection using functions from
selection = elog.get_active_cases(filename)
previewid = request.args.get("selectpreview")
while request.args.get("selectpreview")!= None:
print(previewid)
previewid = request.args.get("selectpreview")
break
preview = "../static/fish.jpg"
# preview = "../static/fish.jpg"
if previewid != None:
result = int(previewid)
......@@ -104,21 +99,14 @@ def case_id(filename):
print(rec)
petrinet.decorate_petri_net(result, filename)
preview = os.path.join(app.config['STATIC_FOLDER'], 'preview_net.png')
# preview = os.path.join(app.config['STATIC_FOLDER'], 'preview_net.png')
# print(preview)
else:
print("else")
preview = "../static/fish.jpg"
# preview = "../static/fish.jpg"
'''
if previewid == '1':
preview = os.path.join(app.config['STATIC_FOLDER'], 'fish.jpg')
elif previewid == '2':
preview = os.path.join(app.config['STATIC_FOLDER'], 'fish.jpg')
else:
preview = os.path.join(app.config['STATIC_FOLDER'], 'moyai.jpg')
'''
return render_template('case.html', selection=selection, preview=preview, filename=filename)
return render_template('case.html', selection=selection, filename=filename)
"""
Route for sending the case id towards recommendation. This is linked to the 'Optimize now' button in the case ID page.
......@@ -142,7 +130,7 @@ def recommendation(result, filename):
rec = int(rec)
petrinet.decorate_petri_net_with_rec(result, rec, filename)
# time.sleep(15)
return render_template('result.html')
"""
......
Frontend/static/net.png

51 KiB | W: | H:

Frontend/static/net.png

50.7 KiB | W: | H:

Frontend/static/net.png
Frontend/static/net.png
Frontend/static/net.png
Frontend/static/net.png
  • 2-up
  • Swipe
  • Onion skin
Frontend/static/preview_net.png

50.7 KiB

......@@ -27,7 +27,7 @@
Preview it before optimizing!
<!--The preview functionality. The dropdown menu is separate to avoid mixing the http requests between both button because I have skill issue and am incapable of coding this cleanly.-->
<form id="previewCase" method="get" name="previewCase">
<select name="selectpreview" id="selectcaseid" method="get" form="selectcaseid">
<select name="selectpreview" id="previewCase" method="get" form="previewCase">
{% for id in selection %}
<!--Dropdown selection-->
<option value= "{{id}}"> {{id}} </option>
......@@ -36,7 +36,8 @@
<div style = "text-align: center;">
<!--The preview image-->
<img src="{{ preview }}">
<img src="\static\preview_net.png" alt="Placeholder"> <br>
</div>
<div style = "text-align: center;">
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -62,7 +62,7 @@ def decorate_petri_net(case, name):
decoration[t].update({"label":t.label})
pm4py.view_petri_net(net, initial_marking, final_marking, decorations = decoration)
# pm4py.view_petri_net(net, initial_marking, final_marking, decorations = decoration)
pm4py.save_vis_petri_net(net, initial_marking, final_marking, decorations = decoration, file_path = r"static\preview_net.png")
def decorate_petri_net_with_rec(case, rec, name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment