Compare commits

..

No commits in common. "c142be9e4aa652d3dd886d92b8c655d41645bf6c" and "e98837082e8db34046a365c2cc3e0315ed8aa1bc" have entirely different histories.

4 changed files with 81 additions and 116 deletions

View file

@ -1,7 +1,6 @@
{ {
"env": { "env": {
"browser": true, "browser": true
"es6": true
}, },
"extends": "eslint:recommended", "extends": "eslint:recommended",
"parserOptions": { "parserOptions": {

View file

@ -1,52 +1,52 @@
- header: true
columns: [power]
titles: {
power_a: Power A,
power_e: Power E,
power_n: Power N
}
- start: 135.7 - start: 135.7
end: 137.8 end: 137.8
power: {a: 1 W ERP} power_a: 1 W ERP
- start: 472 - start: 472
end: 479 end: 479
power: {a: 1 W ERP} power_a: 1 W ERP
- start: 1810 - start: 1810
end: 1850 end: 1850
power: {a: 750 W PEP, e: 100 W PEP} power_a: 750 W PEP
power_e: 100 W PEP
- start: 1850 - start: 1850
end: 1890 end: 1890
power: {a: 75 W PEP, e: 75 W PEP} power_a: 75 W PEP
power_e: 75 W PEP
- start: 1890 - start: 1890
end: 2000 end: 2000
power: {a: 10 W PEP, e: 10 W PEP} power_a: 10 W PEP
power_e: 10 W PEP
- start: 3500 - start: 3500
end: 3800 end: 3800
power: {a: 750 W PEP, e: 100 W PEP} power_a: 750 W PEP
power_e: 100 W PEP
- start: 5351.5 - start: 5351.5
end: 5366.5 end: 5366.5
power: {a: 15 W EIRP} power_a: 15 W EIRP
- start: 7000 - start: 7000
end: 7100 end: 7100
power: {a: 750 W PEP} power_a: 750 W PEP
- start: 7100 - start: 7100
end: 7200 end: 7200
power: {a: 750 W PEP} power_a: 750 W PEP
- start: 10100 - start: 10100
end: 10150 end: 10150
power: {a: 150 W PEP} power_a: 150 W PEP
- start: 14000 - start: 14000
end: 14350 end: 14350
power: {a: 750 W PEP} power_a: 750 W PEP
- start: 18068 - start: 18068
end: 18168 end: 18168
power: {a: 750 W PEP} power_a: 750 W PEP
- start: 21000 - start: 21000
end: 21450 end: 21450
power: {a: 750 W PEP, e: 100 W PEP} power_a: 750 W PEP
power_e: 100 W PEP
- start: 24890 - start: 24890
end: 24990 end: 24990
power: {a: 750 W PEP} power_a: 750 W PEP
- start: 28000 - start: 28000
end: 29700 end: 29700
power: {a: 750 W PEP, e: 100 W PEP, n: 10 W ERP} power_a: 750 W PEP
power_e: 100 W PEP
power_n: 10 W ERP

View file

@ -1,13 +1,3 @@
- header: true
columns: [band, frequency, mode, bandwidth, description]
part_columns: [description]
titles: {
band: Band,
frequency: Frequency / kHz,
mode: Mode,
bandwidth: Bandwidth / Hz,
description: Description
}
- band: 2.2 km - band: 2.2 km
mode: CW mode: CW
bandwidth: 200 bandwidth: 200

View file

@ -77,48 +77,32 @@ div#togglebuttons>button {
} }
function add_power(add, p) { function add_power(add, p) {
for (const [key, value] of Object.entries(add.power)) { if (typeof add.power_a !== "undefined") {
p["power_" + key] = value; p["power_a"] = add.power_a;
}
if (typeof add.power_e !== "undefined") {
p["power_e"] = add.power_e;
}
if (typeof add.power_n !== "undefined") {
p["power_n"] = add.power_n;
} }
} }
function update_table(bands, additions) { function update_table(bands, additions) {
var tdata = []; var tdata = [];
var base_header = {};
var add_header = {};
// first, fill base_header
bands.forEach((band) => { bands.forEach((band) => {
if ((typeof band.header !== "undefined") && band.header) {
base_header = structuredClone(band);
}
});
// then fill tdata
bands.forEach((band) => {
if ((typeof band.header === "undefined") || (band.header == false)) {
band.parts.forEach((part) => { band.parts.forEach((part) => {
let p = {}; let p = {
base_header.columns.forEach((col) => { "band": band.band,
if (base_header.part_columns.includes(col)) { "frequency": typeof part.at !== "undefined" ? part.at : part.start + '\u2013' + part.end,
p[col] = part[col]; "mode": band.mode,
} else { //"band_start": band.start,
p[col] = band[col]; //"band_end": band.end,
} "bandwidth": band.bandwidth,
}); "description": part.description,
p["frequency"] = typeof part.at !== "undefined" ? part.at : part.start + '\u2013' + part.end; };
// first, fill add_header
additions.forEach((add) => {
if ((typeof add.header !== "undefined") && add.header) {
add_header = structuredClone(add);
}
});
// then fill tdata
let parts_already_added = false; let parts_already_added = false;
additions.forEach((add) => { additions.forEach((add) => {
if ((typeof add.header === "undefined") || (add.header == false)) {
if (typeof part.at !== "undefined") { if (typeof part.at !== "undefined") {
if (isInRange(part.at, add.start, add.end)) { if (isInRange(part.at, add.start, add.end)) {
// at single frequency // at single frequency
@ -155,14 +139,12 @@ div#togglebuttons>button {
} }
} }
} }
}
}); });
if (!parts_already_added) { if (!parts_already_added) {
tdata.push(p); tdata.push(p);
} }
parts_already_added = false; parts_already_added = false;
}); });
}
}); });
// require in tabular-tables // require in tabular-tables
@ -180,7 +162,7 @@ div#togglebuttons>button {
autoColumnsDefinitions: function(definitions){ autoColumnsDefinitions: function(definitions){
definitions.forEach((column) => { definitions.forEach((column) => {
if (column.field == "band") { if (column.field == "band") {
column.sorter = function(a, b) { column.sorter = function(a, b, aRow, bRow, column, dir, sorterParams) {
return parseFloat(new Measures().from(a).to('m')) - parseFloat(new Measures().from(b).to('m')); return parseFloat(new Measures().from(a).to('m')) - parseFloat(new Measures().from(b).to('m'));
} }
} }
@ -191,12 +173,6 @@ div#togglebuttons>button {
column.headerFilter = "input"; column.headerFilter = "input";
column.headerFilterFunc = filter_with_not; column.headerFilterFunc = filter_with_not;
if (typeof base_header.titles[column.field] !== "undefined") {
column.title = base_header.titles[column.field];
}
if (typeof add_header.titles[column.field] !== "undefined") {
column.title = add_header.titles[column.field];
}
}); });
return definitions; return definitions;