cmd_filtre.php 1.25 KB
<?php
	/* Filtre CH2 */
	if(array_key_exists('filt_c2',$_POST)){
		$filt_c2 = shell_exec('lxi scpi -a '.$adresse.' "c2:filt?"');
		if(strpos($filt_c2,"ON")!=false){
			shell_exec('lxi scpi -a '.$adresse.' "c2:filt off"');
		}else{
			shell_exec('lxi scpi -a '.$adresse.' "c2:filt on"');
		}
	}
	$trace_c2=shell_exec('lxi scpi -a '.$adresse.' "c2:tra?"');
	if(strpos($trace_c2,"OFF")!=false){
		$filt_c2="OFF";
	}else{
		$filt_c2 = shell_exec('lxi scpi -a '.$adresse.' "c2:filt?"');
	}
	/* Commande type de filtre CH2 */
	if(array_key_exists('c2_filts',$_POST)){
		$c2filts=$_POST['c2_filts'];
		if($c2filts=="LP"){
			$limite_sup = floatval($_POST['lim_sup']);	
			shell_exec('lxi scpi -a '.$adresse.' "c2:filts type,'.$c2filts.',upplimit,'.$limite_sup.'MHz"');
		}else if($c1filts=="HP"){
			$limite_inf = $_POST['lim_inf'];
			shell_exec('lxi scpi -a '.$adresse.' "c2:filts type,'.$c2filts.',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.' "c2:filts type,'.$c2filts.',upplimit,'.$limite_sup.'MHz,lowlimit,'.$limite_inf.'MHz"');
		}
	}
	$c2filts=shell_exec('lxi scpi -a '.$adresse.' "c2:filts?"');
?>