edit_config_param.html 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369
  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. .description {
  20. color: black;
  21. font-size: 80%;
  22. }
  23. .disabled {
  24. color:lightgrey;
  25. }
  26. .smallSelect {
  27. width: 30px;
  28. }
  29. .invalid-input {
  30. background-color: #FFAA00;
  31. }
  32. </style>
  33. </head>
  34. <body style="font-family: arial; padding: 0px 10px;">
  35. <table style="width:100%">
  36. <tr>
  37. <td>
  38. <h2>Config.ini:</h2>
  39. </td>
  40. <td>
  41. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  42. <input type="checkbox" id="ExpertModus_enabled" value="1" onclick = 'UpdateExpertModus()' unchecked><label for="ExpertModus_enabled"> Expertenmodus </label>
  43. </td>
  44. </tr>
  45. </table>
  46. <br>
  47. <div id = "divall" style="display:none">
  48. <table>
  49. <tr>
  50. <th width="20px" style="text-align: left;">
  51. Enable
  52. </th>
  53. <th width="200px" style="text-align: left;">
  54. Parameter
  55. </th>
  56. <th style="text-align: left;">
  57. Value
  58. </th>
  59. <th style="text-align: left;">
  60. Information
  61. </th>
  62. </tr>
  63. <tr>
  64. <td colspan="4" style="padding-left: 20px;"><h4>MakeImage</h4></td>
  65. </tr>
  66. <tr>
  67. <td width="20px" style="padding-left: 40px;">
  68. <input type="checkbox" id="MakeImage_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogImageLocation")' unchecked >
  69. </td>
  70. <td width="200px">
  71. <class id="MakeImage_LogImageLocation_text" style="color:black;">LogImageLocation</class>
  72. </td>
  73. <td>
  74. <input type="text" name="name" id="MakeImage_LogImageLocation_value1">
  75. </td>
  76. <td class="description">
  77. Location to store raw images for logging
  78. </td>
  79. </tr>
  80. <tr>
  81. <td width="20px" style="padding-left: 40px;">
  82. <td"><input type="checkbox" id="MakeImage_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("MakeImage", "LogfileRetentionInDays")' unchecked ></td>
  83. </td>
  84. <td>
  85. <class id="MakeImage_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  86. </td>
  87. <td>
  88. <input type="number" id="MakeImage_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  89. </td>
  90. <td class="description">
  91. Time to keep the raw image (in days -"0" = forever)
  92. </td>
  93. </tr>
  94. <tr class="expert" id="ex1">
  95. <td width="20px" style="padding-left: 40px;">
  96. </td>
  97. <td>
  98. <class id="MakeImage_WaitBeforeTakingPicture_text" style="color:black;">WaitBeforeTakingPicture</class>
  99. </td>
  100. <td>
  101. <input type="number" id="MakeImage_WaitBeforeTakingPicture_value1" size="13" min="0" step="any">
  102. </td>
  103. <td class="description">
  104. Wait time between illumination switch on and take the picture (in seconds)
  105. </td>
  106. </tr>
  107. <tr class="expert" id="ex2">
  108. <td width="20px" style="padding-left: 40px;">
  109. </td>
  110. <td>
  111. <class id="MakeImage_ImageQuality_text" style="color:black;">ImageQuality</class>
  112. </td>
  113. <td>
  114. <input type="number" id="MakeImage_ImageQuality_value1" size="13" min="0" max="63">
  115. </td>
  116. <td class="description">
  117. Quality index for picture (default = "5" - "0" high ... "63" low)
  118. </td>
  119. </tr>
  120. <tr class="expert" id="ex3">
  121. <td width="20px" style="padding-left: 40px;">
  122. </td>
  123. <td>
  124. <class id="MakeImage_ImageSize_text" style="color:black;">ImageSize</class>
  125. </td>
  126. <td>
  127. <select id="MakeImage_ImageSize_value1">
  128. <option value="VGA" selected>VGA</option>
  129. <option value="QVGA" >QVGA</option>
  130. </select>
  131. </td>
  132. <td class="description">
  133. Picture size camera (default = "VGA")
  134. </td>
  135. </tr>
  136. <tr class="expert" id="Brightness_ex3">
  137. <td width="20px" style="padding-left: 40px;">
  138. </td>
  139. <td>
  140. <class id="MakeImage_Brightness_text" style="color:black;">Brightness</class>
  141. </td>
  142. <td>
  143. <input type="number" id="MakeImage_Brightness_value1" size="13" min="-2" max="2">
  144. </td>
  145. <td style="font-size: 80%;">
  146. Image Brightness (-2 .. 2 - default = "0")
  147. </td>
  148. </tr>
  149. <tr class="expert" id="MakeImage_FixedExposure_ex10">
  150. <td width="20px" style="padding-left: 40px;">
  151. </td>
  152. <td width="200px">
  153. <class id="MakeImage_FixedExposure_text" style="color:black;">FixedExposure</class>
  154. </td>
  155. <td>
  156. <select id="MakeImage_FixedExposure_value1">
  157. <option value="true" selected>true</option>
  158. <option value="false" >false</option>
  159. </select>
  160. </td>
  161. <td style="font-size: 80%;">
  162. Fixes the illumination setting of camera at the startup and uses this later --> individual round is faster
  163. </td>
  164. </tr>
  165. <!--
  166. <tr class="expert" id="Contrast_ex3">
  167. <td width="20px" style="padding-left: 40px;">
  168. </td>
  169. <td>
  170. <class id="MakeImage_Contrast_text" style="color:black;">Contrast</class>
  171. </td>
  172. <td>
  173. <input type="number" id="MakeImage_Contrast_value1" size="13" min="-2" max="2">
  174. </td>
  175. <td style="font-size: 80%;">
  176. Image Contrast (-2 .. 2 - default = "0")
  177. </td>
  178. </tr>
  179. <tr class="expert" id="Saturation_ex3">
  180. <td width="20px" style="padding-left: 40px;">
  181. </td>
  182. <td>
  183. <class id="MakeImage_Saturation_text" style="color:black;">Saturation</class>
  184. </td>
  185. <td>
  186. <input type="number" id="MakeImage_Saturation_value1" size="13" min="-2" max="2">
  187. </td>
  188. <td style="font-size: 80%;">
  189. Image Saturation (-2 .. 2 - default = "0")
  190. </td>
  191. </tr>
  192. -->
  193. <tr class="expert" id="ex4">
  194. <td colspan="4" style="padding-left: 20px;"><h4>Alignment</h4></td>
  195. </tr>
  196. <tr class="expert" id="ex6">
  197. <td width="20px" style="padding-left: 40px;">
  198. </td>
  199. <td width="200px">
  200. <class id="Alignment_SearchFieldX_text" style="color:black;">SearchFieldX</class>
  201. </td>
  202. <td>
  203. <input type="number" name="name" id="Alignment_SearchFieldX_value1" size="13" min="1" step="1">
  204. </td>
  205. <td style="font-size: 80%;">
  206. x size (width) in which the reference is searched (default = "20")
  207. </td>
  208. </tr>
  209. <tr class="expert" id="ex8">
  210. <td width="20px" style="padding-left: 40px;">
  211. </td>
  212. <td>
  213. <class id="Alignment_SearchFieldY_text" style="color:black;">SearchFieldY</class>
  214. </td>
  215. <td>
  216. <input type="number" name="name" id="Alignment_SearchFieldY_value1" size="13" min="1">
  217. </td>
  218. <td style="font-size: 80%;">
  219. y size (height) in which the reference is searched (default = "20")
  220. </td>
  221. </tr>
  222. <tr class="expert" id="AlignmentAlgo_ex8">
  223. <td width="20px" style="padding-left: 40px;">
  224. <input type="checkbox" id="Alignment_AlignmentAlgo_enabled" value="1" onclick = 'InvertEnableItem("Alignment", "AlignmentAlgo")' unchecked >
  225. </td>
  226. <td>
  227. <class id="Alignment_AlignmentAlgo_text" style="color:black;">AlignmentAlgo</class>
  228. </td>
  229. <td>
  230. <select id="Alignment_AlignmentAlgo_value1">
  231. <option value="default" selected>Default</option>
  232. <option value="highAccurity" >HighAccurity</option>
  233. <option value="fast" >Fast</option>
  234. </select>
  235. </td>
  236. <td style="font-size: 80%;">
  237. "Default" = use only R-Channel, "HighAccurity" = use all Channels (RGB, 3x slower), <br> "Fast" (First time RGB, then only check if image is shifted)
  238. </td>
  239. </tr>
  240. <tr id="Category_Digits_ex4">
  241. <td colspan="4" style="padding-left: 20px;">
  242. <h4><input type="checkbox" id="Category_Digits_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked >Digits</h4></td>
  243. </tr>
  244. <tr>
  245. <td width="20px" style="padding-left: 40px;">
  246. </td>
  247. <td width="200px">
  248. <class id="Digits_Model_text" style="color:black;">Model</class>
  249. </td>
  250. <td>
  251. <input type="text" id="Digits_Model_value1">
  252. </td>
  253. <td style="font-size: 80%;">
  254. path to CNN model file for image recognition
  255. </td>
  256. </tr>
  257. <tr>
  258. <td width="20px" style="padding-left: 40px;">
  259. <input type="checkbox" id="Digits_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogImageLocation")' unchecked >
  260. </td>
  261. <td>
  262. <class id="Digits_LogImageLocation_text" style="color:black;">LogImageLocation</class>
  263. </td>
  264. <td>
  265. <input type="text" name="name" id="Digits_LogImageLocation_value1">
  266. </td>
  267. <td style="font-size: 80%;">
  268. Location to store separated digits for logging
  269. </td>
  270. </tr>
  271. <tr>
  272. <td width="20px" style="padding-left: 40px;">
  273. <td"><input type="checkbox" id="Digits_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Digits", "LogfileRetentionInDays")' unchecked ></td>
  274. </td>
  275. <td>
  276. <class id="Digits_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  277. </td>
  278. <td>
  279. <input type="number" id="Digits_LogfileRetentionInDays_value1" min="0" step="1">
  280. </td>
  281. <td style="font-size: 80%;">
  282. Time to keep the separated digit images (in days -"0" = forever)
  283. </td>
  284. </tr>
  285. <tr class="expert" id="ex9">
  286. <td width="20px" style="padding-left: 40px;">
  287. </td>
  288. <td>
  289. <class id="Digits_ModelInputSize_text" style="color:black;">ModelInputSize</class>
  290. </td>
  291. <td>
  292. x: <input type="number" id="Digits_ModelInputSize_value1" class="smallSelect" min="1" step="1">
  293. y: <input type="number" id="Digits_ModelInputSize_value2" class="smallSelect" min="1" step="1">
  294. </td>
  295. <td style="font-size: 80%;">
  296. Size of the input image for the CNN model
  297. </td>
  298. </tr>
  299. <tr class="expert" id="ex4">
  300. <td colspan="4" style="padding-left: 20px;">
  301. <h4><input type="checkbox" id="Category_Analog_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked > Analog</h4></td>
  302. </tr>
  303. <tr>
  304. <td width="20px" style="padding-left: 40px;"> </td>
  305. <td width="200px"> <class id="Analog_Model_text" style="color:black;">Model</class> </td>
  306. <td> <input type="text" id="Analog_Model_value1"> </td>
  307. <td style="font-size: 80%;"> path to CNN model file for image recognition</td>
  308. </tr>
  309. <tr>
  310. <td width="20px" style="padding-left: 40px;">
  311. <input type="checkbox" id="Analog_LogImageLocation_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogImageLocation")' unchecked >
  312. </td>
  313. <td> <class id="Analog_LogImageLocation_text" style="color:black;">LogImageLocation</class> </td>
  314. <td> <input type="text" name="name" id="Analog_LogImageLocation_value1"> </td>
  315. <td style="font-size: 80%;"> Location to store separated digits for logging </td>
  316. </tr>
  317. <tr>
  318. <td width="20px" style="padding-left: 40px;">
  319. <td"><input type="checkbox" id="Analog_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Analog", "LogfileRetentionInDays")' unchecked ></td>
  320. </td>
  321. <td> <class id="Analog_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class> </td>
  322. <td> <input type="number" id="Analog_LogfileRetentionInDays_value1" min="0" step="1"> </td>
  323. <td style="font-size: 80%;"> Time to keep the separated digit images (in days -"0" = forever) </td>
  324. </tr>
  325. <tr class="expert" id="Analog_ExtendedResolution_ex10">
  326. <td width="20px" style="padding-left: 40px;">
  327. <input type="checkbox" id="Analog_ExtendedResolution_enabled" value="1" onclick = 'InvertEnableItem("Analog", "ExtendedResolution")' unchecked >
  328. </td>
  329. <td width="200px">
  330. <class id="Analog_ExtendedResolution_text" style="color:black;">ExtendedResolution</class>
  331. </td>
  332. <td>
  333. <select id="Analog_ExtendedResolution_value1">
  334. <option value="true" selected>true</option>
  335. <option value="false" >false</option>
  336. </select>
  337. </td>
  338. <td style="font-size: 80%;">
  339. Enable to use the after point resolution for the last analog counter
  340. </td>
  341. </tr>
  342. ExtendedResolution
  343. <tr class="expert" id="ex10">
  344. <td width="20px" style="padding-left: 40px;"> </td>
  345. <td> <class id="Analog_ModelInputSize_text" style="color:black;">ModelInputSize</class> </td>
  346. <td>
  347. x: <input type="number" id="Analog_ModelInputSize_value1" class="smallSelect" min="1" step="1">
  348. y: <input type="number" id="Analog_ModelInputSize_value2" class="smallSelect" min="1" step="1">
  349. </td>
  350. <td style="font-size: 80%;"> Size of the input image for the CNN model </td>
  351. </tr>
  352. <tr>
  353. <td colspan="4" style="padding-left: 20px;"><h4>PostProcessing</h4></td>
  354. </tr>
  355. <tr>
  356. <td width="20px" style="padding-left: 40px;">
  357. <input type="checkbox" id="PostProcessing_DecimalShift_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "DecimalShift")' unchecked >
  358. </td>
  359. <td width="200px">
  360. <class id="PostProcessing_DecimalShift_text" style="color:black;">DecimalShift</class>
  361. </td>
  362. <td>
  363. <input type="number" id="PostProcessing_DecimalShift_value1" step="1">
  364. </td>
  365. <td style="font-size: 80%;">
  366. shift the digit separator within the digital digits (positiv and negativ)
  367. </td>
  368. </tr>
  369. <tr>
  370. <td width="20px" style="padding-left: 40px;">
  371. <input type="checkbox" id="PostProcessing_PreValueUse_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueUse")' unchecked >
  372. </td>
  373. <td width="200px">
  374. <class id="PostProcessing_PreValueUse_text" style="color:black;">PreValueUse</class>
  375. </td>
  376. <td>
  377. <select id="PostProcessing_PreValueUse_value1">
  378. <option value="true" selected>true</option>
  379. <option value="false" >false</option>
  380. </select>
  381. </td>
  382. <td style="font-size: 80%;">
  383. Enable to use the previous read value for consistency checks - also on reboots
  384. </td>
  385. </tr>
  386. <tr class="expert" id="ex11">
  387. <td width="20px" style="padding-left: 40px;">
  388. <input type="checkbox" id="PostProcessing_PreValueAgeStartup_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "PreValueAgeStartup")' unchecked >
  389. </td>
  390. <td width="200px">
  391. <class id="PostProcessing_PreValueAgeStartup_text" style="color:black;">PreValueAgeStartup</class>
  392. </td>
  393. <td>
  394. <input type="number" id="PostProcessing_PreValueAgeStartup_value1" size="13" min="0">
  395. </td>
  396. <td style="font-size: 80%;">
  397. Time (in minutes), how long a previous read value is valid after reboot (default = 720 min)
  398. </td>
  399. </tr>
  400. <tr>
  401. <td width="20px" style="padding-left: 40px;">
  402. <input type="checkbox" id="PostProcessing_AllowNegativeRates_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "AllowNegativeRates")' unchecked >
  403. </td>
  404. <td width="200px">
  405. <class id="PostProcessing_AllowNegativeRates_text" style="color:black;">AllowNegativeRates</class>
  406. </td>
  407. <td>
  408. <select id="PostProcessing_AllowNegativeRates_value1">
  409. <option value="true" selected>true</option>
  410. <option value="false" >false</option>
  411. </select>
  412. </td>
  413. <td style="font-size: 80%;">
  414. Set on "false" to ensure, that only positive changes are accepted (typically for counter)
  415. </td>
  416. </tr>
  417. <tr>
  418. <td width="20px" style="padding-left: 40px;">
  419. <input type="checkbox" id="PostProcessing_MaxRateValue_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "MaxRateValue")' unchecked >
  420. </td>
  421. <td width="200px">
  422. <class id="PostProcessing_MaxRateValue_text" style="color:black;">MaxRateValue</class>
  423. </td>
  424. <td>
  425. <input type="number" id="PostProcessing_MaxRateValue_value1" size="13" min="0" step="any">
  426. </td>
  427. <td style="font-size: 80%;">
  428. Maximum change of reading from one to the next readout
  429. </td>
  430. </tr>
  431. <tr class="expert" id="ex12">
  432. <td width="20px" style="padding-left: 40px;">
  433. <input type="checkbox" id="PostProcessing_ErrorMessage_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "ErrorMessage")' unchecked >
  434. </td>
  435. <td width="200px">
  436. <class id="PostProcessing_ErrorMessage_text" style="color:black;">ErrorMessage</class>
  437. </td>
  438. <td>
  439. <select id="PostProcessing_ErrorMessage_value1">
  440. <option value="true" selected>true</option>
  441. <option value="false" >false</option>
  442. </select>
  443. </td>
  444. <td style="font-size: 80%;">
  445. Do not show error message in return value - in error case, the last valid number will be send out
  446. </td>
  447. </tr>
  448. <tr>
  449. <td width="20px" style="padding-left: 40px;">
  450. <input type="checkbox" id="PostProcessing_CheckDigitIncreaseConsistency_enabled" value="1" onclick = 'InvertEnableItem("PostProcessing", "CheckDigitIncreaseConsistency")' unchecked >
  451. </td>
  452. <td width="200px">
  453. <class id="PostProcessing_CheckDigitIncreaseConsistency_text" style="color:black;">CheckDigitIncreaseConsistency</class>
  454. </td>
  455. <td>
  456. <select id="PostProcessing_CheckDigitIncreaseConsistency_value1">
  457. <option value="true" selected>true</option>
  458. <option value="false" >false</option>
  459. </select>
  460. </td>
  461. <td style="font-size: 80%;">
  462. Activate to enalbe additional consistency check - especially zero crossing check between digits
  463. </td>
  464. </tr>
  465. <tr>
  466. <td colspan="4" style="padding-left: 20px;"><h4><input type="checkbox" id="Category_MQTT_enabled" value="1" onclick = 'UpdateAfterCategoryCheck()' unchecked > MQTT</h4></td>
  467. </tr>
  468. <tr>
  469. <td width="20px" style="padding-left: 40px;">
  470. <input type="checkbox" id="MQTT_Uri_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "Uri")' unchecked >
  471. </td>
  472. <td width="200px">
  473. <class id="MQTT_Uri_text" style="color:black;">Uri</class>
  474. </td>
  475. <td>
  476. <input type="text" id="MQTT_Uri_value1">
  477. </td>
  478. <td style="font-size: 80%;">
  479. URI to the MQTT broker including port e.g.: mqtt://IP-Address:Port
  480. </td>
  481. </tr>
  482. <tr>
  483. <td width="20px" style="padding-left: 40px;">
  484. <input type="checkbox" id="MQTT_Topic_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "Topic")' unchecked >
  485. </td>
  486. <td width="200px">
  487. <class id="MQTT_Topic_text" style="color:black;">Topic</class>
  488. </td>
  489. <td>
  490. <input type="text" id="MQTT_Topic_value1">
  491. </td>
  492. <td style="font-size: 80%;">
  493. MQTT topic, in which the value is registered
  494. </td>
  495. </tr>
  496. <tr>
  497. <td width="20px" style="padding-left: 40px;">
  498. <input type="checkbox" id="MQTT_TopicError_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "TopicError")' unchecked >
  499. </td>
  500. <td width="200px">
  501. <class id="MQTT_TopicError_text" style="color:black;">TopicError</class>
  502. </td>
  503. <td>
  504. <input type="text" id="MQTT_TopicError_value1">
  505. </td>
  506. <td style="font-size: 80%;">
  507. MQTT topic, in which the error status is reported (empty = no error)
  508. </td>
  509. </tr>
  510. <tr>
  511. <td width="20px" style="padding-left: 40px;">
  512. <input type="checkbox" id="MQTT_TopicRate_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "TopicRate")' unchecked >
  513. </td>
  514. <td width="200px">
  515. <class id="MQTT_TopicRate_text" style="color:black;">TopicRate</class>
  516. </td>
  517. <td>
  518. <input type="text" id="MQTT_TopicRate_value1">
  519. </td>
  520. <td style="font-size: 80%;">
  521. MQTT topic, in which the flow rate [units / minute] is reported
  522. </td>
  523. </tr>
  524. <tr>
  525. <td width="20px" style="padding-left: 40px;">
  526. <input type="checkbox" id="MQTT_TopicTimeStamp_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "TopicTimeStamp")' unchecked >
  527. </td>
  528. <td width="200px">
  529. <class id="MQTT_TopicTimeStamp_text" style="color:black;">TopicTimeStamp</class>
  530. </td>
  531. <td>
  532. <input type="text" id="MQTT_TopicTimeStamp_value1">
  533. </td>
  534. <td style="font-size: 80%;">
  535. MQTT topic, reporting the last correct readout
  536. </td>
  537. </tr>
  538. <tr>
  539. <td width="20px" style="padding-left: 40px;">
  540. <input type="checkbox" id="MQTT_TopicUptime_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "TopicUptime")' unchecked >
  541. </td>
  542. <td width="200px">
  543. <class id="MQTT_TopicUptime_text" style="color:black;">TopicUptime</class>
  544. </td>
  545. <td>
  546. <input type="text" id="MQTT_TopicUptime_value1">
  547. </td>
  548. <td style="font-size: 80%;">
  549. MQTT topic, ESP uptime of last flow
  550. </td>
  551. </tr>
  552. <tr>
  553. <td width="20px" style="padding-left: 40px;">
  554. <input type="checkbox" id="MQTT_MainTopicGPIO_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "MainTopicGPIO")' unchecked >
  555. </td>
  556. <td width="200px">
  557. <class id="MQTT_MainTopicGPIO_text" style="color:black;">MainTopicGPIO</class>
  558. </td>
  559. <td>
  560. <input type="text" id="MQTT_MainTopicGPIO_value1">
  561. </td>
  562. <td style="font-size: 80%;">
  563. MQTT main topic for GPIO
  564. </td>
  565. </tr>
  566. <tr>
  567. <td width="20px" style="padding-left: 40px;">
  568. <input type="checkbox" id="MQTT_ClientID_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "ClientID")' unchecked >
  569. </td>
  570. <td width="200px">
  571. <class id="MQTT_ClientID_text" style="color:black;">ClientID</class>
  572. </td>
  573. <td>
  574. <input type="text" id="MQTT_ClientID_value1">
  575. </td>
  576. <td style="font-size: 80%;">
  577. ClientID to connect to the MQTT broker
  578. </td>
  579. </tr>
  580. <tr>
  581. <td width="20px" style="padding-left: 40px;">
  582. <input type="checkbox" id="MQTT_user_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "user")' unchecked >
  583. </td>
  584. <td width="200px">
  585. <class id="MQTT_user_text" style="color:black;">user</class>
  586. </td>
  587. <td>
  588. <input type="text" id="MQTT_user_value1">
  589. </td>
  590. <td style="font-size: 80%;">
  591. user for MQTT authentication
  592. </td>
  593. </tr>
  594. <tr>
  595. <td width="20px" style="padding-left: 40px;">
  596. <input type="checkbox" id="MQTT_password_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "password")' unchecked >
  597. </td>
  598. <td width="200px">
  599. <class id="MQTT_password_text" style="color:black;">password</class>
  600. </td>
  601. <td>
  602. <input type="text" id="MQTT_password_value1">
  603. </td>
  604. <td style="font-size: 80%;">
  605. password for MQTT authentication
  606. </td>
  607. </tr>
  608. <tr>
  609. <td colspan="4" style="padding-left: 20px;"><h4>AutoTimer</h4></td>
  610. </tr>
  611. <tr class="expert" id="ex13">
  612. <td width="20px" style="padding-left: 40px;">
  613. </td>
  614. <td width="200px">
  615. <class id="AutoTimer_AutoStart_text" style="color:black;">AutoStart</class>
  616. </td>
  617. <td>
  618. <select id="AutoTimer_AutoStart_value1">
  619. <option value="true" selected>true</option>
  620. <option value="false" >false</option>
  621. </select>
  622. </td>
  623. <td style="font-size: 80%;">
  624. Start the image recognition immediatly after power up. false is basically for debugging.
  625. </td>
  626. </tr>
  627. <tr>
  628. <td width="20px" style="padding-left: 40px;">
  629. </td>
  630. <td width="200px">
  631. <class id="AutoTimer_Intervall_text" style="color:black;">Intervall</class>
  632. </td>
  633. <td>
  634. <input type="number" id="AutoTimer_Intervall_value1" size="13" min="3" step="any">
  635. </td>
  636. <td style="font-size: 80%;">
  637. Intervall in which the counter is read (in minutes). Number must be greater than 3 minutes.
  638. </td>
  639. </tr>
  640. <tr>
  641. <td colspan="4" style="padding-left: 20px;"><h4><input type="checkbox" id="Category_GPIO_enabled" value="1" onclick='UpdateAfterCategoryCheck()' unchecked > GPIO Settings</h4></td>
  642. </tr>
  643. <tr class="GPIO_IO12">
  644. <td width="20px" style="padding-left: 40px;">
  645. <input type="checkbox" id="GPIO_IO12_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO12")' unchecked>
  646. </td>
  647. <td>
  648. <span id="GPIO_IO12_text">GPIO 12 state</span>
  649. </td>
  650. <td>
  651. <td">
  652. <select id="GPIO_IO12_value1">
  653. <option value="input">input</option>
  654. <option value="input-pullup">input pullup</option>
  655. <option value="input-pulldown">input pulldown</option>
  656. <option value="output">output</option>
  657. <option value="output-pwm" disabled>output pwm (not implemented)</option>
  658. <option value="external-flash-pwm" disabled>external flash light pwm controlled (not implemented)</option>
  659. <option value="external-flash-ws281x" disabled>external flash light ws281x controlled (not implemented)</option>
  660. </select>
  661. </td>
  662. </td>
  663. <td class="description">
  664. GPIO 12 is usable without restrictions
  665. </td>
  666. </tr>
  667. <tr class="GPIO_IO12">
  668. <td width="20px" style="padding-left: 40px;"></td>
  669. <td>
  670. <span>GPIO 12 use interrupt</span>
  671. </td>
  672. <td>
  673. <td">
  674. <select id="GPIO_IO12_value2">
  675. <option value="disabled">disabled</option>
  676. <option value="rising-edge" disabled>rising edge (not implemented)</option>
  677. <option value="falling-edge" disabled>falling edge (not implemented)</option>
  678. </select>
  679. </td>
  680. </td>
  681. <td class="description">
  682. GPIO 12 enable interrupt trigger
  683. </td>
  684. </tr>
  685. <tr class="GPIO_IO12">
  686. <td width="20px" style="padding-left: 40px;"></td>
  687. <td>
  688. <span>GPIO 12 PWM duty resolution</span>
  689. </td>
  690. <td>
  691. <td"><input type="number" id="GPIO_IO12_value3" min="1" max="20"></td>
  692. </td>
  693. <td class="description">
  694. GPIO 12 LEDC PWM duty resolution in bit
  695. </td>
  696. </tr>
  697. <tr class="GPIO_IO12">
  698. <td width="20px" style="padding-left: 40px;"></td>
  699. <td>
  700. <span>GPIO 12 enable MQTT</span>
  701. </td>
  702. <td>
  703. <td"><input type="checkbox" id="GPIO_IO12_value4"></td>
  704. </td>
  705. <td class="description">
  706. GPIO 12 enable MQTT publishing/subscribing
  707. </td>
  708. </tr>
  709. <tr class="GPIO_IO12">
  710. <td width="20px" style="padding-left: 40px;"></td>
  711. <td>
  712. <span>GPIO 12 enable HTTP</span>
  713. </td>
  714. <td>
  715. <td"><input type="checkbox" id="GPIO_IO12_value5"></td>
  716. </td>
  717. <td class="description">
  718. GPIO 12 enable HTTP write/read
  719. </td>
  720. </tr>
  721. <tr class="GPIO_IO12">
  722. <td width="20px" style="padding-left: 40px;"></td>
  723. <td>
  724. <span>GPIO 12 name</span>
  725. </td>
  726. <td>
  727. <td"><input type="text" id="GPIO_IO12_value6"></td>
  728. </td>
  729. <td class="description">
  730. GPIO 12 MQTT topic name (empty = gpio12). Allowed characters (a-z, A-Z, 0-9, _, -)
  731. </td>
  732. </tr>
  733. <tr class="GPIO_IO13">
  734. <td width="20px" style="padding-left: 40px;">
  735. <input type="checkbox" id="GPIO_IO13_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO13")' unchecked>
  736. </td>
  737. <td>
  738. <span id="GPIO_IO13_text">GPIO 13 state</span>
  739. </td>
  740. <td>
  741. <td">
  742. <select id="GPIO_IO13_value1">
  743. <option value="input">input</option>
  744. <option value="input-pullup">input pullup</option>
  745. <option value="input-pulldown">input pulldown</option>
  746. <option value="output">output</option>
  747. <option value="output-pwm" disabled>output pwm (not implemented)</option>
  748. <option value="external-flash-pwm" disabled>external flash light pwm controlled (not implemented)</option>
  749. <option value="external-flash-ws281x" disabled>external flash light ws281x controlled (not implemented)</option>
  750. </select>
  751. </td>
  752. </td>
  753. <td class="description">
  754. GPIO 13 is usable without restrictions
  755. </td>
  756. </tr>
  757. <tr class="GPIO_IO13">
  758. <td width="20px" style="padding-left: 40px;"></td>
  759. <td>
  760. <span>GPIO 13 use interrupt</span>
  761. </td>
  762. <td>
  763. <td">
  764. <select id="GPIO_IO13_value2">
  765. <option value="disabled">disabled</option>
  766. <option value="rising-edge" disabled>rising edge (not implemented)</option>
  767. <option value="falling-edge" disabled>falling edge (not implemented)</option>
  768. </select>
  769. </td>
  770. </td>
  771. <td class="description">
  772. GPIO 13 enable interrupt trigger
  773. </td>
  774. </tr>
  775. <tr class="GPIO_IO13">
  776. <td width="20px" style="padding-left: 40px;"></td>
  777. <td>
  778. <span>GPIO 13 PWM duty resolution</span>
  779. </td>
  780. <td>
  781. <td"><input type="number" id="GPIO_IO13_value3" min="1" max="20"></td>
  782. </td>
  783. <td class="description">
  784. GPIO 13 LEDC PWM duty resolution in bit
  785. </td>
  786. </tr>
  787. <tr class="GPIO_IO13">
  788. <td width="20px" style="padding-left: 40px;"></td>
  789. <td>
  790. <span>GPIO 13 enable MQTT</span>
  791. </td>
  792. <td>
  793. <td"><input type="checkbox" id="GPIO_IO13_value4"></td>
  794. </td>
  795. <td class="description">
  796. GPIO 13 enable MQTT publishing/subscribing
  797. </td>
  798. </tr>
  799. <tr class="GPIO_IO13">
  800. <td width="20px" style="padding-left: 40px;"></td>
  801. <td>
  802. <span>GPIO 13 enable HTTP</span>
  803. </td>
  804. <td>
  805. <td"><input type="checkbox" id="GPIO_IO13_value5"></td>
  806. </td>
  807. <td class="description">
  808. GPIO 13 enable HTTP write/read
  809. </td>
  810. </tr>
  811. <tr class="GPIO_IO13">
  812. <td width="20px" style="padding-left: 40px;"></td>
  813. <td>
  814. <span>GPIO 13 name</span>
  815. </td>
  816. <td>
  817. <td"><input type="text" id="GPIO_IO13_value6"></td>
  818. </td>
  819. <td class="description">
  820. GPIO 13 MQTT topic name (empty = gpio13). Allowed characters (a-z, A-Z, 0-9, _, -)
  821. </td>
  822. </tr>
  823. <tr>
  824. <td colspan="4" style="padding-left: 20px;"><h4>Debug</h4></td>
  825. </tr>
  826. <tr>
  827. <td width="20px" style="padding-left: 40px;">
  828. <input type="checkbox" id="Debug_Logfile_enabled" value="1" onclick = 'InvertEnableItem("Debug", "Logfile")' unchecked >
  829. </td>
  830. <td width="200px">
  831. <class id="Debug_Logfile_text" style="color:black;">Logfile</class>
  832. </td>
  833. <td>
  834. <select id="Debug_Logfile_value1">
  835. <option value="true" selected>true</option>
  836. <option value="false" >false</option>
  837. </select>
  838. </td>
  839. <td class="description">
  840. Turn on/off the extended logging
  841. </td>
  842. </tr>
  843. <tr>
  844. <td width="20px" style="padding-left: 40px;">
  845. <td"><input type="checkbox" id="Debug_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Debug", "LogfileRetentionInDays")' unchecked ></td>
  846. </td>
  847. <td>
  848. <class id="Debug_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  849. </td>
  850. <td>
  851. <input type="number" id="Debug_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  852. </td>
  853. <td class="description">
  854. Time to keep the log files (in days - "0" = forever)
  855. </td>
  856. </tr>
  857. <tr>
  858. <td colspan="4" style="padding-left: 20px;"><h4>System</h4></td>
  859. </tr>
  860. <tr>
  861. <td width="20px" style="padding-left: 40px;">
  862. <td"><input type="checkbox" id="System_TimeZone_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeZone")' unchecked ></td>
  863. </td>
  864. <td>
  865. <class id="System_TimeZone_text" style="color:black;">TimeZone</class>
  866. </td>
  867. <td>
  868. <input type="text" id="System_TimeZone_value1">
  869. </td>
  870. <td class="description">
  871. Time zone in POSIX syntax (Europe/Berlin = "CET-1CEST,M3.5.0,M10.5.0/3" - incl. daylight saving)
  872. </td>
  873. </tr>
  874. <tr class="expert" id="ex16">
  875. <td width="20px" style="padding-left: 40px;">
  876. <td"><input type="checkbox" id="System_TimeServer_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeServer")' unchecked ></td>
  877. </td>
  878. <td>
  879. <class id="System_TimeServer_text" style="color:black;">TimeServer</class>
  880. </td>
  881. <td>
  882. <input type="text" id="System_TimeServer_value1">
  883. </td>
  884. <td class="description">
  885. Time server to synchronize system time (default: "pool.ntp.org" - used if nothing is specified)
  886. </td>
  887. </tr>
  888. <tr class="expert" id="System_Hostname">
  889. <td width="20px" style="padding-left: 40px;">
  890. <td"><input type="checkbox" id="System_Hostname_enabled" value="1" onclick = 'InvertEnableItem("System", "Hostname")' unchecked ></td>
  891. </td>
  892. <td>
  893. <class id="System_Hostname_text" style="color:black;">Hostname</class>
  894. </td>
  895. <td>
  896. <input type="text" id="System_Hostname_value1">
  897. </td>
  898. <td class="description">
  899. Hostname for server - will be transfered to wlan.ini at next startup)
  900. </td>
  901. </tr>
  902. </table>
  903. <p>
  904. <button class="button" onclick="saveTextAsFile()">Update Config.ini</button>
  905. </p>
  906. <p>
  907. </p>
  908. <div id="doreboot">
  909. <p>
  910. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  911. <button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate updates</button>
  912. </p>
  913. </div>
  914. </div>
  915. <script type="text/javascript" src="./gethost.js"></script>
  916. <script type="text/javascript" src="./readconfigcommon.js"></script>
  917. <script type="text/javascript" src="./readconfigparam.js"></script>
  918. <script type="text/javascript">
  919. var canvas = document.getElementById('canvas'),
  920. basepath = "http://192.168.178.22";
  921. param;
  922. category;
  923. function LoadConfigNeu() {
  924. var isInitialSetup = getParameterByName('InitialSetup');
  925. if (isInitialSetup === 'true')
  926. {
  927. document.getElementById("reboot").style.display = "none";
  928. }
  929. basepath = getbasepath();
  930. if (!loadConfig(basepath)) {
  931. alert("Config.ini could not be loaded!\nPlease reload the page.");
  932. return;
  933. }
  934. loadConfig(basepath);
  935. ParseConfig();
  936. param = getConfigParameters();
  937. category = getConfigCategory();
  938. UpdateInput();
  939. UpdateExpertModus();
  940. document.getElementById("divall").style.display = '';
  941. }
  942. function getParameterByName(name, url = window.location.href) {
  943. name = name.replace(/[\[\]]/g, '\\$&');
  944. var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
  945. results = regex.exec(url);
  946. if (!results) return null;
  947. if (!results[2]) return '';
  948. return decodeURIComponent(results[2].replace(/\+/g, ' '));
  949. }
  950. function WriteParameter(_param, _category, _cat, _name, _optional){
  951. let anzpara = _param[_cat][_name].anzParam;
  952. if (_param[_cat][_name]["found"]){
  953. if (_optional) {
  954. document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"];
  955. for (var j = 1; j <= anzpara; ++j) {
  956. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"];
  957. }
  958. }
  959. document.getElementById(_cat+"_"+_name+"_text").style="color:black;"
  960. setEnabled(_cat+"_"+_name, true);
  961. for (var j = 1; j <= anzpara; ++j) {
  962. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  963. if (element.tagName.toLowerCase() == "select") {
  964. var textToFind = _param[_cat][_name]["value"+j];
  965. for (var i = 0; i < element.options.length; i++) {
  966. if (element.options[i].value.toLowerCase() === textToFind.toLowerCase()) {
  967. element.selectedIndex = i;
  968. break;
  969. }
  970. }
  971. }
  972. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  973. element.checked = _param[_cat][_name]["value"+j] == "true";
  974. }
  975. else {
  976. element.value = _param[_cat][_name]["value"+j];
  977. }
  978. }
  979. }
  980. else {
  981. if (_optional) {
  982. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  983. for (var j = 1; j <= anzpara; ++j) {
  984. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  985. }
  986. }
  987. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  988. setEnabled(_cat+"_"+_name, false);
  989. }
  990. ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren
  991. if (_category[_cat]["enabled"] == false)
  992. {
  993. if (_optional) {
  994. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  995. for (var j = 1; j <= anzpara; ++j) {
  996. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  997. }
  998. }
  999. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  1000. setEnabled(_cat+"_"+_name, false);
  1001. }
  1002. EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional);
  1003. }
  1004. function InvertEnableItem(_cat, _param)
  1005. {
  1006. _zw = _cat + "_" + _param + "_enabled";
  1007. _isOn = document.getElementById(_zw).checked;
  1008. _color = "color:lightgrey;";
  1009. if (_isOn) {
  1010. _color = "color:black;";
  1011. }
  1012. _zw = _cat + "_" + _param + "_text";
  1013. document.getElementById(_zw).disabled = !_isOn;
  1014. document.getElementById(_zw).style = _color;
  1015. setEnabled(_cat + "_" + _param, _isOn);
  1016. for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) {
  1017. document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn;
  1018. document.getElementById(_cat+"_"+_param+"_value"+j).style=_color;
  1019. }
  1020. }
  1021. function setEnabled(className, enabled) {
  1022. let elements = document.getElementsByClassName(className);
  1023. for (i = 0; i < elements.length; i++) {
  1024. if (enabled) {
  1025. elements[i].classList.remove("disabled");
  1026. } else {
  1027. elements[i].classList.add("disabled");
  1028. }
  1029. let inputs = elements[i].getElementsByTagName("input");
  1030. for (j = 0; j < inputs.length; j++) {
  1031. if (inputs[j].id.endsWith("_enabled"))
  1032. continue;
  1033. if (enabled) {
  1034. inputs[j].removeAttribute("disabled");
  1035. } else {
  1036. inputs[j].setAttribute("disabled", "disabled");
  1037. }
  1038. }
  1039. }
  1040. }
  1041. function EnDisableItem(_status, _param, _category, _cat, _name, _optional)
  1042. {
  1043. _status = _param[_cat][_name]["found"] && _category[_cat]["enabled"];
  1044. _color = "color:lightgrey;";
  1045. if (_status) {
  1046. _color = "color:black;";
  1047. }
  1048. if (_optional) {
  1049. document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status;
  1050. document.getElementById(_cat+"_"+_name+"_enabled").style=_color;
  1051. }
  1052. if (!_param[_cat][_name]["enabled"]) {
  1053. _status = false;
  1054. _color = "color:lightgrey;";
  1055. }
  1056. document.getElementById(_cat+"_"+_name+"_text").disabled = !_status;
  1057. document.getElementById(_cat+"_"+_name+"_text").style = _color;
  1058. setEnabled(_cat+"_"+_name, _status);
  1059. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1060. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status;
  1061. document.getElementById(_cat+"_"+_name+"_value"+j).style=_color;
  1062. }
  1063. }
  1064. function ReadParameter(_param, _cat, _name, _optional){
  1065. if (_param[_cat][_name]["found"]){
  1066. if (_optional) {
  1067. _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked;
  1068. }
  1069. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1070. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  1071. if (element.tagName.toLowerCase() == "select") {
  1072. _param[_cat][_name]["value"+j] = element.selectedIndex > -1 ? element.options[element.selectedIndex].value : "";
  1073. }
  1074. else if ((element.getAttribute("type") != null) && (element.getAttribute("type").toLowerCase() == "checkbox")) {
  1075. _param[_cat][_name]["value"+j] = element.checked;
  1076. }
  1077. else {
  1078. if ((_param[_cat][_name].checkRegExList != null) && (_param[_cat][_name].checkRegExList[j-1] != null)) {
  1079. if (!element.value.match(_param[_cat][_name].checkRegExList[j-1])) {
  1080. element.classList.add("invalid-input");
  1081. } else {
  1082. element.classList.remove("invalid-input");
  1083. }
  1084. }
  1085. _param[_cat][_name]["value"+j] = element.value;
  1086. }
  1087. }
  1088. }
  1089. }
  1090. function UpdateInput() {
  1091. document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"];
  1092. document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"];
  1093. document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
  1094. document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"];
  1095. WriteParameter(param, category, "MakeImage", "LogImageLocation", true);
  1096. WriteParameter(param, category, "MakeImage", "LogfileRetentionInDays", true);
  1097. WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
  1098. WriteParameter(param, category, "MakeImage", "ImageQuality", false);
  1099. WriteParameter(param, category, "MakeImage", "Brightness", false);
  1100. // WriteParameter(param, category, "MakeImage", "Contrast", false);
  1101. // WriteParameter(param, category, "MakeImage", "Saturation", false);
  1102. WriteParameter(param, category, "MakeImage", "ImageSize", false, true);
  1103. WriteParameter(param, category, "MakeImage", "FixedExposure", false, true);
  1104. WriteParameter(param, category, "Alignment", "SearchFieldX", false);
  1105. WriteParameter(param, category, "Alignment", "SearchFieldY", false);
  1106. WriteParameter(param, category, "Alignment", "AlignmentAlgo", true, true);
  1107. WriteParameter(param, category, "Digits", "Model", false);
  1108. WriteParameter(param, category, "Digits", "LogImageLocation", true);
  1109. WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
  1110. WriteParameter(param, category, "Digits", "ModelInputSize", false);
  1111. WriteParameter(param, category, "Analog", "Model", false);
  1112. WriteParameter(param, category, "Analog", "LogImageLocation", true);
  1113. WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
  1114. WriteParameter(param, category, "Analog", "ExtendedResolution", true);
  1115. WriteParameter(param, category, "Analog", "ModelInputSize", false);
  1116. WriteParameter(param, category, "PostProcessing", "DecimalShift", true);
  1117. WriteParameter(param, category, "PostProcessing", "PreValueUse", true);
  1118. WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
  1119. WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true);
  1120. WriteParameter(param, category, "PostProcessing", "MaxRateValue", true);
  1121. WriteParameter(param, category, "PostProcessing", "ErrorMessage", true);
  1122. WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  1123. WriteParameter(param, category, "MQTT", "Uri", true);
  1124. WriteParameter(param, category, "MQTT", "Topic", true);
  1125. WriteParameter(param, category, "MQTT", "TopicError", true);
  1126. WriteParameter(param, category, "MQTT", "TopicRate", true);
  1127. WriteParameter(param, category, "MQTT", "TopicTimeStamp", true);
  1128. WriteParameter(param, category, "MQTT", "TopicUptime", true);
  1129. WriteParameter(param, category, "MQTT", "MainTopicGPIO", true);
  1130. WriteParameter(param, category, "MQTT", "ClientID", true);
  1131. WriteParameter(param, category, "MQTT", "user", true);
  1132. WriteParameter(param, category, "MQTT", "password", true);
  1133. WriteParameter(param, category, "GPIO", "IO12", true);
  1134. WriteParameter(param, category, "GPIO", "IO13", true);
  1135. WriteParameter(param, category, "AutoTimer", "AutoStart", false);
  1136. WriteParameter(param, category, "AutoTimer", "Intervall", false);
  1137. WriteParameter(param, category, "Debug", "Logfile", true);
  1138. WriteParameter(param, category, "Debug", "LogfileRetentionInDays", true);
  1139. WriteParameter(param, category, "System", "TimeZone", true);
  1140. WriteParameter(param, category, "System", "Hostname", true);
  1141. WriteParameter(param, category, "System", "TimeServer", true);
  1142. }
  1143. function ReadParameterAll()
  1144. {
  1145. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1146. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1147. category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
  1148. category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
  1149. ReadParameter(param, "MakeImage", "LogImageLocation", true);
  1150. ReadParameter(param, "MakeImage", "LogfileRetentionInDays", true);
  1151. ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
  1152. ReadParameter(param, "MakeImage", "ImageQuality", false);
  1153. ReadParameter(param, "MakeImage", "Brightness", false);
  1154. // ReadParameter(param, "MakeImage", "Contrast", false);
  1155. // ReadParameter(param, "MakeImage", "Saturation", false);
  1156. ReadParameter(param, "MakeImage", "ImageSize", false);
  1157. ReadParameter(param, "MakeImage", "FixedExposure", false);
  1158. ReadParameter(param, "Alignment", "SearchFieldX", false);
  1159. ReadParameter(param, "Alignment", "SearchFieldY", false);
  1160. ReadParameter(param, "Alignment", "AlignmentAlgo", true);
  1161. ReadParameter(param, "Digits", "Model", false);
  1162. ReadParameter(param, "Digits", "LogImageLocation", true);
  1163. ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
  1164. ReadParameter(param, "Digits", "ModelInputSize", false);
  1165. ReadParameter(param, "Analog", "Model", false);
  1166. ReadParameter(param, "Analog", "LogImageLocation", true);
  1167. ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
  1168. ReadParameter(param, "Analog", "ExtendedResolution", true);
  1169. ReadParameter(param, "Analog", "ModelInputSize", false);
  1170. ReadParameter(param, "PostProcessing", "DecimalShift", true);
  1171. ReadParameter(param, "PostProcessing", "PreValueUse", true);
  1172. ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
  1173. ReadParameter(param, "PostProcessing", "AllowNegativeRates", true);
  1174. ReadParameter(param, "PostProcessing", "MaxRateValue", true);
  1175. ReadParameter(param, "PostProcessing", "ErrorMessage", true);
  1176. ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  1177. ReadParameter(param, "MQTT", "Uri", true);
  1178. ReadParameter(param, "MQTT", "Topic", true);
  1179. ReadParameter(param, "MQTT", "TopicError", true);
  1180. ReadParameter(param, "MQTT", "TopicRate", true);
  1181. ReadParameter(param, "MQTT", "TopicTimeStamp", true);
  1182. ReadParameter(param, "MQTT", "TopicUptime", true);
  1183. ReadParameter(param, "MQTT", "MainTopicGPIO", true);
  1184. ReadParameter(param, "MQTT", "ClientID", true);
  1185. ReadParameter(param, "MQTT", "user", true);
  1186. ReadParameter(param, "MQTT", "password", true);
  1187. ReadParameter(param, "GPIO", "IO12", true);
  1188. ReadParameter(param, "GPIO", "IO13", true);
  1189. ReadParameter(param, "AutoTimer", "AutoStart", false);
  1190. ReadParameter(param, "AutoTimer", "Intervall", false);
  1191. ReadParameter(param, "Debug", "Logfile", true);
  1192. ReadParameter(param, "Debug", "LogfileRetentionInDays", true);
  1193. ReadParameter(param, "System", "TimeZone", true);
  1194. ReadParameter(param, "System", "Hostname", true);
  1195. ReadParameter(param, "System", "TimeServer", true);
  1196. FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
  1197. }
  1198. function WriteConfig(){
  1199. ReadParameterAll();
  1200. return setConfigParameters(param, category);
  1201. }
  1202. function FormatDecimalValue(_param, _cat, _name) {
  1203. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1204. var _val = _param[_cat][_name]["value"+j];
  1205. _val = _val.replace(",", ".");
  1206. _param[_cat][_name]["value"+j] = _val;
  1207. }
  1208. }
  1209. function UpdateAfterCategoryCheck() {
  1210. ReadParameterAll();
  1211. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1212. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1213. UpdateInput();
  1214. }
  1215. function UpdateExpertModus()
  1216. {
  1217. var _style = 'display:none;';
  1218. if (document.getElementById("ExpertModus_enabled").checked) {
  1219. _style = '';
  1220. document.getElementById("Edit_Config_Direct").style.display = "";
  1221. }
  1222. else
  1223. {
  1224. document.getElementById("Edit_Config_Direct").style.display = "none";
  1225. }
  1226. const expert = document.querySelectorAll(".expert");
  1227. for (var i = 0; i < expert.length; i++) {
  1228. document.getElementById(expert[i].id).style = _style;
  1229. }
  1230. }
  1231. function saveTextAsFile()
  1232. {
  1233. if (confirm("Are you sure you want to update \"config.ini\"?")) {
  1234. var textToSave = WriteConfig();
  1235. if (document.getElementsByClassName("invalid-input").length > 0) {
  1236. alert("Settings cannot be saved. Please check your entries.");
  1237. return;
  1238. }
  1239. FileDeleteOnServer("/config/config.ini", basepath);
  1240. FileSendContent(textToSave, "/config/config.ini", basepath);
  1241. }
  1242. }
  1243. function doReboot() {
  1244. if (confirm("Are you sure you want to reboot the ESP32?")) {
  1245. var stringota = "/reboot";
  1246. window.location = stringota;
  1247. window.location.href = stringota;
  1248. window.location.assign(stringota);
  1249. window.location.replace(stringota);
  1250. }
  1251. }
  1252. function editConfigDirect() {
  1253. if (confirm("Did you save your changes?")) {
  1254. var stringota = "/edit_config.html";
  1255. window.location = stringota;
  1256. window.location.href = stringota;
  1257. window.location.assign(stringota);
  1258. window.location.replace(stringota);
  1259. }
  1260. }
  1261. LoadConfigNeu();
  1262. </script>
  1263. </body>
  1264. </html>