removed hamlib enable/disable setting

This commit is contained in:
DJ2LS 2023-02-12 11:13:42 +01:00
parent d0c8af2623
commit 8f7f510e5f
3 changed files with 29 additions and 205 deletions

View file

@ -53,21 +53,13 @@ const configDefaultSettings =
"mygrid": "JN40aa",\ "mygrid": "JN40aa",\
"radiocontrol" : "disabled",\ "radiocontrol" : "disabled",\
"hamlib_deviceid": "RIG_MODEL_DUMMY_NOVFO",\ "hamlib_deviceid": "RIG_MODEL_DUMMY_NOVFO",\
"enable_hamlib_deviceport" : "False",\
"hamlib_deviceport": "/dev/ttyACM1",\ "hamlib_deviceport": "/dev/ttyACM1",\
"enable_hamlib_stop_bits" : "False",\
"hamlib_stop_bits" : "1",\ "hamlib_stop_bits" : "1",\
"enable_hamlib_data_bits" : "False",\
"hamlib_data_bits" : "8",\ "hamlib_data_bits" : "8",\
"enable_hamlib_handshake" : "False",\
"hamlib_handshake" : "None",\ "hamlib_handshake" : "None",\
"enable_hamlib_serialspeed" : "False",\
"hamlib_serialspeed" : "9600",\ "hamlib_serialspeed" : "9600",\
"enable_hamlib_pttprotocol" : "False",\
"hamlib_dtrstate" : "OFF",\ "hamlib_dtrstate" : "OFF",\
"enable_hamlib_dtrstate" : "False",\
"hamlib_pttprotocol" : "USB",\ "hamlib_pttprotocol" : "USB",\
"enable_hamlib_pttport" : "False",\
"hamlib_pttport": "/dev/ttyACM1",\ "hamlib_pttport": "/dev/ttyACM1",\
"hamlib_dcd": "None",\ "hamlib_dcd": "None",\
"hamlbib_serialspeed_ptt": "9600",\ "hamlbib_serialspeed_ptt": "9600",\

View file

@ -196,68 +196,6 @@ window.addEventListener("DOMContentLoaded", () => {
// hamlib settings // hamlib settings
document.getElementById("hamlib_deviceid").value = config.hamlib_deviceid; document.getElementById("hamlib_deviceid").value = config.hamlib_deviceid;
set_setting_switch(
"enable_hamlib_deviceport",
"hamlib_deviceport",
config.enable_hamlib_deviceport
);
set_setting_switch(
"enable_hamlib_ptt_port",
"hamlib_ptt_port",
config.enable_hamlib_ptt_port
);
document.getElementById("hamlib_serialspeed").value =
config.hamlib_serialspeed;
set_setting_switch(
"enable_hamlib_serialspeed",
"hamlib_serialspeed",
config.enable_hamlib_serialspeed
);
document.getElementById("hamlib_pttprotocol").value =
config.hamlib_pttprotocol;
set_setting_switch(
"enable_hamlib_pttprotocol",
"hamlib_pttprotocol",
config.enable_hamlib_pttprotocol
);
document.getElementById("hamlib_databits").value = config.hamlib_data_bits;
set_setting_switch(
"enable_hamlib_databits",
"hamlib_databits",
config.enable_hamlib_databits
);
document.getElementById("hamlib_stopbits").value = config.hamlib_stop_bits;
set_setting_switch(
"enable_hamlib_stopbits",
"hamlib_stopbits",
config.enable_hamlib_stopbits
);
document.getElementById("hamlib_handshake").value = config.hamlib_handshake;
set_setting_switch(
"enable_hamlib_handshake",
"hamlib_handshake",
config.enable_hamlib_handshake
);
document.getElementById("hamlib_dcd").value = config.hamlib_dcd;
set_setting_switch(
"enable_hamlib_dcd",
"hamlib_dcd",
config.enable_hamlib_dcd
);
document.getElementById("hamlib_dtrstate").value = config.hamlib_dtrstate;
set_setting_switch(
"enable_hamlib_dtrstate",
"hamlib_dtrstate",
config.enable_hamlib_dtrstate
);
document.getElementById("hamlib_rigctld_ip").value = config.hamlib_rigctld_ip; document.getElementById("hamlib_rigctld_ip").value = config.hamlib_rigctld_ip;
document.getElementById("hamlib_rigctld_port").value = document.getElementById("hamlib_rigctld_port").value =
config.hamlib_rigctld_port; config.hamlib_rigctld_port;
@ -577,75 +515,6 @@ window.addEventListener("DOMContentLoaded", () => {
fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
}); });
// radio settings 'enable hamlib deviceport' event listener
document
.getElementById("enable_hamlib_deviceport")
.addEventListener("change", () => {
enable_setting("enable_hamlib_deviceport", "hamlib_deviceport");
});
// radio settings 'enable hamlib serialspeed' event listener
document
.getElementById("enable_hamlib_serialspeed")
.addEventListener("change", () => {
enable_setting("enable_hamlib_serialspeed", "hamlib_serialspeed");
});
// radio settings 'enable hamlib data bits' event listener
document
.getElementById("enable_hamlib_databits")
.addEventListener("change", () => {
enable_setting("enable_hamlib_databits", "hamlib_databits");
});
// radio settings 'enable hamlib stop bits' event listener
document
.getElementById("enable_hamlib_stopbits")
.addEventListener("change", () => {
enable_setting("enable_hamlib_stopbits", "hamlib_stopbits");
});
// radio settings 'enable hamlib handshake' event listener
document
.getElementById("enable_hamlib_handshake")
.addEventListener("change", () => {
enable_setting("enable_hamlib_handshake", "hamlib_handshake");
});
// radio settings 'enable hamlib ptt port' event listener
document
.getElementById("enable_hamlib_ptt_port")
.addEventListener("change", () => {
enable_setting("enable_hamlib_ptt_port", "hamlib_ptt_port");
});
// radio settings 'enable hamlib ptt protocol' event listener
document
.getElementById("enable_hamlib_pttprotocol")
.addEventListener("change", () => {
enable_setting("enable_hamlib_pttprotocol", "hamlib_pttprotocol");
});
// radio settings 'enable hamlib dcd' event listener
document
.getElementById("enable_hamlib_dcd")
.addEventListener("change", () => {
enable_setting("enable_hamlib_dcd", "hamlib_dcd");
});
// radio settings 'enable hamlib dtr state' event listener
document
.getElementById("enable_hamlib_dtrstate")
.addEventListener("change", () => {
enable_setting("enable_hamlib_dtrstate", "hamlib_dtrstate");
});
/*
document.getElementById('hamlib_rigctld_path').addEventListener('change', () => {
var fileList = document.getElementById("dataModalFile").files;
console.log(fileList)
})
*/
document document
.getElementById("hamlib_rigctld_path") .getElementById("hamlib_rigctld_path")
@ -683,33 +552,33 @@ var fileList = document.getElementById("dataModalFile").files;
paramList = paramList.concat("-m", hamlib_deviceid); paramList = paramList.concat("-m", hamlib_deviceid);
// hamlib deviceport setting // hamlib deviceport setting
if (document.getElementById("enable_hamlib_deviceport").checked) { if (document.getElementById("hamlib_deviceport").value !== 'ignore') {
var hamlib_deviceport = var hamlib_deviceport =
document.getElementById("hamlib_deviceport").value; document.getElementById("hamlib_deviceport").value;
paramList = paramList.concat("-r", hamlib_deviceport); paramList = paramList.concat("-r", hamlib_deviceport);
} }
// hamlib serialspeed setting // hamlib serialspeed setting
if (document.getElementById("enable_hamlib_serialspeed").checked) { if (document.getElementById("hamlib_serialspeed").value !== 'ignore') {
var hamlib_serialspeed = var hamlib_serialspeed =
document.getElementById("hamlib_serialspeed").value; document.getElementById("hamlib_serialspeed").value;
paramList = paramList.concat("-s", hamlib_serialspeed); paramList = paramList.concat("-s", hamlib_serialspeed);
} }
// hamlib databits setting // hamlib databits setting
if (document.getElementById("enable_hamlib_databits").checked) { if (document.getElementById("hamlib_databits").value !== 'ignore') {
var hamlib_databits = document.getElementById("hamlib_databits").value; var hamlib_databits = document.getElementById("hamlib_databits").value;
paramList = paramList.concat("--set-conf=data_bits=" + hamlib_databits); paramList = paramList.concat("--set-conf=data_bits=" + hamlib_databits);
} }
// hamlib stopbits setting // hamlib stopbits setting
if (document.getElementById("enable_hamlib_stopbits").checked) { if (document.getElementById("hamlib_stopbits").value !== 'ignore') {
var hamlib_stopbits = document.getElementById("hamlib_stopbits").value; var hamlib_stopbits = document.getElementById("hamlib_stopbits").value;
paramList = paramList.concat("--set-conf=stop_bits=" + hamlib_stopbits); paramList = paramList.concat("--set-conf=stop_bits=" + hamlib_stopbits);
} }
// hamlib handshake setting // hamlib handshake setting
if (document.getElementById("enable_hamlib_handshake").checked) { if (document.getElementById("hamlib_handshake").value !== 'ignore') {
var hamlib_handshake = var hamlib_handshake =
document.getElementById("hamlib_handshake").value; document.getElementById("hamlib_handshake").value;
paramList = paramList.concat( paramList = paramList.concat(
@ -718,26 +587,26 @@ var fileList = document.getElementById("dataModalFile").files;
} }
// hamlib dcd setting // hamlib dcd setting
if (document.getElementById("enable_hamlib_dcd").checked) { if (document.getElementById("hamlib_dcd").value !== 'ignore') {
var hamlib_dcd = document.getElementById("hamlib_dcd").value; var hamlib_dcd = document.getElementById("hamlib_dcd").value;
paramList = paramList.concat("--dcd-type=" + hamlib_dcd); paramList = paramList.concat("--dcd-type=" + hamlib_dcd);
} }
// hamlib ptt port // hamlib ptt port
if (document.getElementById("enable_hamlib_ptt_port").checked) { if (document.getElementById("hamlib_ptt_port").value !== 'ignore') {
var hamlib_ptt_port = document.getElementById("hamlib_ptt_port").value; var hamlib_ptt_port = document.getElementById("hamlib_ptt_port").value;
paramList = paramList.concat("-p", hamlib_ptt_port); paramList = paramList.concat("-p", hamlib_ptt_port);
} }
// hamlib ptt type // hamlib ptt type
if (document.getElementById("enable_hamlib_pttprotocol").checked) { if (document.getElementById("hamlib_pttprotocol").value !== 'ignore') {
var hamlib_ptt_type = var hamlib_ptt_type =
document.getElementById("hamlib_pttprotocol").value; document.getElementById("hamlib_pttprotocol").value;
paramList = paramList.concat("--ptt-type=" + hamlib_ptt_type); paramList = paramList.concat("--ptt-type=" + hamlib_ptt_type);
} }
// hamlib dtr state // hamlib dtr state
if (document.getElementById("enable_hamlib_dtrstate").checked) { if (document.getElementById("hamlib_dtrstate").value !== 'ignore') {
var hamlib_dtrstate = document.getElementById("hamlib_dtrstate").value; var hamlib_dtrstate = document.getElementById("hamlib_dtrstate").value;
paramList = paramList.concat("--set-conf=dtr_state=" + hamlib_dtrstate); paramList = paramList.concat("--set-conf=dtr_state=" + hamlib_dtrstate);
} }

View file

@ -2031,12 +2031,7 @@
></i> ></i>
Device Port Device Port
</span> </span>
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_deviceport"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
@ -2056,22 +2051,18 @@
></i> ></i>
Serial Speed</span Serial Speed</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_serialspeed"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"
id="hamlib_serialspeed" id="hamlib_serialspeed"
> >
<option selected value="ignore">-- ignore --</option>
<option value="1200">1200</option> <option value="1200">1200</option>
<option value="2400">2400</option> <option value="2400">2400</option>
<option value="4800">4800</option> <option value="4800">4800</option>
<option selected value="9600">9600</option> <option value="9600">9600</option>
<option value="14400">14400</option> <option value="14400">14400</option>
<option value="19200">19200</option> <option value="19200">19200</option>
<option value="28800">28800</option> <option value="28800">28800</option>
@ -2084,18 +2075,14 @@
<span class="input-group-text" style="width: 180px" <span class="input-group-text" style="width: 180px"
>Data bits</span >Data bits</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_databits"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"
id="hamlib_databits" id="hamlib_databits"
> >
<option selected value="ignore">-- ignore --</option>
<option value="7">7</option> <option value="7">7</option>
<option value="8">8</option> <option value="8">8</option>
</select> </select>
@ -2104,18 +2091,14 @@
<span class="input-group-text" style="width: 180px" <span class="input-group-text" style="width: 180px"
>Stop Bits</span >Stop Bits</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_stopbits"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"
id="hamlib_stopbits" id="hamlib_stopbits"
> >
<option selected value="ignore">-- ignore --</option>
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>
</select> </select>
@ -2124,18 +2107,14 @@
<span class="input-group-text" style="width: 180px" <span class="input-group-text" style="width: 180px"
>Serial Handshake</span >Serial Handshake</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_handshake"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"
id="hamlib_handshake" id="hamlib_handshake"
> >
<option selected value="ignore">-- ignore --</option>
<option value="None">None (Default)</option> <option value="None">None (Default)</option>
</select> </select>
</div> </div>
@ -2148,31 +2127,21 @@
></i ></i
>PTT Device Port</span >PTT Device Port</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_ptt_port"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
aria-label=".form-select-sm" aria-label=".form-select-sm"
id="hamlib_ptt_port" id="hamlib_ptt_port"
> > <option selected value="ignore">-- ignore --</option>
<!--<option value="None">None</option>-->
</select> </select>
</div> </div>
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<span class="input-group-text" style="width: 180px" <span class="input-group-text" style="width: 180px"
>PTT Type</span >PTT Type</span
> >
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_pttprotocol"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
@ -2180,6 +2149,7 @@
id="hamlib_pttprotocol" id="hamlib_pttprotocol"
style="width: 0.5rem" style="width: 0.5rem"
> >
<option selected value="ignore">-- ignore --</option>
<option value="NONE">NONE</option> <option value="NONE">NONE</option>
<option value="RIG">RIG</option> <option value="RIG">RIG</option>
<option value="USB">USB</option> <option value="USB">USB</option>
@ -2191,12 +2161,7 @@
</div> </div>
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<span class="input-group-text" style="width: 180px">DCD</span> <span class="input-group-text" style="width: 180px">DCD</span>
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_dcd"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
@ -2204,6 +2169,7 @@
id="hamlib_dcd" id="hamlib_dcd"
style="width: 0.5rem" style="width: 0.5rem"
> >
<option selected value="ignore">-- ignore --</option>
<option value="NONE">NONE</option> <option value="NONE">NONE</option>
<option value="RIG">RIG/CAT</option> <option value="RIG">RIG/CAT</option>
<option value="DSR">DSR</option> <option value="DSR">DSR</option>
@ -2214,12 +2180,7 @@
</div> </div>
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<span class="input-group-text" style="width: 180px">DTR</span> <span class="input-group-text" style="width: 180px">DTR</span>
<span class="input-group-text">
<input
class="form-check-sm form-check-input"
type="checkbox"
id="enable_hamlib_dtrstate"
/>
</span> </span>
<select <select
class="form-select form-select-sm" class="form-select form-select-sm"
@ -2227,6 +2188,7 @@
id="hamlib_dtrstate" id="hamlib_dtrstate"
style="width: 0.5rem" style="width: 0.5rem"
> >
<option selected value="ignore">-- ignore --</option>
<option value="OFF">OFF</option> <option value="OFF">OFF</option>
<option value="ON">ON</option> <option value="ON">ON</option>
</select> </select>
@ -2248,6 +2210,7 @@
class="form-select form-select-sm" class="form-select form-select-sm"
id="tuning_range_fmin" id="tuning_range_fmin"
> >
<option value="-50.0">-50.0</option> <option value="-50.0">-50.0</option>
<option value="-100.0">-100.0</option> <option value="-100.0">-100.0</option>
<option value="-150.0">-150.0</option> <option value="-150.0">-150.0</option>