Ejemplo n.º 1
0
def preproc_settings(request):
    if request.method == "POST":
        form = PreprocSettings(request.POST, request.FILES)
        if form.is_valid():
            return HttpResponseRedirect(reverse("humanupload"))
    else:
        formPick = None
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(
                initial={"passFr": 2, "stopFr": 6, "LOSS": 0.1, "ATTENUATION": 40, "filterType": "cheby2"}
            )
            formSpec = BVP()
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = EKG()
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = inertial()
        if True:
            formPick = remove_spike()
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = GSR()

    context = {
        "formFilt": formFilt,
        "formDown": formDown,
        "formPick": formPick,
        "formSpec": formSpec,
        "formGau": formGau,
    }
    return render(request, "preproc/settings.html", context)
Ejemplo n.º 2
0
def show_chart(request):
    template = "preproc/chart.html"

    # load all the algorithms forms
    # TODO discuss a way to obtain all the form dinamically

    if request.method == "POST":
        form = PreprocSettings(request.POST, request.FILES)
        if form.is_valid():
            return HttpResponseRedirect(reverse("humanupload"))
    else:
        formPick = None
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(
                initial={"passFr": 2, "stopFr": 6, "LOSS": 0.1, "ATTENUATION": 40, "filterType": "cheby2"}
            )
            formSpec = BVP()
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = EKG()
        if True:
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = inertial()
        if True:
            formPick = remove_spike()
            formDown = downsampling(initial={"switch": False})
            formGau = smoothGaussian(initial={"sigma": 2})
            formFilt = filterAlg(initial={"filterType": "none"})
            formSpec = GSR()

    context = {"forms": [formFilt, formDown, formPick, formSpec, formGau]}

    return render(request, template, context)