Package net.geco.model

Examples of net.geco.model.RunnerRaceData


  private void mergeRunnerData(RunnerRaceData runnerData, Vector<Stage> poolStages) {
    long mergedTime = 0;
    Status mergedStatus = Status.OK;
    for (Stage stage : poolStages) {
      RunnerRaceData poolData = stage.registry().findRunnerData(runnerData.getRunner().getEcard());
      mergedTime = mergeTime(mergedTime, poolData.getResult().getRacetime());
      mergedStatus = mergeStatus(mergedStatus, poolData.getResult().getStatus());
    }
    runnerData.getResult().setRacetime(mergedTime);
    runnerData.getResult().setStatus(mergedStatus);
  }
View Full Code Here


    return result;
  }

  protected Result sortResult(Result result, List<Runner> runners) {
    for (Runner runner : runners) {
      RunnerRaceData data = registry().findRunnerData(runner);
      if( runner.isNC() ) {
        result.addNRRunner(data);
      } else {
        switch (data.getResult().getStatus()) {
        case OK:
          result.addRankedRunner(data);
          break;
        case DNF:
        case DSQ:
View Full Code Here

  }
 
 
  public RunnerRaceData clone() {
    try {
      RunnerRaceData clone = (RunnerRaceData) super.clone();
      clone.setStarttime((Date) getStarttime().clone());
      clone.setFinishtime((Date) getFinishtime().clone());
      clone.setErasetime((Date) getErasetime().clone());
      clone.setControltime((Date) getControltime().clone());
      clone.setReadtime((Date) getReadtime().clone());
      Punch[] punches = new Punch[getPunches().length];
      for (int i = 0; i < getPunches().length; i++) {
        punches[i] = getPunches()[i].clone();
      }
      clone.setPunches(punches);
      clone.setResult(getResult().clone());
      // dont clone runner, keep the reference
      return clone;
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
    }
View Full Code Here

    JButton deleteButton = new JButton("-"); //$NON-NLS-1$
    deleteButton.setToolTipText(Messages.uiGet("RunnersPanel.DeleteRunnerTooltip")); //$NON-NLS-1$
    deleteButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        RunnerRaceData data = selectedData();
        if( data!=null ) {
          int previousSel = table.getSelectedRow();
          // announce runner deletion and remove from tablemodel
          geco().runnerControl().deleteRunner(data);
          int nextSelection = Math.min(table.getModel().getRowCount() - 1, previousSel);
View Full Code Here

  }

  public void updateRunnerPanel() {
    String ecard = selectedEcard();
    if( !ecard.equals("") ) { //$NON-NLS-1$
      RunnerRaceData runnerData = registry().findRunnerData(ecard);
      runnerPanel.updateRunner(ecard);
      tracePanel.refreshPunches(runnerData);
      if( gecoLiveMap!=null && gecoLiveMap.isShowing() ) {
        gecoLiveMap.displayRunnerMap(runnerData);
      }
View Full Code Here

  }


  private void focusOnReadCard(String ecard) {
    if( liveModeOn() ) {
      RunnerRaceData data = registry().findRunnerData(ecard);
      tableModel.removeData(data);
      tableModel.addDataFirst(data);
      focusTableOnIndex(0);
    }
  }
View Full Code Here

  }

  @Override
  public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      RunnerRaceData runnerData = registry().findRunnerData(e.getDescription());
      if( runnerData!=null ){
        focusTableOnRunner(runnerData);
      }
    }
  }
View Full Code Here

    result.setRacetime(Long.parseLong(data[8]));
    result.setNbMPs(Integer.parseInt(data[9]));
    result.setTimePenalty(Long.parseLong(data[10]));
    result.setTrace(createTraceFrom(Arrays.copyOfRange(data, 11, data.length)));
   
    RunnerRaceData runnerData = registry().findRunnerData(runner);
    runnerData.setResult(result);
    serverMulti.announceData(runnerData);
    return "ok"; //$NON-NLS-1$
  }
View Full Code Here

        .th(Messages.getString("ResultBuilder.RacetimeHeader"), "class=\"right\"") //$NON-NLS-1$ //$NON-NLS-2$
        .closeTr();
    }
    // Format: rank, first name + last name, club [, real time, nb mps], time/status
    for (RankedRunner runner : result.getRanking()) {
      RunnerRaceData data = runner.getRunnerData();
      writeHtml(
          data,
          Integer.toString(runner.getRank()),
          data.getResult().formatRacetime(),
          config.showPenalties,
          html);
    }
    emptyTr(html);
    for (RunnerRaceData runnerData : result.getNRRunners()) {
View Full Code Here

      throw new Error("Error in race data " + sourceFilename() +"! " //$NON-NLS-1$ //$NON-NLS-2$
              + "Can't find runner with e-card " + record[0] //$NON-NLS-1$
              + ". Use a backup"); //$NON-NLS-1$
    }
   
    RunnerRaceData data = this.factory.createRunnerRaceData();
    // this is the time since midnight, day of the race.
    data.setReadtime(TimeManager.safeParse(record[1]));
    data.setErasetime(TimeManager.safeParse(record[2]));
    data.setControltime(TimeManager.safeParse(record[3]));
    data.setStarttime(TimeManager.safeParse(record[4]));
    data.setFinishtime(TimeManager.safeParse(record[5]));
    data.setRunner(runner);
   
    Punch[] punches = new Punch[(record.length - 6) / 2];
    for (int i = 0; i < punches.length; i++) {
      punches[i] = this.factory.createPunch();
      punches[i].setCode(Integer.parseInt(record[2*i + 6]));
      punches[i].setTime(TimeManager.safeParse(record[2*i + 7]));
    };
    data.setPunches(punches);

    return data;
  }
View Full Code Here

TOP

Related Classes of net.geco.model.RunnerRaceData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.