cmd_filtre.php
1.25 KB
<?php
/* Filtre CH1 */
if(array_key_exists('filt_c1',$_POST)){
$filt_c1 = shell_exec('lxi scpi -a '.$adresse.' "c1:filt?"');
if(strpos($filt_c1,"ON")!=false){
shell_exec('lxi scpi -a '.$adresse.' "c1:filt off"');
}else{
shell_exec('lxi scpi -a '.$adresse.' "c1:filt on"');
}
}
$trace_c1=shell_exec('lxi scpi -a '.$adresse.' "c1:tra?"');
if(strpos($trace_c1,"OFF")!=false){
$filt_c1="OFF";
}else{
$filt_c1 = shell_exec('lxi scpi -a '.$adresse.' "c1:filt?"');
}
/* Commande type de filtre CH1 */
if(array_key_exists('c1_filts',$_POST)){
$c1filts=$_POST['c1_filts'];
if($c1filts=="LP"){
$limite_sup = floatval($_POST['lim_sup']);
shell_exec('lxi scpi -a '.$adresse.' "c1:filts type,'.$c1filts.',upplimit,'.$limite_sup.'MHz"');
}else if($c1filts=="HP"){
$limite_inf = $_POST['lim_inf'];
shell_exec('lxi scpi -a '.$adresse.' "c1:filts type,'.$c1filts.',lowlimit,'.$limite_inf.'MHz"');
}else{
$limite_sup = $_POST['lim_sup'];
$limite_inf = $_POST['lim_inf'];
if($limite_inf>=$limite_sup){
$limite_inf=$limite_sup-5;
}
shell_exec('lxi scpi -a '.$adresse.' "c1:filts type,'.$c1filts.',upplimit,'.$limite_sup.'MHz,lowlimit,'.$limite_inf.'MHz"');
}
}
$c1filts=shell_exec('lxi scpi -a '.$adresse.' "c1:filts?"');
?>