This commit is contained in:
2022-01-12 14:14:42 +08:00
parent fd5859e21e
commit 96c9a58288
11 changed files with 158 additions and 34 deletions

View File

@ -1,31 +1,27 @@
[DEVICE INFO]
TotalSpectrometer=2
TotalSpectrometer=1
[FS2]
Model=ISIF
Port=/dev/ttyS1
UID=QEP02975
[FS1]
Model=OSIFAlpha
Port=-1
UID=FLMS15815
AEMax=0.85
AEMin=0.75
Depth=65535
[FS2]
Model=OSIFBeta
Port=-1
UID=QEP02975
AEMax=0.85
AEMin=0.75
Depth=230000
AEMin=0.80
Depth=200000
[FS3]
Model=Null
[LINEAR SHUTTER]
Port=COM8
Port=/dev/ttyUSB1
Type=1
DCID=1
TotalPosition=6
Position0=2000
Position1=110000
Position2=220000
Position3=330000
Position4=440000
Position5=550000
TotalPosition=5
Position0=10000
Position1=91947
Position2=219299
Position3=347535
Position4=474904
[HUMITURE]
Port=COM11
Port=/dev/ttyUSB3

View File

@ -6,12 +6,15 @@
<link rel="stylesheet" type="text/css" href="/css/config.css">
</head>
<body class="body" >
<div>
<h1 class="title1">Sif And Spectral</h1>
</div>
<div style="margin-left:auto;margin-right:auto;width:80%;" >
<table style="width: 100%">
<tr>
<td>程序运行状态</td>
<td id="statid"></td>
<td></td>
<td width="100px">程序运行状态</td>
<td width="50px" id="statid"></td>
<td ></td>
<td><input type="button" value="重启" onclick="rebootclicked()"></td>
</tr>
</table>
@ -19,9 +22,7 @@
</div>
<form action="/php/config.php" method="POST" >
<div style="margin-left:auto;margin-right:auto;width:80%;" >
<div>
<h1 class="title1">Sif And Spectral</h1>
</div>
<div class="mainframe" >
<table class="linetb">
<tr>

98
html/index.html Normal file
View File

@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/css/config.css">
</head>
<body class="body" >
<div>
<h1 class="title1">Sif And Spectral</h1>
</div>
<div style="margin-left:auto;margin-right:auto;width:80%;" >
<table style="width: 100%">
<tr>
<td width="100px">程序运行状态</td>
<td width="50px" id="statid"></td>
<td ></td>
<td><input type="button" value="重启" onclick="rebootclicked()"></td>
</tr>
</table>
</div>
<form action="/php/config.php" method="POST" >
<div style="margin-left:auto;margin-right:auto;width:80%;" >
<div class="mainframe" >
<table class="linetb">
<tr>
<td><h2>控制设置</h2></td>
</tr>
</table>
<div align="center">
<table class="linetb" >
<tr style="width:80%">
<td style="width:33%">开始时间 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="time" id="BeginTime" name="BeginTime" class="TextInput"></td>
<td style="width:33%">时间间隔&nbsp; &nbsp;&nbsp;
<input type="number" id="IntervalTime" name="IntervalTime" class="TextInput"></td>
<td style="width:33%">停止时间&nbsp;&nbsp;&nbsp;&nbsp;
<input type="time" id="EndTime" class="TextInput" name="EndTime"></td>
</tr>
</table>
</div>
<p></p>
<p></p>
<div>
<h2>描述信息</h2>
</div>
<div align="center">
<table style="width:100%">
<tr>
<td>设备序列号&nbsp;&nbsp;&nbsp; <input class="TextInput" id="Dev_SN" name="Dev_SN" value="1000000"></td>
<td>地点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="TextInput" name="Location" id="Location"></td>
<td>北半球 <input type="checkbox" name="GPS_North" id="GPS_North"> </td>
</tr>
<tr>
<td>GPS经度 <input type="text" class="TextInput" name="GPS_Longtitude" id="GPS_Longtitude"></td>
<td>GPS经度 <input type="text" class="TextInput" name="GPS_Latitude" id="GPS_Latitude"> </td>
<td>GPS高程 <input type="text" class="TextInput" name="GPS_Atitude" id="GPS_Atitude"> </td>
</tr>
</table>
<p></p>
<table style="width:100%">
<tr>
<td>安装时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="date" name="InstallTime" id="InstallTime"></td>
<td>ISIF定标时间&nbsp;&nbsp;<input type="date" name="ISIFCalibrationTime" id="ISIFCalibrationTime"> </td>
<td>IS1定标时间 <input type="date" name="IS1CalibrationTime" id="IS1CalibrationTime"> </td>
</tr>
<tr>
<td>设备维护人员 <input type="text" class="TextInput" name="NameOfMaintenance" id="NameOfMaintenance"></td>
<td>维护人员电话 <input type="number" name="PhoneOfMaintenance" id="PhoneOfMaintenance" style="width: 100px" ></td>
</tr>
<tr>
<td>远程资源用户ID <input type="text" name="DownloadUserID" class="TextInput" id="DownloadUserID"></td>
<td>定标文件下载路径<input type="text" name="DownlaodAddress" id="DownlaodAddress"></td>
</tr>
</table>
</div>
<div id="devinfo">
</div>
<div>
<h2></h2>
<input type="submit" value="提交" >
</div>
</div>
</div>
</form>
<script type="text/javascript" src="/javascript/comment.js"></script>
<script type="text/javascript" src="/javascript/config.js"></script>
</body>
</html>

View File

@ -23,7 +23,10 @@ function getDevinfoRetrun(retrun)
div.innerHTML=retrun;
init()
}
function getstataRetrun(retrun){
var div=document.getElementById('statid');
div.innerHTML=retrun;
}
var datad;
@ -36,10 +39,23 @@ function init()
function getinit()
{
httpget("/php/GetIniFile.php",datad,getDevinfoRetrun)
httpget("/php/GetSata.php",datad,getstataRetrun)
}
function rebootclicked()
{
alert("reboot")
httpget("/php/reboot.php",datad,getrebootRentrun)
var div=document.getElementById('statid');
div.innerHTML="";
}
function getrebootRentrun(ret)
{
alert(ret)
setTimeout(() => {
location.reload()
}, 100);
}
window.onload=getinit;

View File

@ -1,4 +1,4 @@
<?php
header("Content-type:application/json");
$a=file_get_contents("config.json");
$a=file_get_contents("/home/data/Setting/config.json");
echo $a;

View File

@ -1,8 +1,9 @@
<?php
$a=parse_ini_file("/home/data/Setting/DeviceSettings.ini",true);
$numberofsensor=intval($a['DEVICE INFO']['TotalSpectrometer']);
$numberofsensor=intval($a['DEVICE INFO']['TotalSpectrometer']);
$b=array_values($a);
echo '<h2>设备信息</h2>';
echo '设备数量 '.$numberofsensor.'';
echo '<table>';

View File

@ -4,7 +4,7 @@ exec("ps -ef | grep TowerOptoSifAndSpectral | grep -v grep",$output,$return);
//var_dump( $output);
if ( count($output)>0)
{
echo '<div style="width: 20px;height: 20px;background: green"></div>';
echo '<div style="width: 40px;height: 20px;background: green"></div>';
}else{
echo '<div style="width: 20px;height: 20px;background: red"></div>';
echo '<div style="width: 40px;height: 20px;background: red"></div>';
}

View File

@ -1 +1 @@
{"BeginTime":"17:49","IntervalTime":"24","EndTime":"18:50","Dev_SN":"1000000","Location":"dasdf","GPS_North":"on","GPS_Longtitude":"123","GPS_Latitude":"123","GPS_Atitude":"50","InstallTime":"2021-12-16","ISIFCalibrationTime":"2021-12-16","IS1CalibrationTime":"2021-12-23","NameOfMaintenance":"123","PhoneOfMaintenance":"123123123","DownloadUserID":"123123","DownlaodAddress":"http:\/\/www.iris-rs.cn","OSIFAlpha_CaliFileMainName":"osifalpha","OSIFBeta_CaliFileMainName":"osifbeta"}
{"BeginTime":"","IntervalTime":"","EndTime":"","Dev_SN":"1000000","Location":"","GPS_Longtitude":"","GPS_Latitude":"","GPS_Atitude":"","InstallTime":"","ISIFCalibrationTime":"","IS1CalibrationTime":"","NameOfMaintenance":"","PhoneOfMaintenance":"","DownloadUserID":"","DownlaodAddress":""}

View File

@ -1,5 +1,7 @@
<?php
file_put_contents("config.json",json_encode($_POST));
var_dump($_POST);
exec("sudo touch /home/data/Setting/config.json");
exec("sudo chmod 777 /home/data/Setting/config.json");
file_put_contents("/home/data/Setting/config.json",json_encode($_POST));
echo "提交成功";

7
html/php/reboot.php Normal file
View File

@ -0,0 +1,7 @@
<?php
ignore_user_abort(true);
set_time_limit(0);
echo system("sudo killall TowerOptoSifAndSpectral");
echo system("sudo ./reboot.sh &");
echo "系统已重启";
//var_dump($output);

3
html/php/reboot.sh Normal file
View File

@ -0,0 +1,3 @@
cd /home/pi/SIF0/out/build_d/Linux-GCC-Debug/
./TowerOptoSifAndSpectral>>log.txt &