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;
}