|
@@ -1412,7 +1412,9 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
|
|
|
private JSONObject updateLight(int kind, int position) {
|
|
|
+ String [] astrRoomTitle = null;
|
|
|
String strLight = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ String strRoomTitle = "";
|
|
|
if (mKnxData == null) {
|
|
|
deviceApiLoadLight();
|
|
|
return null;
|
|
@@ -1430,6 +1432,17 @@ public class DataSenderService extends Service {
|
|
|
String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
devSet.closeDB();
|
|
|
|
|
|
+ WallpadStatusData wallpadStatusData = new WallpadStatusData(this.getContext());
|
|
|
+ astrRoomTitle = wallpadStatusData.GetDevRoomNameList(define.ROOM_NAME_LIGHT);
|
|
|
+ wallpadStatusData.closeDB();
|
|
|
+ for (int i = 0; i < astrRoomTitle.length; i++) {
|
|
|
+ if(i==astrRoomTitle.length-1){
|
|
|
+ strRoomTitle = strRoomTitle+astrRoomTitle[i];
|
|
|
+ }else {
|
|
|
+ strRoomTitle = strRoomTitle + astrRoomTitle[i] + "_";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
if (strValue != null) {
|
|
|
strLight = strValue[1].substring((strValue[1].indexOf("조명(") + 3), (strValue[1].indexOf(")난방(")));
|
|
@@ -1461,6 +1474,7 @@ public class DataSenderService extends Service {
|
|
|
responseObject.accumulate("liv_info_install", mKnxData.LivingRoom_EnergyMeter.Info.Install);
|
|
|
responseObject.accumulate("liv_info_lightcount", livDataCount);
|
|
|
responseObject.accumulate("data_seq", strLight);
|
|
|
+ responseObject.accumulate("title_name", strRoomTitle);
|
|
|
JSONArray livDataArray = new JSONArray();
|
|
|
for (int i = 0; i < livDataCount; i++) {
|
|
|
// build jsonObject
|
|
@@ -1521,19 +1535,31 @@ public class DataSenderService extends Service {
|
|
|
}
|
|
|
|
|
|
private JSONObject updateConcent(int kind, int position) {
|
|
|
- int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
private JSONObject updateHeating(int kind, int pos) {
|
|
|
String strHeating = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ String [] astrRoomTitle = null;
|
|
|
+ String strRoomTitle = "";
|
|
|
int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
try {
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
devSet.closeDB();
|
|
|
|
|
|
+ WallpadStatusData wallpadStatusData = new WallpadStatusData(this.getContext());
|
|
|
+ astrRoomTitle = wallpadStatusData.GetDevRoomNameList(define.ROOM_NAME_HEATING);
|
|
|
+ wallpadStatusData.closeDB();
|
|
|
+ for (int i = 0; i < astrRoomTitle.length; i++) {
|
|
|
+ if(i==astrRoomTitle.length-1){
|
|
|
+ strRoomTitle = strRoomTitle+astrRoomTitle[i];
|
|
|
+ }else {
|
|
|
+ strRoomTitle = strRoomTitle + astrRoomTitle[i] + "_";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
if (strValue != null) {
|
|
|
strHeating = strValue[1].substring((strValue[1].indexOf("난방(") + 3), (strValue[1].indexOf(")에어컨(")));
|
|
@@ -1572,6 +1598,8 @@ public class DataSenderService extends Service {
|
|
|
jsonObject.accumulate("boiler_error_code", mHeatingV2API.data.Boiler.ErrorCode);
|
|
|
}
|
|
|
jsonObject.accumulate("data_seq", strHeating);
|
|
|
+ jsonObject.accumulate("title_name", strRoomTitle);
|
|
|
+
|
|
|
|
|
|
JSONArray dataArray = new JSONArray();
|
|
|
if (kind == 0) { //전체 응답
|
|
@@ -1685,12 +1713,25 @@ public class DataSenderService extends Service {
|
|
|
|
|
|
private JSONObject updateKnxAircon(int kind, int pos) {
|
|
|
String strAircon = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
+ String [] astrRoomTitle = null;
|
|
|
+ String strRoomTitle = "";
|
|
|
int roomCount = mKnxSystemAirconAPI.data.Device.info.InsideAirconCount;
|
|
|
try {
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
devSet.closeDB();
|
|
|
|
|
|
+ WallpadStatusData wallpadStatusData = new WallpadStatusData(this.getContext());
|
|
|
+ astrRoomTitle = wallpadStatusData.GetDevRoomNameList(define.ROOM_NAME_SYSTEMAIRCON);
|
|
|
+ wallpadStatusData.closeDB();
|
|
|
+ for (int i = 0; i < astrRoomTitle.length; i++) {
|
|
|
+ if(i==astrRoomTitle.length-1){
|
|
|
+ strRoomTitle = strRoomTitle+astrRoomTitle[i];
|
|
|
+ }else {
|
|
|
+ strRoomTitle = strRoomTitle + astrRoomTitle[i] + "_";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
if (strValue != null) {
|
|
|
strAircon = strValue[1].substring((strValue[1].indexOf("에어컨(") + 4), (strValue[1].indexOf("))")));
|
|
@@ -1716,6 +1757,8 @@ public class DataSenderService extends Service {
|
|
|
jsonObject.accumulate("menu", JSON.MENU.AIRCON);
|
|
|
jsonObject.accumulate("aircon_status", mKnxSystemAirconAPI.data.Device.info.AirconStatus);
|
|
|
jsonObject.accumulate("data_seq", strAircon);
|
|
|
+ jsonObject.accumulate("title_name", strRoomTitle);
|
|
|
+
|
|
|
JSONArray dataArray = new JSONArray();
|
|
|
if (kind == 0) { //전체 응답
|
|
|
for (int i = 0; i < roomCount; i++) {
|
|
@@ -1875,12 +1918,6 @@ public class DataSenderService extends Service {
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
- private JSONObject updateCurtain(int kind, int position) {
|
|
|
- int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- return jsonObject;
|
|
|
- }
|
|
|
-
|
|
|
private JSONObject updateRequest(int menu, int kind, int position) {
|
|
|
try {
|
|
|
if (menu == JSON.MENU.LIGHT) {
|
|
@@ -1952,7 +1989,6 @@ public class DataSenderService extends Service {
|
|
|
String strResult = "";
|
|
|
try {
|
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
- int nResultPanelType = devSet.Get_DistributionPannelType_Info();
|
|
|
int nConcentEnable = devSet.Get_Concent_Info(); // 콘센트 사용 유무
|
|
|
String[] strDeviceSeqValue = devSet.GetSettingData("UI순서");
|
|
|
|
|
@@ -2726,105 +2762,6 @@ public class DataSenderService extends Service {
|
|
|
if (mHeating.eachRoom[i].setTemper != mHeatingV2API.data.Device.Room[i].SetTemp) {
|
|
|
bChangeUnitState = true;
|
|
|
}
|
|
|
-
|
|
|
- if (bChangeUnitState == true) {
|
|
|
- Log.d(TAG, "[checkChangedHeating] temper old_mode : " + mHeating.eachRoom[i].mode + " , new_mode : " + mHeatingV2API.data.Device.Room[i].Mode);
|
|
|
- Log.d(TAG, "[checkChangedHeating] temper old_set : " + mHeating.eachRoom[i].setTemper + " , new_set : " + mHeatingV2API.data.Device.Room[i].SetTemp);
|
|
|
- Log.d(TAG, "[checkChangedHeating] temper old_temer : " + old_temer + " , new_temer : " + new_temer);
|
|
|
- // 데이터 전송
|
|
|
- String mode = "";
|
|
|
-
|
|
|
- switch (mHeatingV2API.data.Device.Room[i].Mode) {
|
|
|
- case MODE.HeatingON:
|
|
|
- mode = "on";
|
|
|
- break;
|
|
|
- case MODE.HeatingOFF:
|
|
|
- mode = "off";
|
|
|
- break;
|
|
|
- case MODE.Outing:
|
|
|
- mode = "away";
|
|
|
- break;
|
|
|
- case MODE.Sleep:
|
|
|
- mode = "sleep";
|
|
|
- break;
|
|
|
- case MODE.Reservation:
|
|
|
- mode = "schedule";
|
|
|
- break;
|
|
|
- case MODE.Pause:
|
|
|
- mode = "pause";
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if (bChangeUnitState) {
|
|
|
- Log.i(TAG, "[checkChangedHeating] room[" + i + "] temper changed!!!");
|
|
|
- bChangeTotalState = true;
|
|
|
- } else {
|
|
|
- Log.w(TAG, "[checkChangedHeating] room[" + i + "] temper is not changed!!!");
|
|
|
- }
|
|
|
-
|
|
|
- JSONArray errorArray = new JSONArray();
|
|
|
-
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bRoomComm) {
|
|
|
- errorArray.put("thermostat_comm_fail");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bRoomTempSensor) {
|
|
|
- errorArray.put("thermostat_thermo_sensor_error");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bRoomSystem) {
|
|
|
- errorArray.put("thermostat_system_error");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bMainTempSensor) {
|
|
|
- errorArray.put("valve_thermo_sensor_error");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bMainSystem) {
|
|
|
- errorArray.put("valve_system_error");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bBoiler) {
|
|
|
- errorArray.put("boiler_error");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bLeak) {
|
|
|
- errorArray.put("water_leakage_detection");
|
|
|
- }
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Error.bEtc) {
|
|
|
- errorArray.put("etc_error");
|
|
|
- }
|
|
|
-
|
|
|
- JSONArray reserveArray = new JSONArray();
|
|
|
- for (int j = 0; j < 24; j++) {
|
|
|
- if (mHeatingV2API.data.Device.Room[i].Reservation.getSchedule(j)) {
|
|
|
- reserveArray.put(j);
|
|
|
- }
|
|
|
- }
|
|
|
- // build jsonObject
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- try {
|
|
|
- String roomName;
|
|
|
- if (i == 0) {
|
|
|
- roomName = "living_room";
|
|
|
- } else {
|
|
|
- roomName = "room" + i;
|
|
|
- }
|
|
|
- jsonObject.accumulate("roomNumber", roomName);
|
|
|
- jsonObject.accumulate("mode", mode);
|
|
|
- jsonObject.accumulate("valveState", mHeatingV2API.data.Device.Room[i].bValveStatus == true ? "on" : "off");
|
|
|
- jsonObject.accumulate("setTemperature", mHeatingV2API.data.Device.Room[i].SetTemp);
|
|
|
- jsonObject.accumulate("setUnit", "0.5");
|
|
|
- jsonObject.accumulate("currentTemperature", mHeatingV2API.data.Device.Room[i].NowTemp);
|
|
|
- jsonObject.accumulate("sleepDuration", getTimeData(mHeatingV2API.data.Device.Room[i].Sleep.getTime()));
|
|
|
- jsonObject.accumulate("sleepTemperature", mHeatingV2API.data.Device.Room[i].Sleep.getTempDouble());
|
|
|
- jsonObject.accumulate("reservation", reserveArray);
|
|
|
- if (errorArray.length() > 0) {
|
|
|
- jsonObject.accumulate("errorCode", errorArray);
|
|
|
- } else {
|
|
|
- jsonObject.accumulate("errorCode", JSONObject.NULL);
|
|
|
- }
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- SendData("icon", "controller", "heating", "each_control", jsonObject, 2);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//데이터 저장
|
|
@@ -3111,7 +3048,8 @@ public class DataSenderService extends Service {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- } else if (strActionName.equals(BrID.BR_HEATING)) {
|
|
|
+ }
|
|
|
+ else if (strActionName.equals(BrID.BR_HEATING)) {
|
|
|
// Log.d(TAG, "********************* BR DataSenderService BR_HEATING ********************");
|
|
|
checkChangedHeating();
|
|
|
} else if (strActionName.equals(BrID.BR_AIRCON)) {
|