Added subGhz fixed channel support to tag config, added line accident… (#301)

* Added subGhz fixed channel support to tag config, added line accidentally dropped in pr7 merge.
This commit is contained in:
Skip Hansen
2024-04-19 01:22:15 -07:00
committed by GitHub
parent d40ef83d03
commit f4727483ad
4 changed files with 37 additions and 6 deletions

Binary file not shown.

View File

@@ -682,8 +682,8 @@
"key": "fixedchannel",
"name": "Fixed Channel",
"desc": "What channel should the tag initially join?",
"type": "select",
"options": {
"type": "chanselect",
"chans": {
"0": "-Auto",
"11": "11",
"15": "15",
@@ -691,6 +691,21 @@
"25": "25",
"26": "26",
"27": "27"
},
"subchans": {
"0": "-Auto",
"100": "100",
"101": "101",
"102": "102",
"103": "103",
"104": "104",
"105": "105",
"200": "200",
"201": "201",
"202": "202",
"203": "203",
"204": "204",
"205": "205"
}
}
]

View File

@@ -297,6 +297,7 @@ function processTags(tagArray) {
(async () => {
const localTagmac = tagmac;
const data = await getTagtype(element.hwType);
div.dataset.usetemplate = data.usetemplate;
if (data.usetemplate != 0) {
const template = await getTagtype(data.usetemplate);
}
@@ -523,6 +524,7 @@ function loadContentCard(mac) {
$('#cfglut').value = tagdata.lut;
$('#cfginvert').value = tagdata.invert;
$('#cfgmore').innerHTML = '▼';
$('#cfgmac').dataset.ch = tagdata.ch;
$('#configbox').showModal();
})
}
@@ -969,13 +971,27 @@ function contentselected() {
});
break;
case 'select':
case 'chanselect':
input = document.createElement("select");
for (const key in element.options) {
let options;
if(element.type == 'chanselect') {
if($('#cfgmac').dataset.ch < 100) {
options = element.chans;
}
else {
options = element.subchans;
}
}
else {
options = element.options
}
for (const key in options) {
const optionElement = document.createElement("option");
optionElement.value = key;
optionElement.text = element.options[key];
if (element.options[key].substring(0, 1) == "-") {
optionElement.text = element.options[key].substring(1);
optionElement.text = options[key];
if (options[key].substring(0, 1) == "-") {
optionElement.text = options[key].substring(1);
optionElement.selected = true;
} else {
optionElement.selected = false;