|
@@ -98,6 +98,8 @@ public class APIModuleGis extends UZModule {
|
|
|
|
|
|
private volatile static String logCorsCod = "";//连接状态:0登录成功 1:登录失败
|
|
private volatile static String logCorsCod = "";//连接状态:0登录成功 1:登录失败
|
|
|
|
|
|
|
|
+ private volatile static String logCorsStatus = "0";//cors 登录控制变量 0 从未登录过, 1 登录中 2 登录过程完成
|
|
|
|
+
|
|
private void initData(){
|
|
private void initData(){
|
|
wgslng = "0.0";
|
|
wgslng = "0.0";
|
|
wgslat = "0.0";
|
|
wgslat = "0.0";
|
|
@@ -142,7 +144,7 @@ public class APIModuleGis extends UZModule {
|
|
try {
|
|
try {
|
|
res.put("code",code);
|
|
res.put("code",code);
|
|
res.put("msg",msg);
|
|
res.put("msg",msg);
|
|
- res.put("version","1.1.8");
|
|
|
|
|
|
+ res.put("version","1.2.0");
|
|
|
|
|
|
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
|
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
|
if (adapter == null) {
|
|
if (adapter == null) {
|
|
@@ -201,6 +203,7 @@ public class APIModuleGis extends UZModule {
|
|
Log.i(TAG+"test",wgslat);
|
|
Log.i(TAG+"test",wgslat);
|
|
Log.i(TAG+"test",wgslng);
|
|
Log.i(TAG+"test",wgslng);
|
|
Log.i(TAG+"test",wgsblh);
|
|
Log.i(TAG+"test",wgsblh);
|
|
|
|
+ Log.i(TAG+"corsStatus",logCorsStatus);
|
|
if("0".equals(postType)||"2".equals(postType)){
|
|
if("0".equals(postType)||"2".equals(postType)){
|
|
wgslat = "0.0";
|
|
wgslat = "0.0";
|
|
wgslng = "0.0";
|
|
wgslng = "0.0";
|
|
@@ -268,8 +271,9 @@ public class APIModuleGis extends UZModule {
|
|
res.put("msg","连接已断开,正在重启,请稍后");
|
|
res.put("msg","连接已断开,正在重启,请稍后");
|
|
return new ModuleResult(res);
|
|
return new ModuleResult(res);
|
|
}
|
|
}
|
|
- if(!"0".equals(logCorsCod)) {
|
|
|
|
|
|
+ if(!"0".equals(logCorsCod)&&!"1".equals(logCorsStatus)) {
|
|
DiffConnectManager.loginCors(this.context(), ip, port, mountName, userName, passWord,diffType,stationId,type);
|
|
DiffConnectManager.loginCors(this.context(), ip, port, mountName, userName, passWord,diffType,stationId,type);
|
|
|
|
+ logCorsStatus = "1";
|
|
}
|
|
}
|
|
|
|
|
|
//TODO rtk连接比cors连接优先级要高
|
|
//TODO rtk连接比cors连接优先级要高
|
|
@@ -305,7 +309,9 @@ public class APIModuleGis extends UZModule {
|
|
userName!=null&&userName.length()>0&&
|
|
userName!=null&&userName.length()>0&&
|
|
passWord!=null&&passWord.length()>0){
|
|
passWord!=null&&passWord.length()>0){
|
|
//TODO 重连必须满足以上条件
|
|
//TODO 重连必须满足以上条件
|
|
- DiffConnectManager.loginCors(this.context(),ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
|
|
|
|
+ if(!"0".equals(logCorsCod)&&!"1".equals(logCorsStatus)) {
|
|
|
|
+ DiffConnectManager.loginCors(this.context(), ip, port, mountName, userName, passWord, diffType, stationId, type);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ramRtkName = rtkName;
|
|
ramRtkName = rtkName;
|
|
@@ -627,7 +633,7 @@ public class APIModuleGis extends UZModule {
|
|
res.put("msg","传递参数不完整");
|
|
res.put("msg","传递参数不完整");
|
|
return new ModuleResult(res);
|
|
return new ModuleResult(res);
|
|
}
|
|
}
|
|
- if(!"0".equals(logCorsCod)){
|
|
|
|
|
|
+ if(!"0".equals(logCorsCod)&&!"1".equals(logCorsStatus)) {
|
|
DiffConnectManager.loginCors(this.context(),ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
DiffConnectManager.loginCors(this.context(),ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
}else{
|
|
}else{
|
|
code = "0";
|
|
code = "0";
|
|
@@ -786,39 +792,39 @@ public class APIModuleGis extends UZModule {
|
|
},1000);
|
|
},1000);
|
|
|
|
|
|
//TODO ③登录cors
|
|
//TODO ③登录cors
|
|
- if(ip!=null&&ip.length()>0&&
|
|
|
|
- port!=null&&
|
|
|
|
- mountName!=null&&mountName.length()>0&&
|
|
|
|
- userName!=null&&userName.length()>0&&
|
|
|
|
- passWord!=null&&passWord.length()>0){
|
|
|
|
- Timer timer2 = new Timer();
|
|
|
|
- Context corsContext = this.context();
|
|
|
|
- timer2.schedule(new TimerTask() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- if(!"0".equals(logCorsCod)){
|
|
|
|
- DiffConnectManager.loginCors(corsContext,ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
|
|
- }else{
|
|
|
|
- //TODO cors更换
|
|
|
|
- if((ip!=null&&!ip.equals(ramIp))||(port!=null&&!port.equals(ramPort))
|
|
|
|
- ||(mountName!=null&&!mountName.equals(ramMountName))
|
|
|
|
- ||(userName!=null&&!userName.equals(ramCorsUserName))
|
|
|
|
- ||(passWord!=null&&!passWord.equals(ramCorsPassword))){
|
|
|
|
- //TODO 有一个条件不一致就要重连 cors
|
|
|
|
- DiffConnectManager.loginOutCors(thisContext);
|
|
|
|
- if(ip!=null&&ip.length()>0&&
|
|
|
|
- port!=null&&
|
|
|
|
- mountName!=null&&mountName.length()>0&&
|
|
|
|
- userName!=null&&userName.length()>0&&
|
|
|
|
- passWord!=null&&passWord.length()>0){
|
|
|
|
- //TODO 重连必须满足以上条件
|
|
|
|
- DiffConnectManager.loginCors(thisContext,ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },1500);
|
|
|
|
- }
|
|
|
|
|
|
+// if(ip!=null&&ip.length()>0&&
|
|
|
|
+// port!=null&&
|
|
|
|
+// mountName!=null&&mountName.length()>0&&
|
|
|
|
+// userName!=null&&userName.length()>0&&
|
|
|
|
+// passWord!=null&&passWord.length()>0){
|
|
|
|
+// Timer timer2 = new Timer();
|
|
|
|
+// Context corsContext = this.context();
|
|
|
|
+// timer2.schedule(new TimerTask() {
|
|
|
|
+// @Override
|
|
|
|
+// public void run() {
|
|
|
|
+// if(!"0".equals(logCorsCod)){
|
|
|
|
+// DiffConnectManager.loginCors(corsContext,ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
|
|
+// }else{
|
|
|
|
+// //TODO cors更换
|
|
|
|
+// if((ip!=null&&!ip.equals(ramIp))||(port!=null&&!port.equals(ramPort))
|
|
|
|
+// ||(mountName!=null&&!mountName.equals(ramMountName))
|
|
|
|
+// ||(userName!=null&&!userName.equals(ramCorsUserName))
|
|
|
|
+// ||(passWord!=null&&!passWord.equals(ramCorsPassword))){
|
|
|
|
+// //TODO 有一个条件不一致就要重连 cors
|
|
|
|
+// DiffConnectManager.loginOutCors(thisContext);
|
|
|
|
+// if(ip!=null&&ip.length()>0&&
|
|
|
|
+// port!=null&&
|
|
|
|
+// mountName!=null&&mountName.length()>0&&
|
|
|
|
+// userName!=null&&userName.length()>0&&
|
|
|
|
+// passWord!=null&&passWord.length()>0){
|
|
|
|
+// //TODO 重连必须满足以上条件
|
|
|
|
+// DiffConnectManager.loginCors(thisContext,ip,port,mountName,userName,passWord,diffType,stationId,type);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// },1500);
|
|
|
|
+// }
|
|
|
|
|
|
//static 内存赋值
|
|
//static 内存赋值
|
|
ramRtkName = rtkName;
|
|
ramRtkName = rtkName;
|
|
@@ -962,6 +968,7 @@ public class APIModuleGis extends UZModule {
|
|
case GnssConnectStatusEvent.RECEIVER_DISCONNECT_CORS_DISCONNECT:
|
|
case GnssConnectStatusEvent.RECEIVER_DISCONNECT_CORS_DISCONNECT:
|
|
connectCode = "1";
|
|
connectCode = "1";
|
|
logCorsCod = "1";
|
|
logCorsCod = "1";
|
|
|
|
+ logCorsStatus = "2";
|
|
Log.i(TAG,"已断开");
|
|
Log.i(TAG,"已断开");
|
|
break;
|
|
break;
|
|
case GnssConnectStatusEvent.RECEIVER_CONNECT_CORS_DISCONNECT:
|
|
case GnssConnectStatusEvent.RECEIVER_CONNECT_CORS_DISCONNECT:
|
|
@@ -970,6 +977,7 @@ public class APIModuleGis extends UZModule {
|
|
break;
|
|
break;
|
|
case GnssConnectStatusEvent.RECEIVER_CONNECT_CORS_CONNECT:
|
|
case GnssConnectStatusEvent.RECEIVER_CONNECT_CORS_CONNECT:
|
|
logCorsCod = "0";
|
|
logCorsCod = "0";
|
|
|
|
+ logCorsStatus = "2";
|
|
Log.i(TAG,"已登录");
|
|
Log.i(TAG,"已登录");
|
|
// if (progressDialog != null && progressDialog.isShowing()) {
|
|
// if (progressDialog != null && progressDialog.isShowing()) {
|
|
// progressDialog.dismiss();
|
|
// progressDialog.dismiss();
|