Skip to content

Commit

Permalink
feat: Improve checking SAT
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Aug 29, 2024
1 parent 9de6a11 commit 9d04b5e
Showing 1 changed file with 1 addition and 51 deletions.
52 changes: 1 addition & 51 deletions app/modules/dataset/templates/dataset/view_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,57 +420,7 @@ <h5 class="modal-title" id="fileViewerModalLabel">Feature model view</h5>
document.getElementById("loading").style.display = "none";
}

/*
async function valid() {
showLoading()
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
//await micropip.install("/assets/web_assembly/antlr4_python3_runtime-4.7.2-py3-none-any.whl");
await micropip.install("antlr4-python3-runtime==4.13.1");
await micropip.install("uvlparser==2.0.1");
//await micropip.install("afmparser==1.0.0");
await pyodide.runPythonAsync(
`
import micropip
#await micropip.install("flamapy-fm-dist", deps=False)#this is to avoid problems with deps later on
await micropip.install("flamapy==2.0.1.dev1", deps=False);
await micropip.install("flamapy-fm==2.0.1.dev1", deps=False);
await micropip.install("flamapy-sat");
`
)
hideLoading()
try {
let output = pyodide.runPython(
`
import js
file_content = js.document.getElementById('fileContent').textContent
div = js.document.createElement("result")
with open("uvlfile.uvl", "w") as text_file:
print(file_content, file=text_file)
from flamapy.interfaces.python.FLAMAFeatureModel import FLAMAFeatureModel
fm = FLAMAFeatureModel("uvlfile.uvl")
result=fm.valid()
div.innerHTML = "<div id='deleteme'>"+str(result)+"</div>"
exists=js.document.getElementById('deleteme')
if(exists):
exists.remove()
js.document.getElementById('result').append(div)
`
);
} catch (err) {
console.log(err);
}
}
*/

function copyToClipboard() {
const text = document.getElementById('fileContent').textContent;
navigator.clipboard.writeText(text).then(() => {
Expand Down

0 comments on commit 9d04b5e

Please sign in to comment.