/**
  * @Route("/newOpto", name="newOpto")
  * @Template()
  */
 public function newOptoAction()
 {
     $post = $this->get('request')->request;
     $id = $post->get('id');
     $formData = $post->get('formData');
     $objF = json_decode($formData);
     $obj = $objF->optoForm;
     $opto = new Optoelectronics();
     $opto->setParams($obj);
     $serviceOpto = $this->get('ikaros_optoService');
     $lambda = $serviceOpto->calculateLam($opto, $id);
     $serviceParts = $this->get('ikaros_partService');
     $e = $serviceParts->setLams($lambda, $opto, $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' => $opto->getLabel(), 'Lam' => $opto->getLam(), 'DPTemp' => $opto->getDPTemp(), 'PassiveTemp' => $opto->getPassiveTemp(), 'Application' => $opto->getApplication(), 'Quality' => $opto->getQuality(), 'Environment' => $opto->getEnvironment(), 'idP' => $opto->getIDPart())), 200, array('Content-Type' => 'application/json; charset=utf-8'));
 }