From 50db7e6aa4329b92e6bfc750ba2525fe1be01e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=AB=8B=E6=96=B0?= Date: Wed, 16 Feb 2022 10:54:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?php=E5=88=86=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/config/calibrate.php | 15 ++++----- html/config/location.php | 64 --------------------------------------- 2 files changed, 8 insertions(+), 71 deletions(-) delete mode 100644 html/config/location.php diff --git a/html/config/calibrate.php b/html/config/calibrate.php index e287981..3b00815 100644 --- a/html/config/calibrate.php +++ b/html/config/calibrate.php @@ -14,10 +14,11 @@ ob_implicit_flush(1);//将打开或关闭绝对(隐式)刷送。绝对(隐 echo "application beging
"; //$cmd = 'ping 127.0.0.1'; $ini=parse_ini_file("/home/data/Setting/DeviceSettings.ini",true); + $numberofsensor=intval($ini['DEVICE INFO']['TotalSpectrometer']); $numberofFS=0; for($i=0;$i<$numberofsensor;$i++){ - $tempsens=$ini['FS'.$i+1]['Model']; + $tempsens=$ini['FS'.($i+1)]['Model']; if ($sensorType=$tempsens) { $numberofFS=$i+1; @@ -45,13 +46,13 @@ if ($position==1) { 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{ $port=$ini['FS'.$i+1]['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") { - $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{ $port=$ini['FS'.$i+1]['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()); @@ -83,7 +84,7 @@ while(!feof($proc)){ echo fread($proc, 4096); @ flush(); } -echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'; +echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! '; echo '回到首页'; function getonestring(&$bytes,$fenge) diff --git a/html/config/location.php b/html/config/location.php deleted file mode 100644 index d25e67c..0000000 --- a/html/config/location.php +++ /dev/null @@ -1,64 +0,0 @@ -'; - -echo '设备 - - -    -    -    -    - - '; -echo '尼特 '; -echo ''; -echo ''; - -echo ''; - - -echo '回到首页'; - -/* -$i = 100; -while ($i<1000) { - ++$i; - //部分浏览器需要内容达到一定长度了才输出 - if ($i === 103) { - echo"

hello word".$i."

";; - } else { - echo"

hello word".$i."

";; - } - sleep(1); - -} -*/ From a41649f8eb8f489dce030e067762cc70f02c4e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=AB=8B=E6=96=B0?= Date: Wed, 16 Feb 2022 10:57:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=AF=AF=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/config/location.php | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 html/config/location.php diff --git a/html/config/location.php b/html/config/location.php new file mode 100644 index 0000000..82f9875 --- /dev/null +++ b/html/config/location.php @@ -0,0 +1,64 @@ +'; + +echo '设备 + + +    +    +    +    + + '; +echo '尼特 '; +echo ''; +echo ''; + +echo ''; + + +echo '回到首页'; + +/* +$i = 100; +while ($i<1000) { + ++$i; + //部分浏览器需要内容达到一定长度了才输出 + if ($i === 103) { + echo"

hello word".$i."

";; + } else { + echo"

hello word".$i."

";; + } + sleep(1); + +} +*/