Rearange BRouterActivity/BRouterView
This commit is contained in:
parent
c67374a268
commit
11f104afe9
2 changed files with 29 additions and 49 deletions
|
@ -48,10 +48,27 @@ public class BRouterActivity extends AppCompatActivity implements ActivityCompat
|
||||||
private static final int DIALOG_SHOW_REPEAT_TIMEOUT_HELP_ID = 16;
|
private static final int DIALOG_SHOW_REPEAT_TIMEOUT_HELP_ID = 16;
|
||||||
private static final int DIALOG_SHOW_API23_HELP_ID = 17;
|
private static final int DIALOG_SHOW_API23_HELP_ID = 17;
|
||||||
|
|
||||||
|
|
||||||
private BRouterView mBRouterView;
|
private BRouterView mBRouterView;
|
||||||
private PowerManager mPowerManager;
|
private PowerManager mPowerManager;
|
||||||
private WakeLock mWakeLock;
|
private WakeLock mWakeLock;
|
||||||
|
private String[] availableProfiles;
|
||||||
|
private String selectedProfile = null;
|
||||||
|
private List<File> availableBasedirs;
|
||||||
|
private String[] basedirOptions;
|
||||||
|
private int selectedBasedir;
|
||||||
|
private String[] availableWaypoints;
|
||||||
|
private String[] routingModes;
|
||||||
|
private boolean[] routingModesChecked;
|
||||||
|
private String defaultbasedir = null;
|
||||||
|
private String message = null;
|
||||||
|
private String[] availableVias;
|
||||||
|
private Set<String> selectedVias;
|
||||||
|
private List<OsmNodeNamed> nogoList;
|
||||||
|
private String maptoolDirCandidate;
|
||||||
|
private Set<Integer> dialogIds = new HashSet<Integer>();
|
||||||
|
private String errorMessage;
|
||||||
|
private String title;
|
||||||
|
private int wpCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
|
@ -359,28 +376,6 @@ public class BRouterActivity extends AppCompatActivity implements ActivityCompat
|
||||||
return checked;
|
return checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] availableProfiles;
|
|
||||||
private String selectedProfile = null;
|
|
||||||
|
|
||||||
private List<File> availableBasedirs;
|
|
||||||
private String[] basedirOptions;
|
|
||||||
private int selectedBasedir;
|
|
||||||
|
|
||||||
private String[] availableWaypoints;
|
|
||||||
|
|
||||||
private String[] routingModes;
|
|
||||||
private boolean[] routingModesChecked;
|
|
||||||
|
|
||||||
private String defaultbasedir = null;
|
|
||||||
private String message = null;
|
|
||||||
|
|
||||||
private String[] availableVias;
|
|
||||||
private Set<String> selectedVias;
|
|
||||||
|
|
||||||
private List<OsmNodeNamed> nogoList;
|
|
||||||
|
|
||||||
private String maptoolDirCandidate;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void selectProfile(String[] items) {
|
public void selectProfile(String[] items) {
|
||||||
availableProfiles = items;
|
availableProfiles = items;
|
||||||
|
@ -486,8 +481,6 @@ public class BRouterActivity extends AppCompatActivity implements ActivityCompat
|
||||||
showDialog(DIALOG_NOGOSELECT_ID);
|
showDialog(DIALOG_NOGOSELECT_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<Integer> dialogIds = new HashSet<Integer>();
|
|
||||||
|
|
||||||
private void showNewDialog(int id) {
|
private void showNewDialog(int id) {
|
||||||
if (dialogIds.contains(Integer.valueOf(id))) {
|
if (dialogIds.contains(Integer.valueOf(id))) {
|
||||||
removeDialog(id);
|
removeDialog(id);
|
||||||
|
@ -496,10 +489,6 @@ public class BRouterActivity extends AppCompatActivity implements ActivityCompat
|
||||||
showDialog(id);
|
showDialog(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String errorMessage;
|
|
||||||
private String title;
|
|
||||||
private int wpCount;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void showErrorMessage(String msg) {
|
public void showErrorMessage(String msg) {
|
||||||
errorMessage = msg;
|
errorMessage = msg;
|
||||||
|
|
|
@ -47,10 +47,11 @@ import btools.router.RoutingHelper;
|
||||||
import btools.util.CheapRuler;
|
import btools.util.CheapRuler;
|
||||||
|
|
||||||
public class BRouterView extends View {
|
public class BRouterView extends View {
|
||||||
|
|
||||||
|
public boolean canAccessSdCard;
|
||||||
RoutingEngine cr;
|
RoutingEngine cr;
|
||||||
private int imgw;
|
private int imgw;
|
||||||
private int imgh;
|
private int imgh;
|
||||||
|
|
||||||
private int centerLon;
|
private int centerLon;
|
||||||
private int centerLat;
|
private int centerLat;
|
||||||
private double scaleLon; // ilon -> pixel
|
private double scaleLon; // ilon -> pixel
|
||||||
|
@ -60,7 +61,6 @@ public class BRouterView extends View {
|
||||||
private List<OsmNodeNamed> nogoList;
|
private List<OsmNodeNamed> nogoList;
|
||||||
private List<OsmNodeNamed> nogoVetoList;
|
private List<OsmNodeNamed> nogoVetoList;
|
||||||
private OsmTrack rawTrack;
|
private OsmTrack rawTrack;
|
||||||
|
|
||||||
private File retryBaseDir;
|
private File retryBaseDir;
|
||||||
private File modesDir;
|
private File modesDir;
|
||||||
private File tracksDir;
|
private File tracksDir;
|
||||||
|
@ -73,32 +73,26 @@ public class BRouterView extends View {
|
||||||
private boolean waitingForMigration = false;
|
private boolean waitingForMigration = false;
|
||||||
private String rawTrackPath;
|
private String rawTrackPath;
|
||||||
private String oldMigrationPath;
|
private String oldMigrationPath;
|
||||||
|
|
||||||
private boolean needsViaSelection;
|
private boolean needsViaSelection;
|
||||||
private boolean needsNogoSelection;
|
private boolean needsNogoSelection;
|
||||||
private boolean needsWaypointSelection;
|
private boolean needsWaypointSelection;
|
||||||
|
|
||||||
private WpDatabaseScanner dataBaseScanner;
|
private WpDatabaseScanner dataBaseScanner;
|
||||||
|
|
||||||
private long lastDataTime = System.currentTimeMillis();
|
private long lastDataTime = System.currentTimeMillis();
|
||||||
|
|
||||||
private CoordinateReader cor;
|
private CoordinateReader cor;
|
||||||
|
|
||||||
private int[] imgPixels;
|
private int[] imgPixels;
|
||||||
|
|
||||||
private int memoryClass;
|
private int memoryClass;
|
||||||
|
private long lastTs = System.currentTimeMillis();
|
||||||
public boolean canAccessSdCard;
|
private long startTime = 0L;
|
||||||
|
|
||||||
public void stopRouting() {
|
|
||||||
if (cr != null) cr.terminate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BRouterView(Context context, int memoryClass) {
|
public BRouterView(Context context, int memoryClass) {
|
||||||
super(context);
|
super(context);
|
||||||
this.memoryClass = memoryClass;
|
this.memoryClass = memoryClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopRouting() {
|
||||||
|
if (cr != null) cr.terminate();
|
||||||
|
}
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
try {
|
try {
|
||||||
// get base dir from private file
|
// get base dir from private file
|
||||||
|
@ -703,9 +697,6 @@ public class BRouterView extends View {
|
||||||
lastDataTime += 4000; // give time for the toast before exiting
|
lastDataTime += 4000; // give time for the toast before exiting
|
||||||
}
|
}
|
||||||
|
|
||||||
private long lastTs = System.currentTimeMillis();
|
|
||||||
private long startTime = 0L;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas) {
|
protected void onDraw(Canvas canvas) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue