Roel Schiphorst 3 éve
szülő
commit
0fc894a610

+ 1 - 0
RemoteIDModule/status.cpp

@@ -196,6 +196,7 @@ String status_json(void)
     snprintf(githash, sizeof(githash), "(%08x)", GIT_VERSION);
     const json_table_t table[] = {
         { "STATUS:VERSION", String(FW_VERSION_MAJOR) + "." + String(FW_VERSION_MINOR) + " " + githash},
+        { "STATUS:BOARD_ID", String(BOARD_ID)},
         { "STATUS:UPTIME", String(hr) + ":" + String(minsec_str) },
         { "STATUS:FREEMEM", String(ESP.getFreeHeap()) },
         { "BASICID:UAType", ENUM_MAP(uatype, UAS_data.BasicID[0].UAType) },

BIN
RemoteIDModule/web/images/bluemark.png


+ 4 - 10
RemoteIDModule/web/index.html

@@ -11,7 +11,7 @@
 </head>
 
 <body>
-  <a href="/index.html"><img src="images/logo.jpg" alt="ArduPilot"></a></p>
+  <a href="/index.html"><img id="logo" src="" alt="logo"></a></p>
   <h1>ArduRemoteID</h1>
 
   <h2>Status</h2>
@@ -20,6 +20,7 @@
     <legend>System</legend>
     <table class="values">
       <tr><td>Version</td><td><div id="STATUS:VERSION"></div></td></tr>
+      <tr><td>Board</td><td><div id="STATUS:BOARD"></div></td></tr>
       <tr><td>Up Time</td><td><div id="STATUS:UPTIME"></div></td></tr>
       <tr><td>Free Memory</td><td><div id="STATUS:FREEMEM"></div></td></tr>
     </table>
@@ -87,14 +88,8 @@
   </fieldset>
 
   <h2>Documentation</h2>
-
-  <ul>
-    <li><a href="https://ardupilot.org/ardupilot/index.html">ArduPilot Project</a></li>
-    <li><a href="https://github.com/ArduPilot/ArduRemoteID">ArduRemoteID Project</a></li>
-    <li><a href="https://ardupilot.org/plane/docs/common-remoteid.html">ArduPilot RemoteID Documentation</a></li>
-    <li><a href="https://www.opendroneid.org/">OpenDroneID Website</a></li>
-  </ul>
-
+  <div id="documentation">
+  </div>
   <h2>Firmware Update</h2>
 
   <form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>
@@ -135,6 +130,5 @@
     // poll status information at 1Hz (900ms to cope with some lag)
     ajax_json_poll_fill("/ajax/status.json", 900);
     </script>
-  
 </body>
 </html>

+ 33 - 0
RemoteIDModule/web/js/tools.js

@@ -40,6 +40,39 @@ function page_fill_json_html(json) {
         var element = document.getElementById(v);
         if (element) {
             element.innerHTML = json[v];
+        } else if (v == "STATUS:BOARD_ID") {
+			if(typeof page_fill_json_html.run_once == 'undefined' ) {
+				//run this code only once to avoid updating these fields
+                if (json[v] == "3") {
+                    document.getElementById("logo").src="images/bluemark.png";
+                    document.getElementById("logo").alt="BlueMark";
+                    document.getElementById("STATUS:BOARD").innerText = "BlueMark db200";
+                    document.getElementById("documentation").innerHTML = "<ul><li><a href='https://download.bluemark.io/db200.pdf'>db200 manual</a></li><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
+                    document.body.style.background = "#fafafa";
+                } else if (json[v] == "4") {
+                    document.getElementById("logo").src="images/bluemark.png";
+                    document.getElementById("logo").alt="BlueMark";
+                    document.getElementById("STATUS:BOARD").innerText = "BlueMark db110";
+                    document.getElementById("documentation").innerHTML = "<ul><li><a href='https://download.bluemark.io/db110.pdf'>db110 manual</a></li><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
+                    document.body.style.background = "#fafafa";
+                } else {
+                    document.getElementById("logo").src="images/logo.jpg";
+                    document.getElementById("logo").alt="ArduPilot";
+
+                    if (json[v] == "1") {
+						document.getElementById("STATUS:BOARD").innerText = "ESP32S3_DEV";
+					} else  if (json[v] == "2") {
+						document.getElementById("STATUS:BOARD").innerText = "ESP32C3_DEV";
+					} else	if (json[v] == "5") {
+						document.getElementById("STATUS:BOARD").innerText = "JW_TBD";
+					} else {
+						document.getElementById("STATUS:BOARD").innerText = "unknown";
+					}
+
+                    document.getElementById("documentation").innerHTML = "<ul><li><a href='https://ardupilot.org/ardupilot/index.html'>ArduPilot Project</a></li><li><a href='https://github.com/ArduPilot/ArduRemoteID'>ArduRemoteID Project</a></li><li><a href='https://ardupilot.org/plane/docs/common-remoteid.html'>ArduPilot RemoteID Documentation</a></li><li><a href='https://www.opendroneid.org/'>OpenDroneID Website</a></li></ul>";
+                }
+			}
+			run_once = 1;
         }
     }
 }