edit_config_param.html 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Edit Config</title>
  5. <meta charset="utf-8">
  6. <style>
  7. h1 {font-size: 2em;}
  8. h2 {font-size: 1.5em; margin-block-start: 0.0em; margin-block-end: 0.2em;}
  9. h3 {font-size: 1.2em;}
  10. p {font-size: 1em;}
  11. .button {
  12. padding: 5px 20px;
  13. width: 211px;
  14. font-size: 16px;
  15. }
  16. textarea {
  17. font-size: 14px;
  18. }
  19. </style>
  20. </head>
  21. <body style="font-family: arial; padding: 0px 10px;">
  22. <table style="width:100%">
  23. <tr>
  24. <td>
  25. <h2>Config.ini:</h2>
  26. </td>
  27. <td>
  28. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  29. <input type="checkbox" id="ExpertModus_enabled" value="1" onclick = 'UpdateExpertModus()' unchecked><label for="ExpertModus_enabled"> Expertenmodus </label>
  30. </td>
  31. </tr>
  32. </table>
  33. <br>
  34. <div id = "divall" style="display:none">
  35. <table>
  36. <tr>
  37. <th width="20px" style="text-align: left;">
  38. Enable
  39. </th>
  40. <th width="200px" style="text-align: left;">
  41. Parameter
  42. </th>
  43. <th style="text-align: left;">
  44. Value
  45. </th>
  46. <th style="text-align: left;">
  47. Information
  48. </th>
  49. </tr>
  50. <tr>
  51. <td colspan="4" style="padding-left: 20px;"><h4>MakeImage</h4></td>
  52. </tr>
  53. <tr>
  54. <td width="20px" style="padding-left: 40px;">
  55. <input type="checkbox" id="MakeImage_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogImageLocation")' unchecked >
  56. </td>
  57. <td width="200px">
  58. <class id="MakeImage_LogImageLocation_text" style="color:black;">LogImageLocation</class>
  59. </td>
  60. <td>
  61. <input type="text" name="name" id="MakeImage_LogImageLocation_value1">
  62. </td>
  63. <td style="font-size: 80%;">
  64. Location to store raw images for logging
  65. </td>
  66. </tr>
  67. <tr>
  68. <td width="20px" style="padding-left: 40px;">
  69. <td"><input type="checkbox" id="MakeImage_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogfileRetentionInDays")' unchecked ></td>
  70. </td>
  71. <td>
  72. <class id="MakeImage_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  73. </td>
  74. <td>
  75. <input type="number" id="MakeImage_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  76. </td>
  77. <td style="font-size: 80%;">
  78. Time to keep the raw image (in days -"0" = forever)
  79. </td>
  80. </tr>
  81. <tr class="expert" id="ex1">
  82. <td width="20px" style="padding-left: 40px;">
  83. </td>
  84. <td>
  85. <class id="MakeImage_WaitBeforeTakingPicture_text" style="color:black;">WaitBeforeTakingPicture</class>
  86. </td>
  87. <td>
  88. <input type="number" id="MakeImage_WaitBeforeTakingPicture_value1" size="13" min="0" step="any">
  89. </td>
  90. <td style="font-size: 80%;">
  91. Wait time between illumination switch on and take the picture (in seconds)
  92. </td>
  93. </tr>
  94. <tr class="expert" id="ex2">
  95. <td width="20px" style="padding-left: 40px;">
  96. </td>
  97. <td>
  98. <class id="MakeImage_ImageQuality_text" style="color:black;">ImageQuality</class>
  99. </td>
  100. <td>
  101. <input type="number" id="MakeImage_ImageQuality_value1" size="13" min="0" max="63">
  102. </td>
  103. <td style="font-size: 80%;">
  104. Quality index for picture (default = "5" - "0" high ... "63" low)
  105. </td>
  106. </tr>
  107. <tr class="expert" id="ex3">
  108. <td width="20px" style="padding-left: 40px;">
  109. </td>
  110. <td>
  111. <class id="MakeImage_ImageSize_text" style="color:black;">ImageSize</class>
  112. </td>
  113. <td>
  114. <select id="MakeImage_ImageSize_value1">
  115. <option value="0" selected>VGA</option>
  116. <option value="1" >QVGA</option>
  117. </select>
  118. </td>
  119. <td style="font-size: 80%;">
  120. Picture size camera (default = "VGA")
  121. </td>
  122. </tr>
  123. <tr class="expert" id="Brightness_ex3">
  124. <td width="20px" style="padding-left: 40px;">
  125. </td>
  126. <td>
  127. <class id="MakeImage_Brightness_text" style="color:black;">Brightness</class>
  128. </td>
  129. <td>
  130. <input type="number" id="MakeImage_Brightness_value1" size="13" min="-2" max="2">
  131. </td>
  132. <td style="font-size: 80%;">
  133. Image Brightness (-2 .. 2 - default = "0")
  134. </td>
  135. </tr>
  136. <tr class="expert" id="MakeImage_FixedExposure_ex10">
  137. <td width="20px" style="padding-left: 40px;">
  138. </td>
  139. <td width="200px">
  140. <class id="MakeImage_FixedExposure_text" style="color:black;">FixedExposure</class>
  141. </td>
  142. <td>
  143. <select id="MakeImage_FixedExposure_value1">
  144. <option value="0" selected>true</option>
  145. <option value="1" >false</option>
  146. </select>
  147. </td>
  148. <td style="font-size: 80%;">
  149. Fixes the illumination setting of camera at the startup and uses this later --> individual round is faster
  150. </td>
  151. </tr>
  152. <!--
  153. <tr class="expert" id="Contrast_ex3">
  154. <td width="20px" style="padding-left: 40px;">
  155. </td>
  156. <td>
  157. <class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
  158. </td>
  159. <td>
  160. <input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
  161. </td>
  162. <td style="font-size: 80%;">
  163. Image Contrast (-2 .. 2 - default = "0")
  164. </td>
  165. </tr>
  166. <tr class="expert" id="Saturation_ex3">
  167. <td width="20px" style="padding-left: 40px;">
  168. </td>
  169. <td>
  170. <class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
  171. </td>
  172. <td>
  173. <input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
  174. </td>
  175. <td style="font-size: 80%;">
  176. Image Saturation (-2 .. 2 - default = "0")
  177. </td>
  178. </tr>
  179. -->
  180. <tr class="expert" id="ex4">
  181. <td colspan="4" style="padding-left: 20px;"><h4>Alignment</h4></td>
  182. </tr>
  183. <tr class="expert" id="ex6">
  184. <td width="20px" style="padding-left: 40px;">
  185. </td>
  186. <td width="200px">
  187. <class id="Alignment_SearchFieldX_text" style="color:black;">SearchFieldX</class>
  188. </td>
  189. <td>
  190. <input type="number" name="name" id="Alignment_SearchFieldX_value1" size="13" min="1" step="1">
  191. </td>
  192. <td style="font-size: 80%;">
  193. x size (width) in which the reference is searched (default = "20")
  194. </td>
  195. </tr>
  196. <tr class="expert" id="ex8">
  197. <td width="20px" style="padding-left: 40px;">
  198. </td>
  199. <td>
  200. <class id="Alignment_SearchFieldY_text" style="color:black;">SearchFieldY</class>
  201. </td>
  202. <td>
  203. <input type="number" name="name" id="Alignment_SearchFieldY_value1" size="13" min="1">
  204. </td>
  205. <td style="font-size: 80%;">
  206. y size (height) in which the reference is searched (default = "20")
  207. </td>
  208. </tr>
  209. <tr class="expert" id="AlignmentAlgo_ex8">
  210. <td width="20px" style="padding-left: 40px;">
  211. <input type="checkbox" id="Alignment_AlignmentAlgo_enabled" value="1" onclick = 'InvertEnableItem("Alignment", "AlignmentAlgo")' unchecked >
  212. </td>
  213. <td>
  214. <class id="Alignment_AlignmentAlgo_text" style="color:black;">AlignmentAlgo</class>
  215. </td>
  216. <td>
  217. <select id="Alignment_AlignmentAlgo_value1">
  218. <option value="0" selected>Default</option>
  219. <option value="1" >HighAccurity</option>
  220. <option value="2" >Fast</option>
  221. </select>
  222. </td>
  223. <td style="font-size: 80%;">
  224. "Default" = use only R-Channel, "HighAccurity" = use all Channels (RGB, 3x slower), <br> "Fast" (First time RGB, then only check if image is shifted)
  225. </td>
  226. </tr>
  227. <tr id="Category_Digits_ex4">
  228. <td colspan="4" style="padding-left: 20px;">
  229. <h4><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >Digits</h4></td>
  230. </tr>
  231. <tr>
  232. <td width="20px" style="padding-left: 40px;">
  233. </td>
  234. <td width="200px">
  235. <class id="Digits_Model_text" style="color:black;">Model</class>
  236. </td>
  237. <td>
  238. <input type="text" id="Digits_Model_value1">
  239. </td>
  240. <td style="font-size: 80%;">
  241. path to CNN model file for image recognition
  242. </td>
  243. </tr>
  244. <tr>
  245. <td width="20px" style="padding-left: 40px;">
  246. <input type="checkbox" id="Digits_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogImageLocation")' unchecked >
  247. </td>
  248. <td>
  249. <class id="Digits_LogImageLocation_text" style="color:black;">LogImageLocation</class>
  250. </td>
  251. <td>
  252. <input type="text" name="name" id="Digits_LogImageLocation_value1">
  253. </td>
  254. <td style="font-size: 80%;">
  255. Location to store separated digits for logging
  256. </td>
  257. </tr>
  258. <tr>
  259. <td width="20px" style="padding-left: 40px;">
  260. <td"><input type="checkbox" id="Digits_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogfileRetentionInDays")' unchecked ></td>
  261. </td>
  262. <td>
  263. <class id="Digits_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  264. </td>
  265. <td>
  266. <input type="number" id="Digits_LogfileRetentionInDays_value1" min="0" step="1">
  267. </td>
  268. <td style="font-size: 80%;">
  269. Time to keep the separated digit images (in days -"0" = forever)
  270. </td>
  271. </tr>
  272. <tr class="expert" id="ex9">
  273. <td width="20px" style="padding-left: 40px;">
  274. </td>
  275. <td>
  276. <class id="Digits_ModelInputSize_text" style="color:black;">ModelInputSize</class>
  277. </td>
  278. <td>
  279. x: <input type="number" id="Digits_ModelInputSize_value1" style="width: 30px;" min="1" step="1">
  280. y: <input type="number" id="Digits_ModelInputSize_value2" style="width: 30px;" min="1" step="1">
  281. </td>
  282. <td style="font-size: 80%;">
  283. Size of the input image for the CNN model
  284. </td>
  285. </tr>
  286. <tr class="expert" id="ex4">
  287. <td colspan="4" style="padding-left: 20px;">
  288. <h4><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked > Analog</h4></td>
  289. </tr>
  290. <tr>
  291. <td width="20px" style="padding-left: 40px;"> </td>
  292. <td width="200px"> <class id="Analog_Model_text" style="color:black;">Model</class> </td>
  293. <td> <input type="text" id="Analog_Model_value1"> </td>
  294. <td style="font-size: 80%;"> path to CNN model file for image recognition</td>
  295. </tr>
  296. <tr>
  297. <td width="20px" style="padding-left: 40px;">
  298. <input type="checkbox" id="Analog_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogImageLocation")' unchecked >
  299. </td>
  300. <td> <class id="Analog_LogImageLocation_text" style="color:black;">LogImageLocation</class> </td>
  301. <td> <input type="text" name="name" id="Analog_LogImageLocation_value1"> </td>
  302. <td style="font-size: 80%;"> Location to store separated digits for logging </td>
  303. </tr>
  304. <tr>
  305. <td width="20px" style="padding-left: 40px;">
  306. <td"><input type="checkbox" id="Analog_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogfileRetentionInDays")' unchecked ></td>
  307. </td>
  308. <td> <class id="Analog_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class> </td>
  309. <td> <input type="number" id="Analog_LogfileRetentionInDays_value1" min="0" step="1"> </td>
  310. <td style="font-size: 80%;"> Time to keep the separated digit images (in days -"0" = forever) </td>
  311. </tr>
  312. <tr class="expert" id="Analog_ExtendedResolution_ex10">
  313. <td width="20px" style="padding-left: 40px;">
  314. <input type="checkbox" id="Analog_ExtendedResolution_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ExtendedResolution")' unchecked >
  315. </td>
  316. <td width="200px">
  317. <class id="Analog_ExtendedResolution_text" style="color:black;">ExtendedResolution</class>
  318. </td>
  319. <td>
  320. <select id="Analog_ExtendedResolution_value1">
  321. <option value="0" selected>true</option>
  322. <option value="1" >false</option>
  323. </select>
  324. </td>
  325. <td style="font-size: 80%;">
  326. Enable to use the after point resolution for the last analog counter
  327. </td>
  328. </tr>
  329. ExtendedResolution
  330. <tr class="expert" id="ex10">
  331. <td width="20px" style="padding-left: 40px;"> </td>
  332. <td> <class id="Analog_ModelInputSize_text" style="color:black;">ModelInputSize</class> </td>
  333. <td>
  334. x: <input type="number" id="Analog_ModelInputSize_value1" style="width: 30px;" min="1" step="1">
  335. y: <input type="number" id="Analog_ModelInputSize_value2" style="width: 30px;" min="1" step="1">
  336. </td>
  337. <td style="font-size: 80%;"> Size of the input image for the CNN model </td>
  338. </tr>
  339. <tr>
  340. <td colspan="4" style="padding-left: 20px;"><h4>PostProcessing</h4></td>
  341. </tr>
  342. <tr>
  343. <td width="20px" style="padding-left: 40px;">
  344. <input type="checkbox" id="PostProcessing_DecimalShift_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "DecimalShift")' unchecked >
  345. </td>
  346. <td width="200px">
  347. <class id="PostProcessing_DecimalShift_text" style="color:black;">DecimalShift</class>
  348. </td>
  349. <td>
  350. <input type="number" id="PostProcessing_DecimalShift_value1" step="1">
  351. </td>
  352. <td style="font-size: 80%;">
  353. shift the digit separator within the digital digits (positiv and negativ)
  354. </td>
  355. </tr>
  356. <tr>
  357. <td width="20px" style="padding-left: 40px;">
  358. <input type="checkbox" id="PostProcessing_PreValueUse_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueUse")' unchecked >
  359. </td>
  360. <td width="200px">
  361. <class id="PostProcessing_PreValueUse_text" style="color:black;">PreValueUse</class>
  362. </td>
  363. <td>
  364. <select id="PostProcessing_PreValueUse_value1">
  365. <option value="0" selected>true</option>
  366. <option value="1" >false</option>
  367. </select>
  368. </td>
  369. <td style="font-size: 80%;">
  370. Enable to use the previous read value for consistency checks - also on reboots
  371. </td>
  372. </tr>
  373. <tr class="expert" id="ex11">
  374. <td width="20px" style="padding-left: 40px;">
  375. <input type="checkbox" id="PostProcessing_PreValueAgeStartup_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueAgeStartup")' unchecked >
  376. </td>
  377. <td width="200px">
  378. <class id="PostProcessing_PreValueAgeStartup_text" style="color:black;">PreValueAgeStartup</class>
  379. </td>
  380. <td>
  381. <input type="number" id="PostProcessing_PreValueAgeStartup_value1" size="13" min="0">
  382. </td>
  383. <td style="font-size: 80%;">
  384. Time (in minutes), how long a previous read value is valid after reboot (default = 720 min)
  385. </td>
  386. </tr>
  387. <tr>
  388. <td width="20px" style="padding-left: 40px;">
  389. <input type="checkbox" id="PostProcessing_AllowNegativeRates_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AllowNegativeRates")' unchecked >
  390. </td>
  391. <td width="200px">
  392. <class id="PostProcessing_AllowNegativeRates_text" style="color:black;">AllowNegativeRates</class>
  393. </td>
  394. <td>
  395. <select id="PostProcessing_AllowNegativeRates_value1">
  396. <option value="0" selected>true</option>
  397. <option value="1" >false</option>
  398. </select>
  399. </td>
  400. <td style="font-size: 80%;">
  401. Set on "false" to ensure, that only positive changes are accepted (typically for counter)
  402. </td>
  403. </tr>
  404. <tr>
  405. <td width="20px" style="padding-left: 40px;">
  406. <input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
  407. </td>
  408. <td width="200px">
  409. <class id="PostProcessing_MaxRateValue_text" style="color:black;">MaxRateValue</class>
  410. </td>
  411. <td>
  412. <input type="number" id="PostProcessing_MaxRateValue_value1" size="13" min="0" step="any">
  413. </td>
  414. <td style="font-size: 80%;">
  415. Maximum change of reading from one to the next readout
  416. </td>
  417. </tr>
  418. <tr class="expert" id="ex12">
  419. <td width="20px" style="padding-left: 40px;">
  420. <input type="checkbox" id="PostProcessing_ErrorMessage_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ErrorMessage")' unchecked >
  421. </td>
  422. <td width="200px">
  423. <class id="PostProcessing_ErrorMessage_text" style="color:black;">ErrorMessage</class>
  424. </td>
  425. <td>
  426. <select id="PostProcessing_ErrorMessage_value1">
  427. <option value="0" selected>true</option>
  428. <option value="1" >false</option>
  429. </select>
  430. </td>
  431. <td style="font-size: 80%;">
  432. Do not show error message in return value - in error case, the last valid number will be send out
  433. </td>
  434. </tr>
  435. <tr>
  436. <td width="20px" style="padding-left: 40px;">
  437. <input type="checkbox" id="PostProcessing_CheckDigitIncreaseConsistency_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "CheckDigitIncreaseConsistency")' unchecked >
  438. </td>
  439. <td width="200px">
  440. <class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">CheckDigitIncreaseConsistency</class>
  441. </td>
  442. <td>
  443. <select id="PostProcessing_CheckDigitIncreaseConsistency_value1">
  444. <option value="0" selected>true</option>
  445. <option value="1" >false</option>
  446. </select>
  447. </td>
  448. <td style="font-size: 80%;">
  449. Activate to enalbe additional consistency check - especially zero crossing check between digits
  450. </td>
  451. </tr>
  452. <tr>
  453. <td colspan="4" style="padding-left: 20px;"><h4><input type="checkbox" id="Category_MQTT_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked > MQTT</h4></td>
  454. </tr>
  455. <tr>
  456. <td width="20px" style="padding-left: 40px;">
  457. <input type="checkbox" id="MQTT_Uri_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "Uri")' unchecked >
  458. </td>
  459. <td width="200px">
  460. <class id="MQTT_Uri_text" style="color:black;">Uri</class>
  461. </td>
  462. <td>
  463. <input type="text" id="MQTT_Uri_value1">
  464. </td>
  465. <td style="font-size: 80%;">
  466. URI to the MQTT broker including port e.g.: mqtt://IP-Address:Port
  467. </td>
  468. </tr>
  469. <tr>
  470. <td width="20px" style="padding-left: 40px;">
  471. <input type="checkbox" id="MQTT_Topic_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "Topic")' unchecked >
  472. </td>
  473. <td width="200px">
  474. <class id="MQTT_Topic_text" style="color:black;">Topic</class>
  475. </td>
  476. <td>
  477. <input type="text" id="MQTT_Topic_value1">
  478. </td>
  479. <td style="font-size: 80%;">
  480. MQTT topic, in which the value is registered
  481. </td>
  482. </tr>
  483. <tr>
  484. <td width="20px" style="padding-left: 40px;">
  485. <input type="checkbox" id="MQTT_TopicError_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "TopicError")' unchecked >
  486. </td>
  487. <td width="200px">
  488. <class id="MQTT_TopicError_text" style="color:black;">TopicError</class>
  489. </td>
  490. <td>
  491. <input type="text" id="MQTT_TopicError_value1">
  492. </td>
  493. <td style="font-size: 80%;">
  494. MQTT topic, in which the error status is reported (empty = no error)
  495. </td>
  496. </tr>
  497. <tr>
  498. <td width="20px" style="padding-left: 40px;">
  499. <input type="checkbox" id="MQTT_ClientID_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "ClientID")' unchecked >
  500. </td>
  501. <td width="200px">
  502. <class id="MQTT_ClientID_text" style="color:black;">ClientID</class>
  503. </td>
  504. <td>
  505. <input type="text" id="MQTT_ClientID_value1">
  506. </td>
  507. <td style="font-size: 80%;">
  508. ClientID to connect to the MQTT broker
  509. </td>
  510. </tr>
  511. <tr>
  512. <td width="20px" style="padding-left: 40px;">
  513. <input type="checkbox" id="MQTT_user_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "user")' unchecked >
  514. </td>
  515. <td width="200px">
  516. <class id="MQTT_user_text" style="color:black;">user</class>
  517. </td>
  518. <td>
  519. <input type="text" id="MQTT_user_value1">
  520. </td>
  521. <td style="font-size: 80%;">
  522. user for MQTT authentication
  523. </td>
  524. </tr>
  525. <tr>
  526. <td width="20px" style="padding-left: 40px;">
  527. <input type="checkbox" id="MQTT_password_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "password")' unchecked >
  528. </td>
  529. <td width="200px">
  530. <class id="MQTT_password_text" style="color:black;">password</class>
  531. </td>
  532. <td>
  533. <input type="text" id="MQTT_password_value1">
  534. </td>
  535. <td style="font-size: 80%;">
  536. password for MQTT authentication
  537. </td>
  538. </tr>
  539. <tr>
  540. <td colspan="4" style="padding-left: 20px;"><h4>AutoTimer</h4></td>
  541. </tr>
  542. <tr class="expert" id="ex13">
  543. <td width="20px" style="padding-left: 40px;">
  544. </td>
  545. <td width="200px">
  546. <class id="AutoTimer_AutoStart_text" style="color:black;">AutoStart</class>
  547. </td>
  548. <td>
  549. <select id="AutoTimer_AutoStart_value1">
  550. <option value="0" selected>true</option>
  551. <option value="1" >false</option>
  552. </select>
  553. </td>
  554. <td style="font-size: 80%;">
  555. Start the image recognition immediatly after power up. false is basically for debugging.
  556. </td>
  557. </tr>
  558. <tr>
  559. <td width="20px" style="padding-left: 40px;">
  560. </td>
  561. <td width="200px">
  562. <class id="AutoTimer_Intervall_text" style="color:black;">Intervall</class>
  563. </td>
  564. <td>
  565. <input type="number" id="AutoTimer_Intervall_value1" size="13" min="3" step="any">
  566. </td>
  567. <td style="font-size: 80%;">
  568. Intervall in which the counter is read (in minutes). Number must be greater than 3 minutes.
  569. </td>
  570. </tr>
  571. <tr>
  572. <td colspan="4" style="padding-left: 20px;"><h4>Debug</h4></td>
  573. </tr>
  574. <tr>
  575. <td width="20px" style="padding-left: 40px;">
  576. <input type="checkbox" id="Debug_Logfile_enabled" value="1" onclick = 'InvertEnableItem("Debug", "Logfile")' unchecked >
  577. </td>
  578. <td width="200px">
  579. <class id="Debug_Logfile_text" style="color:black;">Logfile</class>
  580. </td>
  581. <td>
  582. <select id="Debug_Logfile_value1">
  583. <option value="0" selected>true</option>
  584. <option value="1" >false</option>
  585. </select>
  586. </td>
  587. <td style="font-size: 80%;">
  588. Turn on/off the extended logging
  589. </td>
  590. </tr>
  591. <tr>
  592. <td width="20px" style="padding-left: 40px;">
  593. <td"><input type="checkbox" id="Debug_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Debug", "LogfileRetentionInDays")' unchecked ></td>
  594. </td>
  595. <td>
  596. <class id="Debug_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  597. </td>
  598. <td>
  599. <input type="number" id="Debug_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  600. </td>
  601. <td style="font-size: 80%;">
  602. Time to keep the log files (in days - "0" = forever)
  603. </td>
  604. </tr>
  605. <tr>
  606. <td colspan="4" style="padding-left: 20px;"><h4>System</h4></td>
  607. </tr>
  608. <tr>
  609. <td width="20px" style="padding-left: 40px;">
  610. <td"><input type="checkbox" id="System_TimeZone_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeZone")' unchecked ></td>
  611. </td>
  612. <td>
  613. <class id="System_TimeZone_text" style="color:black;">TimeZone</class>
  614. </td>
  615. <td>
  616. <input type="text" id="System_TimeZone_value1">
  617. </td>
  618. <td style="font-size: 80%;">
  619. Time zone in POSIX syntax (Europe/Berlin = "CET-1CEST,M3.5.0,M10.5.0/3" - incl. daylight saving)
  620. </td>
  621. </tr>
  622. <tr class="expert" id="ex16">
  623. <td width="20px" style="padding-left: 40px;">
  624. <td"><input type="checkbox" id="System_TimeServer_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeServer")' unchecked ></td>
  625. </td>
  626. <td>
  627. <class id="System_TimeServer_text" style="color:black;">TimeServer</class>
  628. </td>
  629. <td>
  630. <input type="text" id="System_TimeServer_value1">
  631. </td>
  632. <td style="font-size: 80%;">
  633. Time server to synchronize system time (default: "pool.ntp.org" - used if nothing is specified)
  634. </td>
  635. </tr>
  636. <tr class="expert" id="System_Hostname">
  637. <td width="20px" style="padding-left: 40px;">
  638. <td"><input type="checkbox" id="System_Hostname_enabled" value="1" onclick = 'InvertEnableItem("System", "Hostname")' unchecked ></td>
  639. </td>
  640. <td>
  641. <class id="System_Hostname_text" style="color:black;">Hostname</class>
  642. </td>
  643. <td>
  644. <input type="text" id="System_Hostname_value1">
  645. </td>
  646. <td style="font-size: 80%;">
  647. Hostname for server - will be transfered to wlan.ini at next startup)
  648. </td>
  649. </tr>
  650. </table>
  651. <p>
  652. <button class="button" onclick="saveTextAsFile()">Update Config.ini</button>
  653. </p>
  654. <p>
  655. </p>
  656. <div id="doreboot">
  657. <p>
  658. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  659. <button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate updates</button>
  660. </p>
  661. </div>
  662. </div>
  663. <script type="text/javascript" src="./gethost.js"></script>
  664. <script type="text/javascript" src="./readconfigcommon.js"></script>
  665. <script type="text/javascript" src="./readconfigparam.js"></script>
  666. <script type="text/javascript">
  667. var canvas = document.getElementById('canvas'),
  668. basepath = "http://192.168.178.22";
  669. param;
  670. category;
  671. function LoadConfigNeu() {
  672. var isInitialSetup = getParameterByName('InitialSetup');
  673. if (isInitialSetup === 'true')
  674. {
  675. document.getElementById("reboot").style.display = "none";
  676. }
  677. basepath = getbasepath();
  678. if (!loadConfig(basepath)) {
  679. alert("Config.ini could not be loaded!\nPlease reload the page.");
  680. return;
  681. }
  682. loadConfig(basepath);
  683. ParseConfig();
  684. param = getConfigParameters();
  685. category = getConfigCategory();
  686. UpdateInput();
  687. UpdateExpertModus();
  688. document.getElementById("divall").style.display = '';
  689. }
  690. function getParameterByName(name, url = window.location.href) {
  691. name = name.replace(/[\[\]]/g, '\\$&');
  692. var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
  693. results = regex.exec(url);
  694. if (!results) return null;
  695. if (!results[2]) return '';
  696. return decodeURIComponent(results[2].replace(/\+/g, ' '));
  697. }
  698. function WriteParameter(_param, _category, _cat, _name, _optional, _select = false, _anzpara = 1){
  699. if (_param[_cat][_name]["found"]){
  700. if (_optional) {
  701. document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"];
  702. for (var j = 1; j <= _anzpara; ++j) {
  703. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"];
  704. }
  705. }
  706. document.getElementById(_cat+"_"+_name+"_text").style="color:black;"
  707. if (_select) {
  708. var textToFind = _param[_cat][_name]["value1"];
  709. var dd = document.getElementById(_cat+"_"+_name+"_value1");
  710. for (var i = 0; i < dd.options.length; i++) {
  711. if (dd.options[i].text.toLowerCase() === textToFind.toLowerCase()) {
  712. dd.selectedIndex = i;
  713. break;
  714. }
  715. }
  716. }
  717. else {
  718. for (var j = 1; j <= _anzpara; ++j) {
  719. document.getElementById(_cat+"_"+_name+"_value"+j).value = _param[_cat][_name]["value"+j];
  720. }
  721. }
  722. }
  723. else {
  724. if (_optional) {
  725. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  726. for (var j = 1; j <= _anzpara; ++j) {
  727. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  728. }
  729. }
  730. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  731. }
  732. ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren
  733. if (_category[_cat]["enabled"] == false)
  734. {
  735. if (_optional) {
  736. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  737. for (var j = 1; j <= _anzpara; ++j) {
  738. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  739. }
  740. }
  741. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  742. }
  743. EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional);
  744. }
  745. function InvertEnableItem(_cat, _param)
  746. {
  747. _zw = _cat + "_" + _param + "_enabled";
  748. _isOn = document.getElementById(_zw).checked;
  749. _color = "color:lightgrey;";
  750. if (_isOn) {
  751. _color = "color:black;";
  752. }
  753. _zw = _cat + "_" + _param + "_text";
  754. document.getElementById(_zw).disabled = !_isOn;
  755. document.getElementById(_zw).style = _color;
  756. if (param[_cat][_param]["anzParam"] == 2) {
  757. _color = "width: 30px;" + _color;
  758. }
  759. for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) {
  760. document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn;
  761. document.getElementById(_cat+"_"+_param+"_value"+j).style=_color;
  762. }
  763. }
  764. function EnDisableItem(_status, _param, _category, _cat, _name, _optional)
  765. {
  766. _status = _param[_cat][_name]["found"] && _category[_cat]["enabled"];
  767. _color = "color:lightgrey;";
  768. if (_status) {
  769. _color = "color:black;";
  770. }
  771. if (_optional) {
  772. document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status;
  773. document.getElementById(_cat+"_"+_name+"_enabled").style=_color;
  774. }
  775. if (!_param[_cat][_name]["enabled"]) {
  776. _status = false;
  777. _color = "color:lightgrey;";
  778. }
  779. document.getElementById(_cat+"_"+_name+"_text").disabled = !_status;
  780. document.getElementById(_cat+"_"+_name+"_text").style = _color;
  781. if (_param[_cat][_name]["anzParam"] == 2) {
  782. _color = "width: 30px;" + _color;
  783. }
  784. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  785. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status;
  786. document.getElementById(_cat+"_"+_name+"_value"+j).style=_color;
  787. }
  788. }
  789. function ReadParameter(_param, _cat, _name, _optional, _select = false){
  790. if (_param[_cat][_name]["found"]){
  791. if (_optional) {
  792. _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked;
  793. }
  794. if (_select) {
  795. var sel = document.getElementById(_cat+"_"+_name+"_value1");
  796. _param[_cat][_name]["value1"] = sel.options[sel.selectedIndex].text;
  797. }
  798. else {
  799. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  800. _param[_cat][_name]["value"+j] = document.getElementById(_cat+"_"+_name+"_value"+j).value;
  801. }
  802. }
  803. }
  804. }
  805. function UpdateInput() {
  806. document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"];
  807. document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"];
  808. document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
  809. WriteParameter(param, category, "MakeImage", "LogImageLocation", true);
  810. WriteParameter(param, category, "MakeImage", "LogfileRetentionInDays", true);
  811. WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
  812. WriteParameter(param, category, "MakeImage", "ImageQuality", false);
  813. WriteParameter(param, category, "MakeImage", "Brightness", false);
  814. // WriteParameter(param, category, "MakeImage", "Contrast", false);
  815. // WriteParameter(param, category, "MakeImage", "Saturation", false);
  816. WriteParameter(param, category, "MakeImage", "ImageSize", false, true, true);
  817. WriteParameter(param, category, "MakeImage", "FixedExposure", false, true, true);
  818. WriteParameter(param, category, "Alignment", "SearchFieldX", false);
  819. WriteParameter(param, category, "Alignment", "SearchFieldY", false);
  820. WriteParameter(param, category, "Alignment", "AlignmentAlgo", true, true, true);
  821. WriteParameter(param, category, "Digits", "Model", false);
  822. WriteParameter(param, category, "Digits", "LogImageLocation", true);
  823. WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
  824. WriteParameter(param, category, "Digits", "ModelInputSize", false, false, 2);
  825. WriteParameter(param, category, "Analog", "Model", false);
  826. WriteParameter(param, category, "Analog", "LogImageLocation", true);
  827. WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
  828. WriteParameter(param, category, "Analog", "ExtendedResolution", true, true);
  829. WriteParameter(param, category, "Analog", "ModelInputSize", false, false, 2);
  830. WriteParameter(param, category, "PostProcessing", "DecimalShift", true);
  831. WriteParameter(param, category, "PostProcessing", "PreValueUse", true, true);
  832. WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
  833. WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true, true);
  834. WriteParameter(param, category, "PostProcessing", "MaxRateValue", true);
  835. WriteParameter(param, category, "PostProcessing", "ErrorMessage", true, true);
  836. WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true, true);
  837. WriteParameter(param, category, "MQTT", "Uri", true);
  838. WriteParameter(param, category, "MQTT", "Topic", true);
  839. WriteParameter(param, category, "MQTT", "TopicError", true);
  840. WriteParameter(param, category, "MQTT", "ClientID", true);
  841. WriteParameter(param, category, "MQTT", "user", true);
  842. WriteParameter(param, category, "MQTT", "password", true);
  843. WriteParameter(param, category, "AutoTimer", "AutoStart", false, true);
  844. WriteParameter(param, category, "AutoTimer", "Intervall", false);
  845. WriteParameter(param, category, "Debug", "Logfile", true, true);
  846. WriteParameter(param, category, "Debug", "LogfileRetentionInDays", true);
  847. WriteParameter(param, category, "System", "TimeZone", true);
  848. WriteParameter(param, category, "System", "Hostname", true);
  849. WriteParameter(param, category, "System", "TimeServer", true);
  850. }
  851. function ReadParameterAll()
  852. {
  853. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  854. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  855. category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
  856. ReadParameter(param, "MakeImage", "LogImageLocation", true);
  857. ReadParameter(param, "MakeImage", "LogfileRetentionInDays", true);
  858. ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
  859. ReadParameter(param, "MakeImage", "ImageQuality", false);
  860. ReadParameter(param, "MakeImage", "Brightness", false);
  861. // ReadParameter(param, "MakeImage", "Contrast", false);
  862. // ReadParameter(param, "MakeImage", "Saturation", false);
  863. ReadParameter(param, "MakeImage", "ImageSize", false, true);
  864. ReadParameter(param, "MakeImage", "FixedExposure", false, true);
  865. ReadParameter(param, "Alignment", "SearchFieldX", false);
  866. ReadParameter(param, "Alignment", "SearchFieldY", false);
  867. ReadParameter(param, "Alignment", "AlignmentAlgo", true, true);
  868. ReadParameter(param, "Digits", "Model", false);
  869. ReadParameter(param, "Digits", "LogImageLocation", true);
  870. ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
  871. ReadParameter(param, "Digits", "ModelInputSize", false, false, 2);
  872. ReadParameter(param, "Analog", "Model", false);
  873. ReadParameter(param, "Analog", "LogImageLocation", true);
  874. ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
  875. ReadParameter(param, "Analog", "ExtendedResolution", true, true);
  876. ReadParameter(param, "Analog", "ModelInputSize", false, false, 2);
  877. ReadParameter(param, "PostProcessing", "DecimalShift", true);
  878. ReadParameter(param, "PostProcessing", "PreValueUse", true, true);
  879. ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
  880. ReadParameter(param, "PostProcessing", "AllowNegativeRates", true, true);
  881. ReadParameter(param, "PostProcessing", "MaxRateValue", true);
  882. ReadParameter(param, "PostProcessing", "ErrorMessage", true, true);
  883. ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true, true);
  884. ReadParameter(param, "MQTT", "Uri", true);
  885. ReadParameter(param, "MQTT", "Topic", true);
  886. ReadParameter(param, "MQTT", "TopicError", true);
  887. ReadParameter(param, "MQTT", "ClientID", true);
  888. ReadParameter(param, "MQTT", "user", true);
  889. ReadParameter(param, "MQTT", "password", true);
  890. ReadParameter(param, "AutoTimer", "AutoStart", false, true);
  891. ReadParameter(param, "AutoTimer", "Intervall", false);
  892. ReadParameter(param, "Debug", "Logfile", true, true);
  893. ReadParameter(param, "Debug", "LogfileRetentionInDays", true);
  894. ReadParameter(param, "System", "TimeZone", true);
  895. ReadParameter(param, "System", "Hostname", true);
  896. ReadParameter(param, "System", "TimeServer", true);
  897. FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
  898. }
  899. function WriteConfig(){
  900. ReadParameterAll();
  901. return setConfigParameters(param, category);
  902. }
  903. function FormatDecimalValue(_param, _cat, _name) {
  904. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  905. var _val = _param[_cat][_name]["value"+j];
  906. _val = _val.replace(",", ".");
  907. _param[_cat][_name]["value"+j] = _val;
  908. }
  909. }
  910. function UpdateAfterCategoryCheck() {
  911. ReadParameterAll();
  912. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  913. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  914. UpdateInput();
  915. }
  916. function UpdateExpertModus()
  917. {
  918. var _style = 'display:none;';
  919. if (document.getElementById("ExpertModus_enabled").checked) {
  920. _style = '';
  921. document.getElementById("Edit_Config_Direct").style.display = "";
  922. }
  923. else
  924. {
  925. document.getElementById("Edit_Config_Direct").style.display = "none";
  926. }
  927. const expert = document.querySelectorAll(".expert");
  928. for (var i = 0; i < expert.length; i++) {
  929. document.getElementById(expert[i].id).style = _style;
  930. }
  931. }
  932. function saveTextAsFile()
  933. {
  934. if (confirm("Are you sure you want to update \"config.ini\"?")) {
  935. var textToSave = WriteConfig();
  936. FileDeleteOnServer("/config/config.ini", basepath);
  937. FileSendContent(textToSave, "/config/config.ini", basepath);
  938. }
  939. }
  940. function doReboot() {
  941. if (confirm("Are you sure you want to reboot the ESP32?")) {
  942. var stringota = "/reboot";
  943. window.location = stringota;
  944. window.location.href = stringota;
  945. window.location.assign(stringota);
  946. window.location.replace(stringota);
  947. }
  948. }
  949. function editConfigDirect() {
  950. if (confirm("Did you save your changes?")) {
  951. var stringota = "/edit_config.html";
  952. window.location = stringota;
  953. window.location.href = stringota;
  954. window.location.assign(stringota);
  955. window.location.replace(stringota);
  956. }
  957. }
  958. LoadConfigNeu();
  959. </script>
  960. </body>
  961. </html>