added DTR state

This commit is contained in:
dj2ls 2022-10-06 10:08:31 +02:00
parent 2719875b35
commit b8ee0297a2
3 changed files with 37 additions and 3 deletions

View file

@ -64,6 +64,8 @@ const configDefaultSettings = '{\
"enable_hamlib_serialspeed" : "False",\
"hamlib_serialspeed" : "9600",\
"enable_hamlib_pttprotocol" : "False",\
"hamlib_dtrstate" : "OFF",\
"enable_hamlib_dtrstate" : "False",\
"hamlib_pttprotocol" : "USB",\
"enable_hamlib_pttport" : "False",\
"hamlib_pttport": "/dev/ttyACM1",\

View file

@ -109,6 +109,12 @@ set_setting_switch("enable_hamlib_ptt_port", "hamlib_ptt_port", config.enable_ha
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_port").value = config.hamlib_rigctld_port;
@ -531,6 +537,11 @@ set_setting_switch("enable_hamlib_ptt_port", "hamlib_ptt_port", config.enable_ha
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', () => {
@ -622,6 +633,16 @@ document.getElementById('hamlib_rigctld_start').addEventListener('click', () =>
paramList = paramList.concat('--ptt-type=', hamlib_ptt_type)
}
// hamlib dtr state
if (document.getElementById('enable_hamlib_dtrstate').checked){
var hamlib_dtrstate = document.getElementById("hamlib_dtrstate").value;
paramList = paramList.concat('--set-conf=dtr_state=' + hamlib_dtrstate)
}
var hamlib_rigctld_server_port = document.getElementById("hamlib_rigctld_server_port").value;
paramList = paramList.concat('-t', hamlib_rigctld_server_port)

View file

@ -615,14 +615,13 @@
<option value="RIG">RIG</option>
<option value="USB">USB</option>
<option value="RTS">Serial RTS</option>
<option value="DTR-H">Serial DTR-High</option>
<option value="DTR-L">Serial DTR-Low</option>
<option value="PARALLEL">Rig PARALLEL</option>
<option value="MICDATA">Rig MICDATA</option>
<option value="CM108">Rig CM108</option>
</select>
</div>
<div class="input-group input-group-sm mb-1"> <span class="input-group-text" id="basic-addon1">DCD</span> <span class="input-group-text" id="basic-addon1">
<div class="input-group input-group-sm mb-1">
<span class="input-group-text" id="basic-addon1">DCD</span> <span class="input-group-text" id="basic-addon1">
<input class="form-check-sm form-check-input" type="checkbox" id="enable_hamlib_dcd">
</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_dcd" style="width: 0.5rem">
@ -633,7 +632,19 @@
<option value="CD">CD</option>
<option value="PARALLEL">PARALLEL</option>
</select>
<span class="input-group-text" id="basic-addon1">DTR</span> <span class="input-group-text" id="basic-addon1">
<input class="form-check-sm form-check-input" type="checkbox" id="enable_hamlib_dtrstate">
</span>
<select class="form-select form-select-sm" aria-label=".form-select-sm" id="hamlib_dtrstate" style="width: 0.5rem">
<option value="OFF">OFF</option>
<option value="ON">ON</option>
</select>
</div>
</div>
<!-- RADIO CONTROL NETWORK -->
<div id="radio-control-network">