|
@@ -3,6 +3,7 @@ package kr.co.icontrols.wallpadmain.imap;
|
|
|
import android.content.Context;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import com.artncore.WallPadDataMgr.WallpadDeviceSet;
|
|
|
import com.artncore.WallPadDataMgr.WallpadStatusData;
|
|
|
import com.artncore.WallPadDataMgr.wallpaddbmgr.AddressSet;
|
|
|
//import com.artncore.wallpadapi.APIErrorCode;
|
|
@@ -115,6 +116,7 @@ public class iMAPRemotemeter extends WallPadiMAPClient{
|
|
|
String NewsVersionFromServer = null;
|
|
|
|
|
|
|
|
|
+
|
|
|
public iMAPRemotemeter(Context ctx)
|
|
|
{
|
|
|
super.setContext(ctx);
|
|
@@ -194,19 +196,42 @@ public class iMAPRemotemeter extends WallPadiMAPClient{
|
|
|
support_ems_String = "no";
|
|
|
}
|
|
|
|
|
|
- retXML = XMLHeader +
|
|
|
- " <service type = \"request\" name= \"get_ems_metering\">\r\n"+
|
|
|
- " <guidemap distinguish=\""+isDistinguishYear_String+"\""
|
|
|
- +" elect=\""+elect_String+"\""
|
|
|
- +" gas=\""+gas_String+"\""
|
|
|
- +" water=\""+water_String+"\""
|
|
|
- +" hotwater=\""+hotwater_String+"\""
|
|
|
- +" energy=\""+energy_String+"\""
|
|
|
- +" carbon=\""+carbon_String+"\""
|
|
|
- +" support_ems=\""+support_ems_String+"\">\r\n"+
|
|
|
- " <datelist year=\""+year+ "\" month=\""+month+"\" />\r\n"+
|
|
|
- " </guidemap>\r\n" +
|
|
|
- " </service>\r\n</imap>";
|
|
|
+ boolean isUseEMS = true;
|
|
|
+ WallpadDeviceSet wds = new WallpadDeviceSet(ctx);
|
|
|
+ isUseEMS = wds.GetEMSProtocolUse();
|
|
|
+ wds.closeDB();
|
|
|
+
|
|
|
+ if(isUseEMS)
|
|
|
+ {
|
|
|
+ retXML = XMLHeader +
|
|
|
+ " <service type = \"request\" name= \"get_ems_metering\">\r\n"+
|
|
|
+ " <guidemap distinguish=\""+isDistinguishYear_String+"\""
|
|
|
+ +" elect=\""+elect_String+"\""
|
|
|
+ +" gas=\""+gas_String+"\""
|
|
|
+ +" water=\""+water_String+"\""
|
|
|
+ +" hotwater=\""+hotwater_String+"\""
|
|
|
+ +" energy=\""+energy_String+"\""
|
|
|
+ +" carbon=\""+carbon_String+"\""
|
|
|
+ +" support_ems=\""+support_ems_String+"\">\r\n"+
|
|
|
+ " <datelist year=\""+year+ "\" month=\""+month+"\" />\r\n"+
|
|
|
+ " </guidemap>\r\n" +
|
|
|
+ " </service>\r\n</imap>";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ retXML = XMLHeader +
|
|
|
+ " <service type = \"request\" name= \"get_metering\">\r\n"+
|
|
|
+ " <guidemap distinguish=\""+isDistinguishYear_String+"\""
|
|
|
+ +" elect=\""+elect_String+"\""
|
|
|
+ +" gas=\""+gas_String+"\""
|
|
|
+ +" water=\""+water_String+"\""
|
|
|
+ +" hotwater=\""+hotwater_String+"\""
|
|
|
+ +" energy=\""+energy_String+"\">\r\n"+
|
|
|
+ " <datelist year=\""+year+ "\" month=\""+month+"\" />\r\n"+
|
|
|
+ " </guidemap>\r\n" +
|
|
|
+ " </service>\r\n</imap>";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
return retXML;
|
|
|
}
|
|
@@ -231,25 +256,60 @@ public class iMAPRemotemeter extends WallPadiMAPClient{
|
|
|
String name = GetAttributeVal(0, "name");
|
|
|
String type = GetAttributeVal(0, "type");
|
|
|
|
|
|
- if ((name!=null&& name.equalsIgnoreCase("get_ems_metering"))
|
|
|
- && (type!=null && type.equalsIgnoreCase("reply"))) {
|
|
|
- if (SetItem("guidemap") == 1) {
|
|
|
- if (isDistinguishYear_String!=null && isDistinguishYear_String.equalsIgnoreCase("year")) {
|
|
|
- String year = GetAttributeVal(0, "distinguish");
|
|
|
- if (year!=null&& year.equalsIgnoreCase(
|
|
|
- "year")) {
|
|
|
- if (SetItem("valuelist") > 0) {
|
|
|
- Proc.ProcSuccess();
|
|
|
- return;
|
|
|
+ boolean isUseEMS = true;
|
|
|
+ WallpadDeviceSet wds = new WallpadDeviceSet(ctx);
|
|
|
+ isUseEMS = wds.GetEMSProtocolUse();
|
|
|
+ wds.closeDB();
|
|
|
+
|
|
|
+ if(isUseEMS)
|
|
|
+ {
|
|
|
+ if ((name!=null&& name.equalsIgnoreCase("get_ems_metering"))
|
|
|
+ && (type!=null && type.equalsIgnoreCase("reply"))) {
|
|
|
+ if (SetItem("guidemap") == 1) {
|
|
|
+ if (isDistinguishYear_String!=null && isDistinguishYear_String.equalsIgnoreCase("year")) {
|
|
|
+ String year = GetAttributeVal(0, "distinguish");
|
|
|
+ if (year!=null&& year.equalsIgnoreCase(
|
|
|
+ "year")) {
|
|
|
+ if (SetItem("valuelist") > 0) {
|
|
|
+ Proc.ProcSuccess();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (isDistinguishYear_String!=null&& isDistinguishYear_String.equalsIgnoreCase("month")) {
|
|
|
+ String month = GetAttributeVal(0, "distinguish");
|
|
|
+ if (month!=null && month.equalsIgnoreCase(
|
|
|
+ "month")) {
|
|
|
+ if (SetItem("valuelist") > 0) {
|
|
|
+ Proc.ProcSuccess();
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- } else if (isDistinguishYear_String!=null&& isDistinguishYear_String.equalsIgnoreCase("month")) {
|
|
|
- String month = GetAttributeVal(0, "distinguish");
|
|
|
- if (month!=null && month.equalsIgnoreCase(
|
|
|
- "month")) {
|
|
|
- if (SetItem("valuelist") > 0) {
|
|
|
- Proc.ProcSuccess();
|
|
|
- return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if ((name!=null&& name.equalsIgnoreCase("get_metering"))
|
|
|
+ && (type!=null && type.equalsIgnoreCase("reply"))) {
|
|
|
+ if (SetItem("guidemap") == 1) {
|
|
|
+ if (isDistinguishYear_String!=null && isDistinguishYear_String.equalsIgnoreCase("year")) {
|
|
|
+ String year = GetAttributeVal(0, "distinguish");
|
|
|
+ if (year!=null&& year.equalsIgnoreCase(
|
|
|
+ "year")) {
|
|
|
+ if (SetItem("valuelist") > 0) {
|
|
|
+ Proc.ProcSuccess();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (isDistinguishYear_String!=null&& isDistinguishYear_String.equalsIgnoreCase("month")) {
|
|
|
+ String month = GetAttributeVal(0, "distinguish");
|
|
|
+ if (month!=null && month.equalsIgnoreCase(
|
|
|
+ "month")) {
|
|
|
+ if (SetItem("valuelist") > 0) {
|
|
|
+ Proc.ProcSuccess();
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|