kopia lustrzana https://github.com/sh123/codec2_talkie
Database refactoring
rodzic
48a9ac86d2
commit
f6613bfb6e
|
@ -127,8 +127,8 @@ public class Ax25 implements Protocol {
|
|||
if (ax25Data.isAudio) {
|
||||
_parentProtocolCallback.onReceiveCompressedAudio(ax25Data.src, ax25Data.dst, ax25Data.codec2Mode, ax25Data.rawData);
|
||||
} else {
|
||||
_parentProtocolCallback.onReceiveData(ax25Data.src, ax25Data.dst, ax25Data.digipath, ax25Data.rawData);
|
||||
_parentProtocolCallback.onReceiveLog(ax25Data.toString());
|
||||
_parentProtocolCallback.onReceiveData(ax25Data.src, ax25Data.dst, ax25Data.digipath, ax25Data.rawData);
|
||||
if (_isDigiRepeaterEnabled) digiRepeat(ax25Data);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -116,9 +116,8 @@ public class Position {
|
|||
}
|
||||
|
||||
public StationItem toStationItem() {
|
||||
StationItem stationItem = new StationItem();
|
||||
StationItem stationItem = new StationItem(srcCallsign);
|
||||
stationItem.setTimestampEpoch(System.currentTimeMillis());
|
||||
stationItem.setSrcCallsign(srcCallsign);
|
||||
stationItem.setDstCallsign(dstCallsign);
|
||||
stationItem.setLatitude(latitude);
|
||||
stationItem.setLongitude(longitude);
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.concurrent.ExecutorService;
|
|||
import java.util.concurrent.Executors;
|
||||
|
||||
@androidx.room.Database(
|
||||
version = 9,
|
||||
version = 10,
|
||||
entities = {LogItem.class, MessageItem.class, PositionItem.class, StationItem.class},
|
||||
exportSchema = false
|
||||
)
|
||||
|
|
|
@ -49,9 +49,8 @@ public class LogItem {
|
|||
public void setIsTransmit(boolean isTransmit) { this.isTransmit = isTransmit; }
|
||||
|
||||
public StationItem toStationItem() {
|
||||
StationItem stationItem = new StationItem();
|
||||
StationItem stationItem = new StationItem(srcCallsign);
|
||||
stationItem.setTimestampEpoch(System.currentTimeMillis());
|
||||
stationItem.setSrcCallsign(srcCallsign);
|
||||
stationItem.setDstCallsign(stationItem.dstCallsign);
|
||||
stationItem.setLogLine(logLine);
|
||||
return stationItem;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.radio.codec2talkie.storage.station;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@Entity(indices = {@Index(value = {"id", "srcCallsign"}, unique = true)})
|
||||
@Entity(indices = {@Index(value = {"srcCallsign"}, unique = true)})
|
||||
public class StationItem {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private long id;
|
||||
private long timestampEpoch;
|
||||
@NonNull
|
||||
@PrimaryKey
|
||||
private String srcCallsign;
|
||||
private long timestampEpoch;
|
||||
public String dstCallsign;
|
||||
private String maidenHead;
|
||||
public double latitude;
|
||||
|
@ -26,8 +26,8 @@ public class StationItem {
|
|||
public double rangeMiles;
|
||||
public int directivityDeg;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
public StationItem(@NonNull String srcCallsign) {
|
||||
this.srcCallsign = srcCallsign;
|
||||
}
|
||||
|
||||
public long getTimestampEpoch() { return timestampEpoch; }
|
||||
|
@ -62,10 +62,6 @@ public class StationItem {
|
|||
|
||||
public int getDirectivityDeg() { return directivityDeg; }
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setTimestampEpoch(long timestampEpoch) { this.timestampEpoch = timestampEpoch; }
|
||||
|
||||
public void setSrcCallsign(String srcCallsign) { this.srcCallsign = srcCallsign; }
|
||||
|
|
Ładowanie…
Reference in New Issue