Skip to content

Commit bb50bd7

Browse files
author
wenlong
committed
backup
1 parent 5cf1837 commit bb50bd7

19 files changed

+477
-27
lines changed
Binary file not shown.

libs/comobd-3G-SDK-1.0.0.jar

32.1 KB
Binary file not shown.

libs/eventbus.jar

74.4 KB
Binary file not shown.

libs/fastjson-1.1.45.android.jar

251 KB
Binary file not shown.

libs/zyobd.jar

-31.7 KB
Binary file not shown.

src/com/obd/app/MGApp.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.obd.app;
22

3+
import com.obd.simpleexample.StatusInface;
34
import com.obd.utils.DBmanager;
45
import com.obd.utils.QuickShPref;
56

src/com/obd/app/bean/DROInfo.java

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
package com.obd.app.bean;
2+
3+
import com.obd.utils.DBmanager;
4+
import com.obd.utils.MyLog;
5+
import com.obd.utils.QuickShPref;
6+
7+
import android.app.Application;
8+
import android.content.Context;
9+
import android.util.Log;
10+
11+
public class DROInfo {
12+
13+
public String MAF;
14+
public String AVGSPD;
15+
public String STARTS;
16+
public String MILE_T;
17+
public String MAXRPM;
18+
public String POWER;
19+
public String RACLS;
20+
public String FUELS;
21+
public String FUEL_T;
22+
public String MAXACL;
23+
public String TIMES;
24+
public String MAXSPD;
25+
public String BRAKES;
26+
public String MINRPM;
27+
public String MILES;
28+
public void setMILES(String arg){
29+
MILES = arg;
30+
}
31+
public void setMINRPM(String arg){
32+
MINRPM = arg;
33+
}
34+
public void setBRAKES(String arg){
35+
BRAKES = arg;
36+
}
37+
public void setMAXSPD(String arg){
38+
MAXSPD = arg;
39+
}
40+
public void setTIMES(String arg){
41+
TIMES = arg;
42+
}
43+
public void setMAXACL(String arg){
44+
MAXACL = arg;
45+
}
46+
public void setFUEL_T(String arg){
47+
FUEL_T = arg;
48+
}
49+
public void setFUELS(String arg){
50+
FUELS = arg;
51+
}
52+
public void setRACLS(String arg){
53+
RACLS = arg;
54+
}
55+
public void setPOWER(String arg){
56+
POWER = arg;
57+
}
58+
public void setMAXRPM(String arg){
59+
MAXRPM = arg;
60+
}
61+
public void setMILE_T(String arg){
62+
MILE_T = arg;
63+
}
64+
public void setSTARTS(String arg){
65+
STARTS = arg;
66+
}
67+
public void setAVGSPD(String arg){
68+
AVGSPD = arg;
69+
}
70+
public void setMAF(String arg){
71+
MAF = arg;
72+
}
73+
74+
public int getMILESM(){
75+
int ret = 0;
76+
try {
77+
float f = Float.parseFloat(MILES);
78+
ret = (int) (f*1000);
79+
} catch (Exception e) {
80+
// TODO: handle exception
81+
MyLog.W("累计里程km转换成M失败 MILES="+MILES);
82+
}
83+
return ret;
84+
}
85+
86+
public int getFuleSmL(){
87+
int ret = 0;
88+
try {
89+
float f = Float.parseFloat(FUELS);
90+
ret = (int) (f*1000);
91+
} catch (Exception e) {
92+
// TODO: handle exception
93+
MyLog.W("累计油耗L转换成mL失败 FUELS="+FUELS);
94+
}
95+
return ret;
96+
}
97+
}

src/com/obd/app/bean/JsonMsg.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.obd.app.bean;
2+
3+
import org.json.JSONObject;
4+
5+
public class JsonMsg {
6+
public int what;
7+
public JSONObject obj;
8+
}

src/com/obd/app/bean/RSOInfo.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.obd.app.bean;
2+
3+
public class RSOInfo {
4+
public String MPH;
5+
public String TIMES;
6+
public String SPD;
7+
public String RPM;
8+
9+
public void setMPH(String arg){
10+
MPH = arg;
11+
}
12+
public void setTIMES(String arg){
13+
TIMES = arg;
14+
}
15+
public void setSPD(String arg){
16+
SPD = arg;
17+
}
18+
public void setRPM(String arg){
19+
RPM = arg;
20+
}
21+
public String getDisplay(){
22+
String ret = null;
23+
ret = String.format("&R%s,%s,%s,%s,&F%s", 0,0,0,TIMES,SPD);
24+
return ret;
25+
}
26+
}

src/com/obd/observer/DRObserver.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.obd.observer;
2+
3+
import org.json.JSONObject;
4+
5+
import android.util.Log;
6+
7+
import com.comobd.zyobd.observer.DRONObserver;
8+
import com.comobd.zyobd.port.Subject;
9+
import com.obd.simpleexample.StatusInface;
10+
11+
import de.greenrobot.event.EventBus;
12+
13+
/**
14+
* 车辆熄火之后驾驶习惯数据上传
15+
* @author LUFFY
16+
*
17+
*/
18+
public class DRObserver extends DRONObserver{
19+
private static final String TAG = DRObserver.class.getName();
20+
21+
public DRObserver(Subject subject) {
22+
super(subject);
23+
// TODO Auto-generated constructor stub
24+
}
25+
26+
@Override
27+
public void update(JSONObject jsonString) {
28+
// TODO Auto-generated method stub
29+
super.update(jsonString);
30+
//StatusInface.getInstance().postRSO(jsonString);
31+
EventBus.getDefault().post(jsonString);
32+
Log.e(TAG, jsonString.toString());
33+
}
34+
35+
}

src/com/obd/observer/RPSObserver.java renamed to src/com/obd/observer/RSObserver.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
package com.obd.observer;
22

3+
import org.json.JSONException;
34
import org.json.JSONObject;
45

56
import android.util.Log;
67

78
import com.comobd.zyobd.observer.RPMSPDObserver;
89
import com.comobd.zyobd.port.Subject;
910

10-
public class RPSObserver extends RPMSPDObserver {
11-
private static final String TAG = RPSObserver.class.getName();
11+
import de.greenrobot.event.EventBus;
1212

13-
public RPSObserver(Subject subject) {
13+
/**
14+
* 车辆行驶过程中实时数据上传
15+
* @author LUFFY
16+
*
17+
*/
18+
public class RSObserver extends RPMSPDObserver {
19+
private static final String TAG = RSObserver.class.getName();
20+
21+
public RSObserver(Subject subject) {
1422
super(subject);
1523
// TODO Auto-generated constructor stub
1624
}
@@ -19,6 +27,7 @@ public RPSObserver(Subject subject) {
1927
public void update(JSONObject jsonString) {
2028
// TODO Auto-generated method stub
2129
super.update(jsonString);
30+
2231
Log.e(TAG, jsonString.toString());
2332
}
2433

0 commit comments

Comments
 (0)