|
@@ -76,7 +76,7 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
{
|
|
|
{{393, 247}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
{{266, 247}, {507, 247}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
- {{152, 247}, {393, 247}, {635, 247}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
+ {{152, 247}, {393, 247}, {684, 247}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
{{25, 247}, {266, 247}, {507, 247}, {748, 247}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
{{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {0, 0}, {0, 0}, {0, 0}},
|
|
|
{{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {0, 0}, {0, 0}},
|
|
@@ -99,6 +99,13 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
{{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}},
|
|
|
{{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}},
|
|
|
{{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {393, 247}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {266, 247}, {507, 247}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {152, 247}, {393, 247}, {684, 247}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 247}, {266, 247}, {507, 247}, {748, 247}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}},
|
|
|
+ {{25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}, {25, 110}, {266, 110}, {507, 110}, {748, 110}, {25, 383}, {266, 383}, {507, 383}, {748, 383}},
|
|
|
};
|
|
|
|
|
|
private int[][][] mPos_easymode = new int[][][]
|
|
@@ -229,22 +236,22 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
public WpadImageView OnOffBtn;
|
|
|
|
|
|
|
|
|
- public LightRoom(int index, int left, int top, int LightNum, String roomName, int type) {
|
|
|
-
|
|
|
-
|
|
|
- lightNum = LightNum;
|
|
|
-
|
|
|
+ public LightRoom(int index, int left, int top, String roomName, int type, int seq) {
|
|
|
|
|
|
RoomBackground = new WpadImageView(getContext(), TOUCH_KIND.NONE, 241, 273, R.drawable.knx_light_box_1, R.drawable.knx_light_box_1, ID.KnxLight.image.Room_BACKGROUND_1 + index);
|
|
|
ViewRegistration(getLayout(), RoomBackground, Common.ImgPosion.GetX(left), Common.ImgPosion.GetY(top));
|
|
|
|
|
|
|
|
|
- RoomTitleBg = new WpadImageView(getContext(), TOUCH_KIND.BUTTON, 221, 56, R.drawable.knx_btn_room_normal, R.drawable.knx_btn_room_pressed, ID.KnxLight.button.Room_TITLE_1 + index);
|
|
|
+ RoomTitleBg = new WpadImageView(getContext(), TOUCH_KIND.BUTTON, 221, 56, R.drawable.knx_btn_room_normal, R.drawable.knx_btn_room_pressed, ID.KnxLight.button.Room_TITLE_1 + seq);
|
|
|
ViewRegistration(getLayout(), RoomTitleBg, Common.ImgPosion.GetX(left + 10), Common.ImgPosion.GetY(top + 10));
|
|
|
|
|
|
|
|
|
- RoomTitleText = new WpadTextView(getContext(), false, 221, 56, Gravity.CENTER, Color.BLACK, Common.fontsize._26_DEFAULT, true, ID.KnxLight.text.Room_TITLE_1 + index);
|
|
|
+ RoomTitleText = new WpadTextView(getContext(), false, 221, 56, Gravity.CENTER, Color.BLACK, Common.fontsize._26_DEFAULT, true, ID.KnxLight.text.Room_TITLE_1 + seq);
|
|
|
ViewRegistration(getLayout(), RoomTitleText, Common.ImgPosion.GetX(left + 10), Common.ImgPosion.GetY(top + 10));
|
|
|
+ RoomTitleText.setTextSize(0, Common.fontsize._30);
|
|
|
+ if (roomName.length() == 6) {
|
|
|
+ RoomTitleText.setTextSize(0, Common.fontsize._26_DEFAULT);
|
|
|
+ }
|
|
|
RoomTitleText.setText(roomName);
|
|
|
|
|
|
OnOffBtn = new WpadImageView(getContext(), TOUCH_KIND.BUTTON, 120, 120, mOffImg[type], mOnImg[type], ID.KnxLight.button.Light_Btn_1 + index);
|
|
@@ -629,7 +636,7 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
} else if ((TargetId >= ID.KnxLight.button.Light_Btn_1) && (TargetId <= ID.KnxLight.button.Light_Btn_1 + AllEMcount)) {
|
|
|
|
|
|
int index = TargetId - ID.KnxLight.button.Light_Btn_1;
|
|
|
- index = ROOM_POS[index];
|
|
|
+
|
|
|
DebugLogOutput("onTouchEvent [LIGHT_" + (index + 1) + "] BUTTON !!!");
|
|
|
|
|
|
boolean OnOff = false;
|
|
@@ -719,7 +726,8 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
}
|
|
|
for (int j = startIdx; j < startIdx + ROOM_CNT; j++) {
|
|
|
if (j >= roomCount) break;
|
|
|
- lightRooms[j].setVisible(true);
|
|
|
+ if (lightRooms[j] != null)
|
|
|
+ lightRooms[j].setVisible(true);
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
@@ -809,35 +817,58 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
}
|
|
|
|
|
|
int emCount = 0;
|
|
|
- emCount = mData.MasterController.Info.Liv_EnergyMeterCount + mData.MasterController.Info.Bad_EnergyMeterCount;
|
|
|
+ int totalCount = 0;
|
|
|
+ int BadLightCount = mData.MasterController.Info.Bad_EnergyMeterCount;
|
|
|
+ int SwitchCount = mData.MasterController.Info.Light_SwitchCount;
|
|
|
+ emCount = mData.MasterController.Info.Liv_EnergyMeterCount + BadLightCount;
|
|
|
+ totalCount = emCount + SwitchCount;
|
|
|
+
|
|
|
try {
|
|
|
- if (mData.LivingRoom_EnergyMeter.Info.Install) {
|
|
|
- for (int i = 0; i < mData.LivingRoom_EnergyMeter.Info.LightCount; i++) {
|
|
|
- if (mData.LivingRoom_EnergyMeter.Data.LivingLight[i].Info.Install) {
|
|
|
-
|
|
|
- if (mData.LivingRoom_EnergyMeter.Data.LivingLight[i].Data.OnOff == true) {
|
|
|
- Draw_LightStatusChange(1, true, false);
|
|
|
+ for (int k = 0; k < totalCount; k++) {
|
|
|
+ if (mData.LivingRoom_EnergyMeter.Info.Install && ROOM_POS[k] == 0) {
|
|
|
+ for (int i = 0; i < mData.LivingRoom_EnergyMeter.Info.LightCount; i++) {
|
|
|
+ if (mData.LivingRoom_EnergyMeter.Data.LivingLight[i].Info.Install) {
|
|
|
+
|
|
|
+ if (mData.LivingRoom_EnergyMeter.Data.LivingLight[i].Data.OnOff == true) {
|
|
|
+ Draw_LightStatusChange(k + 1, true, false);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (i == mData.LivingRoom_EnergyMeter.Info.LightCount - 1) {
|
|
|
+ Draw_LightStatusChange(k + 1, false, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (ROOM_POS[k] < emCount) {
|
|
|
+ for (int i = 0; i < mData.BadRoom_EnergyMeter[ROOM_POS[k] - 1].Info.LightCount; i++) {
|
|
|
+
|
|
|
+ if (mData.BadRoom_EnergyMeter[ROOM_POS[k] - 1].Data.BadLight[i].Data.OnOff == true) {
|
|
|
+ Draw_LightStatusChange(k + 1, true, false);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (i == mData.BadRoom_EnergyMeter[ROOM_POS[k] - 1].Info.LightCount - 1) {
|
|
|
+ Draw_LightStatusChange(k + 1, false, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < mData.Light_Switch[ROOM_POS[k] - emCount].Info.LightCount; i++) {
|
|
|
+
|
|
|
+ if (mData.Light_Switch[ROOM_POS[k] - emCount].Data.LightSwitch[i].Data.OnOff == true) {
|
|
|
+ Draw_LightStatusChange(k + 1, true, true);
|
|
|
break;
|
|
|
}
|
|
|
- if (i == mData.LivingRoom_EnergyMeter.Info.LightCount - 1) {
|
|
|
- Draw_LightStatusChange(1, false, false);
|
|
|
+ if (i == mData.Light_Switch[ROOM_POS[k] - emCount].Info.LightCount - 1) {
|
|
|
+ Draw_LightStatusChange(k + 1, false, true);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
- Draw_LightStatus_BadRoom(2);
|
|
|
- Draw_LightStatus_LightSwitch(emCount + 1);
|
|
|
- } else {
|
|
|
- Draw_LightStatus_BadRoom(1);
|
|
|
- Draw_LightStatus_LightSwitch(emCount + 1);
|
|
|
}
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
- lightRooms[0] = null;
|
|
|
} catch (Exception e) {
|
|
|
Log.e(TAG, "[Exception Error] - [Create] LightView new");
|
|
|
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
- lightRooms[0] = null;
|
|
|
}
|
|
|
|
|
|
Draw_CurrentPage(AllEMcount, (CurrentPageNum - 1) * ROOM_CNT);
|
|
@@ -857,8 +888,8 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
if (lightRooms == null) return;
|
|
|
if (LightNumber > lightRooms.length) return;
|
|
|
|
|
|
- int index = ROOM_POS[LightNumber - 1];
|
|
|
-
|
|
|
+ int index = LightNumber - 1;
|
|
|
+
|
|
|
|
|
|
if (index >= startIdx + ROOM_CNT) return;
|
|
|
if (lightRooms[index] == null) return;
|
|
@@ -926,77 +957,24 @@ public class LightKnxMainTestScreen extends WpadScreen {
|
|
|
Log.d(TAG, "installCount = " + installCount);
|
|
|
|
|
|
int posIndex = totalLightCount - 1;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- int createLight = 0;
|
|
|
-
|
|
|
-
|
|
|
- try {
|
|
|
- if (mData.LivingRoom_EnergyMeter.Info.Install) {
|
|
|
- int pos = ROOM_POS[createLight];
|
|
|
- int left, top;
|
|
|
- left = (mPos[posIndex][pos][0]);
|
|
|
- top = (mPos[posIndex][pos][1]);
|
|
|
|
|
|
- String name = mDefaultRoomNameList[createLight];
|
|
|
- mRoomName.add(name);
|
|
|
- Log.d(TAG, "[Registration_Light_New] - name[" + name + "] = ");
|
|
|
-
|
|
|
- lightRooms[pos] = new LightRoom(pos, left, top, createLight, name, EM_TYPE);
|
|
|
- createLight++;
|
|
|
- }
|
|
|
- } catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- lightRooms[0] = null;
|
|
|
- } catch (Exception e) {
|
|
|
- Log.e(TAG, "[Exception Error] - [Create] LightView new");
|
|
|
-
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
- lightRooms[0] = null;
|
|
|
- }
|
|
|
- for (int i = 0; i < BadLightCount; i++) {
|
|
|
- try {
|
|
|
-
|
|
|
- int pos = ROOM_POS[createLight];
|
|
|
- int left, top;
|
|
|
- left = (mPos[posIndex][pos][0]);
|
|
|
- top = (mPos[posIndex][pos][1]);
|
|
|
-
|
|
|
- String name = mDefaultRoomNameList[i + 1];
|
|
|
- mRoomName.add(name);
|
|
|
- Log.d(TAG, "[Registration_Light_New] - name[" + (i + 1) + "] = " + name);
|
|
|
-
|
|
|
- lightRooms[pos] = new LightRoom(pos, left, top, createLight, name, EM_TYPE);
|
|
|
- createLight++;
|
|
|
-
|
|
|
- } catch (RuntimeException re) {
|
|
|
- LogUtil.errorLogInfo("", TAG, re);
|
|
|
- lightRooms[i] = null;
|
|
|
- } catch (Exception e) {
|
|
|
- Log.e(TAG, "[Exception Error] - [Create] LightView new");
|
|
|
-
|
|
|
- LogUtil.errorLogInfo("", TAG, e);
|
|
|
- lightRooms[i] = null;
|
|
|
- }
|
|
|
- }
|
|
|
- for (int i = 0; i < SwitchCount; i++) {
|
|
|
+ for (int i = 0; i < totalLightCount; i++) {
|
|
|
try {
|
|
|
-
|
|
|
- int pos = ROOM_POS[createLight];
|
|
|
- int left, top;
|
|
|
- left = (mPos[posIndex][pos][0]);
|
|
|
- top = (mPos[posIndex][pos][1]);
|
|
|
-
|
|
|
- String name = mDefaultRoomNameList[i + BadLightCount + 1];
|
|
|
- mRoomName.add(name);
|
|
|
- Log.d(TAG, "[Registration_Light_New] - name[" + (i + 1) + "] = " + name);
|
|
|
-
|
|
|
- lightRooms[pos] = new LightRoom(pos, left, top, createLight, name, SWITCH_TYPE);
|
|
|
- createLight++;
|
|
|
-
|
|
|
+ int pos = ROOM_POS[i];
|
|
|
+ if (pos < LivingLightCount + BadLightCount) {
|
|
|
+ int left, top;
|
|
|
+ left = (mPos[posIndex][i][0]);
|
|
|
+ top = (mPos[posIndex][i][1]);
|
|
|
+ String name = mDefaultRoomNameList[pos];
|
|
|
+ lightRooms[i] = new LightRoom(pos, left, top, name, EM_TYPE, i);
|
|
|
+ } else {
|
|
|
+ int left, top;
|
|
|
+ left = (mPos[posIndex][i][0]);
|
|
|
+ top = (mPos[posIndex][i][1]);
|
|
|
+
|
|
|
+ String name = mDefaultRoomNameList[pos];
|
|
|
+ lightRooms[i] = new LightRoom(pos, left, top, name, SWITCH_TYPE, i);
|
|
|
+ }
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
lightRooms[i] = null;
|