diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..51d2ade Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index c595430..211028c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.svg view1090 +map1090 *.swp .~ diff --git a/AircraftData.cpp b/AircraftData.cpp index d6a985e..b00ea94 100644 --- a/AircraftData.cpp +++ b/AircraftData.cpp @@ -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; diff --git a/AircraftData.h b/AircraftData.h index cb35012..dde04a9 100644 --- a/AircraftData.h +++ b/AircraftData.h @@ -29,6 +29,8 @@ class AircraftData { AircraftList aircraftList; Aircraft *selectedAircraft; Modes modes; + + char server[32]; }; #endif \ No newline at end of file diff --git a/Input.h b/Input.h index 36b269f..6958a54 100644 --- a/Input.h +++ b/Input.h @@ -1,5 +1,5 @@ #ifndef INPUT_H -#define INPUT +#define INPUT_H #include "AircraftData.h" #include "View.h" diff --git a/draw.log.REMOVED.git-id b/draw.log.REMOVED.git-id deleted file mode 100644 index 4d361fb..0000000 --- a/draw.log.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -fca1e79ced7e4bc0ee43c01bdd40d67f708ae6bb \ No newline at end of file diff --git a/dump1090.log.REMOVED.git-id b/dump1090.log.REMOVED.git-id deleted file mode 100644 index d8863a8..0000000 --- a/dump1090.log.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ad971cbbab08e7bc43c68649b1796aa31b989e1e \ No newline at end of file diff --git a/map1090.REMOVED.git-id b/map1090.REMOVED.git-id index 5a4ef7c..2146ae3 100644 --- a/map1090.REMOVED.git-id +++ b/map1090.REMOVED.git-id @@ -1 +1 @@ -a18a4bc87ddef182cd7d61470daf952ae025186b \ No newline at end of file +93406437edceb4cd6d39e963d3094663472f660b \ No newline at end of file diff --git a/map1090.cpp b/map1090.cpp index cd7c318..533724f 100644 --- a/map1090.cpp +++ b/map1090.cpp @@ -34,6 +34,8 @@ #include "View.h" #include "Input.h" +#include + //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; diff --git a/run_view1090.sh b/run_view1090.sh index 85ed8e4..c566a59 100755 --- a/run_view1090.sh +++ b/run_view1090.sh @@ -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