Skip to content

Commit

Permalink
Show aprs destination in map popup
Browse files Browse the repository at this point in the history
  • Loading branch information
sh123 committed Jul 4, 2023
1 parent 2c7e3e8 commit 968a213
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ private void recordAndSendAudioFrame() throws IOException {
private final ProtocolCallback _protocolCallback = new ProtocolCallback() {
@Override
protected void onReceivePosition(Position position) {
Log.i(TAG, String.format("Position received: %s, %s, lat: %f, lon: %f, course: %f, speed: %f, alt: %f, sym: %s, range: %.2f, status: %s, comment: %s",
position.srcCallsign, position.maidenHead, position.latitude, position.longitude,
Log.i(TAG, String.format("Position received: %s→%s, %s, lat: %f, lon: %f, course: %f, speed: %f, alt: %f, sym: %s, range: %.2f, status: %s, comment: %s",
position.srcCallsign, position.dstCallsign, position.maidenHead, position.latitude, position.longitude,
position.bearingDegrees, position.speedMetersPerSecond, position.altitudeMeters,
position.symbolCode, position.rangeMiles, position.status, position.comment));
_positionItemRepository.upsertPositionItem(position.toPositionItem(false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private void loadStations(boolean movingOnly) {
_stationItemLiveData.observe((LifecycleOwner) _owner, allStations -> {
Log.i(TAG, "add stations " + allStations.size());
for (StationItem station : allStations) {
//Log.i(TAG, "new position " + station.getLatitude() + " " + station.getLongitude());
//Log.i(TAG, "new position " + station.getSrcCallsign() + ">" +
// station.getDstCallsign() + " " + station.getLatitude() + " " + station.getLongitude());
// do not add items without coordinate
if (station.getMaidenHead() == null) continue;
if (addStationPositionIcon(station)) {
Expand Down Expand Up @@ -200,7 +201,8 @@ private boolean addStationPositionIcon(StationItem group) {

private String getStatus(StationItem station) {
double range = UnitTools.milesToKilometers(station.getRangeMiles());
return String.format(Locale.US, "%s<br>%s %f %f<br>%03d° %03dkm/h %04dm %.2fkm<br>%s %s",
return String.format(Locale.US, "%s %s<br>%s %f %f<br>%03d° %03dkm/h %04dm %.2fkm<br>%s %s",
station.getDstCallsign(),
station.getDigipath(),
station.getMaidenHead(), station.getLatitude(), station.getLongitude(),
(int)station.getBearingDegrees(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ public void sendData(String src, String dst, String path, byte[] data) throws IO
}

private boolean isEligibleForTxGate(AprsIsData aprsIsData) {
/* rules:
1. RX gate must be heard on rf within digi hops or range
2. RX gate has not been heard on internet within given period of time or in third party packets
3. ✓ sender must not be heard within given period of time on RF
4. ✓ sender must not have TCPXX, NOGATE, RFONLY
*/
AprsCallsign aprsCallsign = new AprsCallsign(aprsIsData.src);
return _isTxGateEnabled &&
aprsCallsign.isValid &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public StationItem(@NonNull String srcCallsign) {

public void updateFrom(StationItem stationItem) {
setTimestampEpoch(stationItem.getTimestampEpoch());
setDstCallsign(stationItem.getDstCallsign());
// update position if known
if (stationItem.getMaidenHead() != null) {
setMaidenHead(stationItem.getMaidenHead());
Expand All @@ -139,6 +138,8 @@ public void updateFrom(StationItem stationItem) {
setLogLine(stationItem.getLogLine());
if (stationItem.getDigipath() != null)
setDigipath(stationItem.getDigipath());
if (stationItem.getDstCallsign() != null)
setDstCallsign(stationItem.getDstCallsign());
}

@Override
Expand Down

0 comments on commit 968a213

Please sign in to comment.