edit_config_param.html 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  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="0" selected>VGA</option>
  129. <option value="1" >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="0" selected>true</option>
  158. <option value="1" >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="0" selected>Default</option>
  232. <option value="1" >HighAccurity</option>
  233. <option value="2" >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="0" selected>true</option>
  335. <option value="1" >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="0" selected>true</option>
  379. <option value="1" >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="0" selected>true</option>
  410. <option value="1" >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="0" selected>true</option>
  441. <option value="1" >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="0" selected>true</option>
  458. <option value="1" >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="0" selected>true</option>
  620. <option value="1" >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_IO16">
  644. <td width="20px" style="padding-left: 40px;">
  645. <input type="checkbox" id="GPIO_IO16_enabled" value="1" onclick = 'InvertEnableItem("GPIO", "IO16")' unchecked>
  646. </td>
  647. <td>
  648. <span id="GPIO_IO16_text">GPIO 16 state</span>
  649. </td>
  650. <td>
  651. <td">
  652. <select id="GPIO_IO16_value1">
  653. <option value="input" >input</option>
  654. <option value="output" >output</option>
  655. </select>
  656. </td>
  657. </td>
  658. <td class="description">
  659. GPIO 16 is usable without restrictions
  660. </td>
  661. </tr>
  662. <tr class="GPIO_IO16">
  663. <td width="20px" style="padding-left: 40px;"></td>
  664. <td>
  665. <span>GPIO 16 name</span>
  666. </td>
  667. <td>
  668. <td"><input type="text" id="GPIO_IO16_value2"></td>
  669. </td>
  670. <td class="description">
  671. GPIO 16 MQTT topic name (empty = gpio16). Allowed characters (a-z, A-Z, 0-9, _, -)
  672. </td>
  673. </tr>
  674. <tr>
  675. <td colspan="4" style="padding-left: 20px;"><h4>Debug</h4></td>
  676. </tr>
  677. <tr>
  678. <td width="20px" style="padding-left: 40px;">
  679. <input type="checkbox" id="Debug_Logfile_enabled" value="1" onclick = 'InvertEnableItem("Debug", "Logfile")' unchecked >
  680. </td>
  681. <td width="200px">
  682. <class id="Debug_Logfile_text" style="color:black;">Logfile</class>
  683. </td>
  684. <td>
  685. <select id="Debug_Logfile_value1">
  686. <option value="0" selected>true</option>
  687. <option value="1" >false</option>
  688. </select>
  689. </td>
  690. <td class="description">
  691. Turn on/off the extended logging
  692. </td>
  693. </tr>
  694. <tr>
  695. <td width="20px" style="padding-left: 40px;">
  696. <td"><input type="checkbox" id="Debug_LogfileRetentionInDays_enabled" value="1" onclick = 'InvertEnableItem("Debug", "LogfileRetentionInDays")' unchecked ></td>
  697. </td>
  698. <td>
  699. <class id="Debug_LogfileRetentionInDays_text" style="color:black;">LogfileRetentionInDays</class>
  700. </td>
  701. <td>
  702. <input type="number" id="Debug_LogfileRetentionInDays_value1" size="13" min="0" step="1">
  703. </td>
  704. <td class="description">
  705. Time to keep the log files (in days - "0" = forever)
  706. </td>
  707. </tr>
  708. <tr>
  709. <td colspan="4" style="padding-left: 20px;"><h4>System</h4></td>
  710. </tr>
  711. <tr>
  712. <td width="20px" style="padding-left: 40px;">
  713. <td"><input type="checkbox" id="System_TimeZone_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeZone")' unchecked ></td>
  714. </td>
  715. <td>
  716. <class id="System_TimeZone_text" style="color:black;">TimeZone</class>
  717. </td>
  718. <td>
  719. <input type="text" id="System_TimeZone_value1">
  720. </td>
  721. <td class="description">
  722. Time zone in POSIX syntax (Europe/Berlin = "CET-1CEST,M3.5.0,M10.5.0/3" - incl. daylight saving)
  723. </td>
  724. </tr>
  725. <tr class="expert" id="ex16">
  726. <td width="20px" style="padding-left: 40px;">
  727. <td"><input type="checkbox" id="System_TimeServer_enabled" value="1" onclick = 'InvertEnableItem("System", "TimeServer")' unchecked ></td>
  728. </td>
  729. <td>
  730. <class id="System_TimeServer_text" style="color:black;">TimeServer</class>
  731. </td>
  732. <td>
  733. <input type="text" id="System_TimeServer_value1">
  734. </td>
  735. <td class="description">
  736. Time server to synchronize system time (default: "pool.ntp.org" - used if nothing is specified)
  737. </td>
  738. </tr>
  739. <tr class="expert" id="System_Hostname">
  740. <td width="20px" style="padding-left: 40px;">
  741. <td"><input type="checkbox" id="System_Hostname_enabled" value="1" onclick = 'InvertEnableItem("System", "Hostname")' unchecked ></td>
  742. </td>
  743. <td>
  744. <class id="System_Hostname_text" style="color:black;">Hostname</class>
  745. </td>
  746. <td>
  747. <input type="text" id="System_Hostname_value1">
  748. </td>
  749. <td class="description">
  750. Hostname for server - will be transfered to wlan.ini at next startup)
  751. </td>
  752. </tr>
  753. </table>
  754. <p>
  755. <button class="button" onclick="saveTextAsFile()">Update Config.ini</button>
  756. </p>
  757. <p>
  758. </p>
  759. <div id="doreboot">
  760. <p>
  761. <button class="button" id="Edit_Config_Direct" onclick="editConfigDirect()" style="display:none">Edit Config.ini direct</button>
  762. <button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate updates</button>
  763. </p>
  764. </div>
  765. </div>
  766. <script type="text/javascript" src="./gethost.js"></script>
  767. <script type="text/javascript" src="./readconfigcommon.js"></script>
  768. <script type="text/javascript" src="./readconfigparam.js"></script>
  769. <script type="text/javascript">
  770. var canvas = document.getElementById('canvas'),
  771. basepath = "http://192.168.178.22";
  772. param;
  773. category;
  774. function LoadConfigNeu() {
  775. console.log("LoadConfigNeu");
  776. var isInitialSetup = getParameterByName('InitialSetup');
  777. if (isInitialSetup === 'true')
  778. {
  779. document.getElementById("reboot").style.display = "none";
  780. }
  781. basepath = getbasepath();
  782. if (!loadConfig(basepath)) {
  783. alert("Config.ini could not be loaded!\nPlease reload the page.");
  784. console.log("LoadConfigNeu end ret");
  785. return;
  786. }
  787. loadConfig(basepath);
  788. ParseConfig();
  789. param = getConfigParameters();
  790. category = getConfigCategory();
  791. UpdateInput();
  792. UpdateExpertModus();
  793. document.getElementById("divall").style.display = '';
  794. console.log("LoadConfigNeu end");
  795. }
  796. function getParameterByName(name, url = window.location.href) {
  797. console.log("getParameterByName");
  798. name = name.replace(/[\[\]]/g, '\\$&');
  799. var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
  800. results = regex.exec(url);
  801. console.log("getParameterByName end");
  802. if (!results) return null;
  803. if (!results[2]) return '';
  804. return decodeURIComponent(results[2].replace(/\+/g, ' '));
  805. }
  806. function WriteParameter(_param, _category, _cat, _name, _optional, _anzpara = 1){
  807. console.log("InvertEnableItem");
  808. if (_param[_cat][_name]["found"]){
  809. if (_optional) {
  810. document.getElementById(_cat+"_"+_name+"_enabled").checked = _param[_cat][_name]["enabled"];
  811. for (var j = 1; j <= _anzpara; ++j) {
  812. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_param[_cat][_name]["enabled"];
  813. }
  814. }
  815. document.getElementById(_cat+"_"+_name+"_text").style="color:black;"
  816. setEnabled(_cat+"_"+_name, true);
  817. for (var j = 1; j <= _anzpara; ++j) {
  818. let element = document.getElementById(_cat+"_"+_name+"_value"+j);
  819. if (element.tagName == "select") {
  820. var textToFind = _param[_cat][_name]["value1"];
  821. for (var i = 0; i < element.options.length; i++) {
  822. if (element.options[i].text.toLowerCase() === textToFind.toLowerCase()) {
  823. element.selectedIndex = i;
  824. break;
  825. }
  826. }
  827. }
  828. else {
  829. element.value = _param[_cat][_name]["value"+j];
  830. }
  831. }
  832. }
  833. else {
  834. if (_optional) {
  835. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  836. for (var j = 1; j <= _anzpara; ++j) {
  837. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  838. }
  839. }
  840. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  841. setEnabled(_cat+"_"+_name, false);
  842. }
  843. ///////////////// am Ende, falls Kategorie als gesamtes nicht ausgewählt --> deaktivieren
  844. if (_category[_cat]["enabled"] == false)
  845. {
  846. if (_optional) {
  847. document.getElementById(_cat+"_"+_name+"_enabled").disabled = true;
  848. for (var j = 1; j <= _anzpara; ++j) {
  849. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = true;
  850. }
  851. }
  852. document.getElementById(_cat+"_"+_name+"_text").style="color:lightgrey;"
  853. setEnabled(_cat+"_"+_name, false);
  854. }
  855. EnDisableItem(_category[_cat]["enabled"], _param, _category, _cat, _name, _optional);
  856. console.log("InvertEnableItem end");
  857. }
  858. function InvertEnableItem(_cat, _param)
  859. {
  860. console.log("InvertEnableItem");
  861. _zw = _cat + "_" + _param + "_enabled";
  862. _isOn = document.getElementById(_zw).checked;
  863. _color = "color:lightgrey;";
  864. if (_isOn) {
  865. _color = "color:black;";
  866. }
  867. _zw = _cat + "_" + _param + "_text";
  868. document.getElementById(_zw).disabled = !_isOn;
  869. document.getElementById(_zw).style = _color;
  870. setEnabled(_cat + "_" + _param, _isOn);
  871. for (var j = 1; j <= param[_cat][_param]["anzParam"]; ++j) {
  872. document.getElementById(_cat+"_"+_param+"_value"+j).disabled = !_isOn;
  873. document.getElementById(_cat+"_"+_param+"_value"+j).style=_color;
  874. }
  875. console.log("InvertEnableItem end");
  876. }
  877. function setEnabled(className, enabled) {
  878. let elements = document.getElementsByClassName(className);
  879. for (i = 0; i < elements.length; i++) {
  880. if (enabled) {
  881. elements[i].classList.remove("disabled");
  882. } else {
  883. elements[i].classList.add("disabled");
  884. }
  885. let inputs = elements[i].getElementsByTagName("input");
  886. for (j = 0; j < inputs.length; j++) {
  887. if (inputs[j].id.endsWith("_enabled"))
  888. continue;
  889. if (enabled) {
  890. inputs[j].removeAttribute("disabled");
  891. } else {
  892. inputs[j].setAttribute("disabled", "disabled");
  893. }
  894. }
  895. }
  896. }
  897. function EnDisableItem(_status, _param, _category, _cat, _name, _optional)
  898. {
  899. console.log("EnDisableItem");
  900. _status = _param[_cat][_name]["found"] && _category[_cat]["enabled"];
  901. _color = "color:lightgrey;";
  902. if (_status) {
  903. _color = "color:black;";
  904. }
  905. if (_optional) {
  906. document.getElementById(_cat+"_"+_name+"_enabled").disabled = !_status;
  907. document.getElementById(_cat+"_"+_name+"_enabled").style=_color;
  908. }
  909. if (!_param[_cat][_name]["enabled"]) {
  910. _status = false;
  911. _color = "color:lightgrey;";
  912. }
  913. document.getElementById(_cat+"_"+_name+"_text").disabled = !_status;
  914. document.getElementById(_cat+"_"+_name+"_text").style = _color;
  915. setEnabled(_cat+"_"+_name, _status);
  916. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  917. document.getElementById(_cat+"_"+_name+"_value"+j).disabled = !_status;
  918. document.getElementById(_cat+"_"+_name+"_value"+j).style=_color;
  919. }
  920. console.log("EnDisableItem end");
  921. }
  922. function ReadParameter(_param, _cat, _name, _optional){
  923. if (_param[_cat][_name]["found"]){
  924. if (_optional) {
  925. _param[_cat][_name]["enabled"] = document.getElementById(_cat+"_"+_name+"_enabled").checked;
  926. }
  927. for (var j = 0; j < _param[_cat][_name]["anzParam"]; ++j) {
  928. let element = document.getElementById(_cat+"_"+_name+"_value"+(j+1));
  929. console.log("check value", element.tagName, element.value, _param[_cat][_name].checkRegExList == null ? null : _param[_cat][_name].checkRegExList[j]);
  930. if (element.tagName.toLowerCase() == "select") {
  931. _param[_cat][_name]["value1"] = element.selectedIndex > -1 ? element.options[element.selectedIndex].text : "";
  932. }
  933. else {
  934. if ((_param[_cat][_name].checkRegExList != null) && (_param[_cat][_name].checkRegExList[j] != null)) {
  935. console.log("check regex", element.value.match(_param[_cat][_name].checkRegExList[j]));
  936. if (!element.value.match(_param[_cat][_name].checkRegExList[j])) {
  937. element.classList.add("invalid-input");
  938. } else {
  939. element.classList.remove("invalid-input");
  940. }
  941. }
  942. _param[_cat][_name]["value"+(j+1)] = element.value;
  943. }
  944. }
  945. }
  946. }
  947. function UpdateInput() {
  948. console.log("UpdateInput");
  949. document.getElementById("Category_Analog_enabled").checked = category["Analog"]["enabled"];
  950. document.getElementById("Category_Digits_enabled").checked = category["Digits"]["enabled"];
  951. document.getElementById("Category_MQTT_enabled").checked = category["MQTT"]["enabled"];
  952. document.getElementById("Category_GPIO_enabled").checked = category["GPIO"]["enabled"];
  953. WriteParameter(param, category, "MakeImage", "LogImageLocation", true);
  954. WriteParameter(param, category, "MakeImage", "LogfileRetentionInDays", true);
  955. WriteParameter(param, category, "MakeImage", "WaitBeforeTakingPicture", false);
  956. WriteParameter(param, category, "MakeImage", "ImageQuality", false);
  957. WriteParameter(param, category, "MakeImage", "Brightness", false);
  958. // WriteParameter(param, category, "MakeImage", "Contrast", false);
  959. // WriteParameter(param, category, "MakeImage", "Saturation", false);
  960. WriteParameter(param, category, "MakeImage", "ImageSize", false, true);
  961. WriteParameter(param, category, "MakeImage", "FixedExposure", false, true);
  962. WriteParameter(param, category, "Alignment", "SearchFieldX", false);
  963. WriteParameter(param, category, "Alignment", "SearchFieldY", false);
  964. WriteParameter(param, category, "Alignment", "AlignmentAlgo", true, true);
  965. WriteParameter(param, category, "Digits", "Model", false);
  966. WriteParameter(param, category, "Digits", "LogImageLocation", true);
  967. WriteParameter(param, category, "Digits", "LogfileRetentionInDays", true);
  968. WriteParameter(param, category, "Digits", "ModelInputSize", false, 2);
  969. WriteParameter(param, category, "Analog", "Model", false);
  970. WriteParameter(param, category, "Analog", "LogImageLocation", true);
  971. WriteParameter(param, category, "Analog", "LogfileRetentionInDays", true);
  972. WriteParameter(param, category, "Analog", "ExtendedResolution", true);
  973. WriteParameter(param, category, "Analog", "ModelInputSize", false, 2);
  974. WriteParameter(param, category, "PostProcessing", "DecimalShift", true);
  975. WriteParameter(param, category, "PostProcessing", "PreValueUse", true);
  976. WriteParameter(param, category, "PostProcessing", "PreValueAgeStartup", true);
  977. WriteParameter(param, category, "PostProcessing", "AllowNegativeRates", true);
  978. WriteParameter(param, category, "PostProcessing", "MaxRateValue", true);
  979. WriteParameter(param, category, "PostProcessing", "ErrorMessage", true);
  980. WriteParameter(param, category, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  981. WriteParameter(param, category, "MQTT", "Uri", true);
  982. WriteParameter(param, category, "MQTT", "Topic", true);
  983. WriteParameter(param, category, "MQTT", "TopicError", true);
  984. WriteParameter(param, category, "MQTT", "TopicRate", true);
  985. WriteParameter(param, category, "MQTT", "TopicTimeStamp", true);
  986. WriteParameter(param, category, "MQTT", "TopicUptime", true);
  987. WriteParameter(param, category, "MQTT", "MainTopicGPIO", true);
  988. WriteParameter(param, category, "MQTT", "ClientID", true);
  989. WriteParameter(param, category, "MQTT", "user", true);
  990. WriteParameter(param, category, "MQTT", "password", true);
  991. WriteParameter(param, category, "GPIO", "IO16", true, 2);
  992. WriteParameter(param, category, "AutoTimer", "AutoStart", false);
  993. WriteParameter(param, category, "AutoTimer", "Intervall", false);
  994. WriteParameter(param, category, "Debug", "Logfile", true);
  995. WriteParameter(param, category, "Debug", "LogfileRetentionInDays", true);
  996. WriteParameter(param, category, "System", "TimeZone", true);
  997. WriteParameter(param, category, "System", "Hostname", true);
  998. WriteParameter(param, category, "System", "TimeServer", true);
  999. console.log("UpdateInput end");
  1000. }
  1001. function ReadParameterAll()
  1002. {
  1003. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1004. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1005. category["MQTT"]["enabled"] = document.getElementById("Category_MQTT_enabled").checked;
  1006. category["GPIO"]["enabled"] = document.getElementById("Category_GPIO_enabled").checked;
  1007. ReadParameter(param, "MakeImage", "LogImageLocation", true);
  1008. ReadParameter(param, "MakeImage", "LogfileRetentionInDays", true);
  1009. ReadParameter(param, "MakeImage", "WaitBeforeTakingPicture", false);
  1010. ReadParameter(param, "MakeImage", "ImageQuality", false);
  1011. ReadParameter(param, "MakeImage", "Brightness", false);
  1012. // ReadParameter(param, "MakeImage", "Contrast", false);
  1013. // ReadParameter(param, "MakeImage", "Saturation", false);
  1014. ReadParameter(param, "MakeImage", "ImageSize", false);
  1015. ReadParameter(param, "MakeImage", "FixedExposure", false);
  1016. ReadParameter(param, "Alignment", "SearchFieldX", false);
  1017. ReadParameter(param, "Alignment", "SearchFieldY", false);
  1018. ReadParameter(param, "Alignment", "AlignmentAlgo", true);
  1019. ReadParameter(param, "Digits", "Model", false);
  1020. ReadParameter(param, "Digits", "LogImageLocation", true);
  1021. ReadParameter(param, "Digits", "LogfileRetentionInDays", true);
  1022. ReadParameter(param, "Digits", "ModelInputSize", false);
  1023. ReadParameter(param, "Analog", "Model", false);
  1024. ReadParameter(param, "Analog", "LogImageLocation", true);
  1025. ReadParameter(param, "Analog", "LogfileRetentionInDays", true);
  1026. ReadParameter(param, "Analog", "ExtendedResolution", true);
  1027. ReadParameter(param, "Analog", "ModelInputSize", false);
  1028. ReadParameter(param, "PostProcessing", "DecimalShift", true);
  1029. ReadParameter(param, "PostProcessing", "PreValueUse", true);
  1030. ReadParameter(param, "PostProcessing", "PreValueAgeStartup", true);
  1031. ReadParameter(param, "PostProcessing", "AllowNegativeRates", true);
  1032. ReadParameter(param, "PostProcessing", "MaxRateValue", true);
  1033. ReadParameter(param, "PostProcessing", "ErrorMessage", true);
  1034. ReadParameter(param, "PostProcessing", "CheckDigitIncreaseConsistency", true);
  1035. ReadParameter(param, "MQTT", "Uri", true);
  1036. ReadParameter(param, "MQTT", "Topic", true);
  1037. ReadParameter(param, "MQTT", "TopicError", true);
  1038. ReadParameter(param, "MQTT", "TopicRate", true);
  1039. ReadParameter(param, "MQTT", "TopicTimeStamp", true);
  1040. ReadParameter(param, "MQTT", "TopicUptime", true);
  1041. ReadParameter(param, "MQTT", "MainTopicGPIO", true);
  1042. ReadParameter(param, "MQTT", "ClientID", true);
  1043. ReadParameter(param, "MQTT", "user", true);
  1044. ReadParameter(param, "MQTT", "password", true);
  1045. ReadParameter(param, "GPIO", "IO16", true);
  1046. ReadParameter(param, "AutoTimer", "AutoStart", false);
  1047. ReadParameter(param, "AutoTimer", "Intervall", false);
  1048. ReadParameter(param, "Debug", "Logfile", true);
  1049. ReadParameter(param, "Debug", "LogfileRetentionInDays", true);
  1050. ReadParameter(param, "System", "TimeZone", true);
  1051. ReadParameter(param, "System", "Hostname", true);
  1052. ReadParameter(param, "System", "TimeServer", true);
  1053. FormatDecimalValue(param, "PostProcessing", "MaxRateValue");
  1054. }
  1055. function WriteConfig(){
  1056. ReadParameterAll();
  1057. return setConfigParameters(param, category);
  1058. }
  1059. function FormatDecimalValue(_param, _cat, _name) {
  1060. console.log("FormatDecimalValue");
  1061. for (var j = 1; j <= _param[_cat][_name]["anzParam"]; ++j) {
  1062. var _val = _param[_cat][_name]["value"+j];
  1063. _val = _val.replace(",", ".");
  1064. _param[_cat][_name]["value"+j] = _val;
  1065. }
  1066. console.log("FormatDecimalValue end");
  1067. }
  1068. function UpdateAfterCategoryCheck() {
  1069. console.log("UpdateAfterCategoryCheck");
  1070. ReadParameterAll();
  1071. category["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
  1072. category["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
  1073. UpdateInput();
  1074. console.log("UpdateAfterCategoryCheck end");
  1075. }
  1076. function UpdateExpertModus()
  1077. {
  1078. console.log("UpdateExpertModus");
  1079. var _style = 'display:none;';
  1080. if (document.getElementById("ExpertModus_enabled").checked) {
  1081. _style = '';
  1082. document.getElementById("Edit_Config_Direct").style.display = "";
  1083. }
  1084. else
  1085. {
  1086. document.getElementById("Edit_Config_Direct").style.display = "none";
  1087. }
  1088. const expert = document.querySelectorAll(".expert");
  1089. for (var i = 0; i < expert.length; i++) {
  1090. document.getElementById(expert[i].id).style = _style;
  1091. }
  1092. console.log("UpdateExpertModus end");
  1093. }
  1094. function saveTextAsFile()
  1095. {
  1096. console.log("saveTextAsFile");
  1097. if (confirm("Are you sure you want to update \"config.ini\"?")) {
  1098. var textToSave = WriteConfig();
  1099. if (document.getElementsByClassName("invalid-input").length > 0) {
  1100. alert("Settings cannot be saved. Please check your entries.");
  1101. return;
  1102. }
  1103. FileDeleteOnServer("/config/config.ini", basepath);
  1104. FileSendContent(textToSave, "/config/config.ini", basepath);
  1105. }
  1106. console.log("saveTextAsFile end");
  1107. }
  1108. function doReboot() {
  1109. console.log("doReboot");
  1110. if (confirm("Are you sure you want to reboot the ESP32?")) {
  1111. var stringota = "/reboot";
  1112. window.location = stringota;
  1113. window.location.href = stringota;
  1114. window.location.assign(stringota);
  1115. window.location.replace(stringota);
  1116. }
  1117. console.log("doReboot end");
  1118. }
  1119. function editConfigDirect() {
  1120. console.log("editConfigDirect");
  1121. if (confirm("Did you save your changes?")) {
  1122. var stringota = "/edit_config.html";
  1123. window.location = stringota;
  1124. window.location.href = stringota;
  1125. window.location.assign(stringota);
  1126. window.location.replace(stringota);
  1127. }
  1128. console.log("editConfigDirect end");
  1129. }
  1130. LoadConfigNeu();
  1131. </script>
  1132. </body>
  1133. </html>