diff --git a/Aircraft.cpp b/Aircraft.cpp index d676912..99a2d1c 100644 --- a/Aircraft.cpp +++ b/Aircraft.cpp @@ -1,8 +1,12 @@ #include "Aircraft.h" +static auto now() { + return std::chrono::high_resolution_clock::now(); +} + Aircraft::Aircraft(uint32_t addr) { this->addr = addr; - created = 0; + // created = now(); prev_seen = 0; x = 0; @@ -16,6 +20,9 @@ Aircraft::Aircraft(uint32_t addr) { doy = 0; ddox = 0; ddoy = 0; + + lon = 0; + lat = 0; } diff --git a/Aircraft.h b/Aircraft.h index f25fad9..e28c0eb 100644 --- a/Aircraft.h +++ b/Aircraft.h @@ -2,6 +2,7 @@ #include #include +#include class Aircraft { public: @@ -20,16 +21,17 @@ public: //history - std::vector lonHistory, latHistory, headingHistory, timestampHistory; + std::vector lonHistory, latHistory, headingHistory; + std::vector timestampHistory; // float oldLon[TRAIL_LENGTH]; // float oldLat[TRAIL_LENGTH]; // float oldHeading[TRAIL_LENGTH]; // time_t oldSeen[TRAIL_LENGTH]; // uint8_t oldIdx; - uint64_t created; - uint64_t msSeen; - uint64_t msSeenLatLon; + std::chrono::high_resolution_clock::time_point created; + std::chrono::high_resolution_clock::time_point msSeen; + std::chrono::high_resolution_clock::time_point msSeenLatLon; int live; struct Aircraft *next; // Next aircraft in our linked list diff --git a/AircraftList.cpp b/AircraftList.cpp index a4ac4bc..03a24cc 100644 --- a/AircraftList.cpp +++ b/AircraftList.cpp @@ -1,9 +1,7 @@ #include "AircraftList.h" -#include - -static uint64_t now() { - return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); +static auto now() { + return std::chrono::high_resolution_clock::now(); } @@ -56,32 +54,33 @@ void AircraftList::update(Modes *modes) { memcpy(p->flight, a->flight, sizeof(p->flight)); memcpy(p->signalLevel, a->signalLevel, sizeof(p->signalLevel)); + + if(p->seenLatLon == a->seenLatLon) { + a = a->next; + continue; + } + + p->msSeenLatLon = now(); + + p->seenLatLon = a->seenLatLon; + p->altitude = a->altitude; p->speed = a->speed; - p->track = a->track; + p->track = a->track; + p->vert_rate = a->vert_rate; + + if(p->lon == 0) { + p->created = now(); + } p->lon = a->lon; p->lat = a->lat; - if(p->seenLatLon < a->seenLatLon) { - p->msSeenLatLon = now(); - - // p->oldIdx = (p->oldIdx+1) % 32; - - // p->oldLon[p->oldIdx] = p->lon; - // p->oldLat[p->oldIdx] = p->lat; - p->lonHistory.push_back(p->lon); - p->latHistory.push_back(p->lat); - p->headingHistory.push_back(p->track); - p->timestampHistory.push_back(p->seenLatLon); - - // p->oldHeading[p->oldIdx] = p->track; - - // p->oldSeen[p->oldIdx] = p->seenLatLon; - } + p->lonHistory.push_back(p->lon); + p->latHistory.push_back(p->lat); + p->headingHistory.push_back(p->track); + p->timestampHistory.push_back(p->msSeenLatLon); - p->seenLatLon = a->seenLatLon; - a = a->next; } diff --git a/Input.cpp b/Input.cpp index 50ba706..b349e31 100644 --- a/Input.cpp +++ b/Input.cpp @@ -1,13 +1,15 @@ #include "Input.h" -#include - -static uint64_t now() { - return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); +static std::chrono::high_resolution_clock::time_point now() { + return std::chrono::high_resolution_clock::now(); } -static uint64_t elapsed(uint64_t ref) { - return now() - ref; +// static uint64_t now() { +// return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch).count(); +// } + +static uint64_t elapsed(std::chrono::high_resolution_clock::time_point ref) { + return std::chrono::duration_cast(now() - ref).count(); } template int sgn(T val) { @@ -55,14 +57,14 @@ void Input::getInput() view->mapMoved = 1; if(elapsed(touchDownTime) > 100) { - touchDownTime = 0; + //touchDownTime = 0; } break; case SDL_FINGERMOTION:; if(elapsed(touchDownTime) > 150) { tapCount = 0; - touchDownTime = 0; + //touchDownTime = 0; } view->moveCenterRelative( view->screen_width * event.tfinger.dx, view->screen_height * event.tfinger.dy); break; diff --git a/Input.h b/Input.h index 9e6e6f0..360b7f0 100644 --- a/Input.h +++ b/Input.h @@ -2,7 +2,9 @@ #define INPUT_H #include "AppData.h" -#include "View.h" +#include "View.h" + +#include class Input { public: @@ -14,7 +16,7 @@ public: View *view; AppData *appData; - uint64_t touchDownTime; + std::chrono::high_resolution_clock::time_point touchDownTime; int touchx; int touchy; int tapCount; diff --git a/Makefile b/Makefile index 26c5a4b..fb6dc98 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local # -CFLAGS=-O2 -Wno-write-strings +CFLAGS=-O2 -g -Wno-write-strings LIBS=-lm -lSDL2 -lSDL2_ttf -lSDL2_gfx CC=g++ diff --git a/View.cpp b/View.cpp index 0376f13..ea0ca34 100644 --- a/View.cpp +++ b/View.cpp @@ -8,24 +8,21 @@ #include "View.h" #include - -#include #include -static uint64_t now() { - return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); +using fmilliseconds = std::chrono::duration; +using fseconds = std::chrono::duration; + +static std::chrono::high_resolution_clock::time_point now() { + return std::chrono::high_resolution_clock::now(); } -static time_t now_s() { - return std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); +static float elapsed(std::chrono::high_resolution_clock::time_point ref) { + return (fmilliseconds {now() - ref}).count(); } -static uint64_t elapsed(uint64_t ref) { - return now() - ref; -} - -static time_t elapsed_s(time_t ref) { - return now_s() - ref; +static float elapsed_s(std::chrono::high_resolution_clock::time_point ref) { + return (fseconds { now() - ref}).count(); } static float sign(float x) { @@ -536,11 +533,18 @@ void View::drawPlaneIcon(int x, int y, float heading, SDL_Color planeColor) void View::drawTrail(Aircraft *p) { int currentX, currentY, prevX, prevY; - - if(p->lonHistory.empty()) { + float dx, dy; + + if(p->lonHistory.empty()) { return; } + + // pxFromLonLat(&dx, &dy, p->lonHistory.back(), p->latHistory.back()); + // screenCoords(¤tX, ¤tY, dx, dy); + // circleRGBA(renderer, currentX, currentY, 4 * screen_uiscale, 255,255,255,127); + + std::vector::iterator lon_idx = p->lonHistory.begin(); std::vector::iterator lat_idx = p->latHistory.begin(); std::vector::iterator heading_idx = p->headingHistory.begin(); @@ -549,7 +553,6 @@ void View::drawTrail(Aircraft *p) { for(; std::next(lon_idx) != p->lonHistory.end(); ++lon_idx, ++lat_idx, ++heading_idx) { - float dx, dy; pxFromLonLat(&dx, &dy, *(std::next(lon_idx)), *(std::next(lat_idx))); screenCoords(¤tX, ¤tY, dx, dy); @@ -749,7 +752,7 @@ void View::drawSignalMarks(Aircraft *p, int x, int y) { circleRGBA(renderer, x + mapFontWidth, y - 5, 2 * screen_uiscale, barColor.r, barColor.g, barColor.b, seenFade); } - + if(elapsed(p->msSeenLatLon) < 1024) { seenFade = (Uint8) (255.0 - elapsed(p->msSeenLatLon) / 4.0); @@ -766,11 +769,13 @@ void View::drawPlaneText(Aircraft *p) { int currentLine = 0; + float pressure_scale = 1.0f; //this should be set by a UI slider eventually + if(elapsed(p->msSeenLatLon) < 500) { circleRGBA(renderer, p->cx, p->cy, elapsed(p->msSeenLatLon) * screen_width / (8192), 255,255, 255, 64 - (uint8_t)(64.0 * elapsed(p->msSeenLatLon) / 500.0)); } - if(p->pressure * screen_width< 0.4f) { + if(p->pressure * screen_width < pressure_scale) { drawSignalMarks(p, p->x, p->y); char flight[10] = " "; @@ -784,7 +789,7 @@ void View::drawPlaneText(Aircraft *p) { } } - if(p->pressure * screen_width < 0.2f) { + if(p->pressure * screen_width < 0.5f * pressure_scale) { char alt[10] = " "; if (metric) { currentCharCount = snprintf(alt,10," %dm", (int) (p->altitude / 3.2828)); @@ -851,6 +856,10 @@ void View::drawSelectedAircraftText(Aircraft *p) { int currentLine = 0; + if(elapsed(p->msSeenLatLon) < 500) { + circleRGBA(renderer, p->cx, p->cy, elapsed(p->msSeenLatLon) * screen_width / (8192), 255,255, 255, 64 - (uint8_t)(64.0 * elapsed(p->msSeenLatLon) / 500.0)); + } + drawSignalMarks(p, x, y); char flight[10] = " "; @@ -1092,7 +1101,9 @@ void View::drawPlanes() { // draw all trails first so they don't cover up planes and text // also find closest plane to selection point while(p) { - drawTrail(p); + if (p->lon && p->lat) { + drawTrail(p); + } p = p->next; } @@ -1111,11 +1122,7 @@ void View::drawPlanes() { pxFromLonLat(&dx, &dy, p->lon, p->lat); screenCoords(&x, &y, dx, dy); - if(p->created == 0) { - p->created = now(); - } - - float age_ms = (float)elapsed(p->created); + float age_ms = elapsed(p->created); if(age_ms < 500) { circleRGBA(renderer, x, y, 500 - age_ms, 255,255, 255, (uint8_t)(255.0 * age_ms / 500.0)); } else { @@ -1123,20 +1130,32 @@ void View::drawPlanes() { int usex = x; int usey = y; - if(p->seenLatLon > p->timestampHistory.back()) { - int oldx, oldy; + //draw predicted position + // if(p->timestampHistory.size() > 2) { - pxFromLonLat(&dx, &dy, p->lonHistory.back(), p->latHistory.back()); - screenCoords(&oldx, &oldy, dx, dy); + // int x1, y1, x2, y2; - float velx = (x - oldx) / (1000.0 * (p->seenLatLon - p->timestampHistory.back())); - float vely = (y - oldy) / (1000.0 * (p->seenLatLon - p->timestampHistory.back())); - - usex = x + elapsed(p->msSeenLatLon) * velx; - usey = y + elapsed(p->msSeenLatLon) * vely; - } + // pxFromLonLat(&dx, &dy, p->lonHistory.end()[-1], p->latHistory.end()[-1]); + // screenCoords(&x1, &y1, dx, dy); - planeColor = lerpColor(style.planeColor, style.planeGoneColor, float(elapsed_s(p->seen)) / (float) DISPLAY_ACTIVE); + // pxFromLonLat(&dx, &dy, p->lonHistory.end()[-2], p->latHistory.end()[-2]); + // screenCoords(&x2, &y2, dx, dy); + + // //printf("latlon: [%f %f] -> [%f %f], px: [%d %d] -> [%d %d]\n",p->lonHistory.end()[-1], p->latHistory.end()[-1],p->lonHistory.end()[-2], p->latHistory.end()[-2], x1,y1,x2,y2); + + + // float velx = float(x1 - x2) / (fmilliseconds{p->timestampHistory.end()[-1] - p->timestampHistory.end()[-2]}).count(); + // float vely = float(y1 - y2) / (fmilliseconds{p->timestampHistory.end()[-1] - p->timestampHistory.end()[-2]}).count(); + + // //printf("diff: %f\n",(fmilliseconds{p->timestampHistory.end()[-1] - p->timestampHistory.end()[-2]}).count()); + + // //printf("%f %f, %d - %d \n", velx,vely,p->timestampHistory.end()[-1], p->timestampHistory.end()[-2]); + + // usex = x + float(elapsed(p->msSeenLatLon)) * velx; + // usey = y + float(elapsed(p->msSeenLatLon)) * vely; + // } + + planeColor = lerpColor(style.planeColor, style.planeGoneColor, float(elapsed_s(p->msSeen)) / (float) DISPLAY_ACTIVE); if(p == selectedAircraft) { planeColor = style.selectedColor; @@ -1258,8 +1277,12 @@ void View::moveMapToTarget() { } void View::drawMouse() { - if(mouseMovedTime == 0 || elapsed(mouseMovedTime) > 1000) { - mouseMovedTime = 0; + if(!mouseMoved) { + return; + } + + if(elapsed(mouseMovedTime) > 1000) { + mouseMoved = false; return; } @@ -1342,6 +1365,7 @@ void View::registerClick(int tapcount, int x, int y) { } void View::registerMouseMove(int x, int y) { + mouseMoved = true; mouseMovedTime = now(); this->mousex = x; this->mousey = y; @@ -1457,7 +1481,7 @@ void View::draw() { SDL_RenderPresent(renderer); if (elapsed(drawStartTime) < FRAMETIME) { - std::this_thread::sleep_for(std::chrono::milliseconds((FRAMETIME - elapsed(drawStartTime)))); + std::this_thread::sleep_for(fmilliseconds{FRAMETIME} - (now() - drawStartTime)); } lastFrameTime = now(); diff --git a/View.h b/View.h index a3e2427..786a5cb 100644 --- a/View.h +++ b/View.h @@ -5,6 +5,7 @@ #include "Map.h" #include "SDL2/SDL.h" #include "SDL2/SDL_ttf.h" +#include //defs - should all move to config file setup #define ROUND_RADIUS 3 //radius of text box corners @@ -52,11 +53,13 @@ class View { AppData *appData; //for cursor drawing - uint64_t mouseMovedTime; + std::chrono::high_resolution_clock::time_point mouseMovedTime; + bool mouseMoved; int mousex; int mousey; - uint64_t clickTime; + std::chrono::high_resolution_clock::time_point clickTime; + bool clicked; int clickx; int clicky; @@ -129,8 +132,8 @@ class View { int mapRedraw; float currentLon; float currentLat; - uint64_t lastFrameTime; - uint64_t drawStartTime; + std::chrono::high_resolution_clock::time_point lastFrameTime; + std::chrono::high_resolution_clock::time_point drawStartTime; Map map; diff --git a/seen b/seen new file mode 100644 index 0000000..6075aa7 --- /dev/null +++ b/seen @@ -0,0 +1,172 @@ +net_io.c: while ((p) && (p->next != c)) { +net_io.c: p = p->next; +net_io.c: p->next = c->next; +Binary file .git/objects/pack/pack-bf860161866f3e6c65f8f17c93e90565fe339dff.idx matches +Binary file .git/objects/pack/pack-bf860161866f3e6c65f8f17c93e90565fe339dff.pack matches +AircraftList.cpp: if (p->addr == addr) return (p); +AircraftList.cpp: p = p->next; +AircraftList.cpp: p->live = 0; +AircraftList.cpp: p = p->next; +AircraftList.cpp: p->next = head; +AircraftList.cpp: p->prev_seen = p->seen; +AircraftList.cpp: p->live = 1; +AircraftList.cpp: if(p->seen == a->seen) { +AircraftList.cpp: p->seen = a->seen; +AircraftList.cpp: p->msSeen = now(); +AircraftList.cpp: if((p->seen - p->prev_seen) > 0) { +AircraftList.cpp: p->messageRate = 1.0 / (double)(p->seen - p->prev_seen); +AircraftList.cpp: memcpy(p->flight, a->flight, sizeof(p->flight)); +AircraftList.cpp: memcpy(p->signalLevel, a->signalLevel, sizeof(p->signalLevel)); +AircraftList.cpp: p->altitude = a->altitude; +AircraftList.cpp: p->speed = a->speed; +AircraftList.cpp: p->track = a->track; +AircraftList.cpp: p->vert_rate = a->vert_rate; +AircraftList.cpp: p->lon = a->lon; +AircraftList.cpp: p->lat = a->lat; +AircraftList.cpp: if(p->seenLatLon < a->seenLatLon) { +AircraftList.cpp: p->msSeenLatLon = now(); +AircraftList.cpp: // p->oldIdx = (p->oldIdx+1) % 32; +AircraftList.cpp: // p->oldLon[p->oldIdx] = p->lon; +AircraftList.cpp: // p->oldLat[p->oldIdx] = p->lat; +AircraftList.cpp: p->lonHistory.push_back(p->lon); +AircraftList.cpp: p->latHistory.push_back(p->lat); +AircraftList.cpp: p->headingHistory.push_back(p->track); +AircraftList.cpp: p->timestampHistory.push_back(p->msSeenLatLon); +AircraftList.cpp: // p->oldHeading[p->oldIdx] = p->track; +AircraftList.cpp: // p->oldSeen[p->oldIdx] = p->seenLatLon; +AircraftList.cpp: p->seenLatLon = a->seenLatLon; +AircraftList.cpp: if(!p->live) { +AircraftList.cpp: head = p->next; +AircraftList.cpp: prev->next = p->next; +AircraftList.cpp: p = p->next; +Binary file mapdata.bin matches +Binary file viz1090 matches +View.cpp: if(p->lonHistory.empty()) { +View.cpp: std::vector::iterator lon_idx = p->lonHistory.begin(); +View.cpp: std::vector::iterator lat_idx = p->latHistory.begin(); +View.cpp: std::vector::iterator heading_idx = p->headingHistory.begin(); +View.cpp: int idx = p->lonHistory.size(); +View.cpp: for(; std::next(lon_idx) != p->lonHistory.end(); ++lon_idx, ++lat_idx, ++heading_idx) { +View.cpp: // float age = pow(1.0 - (float)idx / (float)p->lonHistory.size(), 2.2); +View.cpp: float age = 1.0 - (float)idx / (float)p->lonHistory.size(); +View.cpp: unsigned char * pSig = p->signalLevel; +View.cpp: if(elapsed(p->msSeen) < 1024) { +View.cpp: seenFade = (Uint8) (255.0 - elapsed(p->msSeen) / 4.0); +View.cpp: if(elapsed(p->msSeenLatLon) < 1024) { +View.cpp: seenFade = (Uint8) (255.0 - elapsed(p->msSeenLatLon) / 4.0); +View.cpp: if(elapsed(p->msSeenLatLon) < 500) { +View.cpp: circleRGBA(renderer, p->cx, p->cy, elapsed(p->msSeenLatLon) * screen_width / (8192), 255,255, 255, 64 - (uint8_t)(64.0 * elapsed(p->msSeenLatLon) / 500.0)); +View.cpp: if(p->pressure * screen_width < pressure_scale) { +View.cpp: drawSignalMarks(p, p->x, p->y); +View.cpp: maxCharCount = snprintf(flight,10," %s", p->flight); +View.cpp: drawStringBG(flight, p->x, p->y, mapBoldFont, white, black); +View.cpp: //roundedRectangleRGBA(renderer, p->x, p->y, p->x + maxCharCount * mapFontWidth, p->y + mapFontHeight, ROUND_RADIUS, white.r, white.g, white.b, SDL_ALPHA_OPAQUE); +View.cpp: //drawString(flight, p->x, p->y, mapBoldFont, white); +View.cpp: if(p->pressure * screen_width < 0.5f * pressure_scale) { +View.cpp: currentCharCount = snprintf(alt,10," %dm", (int) (p->altitude / 3.2828)); +View.cpp: currentCharCount = snprintf(alt,10," %d'", p->altitude); +View.cpp: drawStringBG(alt, p->x, p->y + currentLine * mapFontHeight, mapFont, grey, black); +View.cpp: currentCharCount = snprintf(speed,10," %dkm/h", (int) (p->speed * 1.852)); +View.cpp: currentCharCount = snprintf(speed,10," %dmph", p->speed); +View.cpp: drawStringBG(speed, p->x, p->y + currentLine * mapFontHeight, mapFont, grey, black); +View.cpp: Sint16 vx[4] = {p->cx, p->cx + (p->x - p->cx) / 2, p->x, p->x}; +View.cpp: Sint16 vy[4] = {p->cy, p->cy + (p->y - p->cy) / 2, p->y - mapFontHeight, p->y}; +View.cpp: if(p->cy > p->y + currentLine * mapFontHeight) { +View.cpp: vy[2] = p->y + currentLine * mapFontHeight + mapFontHeight; +View.cpp: vy[3] = p->y + currentLine * mapFontHeight; +View.cpp: thickLineRGBA(renderer,p->x,p->y,p->x,p->y+currentLine*mapFontHeight,screen_uiscale,200,200,200,SDL_ALPHA_OPAQUE); +View.cpp: p->w = maxCharCount * mapFontWidth; +View.cpp: p->h = currentLine * mapFontHeight; +View.cpp: int x = p->cx - 20; +View.cpp: int y = p->cy + 22; +View.cpp: if(elapsed(p->msSeenLatLon) < 500) { +View.cpp: circleRGBA(renderer, p->cx, p->cy, elapsed(p->msSeenLatLon) * screen_width / (8192), 255,255, 255, 64 - (uint8_t)(64.0 * elapsed(p->msSeenLatLon) / 500.0)); +View.cpp: maxCharCount = snprintf(flight,10," %s", p->flight); +View.cpp: //roundedRectangleRGBA(renderer, p->x, p->y, p->x + maxCharCount * mapFontWidth, p->y + mapFontHeight, ROUND_RADIUS, white.r, white.g, white.b, SDL_ALPHA_OPAQUE); +View.cpp: //drawString(flight, p->x, p->y, mapBoldFont, white); +View.cpp: currentCharCount = snprintf(alt,10," %dm", (int) (p->altitude / 3.2828)); +View.cpp: currentCharCount = snprintf(alt,10," %d'", p->altitude); +View.cpp: currentCharCount = snprintf(speed,10," %dkm/h", (int) (p->speed * 1.852)); +View.cpp: currentCharCount = snprintf(speed,10," %dmph", p->speed); +View.cpp: int p_left = p->x - 10 * screen_uiscale; +View.cpp: int p_right = p->x + p->w + 10 * screen_uiscale; +View.cpp: int p_top = p->y - 10 * screen_uiscale; +View.cpp: int p_bottom = p->y + p->h + 10 * screen_uiscale; +View.cpp: //rectangleRGBA(renderer, p->x, p->y, p->x + p->w, p->y + p->h, 255,0,0, SDL_ALPHA_OPAQUE); +View.cpp: //lineRGBA(renderer, p->cx, p->cy, p->x, p->y, 0,255,0, SDL_ALPHA_OPAQUE); +View.cpp: p->ddox = 0; +View.cpp: p->ddoy = 0; +View.cpp: float o_mag = sqrt(p->ox*p->ox + p->oy*p->oy); +View.cpp: p->ddox -= p->ox / o_mag * spring_force * (o_mag - spring_length); +View.cpp: p->ddoy -= p->oy / o_mag * spring_force * (o_mag - spring_length); +View.cpp: p->ox += (float)(10 * screen_uiscale - p_left); +View.cpp: p->ox -= (float)(p_right - (screen_width - 10 * screen_uiscale)); +View.cpp: p->oy += (float)(10 * screen_uiscale - p_top); +View.cpp: p->oy -= (float)(p_bottom - (screen_height - 10 * screen_uiscale)); +View.cpp: p->pressure = 0; +View.cpp: if(check_p->addr != p->addr) { +View.cpp: int check_left = check_p->x - 5 * screen_uiscale; +View.cpp: int check_right = check_p->x + check_p->w + 5 * screen_uiscale; +View.cpp: int check_top = check_p->y - 5 * screen_uiscale; +View.cpp: int check_bottom = check_p->y + check_p->h + 5 * screen_uiscale; +View.cpp: p->pressure += 1.0f / ((check_p->cx - p->cx) * (check_p->cx - p->cx) + (check_p->cy - p->cy) * (check_p->cy - p->cy)); +View.cpp: check_p->ddox -= label_force * (float)(check_left - p_right); +View.cpp: check_p->ddox -= label_force * (float)(check_right - p_left); +View.cpp: check_p->ddoy -= label_force * (float)(check_top - p_bottom); +View.cpp: check_p->ddoy -= label_force * (float)(check_bottom - p_top); +View.cpp: p_left = p->x - 5 * screen_uiscale; +View.cpp: p_right = p->x + 5 * screen_uiscale; +View.cpp: p_top = p->y - 5 * screen_uiscale; +View.cpp: p_bottom = p->y + 5 * screen_uiscale; +View.cpp: int check_left = check_p->x - 5 * screen_uiscale; +View.cpp: int check_right = check_p->x + check_p->w + 5 * screen_uiscale; +View.cpp: int check_top = check_p->y - 5 * screen_uiscale; +View.cpp: int check_bottom = check_p->y + check_p->h + 5 * screen_uiscale; +View.cpp: check_p->ddox -= plane_force * (float)(check_left - p_right); +View.cpp: check_p->ddox -= plane_force * (float)(check_right - p_left); +View.cpp: check_p->ddoy -= plane_force * (float)(check_top - p_bottom); +View.cpp: check_p->ddoy -= plane_force * (float)(check_bottom - p_top); +View.cpp: p = p->next; +View.cpp: p->dox += p->ddox; +View.cpp: p->doy += p->ddoy; +View.cpp: p->dox *= damping_force; +View.cpp: p->doy *= damping_force; +View.cpp: if(fabs(p->dox) > 10.0f) { +View.cpp: p->dox = sign(p->dox) * 10.0f; +View.cpp: if(fabs(p->doy) > 10.0f) { +View.cpp: p->doy = sign(p->doy) * 10.0f; +View.cpp: if(fabs(p->dox) < 1.0f) { +View.cpp: p->dox = 0; +View.cpp: if(fabs(p->doy) < 1.0f) { +View.cpp: p->doy = 0; +View.cpp: p->ox += p->dox; +View.cpp: p->oy += p->doy; +View.cpp: p->x = p->cx + (int)round(p->ox); +View.cpp: p->y = p->cy + (int)round(p->oy); +View.cpp: p = p->next; +View.cpp: p = p->next; +View.cpp: if (p->lon && p->lat) { +View.cpp: pxFromLonLat(&dx, &dy, p->lon, p->lat); +View.cpp: if(p->created == 0) { +View.cpp: p->created = now(); +View.cpp: float age_ms = (float)elapsed(p->created); +View.cpp: if(p->msSeenLatLon > p->timestampHistory.back()) { +View.cpp: pxFromLonLat(&dx, &dy, p->lonHistory.back(), p->latHistory.back()); +View.cpp: float velx = (x - oldx) / (p->msSeenLatLon - p->timestampHistory.back()); +View.cpp: float vely = (y - oldy) / (p->msSeenLatLon - p->timestampHistory.back()); +View.cpp: usex = x + elapsed(p->msSeenLatLon) * velx; +View.cpp: usey = y + elapsed(p->msSeenLatLon) * vely; +View.cpp: planeColor = lerpColor(style.planeColor, style.planeGoneColor, float(elapsed_s(p->seen)) / (float) DISPLAY_ACTIVE); +View.cpp: drawPlaneOffMap(x, y, &(p->cx), &(p->cy), planeColor); +View.cpp: drawPlaneIcon(usex, usey, p->track, planeColor); +View.cpp: p->cx = usex; +View.cpp: p->cy = usey; +View.cpp: p = p->next; +View.cpp: if((p->cx - x) * (p->cx - x) + (p->cy - y) * (p->cy - y) < 900) { +View.cpp: if((p->cx - x) * (p->cx - x) + (p->cy - y) * (p->cy - y) < +View.cpp: p = p->next; +all.svg: +AppData.cpp: unsigned char * pSig = p->signalLevel; +AppData.cpp: if (p->lon && p->lat) { +AppData.cpp: msgRateAccumulate += p->messageRate; +AppData.cpp: p = p->next;