Exemplo n.º 1
0
  @RequestMapping("Previous")
  public ModelAndView getoldGraphPlot(
      @RequestParam int id,
      @RequestParam int lastPage,
      @RequestParam String valuePage,
      HttpSession session) {

    logger.info("Wasserman graphs displayed for dataset-" + id);

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    String tableName = tableNames.get(id);
    List<GraphPlot> oldGraphValues = dataService.getUpdatedGraphPlotList(tableName);

    session.setAttribute("idValue", id);
    session.setAttribute("dataSetnumber", id);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("Previous");
    modelAndView.addObject("oldGraphValues", oldGraphValues);

    List<GraphPlot> thresholdValues =
        dataService.getRowByPower(Integer.parseInt(thresholdValuesData.get(id)), tableName);
    modelAndView.addObject("thresholdValues", thresholdValues);

    return modelAndView;
  }
Exemplo n.º 2
0
  @RequestMapping("WassermanGraphs")
  public ModelAndView getUpdatedGraphPlot(
      @RequestParam int id,
      @RequestParam String value,
      HttpSession session,
      HttpServletRequest request) {

    logger.info("Wasserman graphs displayed for dataset-" + id);

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    String tableName = tableNames.get(id);

    List<GraphPlot> graphValues = dataService.getUpdatedGraphPlotList(tableName);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("WassermanGraphs");
    modelAndView.addObject("graphValues", graphValues);

    session.setAttribute("dataSetnumber", id);

    if (id > 1) {
      if (thresholdValuesData.containsKey(id)) {
        List<GraphPlot> thresholdValues =
            dataService.getRowByPower(Integer.parseInt(thresholdValuesData.get(id)), tableName);
        modelAndView.addObject("thresholdValues", thresholdValues);
      } else {
        thresholdValuesData.put(id - 1, value);
      }
    }

    return modelAndView;
  }
Exemplo n.º 3
0
  @RequestMapping("last")
  public ModelAndView getlast(HttpSession session, @ModelAttribute User_Results user, Model model) {

    logger.info("Results stored");

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("last");

    User_Results users = new User_Results();
    Iterator iterator = resultData.keySet().iterator();
    while (iterator.hasNext()) {
      Integer key = (Integer) iterator.next();
      List list = (List) resultData.get(key);
      users.setTitle(utitle);
      users.setExpertName(uName);
      users.setExperience(exp);
      users.setTestsNumber(numberTests);
      users.setEmail(mail);
      users.setDataSet("Data-Set" + key);
      users.setSession(session.getId());
      users.setPower(((GraphPlot) list.get(0)).getLast());
      users.setVCO2(((GraphPlot) list.get(0)).getVCO2());
      users.setVO2(((GraphPlot) list.get(0)).getVO2());
      users.setVE(((GraphPlot) list.get(0)).getVE());
      dataService.insertData(users);
    }
    session.invalidate();
    model.asMap().clear();
    return modelAndView;
  }
Exemplo n.º 4
0
  @RequestMapping("result")
  public ModelAndView getresult(
      @RequestParam int id,
      @RequestParam String value,
      HttpSession session,
      HttpServletRequest request) {

    logger.info("Summary of all the results");

    thresholdValuesData.put(id, value);

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("result");

    Map<Integer, String> tableNames = DataSetList.dataSetName();

    Iterator it = thresholdValuesData.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<Integer, String> pair = (Map.Entry) it.next();
      resultData.put(
          pair.getKey(),
          dataService.getRowByPower(
              Integer.parseInt(pair.getValue()), tableNames.get(pair.getKey())));
    }

    modelAndView.addObject("dataList", resultData);

    request.setAttribute("expertt", uName);
    request.setAttribute("tit", utitle);
    request.setAttribute("test", numberTests);
    request.setAttribute("experience", exp);
    request.setAttribute("maill", mail);

    return modelAndView;
  }
Exemplo n.º 5
0
  @RequestMapping("graphplotTime")
  public ModelAndView getGraphPlot(@RequestParam int id, @RequestParam int tableId) {

    logger.info("Data fetched by time");

    Map<Integer, String> tableNames = DataSetList.dataSetName();
    String tableName = tableNames.get(tableId);
    List<GraphPlot> graphTime = dataService.getRowByTime(id, tableName);

    return new ModelAndView("graphplotTime", "graphTime", graphTime);
  }
Exemplo n.º 6
0
  @RequestMapping("graphplotVO2")
  public ModelAndView getVO2(
      @RequestParam double VO2, @RequestParam double VCO2, @RequestParam int tableId) {

    logger.info("Data fetched by VO2");

    Map<Integer, String> tableNames = DataSetList.dataSetName();
    String tableName = tableNames.get(tableId);
    List<GraphPlot> graphVO2 = dataService.getRowByVO2(VO2, VCO2, tableName);

    return new ModelAndView("graphplotVO2", "graphVO2", graphVO2);
  }