コード例 #1
0
ファイル: TableRow.php プロジェクト: n0rthface/Runalyze
 /**
  * Constructor
  * @param array $data
  */
 public function __construct(array $data)
 {
     $this->Data = $data;
     $this->Activity = new Activity\Object($data);
     $this->Shape = $this->loadShape($data['time']);
     VDOT::setPrecision(2);
     VDOTCorrector::setGlobalFactor(Configuration::Data()->vdotFactor());
 }
コード例 #2
0
ファイル: ShapeTest.php プロジェクト: n0rthface/Runalyze
    protected function setUp()
    {
        $this->PDO = new PDO('sqlite::memory:');
        $this->PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $this->PDO->exec('CREATE TABLE IF NOT EXISTS `' . PREFIX . 'training` (
			`accountid` int(10),
			`sportid` int(10),
			`time` int(10),
			`s` int(10),
			`use_vdot` tinyint(1),
			`vdot` decimal(5,2),
			`vdot_with_elevation` decimal(5,2)
			);
		');
        VDOTCorrector::setGlobalFactor(1.0);
    }
コード例 #3
0
ファイル: class.Frontend.php プロジェクト: n0rthface/Runalyze
 /**
  * Init constants
  */
 private function defineConsts()
 {
     require_once FRONTEND_PATH . 'system/define.consts.php';
     Configuration::loadAll();
     \Runalyze\Calculation\JD\VDOTCorrector::setGlobalFactor(Configuration::Data()->vdotFactor());
     require_once FRONTEND_PATH . 'class.Helper.php';
 }
コード例 #4
0
 public function testGlobalFactor()
 {
     VDOTCorrector::setGlobalFactor(0.5);
     $Corrector = new VDOTCorrector();
     $this->assertEquals(0.5, $Corrector->factor());
 }