Skip to content

Commit 2f133fa

Browse files
committed
联调1
1 parent d6fbe79 commit 2f133fa

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

app/src/main/java/com/flir/flirone/GlobalConfig.java

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public class GlobalConfig {
3636
public static final String MAX_TEMP_X = "maxtemplocalx"; //最高温度x坐标
3737
public static final String MAX_TEMP_Y = "maxtemplocaly"; //最高温度y坐标
3838
public static final String AVERAGE_TEMP = "meantemperature"; //平均温度
39+
public static final String TELELONG = "telelong";
40+
public static final String TELELAT = "telelat";
3941

4042
//数据库
4143
public static final String DB_NAME = "heat_images_info.db";

app/src/main/java/com/flir/flirone/NfcHandlerActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void run() {
6262
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) {
6363
NfcInfo nfcInfo = readFromTag(getIntent());
6464
nfcResult = nfcInfo.readResult;
65-
nfcTView.setText("NFC扫描结果:" + nfcResult + "\n当前车厢号:硬卧1234");
65+
nfcTView.setText("NFC扫描结果:" + nfcResult);
6666
}
6767
}
6868
}).start();

app/src/main/java/com/flir/flirone/networkhelp/UpLoadService.java

+16-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public void run() {
9696
while (true) {
9797
try {
9898
Thread.sleep(TIME_DELAYED);
99-
startService(intent);
99+
100+
Intent s = new Intent(UpLoadService.this, UpLoadService.class);
101+
startService(s);
100102
} catch (InterruptedException e) {
101103
e.printStackTrace();
102104
}
@@ -126,15 +128,23 @@ private boolean request(WebServiceCall call, ImageHelp imageHelp, ImageInfo imag
126128
call.request.addProperty(GlobalConfig.PHONE_TAG, phoneId); //手机串号
127129
call.request.addProperty(GlobalConfig.NFC_TAG, imageInfo.getNfcCode());
128130
call.request.addProperty(GlobalConfig.IMAGE, image);
129-
call.request.addProperty(GlobalConfig.IMAGE_NAME, imageInfo.getName());
131+
call.request.addProperty(GlobalConfig.IMAGE_NAME, imageInfo.getName() + ".jpg");
130132
call.request.addProperty(GlobalConfig.IMAGE_TIME, imageHelp.getTimeFromName(imageInfo.getName()));
131-
call.request.addProperty(GlobalConfig.MAX_TEMP, imageInfo.getMaxTemp());
133+
int maxTempDot = imageInfo.getMaxTemp().indexOf(".") + 3;
134+
call.request.addProperty(GlobalConfig.MAX_TEMP, imageInfo.getMaxTemp().substring(0, maxTempDot));
132135
call.request.addProperty(GlobalConfig.MAX_TEMP_X, imageInfo.getMaxTempX());
133136
call.request.addProperty(GlobalConfig.MAX_TEMP_Y, imageInfo.getMaxTempY());
134-
call.request.addProperty(GlobalConfig.AVERAGE_TEMP, imageInfo.getAverTemp());
137+
int averTempDot = imageInfo.getAverTemp().indexOf(".") + 3;
138+
call.request.addProperty(GlobalConfig.AVERAGE_TEMP, imageInfo.getAverTemp().substring(0, averTempDot));
139+
call.request.addProperty(GlobalConfig.TELELONG, "90");
140+
call.request.addProperty(GlobalConfig.TELELAT, "90");
141+
142+
Log.i("temp", imageInfo.getMaxTemp().substring(0, maxTempDot));
143+
Log.i("temp11", imageInfo.getMaxTemp());
135144

136145
try {
137146
String result = webServiceCall.callWebMethod().toString();
147+
Log.i("upload", result);
138148
int result_code = Integer.parseInt(result);
139149
if (result_code > 0) {
140150
isSuccess = true;
@@ -165,6 +175,8 @@ private boolean request(WebServiceCall call, ImageHelp imageHelp, ImageInfo imag
165175
@Override
166176
public void onDestroy() {
167177
super.onDestroy();
178+
179+
Log.i("temp", "UpLoadService onDestroy");
168180
}
169181

170182
@Override

0 commit comments

Comments
 (0)