builds and runs
Former-commit-id: 5158d4459d5b43213803b859ae4491113cf765f9 Former-commit-id: cd1720a0ea9b781adbe21e052efb79b75bc137f1
This commit is contained in:
parent
8b23d25dd1
commit
be5ec5c0ed
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,6 +3,7 @@
|
|||
*.svg
|
||||
|
||||
view1090
|
||||
map1090
|
||||
|
||||
*.swp
|
||||
.~
|
||||
|
|
|
@ -9,7 +9,7 @@ int AircraftData::setupConnection(struct client *c) {
|
|||
int fd;
|
||||
|
||||
// Try to connect to the selected ip address and port. We only support *ONE* input connection which we initiate.here.
|
||||
if ((fd = anetTcpConnect(modes.aneterr, View1090.net_input_beast_ipaddr, modes.net_input_beast_port)) != ANET_ERR) {
|
||||
if ((fd = anetTcpConnect(modes.aneterr, server, modes.net_input_beast_port)) != ANET_ERR) {
|
||||
anetNonBlock(modes.aneterr, fd);
|
||||
//
|
||||
// Setup a service callback client structure for a beast binary input (from dump1090)
|
||||
|
@ -58,7 +58,7 @@ void AircraftData::connect() {
|
|||
c = (struct client *) malloc(sizeof(*c));
|
||||
while(1) {
|
||||
if ((fd = setupConnection(c)) == ANET_ERR) {
|
||||
fprintf(stderr, "Waiting on %s:%d\n", View1090.net_input_beast_ipaddr, modes.net_input_beast_port);
|
||||
fprintf(stderr, "Waiting on %s:%d\n", server, modes.net_input_beast_port);
|
||||
sleep(1);
|
||||
} else {
|
||||
break;
|
||||
|
@ -92,11 +92,10 @@ void AircraftData::update() {
|
|||
AircraftData::AircraftData(){
|
||||
// Default everything to zero/NULL
|
||||
memset(&modes, 0, sizeof(Modes));
|
||||
memset(&View1090, 0, sizeof(View1090));
|
||||
|
||||
// Now initialise things that should not be 0/NULL to their defaults
|
||||
modes.check_crc = 1;
|
||||
strcpy(View1090.net_input_beast_ipaddr,VIEW1090_NET_OUTPUT_IP_ADDRESS);
|
||||
strcpy(server,VIEW1090_NET_OUTPUT_IP_ADDRESS);
|
||||
modes.net_input_beast_port = MODES_NET_OUTPUT_BEAST_PORT;
|
||||
modes.interactive_rows = MODES_INTERACTIVE_ROWS;
|
||||
modes.interactive_delete_ttl = MODES_INTERACTIVE_DELETE_TTL;
|
||||
|
|
|
@ -29,6 +29,8 @@ class AircraftData {
|
|||
AircraftList aircraftList;
|
||||
Aircraft *selectedAircraft;
|
||||
Modes modes;
|
||||
|
||||
char server[32];
|
||||
};
|
||||
|
||||
#endif
|
2
Input.h
2
Input.h
|
@ -1,5 +1,5 @@
|
|||
#ifndef INPUT_H
|
||||
#define INPUT
|
||||
#define INPUT_H
|
||||
|
||||
#include "AircraftData.h"
|
||||
#include "View.h"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
fca1e79ced7e4bc0ee43c01bdd40d67f708ae6bb
|
|
@ -1 +0,0 @@
|
|||
ad971cbbab08e7bc43c68649b1796aa31b989e1e
|
|
@ -1 +1 @@
|
|||
a18a4bc87ddef182cd7d61470daf952ae025186b
|
||||
93406437edceb4cd6d39e963d3094663472f660b
|
|
@ -34,6 +34,8 @@
|
|||
#include "View.h"
|
||||
#include "Input.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
//time utility, might change to std::chrono
|
||||
uint64_t mstime(void) {
|
||||
struct timeval tv;
|
||||
|
@ -96,10 +98,8 @@ int main(int argc, char **argv) {
|
|||
aircraftData.modes.net_input_beast_port = atoi(argv[++j]);
|
||||
} else if (!strcmp(argv[j],"--port") && more) {
|
||||
aircraftData.modes.net_input_beast_port = atoi(argv[++j]);
|
||||
} else if (!strcmp(argv[j],"--net-bo-ipaddr") && more) {
|
||||
strcpy(View1090.net_input_beast_ipaddr, argv[++j]);
|
||||
} else if (!strcmp(argv[j],"--server") && more) {
|
||||
strcpy(View1090.net_input_beast_ipaddr, argv[++j]);
|
||||
std::strcpy(aircraftData.server, argv[++j]);
|
||||
} else if (!strcmp(argv[j],"--lat") && more) {
|
||||
aircraftData.modes.fUserLat = atof(argv[++j]);
|
||||
appData.centerLat = aircraftData.modes.fUserLat;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/bash
|
||||
./view1090 --screensize 640 360 --fullscreen --server adsb --lat 47.6 --lon -122.3
|
||||
./map1090 --screensize 640 360 --fullscreen --server adsb --lat 47.6 --lon -122.3
|
||||
|
|
Loading…
Reference in a new issue