(output, outputHtml, diagnoseSdkVersion, recordingSdkVersion)
| 154 | return s |
| 155 | |
| 156 | def generateHtml(output, outputHtml, diagnoseSdkVersion, recordingSdkVersion): |
| 157 | s = HEAD |
| 158 | s += h1("Dataset report") |
| 159 | s += '<section>\n' |
| 160 | |
| 161 | summary = [] |
| 162 | summary.append({ |
| 163 | "id": None, |
| 164 | "title": "Outcome", |
| 165 | "value": passed(output["passed"], large=False) |
| 166 | }) |
| 167 | summary.append({ |
| 168 | "id": None, |
| 169 | "title": "Date", |
| 170 | "value": output['date'] |
| 171 | }) |
| 172 | summary.append({ |
| 173 | "id": None, |
| 174 | "title": "Dataset", |
| 175 | "value": output["dataset_path"] |
| 176 | }) |
| 177 | |
| 178 | if len(output["cameras"]) == 0: |
| 179 | summary.append({ |
| 180 | "id": None, |
| 181 | "title": "Cameras", |
| 182 | "value": "No data" |
| 183 | }) |
| 184 | else: |
| 185 | for camera in output["cameras"]: |
| 186 | summary.append({ |
| 187 | "id": f"camera_{camera['ind']}", |
| 188 | "title": f"Camera #{camera['ind']}", |
| 189 | "value": '{:.1f} Hz<span style="color: gray">, {} frames</span>'.format( |
| 190 | camera["frequency"], |
| 191 | camera["count"]) |
| 192 | }) |
| 193 | |
| 194 | SENSOR_NAMES = ["accelerometer", "gyroscope", "magnetometer", "barometer", "GNSS", "CPU", "VIO"] |
| 195 | for sensor in SENSOR_NAMES: |
| 196 | if sensor not in output: continue |
| 197 | summary.append({ |
| 198 | "id": sensor.lower(), |
| 199 | "title": sensor.capitalize() if sensor.islower() else sensor, |
| 200 | "value": 'No data' if output[sensor]["count"] == 0 else |
| 201 | '{:.1f} Hz<span style="color: gray">, {} samples</span>'.format( |
| 202 | output[sensor]["frequency"], |
| 203 | output[sensor]["count"]) |
| 204 | }) |
| 205 | |
| 206 | s += summaryTable(summary) |
| 207 | if not output["passed"]: s += p("One or more checks below failed.") |
| 208 | s += '</section>\n' |
| 209 | |
| 210 | if len(output["cameras"]) == 0: |
| 211 | camera = { |
| 212 | "diagnosis": "error", |
| 213 | "issues": [{"message": "Missing camera(s).", "diagnosis": "error"}], |
no test coverage detected