Blame view

html/Oscilloscope/CH1/6_Filtre/cmd_filtre.php 1.25 KB
c825216f   lwadbled   feat(main.php): R...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  <?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?"');
  ?>