|
@@ -225,11 +225,6 @@ public class MainActivity extends WpadActivity {
|
|
private PurityMainScreen purityMainScreen = null;
|
|
private PurityMainScreen purityMainScreen = null;
|
|
private ParkingDoorMainScreen parkingDoorMainScreen = null;
|
|
private ParkingDoorMainScreen parkingDoorMainScreen = null;
|
|
|
|
|
|
-
|
|
|
|
- public WallpadStatusData GetDBObj() {
|
|
|
|
- return wdb;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
|
|
public static final int HEATING = 1;
|
|
public static final int HEATING = 1;
|
|
public static final int LIGHT = 2;
|
|
public static final int LIGHT = 2;
|
|
@@ -393,6 +388,7 @@ public class MainActivity extends WpadActivity {
|
|
try {
|
|
try {
|
|
wdb = new WallpadStatusData(this);
|
|
wdb = new WallpadStatusData(this);
|
|
wallpaddbmgr.AddressSet addc = wdb.getAddressMGR();
|
|
wallpaddbmgr.AddressSet addc = wdb.getAddressMGR();
|
|
|
|
+ if (wdb != null) wdb.closeDB();
|
|
|
|
|
|
myIP = addc.IPAddress;
|
|
myIP = addc.IPAddress;
|
|
myDong = addc.Dong;
|
|
myDong = addc.Dong;
|
|
@@ -983,8 +979,6 @@ public class MainActivity extends WpadActivity {
|
|
try {
|
|
try {
|
|
setChangeScreen(mCurrentScreenId, true);
|
|
setChangeScreen(mCurrentScreenId, true);
|
|
|
|
|
|
- if (wdb != null) wdb.closeDB();
|
|
|
|
-
|
|
|
|
if (mWallPadApiCheckHandler != null) {
|
|
if (mWallPadApiCheckHandler != null) {
|
|
mWallPadApiCheckHandler.removeMessages(0);
|
|
mWallPadApiCheckHandler.removeMessages(0);
|
|
}
|
|
}
|
|
@@ -3579,6 +3573,7 @@ public class MainActivity extends WpadActivity {
|
|
private double doubleState;
|
|
private double doubleState;
|
|
private byte[] arrayState;
|
|
private byte[] arrayState;
|
|
private int state = -9999;
|
|
private int state = -9999;
|
|
|
|
+ int dong=0;
|
|
|
|
|
|
public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, int state) {
|
|
public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, int state) {
|
|
this.handler = handler;
|
|
this.handler = handler;
|
|
@@ -3591,6 +3586,18 @@ public class MainActivity extends WpadActivity {
|
|
this.state = state;
|
|
this.state = state;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public ClientThread(Handler handler, int menu, int dong, int kind, int reason, int position, String category, int roomNumber, int state) {
|
|
|
|
+ this.handler = handler;
|
|
|
|
+ this.menu = menu;
|
|
|
|
+ this.dong = dong;
|
|
|
|
+ this.kind = kind;
|
|
|
|
+ this.reason = reason;
|
|
|
|
+ this.position = position;
|
|
|
|
+ this.category = category;
|
|
|
|
+ this.roomNumber = roomNumber;
|
|
|
|
+ this.state = state;
|
|
|
|
+ }
|
|
|
|
+
|
|
public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, double state) {
|
|
public ClientThread(Handler handler, int menu, int kind, int reason, int position, String category, int roomNumber, double state) {
|
|
this.handler = handler;
|
|
this.handler = handler;
|
|
this.menu = menu;
|
|
this.menu = menu;
|
|
@@ -3623,9 +3630,12 @@ public class MainActivity extends WpadActivity {
|
|
}
|
|
}
|
|
|
|
|
|
public void run() {
|
|
public void run() {
|
|
-
|
|
+ String host = "10.1.1.1";
|
|
-
|
|
+ if(dong==0) {
|
|
- String host = "10.1."+mMultiAddress+".1";
|
|
+ host = "10.1." + mMultiAddress + ".1";
|
|
|
|
+ }else{
|
|
|
|
+ host = "10.1." + dong + ".1";
|
|
|
|
+ }
|
|
int port = 9998;
|
|
int port = 9998;
|
|
String json = "";
|
|
String json = "";
|
|
|
|
|
|
@@ -3731,6 +3741,11 @@ public class MainActivity extends WpadActivity {
|
|
thread.start();
|
|
thread.start();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void requestMultiControl(Handler handler, int menu, int dong, int kind, int reason, int position, String category, int number, int state) {
|
|
|
|
+ ClientThread thread = new ClientThread(handler, menu, dong, kind, reason, position, category, number, state);
|
|
|
|
+ thread.start();
|
|
|
|
+ }
|
|
|
|
+
|
|
public void requestMultiControl(Handler handler, int menu, int kind, int reason, int position, String category, int number, double state) {
|
|
public void requestMultiControl(Handler handler, int menu, int kind, int reason, int position, String category, int number, double state) {
|
|
ClientThread thread = new ClientThread(handler, menu, kind, reason, position, category, number, state);
|
|
ClientThread thread = new ClientThread(handler, menu, kind, reason, position, category, number, state);
|
|
thread.start();
|
|
thread.start();
|