mirror of
http://172.16.0.230/r/SIF/TowerOptoSifAndSpectral.git
synced 2025-10-19 19:49:42 +08:00
php分号
This commit is contained in:
@ -14,10 +14,11 @@ ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐
|
|||||||
echo "application beging<br>";
|
echo "application beging<br>";
|
||||||
//$cmd = 'ping 127.0.0.1';
|
//$cmd = 'ping 127.0.0.1';
|
||||||
$ini=parse_ini_file("/home/data/Setting/DeviceSettings.ini",true);
|
$ini=parse_ini_file("/home/data/Setting/DeviceSettings.ini",true);
|
||||||
|
|
||||||
$numberofsensor=intval($ini['DEVICE INFO']['TotalSpectrometer']);
|
$numberofsensor=intval($ini['DEVICE INFO']['TotalSpectrometer']);
|
||||||
$numberofFS=0;
|
$numberofFS=0;
|
||||||
for($i=0;$i<$numberofsensor;$i++){
|
for($i=0;$i<$numberofsensor;$i++){
|
||||||
$tempsens=$ini['FS'.$i+1]['Model'];
|
$tempsens=$ini['FS'.($i+1)]['Model'];
|
||||||
if ($sensorType=$tempsens)
|
if ($sensorType=$tempsens)
|
||||||
{
|
{
|
||||||
$numberofFS=$i+1;
|
$numberofFS=$i+1;
|
||||||
@ -45,13 +46,13 @@ if ($position==1)
|
|||||||
{
|
{
|
||||||
if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta")
|
if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta")
|
||||||
{
|
{
|
||||||
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs ocean_optics.lmp --cfon FSN'.sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs ocean_optics.lmp --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$port=$ini['FS'.$i+1]['Port'];
|
$port=$ini['FS'.$i+1]['Port'];
|
||||||
getonestring($port,'/');
|
getonestring($port,'/');
|
||||||
getonestring($port,'/');
|
getonestring($port,'/');
|
||||||
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OPTOSKY --serialPort '.$port.' -t 30 -slfs ocean_optics.lmp --cfon FSN'.sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OPTOSKY --serialPort '.$port.' -t 30 -slfs ocean_optics.lmp --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,18 +62,18 @@ else
|
|||||||
{
|
{
|
||||||
if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta")
|
if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta")
|
||||||
{
|
{
|
||||||
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs 4000nit.dat --cfon FSNsdfsd'.sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs 4000nit.dat --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
||||||
}else{
|
}else{
|
||||||
$port=$ini['FS'.$i+1]['Port'];
|
$port=$ini['FS'.$i+1]['Port'];
|
||||||
getonestring($port,'/');
|
getonestring($port,'/');
|
||||||
getonestring($port,'/');
|
getonestring($port,'/');
|
||||||
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OPTOSKY --serialPort '.$port.' -t 30 -slfs 4000nit.dat --cfon FSNsdfsd'.sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
$cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OPTOSKY --serialPort '.$port.' -t 30 -slfs 4000nit.dat --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo $cmd;
|
||||||
|
|
||||||
while(@ ob_end_flush());
|
while(@ ob_end_flush());
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ while(!feof($proc)){
|
|||||||
echo fread($proc, 4096);
|
echo fread($proc, 4096);
|
||||||
@ flush();
|
@ flush();
|
||||||
}
|
}
|
||||||
echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!';
|
echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ';
|
||||||
echo '<a href=/config/position.html>回到首页</a>';
|
echo '<a href=/config/position.html>回到首页</a>';
|
||||||
|
|
||||||
function getonestring(&$bytes,$fenge)
|
function getonestring(&$bytes,$fenge)
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$a=$_GET["p"];
|
|
||||||
|
|
||||||
if ($a==0)
|
|
||||||
{
|
|
||||||
echo "error";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
set_time_limit(0);
|
|
||||||
ob_end_clean();//清空(擦除)缓冲区并关闭输出缓冲
|
|
||||||
ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐式)刷送将导致在每次输出调用后有一次刷送操作,以便不再需要对 flush() 的显式调用
|
|
||||||
//echo shell_exec("D:\\03MyGit\\linux\\movingliner\\cmake-build-debug-mingw\\movingliner.exe");
|
|
||||||
//$cmd = 'ping 127.0.0.1';
|
|
||||||
//sy""
|
|
||||||
system("sudo pkill movingliner");
|
|
||||||
Echo $a;
|
|
||||||
$cmd = 'sudo /home/pi/bin/movingliner '.$a;
|
|
||||||
|
|
||||||
while(@ ob_end_flush());
|
|
||||||
|
|
||||||
$proc = popen($cmd, 'r');
|
|
||||||
|
|
||||||
|
|
||||||
while(!feof($proc)){
|
|
||||||
echo fread($proc, 4096);
|
|
||||||
@ flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo '<form action="/config/calibrate.php?p" method="get">';
|
|
||||||
|
|
||||||
echo '设备<input id="sensor" name="sensor" type="text" list="typelist" placeholder="请选择">
|
|
||||||
|
|
||||||
<datalist id="typelist">
|
|
||||||
<option>IS1</option>
|
|
||||||
<option>IS2</option>
|
|
||||||
<option>ISIF</option>
|
|
||||||
<option>OSIFAlpha</option>
|
|
||||||
<option>OSIFBeta</option>
|
|
||||||
</datalist>';
|
|
||||||
echo '尼特 <input type="number" name="nite" id="nite"/>';
|
|
||||||
echo '<input id="p" name="p" type="hidden" value="'.$a.'">';
|
|
||||||
echo '<input type="submit" value="定标">';
|
|
||||||
|
|
||||||
echo '</form>';
|
|
||||||
|
|
||||||
|
|
||||||
echo '<a href=/config/position.html>回到首页</a>';
|
|
||||||
|
|
||||||
/*
|
|
||||||
$i = 100;
|
|
||||||
while ($i<1000) {
|
|
||||||
++$i;
|
|
||||||
//部分浏览器需要内容达到一定长度了才输出
|
|
||||||
if ($i === 103) {
|
|
||||||
echo"<p>hello word".$i."</p>";;
|
|
||||||
} else {
|
|
||||||
echo"<p>hello word".$i."</p>";;
|
|
||||||
}
|
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
Reference in New Issue
Block a user