diff --git a/api/server.js b/api/server.js
index eae752d..6b2e15d 100644
--- a/api/server.js
+++ b/api/server.js
@@ -6,6 +6,7 @@ var stash_map = require('./stash/maxhold.js');
var stash_detection = require('./stash/detection.js');
var stash_iqdata = require('./stash/iqdata.js');
var stash_timing = require('./stash/timing.js');
+var stash_falsetargets = require('./stash/falsetargets.js');
// constants
const PORT = 3000;
@@ -16,6 +17,7 @@ var track = '';
var timestamp = '';
var timing = '';
var iqdata = '';
+var falsetargets = '';
var data = '';
var data_map;
var data_detection;
@@ -23,12 +25,13 @@ var data_tracker;
var data_timestamp;
var data_timing;
var data_iqdata;
+var data_falsetargets;
var capture = false;
// api server
const app = express();
// header on all requests
-app.use(function(req, res, next) {
+app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
@@ -56,6 +59,9 @@ app.get('/api/timing', (req, res) => {
app.get('/api/iqdata', (req, res) => {
res.send(iqdata);
});
+app.get('/api/falsetargets', (req, res) => {
+ res.send(falsetargets);
+});
// stash API
app.get('/stash/map', (req, res) => {
@@ -70,6 +76,9 @@ app.get('/stash/iqdata', (req, res) => {
app.get('/stash/timing', (req, res) => {
res.send(stash_timing.get_data_timing());
});
+app.get('/stash/falsetargets', (req, res) => {
+ res.send(stash_falsetargets.get_data_falsetargets());
+});
// read state of capture
app.get('/capture', (req, res) => {
@@ -85,100 +94,111 @@ app.listen(PORT, HOST, () => {
});
// tcp listener map
-const server_map = net.createServer((socket)=>{
- socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
- data_map = data_map + msg.toString();
- if (data_map.slice(-1) === "}")
- {
- map = data_map;
- data_map = '';
- }
- });
- socket.on("close",()=>{
- console.log("Connection closed.");
- })
+const server_map = net.createServer((socket) => {
+ socket.write("Hello From Server!")
+ socket.on("data", (msg) => {
+ data_map = data_map + msg.toString();
+ if (data_map.slice(-1) === "}") {
+ map = data_map;
+ data_map = '';
+ }
+ });
+ socket.on("close", () => {
+ console.log("Connection closed.");
+ })
});
server_map.listen(3001);
// tcp listener detection
-const server_detection = net.createServer((socket)=>{
+const server_detection = net.createServer((socket) => {
socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
- data_detection = data_detection + msg.toString();
- if (data_detection.slice(-1) === "}")
- {
- detection = data_detection;
- data_detection = '';
- }
+ socket.on("data", (msg) => {
+ data_detection = data_detection + msg.toString();
+ if (data_detection.slice(-1) === "}") {
+ detection = data_detection;
+ data_detection = '';
+ }
});
- socket.on("close",()=>{
- console.log("Connection closed.");
+ socket.on("close", () => {
+ console.log("Connection closed.");
})
});
server_detection.listen(3002);
// tcp listener tracker
-const server_tracker = net.createServer((socket)=>{
+const server_tracker = net.createServer((socket) => {
socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
- data_tracker = data_tracker + msg.toString();
- if (data_tracker.slice(-1) === "}")
- {
- track = data_tracker;
- data_tracker = '';
- }
+ socket.on("data", (msg) => {
+ data_tracker = data_tracker + msg.toString();
+ if (data_tracker.slice(-1) === "}") {
+ track = data_tracker;
+ data_tracker = '';
+ }
});
- socket.on("close",()=>{
- console.log("Connection closed.");
+ socket.on("close", () => {
+ console.log("Connection closed.");
})
});
server_tracker.listen(3003);
// tcp listener timestamp
-const server_timestamp = net.createServer((socket)=>{
+const server_timestamp = net.createServer((socket) => {
socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
+ socket.on("data", (msg) => {
data_timestamp = data_timestamp + msg.toString();
timestamp = data_timestamp;
data_timestamp = '';
});
- socket.on("close",()=>{
- console.log("Connection closed.");
+ socket.on("close", () => {
+ console.log("Connection closed.");
})
});
server_timestamp.listen(4000);
// tcp listener timing
-const server_timing = net.createServer((socket)=>{
+const server_timing = net.createServer((socket) => {
socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
+ socket.on("data", (msg) => {
data_timing = data_timing + msg.toString();
- if (data_timing.slice(-1) === "}")
- {
+ if (data_timing.slice(-1) === "}") {
timing = data_timing;
data_timing = '';
}
});
- socket.on("close",()=>{
- console.log("Connection closed.");
+ socket.on("close", () => {
+ console.log("Connection closed.");
})
});
server_timing.listen(4001);
// tcp listener iqdata metadata
-const server_iqdata = net.createServer((socket)=>{
+const server_iqdata = net.createServer((socket) => {
socket.write("Hello From Server!")
- socket.on("data",(msg)=>{
+ socket.on("data", (msg) => {
data_iqdata = data_iqdata + msg.toString();
- if (data_iqdata.slice(-1) === "}")
- {
+ if (data_iqdata.slice(-1) === "}") {
iqdata = data_iqdata;
data_iqdata = '';
}
});
- socket.on("close",()=>{
- console.log("Connection closed.");
+ socket.on("close", () => {
+ console.log("Connection closed.");
})
});
server_iqdata.listen(4002);
+
+// tcp listener falsetargets
+const server_falsetargets = net.createServer((socket) => {
+ socket.write("Hello From Server!")
+ socket.on("data", (msg) => {
+ data_falsetargets = data_falsetargets + msg.toString();
+ if (data_falsetargets.slice(-1) === "}") {
+ falsetargets = data_falsetargets;
+ data_falsetargets = '';
+ }
+ });
+ socket.on("close", () => {
+ console.log("Connection closed.");
+ })
+});
+server_falsetargets.listen(4003);
diff --git a/api/stash/falsetargets.js b/api/stash/falsetargets.js
new file mode 100644
index 0000000..72de7b9
--- /dev/null
+++ b/api/stash/falsetargets.js
@@ -0,0 +1,50 @@
+const http = require('http');
+
+var falsetargets = [];
+frequency = [];
+var ts = '';
+var output = [];
+const options_falsetargets = {
+ host: '127.0.0.1',
+ path: '/api/falsetargets',
+ port: 3000
+};
+
+function update_data() {
+
+ // check if timestamp is updated
+ http.get(options_falsetargets, function (res) {
+ res.setEncoding('utf8');
+ res.on('data', function (body) {
+ if (ts != body) {
+ ts = body;
+ http.get(options_falsetargets, function (res) {
+ let body_map = '';
+ res.setEncoding('utf8');
+ res.on('data', (chunk) => {
+ body_map += chunk;
+ });
+ res.on('end', () => {
+ try {
+
+ output = JSON.parse(body_map);
+ // false targets
+ falsetargets.push(output.falsetargets);
+ } catch (e) {
+ console.error(e.message);
+ }
+ });
+ });
+ }
+ });
+ });
+
+};
+
+setInterval(update_data, 100);
+
+function get_data() {
+ return output;
+};
+
+module.exports.get_data_falsetargets = get_data;
\ No newline at end of file
diff --git a/config/config.yml b/config/config.yml
index 47b6c8b..e7eb5b3 100644
--- a/config/config.yml
+++ b/config/config.yml
@@ -2,7 +2,7 @@ capture:
fs: 2000000
fc: 204640000
device:
- type: "RspDuo"
+ type: "IqSimulator"
replay:
state: false
loop: true
@@ -14,13 +14,13 @@ process:
buffer: 1.5
overlap: 0
ambiguity:
- delayMin: -10
- delayMax: 400
- dopplerMin: -200
- dopplerMax: 200
+ delayMin: -10 # bins
+ delayMax: 400 # bins
+ dopplerMin: -200 # Hz
+ dopplerMax: 200 # Hz
clutter:
- delayMin: -10
- delayMax: 400
+ delayMin: -10 # bins
+ delayMax: 400 # bins
detection:
pfa: 0.00001
nGuard: 2
@@ -46,6 +46,7 @@ network:
timestamp: 4000
timing: 4001
iqdata: 4002
+ falsetargets: 4003
truth:
asdb:
@@ -58,7 +59,7 @@ truth:
port: 30001
save:
- iq: true
+ iq: false
map: false
detection: false
timing: false
diff --git a/config/false_targets.yml b/config/false_targets.yml
index 50b8adf..aeb9481 100644
--- a/config/false_targets.yml
+++ b/config/false_targets.yml
@@ -1,5 +1,5 @@
targets:
- - id: 1
+ - id: 0
type: "static"
location:
range: 10000 # meters
@@ -8,11 +8,21 @@ targets:
rcs: -20 # dBsm - this is a bit contrived for a static target
state: "active"
- - id: 2
+ - id: 1
type: "static"
location:
range: 30000 # meters
velocity:
doppler: -150 # Hertz
rcs: -20 # dBsm
+ state: "active"
+
+ - id: 2
+ type: "moving_radar"
+ location:
+ range: 5000 # meters
+ velocity:
+ doppler: 100 # Hertz
+ dopplerRate: 0 # Hertz/second
+ rcs: -20 # dBsm - this is also contrived
state: "active"
\ No newline at end of file
diff --git a/html/controller/index.html b/html/controller/index.html
index 24818c9..9ec0841 100644
--- a/html/controller/index.html
+++ b/html/controller/index.html
@@ -38,6 +38,7 @@
Detections in delay-Doppler over time
Spectrum reference
Timing display
+ False Target Data
diff --git a/html/display/falsetargets/index.html b/html/display/falsetargets/index.html
new file mode 100644
index 0000000..5f03537
--- /dev/null
+++ b/html/display/falsetargets/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
blah2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/html/js/table_falsetargets.js b/html/js/table_falsetargets.js
new file mode 100644
index 0000000..81f4cbb
--- /dev/null
+++ b/html/js/table_falsetargets.js
@@ -0,0 +1,60 @@
+
+var host = window.location.hostname;
+var isLocalHost = (host === "localhost" || host === "127.0.0.1" || host === "192.168.0.112");
+
+// setup API
+var urlFalseTargets;
+
+if (isLocalHost) {
+ urlFalseTargets = '//' + host + ':3000/api/falsetargets';
+} else {
+ urlFalseTargets = '//' + host + '/api/falsetargets';
+}
+
+//callback function
+var intervalId = window.setInterval(function () {
+ $.getJSON(urlFalseTargets, function (data) {
+ if (data != null) {
+ var table = document.getElementById("data");
+
+
+ // PLEASE SOMEONE FORMAT THIS NICER! //
+ var output = "";
+ data.false_targets.forEach((target) => {
+ output += "id: " + target.id + "
";
+ output += "
- " + target.type + "
";
+ if (target.type === "static") {
+ output += "- delay: " + target.delay + "
";
+ output += "- delay_samples: " + target.delay_samples + "
";
+ output += "- range: " + target.range + "
";
+ output += "- doppler: " + target.doppler + "
";
+ output += "- rcs: " + target.rcs + "
";
+ } else if (target.type === "moving_radar") {
+ output += "- delay: " + target.delay + "
";
+ output += "- delay_samples: " + target.delay_samples + "
";
+ output += "- range: " + target.range + "
";
+ output += "- start_range: " + target.start_range + "
";
+ output += "- doppler: " + target.doppler + "
";
+ output += "- doppler_rate: " + target.doppler_rate + "
";
+ output += "- rcs: " + target.rcs + "
";
+ }
+ output += "
";
+ });
+ table.innerHTML = output;
+ // data.false_targets.foreach((targetjson) => {
+ // target = JSON.parse(targetjson);
+ // console.log(target);
+ // });
+
+ // for (var i = 0; i < data.length; i++) {
+ // var row = table.insertRow(i + 1);
+ // var cell1 = row.insertCell(0);
+ // var cell2 = row.insertCell(1);
+ // var cell3 = row.insertCell(2);
+ // cell1.innerHTML = data[i].x;
+ // cell2.innerHTML = data[i].y;
+ // cell3.innerHTML = data[i].z;
+ // }
+ }
+ });
+}, 100);
\ No newline at end of file
diff --git a/src/capture/Capture.cpp b/src/capture/Capture.cpp
index 80eb522..170e6a7 100644
--- a/src/capture/Capture.cpp
+++ b/src/capture/Capture.cpp
@@ -92,9 +92,7 @@ std::unique_ptr