|
@@ -70,6 +70,7 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
private int OPERATION_MODE = -1;
|
|
private int OPERATION_MODE = -1;
|
|
private KnxSystemAirconAPI airconAPI;
|
|
private KnxSystemAirconAPI airconAPI;
|
|
private int mCurrentRoomIndex = 0;
|
|
private int mCurrentRoomIndex = 0;
|
|
|
|
+ private int mCurrentOriginRoomIndex = 0;
|
|
private String[] mVolumeString = new String[]{"자동", "약", "중", "강"};
|
|
private String[] mVolumeString = new String[]{"자동", "약", "중", "강"};
|
|
private int[] mVolumeImgID = new int[]{R.drawable.wind_p_4, R.drawable.wind_p_1, R.drawable.wind_p_2, R.drawable.wind_p_3};
|
|
private int[] mVolumeImgID = new int[]{R.drawable.wind_p_4, R.drawable.wind_p_1, R.drawable.wind_p_2, R.drawable.wind_p_3};
|
|
//"모드가 자동->냉방->제습->송풍->난방" 인 경우 count를 5로 한다. 현재 난방은 제거하므로 4로 한다.
|
|
//"모드가 자동->냉방->제습->송풍->난방" 인 경우 count를 5로 한다. 현재 난방은 제거하므로 4로 한다.
|
|
@@ -95,12 +96,48 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
|
|
|
|
mData = new Data();
|
|
mData = new Data();
|
|
|
|
|
|
|
|
+ // 2. Device API Load & Update
|
|
|
|
+ DebugLogOutput("[Create] - Step2 : Device API Load & Update");
|
|
|
|
+ if (OPERATION_MODE == Common.MODE_NOMAL) {
|
|
|
|
+ DebugLogOutput("OPERATION_MODE = MODE_NOMAL");
|
|
|
|
+ if (Device_ApiLoad(wpapi) >= 0) {
|
|
|
|
+ Device_Update(Common.INDEX_ALL, false);
|
|
|
|
+ }
|
|
|
|
+ } else if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
+ DebugLogOutput("OPERATION_MODE = MODE_BUSINESS_SAMPLE");
|
|
|
|
+ } else {
|
|
|
|
+ Log.e(TAG, "OPERATION_MODE : " + OPERATION_MODE + " Out of range !!!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ WallpadDeviceSet devSet = new WallpadDeviceSet(this.getContext());
|
|
|
|
+ String[] strValue = devSet.GetSettingData("UI순서");
|
|
|
|
+ devSet.closeDB();
|
|
|
|
+
|
|
|
|
+ // 현대건설 더 펜트하우스 서버에서 설정된 UI 순서를 이용하도록 한다.
|
|
|
|
+ if( strValue != null ) {
|
|
|
|
+ String strAircon = strValue[1].substring( (strValue[1].indexOf("에어컨(") + 4) , (strValue[1].indexOf("))")));
|
|
|
|
+
|
|
|
|
+ int strAirconCount = Integer.valueOf(strAircon.substring(0, strAircon.indexOf(":")));
|
|
|
|
+
|
|
|
|
+ if(strAirconCount==mData.airconData.Device.info.InsideAirconCount){
|
|
|
|
+ //개수가 일치하는 경우에 적용
|
|
|
|
+ strAircon = strAircon.substring(strAircon.indexOf(":")+1);
|
|
|
|
+ String[] strDataSeq = strAircon.split("_");
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < strDataSeq.length; i++) {
|
|
|
|
+ ROOM_POS[i] = Integer.valueOf(strDataSeq[i])-1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
Intent intent = super.getScreenIntent();
|
|
Intent intent = super.getScreenIntent();
|
|
if (intent != null) {
|
|
if (intent != null) {
|
|
// 시작할 룸인덱스
|
|
// 시작할 룸인덱스
|
|
int RoomIndex = intent.getIntExtra("ROOM_INDEX", -1);
|
|
int RoomIndex = intent.getIntExtra("ROOM_INDEX", -1);
|
|
if (RoomIndex > 0) {
|
|
if (RoomIndex > 0) {
|
|
- mCurrentRoomIndex = RoomIndex;
|
|
|
|
|
|
+ //mCurrentRoomIndex = RoomIndex;
|
|
|
|
+ mCurrentOriginRoomIndex = RoomIndex;
|
|
|
|
+ mCurrentRoomIndex = ROOM_POS[RoomIndex];
|
|
}
|
|
}
|
|
|
|
|
|
// 방명칭
|
|
// 방명칭
|
|
@@ -139,18 +176,6 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- // 2. Device API Load & Update
|
|
|
|
- DebugLogOutput("[Create] - Step2 : Device API Load & Update");
|
|
|
|
- if (OPERATION_MODE == Common.MODE_NOMAL) {
|
|
|
|
- DebugLogOutput("OPERATION_MODE = MODE_NOMAL");
|
|
|
|
- if (Device_ApiLoad(wpapi) >= 0) {
|
|
|
|
- Device_Update(Common.INDEX_ALL, false);
|
|
|
|
- }
|
|
|
|
- } else if (OPERATION_MODE == Common.MODE_BUSINESS_SAMPLE) {
|
|
|
|
- DebugLogOutput("OPERATION_MODE = MODE_BUSINESS_SAMPLE");
|
|
|
|
- } else {
|
|
|
|
- Log.e(TAG, "OPERATION_MODE : " + OPERATION_MODE + " Out of range !!!");
|
|
|
|
- }
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// 3. Common (Image & Button & Text) Create
|
|
// 3. Common (Image & Button & Text) Create
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -287,17 +312,19 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ROOM_PREV) {
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ROOM_PREV) {
|
|
DebugLogOutput("onTouchEvent [ROOM_PREV] BUTTON !!!");
|
|
DebugLogOutput("onTouchEvent [ROOM_PREV] BUTTON !!!");
|
|
Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
- mCurrentRoomIndex--;
|
|
|
|
- if (mCurrentRoomIndex < 0)
|
|
|
|
- mCurrentRoomIndex = (int) (mData.airconData.Device.info.InsideAirconCount - 1);
|
|
|
|
|
|
+ mCurrentOriginRoomIndex--;
|
|
|
|
+ if (mCurrentOriginRoomIndex < 0)
|
|
|
|
+ mCurrentOriginRoomIndex = (int) (mData.airconData.Device.info.InsideAirconCount - 1);
|
|
|
|
+ mCurrentRoomIndex = ROOM_POS[mCurrentOriginRoomIndex];
|
|
Draw_TitleChange(mCurrentRoomIndex);
|
|
Draw_TitleChange(mCurrentRoomIndex);
|
|
Draw_Update((byte) mCurrentRoomIndex);
|
|
Draw_Update((byte) mCurrentRoomIndex);
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ROOM_NEXT) {
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ROOM_NEXT) {
|
|
DebugLogOutput("onTouchEvent [ROOM_PREV] BUTTON !!!");
|
|
DebugLogOutput("onTouchEvent [ROOM_PREV] BUTTON !!!");
|
|
Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
Sound().Play(SND.effect.TOUCH_LATCHED);
|
|
- mCurrentRoomIndex++;
|
|
|
|
- if (mCurrentRoomIndex >= (int) mData.airconData.Device.info.InsideAirconCount)
|
|
|
|
- mCurrentRoomIndex = 0;
|
|
|
|
|
|
+ mCurrentOriginRoomIndex++;
|
|
|
|
+ if (mCurrentOriginRoomIndex >= (int) mData.airconData.Device.info.InsideAirconCount)
|
|
|
|
+ mCurrentOriginRoomIndex = 0;
|
|
|
|
+ mCurrentRoomIndex = ROOM_POS[mCurrentOriginRoomIndex];
|
|
Draw_TitleChange(mCurrentRoomIndex);
|
|
Draw_TitleChange(mCurrentRoomIndex);
|
|
Draw_Update((byte) mCurrentRoomIndex);
|
|
Draw_Update((byte) mCurrentRoomIndex);
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ONOFF) {
|
|
} else if (nTargetId == ID.KNxSystemAirconPopup.button.ONOFF) {
|
|
@@ -357,9 +384,9 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
if ((index != Common.INDEX_ALL) && (index != (byte) mCurrentRoomIndex)) {
|
|
if ((index != Common.INDEX_ALL) && (index != (byte) mCurrentRoomIndex)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- int pos = ROOM_POS[index];
|
|
|
|
- KnxSystemAircon.AirData roomData = mData.airconData.Device.Aircon[pos];
|
|
|
|
- //KnxSystemAircon.AirData roomData = mData.airconData.Device.Aircon[mCurrentRoomIndex];
|
|
|
|
|
|
+ //int pos = ROOM_POS[index];
|
|
|
|
+ //KnxSystemAircon.AirData roomData = mData.airconData.Device.Aircon[pos];
|
|
|
|
+ KnxSystemAircon.AirData roomData = mData.airconData.Device.Aircon[mCurrentRoomIndex];
|
|
|
|
|
|
// 운전모드 갱신
|
|
// 운전모드 갱신
|
|
//madeinLab 현재온도와 설정온도에 따라 자동으로 에어컨이 OFF로 전환되어야 하는지 확인이 필요함.
|
|
//madeinLab 현재온도와 설정온도에 따라 자동으로 에어컨이 OFF로 전환되어야 하는지 확인이 필요함.
|
|
@@ -397,7 +424,7 @@ public class KnxSystemAirconPopupScreen extends WpadScreen {
|
|
if (TitleText == null) return;
|
|
if (TitleText == null) return;
|
|
|
|
|
|
if ((index < 0) || (index >= 15)) return;
|
|
if ((index < 0) || (index >= 15)) return;
|
|
- index = ROOM_POS[index];
|
|
|
|
|
|
+ //index = ROOM_POS[index];
|
|
TitleText.setText(mRoomNameList[index]);
|
|
TitleText.setText(mRoomNameList[index]);
|
|
}
|
|
}
|
|
|
|
|