got most of the WebUI updated and working
This commit is contained in:
parent
9301607468
commit
c9fba23e70
@ -1,8 +0,0 @@
|
||||
import subprocess
|
||||
|
||||
revision = (
|
||||
subprocess.check_output(["git", "rev-parse", "--short=10", "HEAD"])
|
||||
.strip()
|
||||
.decode("utf-8")
|
||||
)
|
||||
print("-DGIT_REV='\"%s\"'" % revision)
|
@ -3,6 +3,12 @@ env.Execute("\"$PYTHONEXE\" -m pip install jinja2")
|
||||
|
||||
import struct2json
|
||||
import dtcs
|
||||
from os import popen
|
||||
|
||||
git_revision = popen('git rev-parse --short HEAD').read().strip()
|
||||
|
||||
env.Replace(PROGNAME="firmware_%s.fw" % git_revision)
|
||||
env.Append(CPPDEFINES=[('GIT_REV', '\\"{}\\"'.format(git_revision))])
|
||||
|
||||
struct2json.struct2json()
|
||||
dtcs.build_dtcs()
|
@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>%DEVICENAME%</title>
|
||||
<title>KTM CAN Chain Oiler</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="static/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="static/css/custom.css">
|
||||
@ -11,6 +11,8 @@
|
||||
<script src="static/js/jquery.min.js"></script>
|
||||
<script src="static/js/bootstrap.min.js"></script>
|
||||
<script src="static/js/websocket.js"></script>
|
||||
<script src="static/js/dtc_table.js"></script>
|
||||
<script src="static/js/script.js"></script>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="static/img/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="static/img/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="static/img/favicon-16x16.png">
|
||||
@ -18,11 +20,22 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Connection-Overlay -->
|
||||
<div id="overlay">
|
||||
<div class="overlay-content">
|
||||
<p>Verbinde...</p>
|
||||
<span class="loader"></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Connection-Overlay -->
|
||||
<!-- Notification-Container -->
|
||||
<div id="notification-container" class="notification-container"></div>
|
||||
<!-- Notification-Container -->
|
||||
|
||||
<nav class="navbar fixed-top navbar-dark bg-primary" id="navbar1">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img src="static/img/logo.png" width="30" height="30" class="d-inline-block align-top mr-1" alt="">
|
||||
%DEVICENAME%
|
||||
DE Airsoft Timer
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsingNavbar"
|
||||
aria-controls="collapsingNavbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@ -35,7 +48,6 @@
|
||||
<li class="nav-item"><a class="nav-link active" role="tab" data-toggle="tab" href="#tab_home">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" role="tab" data-toggle="tab" href="#tab_maintenance">Wartung</a></li>
|
||||
<li class="nav-item"><a class="nav-link" role="tab" data-toggle="tab" href="#tab_source">Einstellungen</a></li>
|
||||
<li class="nav-item"><a class="nav-link" role="tab" data-toggle="tab" href="#tab_sysinfo">Systeminfo</a></li>
|
||||
<li class="nav-item"><a class="nav-link" role="tab" data-toggle="tab" href="#tab_fwupdate">Update</a></li>
|
||||
|
||||
</ul>
|
||||
@ -51,17 +63,17 @@
|
||||
<div class="col text-center">
|
||||
<div class="jumbotron">
|
||||
<img src="static/img/logo.png" width="120" height="120" class="img-fluid" alt="">
|
||||
<h3 class="pt-3">%DEVICENAME%</h3>
|
||||
<h3 class="pt-3">KTM CAN Chain Lube</h3>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Div Group Battery remain -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Akku Ladestand</h4>
|
||||
<h4>Akkuladestand</h4>
|
||||
<div class="progress">
|
||||
<div class="progress-bar text-light" role="progressbar" aria-valuenow="%BAT_REMAIN_CAPACITY%"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: %BAT_REMAIN_CAPACITY%%">
|
||||
%BAT_REMAIN_CAPACITY%%
|
||||
<div id="battery_level" class="data-battery_level progress-bar text-light" role="progressbar" aria-valuenow="0"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
0
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
@ -70,7 +82,7 @@
|
||||
<hr />
|
||||
<p>
|
||||
<h4>aktueller Modus</h4>
|
||||
<input class="form-control" type="text" placeholder="%SYSTEM_STATUS%" readonly>
|
||||
<input class="data-systemstatus form-control" type="text" id="sysstatus" readonly>
|
||||
</p>
|
||||
<!-- Div Group current Mode -->
|
||||
<!-- Div Group Faction Points -->
|
||||
@ -79,9 +91,9 @@
|
||||
<h4>aktueller Punktestand</h4>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col text-center %FACTION_1_ACTIVE% text-white p-3">%NAME_FAC_1%</div>
|
||||
<div class="col text-center %FACTION_2_ACTIVE% text-white p-3">%NAME_FAC_2%</div>
|
||||
<div class="col text-center %FACTION_3_ACTIVE% text-white p-3">%NAME_FAC_3%</div>
|
||||
<div id="header_faction1" class="col text-center data-name_faction1 text-white p-3">%NAME_FAC_1%</div>
|
||||
<div id="header_faction2" class="col text-center data-name_faction2 text-white p-3">%NAME_FAC_2%</div>
|
||||
<div id="header_faction3" class="col text-center data-name_faction3 text-white p-3">%NAME_FAC_3%</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col bg-dark text-white p-3"><img src="static/img/logo_fac1.png"
|
||||
@ -95,19 +107,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-center bg-secondary text-white p-3">%POINTS_FAC_1%</div>
|
||||
<div class="col text-center bg-secondary text-white p-3">%POINTS_FAC_2%</div>
|
||||
<div class="col text-center bg-secondary text-white p-3">%POINTS_FAC_3%</div>
|
||||
<div id="time_faction1" class="data-time_faction1 col text-center bg-secondary text-white p-3 format-time">0</div>
|
||||
<div id="time_faction2" class="data-time_faction2 col text-center bg-secondary text-white p-3 format-time">0</div>
|
||||
<div id="time_faction3" class="data-time_faction3 col text-center bg-secondary text-white p-3 format-time">0</div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
<!-- Div GroupFaction Points -->
|
||||
<!-- Div Group DTC Table -->
|
||||
<div %SHOW_DTC_TABLE%>
|
||||
<div id="dtc_container" hidden>
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Fehlercodes</h4>
|
||||
<table class="table">
|
||||
<table class="table" id="dtc_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="col-6" scope="col">Zeitstempel</th>
|
||||
@ -115,7 +127,6 @@
|
||||
<th class="col-2" scope="col">Schwere</th>
|
||||
<th class="col-2" scope="col">Aktiv</th>
|
||||
</tr>
|
||||
%DTC_TABLE%
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
@ -131,254 +142,13 @@
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Punkte zurücksetzen</h4>
|
||||
<form action="post.htm" method="POST" class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button name="resetpoints" type="submit" class="btn btn-outline-primary">Reset</button>
|
||||
<button id="reset-timer" class="btn-wsevent btn btn-outline-primary ml-2">Timer zurücksetzen</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
<!-- Div Group Reset Timers -->
|
||||
<!-- Div Group EEPROM formatting -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>EEPROM formatieren</h4>
|
||||
<div class="alert alert-primary alert-dismissable show fade" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Achtung!</strong><br>
|
||||
Das Formatieren der EEPROM-Bereiche sollte nur ausgeführt werden wenn es unbedingt erforderlich ist!
|
||||
Hierdurch werden alle Einstellungen zurück gesetzt bzw. alle Betriebsdaten gehen verloren.
|
||||
Folgende Situationen erfordern unter anderem eine Formatierung:
|
||||
- Erstinitialisierung (bei neu aufgebautem Gerät)
|
||||
- Firmware-Update (nur wenn es die Release-Notes fordern)
|
||||
</div>
|
||||
<form action="post.htm" method="POST" class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<div class="offset-4 col-8">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="reset_ee_cfg" id="reset_ee_cfg">
|
||||
<label class="form-check-label" for="reset_ee_cfg">
|
||||
Bereich "CFG"
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="reset_ee_pds" id="reset_ee_pds">
|
||||
<label class="form-check-label" for="reset_ee_pds">
|
||||
Bereich "PDS"
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button name="reset_ee_btn" type="submit" class="btn btn-outline-primary">EEPROM formatieren</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
<!-- Div Group EEPROM formatting -->
|
||||
<!-- Div Group Device Reboot -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Gerät neustarten</h4>
|
||||
<form action="post.htm" method="POST" class="form-horizontal">
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button name="reboot" type="submit" class="btn btn-outline-primary">Reboot</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
<!-- Div Group Device Reboot -->
|
||||
</div>
|
||||
<!-- Div Tab Maintenance -->
|
||||
<!-- Div Tab Settings-->
|
||||
<div id="tab_source" class="tab-pane fade" role="tabpanel">
|
||||
<h3>Einstellungen</h3>
|
||||
<!-- Div Group Battery Type -->
|
||||
<hr />
|
||||
<p>
|
||||
<form action="post.htm" method="POST" class="form-horizontal">
|
||||
<h4>Akku-Variante</h4>
|
||||
<div class="form-group row">
|
||||
<label for="battery_select" class="control-label col-4">Akku</label>
|
||||
<div class="col-8">
|
||||
<select id="battery_select" name="battery_select" class="select form-control">
|
||||
%BATTERY_SELECT_OPTIONS%
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Timer-Einstellungen</h4>
|
||||
<div class="form-group row">
|
||||
<label for="factionreboot_cont" class="control-label col-4">active Faction Recovery</label>
|
||||
<div class="col-8">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="factionreboot_cont" id="factionreboot_cont"
|
||||
%FACTIONREBOOT_CHECKED%>
|
||||
<label class="form-check-label" for="factionreboot_cont">
|
||||
aktive Faktion beim booten wiederherstellen ?
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4>Faktionsbezeichnungen</h4>
|
||||
<div class="alert alert-primary alert-dismissable show fade" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Achtung!</strong><br>
|
||||
Faktionsbezeichnungen können nur aus ASCII-Zeichen bestehen, also A-Z, a-z und 0-9
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="faction_1_name" class="control-label col-4">Faktion 1</label>
|
||||
<div class="col-8">
|
||||
<div class="input-group">
|
||||
<input id="faction_1_name" name="faction_1_name" value="%NAME_FAC_1%" type="text" class="form-control" pattern="[A-Za-z0-9 _-]{1,32}">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="faction_2_name" class="control-label col-4">Faktion 2</label>
|
||||
<div class="col-8">
|
||||
<div class="input-group">
|
||||
<input id="faction_2_name" name="faction_2_name" value="%NAME_FAC_2%" type="text" class="form-control" pattern="[A-Za-z0-9 _-]{1,32}">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="faction_3_name" class="control-label col-4">Faktion 3</label>
|
||||
<div class="col-8">
|
||||
<div class="input-group">
|
||||
<input id="faction_3_name" name="faction_3_name" value="%NAME_FAC_3%" type="text" class="form-control" pattern="[A-Za-z0-9 _-]{1,32}">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button name="settingssave" type="submit" class="btn btn-outline-primary">Übernehmen</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
<!-- Div Group Battery Type -->
|
||||
</div>
|
||||
<!-- Div Tab Settings -->
|
||||
|
||||
<!-- Div Tab SystemInfo -->
|
||||
<div id="tab_sysinfo" class="tab-pane fade" role="tabpanel">
|
||||
<h3>Systeminfo</h3>
|
||||
<!-- Div Group Sysinfo:Geraeteinfo -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Gerät</h4>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="col-7" scope="col">Parameter</td>
|
||||
<th class="col-5" scope="col">Value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hostname</td>
|
||||
<td>%HOSTNAME%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Device-ID</td>
|
||||
<td>%DEVICENAME_ID%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Battery Voltage</td>
|
||||
<td>%BAT_VOLTAGE%V</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Battery Remain</td>
|
||||
<td>%BAT_REMAIN_CAPACITY%%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<!-- Div Group Sysinfo:Geraeteinfo -->
|
||||
<!-- Div Group Sysinfo:Settings -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Einstellungen</h4>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="col-7" scope="col">Parameter</td>
|
||||
<th class="col-5" scope="col">Value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Battery_type</td>
|
||||
<td>%BATTERY_TYPE%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Faction_recovery</td>
|
||||
<td>%FACTION_RECOVERY%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EEPROM Version</td>
|
||||
<td>%EEPROM_VERSION%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Checksum</td>
|
||||
<td>%CONFIG_CHECKSUM%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<!-- Div Group Sysinfo:Settings -->
|
||||
<!-- Div Group Sysinfo:Persistance -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Betriebsdaten</h4>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="col-7" scope="col">Parameter</td>
|
||||
<th class="col-5" scope="col">Value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>writeCycleCounter</td>
|
||||
<td>%WRITE_CYCLE_COUNT%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PersistenceMarker</td>
|
||||
<td>%PERSISTENCE_MARKER%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>activeFaction</td>
|
||||
<td>%ACTIVE_FACTION%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>faction_1_timer</td>
|
||||
<td>%POINTS_FAC_1%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>faction_2_timer</td>
|
||||
<td>%POINTS_FAC_2%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>faction_3_timer</td>
|
||||
<td>%POINTS_FAC_3%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>checksum</td>
|
||||
<td>%PERSISTANCE_CHECKSUM%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<!-- Div Group Sysinfo:Persistance -->
|
||||
<!-- Div Group LiveDebug -->
|
||||
<hr />
|
||||
<p>
|
||||
@ -388,14 +158,99 @@
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button id="btn-ws-start" class="btn btn-outline-primary">Start</button>
|
||||
<button id="btn-ws-stop" class="btn btn-outline-primary ml-2">Stop</button>
|
||||
<button id="debugstart" class="btn-wsevent btn btn-outline-primary ml-2">Start</button>
|
||||
<button id="debugstop" class="btn-wsevent btn btn-outline-primary ml-2">Stop</button>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
<!-- Div Group LiveDebug -->
|
||||
<!-- Div Group Device Reboot -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Gerät neustarten</h4>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button id="reboot" class="btn-wsevent confirm btn btn-outline-primary">Reboot</button>
|
||||
</div>
|
||||
<!-- Div Tab SystemInfo -->
|
||||
</div>
|
||||
</p>
|
||||
<!-- Div Group Device Reboot -->
|
||||
</div>
|
||||
<!-- Div Tab Maintenance -->
|
||||
|
||||
<!-- Div Tab Settings-->
|
||||
<div id="tab_source" class="tab-pane fade" role="tabpanel">
|
||||
<h3>Einstellungen</h3>
|
||||
<!-- Div Group Battery Type -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Akku</h4>
|
||||
<div class="form-group row">
|
||||
<label for="batterytype" class="control-label col-4">Akku-Variante</label>
|
||||
<div class="col-8">
|
||||
<select id="batterytype" class="set-wsevent data-batterytype select form-control">
|
||||
<option value="Undefined">Undefined</option>
|
||||
<option value="LiPo3S">LiPo 3S</option>
|
||||
<option value="LiPo2S">LiPo 2S</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
<!-- Div Group Battery Type -->
|
||||
<!-- Div Group Timer Settings -->
|
||||
<hr />
|
||||
<p>
|
||||
<h4>Timer Einstellungen</h4>
|
||||
<div class="form-group row">
|
||||
<label for="active_faction_on_reboot" class="control-label col-4">Aktive Fraktion wiederherstellen</label>
|
||||
<div class="col-8">
|
||||
<div class="form-check">
|
||||
<input class="set-wsevent data-active_faction_on_reboot form-check-input" type="checkbox" id="active_faction_on_reboot">
|
||||
<label class="form-check-label" for="active_faction_on_reboot">
|
||||
aktivieren
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="name_faction1" class="control-label col-4">Faktion 1</label>
|
||||
<div class="col-8">
|
||||
<input id="name_faction1" type="text" class="set-wsevent data-name_faction1 form-control" required="required">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max. 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="name_faction2" class="control-label col-4">Faktion 2</label>
|
||||
<div class="col-8">
|
||||
<input id="name_faction2" type="text" class="set-wsevent data-name_faction2 form-control" required="required">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max. 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="name_faction3" class="control-label col-4">Faktion 3</label>
|
||||
<div class="col-8">
|
||||
<input id="name_faction3" type="text" class="set-wsevent data-name_faction3 form-control" required="required">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">max. 32 Zeichen</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Div Group Timer Settings -->
|
||||
<!-- Div Group Save Button-->
|
||||
<hr />
|
||||
<p>
|
||||
<div class="form-group row">
|
||||
<div class="col text-center">
|
||||
<button id="settingssave" class="btn-wsevent btn btn-outline-primary">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<!-- Div Tab Settings -->
|
||||
|
||||
<!-- Div Tab Firmware Update-->
|
||||
<div id="tab_fwupdate" class="tab-pane fade" role="tabpanel">
|
||||
@ -480,25 +335,24 @@
|
||||
<!-- Div Tab Firmware Update-->
|
||||
</div>
|
||||
<!-- Tabs Content -->
|
||||
</main>
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
|
||||
<!-- Footer -->
|
||||
|
||||
<footer class="page-footer navbar-dark bg-primary font-small fixed-bottom">
|
||||
<footer class="page-footer navbar-dark bg-primary font-small fixed-bottom">
|
||||
<div class="container-fluid text-center">
|
||||
<div class="footer-copyright text-center py-3">
|
||||
<span class="text-muted">© 2023 -
|
||||
<a class="text-reset fw-bold" href="https://hiabuto.de/">Hiabuto Defense Systems</a></span>
|
||||
<a class="text-reset fw-bold" href="https://eventronics.de/">Marcel Peterkau</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
|
||||
<!-- Footer -->
|
||||
<!-- Footer -->
|
||||
|
||||
<!-- Modal Dialog -->
|
||||
<!-- Modal Dialog -->
|
||||
|
||||
<div class="modal fade" id="dtcModal" tabindex="-1" role="dialog" aria-labelledby="dtcModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="dtcModal" tabindex="-1" role="dialog" aria-labelledby="dtcModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -516,50 +370,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Dialog -->
|
||||
<!-- Modal Dialog -->
|
||||
|
||||
<script>
|
||||
$('.navbar-nav>li>a').on('click', function () {
|
||||
$('.navbar-collapse').collapse('hide');
|
||||
});
|
||||
|
||||
document.querySelector('.custom-file-input').addEventListener('change', function (e) {
|
||||
var fileName = document.getElementById("fw-update-file").files[0].name;
|
||||
var nextSibling = e.target.nextElementSibling
|
||||
nextSibling.innerText = fileName
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("tr[data-dtc]").each(function (i) {
|
||||
$(this).attr('data-toggle', "modal");
|
||||
$(this).attr('data-target', "#dtcModal");
|
||||
});
|
||||
});
|
||||
|
||||
$('#dtcModal').on('show.bs.modal', function (event) {
|
||||
var dtctr = $(event.relatedTarget)
|
||||
var dtc = dtctr.data('dtc')
|
||||
var debugval = dtctr.data('debugval')
|
||||
var modal = $(this)
|
||||
$.getJSON('static/tt_dtc/dtc_' + dtc + '.json', function (data) {
|
||||
modal.find('.modal-title').text(data.title)
|
||||
modal.find('.dtc-desc').text(data.description)
|
||||
if (debugval > 0) {
|
||||
modal.find('.dtc-debugval').text("Debugvalue: " + debugval)
|
||||
}
|
||||
else {
|
||||
modal.find('.dtc-debugval').remove()
|
||||
}
|
||||
}).fail(function () {
|
||||
console.log("An error has occurred.");
|
||||
modal.find('.modal-title').text("Fehler")
|
||||
modal.find('.dtc-desc').text("DTC-Beschreibung konnte nicht geladen werden")
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
@ -58,6 +58,17 @@ typedef enum eSystem_Status
|
||||
sysStat_Shutdown
|
||||
} tSystem_Status;
|
||||
|
||||
typedef enum batteryType_e
|
||||
{
|
||||
BATTERY_UNDEFINED,
|
||||
BATTERY_LIPO_2S,
|
||||
BATTERY_LIPO_3S
|
||||
} batteryType_t;
|
||||
|
||||
// String representation of SpeedSource enum
|
||||
extern const char *BatteryString[];
|
||||
extern const size_t BatteryString_Elements;
|
||||
|
||||
#define STARTUP_DELAY 2500
|
||||
#define SHUTDOWN_DELAY_MS 2500
|
||||
|
||||
|
@ -57,20 +57,6 @@ typedef struct
|
||||
uint32_t checksum;
|
||||
} persistenceData_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BATTERY_UNDEFINED,
|
||||
BATTERY_LIPO_2S,
|
||||
BATTERY_LIPO_3S
|
||||
} batteryType_t;
|
||||
|
||||
const char BatteryString[][10]{
|
||||
"Undefined",
|
||||
"LiPo 2S",
|
||||
"LiPo 3S"};
|
||||
|
||||
const size_t BatteryString_Elements = sizeof(BatteryString) / sizeof(BatteryString[0]);
|
||||
|
||||
// Structure for configuration settings stored in EEPROM
|
||||
typedef struct
|
||||
{
|
||||
|
8
Software/src/common.cpp
Normal file
8
Software/src/common.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include "common.h"
|
||||
|
||||
const char *BatteryString[] = {
|
||||
"Undefined",
|
||||
"LiPo 2S",
|
||||
"LiPo 3S"};
|
||||
|
||||
const size_t BatteryString_Elements = sizeof(BatteryString) / sizeof(BatteryString[0]);
|
@ -288,6 +288,18 @@ void Debug_printSystemInfo()
|
||||
Debug_pushMessage("OTA-Pass: %s\n", QUOTE(ADMIN_PASSWORD));
|
||||
Debug_pushMessage("Git-Revision: %s\n", constants.GitHash);
|
||||
Debug_pushMessage("Sw-Version: %d.%02d\n", constants.FW_Version_major, constants.FW_Version_minor);
|
||||
|
||||
Debug_pushMessage("globals.systemStatus: %d\n", globals.systemStatus);
|
||||
Debug_pushMessage("globals.resumeStatus: %d\n", globals.resumeStatus);
|
||||
Debug_pushMessage("globals.systemStatustxt: %s\n", globals.systemStatustxt);
|
||||
Debug_pushMessage("globals.requestEEAction: %d\n", globals.requestEEAction);
|
||||
Debug_pushMessage("globals.DeviceName: %s\n", globals.DeviceName);
|
||||
Debug_pushMessage("globals.FlashVersion: %s\n", globals.FlashVersion);
|
||||
Debug_pushMessage("globals.eePersistanceAdress: %u\n", globals.eePersistanceAdress);
|
||||
Debug_pushMessage("globals.hasDTC: %d\n", globals.hasDTC);
|
||||
Debug_pushMessage("globals.loadvoltage_mV: %d\n", globals.loadvoltage_mV);
|
||||
Debug_pushMessage("globals.battery_level: %d\n", globals.battery_level);
|
||||
Debug_pushMessage("globals.timer_disabled: %d\n", globals.timer_disabled);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -6,4 +6,5 @@ void initGlobals()
|
||||
{
|
||||
globals.systemStatus = sysStat_Startup;
|
||||
globals.requestEEAction = EE_IDLE;
|
||||
globals.systemStatustxt[0] = 0;
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ void loop()
|
||||
tmrWiFiMaintainConnection.update();
|
||||
#endif
|
||||
|
||||
static tSystem_Status lastStatus = sysStat_Error;
|
||||
static tSystem_Status lastStatus = sysStat_Init;
|
||||
|
||||
// Handle different system statuses
|
||||
switch (globals.systemStatus)
|
||||
@ -293,7 +293,12 @@ void loop()
|
||||
}
|
||||
SystemShutdown(false);
|
||||
break;
|
||||
|
||||
case sysStat_Error:
|
||||
if (lastStatus != globals.systemStatus)
|
||||
{
|
||||
strcpy_P(globals.systemStatustxt, PSTR("Error"));
|
||||
lastStatus = globals.systemStatus;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ AsyncWebServer webServer(80);
|
||||
|
||||
const char *PARAM_MESSAGE = "message";
|
||||
|
||||
batteryType_t batterytypePreselect; /**< Preselect Memory for change Batterytype */
|
||||
|
||||
String processor(const String &var);
|
||||
void WebserverNotFound_Callback(AsyncWebServerRequest *request);
|
||||
void WebserverFirmwareUpdate_Callback(AsyncWebServerRequest *request, const String &filename, size_t index, uint8_t *data, size_t len, bool final);
|
||||
@ -446,8 +448,14 @@ void Websocket_HandleButtons(uint8_t *data)
|
||||
char value[32];
|
||||
|
||||
parseWebsocketString((char *)data, identifier, sizeof(identifier), value, sizeof(value));
|
||||
|
||||
if (strcmp(identifier, "debugstart") == 0)
|
||||
if (strcmp(identifier, "reset-timer") == 0)
|
||||
{
|
||||
PersistenceData.activeFaction = NONE;
|
||||
PersistenceData.faction_1_timer = 0;
|
||||
PersistenceData.faction_2_timer = 0;
|
||||
PersistenceData.faction_3_timer = 0;
|
||||
}
|
||||
else if (strcmp(identifier, "debugstart") == 0)
|
||||
{
|
||||
SetDebugportStatus(dbg_Webui, enabled);
|
||||
}
|
||||
@ -457,6 +465,7 @@ void Websocket_HandleButtons(uint8_t *data)
|
||||
}
|
||||
else if (strcmp(identifier, "settingssave") == 0)
|
||||
{
|
||||
ConfigData.batteryType = batterytypePreselect;
|
||||
globals.requestEEAction = EE_CFG_SAVE;
|
||||
}
|
||||
else if (strcmp(identifier, "reboot") == 0)
|
||||
@ -484,7 +493,33 @@ void Websocket_HandleSettings(uint8_t *data)
|
||||
|
||||
parseWebsocketString((char *)data, identifier, sizeof(identifier), value, sizeof(value));
|
||||
|
||||
if (strcmp(identifier, "wifi-ssid") == 0)
|
||||
if (strcmp(identifier, "active_faction_on_reboot") == 0)
|
||||
{
|
||||
ConfigData.active_faction_on_reboot = value[0] == '1' ? true : false;
|
||||
}
|
||||
|
||||
else if (strcmp(identifier, "name_faction1") == 0)
|
||||
{
|
||||
strncpy(ConfigData.Faction_1_Name, value, sizeof(ConfigData.Faction_1_Name));
|
||||
}
|
||||
else if (strcmp(identifier, "name_faction2") == 0)
|
||||
{
|
||||
strncpy(ConfigData.Faction_2_Name, value, sizeof(ConfigData.Faction_2_Name));
|
||||
}
|
||||
else if (strcmp(identifier, "name_faction3") == 0)
|
||||
{
|
||||
strncpy(ConfigData.Faction_3_Name, value, sizeof(ConfigData.Faction_3_Name));
|
||||
}
|
||||
else if (strcmp(identifier, "batterytype") == 0)
|
||||
{
|
||||
strncpy(ConfigData.wifi_client_ssid, value, sizeof(ConfigData.wifi_client_ssid));
|
||||
}
|
||||
else if (strcmp(identifier, "batterytype") == 0)
|
||||
{
|
||||
int index = findIndexByString(value, BatteryString, BatteryString_Elements);
|
||||
batterytypePreselect = (batteryType_t)index;
|
||||
}
|
||||
else if (strcmp(identifier, "wifi-ssid") == 0)
|
||||
{
|
||||
strncpy(ConfigData.wifi_client_ssid, value, sizeof(ConfigData.wifi_client_ssid));
|
||||
}
|
||||
@ -579,6 +614,8 @@ void Websocket_RefreshClientData_Status(uint32_t client_id, bool send_mapping)
|
||||
webSocket.text(client_id, mapping);
|
||||
else
|
||||
webSocket.textAll(mapping);
|
||||
|
||||
Debug_pushMessage("send MAPPING_STATUS WS-Client Data\n");
|
||||
}
|
||||
|
||||
String temp = "STATUS:";
|
||||
|
Loading…
x
Reference in New Issue
Block a user