mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 18:47:33 -05:00
(cherry picked from commit 55b20c75c0)
Co-authored-by: sheirerd <sheirerd@ainfosec.com>
This commit is contained in:
@@ -86,6 +86,8 @@ public class PlottableEntityHistory
|
|||||||
* Updates the entity history with a location from the latest decode event
|
* Updates the entity history with a location from the latest decode event
|
||||||
*/
|
*/
|
||||||
public void add(PlottableDecodeEvent event)
|
public void add(PlottableDecodeEvent event)
|
||||||
|
{
|
||||||
|
if(event.isValidLocation())
|
||||||
{
|
{
|
||||||
TimestampedGeoPosition mostRecentPosition = getLatestPosition();
|
TimestampedGeoPosition mostRecentPosition = getLatestPosition();
|
||||||
TimestampedGeoPosition latest = new TimestampedGeoPosition(event.getLocation(), event.getTimeStart());
|
TimestampedGeoPosition latest = new TimestampedGeoPosition(event.getLocation(), event.getTimeStart());
|
||||||
@@ -101,6 +103,7 @@ public class PlottableEntityHistory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if the latest time and position is at least 30 seconds newer than the previous position and either the
|
* Indicates if the latest time and position is at least 30 seconds newer than the previous position and either the
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ public class PlottableEntityModel extends AbstractTableModel implements Listener
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive(PlottableDecodeEvent plottableDecodeEvent)
|
public void receive(PlottableDecodeEvent plottableDecodeEvent)
|
||||||
|
{
|
||||||
|
if(plottableDecodeEvent.isValidLocation())
|
||||||
{
|
{
|
||||||
//Add or update the event on the swing event thread
|
//Add or update the event on the swing event thread
|
||||||
EventQueue.invokeLater(() -> {
|
EventQueue.invokeLater(() -> {
|
||||||
@@ -138,6 +140,7 @@ public class PlottableEntityModel extends AbstractTableModel implements Listener
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getColumnName(int column)
|
public String getColumnName(int column)
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ public class PlottableDecodeEvent extends DecodeEvent
|
|||||||
return mGeoPosition;
|
return mGeoPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the location is non-null and either latitude or longitude is not at the zero axis. If the location
|
||||||
|
* coordinates are zero or both are very small values close to zero, then the location is flagged as invalid.
|
||||||
|
*/
|
||||||
|
public boolean isValidLocation()
|
||||||
|
{
|
||||||
|
return mGeoPosition != null &&
|
||||||
|
((Math.abs(mGeoPosition.getLatitude()) > 0.01) || (Math.abs(mGeoPosition.getLongitude()) > 0.01));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the heading for the mobile plottable event
|
* Sets the heading for the mobile plottable event
|
||||||
* @param heading
|
* @param heading
|
||||||
|
|||||||
Reference in New Issue
Block a user