<?
function panel_personal_norma($rec_norm,$analyzer='',$arr_res=array())
{
  ?><div id="panel_personal_norma">
     <h2>Значения нормы</h2>
     <table><tr>
               <th>Критерии</th>
                <th colspan="2"><? echo '<strong>Разброс нормы</strong>'?></th>
                <th colspan="2"><? echo '<strong>латентное время на включение светодиода</strong><br>[getTlatFirst]'?></th>
                <th colspan="2"><? echo '<strong>латентное время выключения светодиода</strong><br>[getTlatSecond]'?></th>
                <th colspan="2"><? echo '<strong>Угол наклона реакции на включение</strong><br>[getFirstAngleTan]'?></th>
                <th colspan="2"><? echo '<strong>Угол наклона при выключении светодиода</strong><br>[getSecondAngleTan]'?></th>
                <th colspan="2"><? echo '<strong>отношение максимального значения к минимальному</strong><br>[getAmplitudeRatio]'?></th>
                <th colspan="2"><? echo '<strong>среднее значение на участке адаптации</strong><br>[getAverage]'?></th>
               </tr>
               <tr>
                <th></th>
                <th>-</th>
                <th>+</th>
                <th>Tlat1Min</th>
                <th>Tlat1Max</th>
                <th>Tlat2Min</th>
                <th>Tlat2Max</th>
                <th>Angle1Min</th>
                <th>Angle1Max</th>
                <th>Angle2Min</th>
                <th>Angle2Max</th>
                <th>AmplitudeMin</th>
                <th>AmplitudeMax</th>
                <th>AverageMin</th>
                <th>AverageMax</th>
               </tr>
               <tr>
                <td>По умолчанию</td>
                <td><? echo $GLOBALS['LS_pp_norma_koof_m']?></td>
                <td><? echo $GLOBALS['LS_pp_norma_koof_p']?></td>
                <td><? echo $GLOBALS['LS_pp_Tlat1Min']?></td>
                <td><? echo $GLOBALS['LS_pp_Tlat1Max']?></td>
                <td><? echo $GLOBALS['LS_pp_Tlat2Min']?></td>
                <td><? echo $GLOBALS['LS_pp_Tlat2Max']?></td>
                <td><? view_with_angle($GLOBALS['LS_pp_Angle1Min'])?></td>
                <td><? view_with_angle($GLOBALS['LS_pp_Angle1Max'])?></td>
                <td><? view_with_angle($GLOBALS['LS_pp_Angle2Min'])?></td>
                <td><? view_with_angle($GLOBALS['LS_pp_Angle2Max'])?></td>
                <td><? echo $GLOBALS['LS_pp_AmplitudeMin']?></td>
                <td><? echo $GLOBALS['LS_pp_AmplitudeMax']?></td>
                <td><? echo $GLOBALS['LS_pp_AverageMin']?></td>
                <td><? echo $GLOBALS['LS_pp_AverageMax']?></td>
               </tr>
         <?if ($rec_norm['pkey']){?>
                <tr>
                <td>Норма сотрудника<br>
                </td>
                <td><? echo round($rec_norm['koof_m'],2)?></td>
                <td><? echo round($rec_norm['koof_p'],2)?></td>
                <td><? echo round($rec_norm['Tlat1Min'],2)?></td>
                <td><? echo round($rec_norm['Tlat1Max'],2)?></td>
                <td><? echo round($rec_norm['Tlat2Min'],2)?></td>
                <td><? echo round($rec_norm['Tlat2Max'],2)?></td>
                <td><? view_with_angle(round($rec_norm['Angle1Min'],2))?></td>
                <td><? view_with_angle(round($rec_norm['Angle1Max'],2))?></td>
                <td><? view_with_angle(round($rec_norm['Angle2Min'],2))?></td>
                <td><? view_with_angle(round($rec_norm['Angle2Max'],2))?></td>
                <td><? echo round($rec_norm['AmplitudeMin'],2)?></td>
                <td><? echo round($rec_norm['AmplitudeMax'],2)?></td>
                <td><? echo round($rec_norm['AverageMin'],2)?></td>
                <td><? echo round($rec_norm['AverageMax'],2)?></td>
               </tr><?}?>
         <?if (is_object($analyzer)){?>
                <tr>
                   <td>Значения критериев</td>
                   <td colspan="2"></td>
                   <td colspan="2"><? echo $analyzer->getTlatFirst()?></td>
                   <td colspan="2"><? echo $analyzer->getTlatSecond()?></td>
                   <td colspan="2"><? view_with_angle($analyzer->getFirstAngleTan())?></td>
                   <td colspan="2"><? view_with_angle($analyzer->getSecondAngleTan())?></td>
                   <td colspan="2"><? echo $analyzer->getAmplitudeRatio()?></td>
                   <td colspan="2"><? echo $analyzer->getAverage()?></td>
                </tr><?}?>
         <?if (_sizeof($arr_res)){?>
                <tr>
                   <td>Вывод</td>
                   <td colspan="2"></td>
                   <td colspan="2"><? echo $arr_res['getTlatFirst']?></td>
                   <td colspan="2"><? echo $arr_res['getTlatSecond']?></td>
                   <td colspan="2"><? echo $arr_res['getFirstAngleTan']?></td>
                   <td colspan="2"><? echo $arr_res['getSecondAngleTan']?></td>
                   <td colspan="2"><? echo $arr_res['getAmplitudeRatio']?></td>
                   <td colspan="2"><? echo $arr_res['getAverage']?></td>
                </tr><?}?>
        </table>
       </div>

  <?
}

function view_with_angle($tan)
{
    $angle=rad2deg(atan($tan));
    echo round($angle,2);
}

?>
