public function calculateLam(Fuse $fuse, $pcbID = -1) { $sEnv = $fuse->getEnvironment(); $piE = $this->systemService->getPiE(221, $sEnv); $base = 0.01; $lambda = $base * $piE * pow(10, -6); return $lambda; }
/** * @Route("/newFuse", name="newFuse") * @Template() */ public function newFuseAction() { $post = $this->get('request')->request; $id = $post->get('id'); $formData = $post->get('formData'); $objF = json_decode($formData); $obj = $objF->fuseForm; $fuse = new Fuse(); $fuse->setParams($obj); $service = $this->get('ikaros_fuseService'); $lambda = $service->calculateLam($fuse); $serviceParts = $this->get('ikaros_partService'); $e = $serviceParts->setLams($lambda, $fuse, $id); if ($e != "") { return new Response(json_encode(array('e' => $e)), 400, array('Content-Type' => 'application/json; charset=utf-8')); } return new Response(json_encode(array('Label' => $fuse->getLabel(), 'Lam' => $fuse->getLam(), 'Value' => $fuse->getValue(), 'Type' => $fuse->getType(), 'CasePart' => $fuse->getCasePart(), 'Environment' => $fuse->getEnvironment(), 'idP' => $fuse->getIDPart())), 200, array('Content-Type' => 'application/json; charset=utf-8')); }