diff --git a/README.md b/README.md index c59b6db..a1eacc5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,50 @@ #spidr1090 + +###INSTALLATION + +Tested and working on Ubuntu 18.04, Raspbian Stretch, Buster + +1. Install SDL and RTL-SDR libararies +``` +sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-gfx-dev librtlsdr-dev +``` + Note: On Raspbian the SDL2 package requires X to be running. See the Raspberry Pi section for notes on running from the terminal and other improvements. + +2. Download and build spidr +``` +cd ~ +git clone https://www.github.com/nmatsuda/spidr +cd spidr +make clean; make +``` + +3. Download and build dump1090 +``` +cd ~ +git clone http://www.github.com/MalcolmRobb/dump1090) +cd dump1090 +make clean; make + +4. Run +``` +~/dump1090/dump1090 --net +cd spidr +./view1090 --fullsceen + +### Runtime Options + +--server [domain name or ip] Specify a dump1090 server. Renamed from the view1090 "--net-bo-ip-addr" argument +--metric Display metric units rather than imperial. + +--screensize [width] [height] Specify a specific resolution to pass to SDL_RenderSetLogicalSize, otherwise use resolution of display +--uiscale [scale] Scale up UI elements by integer amounts for high resolution screen +--fullscreen Render fullscreen rather than in a window + + + ### TODO -* change plane history from fixed array to linked list of planeObj, handle cleanup -* status box layout system -* status box tap for info - * trails w/ altitudes +* build for ios and android * menu system (toggles for UI elements) * map system (automatically load open source) * separate fully from view1090 (which interface?) @@ -20,13 +60,13 @@ Notes: Pi 3b+ and below are a little underpowerd for unoptimized map drawing Pi 4 is smooth, may have USB issues with RTLSDR? Up squared is good, but large -Up Core may be fine but bad connection options - try up core? +Up Core may be fine but bad connection options? PiJuice is by far best battery option. FCC/CE certified! Need to test stratux low power dongles. 987Mhz? -Waveshare 4.3" HDMI(B) is very good, slightly too large for handheld. Uses a lot of power, around 500ma +Waveshare 4.3" HDMI(B) and 5.5" AOLED are both very good, a little too large for handheld. Uses a lot of power, around 500ma for the 4.3", the AMOLED scales by the overal screen brightness. Pimoroni Hyperpixel 4.0 is the right size, but takes over default I2C pins so conflicts with PiJuice, unless some pin remapping. Also lower power, around 150ma Adafruit PiTFT 2.8" capacitive touch is ok, but a little small. Not sure about power draw. Docs claim no multitouch? @@ -88,34 +128,3 @@ Recommended: PiJuice 18650 batteries (18mm x 65mm). ~2200mAH ea. Adafruit pack + PowerBoost Charger, ~$40 http://www.ebay.com/itm/3-7-volts-6400-mAh-1S2P-18650-Li-Ion-Battery-Pack-PCB-protected-Panasonic-Cells-/221923032745?hash=item33aba4bea9:g:0-IAAOSw14xWLSr2 - -###INSTALLATION - -Tested and working on Ubuntu 18.04, Raspbian Stretch - -1. Install SDL and RTL-SDR libararies -``` -sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-gfx-dev librtlsdr-dev -``` -2. Download and build spidr -``` -cd ~ -git clone https://www.github.com/nmatsuda/spidr -cd spidr -make clean; make -``` - -3. Download and build dump1090 -``` -cd ~ -git clone http://www.github.com/MalcolmRobb/dump1090) -cd dump1090 -make clean; make - -4. Run -``` -~/dump1090/dump1090 -cd spidr -./view1090 --screensize 240 400 --fullsceen - -### Runtime Options diff --git a/draw.c b/draw.c index bebe530..e6287c5 100644 --- a/draw.c +++ b/draw.c @@ -2,7 +2,7 @@ #include "structs.h" #include "SDL2/SDL2_rotozoom.h" #include "SDL2/SDL2_gfxPrimitives.h" - +#include "mapdata.h" //color schemes #include "parula.h" #include "monokai.h" @@ -128,6 +128,16 @@ void pxFromLonLat(double *dx, double *dy, double lon, double lat) { *dy = 6371.0 * (lat - appData.centerLat) * M_PI / 180.0f; } +void latLonFromScreenCoords(double *lat, double *lon, int x, int y) { + double scale_factor = (appData.screen_width > appData.screen_height) ? appData.screen_width : appData.screen_height; + + double dx = appData.maxDist * (x - (appData.screen_width>>1)) / (0.95 * scale_factor * 0.5 ); + double dy = appData.maxDist * (y - (appData.screen_height * CENTEROFFSET)) / (0.95 * scale_factor * 0.5 ); + + *lat = 180.0f * dy / (6371.0 * M_PI) + appData.centerLat; + *lon = 180.0 * dx / (cos(((*lat + appData.centerLat)/2.0f) * M_PI / 180.0f) * 6371.0 * M_PI) + appData.centerLon; +} + void screenCoords(int *outX, int *outY, double dx, double dy) { *outX = (appData.screen_width>>1) + ((dx>0) ? 1 : -1) * screenDist(dx); @@ -361,7 +371,77 @@ void drawGrid() drawString("100km", (appData.screen_width>>1) + (0.707 * p100km) + 5, (appData.screen_height * CENTEROFFSET) + (0.707 * p100km) + 5, appData.mapFont, pink); } +void drawPolys(QuadTree *tree, double screen_lat_min, double screen_lat_max, double screen_lon_min, double screen_lon_max) { + + if(tree == NULL) { + return; + } + + double dx, dy; + int x, y; + + if (!(tree->lat_min < screen_lat_min && + tree->lat_max > screen_lat_max && + tree->lon_min < screen_lon_min && + tree->lon_max > screen_lon_max)) { + return; + } + + + Polygon *currentPolygon = tree->polygons; + + while(currentPolygon != NULL) { + // Sint16 *px = (Sint16*)malloc(sizeof(Sint16*)*currentPolygon->numPoints); + // Sint16 *py = (Sint16*)malloc(sizeof(Sint16*)*currentPolygon->numPoints); + + // for(int i=0; inumPoints; i++) { + + // pxFromLonLat(&dx, &dy, currentPolygon->points[i].lat, currentPolygon->points[i].lon); + // screenCoords(&x, &y, dx, dy); + + // px[i] = x; + // py[i] = y; + // } + + // double alpha = 1.0; + + pxFromLonLat(&dx, &dy, currentPolygon->lat_min, currentPolygon->lon_min); + screenCoords(&x, &y, dx, dy); + + int top = y; + int left = x; + + pxFromLonLat(&dx, &dy, currentPolygon->lat_max, currentPolygon->lon_max); + screenCoords(&x, &y, dx, dy); + + int bottom = y; + int right = x; + + //polygonRGBA (appData.renderer, px, py, currentPolygon->numPoints, alpha * purple.r + (1.0-alpha) * blue.r, alpha * purple.g + (1.0-alpha) * blue.g, alpha * purple.b + (1.0-alpha) * blue.b, 255 * alpha); + + rectangleRGBA(appData.renderer, left, top, right, bottom, purple.r, purple.g, purple.b, 255); + + + currentPolygon = currentPolygon->next; + } + + //drawPolys(tree->nw, screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max); + //drawPolys(tree->sw, screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max); + //drawPolys(tree->ne, screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max); + //drawPolys(tree->se, screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max); +} + void drawGeography() { + + double screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max; + + latLonFromScreenCoords(&screen_lon_min, &screen_lat_min, 0, 0); + latLonFromScreenCoords(&screen_lon_max, &screen_lat_max, appData.screen_width, appData.screen_height); + + drawPolys(&root, screen_lat_min, screen_lat_max, screen_lon_min, screen_lon_max); + + + return; int x1, y1, x2, y2; int skip = (int)(appData.maxDist / 25.0f); @@ -376,11 +456,11 @@ void drawGeography() { dx = 1; dy = 1; for(int j = 0; j < skip; j++) { - if(!mapPoints_relative[(i - skip + j) * 2]) { + if(!mapPoints[(i - skip + j) * 2]) { dx = 0; } - if(!mapPoints_relative[(i - skip + j) * 2 + 1]) { + if(!mapPoints[(i - skip + j) * 2 + 1]) { dy = 0; } } @@ -389,7 +469,7 @@ void drawGeography() { continue; } - pxFromLonLat(&dx, &dy, mapPoints_relative[(i - skip) * 2], mapPoints_relative[(i - skip) * 2 + 1]); + pxFromLonLat(&dx, &dy, mapPoints[(i - skip) * 2], mapPoints[(i - skip) * 2 + 1]); if(!dx || !dy) { continue; @@ -403,7 +483,7 @@ void drawGeography() { double d1 = sqrt(dx * dx + dy * dy); - pxFromLonLat(&dx, &dy, mapPoints_relative[i * 2], mapPoints_relative[i * 2 + 1]); + pxFromLonLat(&dx, &dy, mapPoints[i * 2], mapPoints[i * 2 + 1]); if(!dx || !dy) { continue; @@ -752,7 +832,7 @@ void drawMap() { if((int)(now - p->seen) > DISPLAY_ACTIVE) { planeColor = grey; } else { - planeColor = white; + planeColor = green; //srand(p->addr); // planeColor = hsv2SDLColor(255.0 * (double)rand()/(double)RAND_MAX, 255.0, 200.0); //planeColor = signalToColor((int)(255.0f * (float)rand()/(float)RAND_MAX)); diff --git a/draw.o.REMOVED.git-id b/draw.o.REMOVED.git-id index 7c1526e..f402cfa 100644 --- a/draw.o.REMOVED.git-id +++ b/draw.o.REMOVED.git-id @@ -1 +1 @@ -5bec8587fd94772a4061e38543ad9846ffb0fc11 \ No newline at end of file +737abac0c33061fb6e1c86993e1b329d8a451dcd \ No newline at end of file diff --git a/font.o b/font.o index 1b9094e..75c233b 100644 Binary files a/font.o and b/font.o differ diff --git a/gmon.out b/gmon.out new file mode 100644 index 0000000..cbb6f49 Binary files /dev/null and b/gmon.out differ diff --git a/init.c b/init.c index 46d5643..720cd3a 100644 --- a/init.c +++ b/init.c @@ -2,6 +2,7 @@ #include "structs.h" void init(char *title) { + // raspberry pi compiler flag enables these options #ifdef RPI putenv((char*)"FRAMEBUFFER=/dev/fb1"); diff --git a/init.o b/init.o index 60eada6..129f6da 100644 Binary files a/init.o and b/init.o differ diff --git a/input.o.REMOVED.git-id b/input.o.REMOVED.git-id index 5a96a3c..ce4b4dd 100644 --- a/input.o.REMOVED.git-id +++ b/input.o.REMOVED.git-id @@ -1 +1 @@ -b7c0644a5ba34c2548772d880bce685146ce9e95 \ No newline at end of file +bb8d618a3de2096192e6fd03ba715f6346df1193 \ No newline at end of file diff --git a/list.o b/list.o index a8039d4..508336c 100644 Binary files a/list.o and b/list.o differ diff --git a/mapdata.c.REMOVED.git-id b/mapdata.c.REMOVED.git-id index 62add43..3a02d0f 100644 --- a/mapdata.c.REMOVED.git-id +++ b/mapdata.c.REMOVED.git-id @@ -1 +1 @@ -7ed2e5c3d762695e6aaf4111584830b537a549a0 \ No newline at end of file +212d4fb6e7ea7b3c502081037abbac1fbdd9fccf \ No newline at end of file diff --git a/mapdata.h b/mapdata.h index bcdd7c1..2dc6d4e 100644 --- a/mapdata.h +++ b/mapdata.h @@ -1,4 +1,43 @@ +#ifndef MAPPOINTS_H +#define MAPPOINTS_H + double *mapPoints_relative; -double *mapPoints_x; -double *mapPoints_y; int mapPoints_count; + +extern double mapPoints[]; + +typedef struct Point{ + double lat; + double lon; + struct Point *next; +} Point; + +typedef struct Polygon{ + double lat_min; + double lat_max; + double lon_min; + double lon_max; + + Point *points; + int numPoints; + + struct Polygon *next; +} Polygon; + +typedef struct QuadTree{ + double lat_min; + double lat_max; + double lon_min; + double lon_max; + + Polygon *polygons; + + struct QuadTree *nw; + struct QuadTree *sw; + struct QuadTree *ne; + struct QuadTree *se; +} QuadTree; + +QuadTree root; + +#endif \ No newline at end of file diff --git a/mapdata.o.REMOVED.git-id b/mapdata.o.REMOVED.git-id index c37fba4..abf0145 100644 --- a/mapdata.o.REMOVED.git-id +++ b/mapdata.o.REMOVED.git-id @@ -1 +1 @@ -c95610367de3a9e8503644016da9760739f94993 \ No newline at end of file +1c1e7d6bdf081956022b7592b8d59a929da2f463 \ No newline at end of file diff --git a/monokai.o b/monokai.o index 8a20179..03c4bd0 100644 Binary files a/monokai.o and b/monokai.o differ diff --git a/planeObj.o b/planeObj.o index e2a0fd7..44e6d26 100644 Binary files a/planeObj.o and b/planeObj.o differ diff --git a/prof_output_nogeography b/prof_output_nogeography new file mode 100644 index 0000000..515e323 --- /dev/null +++ b/prof_output_nogeography @@ -0,0 +1,517 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls us/call us/call name + 66.67 0.02 0.02 600 33.34 33.34 resolveLabelConflicts + 33.34 0.03 0.01 2147 4.66 4.66 drawTrail + 0.00 0.03 0.00 9666 0.00 0.00 screenDist + 0.00 0.03 0.00 4935 0.00 0.00 mstime + 0.00 0.03 0.00 4608 0.00 0.00 pxFromLonLat + 0.00 0.03 0.00 4608 0.00 0.00 screenCoords + 0.00 0.03 0.00 2831 0.00 0.00 outOfBounds + 0.00 0.03 0.00 2147 0.00 0.00 findPlaneObj + 0.00 0.03 0.00 1770 0.00 0.00 drawStringBG + 0.00 0.03 0.00 1650 0.00 0.00 drawString + 0.00 0.03 0.00 1598 0.00 0.00 CROSSVP + 0.00 0.03 0.00 985 0.00 0.00 drawPlaneText + 0.00 0.03 0.00 656 0.00 0.00 drawSignalMarks + 0.00 0.03 0.00 656 0.00 0.00 setColor + 0.00 0.03 0.00 656 0.00 0.00 signalToColor + 0.00 0.03 0.00 600 0.00 0.00 drawStatusBox + 0.00 0.03 0.00 528 0.00 0.00 drawPlaneHeading + 0.00 0.03 0.00 493 0.00 0.00 modesChecksum + 0.00 0.03 0.00 457 0.00 0.00 drawPlaneOffMap + 0.00 0.03 0.00 387 0.00 0.00 ICAOCacheHashAddress + 0.00 0.03 0.00 386 0.00 0.00 decodeBinMessage + 0.00 0.03 0.00 386 0.00 0.00 decodeModesMessage + 0.00 0.03 0.00 386 0.00 0.00 modesMessageLenByType + 0.00 0.03 0.00 386 0.00 0.00 useModesMessage + 0.00 0.03 0.00 373 0.00 0.00 interactiveFindAircraft + 0.00 0.03 0.00 373 0.00 0.00 interactiveReceiveData + 0.00 0.03 0.00 330 0.00 0.00 cprNLFunction + 0.00 0.03 0.00 324 0.00 0.00 getInput + 0.00 0.03 0.00 323 0.00 92.88 draw + 0.00 0.03 0.00 323 0.00 0.00 interactiveRemoveStaleAircrafts + 0.00 0.03 0.00 323 0.00 0.00 modesReadFromClient + 0.00 0.03 0.00 206 0.00 0.00 addRecentlySeenICAOAddr + 0.00 0.03 0.00 181 0.00 0.00 ICAOAddressWasRecentlySeen + 0.00 0.03 0.00 172 0.00 0.00 sign + 0.00 0.03 0.00 167 0.00 0.00 decodeAC13Field + 0.00 0.03 0.00 165 0.00 0.00 cprModFunction + 0.00 0.03 0.00 150 0.00 0.00 drawGrid + 0.00 0.03 0.00 150 0.00 200.01 drawMap + 0.00 0.03 0.00 150 0.00 0.00 drawStatus + 0.00 0.03 0.00 150 0.00 0.00 updatePlanes + 0.00 0.03 0.00 150 0.00 0.00 updateStatus + 0.00 0.03 0.00 110 0.00 0.00 cprNFunction + 0.00 0.03 0.00 108 0.00 0.00 mstime + 0.00 0.03 0.00 72 0.00 0.00 decodeAC12Field + 0.00 0.03 0.00 72 0.00 0.00 mstime + 0.00 0.03 0.00 55 0.00 0.00 cprDlonFunction + 0.00 0.03 0.00 55 0.00 0.00 decodeCPR + 0.00 0.03 0.00 22 0.00 0.00 decodeID13Field + 0.00 0.03 0.00 19 0.00 0.00 ModeAToModeC + 0.00 0.03 0.00 17 0.00 0.00 createPlaneObj + 0.00 0.03 0.00 17 0.00 0.00 decodeCPRrelative + 0.00 0.03 0.00 17 0.00 0.00 interactiveCreateAircraft + 0.00 0.03 0.00 6 0.00 0.00 interactiveRemoveStaleDF + 0.00 0.03 0.00 5 0.00 0.00 closeFont + 0.00 0.03 0.00 5 0.00 0.00 loadFont + 0.00 0.03 0.00 1 0.00 0.00 anetCreateSocket + 0.00 0.03 0.00 1 0.00 0.00 anetNonBlock + 0.00 0.03 0.00 1 0.00 0.00 anetTcpConnect + 0.00 0.03 0.00 1 0.00 0.00 anetTcpGenericConnect + 0.00 0.03 0.00 1 0.00 0.00 init + 0.00 0.03 0.00 1 0.00 0.00 initMaps + 0.00 0.03 0.00 1 0.00 0.00 modesInitErrorInfo + 0.00 0.03 0.00 1 0.00 0.00 setupConnection + 0.00 0.03 0.00 1 0.00 0.00 view1090Init + 0.00 0.03 0.00 1 0.00 0.00 view1090InitConfig + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2018 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 2 byte(s) for 33.33% of 0.03 seconds + +index % time self children called name + 0.00 0.03 323/323 main [3] +[1] 100.0 0.00 0.03 323 draw [1] + 0.00 0.03 150/150 drawMap [2] + 0.00 0.00 473/4935 mstime [7] + 0.00 0.00 150/150 updatePlanes [41] + 0.00 0.00 150/150 updateStatus [42] + 0.00 0.00 150/150 drawStatus [40] +----------------------------------------------- + 0.00 0.03 150/150 draw [1] +[2] 100.0 0.00 0.03 150 drawMap [2] + 0.02 0.00 600/600 resolveLabelConflicts [4] + 0.01 0.00 2147/2147 drawTrail [5] + 0.00 0.00 3150/4935 mstime [7] + 0.00 0.00 2152/4608 pxFromLonLat [8] + 0.00 0.00 2152/4608 screenCoords [9] + 0.00 0.00 985/2831 outOfBounds [10] + 0.00 0.00 985/985 drawPlaneText [15] + 0.00 0.00 528/528 drawPlaneHeading [20] + 0.00 0.00 457/457 drawPlaneOffMap [22] + 0.00 0.00 150/150 drawGrid [39] +----------------------------------------------- + +[3] 100.0 0.00 0.03 main [3] + 0.00 0.03 323/323 draw [1] + 0.00 0.00 324/324 getInput [31] + 0.00 0.00 323/323 interactiveRemoveStaleAircrafts [32] + 0.00 0.00 323/323 modesReadFromClient [33] + 0.00 0.00 1/1 view1090InitConfig [66] + 0.00 0.00 1/1 view1090Init [65] + 0.00 0.00 1/1 setupConnection [64] + 0.00 0.00 1/1 init [61] +----------------------------------------------- + 0.02 0.00 600/600 drawMap [2] +[4] 66.7 0.02 0.00 600 resolveLabelConflicts [4] + 0.00 0.00 172/172 sign [36] +----------------------------------------------- + 0.01 0.00 2147/2147 drawMap [2] +[5] 33.3 0.01 0.00 2147 drawTrail [5] + 0.00 0.00 2456/4608 pxFromLonLat [8] + 0.00 0.00 2456/4608 screenCoords [9] + 0.00 0.00 1846/2831 outOfBounds [10] + 0.00 0.00 613/1598 CROSSVP [14] +----------------------------------------------- + 0.00 0.00 450/9666 drawGrid [39] + 0.00 0.00 9216/9666 screenCoords [9] +[6] 0.0 0.00 0.00 9666 screenDist [6] +----------------------------------------------- + 0.00 0.00 473/4935 draw [1] + 0.00 0.00 1312/4935 drawSignalMarks [16] + 0.00 0.00 3150/4935 drawMap [2] +[7] 0.0 0.00 0.00 4935 mstime [7] +----------------------------------------------- + 0.00 0.00 2152/4608 drawMap [2] + 0.00 0.00 2456/4608 drawTrail [5] +[8] 0.0 0.00 0.00 4608 pxFromLonLat [8] +----------------------------------------------- + 0.00 0.00 2152/4608 drawMap [2] + 0.00 0.00 2456/4608 drawTrail [5] +[9] 0.0 0.00 0.00 4608 screenCoords [9] + 0.00 0.00 9216/9666 screenDist [6] +----------------------------------------------- + 0.00 0.00 985/2831 drawMap [2] + 0.00 0.00 1846/2831 drawTrail [5] +[10] 0.0 0.00 0.00 2831 outOfBounds [10] +----------------------------------------------- + 0.00 0.00 2147/2147 updatePlanes [41] +[11] 0.0 0.00 0.00 2147 findPlaneObj [11] +----------------------------------------------- + 0.00 0.00 1770/1770 drawPlaneText [15] +[12] 0.0 0.00 0.00 1770 drawStringBG [12] +----------------------------------------------- + 0.00 0.00 450/1650 drawGrid [39] + 0.00 0.00 1200/1650 drawStatusBox [19] +[13] 0.0 0.00 0.00 1650 drawString [13] +----------------------------------------------- + 0.00 0.00 457/1598 drawPlaneOffMap [22] + 0.00 0.00 528/1598 drawPlaneHeading [20] + 0.00 0.00 613/1598 drawTrail [5] +[14] 0.0 0.00 0.00 1598 CROSSVP [14] +----------------------------------------------- + 0.00 0.00 985/985 drawMap [2] +[15] 0.0 0.00 0.00 985 drawPlaneText [15] + 0.00 0.00 1770/1770 drawStringBG [12] + 0.00 0.00 656/656 drawSignalMarks [16] +----------------------------------------------- + 0.00 0.00 656/656 drawPlaneText [15] +[16] 0.0 0.00 0.00 656 drawSignalMarks [16] + 0.00 0.00 1312/4935 mstime [7] + 0.00 0.00 656/656 signalToColor [18] +----------------------------------------------- + 0.00 0.00 656/656 signalToColor [18] +[17] 0.0 0.00 0.00 656 setColor [17] +----------------------------------------------- + 0.00 0.00 656/656 drawSignalMarks [16] +[18] 0.0 0.00 0.00 656 signalToColor [18] + 0.00 0.00 656/656 setColor [17] +----------------------------------------------- + 0.00 0.00 600/600 drawStatus [40] +[19] 0.0 0.00 0.00 600 drawStatusBox [19] + 0.00 0.00 1200/1650 drawString [13] +----------------------------------------------- + 0.00 0.00 528/528 drawMap [2] +[20] 0.0 0.00 0.00 528 drawPlaneHeading [20] + 0.00 0.00 528/1598 CROSSVP [14] +----------------------------------------------- + 0.00 0.00 107/493 modesInitErrorInfo [63] + 0.00 0.00 386/493 decodeModesMessage [25] +[21] 0.0 0.00 0.00 493 modesChecksum [21] +----------------------------------------------- + 0.00 0.00 457/457 drawMap [2] +[22] 0.0 0.00 0.00 457 drawPlaneOffMap [22] + 0.00 0.00 457/1598 CROSSVP [14] +----------------------------------------------- + 0.00 0.00 181/387 ICAOAddressWasRecentlySeen [35] + 0.00 0.00 206/387 addRecentlySeenICAOAddr [34] +[23] 0.0 0.00 0.00 387 ICAOCacheHashAddress [23] +----------------------------------------------- + 0.00 0.00 386/386 modesReadFromClient [33] +[24] 0.0 0.00 0.00 386 decodeBinMessage [24] + 0.00 0.00 386/386 decodeModesMessage [25] + 0.00 0.00 386/386 useModesMessage [27] +----------------------------------------------- + 0.00 0.00 386/386 decodeBinMessage [24] +[25] 0.0 0.00 0.00 386 decodeModesMessage [25] + 0.00 0.00 386/386 modesMessageLenByType [26] + 0.00 0.00 386/493 modesChecksum [21] + 0.00 0.00 206/206 addRecentlySeenICAOAddr [34] + 0.00 0.00 181/181 ICAOAddressWasRecentlySeen [35] + 0.00 0.00 167/167 decodeAC13Field [37] + 0.00 0.00 72/72 decodeAC12Field [45] + 0.00 0.00 3/22 decodeID13Field [49] +----------------------------------------------- + 0.00 0.00 386/386 decodeModesMessage [25] +[26] 0.0 0.00 0.00 386 modesMessageLenByType [26] +----------------------------------------------- + 0.00 0.00 386/386 decodeBinMessage [24] +[27] 0.0 0.00 0.00 386 useModesMessage [27] + 0.00 0.00 373/373 interactiveReceiveData [29] +----------------------------------------------- + 0.00 0.00 373/373 interactiveReceiveData [29] +[28] 0.0 0.00 0.00 373 interactiveFindAircraft [28] +----------------------------------------------- + 0.00 0.00 373/373 useModesMessage [27] +[29] 0.0 0.00 0.00 373 interactiveReceiveData [29] + 0.00 0.00 373/373 interactiveFindAircraft [28] + 0.00 0.00 72/72 mstime [46] + 0.00 0.00 55/55 decodeCPR [48] + 0.00 0.00 17/17 interactiveCreateAircraft [53] + 0.00 0.00 17/17 decodeCPRrelative [52] +----------------------------------------------- + 0.00 0.00 110/330 cprNFunction [43] + 0.00 0.00 220/330 decodeCPR [48] +[30] 0.0 0.00 0.00 330 cprNLFunction [30] +----------------------------------------------- + 0.00 0.00 324/324 main [3] +[31] 0.0 0.00 0.00 324 getInput [31] +----------------------------------------------- + 0.00 0.00 323/323 main [3] +[32] 0.0 0.00 0.00 323 interactiveRemoveStaleAircrafts [32] + 0.00 0.00 6/6 interactiveRemoveStaleDF [54] +----------------------------------------------- + 0.00 0.00 323/323 main [3] +[33] 0.0 0.00 0.00 323 modesReadFromClient [33] + 0.00 0.00 386/386 decodeBinMessage [24] +----------------------------------------------- + 0.00 0.00 206/206 decodeModesMessage [25] +[34] 0.0 0.00 0.00 206 addRecentlySeenICAOAddr [34] + 0.00 0.00 206/387 ICAOCacheHashAddress [23] +----------------------------------------------- + 0.00 0.00 181/181 decodeModesMessage [25] +[35] 0.0 0.00 0.00 181 ICAOAddressWasRecentlySeen [35] + 0.00 0.00 181/387 ICAOCacheHashAddress [23] +----------------------------------------------- + 0.00 0.00 172/172 resolveLabelConflicts [4] +[36] 0.0 0.00 0.00 172 sign [36] +----------------------------------------------- + 0.00 0.00 167/167 decodeModesMessage [25] +[37] 0.0 0.00 0.00 167 decodeAC13Field [37] + 0.00 0.00 10/22 decodeID13Field [49] + 0.00 0.00 10/19 ModeAToModeC [50] +----------------------------------------------- + 0.00 0.00 165/165 decodeCPR [48] +[38] 0.0 0.00 0.00 165 cprModFunction [38] +----------------------------------------------- + 0.00 0.00 150/150 drawMap [2] +[39] 0.0 0.00 0.00 150 drawGrid [39] + 0.00 0.00 450/9666 screenDist [6] + 0.00 0.00 450/1650 drawString [13] +----------------------------------------------- + 0.00 0.00 150/150 draw [1] +[40] 0.0 0.00 0.00 150 drawStatus [40] + 0.00 0.00 600/600 drawStatusBox [19] +----------------------------------------------- + 0.00 0.00 150/150 draw [1] +[41] 0.0 0.00 0.00 150 updatePlanes [41] + 0.00 0.00 2147/2147 findPlaneObj [11] + 0.00 0.00 108/108 mstime [44] + 0.00 0.00 17/17 createPlaneObj [51] +----------------------------------------------- + 0.00 0.00 150/150 draw [1] +[42] 0.0 0.00 0.00 150 updateStatus [42] +----------------------------------------------- + 0.00 0.00 55/110 cprDlonFunction [47] + 0.00 0.00 55/110 decodeCPR [48] +[43] 0.0 0.00 0.00 110 cprNFunction [43] + 0.00 0.00 110/330 cprNLFunction [30] +----------------------------------------------- + 0.00 0.00 108/108 updatePlanes [41] +[44] 0.0 0.00 0.00 108 mstime [44] +----------------------------------------------- + 0.00 0.00 72/72 decodeModesMessage [25] +[45] 0.0 0.00 0.00 72 decodeAC12Field [45] + 0.00 0.00 9/22 decodeID13Field [49] + 0.00 0.00 9/19 ModeAToModeC [50] +----------------------------------------------- + 0.00 0.00 72/72 interactiveReceiveData [29] +[46] 0.0 0.00 0.00 72 mstime [46] +----------------------------------------------- + 0.00 0.00 55/55 decodeCPR [48] +[47] 0.0 0.00 0.00 55 cprDlonFunction [47] + 0.00 0.00 55/110 cprNFunction [43] +----------------------------------------------- + 0.00 0.00 55/55 interactiveReceiveData [29] +[48] 0.0 0.00 0.00 55 decodeCPR [48] + 0.00 0.00 220/330 cprNLFunction [30] + 0.00 0.00 165/165 cprModFunction [38] + 0.00 0.00 55/110 cprNFunction [43] + 0.00 0.00 55/55 cprDlonFunction [47] +----------------------------------------------- + 0.00 0.00 3/22 decodeModesMessage [25] + 0.00 0.00 9/22 decodeAC12Field [45] + 0.00 0.00 10/22 decodeAC13Field [37] +[49] 0.0 0.00 0.00 22 decodeID13Field [49] +----------------------------------------------- + 0.00 0.00 9/19 decodeAC12Field [45] + 0.00 0.00 10/19 decodeAC13Field [37] +[50] 0.0 0.00 0.00 19 ModeAToModeC [50] +----------------------------------------------- + 0.00 0.00 17/17 updatePlanes [41] +[51] 0.0 0.00 0.00 17 createPlaneObj [51] +----------------------------------------------- + 0.00 0.00 17/17 interactiveReceiveData [29] +[52] 0.0 0.00 0.00 17 decodeCPRrelative [52] +----------------------------------------------- + 0.00 0.00 17/17 interactiveReceiveData [29] +[53] 0.0 0.00 0.00 17 interactiveCreateAircraft [53] +----------------------------------------------- + 0.00 0.00 6/6 interactiveRemoveStaleAircrafts [32] +[54] 0.0 0.00 0.00 6 interactiveRemoveStaleDF [54] +----------------------------------------------- + 0.00 0.00 5/5 cleanup [85] +[55] 0.0 0.00 0.00 5 closeFont [55] +----------------------------------------------- + 0.00 0.00 5/5 init [61] +[56] 0.0 0.00 0.00 5 loadFont [56] +----------------------------------------------- + 0.00 0.00 1/1 anetTcpGenericConnect [60] +[57] 0.0 0.00 0.00 1 anetCreateSocket [57] +----------------------------------------------- + 0.00 0.00 1/1 setupConnection [64] +[58] 0.0 0.00 0.00 1 anetNonBlock [58] +----------------------------------------------- + 0.00 0.00 1/1 setupConnection [64] +[59] 0.0 0.00 0.00 1 anetTcpConnect [59] + 0.00 0.00 1/1 anetTcpGenericConnect [60] +----------------------------------------------- + 0.00 0.00 1/1 anetTcpConnect [59] +[60] 0.0 0.00 0.00 1 anetTcpGenericConnect [60] + 0.00 0.00 1/1 anetCreateSocket [57] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[61] 0.0 0.00 0.00 1 init [61] + 0.00 0.00 5/5 loadFont [56] + 0.00 0.00 1/1 initMaps [62] +----------------------------------------------- + 0.00 0.00 1/1 init [61] +[62] 0.0 0.00 0.00 1 initMaps [62] +----------------------------------------------- + 0.00 0.00 1/1 view1090Init [65] +[63] 0.0 0.00 0.00 1 modesInitErrorInfo [63] + 0.00 0.00 107/493 modesChecksum [21] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[64] 0.0 0.00 0.00 1 setupConnection [64] + 0.00 0.00 1/1 anetTcpConnect [59] + 0.00 0.00 1/1 anetNonBlock [58] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[65] 0.0 0.00 0.00 1 view1090Init [65] + 0.00 0.00 1/1 modesInitErrorInfo [63] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[66] 0.0 0.00 0.00 1 view1090InitConfig [66] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2018 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [14] CROSSVP [1] draw [21] modesChecksum + [35] ICAOAddressWasRecentlySeen [39] drawGrid [63] modesInitErrorInfo + [23] ICAOCacheHashAddress [2] drawMap [26] modesMessageLenByType + [50] ModeAToModeC [20] drawPlaneHeading [33] modesReadFromClient + [34] addRecentlySeenICAOAddr [22] drawPlaneOffMap [46] mstime + [57] anetCreateSocket [15] drawPlaneText [44] mstime + [58] anetNonBlock [16] drawSignalMarks [7] mstime + [59] anetTcpConnect [40] drawStatus [10] outOfBounds + [60] anetTcpGenericConnect [19] drawStatusBox [8] pxFromLonLat + [55] closeFont [13] drawString [4] resolveLabelConflicts + [47] cprDlonFunction [12] drawStringBG [9] screenCoords + [38] cprModFunction [5] drawTrail [6] screenDist + [43] cprNFunction [11] findPlaneObj [17] setColor + [30] cprNLFunction [31] getInput [64] setupConnection + [51] createPlaneObj [61] init [36] sign + [45] decodeAC12Field [62] initMaps [18] signalToColor + [37] decodeAC13Field [53] interactiveCreateAircraft [41] updatePlanes + [24] decodeBinMessage [28] interactiveFindAircraft [42] updateStatus + [48] decodeCPR [29] interactiveReceiveData [27] useModesMessage + [52] decodeCPRrelative [32] interactiveRemoveStaleAircrafts [65] view1090Init + [49] decodeID13Field [54] interactiveRemoveStaleDF [66] view1090InitConfig + [25] decodeModesMessage [56] loadFont diff --git a/prof_output_withgeography b/prof_output_withgeography new file mode 100644 index 0000000..9c55a8a --- /dev/null +++ b/prof_output_withgeography @@ -0,0 +1,517 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls ms/call ms/call name + 38.46 0.05 0.05 62 0.81 2.10 drawGeography + 23.08 0.08 0.03 7006834 0.00 0.00 screenDist + 23.08 0.11 0.03 3503324 0.00 0.00 screenCoords + 15.39 0.13 0.02 3508939 0.00 0.00 pxFromLonLat + 0.00 0.13 0.00 3502994 0.00 0.00 outOfBounds + 0.00 0.13 0.00 1057 0.00 0.00 mstime + 0.00 0.13 0.00 698 0.00 0.00 drawTrail + 0.00 0.13 0.00 698 0.00 0.00 findPlaneObj + 0.00 0.13 0.00 682 0.00 0.00 drawString + 0.00 0.13 0.00 510 0.00 0.00 drawStringBG + 0.00 0.13 0.00 478 0.00 0.00 modesChecksum + 0.00 0.13 0.00 372 0.00 0.00 ICAOCacheHashAddress + 0.00 0.13 0.00 371 0.00 0.00 decodeBinMessage + 0.00 0.13 0.00 371 0.00 0.00 decodeModesMessage + 0.00 0.13 0.00 371 0.00 0.00 modesMessageLenByType + 0.00 0.13 0.00 371 0.00 0.00 useModesMessage + 0.00 0.13 0.00 351 0.00 0.00 interactiveFindAircraft + 0.00 0.13 0.00 351 0.00 0.00 interactiveReceiveData + 0.00 0.13 0.00 251 0.00 0.00 CROSSVP + 0.00 0.13 0.00 248 0.00 0.00 drawStatusBox + 0.00 0.13 0.00 248 0.00 0.00 resolveLabelConflicts + 0.00 0.13 0.00 234 0.00 0.00 cprNLFunction + 0.00 0.13 0.00 199 0.00 0.00 ICAOAddressWasRecentlySeen + 0.00 0.13 0.00 178 0.00 0.00 drawPlaneText + 0.00 0.13 0.00 175 0.00 0.00 decodeAC13Field + 0.00 0.13 0.00 173 0.00 0.00 addRecentlySeenICAOAddr + 0.00 0.13 0.00 172 0.00 0.00 sign + 0.00 0.13 0.00 170 0.00 0.00 drawSignalMarks + 0.00 0.13 0.00 170 0.00 0.00 setColor + 0.00 0.13 0.00 170 0.00 0.00 signalToColor + 0.00 0.13 0.00 117 0.00 0.00 cprModFunction + 0.00 0.13 0.00 89 0.00 0.00 drawPlaneHeading + 0.00 0.13 0.00 89 0.00 0.00 drawPlaneOffMap + 0.00 0.13 0.00 82 0.00 0.00 mstime + 0.00 0.13 0.00 78 0.00 0.00 cprNFunction + 0.00 0.13 0.00 63 0.00 0.00 getInput + 0.00 0.13 0.00 62 0.00 2.10 draw + 0.00 0.13 0.00 62 0.00 0.00 drawGrid + 0.00 0.13 0.00 62 0.00 2.10 drawMap + 0.00 0.13 0.00 62 0.00 0.00 drawStatus + 0.00 0.13 0.00 62 0.00 0.00 interactiveRemoveStaleAircrafts + 0.00 0.13 0.00 62 0.00 0.00 modesReadFromClient + 0.00 0.13 0.00 62 0.00 0.00 updatePlanes + 0.00 0.13 0.00 62 0.00 0.00 updateStatus + 0.00 0.13 0.00 57 0.00 0.00 decodeAC12Field + 0.00 0.13 0.00 57 0.00 0.00 mstime + 0.00 0.13 0.00 39 0.00 0.00 cprDlonFunction + 0.00 0.13 0.00 39 0.00 0.00 decodeCPR + 0.00 0.13 0.00 18 0.00 0.00 decodeCPRrelative + 0.00 0.13 0.00 13 0.00 0.00 createPlaneObj + 0.00 0.13 0.00 13 0.00 0.00 interactiveCreateAircraft + 0.00 0.13 0.00 7 0.00 0.00 decodeID13Field + 0.00 0.13 0.00 6 0.00 0.00 interactiveRemoveStaleDF + 0.00 0.13 0.00 5 0.00 0.00 closeFont + 0.00 0.13 0.00 5 0.00 0.00 loadFont + 0.00 0.13 0.00 1 0.00 0.00 anetCreateSocket + 0.00 0.13 0.00 1 0.00 0.00 anetNonBlock + 0.00 0.13 0.00 1 0.00 0.00 anetTcpConnect + 0.00 0.13 0.00 1 0.00 0.00 anetTcpGenericConnect + 0.00 0.13 0.00 1 0.00 0.00 init + 0.00 0.13 0.00 1 0.00 0.00 initMaps + 0.00 0.13 0.00 1 0.00 0.00 modesInitErrorInfo + 0.00 0.13 0.00 1 0.00 0.00 setupConnection + 0.00 0.13 0.00 1 0.00 0.00 view1090Init + 0.00 0.13 0.00 1 0.00 0.00 view1090InitConfig + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2018 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 2 byte(s) for 7.69% of 0.13 seconds + +index % time self children called name + 0.00 0.13 62/62 main [3] +[1] 100.0 0.00 0.13 62 draw [1] + 0.00 0.13 62/62 drawMap [2] + 0.00 0.00 124/1057 mstime [11] + 0.00 0.00 62/62 updatePlanes [44] + 0.00 0.00 62/62 updateStatus [45] + 0.00 0.00 62/62 drawStatus [41] +----------------------------------------------- + 0.00 0.13 62/62 draw [1] +[2] 100.0 0.00 0.13 62 drawMap [2] + 0.05 0.08 62/62 drawGeography [4] + 0.00 0.00 698/698 drawTrail [8] + 0.00 0.00 406/3503324 screenCoords [5] + 0.00 0.00 406/3508939 pxFromLonLat [7] + 0.00 0.00 62/62 drawGrid [9] + 0.00 0.00 593/1057 mstime [11] + 0.00 0.00 248/248 resolveLabelConflicts [25] + 0.00 0.00 178/3502994 outOfBounds [10] + 0.00 0.00 178/178 drawPlaneText [28] + 0.00 0.00 89/89 drawPlaneOffMap [37] + 0.00 0.00 89/89 drawPlaneHeading [36] +----------------------------------------------- + +[3] 100.0 0.00 0.13 main [3] + 0.00 0.13 62/62 draw [1] + 0.00 0.00 63/63 getInput [40] + 0.00 0.00 62/62 interactiveRemoveStaleAircrafts [42] + 0.00 0.00 62/62 modesReadFromClient [43] + 0.00 0.00 1/1 view1090InitConfig [66] + 0.00 0.00 1/1 view1090Init [65] + 0.00 0.00 1/1 setupConnection [64] + 0.00 0.00 1/1 init [61] +----------------------------------------------- + 0.05 0.08 62/62 drawMap [2] +[4] 100.0 0.05 0.08 62 drawGeography [4] + 0.03 0.03 3502560/3503324 screenCoords [5] + 0.02 0.00 3508175/3508939 pxFromLonLat [7] + 0.00 0.00 3502560/3502994 outOfBounds [10] +----------------------------------------------- + 0.00 0.00 358/3503324 drawTrail [8] + 0.00 0.00 406/3503324 drawMap [2] + 0.03 0.03 3502560/3503324 drawGeography [4] +[5] 46.2 0.03 0.03 3503324 screenCoords [5] + 0.03 0.00 7006648/7006834 screenDist [6] +----------------------------------------------- + 0.00 0.00 186/7006834 drawGrid [9] + 0.03 0.00 7006648/7006834 screenCoords [5] +[6] 23.1 0.03 0.00 7006834 screenDist [6] +----------------------------------------------- + 0.00 0.00 358/3508939 drawTrail [8] + 0.00 0.00 406/3508939 drawMap [2] + 0.02 0.00 3508175/3508939 drawGeography [4] +[7] 15.4 0.02 0.00 3508939 pxFromLonLat [7] +----------------------------------------------- + 0.00 0.00 698/698 drawMap [2] +[8] 0.0 0.00 0.00 698 drawTrail [8] + 0.00 0.00 358/3503324 screenCoords [5] + 0.00 0.00 358/3508939 pxFromLonLat [7] + 0.00 0.00 256/3502994 outOfBounds [10] + 0.00 0.00 73/251 CROSSVP [23] +----------------------------------------------- + 0.00 0.00 62/62 drawMap [2] +[9] 0.0 0.00 0.00 62 drawGrid [9] + 0.00 0.00 186/7006834 screenDist [6] + 0.00 0.00 186/682 drawString [13] +----------------------------------------------- + 0.00 0.00 178/3502994 drawMap [2] + 0.00 0.00 256/3502994 drawTrail [8] + 0.00 0.00 3502560/3502994 drawGeography [4] +[10] 0.0 0.00 0.00 3502994 outOfBounds [10] +----------------------------------------------- + 0.00 0.00 124/1057 draw [1] + 0.00 0.00 340/1057 drawSignalMarks [32] + 0.00 0.00 593/1057 drawMap [2] +[11] 0.0 0.00 0.00 1057 mstime [11] +----------------------------------------------- + 0.00 0.00 698/698 updatePlanes [44] +[12] 0.0 0.00 0.00 698 findPlaneObj [12] +----------------------------------------------- + 0.00 0.00 186/682 drawGrid [9] + 0.00 0.00 496/682 drawStatusBox [24] +[13] 0.0 0.00 0.00 682 drawString [13] +----------------------------------------------- + 0.00 0.00 510/510 drawPlaneText [28] +[14] 0.0 0.00 0.00 510 drawStringBG [14] +----------------------------------------------- + 0.00 0.00 107/478 modesInitErrorInfo [63] + 0.00 0.00 371/478 decodeModesMessage [18] +[15] 0.0 0.00 0.00 478 modesChecksum [15] +----------------------------------------------- + 0.00 0.00 173/372 addRecentlySeenICAOAddr [30] + 0.00 0.00 199/372 ICAOAddressWasRecentlySeen [27] +[16] 0.0 0.00 0.00 372 ICAOCacheHashAddress [16] +----------------------------------------------- + 0.00 0.00 371/371 modesReadFromClient [43] +[17] 0.0 0.00 0.00 371 decodeBinMessage [17] + 0.00 0.00 371/371 decodeModesMessage [18] + 0.00 0.00 371/371 useModesMessage [20] +----------------------------------------------- + 0.00 0.00 371/371 decodeBinMessage [17] +[18] 0.0 0.00 0.00 371 decodeModesMessage [18] + 0.00 0.00 371/371 modesMessageLenByType [19] + 0.00 0.00 371/478 modesChecksum [15] + 0.00 0.00 199/199 ICAOAddressWasRecentlySeen [27] + 0.00 0.00 175/175 decodeAC13Field [29] + 0.00 0.00 173/173 addRecentlySeenICAOAddr [30] + 0.00 0.00 57/57 decodeAC12Field [46] + 0.00 0.00 7/7 decodeID13Field [53] +----------------------------------------------- + 0.00 0.00 371/371 decodeModesMessage [18] +[19] 0.0 0.00 0.00 371 modesMessageLenByType [19] +----------------------------------------------- + 0.00 0.00 371/371 decodeBinMessage [17] +[20] 0.0 0.00 0.00 371 useModesMessage [20] + 0.00 0.00 351/351 interactiveReceiveData [22] +----------------------------------------------- + 0.00 0.00 351/351 interactiveReceiveData [22] +[21] 0.0 0.00 0.00 351 interactiveFindAircraft [21] +----------------------------------------------- + 0.00 0.00 351/351 useModesMessage [20] +[22] 0.0 0.00 0.00 351 interactiveReceiveData [22] + 0.00 0.00 351/351 interactiveFindAircraft [21] + 0.00 0.00 57/57 mstime [47] + 0.00 0.00 39/39 decodeCPR [49] + 0.00 0.00 18/18 decodeCPRrelative [50] + 0.00 0.00 13/13 interactiveCreateAircraft [52] +----------------------------------------------- + 0.00 0.00 73/251 drawTrail [8] + 0.00 0.00 89/251 drawPlaneOffMap [37] + 0.00 0.00 89/251 drawPlaneHeading [36] +[23] 0.0 0.00 0.00 251 CROSSVP [23] +----------------------------------------------- + 0.00 0.00 248/248 drawStatus [41] +[24] 0.0 0.00 0.00 248 drawStatusBox [24] + 0.00 0.00 496/682 drawString [13] +----------------------------------------------- + 0.00 0.00 248/248 drawMap [2] +[25] 0.0 0.00 0.00 248 resolveLabelConflicts [25] + 0.00 0.00 172/172 sign [31] +----------------------------------------------- + 0.00 0.00 78/234 cprNFunction [39] + 0.00 0.00 156/234 decodeCPR [49] +[26] 0.0 0.00 0.00 234 cprNLFunction [26] +----------------------------------------------- + 0.00 0.00 199/199 decodeModesMessage [18] +[27] 0.0 0.00 0.00 199 ICAOAddressWasRecentlySeen [27] + 0.00 0.00 199/372 ICAOCacheHashAddress [16] +----------------------------------------------- + 0.00 0.00 178/178 drawMap [2] +[28] 0.0 0.00 0.00 178 drawPlaneText [28] + 0.00 0.00 510/510 drawStringBG [14] + 0.00 0.00 170/170 drawSignalMarks [32] +----------------------------------------------- + 0.00 0.00 175/175 decodeModesMessage [18] +[29] 0.0 0.00 0.00 175 decodeAC13Field [29] +----------------------------------------------- + 0.00 0.00 173/173 decodeModesMessage [18] +[30] 0.0 0.00 0.00 173 addRecentlySeenICAOAddr [30] + 0.00 0.00 173/372 ICAOCacheHashAddress [16] +----------------------------------------------- + 0.00 0.00 172/172 resolveLabelConflicts [25] +[31] 0.0 0.00 0.00 172 sign [31] +----------------------------------------------- + 0.00 0.00 170/170 drawPlaneText [28] +[32] 0.0 0.00 0.00 170 drawSignalMarks [32] + 0.00 0.00 340/1057 mstime [11] + 0.00 0.00 170/170 signalToColor [34] +----------------------------------------------- + 0.00 0.00 170/170 signalToColor [34] +[33] 0.0 0.00 0.00 170 setColor [33] +----------------------------------------------- + 0.00 0.00 170/170 drawSignalMarks [32] +[34] 0.0 0.00 0.00 170 signalToColor [34] + 0.00 0.00 170/170 setColor [33] +----------------------------------------------- + 0.00 0.00 117/117 decodeCPR [49] +[35] 0.0 0.00 0.00 117 cprModFunction [35] +----------------------------------------------- + 0.00 0.00 89/89 drawMap [2] +[36] 0.0 0.00 0.00 89 drawPlaneHeading [36] + 0.00 0.00 89/251 CROSSVP [23] +----------------------------------------------- + 0.00 0.00 89/89 drawMap [2] +[37] 0.0 0.00 0.00 89 drawPlaneOffMap [37] + 0.00 0.00 89/251 CROSSVP [23] +----------------------------------------------- + 0.00 0.00 82/82 updatePlanes [44] +[38] 0.0 0.00 0.00 82 mstime [38] +----------------------------------------------- + 0.00 0.00 39/78 cprDlonFunction [48] + 0.00 0.00 39/78 decodeCPR [49] +[39] 0.0 0.00 0.00 78 cprNFunction [39] + 0.00 0.00 78/234 cprNLFunction [26] +----------------------------------------------- + 0.00 0.00 63/63 main [3] +[40] 0.0 0.00 0.00 63 getInput [40] +----------------------------------------------- + 0.00 0.00 62/62 draw [1] +[41] 0.0 0.00 0.00 62 drawStatus [41] + 0.00 0.00 248/248 drawStatusBox [24] +----------------------------------------------- + 0.00 0.00 62/62 main [3] +[42] 0.0 0.00 0.00 62 interactiveRemoveStaleAircrafts [42] + 0.00 0.00 6/6 interactiveRemoveStaleDF [54] +----------------------------------------------- + 0.00 0.00 62/62 main [3] +[43] 0.0 0.00 0.00 62 modesReadFromClient [43] + 0.00 0.00 371/371 decodeBinMessage [17] +----------------------------------------------- + 0.00 0.00 62/62 draw [1] +[44] 0.0 0.00 0.00 62 updatePlanes [44] + 0.00 0.00 698/698 findPlaneObj [12] + 0.00 0.00 82/82 mstime [38] + 0.00 0.00 13/13 createPlaneObj [51] +----------------------------------------------- + 0.00 0.00 62/62 draw [1] +[45] 0.0 0.00 0.00 62 updateStatus [45] +----------------------------------------------- + 0.00 0.00 57/57 decodeModesMessage [18] +[46] 0.0 0.00 0.00 57 decodeAC12Field [46] +----------------------------------------------- + 0.00 0.00 57/57 interactiveReceiveData [22] +[47] 0.0 0.00 0.00 57 mstime [47] +----------------------------------------------- + 0.00 0.00 39/39 decodeCPR [49] +[48] 0.0 0.00 0.00 39 cprDlonFunction [48] + 0.00 0.00 39/78 cprNFunction [39] +----------------------------------------------- + 0.00 0.00 39/39 interactiveReceiveData [22] +[49] 0.0 0.00 0.00 39 decodeCPR [49] + 0.00 0.00 156/234 cprNLFunction [26] + 0.00 0.00 117/117 cprModFunction [35] + 0.00 0.00 39/78 cprNFunction [39] + 0.00 0.00 39/39 cprDlonFunction [48] +----------------------------------------------- + 0.00 0.00 18/18 interactiveReceiveData [22] +[50] 0.0 0.00 0.00 18 decodeCPRrelative [50] +----------------------------------------------- + 0.00 0.00 13/13 updatePlanes [44] +[51] 0.0 0.00 0.00 13 createPlaneObj [51] +----------------------------------------------- + 0.00 0.00 13/13 interactiveReceiveData [22] +[52] 0.0 0.00 0.00 13 interactiveCreateAircraft [52] +----------------------------------------------- + 0.00 0.00 7/7 decodeModesMessage [18] +[53] 0.0 0.00 0.00 7 decodeID13Field [53] +----------------------------------------------- + 0.00 0.00 6/6 interactiveRemoveStaleAircrafts [42] +[54] 0.0 0.00 0.00 6 interactiveRemoveStaleDF [54] +----------------------------------------------- + 0.00 0.00 5/5 cleanup [86] +[55] 0.0 0.00 0.00 5 closeFont [55] +----------------------------------------------- + 0.00 0.00 5/5 init [61] +[56] 0.0 0.00 0.00 5 loadFont [56] +----------------------------------------------- + 0.00 0.00 1/1 anetTcpGenericConnect [60] +[57] 0.0 0.00 0.00 1 anetCreateSocket [57] +----------------------------------------------- + 0.00 0.00 1/1 setupConnection [64] +[58] 0.0 0.00 0.00 1 anetNonBlock [58] +----------------------------------------------- + 0.00 0.00 1/1 setupConnection [64] +[59] 0.0 0.00 0.00 1 anetTcpConnect [59] + 0.00 0.00 1/1 anetTcpGenericConnect [60] +----------------------------------------------- + 0.00 0.00 1/1 anetTcpConnect [59] +[60] 0.0 0.00 0.00 1 anetTcpGenericConnect [60] + 0.00 0.00 1/1 anetCreateSocket [57] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[61] 0.0 0.00 0.00 1 init [61] + 0.00 0.00 5/5 loadFont [56] + 0.00 0.00 1/1 initMaps [62] +----------------------------------------------- + 0.00 0.00 1/1 init [61] +[62] 0.0 0.00 0.00 1 initMaps [62] +----------------------------------------------- + 0.00 0.00 1/1 view1090Init [65] +[63] 0.0 0.00 0.00 1 modesInitErrorInfo [63] + 0.00 0.00 107/478 modesChecksum [15] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[64] 0.0 0.00 0.00 1 setupConnection [64] + 0.00 0.00 1/1 anetTcpConnect [59] + 0.00 0.00 1/1 anetNonBlock [58] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[65] 0.0 0.00 0.00 1 view1090Init [65] + 0.00 0.00 1/1 modesInitErrorInfo [63] +----------------------------------------------- + 0.00 0.00 1/1 main [3] +[66] 0.0 0.00 0.00 1 view1090InitConfig [66] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2018 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [23] CROSSVP [4] drawGeography [15] modesChecksum + [27] ICAOAddressWasRecentlySeen [9] drawGrid [63] modesInitErrorInfo + [16] ICAOCacheHashAddress [2] drawMap [19] modesMessageLenByType + [30] addRecentlySeenICAOAddr [36] drawPlaneHeading [43] modesReadFromClient + [57] anetCreateSocket [37] drawPlaneOffMap [47] mstime + [58] anetNonBlock [28] drawPlaneText [38] mstime + [59] anetTcpConnect [32] drawSignalMarks [11] mstime + [60] anetTcpGenericConnect [41] drawStatus [10] outOfBounds + [55] closeFont [24] drawStatusBox [7] pxFromLonLat + [48] cprDlonFunction [13] drawString [25] resolveLabelConflicts + [35] cprModFunction [14] drawStringBG [5] screenCoords + [39] cprNFunction [8] drawTrail [6] screenDist + [26] cprNLFunction [12] findPlaneObj [33] setColor + [51] createPlaneObj [40] getInput [64] setupConnection + [46] decodeAC12Field [61] init [31] sign + [29] decodeAC13Field [62] initMaps [34] signalToColor + [17] decodeBinMessage [52] interactiveCreateAircraft [44] updatePlanes + [49] decodeCPR [21] interactiveFindAircraft [45] updateStatus + [50] decodeCPRrelative [22] interactiveReceiveData [20] useModesMessage + [53] decodeID13Field [42] interactiveRemoveStaleAircrafts [65] view1090Init + [18] decodeModesMessage [54] interactiveRemoveStaleDF [66] view1090InitConfig + [1] draw [56] loadFont diff --git a/status.c b/status.c index 852c8f0..cfd8a15 100644 --- a/status.c +++ b/status.c @@ -225,7 +225,7 @@ void drawStatus() { snprintf(strSig, 18, "%.0f%%", 100.0 * Status.avgSig / 1024.0); drawStatusBox(&left, &top, "sAvg", strSig, green); - // drawStatusBox(&left, &top, "||||", "MENU", grey); + //drawStatusBox(&left, &top, "x", "exit", grey); // if(Status.closeCall != NULL) { // drawStatusBox(&left, &top, "", "", black); //this is effectively a newline diff --git a/status.o.REMOVED.git-id b/status.o.REMOVED.git-id index e8a5452..135328c 100644 --- a/status.o.REMOVED.git-id +++ b/status.o.REMOVED.git-id @@ -1 +1 @@ -90ec17d3fd60fd6950fbb50080a31747734eec21 \ No newline at end of file +ad8dd0e24a66f4d0d8df1297c6b9d65e3e429797 \ No newline at end of file diff --git a/testing.svg b/testing.svg new file mode 100644 index 0000000..3ab5971 --- /dev/null +++ b/testing.svg @@ -0,0 +1,19 @@ + + + + +Polygon + + + + + +-122.00493847.118663 + + + + diff --git a/view1090.REMOVED.git-id b/view1090.REMOVED.git-id index fbe62e2..7d1f834 100644 --- a/view1090.REMOVED.git-id +++ b/view1090.REMOVED.git-id @@ -1 +1 @@ -2e266c7f3d943cd7251613fc0eddc9208d5bb05a \ No newline at end of file +59d9fddeaaf6bf38d20131f49c0ce5c67d56749c \ No newline at end of file diff --git a/view1090.c b/view1090.c index b5453ec..c9e294a 100644 --- a/view1090.c +++ b/view1090.c @@ -178,24 +178,12 @@ void showHelp(void) { "-----------------------------------------------------------------------------\n" "| view1090 dump1090 Viewer Ver : "MODES_DUMP1090_VERSION " |\n" "-----------------------------------------------------------------------------\n" - "--interactive Interactive mode refreshing data on screen\n" - "--interactive-rows Max number of rows in interactive mode (default: 15)\n" - "--interactive-ttl Remove from list if idle for (default: 60)\n" - "--interactive-rtl1090 Display flight table in RTL1090 format\n" - "--modeac Enable decoding of SSR modes 3/A & 3/C\n" - "--net-bo-ipaddr TCP Beast output listen IPv4 (default: 127.0.0.1)\n" + "--server TCP Beast output listen IPv4 (default: 127.0.0.1)\n" "--net-bo-port TCP Beast output listen port (default: 30005)\n" "--lat Reference/receiver latitide for surface posn (opt)\n" "--lon Reference/receiver longitude for surface posn (opt)\n" - "--no-crc-check Disable messages with broken CRC (discouraged)\n" - "--no-fix Disable single-bits error correction using CRC\n" - "--fix Enable single-bits error correction using CRC\n" - "--aggressive More CPU for more messages (two bits fixes, ...)\n" "--metric Use metric units (meters, km/h, ...)\n" "--help Show this help\n" - "\n-----------------------------------------------------------------------------\n" - "| SDL DISPLAY OPTIONS |\n" - "-----------------------------------------------------------------------------\n" "--uiscale UI global scaling\n" "--screensize \n" "--fullscreen Start fullscreen\n" @@ -258,6 +246,8 @@ int main(int argc, char **argv) { 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]); } else if (!strcmp(argv[j],"--modeac")) { Modes.mode_ac = 1; } else if (!strcmp(argv[j],"--interactive-rows") && more) { diff --git a/view1090.o.REMOVED.git-id b/view1090.o.REMOVED.git-id index 8adde1b..c6417f6 100644 --- a/view1090.o.REMOVED.git-id +++ b/view1090.o.REMOVED.git-id @@ -1 +1 @@ -547bceb30b8891c365837c7f01eac3b9c227fa8e \ No newline at end of file +015246b1fb747817b20ce17e660e6fb65096a4ff \ No newline at end of file