def get_treatment_iteration_result(request): analyzer = WaterTreatmentAnalyzer(WaterTreatment) input = request.__str__().split("get-water-treatment-iteration-result/")[1] input = input.split("/") location_name = input[0].replace("%20", " ") constitutent_name = input[1] end_day = int(input[2]) stages = int(input[3]) percent = float(input[4].split("'")[0]) # location_name = "Core" # constitutent_name = "TDS" # end_day = 1000 # stages = 20 # percent=1.0 coefficients = analyzer.coefficients methods = analyzer.methods constants = analyzer.constants parameters = analyzer.parameters result = analyzer.get_treatment_iteration_result(end_day, coefficients, methods, constants, parameters, stages, location_name, constitutent_name, percent) return HttpResponse(json.dumps(result), content_type="application/json")
def get_water_treatment_location_settings(request): analyzer = WaterTreatmentAnalyzer(request) settings = analyzer.get_water_treatment_location_settings() return HttpResponse(json.dumps(settings), content_type="application/json")