mirror of
https://github.com/dustinbrun/openwebrx_docker_installation.git
synced 2025-11-04 15:27:32 +01:00
added docker compose and plugins for openwebrx installation
This commit is contained in:
23
docker/openwebrx/plugins/receiver/screenshot/README.md
Normal file
23
docker/openwebrx/plugins/receiver/screenshot/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
layout: page
|
||||
title: "OpenWebRX+ Receiver Plugin: ScreenShot"
|
||||
permalink: /receiver/screenshot
|
||||
---
|
||||
|
||||
This `receiver` plugin will allow you to take screenshot of your waterfall.
|
||||
|
||||
## Preview
|
||||
|
||||

|
||||
|
||||
## Load
|
||||
|
||||
Add this line in your `init.js` file:
|
||||
|
||||
```js
|
||||
Plugins.load('https://0xaf.github.io/openwebrxplus-plugins/receiver/screenshot/screenshot.js');
|
||||
```
|
||||
|
||||
## init.js
|
||||
|
||||
Learn how to [load plugins](/openwebrxplus-plugins/#load-plugins).
|
||||
20
docker/openwebrx/plugins/receiver/screenshot/html2canvas.min.js
vendored
Normal file
20
docker/openwebrx/plugins/receiver/screenshot/html2canvas.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
66
docker/openwebrx/plugins/receiver/screenshot/screenshot.js
Normal file
66
docker/openwebrx/plugins/receiver/screenshot/screenshot.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Plugin: Screenshot - Take a screenshot of the waterfall
|
||||
*
|
||||
* License: MIT
|
||||
* Copyright (c) 2024 Stanislav Lechev [0xAF], LZ2SLL
|
||||
*/
|
||||
|
||||
|
||||
// no css for this plugin
|
||||
Plugins.screenshot.no_css = true;
|
||||
|
||||
// Initialize the plugin
|
||||
Plugins.screenshot.init = async function () {
|
||||
|
||||
await Plugins._load_script('https://0xaf.github.io/openwebrxplus-plugins/receiver/screenshot/html2canvas.min.js').catch(function() {
|
||||
throw("Cannot load html2canvas script.");
|
||||
});
|
||||
|
||||
|
||||
if ($("#screenshot-btn").length < 1) {
|
||||
$(".openwebrx-record-button").wrap("<div class='openwebrx-button openwebrx-square-button' style='background: none; width:2rem;'></div>");
|
||||
$(".openwebrx-record-button").after("<div id='screenshot-btn' class='openwebrx-button openwebrx-square-button'>PIC</div>");
|
||||
$(".openwebrx-record-button, #screenshot-btn").css({ float: 'none', marginTop: 0, width: '2rem', textAlign: 'center', padding: '2px 8px' });
|
||||
$('#screenshot-btn').click(function () {
|
||||
|
||||
var freq = window.center_freq + $('#openwebrx-panel-receiver').demodulatorPanel().getDemodulator().get_offset_frequency();
|
||||
freq = parseInt(freq / 1000);
|
||||
freq = parseFloat(freq / 1000);
|
||||
console.log(freq);
|
||||
|
||||
let cloned_width = document.querySelector('#webrx-canvas-container').style.width;
|
||||
let cloned_height = 1200;
|
||||
var iframe_canvas = document.createElement("canvas");
|
||||
iframe_canvas.setAttribute('width', cloned_width);
|
||||
iframe_canvas.setAttribute('height', cloned_height);
|
||||
document.body.appendChild(iframe_canvas);
|
||||
html2canvas(document.querySelector('.openwebrx-waterfall-container'), {
|
||||
canvas: iframe_canvas,
|
||||
width: cloned_width,
|
||||
height: cloned_height,
|
||||
windowWidth: cloned_width,
|
||||
windowHeight: cloned_height,
|
||||
onclone: (e) => {
|
||||
// console.log(e);
|
||||
return e;
|
||||
}
|
||||
}).then(function (canvas) {
|
||||
// console.log(canvas);
|
||||
var d = new Date();
|
||||
var a = document.createElement("a");
|
||||
a.setAttribute('download', `sdr-screenshot-${freq.toFixed(3)}MHz-${d.toISOString()}.png`);
|
||||
a.setAttribute('href', canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"));
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
setTimeout(function () { document.body.removeChild(a); document.body.removeChild(iframe_canvas) }, 0);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
docker/openwebrx/plugins/receiver/screenshot/screenshot.png
Normal file
BIN
docker/openwebrx/plugins/receiver/screenshot/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
Reference in New Issue
Block a user