mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-03 07:08:53 +03:00
Camera settings (#3029)
* Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload
This commit is contained in:
@@ -113,49 +113,56 @@
|
||||
<hr />
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col span="1" style="width: 33.3%;">
|
||||
<col span="1" style="width: 33.3%;">
|
||||
<col span="1" style="width: 33.3%;">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>Marker:
|
||||
<select id="index" name="reference" onchange="ChangeSelection()">
|
||||
<option value="0" selected>Marker 1</option>
|
||||
<option value="1" >Marker 2</option>
|
||||
</select>
|
||||
</td>
|
||||
<td colspan="2" style="padding-left: 22px; color: grey;">Filename: <output type="text" name="name" id="name" onchange="namechanged()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-top: 10px">x: <input type="number" name="refx" id="refx" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td style="padding-top: 10px">dx: <input type="number" name="refdx" id="refdx" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td rowspan="2" style="padding-top: 10px;"><input class="button" type="button" value="Update Marker" onclick="CutOutReference()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>y: <input type="number" name="refy" id="refy" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td>dy: <input type="number" name="refdy" id="refdy" step=1 onchange="valuemanualchanged()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: bottom;">Selected Image Area:</td>
|
||||
<td style="vertical-align: bottom;">Resulting Marker:</td>
|
||||
<td><input class="button" type="button" id="enhancecontrast" value="Enhance Image Contrast" onclick="EnhanceContrast()"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height:70px; vertical-align: top;"><img id="img_ref_org" src = ""></td> <!--/img_tmp/ref_zw_org.jpg-->
|
||||
<td style="height:70px; vertical-align: top;"><img id="img_ref" src = ""></td> <!--/img_tmp/ref_zw.jpg-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:bottom;"><b>Reference Image:</b></td>
|
||||
<td></td>
|
||||
<td><input style="font-weight:bold;" class="button" type="submit" name="saveroi" id="savemarker" onclick="SaveToConfig()" value="Save New Marker">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><canvas id="canvas" crossorigin></canvas></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<colgroup>
|
||||
<col span="1" style="width: 33.3%;">
|
||||
<col span="1" style="width: 33.3%;">
|
||||
<col span="1" style="width: 33.3%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td>Marker:
|
||||
<select id="index" name="reference" onchange="ChangeSelection()">
|
||||
<option value="0" selected>Marker 1</option>
|
||||
<option value="1" >Marker 2</option>
|
||||
</select>
|
||||
</td>
|
||||
<td colspan="2" style="padding-left: 22px; color: grey;">Filename: <output type="text" name="name" id="name" onchange="namechanged()"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="padding-top: 10px">x: <input type="number" name="refx" id="refx" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td style="padding-top: 10px">dx: <input type="number" name="refdx" id="refdx" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td rowspan="2" style="padding-top: 10px;"><input class="button" type="button" value="Update Marker" onclick="CutOutReference()"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>y: <input type="number" name="refy" id="refy" step=1 onchange="valuemanualchanged()"></td>
|
||||
<td>dy: <input type="number" name="refdy" id="refdy" step=1 onchange="valuemanualchanged()"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: bottom;">Selected Image Area:</td>
|
||||
<td style="vertical-align: bottom;">Resulting Marker:</td>
|
||||
<td><input class="button" type="button" id="enhancecontrast" value="Enhance Image Contrast" onclick="EnhanceContrast()"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="height:70px; vertical-align: top;"><img id="img_ref_org" src = ""></td> <!--/img_tmp/ref_zw_org.jpg-->
|
||||
<td style="height:70px; vertical-align: top;"><img id="img_ref" src = ""></td> <!--/img_tmp/ref_zw.jpg-->
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align:bottom;"><b>Reference Image:</b></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<input style="font-weight:bold;" class="button" type="submit" name="saveroi" id="savemarker" onclick="SaveToConfig()" value="Save New Marker">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3"><canvas id="canvas" crossorigin></canvas></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
||||
@@ -173,6 +180,7 @@ var canvas = document.getElementById('canvas'),
|
||||
domainname = getDomainname(),
|
||||
neueref1,
|
||||
neueref2,
|
||||
cofcat,
|
||||
param;
|
||||
|
||||
function doReboot() {
|
||||
@@ -290,8 +298,7 @@ function UpdateReference(){
|
||||
draw();
|
||||
}
|
||||
|
||||
_filenameurl = refInfo[aktindex]["name"].replace("/config/", "/img_tmp/");
|
||||
|
||||
var _filenameurl = refInfo[aktindex]["name"].replace("/config/", "/img_tmp/");
|
||||
var url = domainname + "/fileserver" + _filenameurl + "?" + Date.now();
|
||||
document.getElementById("img_ref").src = url;
|
||||
|
||||
@@ -352,7 +359,7 @@ function openDescription() {
|
||||
if(window.location.hash) {
|
||||
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
|
||||
if(hash == 'description') {
|
||||
document.getElementById("desc_details").open = true;
|
||||
document.getElementById("desc_details").open = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,7 +375,7 @@ function LoadReference(){
|
||||
draw();
|
||||
}
|
||||
|
||||
_filenameurl = refInfo[aktindex]["name"];
|
||||
var _filenameurl = refInfo[aktindex]["name"];
|
||||
var url = domainname + "/fileserver" + _filenameurl + "?" + Date.now();
|
||||
document.getElementById("img_ref").src = url;
|
||||
|
||||
@@ -387,17 +394,23 @@ function LoadReference(){
|
||||
function init() {
|
||||
openDescription();
|
||||
domainname = getDomainname();
|
||||
loadConfig(domainname);
|
||||
|
||||
if (!loadConfig(domainname)) {
|
||||
firework.launch('Configuration could not be loaded! Please reload the page!', 'danger', 30000);
|
||||
return;
|
||||
}
|
||||
|
||||
ParseConfig();
|
||||
param = getConfigParameters();
|
||||
cofcat = getConfigCategory();
|
||||
|
||||
document.getElementById("savemarker").disabled = true;
|
||||
document.getElementById("enhancecontrast").disabled = true;
|
||||
|
||||
|
||||
canvas.addEventListener('mousedown', mouseDown, false);
|
||||
canvas.addEventListener('mouseup', mouseUp, false);
|
||||
canvas.addEventListener('mousemove', mouseMove, false);
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
|
||||
//CopyReferenceToImgTmp(domainname);
|
||||
refInfo = GetReferencesInfo();
|
||||
@@ -405,6 +418,7 @@ function init() {
|
||||
//UpdateReference();
|
||||
LoadReference();
|
||||
drawImage();
|
||||
draw();
|
||||
}
|
||||
|
||||
function drawImage(){
|
||||
|
||||
@@ -125,7 +125,6 @@
|
||||
|
||||
|
||||
<div id="div1">
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col span="1" style="width: 22%;">
|
||||
@@ -133,9 +132,11 @@
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" style="padding: 0px"><class id="Numbers_text" style="color:black;">Number Sequence:</class></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<select id="Numbers_value1" onchange="numberChanged()">
|
||||
@@ -156,15 +157,18 @@
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td style="padding: 0px">ROI:</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><select id="index" name="index" onchange="ChangeSelection()" tabindex=1></select></td>
|
||||
<td><input class="button" type="submit" id="newROI" name="newROI" onclick="newROI()" value="New ROI"></td>
|
||||
<td><input class="button" type="submit" id="renameROI" name="renameROI" onclick="renameROI()" value="Rename ROI"></td>
|
||||
<td><input class="button" type="submit" id="deleteROI" name="deleteROI" onclick="deleteROI()" value="Delete ROI"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="multiplier">Multiplier: <output type="text" id="multiplier" name="multiplier"></output><br>
|
||||
(only based on order)
|
||||
@@ -183,14 +187,17 @@
|
||||
<col span="1" style="width: 18%;">
|
||||
<col span="1" style="width: 64%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td>x: <input type="number" name="refx" id="refx" step=1 onchange="valuemanualchanged()" tabindex=2></td>
|
||||
<td>Δx: <input type="number" name="refdx" id="refdx" step=1 onchange="valuemanualchangeddx()" tabindex=4></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>y: <input type="number" name="refy" id="refy" step=1 onchange="valuemanualchanged()" tabindex=3></td>
|
||||
<td>Δy: <input type="number" name="refdy" id="refdy" step=1 onchange="valuemanualchanged()" tabindex=5></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="3"><input type="checkbox" id="CCW" name="CCW" value="0" onclick="changeCCW()" unchecked tabindex=8><label for="CCW">Counter clockwise rotation (CCW)</label></td>
|
||||
</tr>
|
||||
@@ -202,7 +209,6 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
<input type="checkbox" id="showall" name="showall" value="1" onclick="draw()" checked tabindex=9><label for="showall">Show all ROIs</label><br>
|
||||
<input type="checkbox" id="lockAspectRatio" name="lockAspectRatio" value="1" onclick="changelockAspectRatio()" checked tabindex=6><label for="lockAspectRatio"> Lock aspect ratio </label><br>
|
||||
<input type="checkbox" id="lockSizes" name="lockSizes" value="1" onclick="changelockSizes()" checked tabindex=7><label for="lockSizes"> Synchronize y, Δx and Δy between ROIs</label><br>
|
||||
|
||||
<hr>
|
||||
|
||||
<table>
|
||||
@@ -212,20 +218,23 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td colspan="3" style="vertical-align: bottom;"><b>Reference Image:</b></td>
|
||||
<!---<td><button class="button" id="reboot" type="button" onclick="doReboot()">Reboot device</button></td>-->
|
||||
<td><input style="font-weight:bold;" class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save Config" tabindex=10></td>
|
||||
<td>
|
||||
<input style="font-weight:bold;" class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save Config" tabindex=10>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><canvas id="canvas" crossorigin></canvas></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
var canvas = document.getElementById('canvas'),
|
||||
@@ -595,7 +604,7 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
if(window.location.hash) {
|
||||
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
|
||||
if(hash == 'description') {
|
||||
document.getElementById("desc_details").open = true;
|
||||
document.getElementById("desc_details").open = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,18 +612,26 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
function init() {
|
||||
openDescription();
|
||||
domainname = getDomainname();
|
||||
canvas.addEventListener('mousedown', mouseDown, false);
|
||||
canvas.addEventListener('mouseup', mouseUp, false);
|
||||
canvas.addEventListener('mousemove', mouseMove, false);
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
loadConfig(domainname);
|
||||
|
||||
if (!loadConfig(domainname)) {
|
||||
firework.launch('Configuration could not be loaded! Please reload the page!', 'danger', 30000);
|
||||
return;
|
||||
}
|
||||
|
||||
ParseConfig();
|
||||
param = getConfigParameters();
|
||||
cofcat = getConfigCategory();
|
||||
|
||||
canvas.addEventListener('mousedown', mouseDown, false);
|
||||
canvas.addEventListener('mouseup', mouseUp, false);
|
||||
canvas.addEventListener('mousemove', mouseMove, false);
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
|
||||
UpdateNUMBERS();
|
||||
|
||||
/* Check if the ROIs have same dy and dx. If so, tick the sync checkbox */
|
||||
var all_dx_dy_Identical = true;
|
||||
|
||||
if (ROIInfo.length > 1) {
|
||||
for (var i = 1; i < (ROIInfo.length); ++i) { // 2nd .. last ROI
|
||||
if (parseInt(ROIInfo[i].dx) != parseInt(ROIInfo[0].dx) || parseInt(ROIInfo[i].dy) != parseInt(ROIInfo[0].dy)) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
p {font-size: 1em;}
|
||||
|
||||
input[type=number] {
|
||||
width: 40px;
|
||||
width: 60px;
|
||||
margin-right: 10px;
|
||||
padding: 3px 5px;
|
||||
display: inline-block;
|
||||
@@ -123,17 +123,25 @@
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" style="padding: 0px"><class id="Numbers_text" style="color:black;">Number Sequence:</class></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<select id="Numbers_value1" onchange="numberChanged()">
|
||||
</select>
|
||||
</td>
|
||||
<td><input class="button" type="submit" id="newNumber" name="newNumber" onclick="newNumber()" value="New Sequence"></td>
|
||||
<td><input class="button" type="submit" id="renameNumber" name="renameNumber" onclick="renameNumber()" value="Rename Sequence"></td>
|
||||
<td><input class="button" type="submit" id="removeNumber" name="removeNumber" onclick="removeNumber()" value="Delete Sequence"></td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="newNumber" name="newNumber" onclick="newNumber()" value="New Sequence">
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="renameNumber" name="renameNumber" onclick="renameNumber()" value="Rename Sequence">
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="removeNumber" name="removeNumber" onclick="removeNumber()" value="Delete Sequence">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -146,15 +154,26 @@
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td style="padding: 0px">ROI:</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><select id="index" name="index" onchange="ChangeSelection()" tabindex=1></select></td>
|
||||
<td><input class="button" type="submit" id="newROI" name="newROI" onclick="newROI()" value="New ROI"></td>
|
||||
<td><input class="button" type="submit" id="renameROI" name="renameROI" onclick="renameROI()" value="Rename ROI"></td>
|
||||
<td><input class="button" type="submit" id="deleteROI" name="deleteROI" onclick="deleteROI()" value="Delete ROI"></td>
|
||||
<td>
|
||||
<select id="index" name="index" onchange="ChangeSelection()" tabindex=1></select>
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="newROI" name="newROI" onclick="newROI()" value="New ROI">
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="renameROI" name="renameROI" onclick="renameROI()" value="Rename ROI">
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="deleteROI" name="deleteROI" onclick="deleteROI()" value="Delete ROI">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="multiplier">Multiplier: <output type="text" id="multiplier" name="multiplier"></output><br>
|
||||
(only based on order)
|
||||
@@ -162,8 +181,12 @@
|
||||
<td class="multiplier">Multiplier: <output type="text" id="multiplier_decshift" name="multiplier_decshift"></output><br>
|
||||
(order + decimal shift: <output type="text" id="decimalShift" name="decimalShift"></output>)
|
||||
</td>
|
||||
<td><input class="button" type="submit" id="movePrevious" onclick="movePrevious()" value="Move ROI Higher"></td>
|
||||
<td><input class="button" type="submit" id="moveNext" onclick="moveNext()" value="Move ROI Lower"></td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="movePrevious" onclick="movePrevious()" value="Move ROI Higher">
|
||||
</td>
|
||||
<td>
|
||||
<input class="button" type="submit" id="moveNext" onclick="moveNext()" value="Move ROI Lower">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -173,10 +196,12 @@
|
||||
<col span="1" style="width: 18%;">
|
||||
<col span="1" style="width: 64%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td>x: <input type="number" name="refx" id="refx" step=1 onchange="valuemanualchanged()" tabindex=2></td>
|
||||
<td>Δx: <input type="number" name="refdx" id="refdx" step=1 onchange="valuemanualchangeddx()" tabindex=4></td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>y: <input type="number" name="refy" id="refy" step=1 onchange="valuemanualchanged()" tabindex=3></td>
|
||||
<td>Δy: <input type="number" name="refdy" id="refdy" step=1 onchange="valuemanualchanged()" tabindex=5></td>
|
||||
@@ -186,11 +211,11 @@
|
||||
|
||||
|
||||
<hr>
|
||||
The following settings are only used for easier setup, they are <b>not</b> persisted on the device:<br>
|
||||
<input type="checkbox" id="showall" name="showall" value="1" onclick="draw()" checked tabindex=10><label for="showall">Show all ROIs</label><br>
|
||||
<input type="checkbox" id="lockAspectRatio" name="lockAspectRatio" value="1" onclick="changelockAspectRatio()" checked tabindex=6><label for="lockAspectRatio"> Lock aspect ratio </label><br>
|
||||
<input type="checkbox" id="lockSizes" name="lockSizes" value="1" onclick="changelockSizes()" checked tabindex=7><label for="lockSizes"> Synchronize y, Δx and Δy between ROIs</label><br>
|
||||
<input type="checkbox" id="lockSpaceEquidistant" name="lockSpaceEquidistant" value="1" onclick="changeLockSpaceEquidistant()" checked tabindex=8>
|
||||
The following settings are only used for easier setup, they are <b>not</b> persisted on the device:<br>
|
||||
<input type="checkbox" id="showall" name="showall" value="1" onclick="draw()" checked tabindex=10><label for="showall">Show all ROIs</label><br>
|
||||
<input type="checkbox" id="lockAspectRatio" name="lockAspectRatio" value="1" onclick="changelockAspectRatio()" checked tabindex=6><label for="lockAspectRatio"> Lock aspect ratio </label><br>
|
||||
<input type="checkbox" id="lockSizes" name="lockSizes" value="1" onclick="changelockSizes()" checked tabindex=7><label for="lockSizes"> Synchronize y, Δx and Δy between ROIs</label><br>
|
||||
<input type="checkbox" id="lockSpaceEquidistant" name="lockSpaceEquidistant" value="1" onclick="changeLockSpaceEquidistant()" checked tabindex=8>
|
||||
<label for="lockSpaceEquidistant">Keep equidistance of <input type="number" name="space" id="space" maxlength="2" max=99 step=1 onchange="valuemanualchangedspace()" tabindex=9> between all ROIs</label><br>
|
||||
<hr>
|
||||
|
||||
@@ -201,10 +226,14 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
<col span="1" style="width: 26%;">
|
||||
<col span="1" style="width: 26%;">
|
||||
</colgroup>
|
||||
|
||||
<tr>
|
||||
<td colspan="3" style="vertical-align: bottom;"><b>Reference Image:</b></td>
|
||||
<td><input style="font-weight:bold;" class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save Config" tabindex=11></td>
|
||||
</tr>
|
||||
<td>
|
||||
<input style="font-weight:bold;" class="button" type="submit" id="saveroi" name="saveroi" onclick="SaveToConfig()" value="Save Config" tabindex=11>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><canvas id="canvas" crossorigin></canvas></td>
|
||||
</tr>
|
||||
@@ -491,6 +520,7 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
}
|
||||
|
||||
var _index = document.getElementById("index");
|
||||
|
||||
while (_index.length){
|
||||
_index.remove(0);
|
||||
}
|
||||
@@ -582,7 +612,7 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
if(window.location.hash) {
|
||||
var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character
|
||||
if(hash == 'description') {
|
||||
document.getElementById("desc_details").open = true;
|
||||
document.getElementById("desc_details").open = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -590,14 +620,21 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
function init() {
|
||||
openDescription();
|
||||
domainname = getDomainname();
|
||||
canvas.addEventListener('mousedown', mouseDown, false);
|
||||
canvas.addEventListener('mouseup', mouseUp, false);
|
||||
canvas.addEventListener('mousemove', mouseMove, false);
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
loadConfig(domainname);
|
||||
|
||||
if (!loadConfig(domainname)) {
|
||||
firework.launch('Configuration could not be loaded! Please reload the page!', 'danger', 30000);
|
||||
return;
|
||||
}
|
||||
|
||||
ParseConfig();
|
||||
param = getConfigParameters();
|
||||
cofcat = getConfigCategory();
|
||||
|
||||
canvas.addEventListener('mousedown', mouseDown, false);
|
||||
canvas.addEventListener('mouseup', mouseUp, false);
|
||||
canvas.addEventListener('mousemove', mouseMove, false);
|
||||
loadCanvas(domainname + "/fileserver/config/reference.jpg");
|
||||
|
||||
UpdateNUMBERS();
|
||||
|
||||
/* Check if the ROIs are equidistant. Only if not, untick the checkbox */
|
||||
@@ -717,6 +754,7 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
}
|
||||
|
||||
erg = CreateNUMBER(_numbernew);
|
||||
|
||||
if (erg != "") {
|
||||
firework.launch(erg, 'danger', 30000);
|
||||
}
|
||||
@@ -844,14 +882,17 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
|
||||
function mouseUp() {
|
||||
drag = false;
|
||||
|
||||
if (rect.w < 0) {
|
||||
rect.w = -rect.w
|
||||
rect.startX-=rect.w
|
||||
}
|
||||
|
||||
if (rect.h < 0) {
|
||||
rect.h = -rect.h
|
||||
rect.startY-=rect.h
|
||||
}
|
||||
|
||||
document.getElementById("refdx").value = rect.w;
|
||||
document.getElementById("refdy").value = rect.h;
|
||||
document.getElementById("refx").value = rect.startX;
|
||||
@@ -876,10 +917,12 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
}
|
||||
document.getElementById("refdx").value = rect.w;
|
||||
document.getElementById("refdy").value = rect.h;
|
||||
|
||||
draw();
|
||||
}
|
||||
else {
|
||||
draw();
|
||||
|
||||
var canvas = document.getElementById('canvas');
|
||||
var context = canvas.getContext('2d');
|
||||
|
||||
@@ -915,10 +958,10 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
rect.startX = document.getElementById("refx").value;
|
||||
rect.startY = document.getElementById("refy").value;
|
||||
|
||||
draw();
|
||||
if (lockSpaceEquidistant) {
|
||||
makeX_SpaceEquidistant();
|
||||
}
|
||||
}
|
||||
|
||||
draw();
|
||||
}
|
||||
document.getElementById("saveroi").disabled = false;
|
||||
@@ -990,11 +1033,13 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
||||
_roialt= sel.options[sel.selectedIndex].text;
|
||||
|
||||
var _roinew = prompt("Please enter a new name for the selected ROI", _roialt);
|
||||
|
||||
if (_roinew === null) {
|
||||
return; //break out of the function early because prompt was aborted
|
||||
}
|
||||
|
||||
erg = RenameROI(_number, "digit", _roialt, _roinew);
|
||||
|
||||
if (erg != "") {
|
||||
firework.launch(erg, 'danger', 30000);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,21 +21,21 @@
|
||||
var streamPopup;
|
||||
var streamFlashlight = false;
|
||||
var streamWindowFeatures =
|
||||
'channelmode=no,directories=no,fullscreen=no,' +
|
||||
'location=no,dependent=yes,menubar=no,resizable=no,scrollbars=no,' +
|
||||
'status=no,toolbar=no,titlebar=no,' +
|
||||
'left=10,top=260,width=640px,height=480px';
|
||||
'channelmode=no,directories=no,fullscreen=no,' +
|
||||
'location=no,dependent=yes,menubar=no,resizable=no,scrollbars=no,' +
|
||||
'status=no,toolbar=no,titlebar=no,' +
|
||||
'left=10,top=260,width=640px,height=480px';
|
||||
|
||||
function loadPage(page) {
|
||||
function loadPage(page) {
|
||||
console.log("loadPage( " + page + " )");
|
||||
|
||||
if (streamPopup) // Ensure that stream popup is closed because it's blocking web interface
|
||||
if (streamPopup) { // Ensure that stream popup is closed because it's blocking web interface
|
||||
streamPopup.close();
|
||||
}
|
||||
|
||||
asyncPageLoad(page);
|
||||
}
|
||||
|
||||
|
||||
async function asyncPageLoad(page ) {
|
||||
console.log(" loading " + page + " ...");
|
||||
document.cookie = "page="+page + "; path=/";
|
||||
@@ -46,7 +46,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function resetMenu() {
|
||||
[].forEach.call(document.querySelectorAll('.submenu'), function (el) {
|
||||
el.style.visibility = 'visible';
|
||||
@@ -54,18 +53,20 @@
|
||||
}
|
||||
|
||||
function getCookie(cname) {
|
||||
let name = cname + "=";
|
||||
let decodedCookie = decodeURIComponent(document.cookie);
|
||||
let ca = decodedCookie.split(';');
|
||||
for(let i = 0; i <ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
let name = cname + "=";
|
||||
let decodedCookie = decodeURIComponent(document.cookie);
|
||||
let ca = decodedCookie.split(';');
|
||||
for(let i = 0; i <ca.length; i++) {
|
||||
let c = ca[i];
|
||||
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
</script>
|
||||
@@ -153,7 +154,7 @@
|
||||
HA_send_discovery_visibility();
|
||||
|
||||
if (getCookie("page") == "" || getCookie("page") == "reboot_page.html?v=$COMMIT_HASH") {
|
||||
document.cookie = "page=overview.html?v=$COMMIT_HASH" + "; path=/";
|
||||
document.cookie = "page=overview.html?v=$COMMIT_HASH" + "; path=/";
|
||||
}
|
||||
console.log("Loading page: " + getCookie("page"));
|
||||
document.getElementById('maincontent').src = getCookie("page");
|
||||
@@ -181,19 +182,18 @@
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
function HA_send_discovery_visibility() {
|
||||
loadConfig(domainname);
|
||||
ParseConfig();
|
||||
category = getConfigCategory();
|
||||
param = getConfigParameters();
|
||||
if (category["MQTT"]["enabled"] && param["MQTT"]["HomeassistantDiscovery"]["value1"] == "true") {
|
||||
|
||||
if (category["MQTT"]["enabled"] && param["MQTT"]["HomeassistantDiscovery"].value == "true") {
|
||||
document.getElementById("ManualControl").style.display="";
|
||||
document.getElementById("HASendDiscovery").style.display="";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function HA_send_discovery() {
|
||||
console.log("HA Discovery scheduled");
|
||||
var url = getDomainname() + '/mqtt_publish_discovery';
|
||||
@@ -207,15 +207,17 @@
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function start_livestream(streamFlashlight) {
|
||||
if (streamPopup)
|
||||
if (streamPopup) {
|
||||
streamPopup.close();
|
||||
}
|
||||
|
||||
if (streamFlashlight)
|
||||
if (streamFlashlight) {
|
||||
streamPopup = window.open(getDomainname() + '/stream?flashlight=true','LivestreamWithlight',streamWindowFeatures);
|
||||
else
|
||||
}
|
||||
else {
|
||||
streamPopup = window.open(getDomainname() + '/stream','Livestream',streamWindowFeatures);
|
||||
}
|
||||
|
||||
streamPopup.focus();
|
||||
}
|
||||
|
||||
@@ -5,13 +5,64 @@
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<style>
|
||||
.tg {border-collapse:collapse;border-spacing:0;width:100%;min-width:600px;height:100%;color:darkslategray;}
|
||||
.tg th{min-width:325px;width:325px;height:20px;font-size:18px;text-align:left;font-weight:bold;padding:5px 10px 5px 10px;;overflow:hidden;word-break:normal;background-color:lightgrey;}
|
||||
.tg td{font-size:15px;padding:5px 10px 5px 10px;overflow:hidden;word-break:normal;}
|
||||
.tg .tg-1{font-size:15px;vertical-align: top; font-family:Arial, Helvetica, sans-serif !important;}
|
||||
.tg .tg-2{height:52px;font-size:15px;padding:3px 0px 3px 10px;vertical-align:middle;font-family:Arial, Helvetica, sans-serif !important;}
|
||||
.tg .tg-3{height:45px;font-size:15px;padding:3px 10px 3px 10px;vertical-align:middle;font-family:Arial, Helvetica, sans-serif !important;}
|
||||
.tg .tg-4{height:fit-content;font-size:15px;padding:5px 10px 5px 10px;vertical-align:text-top;font-family:Arial, Helvetica, sans-serif !important;}
|
||||
.tg {
|
||||
border-collapse:collapse;
|
||||
border-spacing:0;
|
||||
width:100%;
|
||||
min-width:600px;
|
||||
height:100%;
|
||||
color:darkslategray;
|
||||
}
|
||||
|
||||
.tg th{
|
||||
min-width:325px;
|
||||
width:325px;
|
||||
height:20px;
|
||||
font-size:18px;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
padding:5px 10px 5px 10px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
background-color:lightgrey;
|
||||
}
|
||||
|
||||
.tg td{
|
||||
font-size:15px;
|
||||
padding:5px 10px 5px 10px;
|
||||
overflow:hidden;
|
||||
word-break:normal;
|
||||
}
|
||||
|
||||
.tg .tg-1{
|
||||
font-size:15px;
|
||||
vertical-align: top;
|
||||
font-family:Arial, Helvetica, sans-serif !important;
|
||||
}
|
||||
|
||||
.tg .tg-2{
|
||||
height:52px;
|
||||
font-size:15px;
|
||||
padding:3px 0px 3px 10px;
|
||||
vertical-align:middle;
|
||||
font-family:Arial, Helvetica, sans-serif !important;
|
||||
}
|
||||
|
||||
.tg .tg-3{
|
||||
height:45px;
|
||||
font-size:15px;
|
||||
padding:3px 10px 3px 10px;
|
||||
vertical-align:middle;
|
||||
font-family:Arial, Helvetica, sans-serif !important;
|
||||
}
|
||||
|
||||
.tg .tg-4{
|
||||
height:fit-content;
|
||||
font-size:15px;
|
||||
padding:5px 10px 5px 10px;
|
||||
vertical-align:text-top;
|
||||
font-family:Arial, Helvetica, sans-serif !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -78,221 +129,208 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script type="text/javascript" src="jquery-3.6.0.min.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="common.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
||||
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function addZero(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
function addZero(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
LoadData();
|
||||
LoadROIImage();
|
||||
});
|
||||
|
||||
|
||||
function LoadData(){
|
||||
loadValue("value", "value", "border-collapse: collapse; width: 100%");
|
||||
loadValue("raw", "raw", "border-collapse: collapse; width: 100%");
|
||||
loadValue("prevalue", "prevalue", "border-collapse: collapse; width: 100%");
|
||||
loadValue("error", "error", "border-collapse: collapse; width: 100%");
|
||||
loadStatus();
|
||||
loadCPUTemp();
|
||||
loadRSSI();
|
||||
loadUptime();
|
||||
loadRoundCounter();
|
||||
}
|
||||
|
||||
|
||||
function LoadROIImage(){
|
||||
var d = new Date();
|
||||
var timestamp = d.getTime();
|
||||
var h = addZero(d.getHours());
|
||||
var m = addZero(d.getMinutes());
|
||||
var s = addZero(d.getSeconds());
|
||||
document.getElementById("img").src = getDomainname() + '/img_tmp/alg_roi.jpg?timestamp=' + timestamp;
|
||||
$('#timestamp').html("Last Page Refresh:" + (h + ":" + m + ":" + s));
|
||||
}
|
||||
|
||||
|
||||
function Refresh() {
|
||||
setTimeout (function() {
|
||||
$(document).ready(function() {
|
||||
LoadData();
|
||||
LoadROIImage();
|
||||
Refresh();
|
||||
}, 300000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function loadStatus() {
|
||||
url = domainname + '/statusflow';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#statusflow').html(_rsp);
|
||||
}
|
||||
function LoadData(){
|
||||
loadValue("value", "value", "border-collapse: collapse; width: 100%");
|
||||
loadValue("raw", "raw", "border-collapse: collapse; width: 100%");
|
||||
loadValue("prevalue", "prevalue", "border-collapse: collapse; width: 100%");
|
||||
loadValue("error", "error", "border-collapse: collapse; width: 100%");
|
||||
loadStatus();
|
||||
loadCPUTemp();
|
||||
loadRSSI();
|
||||
loadUptime();
|
||||
loadRoundCounter();
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function loadCPUTemp() {
|
||||
url = domainname + '/cpu_temperature';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#cputemp').html("CPU Temperature: " +_rsp + "°C");
|
||||
}
|
||||
function LoadROIImage(){
|
||||
var d = new Date();
|
||||
var timestamp = d.getTime();
|
||||
var h = addZero(d.getHours());
|
||||
var m = addZero(d.getMinutes());
|
||||
var s = addZero(d.getSeconds());
|
||||
document.getElementById("img").src = getDomainname() + '/img_tmp/alg_roi.jpg?timestamp=' + timestamp;
|
||||
$('#timestamp').html("Last Page Refresh:" + (h + ":" + m + ":" + s));
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function Refresh() {
|
||||
setTimeout (function() {
|
||||
LoadData();
|
||||
LoadROIImage();
|
||||
Refresh();
|
||||
}, 300000);
|
||||
}
|
||||
|
||||
function loadRSSI() {
|
||||
url = domainname + '/rssi';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
function loadStatus() {
|
||||
url = domainname + '/statusflow';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#statusflow').html(_rsp);
|
||||
}
|
||||
}
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function loadCPUTemp() {
|
||||
url = domainname + '/cpu_temperature';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#cputemp').html("CPU Temperature: " +_rsp + "°C");
|
||||
}
|
||||
}
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function loadRSSI() {
|
||||
url = domainname + '/rssi';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
|
||||
if (_rsp >= -55) {
|
||||
$('#rssi').html("WIFI Signal: Excellent (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -55 && _rsp >= -67) {
|
||||
$('#rssi').html("WIFI Signal: Good (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -67 && _rsp >= -78) {
|
||||
$('#rssi').html("WIFI Signal: Fair (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -78 && _rsp >= -85) {
|
||||
$('#rssi').html("WIFI Signal: Weak (" + _rsp + "dBm)");
|
||||
}
|
||||
else {
|
||||
$('#rssi').html("WIFI Signal: Unreliable (" + _rsp + "dBm)");
|
||||
if (_rsp >= -55) {
|
||||
$('#rssi').html("WIFI Signal: Excellent (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -55 && _rsp >= -67) {
|
||||
$('#rssi').html("WIFI Signal: Good (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -67 && _rsp >= -78) {
|
||||
$('#rssi').html("WIFI Signal: Fair (" + _rsp + "dBm)");
|
||||
}
|
||||
else if (_rsp < -78 && _rsp >= -85) {
|
||||
$('#rssi').html("WIFI Signal: Weak (" + _rsp + "dBm)");
|
||||
}
|
||||
else {
|
||||
$('#rssi').html("WIFI Signal: Unreliable (" + _rsp + "dBm)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function loadUptime() {
|
||||
url = domainname + '/uptime';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#uptime').html("Uptime: " + _rsp);
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function loadRoundCounter() {
|
||||
url = domainname + '/info?type=Round';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#round').html("(Round: " + _rsp + ")");
|
||||
}
|
||||
}
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
|
||||
function loadValue(_type, _div, _style) {
|
||||
url = domainname + '/value?all=true&type=' + _type;
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
var _split = _rsp.split("\r");
|
||||
if (typeof _style == undefined)
|
||||
out = "<table>";
|
||||
else
|
||||
out = "<table style=\"" + _style + "\">";
|
||||
|
||||
if (_split.length == 1)
|
||||
{
|
||||
var _zer = ZerlegeZeile(_split[0], "\t")
|
||||
if (_zer.length > 1)
|
||||
out = _zer[1];
|
||||
else
|
||||
out = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var j = 0; j < _split.length; ++j)
|
||||
{
|
||||
var _zer = ZerlegeZeile(_split[j], "\t")
|
||||
if (_zer.length == 1)
|
||||
out = out + "<tr><td style=\"width: 22%; padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\">" +
|
||||
_zer[0] + "</td><td style=\"padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\"> </td></tr>";
|
||||
else
|
||||
out = out + "<tr><td style=\"width: 22%; padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\">" +
|
||||
_zer[0] + "</td><td style=\"padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\" >" + _zer[1] + "</td></tr>";
|
||||
function loadUptime() {
|
||||
url = domainname + '/uptime';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#uptime').html("Uptime: " + _rsp);
|
||||
}
|
||||
out = out + "</table>"
|
||||
|
||||
}
|
||||
document.getElementById(_div).innerHTML = out;
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function loadRoundCounter() {
|
||||
url = domainname + '/info?type=Round';
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
$('#round').html("(Round: " + _rsp + ")");
|
||||
}
|
||||
}
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function setImageMaxWidth()
|
||||
{
|
||||
loadConfig(domainname);
|
||||
ParseConfig();
|
||||
param = getConfigParameters();
|
||||
if(param["TakeImage"]["ImageSize"]["value1"] == "QVGA") {
|
||||
if (param["Alignment"]["FlipImageSize"]["value1"] == "false") {
|
||||
function loadValue(_type, _div, _style) {
|
||||
url = domainname + '/value?all=true&type=' + _type;
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var _rsp = xhttp.responseText;
|
||||
var _split = _rsp.split("\r");
|
||||
|
||||
if (typeof _style == undefined) {
|
||||
out = "<table>";
|
||||
}
|
||||
else {
|
||||
out = "<table style=\"" + _style + "\">";
|
||||
}
|
||||
|
||||
if (_split.length == 1) {
|
||||
var _zer = ZerlegeZeile(_split[0], "\t")
|
||||
|
||||
if (_zer.length > 1) {
|
||||
out = _zer[1];
|
||||
}
|
||||
else {
|
||||
out = "";
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (var j = 0; j < _split.length; ++j) {
|
||||
var _zer = ZerlegeZeile(_split[j], "\t")
|
||||
|
||||
if (_zer.length == 1) {
|
||||
out = out + "<tr><td style=\"width: 22%; padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\">" +
|
||||
_zer[0] + "</td><td style=\"padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\"> </td></tr>";
|
||||
}
|
||||
else {
|
||||
out = out + "<tr><td style=\"width: 22%; padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\">" +
|
||||
_zer[0] + "</td><td style=\"padding: 3px 5px; text-align: left; vertical-align:middle; border: 1px solid lightgrey\" >" + _zer[1] + "</td></tr>";
|
||||
}
|
||||
}
|
||||
out = out + "</table>"
|
||||
}
|
||||
document.getElementById(_div).innerHTML = out;
|
||||
}
|
||||
};
|
||||
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
function setImageMaxWidth() {
|
||||
loadConfig(domainname);
|
||||
ParseConfig();
|
||||
param = getConfigParameters();
|
||||
|
||||
if(param["TakeImage"]["CamFrameSize"].value == "QVGA") {
|
||||
document.getElementById("img").style.maxWidth = "320px";
|
||||
}
|
||||
else {
|
||||
document.getElementById("img").style.maxWidth = "240px";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (param["Alignment"]["FlipImageSize"]["value1"] == "false") {
|
||||
document.getElementById("img").style.maxWidth = "640px";
|
||||
}
|
||||
else {
|
||||
document.getElementById("img").style.maxWidth = "480px";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function init(){
|
||||
domainname = getDomainname();
|
||||
setImageMaxWidth();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
function init(){
|
||||
domainname = getDomainname();
|
||||
setImageMaxWidth();
|
||||
Refresh();
|
||||
}
|
||||
init();
|
||||
|
||||
|
||||
init();
|
||||
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
function SaveConfigToServer(_domainname){
|
||||
// leere Zeilen am Ende löschen
|
||||
var zw = config_split.length - 1;
|
||||
|
||||
while (config_split[zw] == "") {
|
||||
config_split.pop();
|
||||
}
|
||||
|
||||
var config_gesamt = "";
|
||||
|
||||
for (var i = 0; i < config_split.length; ++i)
|
||||
{
|
||||
config_gesamt = config_gesamt + config_split[i] + "\n";
|
||||
@@ -26,231 +28,227 @@ function UpdateConfig(zw, _index, _enhance, _domainname){
|
||||
|
||||
function createReader(file) {
|
||||
var image = new Image();
|
||||
|
||||
reader.onload = function(evt) {
|
||||
var image = new Image();
|
||||
|
||||
image.onload = function(evt) {
|
||||
var width = this.width;
|
||||
var height = this.height;
|
||||
//alert (width); // will produce something like 198
|
||||
};
|
||||
|
||||
image.src = evt.target.result;
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
|
||||
|
||||
function ZerlegeZeile(input, delimiter = " =\t\r")
|
||||
{
|
||||
var Output = Array(0);
|
||||
function ZerlegeZeile(input, delimiter = " =\t\r") {
|
||||
var Output = Array(0);
|
||||
// delimiter = " =,\t";
|
||||
|
||||
/* The input can have multiple formats:
|
||||
* - key = value
|
||||
* - key = value1 value2 value3 ...
|
||||
* - key value1 value2 value3 ...
|
||||
*
|
||||
* Examples:
|
||||
* - ImageSize = VGA
|
||||
* - IO0 = input disabled 10 false false
|
||||
* - main.dig1 28 144 55 100 false
|
||||
*
|
||||
* This causes issues eg. if a password key has a whitespace or equal sign in its value.
|
||||
* As a workaround and to not break any legacy usage, we enforce to only use the
|
||||
* equal sign, if the key is "password"
|
||||
*/
|
||||
if (input.includes("password") || input.includes("Token")) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
||||
var pos = input.indexOf("=");
|
||||
delimiter = " \t\r"
|
||||
Output.push(trim(input.substr(0, pos), delimiter));
|
||||
Output.push(trim(input.substr(pos +1, input.length), delimiter));
|
||||
}
|
||||
else { // Legacy Mode
|
||||
input = trim(input, delimiter);
|
||||
var pos = findDelimiterPos(input, delimiter);
|
||||
var token;
|
||||
while (pos > -1) {
|
||||
token = input.substr(0, pos);
|
||||
token = trim(token, delimiter);
|
||||
Output.push(token);
|
||||
input = input.substr(pos+1, input.length);
|
||||
input = trim(input, delimiter);
|
||||
pos = findDelimiterPos(input, delimiter);
|
||||
}
|
||||
Output.push(input);
|
||||
}
|
||||
/* The input can have multiple formats:
|
||||
* - key = value
|
||||
* - key = value1 value2 value3 ...
|
||||
* - key value1 value2 value3 ...
|
||||
*
|
||||
* Examples:
|
||||
* - ImageSize = VGA
|
||||
* - IO0 = input disabled 10 false false
|
||||
* - main.dig1 28 144 55 100 false
|
||||
*
|
||||
* This causes issues eg. if a password key has a whitespace or equal sign in its value.
|
||||
* As a workaround and to not break any legacy usage, we enforce to only use the
|
||||
* equal sign, if the key is "password"
|
||||
*/
|
||||
if (input.includes("password") || input.includes("Token")) { // Line contains a password, use the equal sign as the only delimiter and only split on first occurrence
|
||||
var pos = input.indexOf("=");
|
||||
delimiter = " \t\r"
|
||||
Output.push(trim(input.substr(0, pos), delimiter));
|
||||
Output.push(trim(input.substr(pos +1, input.length), delimiter));
|
||||
}
|
||||
else { // Legacy Mode
|
||||
input = trim(input, delimiter);
|
||||
var pos = findDelimiterPos(input, delimiter);
|
||||
var token;
|
||||
|
||||
while (pos > -1) {
|
||||
token = input.substr(0, pos);
|
||||
token = trim(token, delimiter);
|
||||
Output.push(token);
|
||||
input = input.substr(pos+1, input.length);
|
||||
input = trim(input, delimiter);
|
||||
pos = findDelimiterPos(input, delimiter);
|
||||
}
|
||||
|
||||
Output.push(input);
|
||||
}
|
||||
|
||||
return Output;
|
||||
}
|
||||
return Output;
|
||||
}
|
||||
|
||||
|
||||
function findDelimiterPos(input, delimiter)
|
||||
{
|
||||
var pos = -1;
|
||||
var zw;
|
||||
var akt_del;
|
||||
function findDelimiterPos(input, delimiter) {
|
||||
var pos = -1;
|
||||
var zw;
|
||||
var akt_del;
|
||||
|
||||
for (var anz = 0; anz < delimiter.length; ++anz)
|
||||
{
|
||||
akt_del = delimiter[anz];
|
||||
zw = input.indexOf(akt_del);
|
||||
if (zw > -1)
|
||||
{
|
||||
if (pos > -1)
|
||||
{
|
||||
if (zw < pos)
|
||||
pos = zw;
|
||||
}
|
||||
else
|
||||
pos = zw;
|
||||
}
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
for (var anz = 0; anz < delimiter.length; ++anz) {
|
||||
akt_del = delimiter[anz];
|
||||
zw = input.indexOf(akt_del);
|
||||
|
||||
if (zw > -1) {
|
||||
if (pos > -1) {
|
||||
if (zw < pos) {
|
||||
pos = zw;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pos = zw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
function trim(istring, adddelimiter)
|
||||
{
|
||||
while ((istring.length > 0) && (adddelimiter.indexOf(istring[0]) >= 0)){
|
||||
istring = istring.substr(1, istring.length-1);
|
||||
}
|
||||
function trim(istring, adddelimiter) {
|
||||
while ((istring.length > 0) && (adddelimiter.indexOf(istring[0]) >= 0)) {
|
||||
istring = istring.substr(1, istring.length-1);
|
||||
}
|
||||
|
||||
while ((istring.length > 0) && (adddelimiter.indexOf(istring[istring.length-1]) >= 0)){
|
||||
istring = istring.substr(0, istring.length-1);
|
||||
}
|
||||
while ((istring.length > 0) && (adddelimiter.indexOf(istring[istring.length-1]) >= 0)) {
|
||||
istring = istring.substr(0, istring.length-1);
|
||||
}
|
||||
|
||||
return istring;
|
||||
}
|
||||
return istring;
|
||||
}
|
||||
|
||||
|
||||
function getConfig()
|
||||
{
|
||||
return config_gesamt;
|
||||
function getConfig() {
|
||||
return config_gesamt;
|
||||
}
|
||||
|
||||
|
||||
function loadConfig(_domainname)
|
||||
{
|
||||
var xhttp = new XMLHttpRequest();
|
||||
try {
|
||||
url = _domainname + '/fileserver/config/config.ini';
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
config_gesamt = xhttp.responseText;
|
||||
config_gesamt = config_gesamt.replace("InitalRotate", "InitialRotate"); // Korrigiere Schreibfehler in config.ini !!!!!
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// firework.launch('Deleting Config.ini failed!', 'danger', 30000);
|
||||
}
|
||||
return true;
|
||||
function loadConfig(_domainname) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
url = _domainname + '/fileserver/config/config.ini';
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
config_gesamt = xhttp.responseText;
|
||||
config_gesamt = config_gesamt.replace("InitalRotate", "InitialRotate"); // Korrigiere Schreibfehler in config.ini !!!!!
|
||||
} catch (error) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function dataURLtoBlob(dataurl)
|
||||
{
|
||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
||||
function dataURLtoBlob(dataurl) {
|
||||
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
||||
while(n--){
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new Blob([u8arr], {type:mime});
|
||||
|
||||
while(n--){
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
|
||||
return new Blob([u8arr], {type:mime});
|
||||
}
|
||||
|
||||
|
||||
function FileCopyOnServer(_source, _target, _domainname = ""){
|
||||
url = _domainname + "/editflow?task=copy&in=" + _source + "&out=" + _target;
|
||||
var xhttp = new XMLHttpRequest();
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send(); }
|
||||
catch (error)
|
||||
{
|
||||
// firework.launch('Deleting Config.ini failed!', 'danger', 30000);
|
||||
}
|
||||
function FileCopyOnServer(_source, _target, _domainname = "") {
|
||||
url = _domainname + "/editflow?task=copy&in=" + _source + "&out=" + _target;
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
|
||||
function FileDeleteOnServer(_filename, _domainname = ""){
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
function FileDeleteOnServer(_filename, _domainname = "") {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {
|
||||
if (xhttp.status == 200) {
|
||||
okay = true;
|
||||
} else if (xhttp.status == 0) {
|
||||
// firework.launch('Server closed the connection abruptly!', 'danger', 30000);
|
||||
// location.reload()
|
||||
} else {
|
||||
// firework.launch('An error occured: ' + xhttp.responseText, 'danger', 30000);
|
||||
// location.reload()
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
var url = _domainname + "/delete" + _filename;
|
||||
xhttp.open("POST", url, false);
|
||||
xhttp.send();
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// firework.launch('Deleting Config.ini failed!', 'danger', 30000);
|
||||
}
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {
|
||||
if (xhttp.status == 200) {
|
||||
okay = true;
|
||||
}
|
||||
else if (xhttp.status == 0) {
|
||||
// firework.launch('Server closed the connection abruptly!', 'danger', 30000);
|
||||
// location.reload()
|
||||
}
|
||||
else {
|
||||
// firework.launch('An error occured: ' + xhttp.responseText, 'danger', 30000);
|
||||
// location.reload()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
var url = _domainname + "/delete" + _filename;
|
||||
xhttp.open("POST", url, false);
|
||||
xhttp.send();
|
||||
} catch (error) {}
|
||||
|
||||
return okay;
|
||||
return okay;
|
||||
}
|
||||
|
||||
|
||||
function FileSendContent(_content, _filename, _domainname = ""){
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
function FileSendContent(_content, _filename, _domainname = "") {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var okay = false;
|
||||
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {
|
||||
if (xhttp.status == 200) {
|
||||
okay = true;
|
||||
} else if (xhttp.status == 0) {
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (xhttp.readyState == 4) {
|
||||
if (xhttp.status == 200) {
|
||||
okay = true;
|
||||
}
|
||||
else if (xhttp.status == 0) {
|
||||
firework.launch('Server closed the connection abruptly!', 'danger', 30000);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
firework.launch('An error occured: ' + xhttp.responseText, 'danger', 30000);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
upload_path = _domainname + "/upload" + _filename;
|
||||
xhttp.open("POST", upload_path, false);
|
||||
xhttp.send(_content);
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// firework.launch('Deleting Config.ini failed!', 'danger', 30000);
|
||||
}
|
||||
try {
|
||||
upload_path = _domainname + "/upload" + _filename;
|
||||
xhttp.open("POST", upload_path, false);
|
||||
xhttp.send(_content);
|
||||
} catch (error) {}
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
|
||||
function MakeRefImageZW(zw, _enhance, _domainname){
|
||||
var _filename = zw["name"].replace("/config/", "/img_tmp/");
|
||||
var _filename = zw["name"].replace("/config/", "/img_tmp/");
|
||||
|
||||
var url = _domainname + "/editflow?task=cutref&in=/config/reference.jpg&out=" + _filename + "&x=" + zw["x"] + "&y=" + zw["y"] + "&dx=" + zw["dx"] + "&dy=" + zw["dy"];
|
||||
var url = _domainname + "/editflow?task=cutref&in=/config/reference.jpg&out=" + _filename + "&x=" + zw["x"] + "&y=" + zw["y"] + "&dx=" + zw["dx"] + "&dy=" + zw["dy"];
|
||||
|
||||
if (_enhance == true){
|
||||
url = url + "&enhance=true";
|
||||
}
|
||||
if (_enhance == true){
|
||||
url = url + "&enhance=true";
|
||||
}
|
||||
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var xhttp = new XMLHttpRequest();
|
||||
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error){}
|
||||
try {
|
||||
xhttp.open("GET", url, false);
|
||||
xhttp.send();
|
||||
} catch (error){}
|
||||
|
||||
if (xhttp.responseText == "CutImage Done") {
|
||||
firework.launch('Image Contrast got enhanced', 'success', 5000);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
if (xhttp.responseText == "CutImage Done") {
|
||||
firework.launch('Image Contrast got enhanced', 'success', 5000);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user