From eab123e0f24f862401d44f5af8bf88310aaeaef6 Mon Sep 17 00:00:00 2001 From: zhangzhuo Date: Tue, 10 May 2022 13:56:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=B8=8A=E6=AC=A1=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=8E=E6=9C=AA=E5=90=AF=E7=94=A8=E9=A2=84=E7=83=AD?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B7=B2=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/config/calibrate.php | 98 --------------------------------------- main.cpp | 2 +- 2 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 html/config/calibrate.php diff --git a/html/config/calibrate.php b/html/config/calibrate.php deleted file mode 100644 index 0bc60cb..0000000 --- a/html/config/calibrate.php +++ /dev/null @@ -1,98 +0,0 @@ -"; -//$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']; - if ($sensorType==$tempsens) - { - $numberofFS=$i+1; - break; - } - if ($i==$numberofsensor-1) - { - echo "cannot find the sensor"; - return; - } - } - - - -system("sudo killall Mywathdog.sh"); -system("sudo killall TowerOptoSifAndSpectral"); -system("sudo pkill ocean_optics_calibration_console"); -system("sudo gpio write 1 1"); -$cmd=""; - - - - -if ($position==1) -{ - if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta") - { - $cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs IrrLamp.txt --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 IrrLamp.txt --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite; - - } - - -} -else -{ - if($sensorType=="OSIFAlpha"||$sensorType=="OSIFBeta") - { - $cmd = 'sudo /home/pi/bin/ocean_optics_calibration_console --deviceType OceanOptics -t 30 -slfs RadLamp.txt --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 RadLamp.txt --cfon FSN'.$sensorType.$position.'.data --position '.$position.' --integratingSphereDetectorValue '.$nite; - - } -} - - -echo $cmd; - -while(@ ob_end_flush()); - -$proc = popen($cmd, 'r'); - - -while(!feof($proc)){ - echo fread($proc, 4096); - @ flush(); -} -echo 'FINISH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! '; -echo '回到首页'; - -function getonestring(&$bytes,$fenge) -{ - $pattern = '{^.*?'.$fenge.'}'; - $lenth=strlen($fenge); - preg_match($pattern, $bytes, $aa, PREG_OFFSET_CAPTURE); - $bytes = substr($bytes, strlen($aa[0][0])); - $bb = substr($aa[0][0], 0, -$lenth); - return $bb; -} \ No newline at end of file diff --git a/main.cpp b/main.cpp index 629df79..5f41a81 100644 --- a/main.cpp +++ b/main.cpp @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) //m_mduUploader.Initialize(); //m_ctrlHumitureDetector.Initialize(m_struHumitureDI.qstrInterfaceName.toStdString()); //////////////////////////////////////////////////////////////////////////prepare - //m_sTimer.Preheating(); + m_sTimer.Preheating(); //m_ctrlHumitureDetector.GetHumiture_retry(m_fChassisTemp, m_fChassisHum); m_struEC.qstrCaseTemperature= QString("%1").arg(m_fChassisTemp);