public function testHRVdata() { $this->object->parseFile('../tests/testfiles/hrm/hrv.hrm'); $this->assertFalse($this->object->failed()); $this->assertEquals("08.08.2012 18:09:55", date("d.m.Y H:i:s", $this->object->object()->getTimestamp())); $this->assertEquals(2 * 60 + 13.3, $this->object->object()->getTimeInSeconds()); $this->assertTrue($this->object->object()->hasArrayHeartrate()); $this->assertTrue($this->object->object()->hasArrayHRV()); $this->assertEquals(93, $this->object->object()->getPulseAvg()); }
/** * @param string $hrmFile * @param string $gpxFile * @return \ImporterHRMandGPX */ protected function loadFiles($hrmFile, $gpxFile) { $HRMimporter = new ImporterFiletypeHRM(); $HRMimporter->parseFile($hrmFile); $GPXimporter = new ImporterFiletypeGPX(); $GPXimporter->parseFile($gpxFile); return new ImporterHRMandGPX($HRMimporter, $GPXimporter); }
/** * Import hrm and gpx * @param string $filename relative path */ private function importHRMandGPX($filename) { $HRMImporter = new ImporterFiletypeHRM(); $HRMImporter->parseFile($filename . '.hrm'); $GPXImporter = new ImporterFiletypeGPX(); $GPXImporter->parseFile($filename . '.gpx'); $Importer = new ImporterHRMandGPX($HRMImporter, $GPXImporter); $this->TrainingObjects[] = $Importer->object(); $this->addErrors($HRMImporter->getErrors()); $this->addErrors($GPXImporter->getErrors()); unlink(FRONTEND_PATH . $filename . '.hrm'); unlink(FRONTEND_PATH . $filename . '.gpx'); }