|
@@ -1423,22 +1423,26 @@ public class DataSenderService extends Service {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
- String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
- devSet.closeDB();
|
|
|
|
|
|
+ try {
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
|
|
- // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
- if( strValue != null ) {
|
|
|
|
- strLight = strValue[1].substring( (strValue[1].indexOf("조명(") + 3) , (strValue[1].indexOf(")난방(")));
|
|
|
|
|
|
+ // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
+ if (strValue != null) {
|
|
|
|
+ strLight = strValue[1].substring((strValue[1].indexOf("조명(") + 3), (strValue[1].indexOf(")난방(")));
|
|
|
|
|
|
- int strLightCount = Integer.valueOf(strLight.substring(0, strLight.indexOf(":")));
|
|
|
|
|
|
+ int strLightCount = Integer.valueOf(strLight.substring(0, strLight.indexOf(":")));
|
|
|
|
|
|
- if(strLightCount==(1 + bedDataCount)){
|
|
|
|
- //개수가 일치하는 경우에 적용
|
|
|
|
- strLight = strLight.substring(strLight.indexOf(":")+1);
|
|
|
|
- }else{
|
|
|
|
- strLight = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
|
|
+ if (strLightCount == (1 + bedDataCount)) {
|
|
|
|
+ //개수가 일치하는 경우에 적용
|
|
|
|
+ strLight = strLight.substring(strLight.indexOf(":") + 1);
|
|
|
|
+ } else {
|
|
|
|
+ strLight = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject responseObject = new JSONObject();
|
|
JSONObject responseObject = new JSONObject();
|
|
@@ -1523,23 +1527,28 @@ public class DataSenderService extends Service {
|
|
private JSONObject updateHeating(int kind, int pos) {
|
|
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 strHeating = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
int roomCount = mHeatingV2API.data.Device.info.RoomCount;
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
- String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
- devSet.closeDB();
|
|
|
|
|
|
+ try {
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
|
|
- // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
- if( strValue != null ) {
|
|
|
|
- strHeating = strValue[1].substring( (strValue[1].indexOf("난방(") + 3) , (strValue[1].indexOf(")에어컨(")));
|
|
|
|
|
|
+ // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
+ if (strValue != null) {
|
|
|
|
+ strHeating = strValue[1].substring((strValue[1].indexOf("난방(") + 3), (strValue[1].indexOf(")에어컨(")));
|
|
|
|
|
|
- int strHeatingCount = Integer.valueOf(strHeating.substring(0, strHeating.indexOf(":")));
|
|
|
|
|
|
+ int strHeatingCount = Integer.valueOf(strHeating.substring(0, strHeating.indexOf(":")));
|
|
|
|
|
|
- if(strHeatingCount==roomCount){
|
|
|
|
- //개수가 일치하는 경우에 적용
|
|
|
|
- strHeating = strHeating.substring(strHeating.indexOf(":")+1);
|
|
|
|
- }else{
|
|
|
|
- strHeating = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
|
|
+ if (strHeatingCount == roomCount) {
|
|
|
|
+ //개수가 일치하는 경우에 적용
|
|
|
|
+ strHeating = strHeating.substring(strHeating.indexOf(":") + 1);
|
|
|
|
+ } else {
|
|
|
|
+ strHeating = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
try {
|
|
try {
|
|
jsonObject.accumulate("type", "updateResponse");
|
|
jsonObject.accumulate("type", "updateResponse");
|
|
@@ -1675,23 +1684,26 @@ public class DataSenderService extends Service {
|
|
private JSONObject updateKnxAircon(int kind, int pos) {
|
|
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 strAircon = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
int roomCount = mKnxSystemAirconAPI.data.Device.info.InsideAirconCount;
|
|
int roomCount = mKnxSystemAirconAPI.data.Device.info.InsideAirconCount;
|
|
|
|
+ try {
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
|
|
- WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
- String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
- devSet.closeDB();
|
|
|
|
-
|
|
|
|
- // 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
- if( strValue != null ) {
|
|
|
|
- strAircon = strValue[1].substring( (strValue[1].indexOf("에어컨(") + 4) , (strValue[1].indexOf("))")));
|
|
|
|
|
|
+ // 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
+ if (strValue != null) {
|
|
|
|
+ strAircon = strValue[1].substring((strValue[1].indexOf("에어컨(") + 4), (strValue[1].indexOf("))")));
|
|
|
|
|
|
- int strAirconCount = Integer.valueOf(strAircon.substring(0, strAircon.indexOf(":")));
|
|
|
|
|
|
+ int strAirconCount = Integer.valueOf(strAircon.substring(0, strAircon.indexOf(":")));
|
|
|
|
|
|
- if(strAirconCount==roomCount){
|
|
|
|
- //개수가 일치하는 경우에 적용
|
|
|
|
- strAircon = strAircon.substring(strAircon.indexOf(":")+1);
|
|
|
|
- }else{
|
|
|
|
- strAircon = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
|
|
+ if (strAirconCount == roomCount) {
|
|
|
|
+ //개수가 일치하는 경우에 적용
|
|
|
|
+ strAircon = strAircon.substring(strAircon.indexOf(":") + 1);
|
|
|
|
+ } else {
|
|
|
|
+ strAircon = "1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -1938,6 +1950,7 @@ public class DataSenderService extends Service {
|
|
try {
|
|
try {
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
|
|
int nResultPanelType = devSet.Get_DistributionPannelType_Info();
|
|
int nResultPanelType = devSet.Get_DistributionPannelType_Info();
|
|
|
|
+ int nConcentEnable = devSet.Get_Concent_Info(); // 콘센트 사용 유무
|
|
String[] strDeviceSeqValue = devSet.GetSettingData("UI순서");
|
|
String[] strDeviceSeqValue = devSet.GetSettingData("UI순서");
|
|
|
|
|
|
String strLight = strDeviceSeqValue[1].substring( (strDeviceSeqValue[1].indexOf("조명(") + 3) , (strDeviceSeqValue[1].indexOf(")난방(")));
|
|
String strLight = strDeviceSeqValue[1].substring( (strDeviceSeqValue[1].indexOf("조명(") + 3) , (strDeviceSeqValue[1].indexOf(")난방(")));
|
|
@@ -1947,7 +1960,13 @@ public class DataSenderService extends Service {
|
|
strLight = (strLight.substring(strLight.indexOf(":")+1)).replaceAll("_","/");
|
|
strLight = (strLight.substring(strLight.indexOf(":")+1)).replaceAll("_","/");
|
|
strHeating = (strHeating.substring(strHeating.indexOf(":")+1)).replaceAll("_","/");
|
|
strHeating = (strHeating.substring(strHeating.indexOf(":")+1)).replaceAll("_","/");
|
|
strAircon = (strAircon.substring(strAircon.indexOf(":")+1)).replaceAll("_","/");
|
|
strAircon = (strAircon.substring(strAircon.indexOf(":")+1)).replaceAll("_","/");
|
|
- String[] devlist = {"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop", "sysaircon"};
|
|
|
|
|
|
+
|
|
|
|
+ String[] devlist;
|
|
|
|
+ if(nConcentEnable==1){
|
|
|
|
+ devlist = new String[]{"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop", "sysaircon"};
|
|
|
|
+ } else {
|
|
|
|
+ devlist = new String[]{"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "smartlight", "cooktop", "sysaircon"};
|
|
|
|
+ }
|
|
|
|
|
|
for (int i = 0; i < devlist.length; i++) {
|
|
for (int i = 0; i < devlist.length; i++) {
|
|
if (devlist[i].equals("cooktop")) {
|
|
if (devlist[i].equals("cooktop")) {
|
|
@@ -2223,10 +2242,10 @@ public class DataSenderService extends Service {
|
|
int AllEMcount;
|
|
int AllEMcount;
|
|
|
|
|
|
public void deviceApiLoadLight() {
|
|
public void deviceApiLoadLight() {
|
|
- WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
|
|
|
|
- int nDPType = wds.Get_DistributionPannelType_Info();
|
|
|
|
- wds.closeDB();
|
|
|
|
try {
|
|
try {
|
|
|
|
+ WallpadDeviceSet wds = new WallpadDeviceSet(mContext);
|
|
|
|
+ int nDPType = wds.Get_DistributionPannelType_Info();
|
|
|
|
+ wds.closeDB();
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
if (mWallPadAPI.Check_Connect()) {
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|| Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|