Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
int2001 committed Nov 9, 2024
2 parents 145032d + 660787f commit 64a3ef4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
15 changes: 11 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,21 @@
</div>
<div class="row">
<div class="col">
<div class="mb-3">
<div class="mb-3 col-mb3">
<label for="wavelog_radioname">Radio Name</label>
<input type="text" class="form-control form-control-sm" name="wavelog_radioname"
id="wavelog_radioname" value="" />
</div>
</div>
<div class="col"></div>
<div class="col">
<div class="mb-2 col-mb-2"></div>
</div>
<div class="col">
<div class="mb-1 col-mb-1">
<label for="wavelog_pmode" class="text-center">Set MODE via FLRig</label>
<input type="checkbox" value="1" class="form-control form-control-sm" name="wavelog_pmode" id="wavelog_pmode" title="Try to set Mode automatically" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col">
Expand All @@ -177,8 +185,7 @@
<div class="col">
<div class="mb-1 col-mb-1">
<label for="flrig_ena">FLRig Enabled</label>
<input type="checkbox" value="1" class="form-control form-control-sm" name="flrig_ena"
id="flrig_ena" value="" />
<input type="checkbox" value="1" class="form-control form-control-sm" name="flrig_ena" id="flrig_ena" value="" />
</div>
</div>
</div>
Expand Down
23 changes: 13 additions & 10 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var defaultcfg = {
wavelog_key: "mykey",
wavelog_id: 0,
wavelog_radioname: 'WLGate',
wavelog_pmode: true,
flrig_host: '127.0.0.1',
flrig_port: '12345',
flrig_ena: false,
Expand Down Expand Up @@ -338,16 +339,18 @@ async function settrx(qrg) {
let url="http://"+defaultcfg.flrig_host+':'+defaultcfg.flrig_port+'/';
x=await httpPost(url,options,postData);

postData= '<?xml version="1.0"?>';
postData+='<methodCall><methodName>rig.set_modeA</methodName><params><param><value>' + to.mode + '</value></param></params></methodCall>';
var options = {
method: 'POST',
headers: {
'User-Agent': 'SW2WL_v' + app.getVersion(),
'Content-Length': postData.length
}
};
x=await httpPost(url,options,postData);
if (defaultcfg.wavelog_pmode) {
postData= '<?xml version="1.0"?>';
postData+='<methodCall><methodName>rig.set_modeA</methodName><params><param><value>' + to.mode + '</value></param></params></methodCall>';
var options = {
method: 'POST',
headers: {
'User-Agent': 'SW2WL_v' + app.getVersion(),
'Content-Length': postData.length
}
};
x=await httpPost(url,options,postData);
}

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Gateway for connecting WSJT-* and FLRig to Wavelog",
"keywords": [],
"main": "./main.js",
"version": "1.0.17",
"version": "1.0.18",
"author": "DJ7NT",
"scripts": {
"start": "electron-forge start",
Expand Down
2 changes: 2 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ $(document).ready(function() {
$("#flrig_host").val(cfg.flrig_host);
$("#flrig_port").val(cfg.flrig_port);
$("#flrig_ena").prop("checked", cfg.flrig_ena);
$("#wavelog_pmode").prop("checked", cfg.wavelog_pmode);

bt_save.addEventListener('click', () => {
cfg.wavelog_url=$("#wavelog_url").val().trim();
Expand All @@ -35,6 +36,7 @@ $(document).ready(function() {
cfg.flrig_host=$("#flrig_host").val().trim();
cfg.flrig_port=$("#flrig_port").val().trim();
cfg.flrig_ena=$("#flrig_ena").is(':checked');
cfg.wavelog_pmode=$("#wavelog_pmode").is(':checked');
x=ipcRenderer.sendSync("set_config", cfg);
console.log(x);
});
Expand Down

0 comments on commit 64a3ef4

Please sign in to comment.