1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

introduce NMEA filter

This commit is contained in:
andreas
2021-11-03 19:36:28 +01:00
parent 2028525cc9
commit 3cf67d387e
5 changed files with 183 additions and 4 deletions

View File

@@ -36,6 +36,20 @@
"default": "true",
"description": "convert NMEA0183 from the USB port to NMEA2000"
},
{
"name": "usbReadFilter",
"label": "USB read Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when reading from USB\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA"
},
{
"name": "usbWriteFilter",
"label": "USB write Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when writing to USB\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA"
},
{
"name": "serialDirection",
"label": "serial direction",
@@ -78,6 +92,22 @@
"description": "convert NMEA0183 from the serial port to NMEA2000",
"capabilities":{"serialmode":["RX","BI","UNI"]}
},
{
"name": "serialReadFilter",
"label": "serial read Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when reading from serial\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA",
"capabilities":{"serialmode":["RX","BI","UNI"]}
},
{
"name": "serialWriteFilter",
"label": "serial write Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when writing to serial\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA",
"capabilities":{"serialmode":["TX","BI","UNI"]}
},
{
"name": "serverPort",
"label": "TCP port",
@@ -114,6 +144,20 @@
"default": "true",
"description": "convert NMEA0183 from TCP clients to NMEA2000"
},
{
"name": "tcpReadFilter",
"label": "TCP read Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when reading from TCP\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA"
},
{
"name": "tcpWriteFilter",
"label": "TCP write Filter",
"type": "filter",
"default": "",
"description": "filter for NMEA0183 data when writing to TCP\nempty to let all data pass\nexamples:\n! \t: all AIS\n$RMB,$APB \t: only NMEA RMB and APB\n^! \t: no AIS but other NMEA"
},
{
"name": "sendSeasmart",
"label": "Seasmart to TCP",

View File

@@ -142,6 +142,16 @@
}
}
}
function showOverlay(text){
let el=document.getElementById('overlayContent');
el.textContent=text;
let container=document.getElementById('overlayContainer');
container.classList.remove('hidden');
}
function hideOverlay(){
let container=document.getElementById('overlayContainer');
container.classList.add('hidden');
}
function checkChange(el) {
let loaded = el.getAttribute('data-loaded');
if (loaded !== undefined) {
@@ -240,7 +250,7 @@
bt = document.createElement('button');
bt.classList.add('infoButton');
bt.addEventListener('click', function (ev) {
alert(item.description);
showOverlay(item.description);
});
bt.textContent = "?";
row.appendChild(bt);
@@ -309,6 +319,34 @@ button.infoButton {
display: block;
}
.overlayContainer {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #80808070;
display: flex;
}
.overlayContainer.hidden{
display: none;
}
div#overlay {
margin: auto;
background-color: white;
padding: 0.5em;
}
div#overlayContent {
padding: 0.5em;
white-space: pre;
}
.overlayButtons {
border-top: 1px solid grey;
padding-top: 0.5em;
display: flex;
flex-direction: row;
justify-content: end;
}
</style>
</head>
<body>
@@ -362,6 +400,16 @@ button.infoButton {
</div>
</div>
</div>
<div class="overlayContainer hidden" id="overlayContainer">
<div id="overlay">
<div id="overlayContent">
AHA
</div>
<div class="overlayButtons">
<button id="hideOverlay">Close</button>
</div>
</div>
</div>
</body>
</html>