inital commit

This commit is contained in:
Wolfgang 2024-05-14 21:10:53 +02:00
parent f3223e4556
commit 50e58f1628
3 changed files with 499 additions and 0 deletions

11
.eslintrc Normal file
View file

@ -0,0 +1,11 @@
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12
},
"rules": {},
"plugins": [ "html" ]
}

145
band-plan.html Normal file
View file

@ -0,0 +1,145 @@
<!-- SPDX-License-Identifier: Beerware -->
<!-- Wolfgang Kroener wrote this file. As long as you retain this notice -->
<!-- you can do whatever you want with this stuff. If we meet some day, -->
<!-- and you think this stuff is worth it, you can buy me a beer in return -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>band plan</title>
<style>
body>div {
padding-bottom: 1em;
}
</style>
</head>
<body>
<link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet">
<script src="https://unpkg.com/browser-cjs/require.min.js"></script>
<script src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script>
<script src="https://unpkg.com/jspdf/dist/jspdf.umd.min.js"></script>
<script src="https://unpkg.com/jspdf-autotable/dist/jspdf.plugin.autotable.min.js"></script>
<script>
// require in browser-cjs
// eslint-disable-next-line no-undef
const yaml = require('https://unpkg.com/js-yaml/dist/js-yaml.min.js');
// eslint-disable-next-line no-undef
const Measures = require('https://unpkg.com/measures/dist/measures.cjs.js');
// eslint-disable-next-line no-undef
const path = require('https://unpkg.com/path-browserify/index.js');
document.addEventListener('DOMContentLoaded', () => {
update_plan();
});
// eslint-disable-next-line no-unused-vars
function filter_with_not(headerValue, rowValue, rowData, filterParams){
if (headerValue.startsWith('!')) {
// filter not
const str = headerValue.slice(1);
if ((str.length > 0) && (typeof rowValue !== "undefined")) {
return !rowValue.toString().includes(str);
} else {
return true;
}
} else {
// filter normal
if (typeof rowValue !== "undefined") {
return rowValue.toString().includes(headerValue);
} else {
return false;
}
}
}
function update_plan() {
fetch(document.getElementById('sel_plan').value).then((response) => {
return response.text();
}).then((data) => {
try {
const bands = yaml.load(data);
var tdata = [];
bands.forEach((band) => {
band.parts.forEach((part) => {
tdata.push({
"band": band.band,
"mode": band.mode,
//"band_start": band.start,
//"band_end": band.end,
"bandwidth": band.bandwidth,
"description": part.description,
"frequency": typeof part.at !== "undefined" ? part.at : part.start + '\u2013' + part.end ,
});
});
});
// require in tabular-tables
// eslint-disable-next-line no-undef
var table = new Tabulator("#data-table", {
layout: "fitDataTable",
initialSort: [
{column: "frequency", dir: "asc"},
{column: "band", dir: "desc"},
],
selectableRows: true,
data: tdata,
columns: [
// eslint-disable-next-line no-unused-vars
{title: "band", field: "band", headerFilter: "input", sorter: function(a, b, aRow, bRow, column, dir, sorterParams){
return parseFloat(new Measures().from(a).to('m')) - parseFloat(new Measures().from(b).to('m'));
}},
{title: "frequency/kHz", field: "frequency", sorter: "number", headerFilter: "input", headerFilterFunc: filter_with_not},
{title: "bandwidth/Hz", field: "bandwidth", headerFilter: "input", headerFilterFunc: filter_with_not},
{title: "mode", field: "mode", headerFilter: "input", headerFilterFunc: filter_with_not},
//{title: "band_start", field: "band_start", headerFilter: "input"},
//{title: "band_end", field: "band_end", headerFilter: "input"},
{title: "description", field: "description", headerFilter: "input", headerFilterFunc: filter_with_not},
],
});
document.getElementById("print").addEventListener("click", () => {
let download_range = "all";
if (table.getSelectedRows().length > 0) {
download_range = "selected";
}
table.download("pdf", path.basename(document.getElementById('sel_plan').value, '.yml') + '.pdf', {}, download_range);
});
//["band", "frequency", "bandwidth", "mode", "description"].forEach((col) => {
table.getColumns().forEach((col) => {
document.getElementById("toggle-" + col).addEventListener("click", () => {
table.toggleColumn(col);
});
});
document.getElementById("error").innerText = "";
} catch (e) {
console.log(e);
document.getElementById("error").innerText = e;
}
});
}
</script>
<div>
<form name="selection">
<label>plan:
<input name="plan" id="sel_plan" type="text" value="/plan-de.yml">
</label>
<button onclick="update_plan()">Change plan</button>
<button id="print">Print plan</button>
</form>
</div>
<div>
<button id="toggle-band">Toggle band</button>
<button id="toggle-frequency">Toggle frequency</button>
<button id="toggle-bandwidth">Toggle bandwidth</button>
<button id="toggle-mode">Toggle mode</button>
<button id="toggle-description">Toggle description</button>
</div>
<div>
Use filter with "!" as "not".
</div>
<div id="data-table"></div>
<div id="error"></div>
</body>
</html>

343
plan-de.yml Normal file
View file

@ -0,0 +1,343 @@
- band: 2.2 km
mode: CW
bandwidth: 200
start: 135.7
end: 137.8
parts:
- description: CW, QRSS and narrow band digital modes
start: 135.7
end: 137.8
- band: 630 m
mode: CW
bandwidth: 200
start: 472
end: 475
parts:
- description: CW
start: 472
end: 475
- band: 630 m
mode: Narrow band modes
bandwidth: 500
start: 475
end: 479
parts:
- description: CW, Digimodes, Bandwidth of 500 Hz suggested
start: 475
end: 479
- band: 160 m
mode: CW
bandwidth: 200
start: 1810
end: 1838
parts:
- start: 1810
end: 1838
- description: CW QRP Centre of Activity
at: 1836
- band: 160 m
mode: Narrow band modes
bandwidth: 500
start: 1838
end: 1840
parts:
- start: 1838
end: 1840
- band: 160 m
mode: All modes
bandwidth: 2700
parts:
- description: Digimodes
start: 1840
end: 1843
- start: 1843
end: 2000
- band: 80 m
mode: CW
bandwidth: 200
start: 3500
end: 3570
parts:
- description: Priority for inter-continental operation
start: 3500
end: 3510
- description: CW contest preferred
start: 3510
end: 3560
- description: CW QRS Centre of Activity
at: 3555
- start: 3560
end: 3570
- description: CW QRP Centre of Activity
at: 3560
- band: 80 m
mode: Narrow band modes
bandwidth: 200
start: 3570
end: 3580
parts:
- description: Digimodes
start: 3570
end: 3580
- band: 80 m
mode: Narrow band modes
bandwidth: 500
start: 3580
end: 3600
parts:
- description: Digimodes
start: 3580
end: 3590
- description: Digimodes, automatically controlled data stations (unattended)
start: 3590
end: 3600
- band: 80 m
mode: All modes
bandwidth: 2700
start: 3600
end: 3800
parts:
- description: Digimodes, automatically controlled data stations (unattended)
start: 3600
end: 3620
- description: SSB contest preferred
start: 3600
end: 3650
- description: Digital Voice Centre of Activity
at: 3630
- start: 3650
end: 3700
- description: SSB QRP Centre of Activity
at: 3690
- description: SSB contest preferred
start: 3700
end: 3775
- description: Image Centre of Activity
at: 3735
- description: R1 Emergency Centre of Activity
at: 3760
- description: SSB contest preferred - Priority for inter-continental operation
start: 3775
end: 3800
- band: 60 m
mode: CW, Narrow band modes
bandwidth: 200
start: 5351.5
end: 5354.0
parts:
- description: CW, Narrow band modes
start: 5351.5
end: 5354.0
- band: 60 m
mode: All modes
bandwidth: 2700
start: 5354
end: 5366
parts:
- description: USB recommended for voice operation
start: 5354
end: 5366
- band: 60 m
bandwidth: 20
start: 5366.0
end: 5366.5
parts:
- description: Weak signal narrow band modes
start: 5366.0
end: 5366.5
- band: 40 m
mode: CW
bandwidth: 200
start: 7000
end: 7040
parts:
- start: 7000
end: 7040
- description: CW, QRP Centre of Activity
at: 7030
- band: 40 m
mode: Narrow band modes
bandwidth: 500
start: 7040
end: 7050
parts:
- description: Digimodes
start: 7040
end: 7047
- description: Digimodes, automatically controlled data stations (unattended)
start: 7047
end: 7050
- band: 40 m
mode: All modes
bandwidth: 2700
start: 7050
end: 7200
parts:
- description: Digimodes, automatically controlled data stations (unattended)
start: 7050
end: 7053
- description: Digimodes
start: 7053
end: 7060
- description: SSB contest preferred
start: 7060
end: 7100
- description: Digital Voice Centre of Activity
at: 7070
- description: SSB QRP Centre of Activity
at: 7090
- description: R1 Emergency Centre of Activity
at: 7110
- start: 7100
end: 7130
- description: SSB contest preferred
start: 7130
end: 7175
- description: Image Centre of Activity
at: 7165
- description: SSB contest preferred - Priority for inter-continental Activity
start: 7175
end: 7200
- band: 30 m
mode: CW
bandwidth: 200
start: 10100
end: 10130
parts:
- start: 10100
end: 10130
- description: CW QRP Centre of Activity
at: 10116
- band: 30 m
mode: Narrow band modes
bandwidth: 500
start: 10130
end: 10150
parts:
- description: Digimodes
start: 10130
end: 10150
- band: 20 m
mode: CW
bandwidth: 200
start: 14000
end: 14070
parts:
- description: CW contest preferred
start: 14000
end: 14060
- description: QRS Centre of Activity
at: 14055
- start: 14060
end: 14070
- description: CW QRP Centre of Activity
at: 14060
- band: 20 m
mode: Narrow band modes
bandwidth: 500
start: 14070
end: 14099
parts:
- description: Digimodes
start: 14070
end: 14089
- description: Digimodes, automatically controlled data stations (unattended)
start: 14089
end: 14099
- band: 20 m
mode: International Beacon Project
start: 14099
end: 14101
parts:
- description: Beacons exclusively
start: 14099
end: 14101
- band: 20 m
mode: All modes
bandwidth: 2700
start: 141101
end: 14350
parts:
- description: Digimodes, automatically controlled data stations (unattended)
start: 141101
end: 14112
- start: 14112
end: 14125
- description: SSB contest preferred
start: 14125
end: 14300
- description: Digital Voice Centre of Activity
at: 14130
- description: Priority for DX-peditions
start: 14190
end: 14200
- description: Image Centre of Activity
at: 14230
- description: SSB QRP Centre of Activity
at: 14285
- start: 14300
end: 14350
- description: Global Emergency Centre of Activity
at: 14300
- band: 17 m
mode: CW
bandwidth: 200
start: 18068
end: 18095
parts:
- start: 18068
end: 18095
- description: CW QRP Centre of Activity
at: 18086
- band: 17 m
mode: Narrow band modes
bandwidth: 500
start: 18095
end: 18109
parts:
- description: Digimodes
start: 18095
end: 18105
- description: Digimodes, automatically controlled data stations (unattended)
start: 18105
end: 18109
- band: 17 m
mode: International Beacon Project
start: 18109
end: 18111
parts:
- description: Beacons exclusively
start: 18109
end: 18111
- band: 17 m
mode: All modes
bandwidth: 2700
start: 18111
end: 18168
parts:
- description: Digimodes, automatically controlled data stations (unattended)
start: 18111
end: 18120
- start: 18120
end: 18168
- description: SSB QRP Centre of Activity
at: 18130
- description: Digital Voice Centre of Activity
at: 18150
- description: Emergency Centre of Activity
at: 18160
#- band: 10 m
# mode: SSBTest
# bandwidth: 2700
# start: 28320
# end: 29000
# parts:
# -
# description: Digital Voice
# at: 28330
# -
# description: QRP
# at: 28360
# -
# description: Image Centre of Activity
# at: 28680