diff --git a/sd-card/html/edit_config_param.html b/sd-card/html/edit_config_param.html index 5e482ac9..aacac873 100644 --- a/sd-card/html/edit_config_param.html +++ b/sd-card/html/edit_config_param.html @@ -295,7 +295,7 @@ textarea { - Path to CNN model file for image recognition + Path to CNN model file for image recognition. Check the documentation for details. @@ -371,7 +371,7 @@ textarea { - Path to CNN model file for image recognition + Path to CNN model file for image recognition. Check the documentation for details. @@ -1939,26 +1939,42 @@ function WriteModelFiles() { list_tflite = getTFLITEList(); - var _index1 = document.getElementById("Digits_Model_value1"); - var _index2 = document.getElementById("Analog_Model_value1"); - while (_index1.length) - _index1.remove(0); - while (_index2.length) - _index2.remove(0); + var _indexDig = document.getElementById("Digits_Model_value1"); + var _indexAna = document.getElementById("Analog_Model_value1"); + while (_indexDig.length) + _indexDig.remove(0); + while (_indexAna.length) + _indexAna.remove(0); for (var i = 0; i < list_tflite.length; ++i){ - var option1 = document.createElement("option"); - var option2 = document.createElement("option"); - option1.text = list_tflite[i]; - option1.value = list_tflite[i]; - option2.text = list_tflite[i]; - option2.value = list_tflite[i]; - _index1.add(option1); - _index2.add(option2); + var optionDig = document.createElement("option"); + var optionAna = document.createElement("option"); + + var text = list_tflite[i].replace("/config/", ""); + + if (list_tflite[i].includes("/dig-")) { // Its a digital file, only show in the digital list box + optionDig.text = text; + optionDig.value = list_tflite[i]; + _indexDig.add(optionDig); } + else if (list_tflite[i].includes("/ana-")) { // Its a digital file, only show in the analog list box + optionAna.text = text; + optionAna.value = list_tflite[i]; + _indexAna.add(optionAna); + } + else { // all other files, show in both list boxes + optionDig.text = text; + optionDig.value = list_tflite[i]; + _indexDig.add(optionDig); + + optionAna.text = text; + optionAna.value = list_tflite[i]; + _indexAna.add(optionAna); + } + } - WriteParameter(param, category, "Analog", "Model", false); - WriteParameter(param, category, "Digits", "Model", false); + WriteParameter(param, category, "Analog", "Model", false); + WriteParameter(param, category, "Digits", "Model", false); } function ReadParameterAll()