|  | @@ -48,6 +48,7 @@ import com.artncore.commons.DataClasses.MultiSwitch;
 | 
	
		
			
				|  |  |  import com.artncore.commons.define;
 | 
	
		
			
				|  |  |  import com.artncore.deviceinterface.WallPadInterface;
 | 
	
		
			
				|  |  |  import com.artncore.wallpadapi.AirQualitySensorAPI;
 | 
	
		
			
				|  |  | +import com.artncore.wallpadapi.CooktopAPI;
 | 
	
		
			
				|  |  |  import com.artncore.wallpadapi.DLockAPI;
 | 
	
		
			
				|  |  |  import com.artncore.wallpadapi.EnergyMeterAPI;
 | 
	
		
			
				|  |  |  import com.artncore.wallpadapi.GasAPI;
 | 
	
	
		
			
				|  | @@ -208,6 +209,8 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |  	//private boolean mNewDanjiServer = false;
 | 
	
		
			
				|  |  |      /** 단지서버 타입 1=1.0, 2 = 2.0, 0 = mix*/
 | 
	
		
			
				|  |  |  	private int danjiserverType = 1;
 | 
	
		
			
				|  |  | +/** 가스밸브를 쿡탑콘센트로 사용 */
 | 
	
		
			
				|  |  | +    private boolean bGasAsCooktopOutlet = false;   // 쿡탑콘센트에 가스밸브 프로토콜이 적용된 경우
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * JEFF, 2019.12.31
 | 
	
	
		
			
				|  | @@ -2832,6 +2835,10 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                  LogUtil.errorLogInfo("", TAG, e);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            WallpadDeviceSet mWallpadDeviceSet = new WallpadDeviceSet(getApplicationContext());
 | 
	
		
			
				|  |  | +            bGasAsCooktopOutlet = mWallpadDeviceSet.Get_CookTopConcent_Use();
 | 
	
		
			
				|  |  | +            mWallpadDeviceSet.closeDB();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			SvrSock = new iMapSverSocket();
 | 
	
		
			
				|  |  |  			SvrSock.start();
 | 
	
		
			
				|  |  |  		} catch (IOException e) {
 | 
	
	
		
			
				|  | @@ -6094,6 +6101,15 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                  if (!ServerCheckResult.equals(MOBILE_USER_AUTH_PASSED) && !ServerCheckResult.equals(WEB_USER_AUTH_PASSED)) return ServerCheckResult;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            GasAPI mGasAPI = null;
 | 
	
		
			
				|  |  | +            CooktopAPI mCooktopAPI = null;
 | 
	
		
			
				|  |  | +            if (mWallPadAPI.GetGasKind() == 1) {
 | 
	
		
			
				|  |  | +                mGasAPI = mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else if (mWallPadAPI.GetGasKind() == 2) {
 | 
	
		
			
				|  |  | +                mCooktopAPI = mWallPadAPI.Get_CookTopController();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              WallpadiCMDParser DevListCMD = new WallpadiCMDParser(ele);
 | 
	
		
			
				|  |  |              String[] devlist = {"gas", "livinglight", "doorlock", "light", "ventil", "thermostat", "electric", "smartlight", "cooktop"};
 | 
	
		
			
				|  |  |              strResult += "\"ok\">\r\n";
 | 
	
	
		
			
				|  | @@ -6102,34 +6118,43 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |              WallpadDeviceSet devSet = new WallpadDeviceSet(getApplicationContext());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              for (int i = 0; i < devlist.length; i++) {
 | 
	
		
			
				|  |  | -                if (devlist[i].equals("gas")) {
 | 
	
		
			
				|  |  | -                    try {
 | 
	
		
			
				|  |  | +                if (devlist[i].equals("cooktop")) {
 | 
	
		
			
				|  |  | +                    if (mWallPadAPI.GetGasKind() == 1) {
 | 
	
		
			
				|  |  | +                        // 가스밸브
 | 
	
		
			
				|  |  |                          int Gasinfo = devSet.Get_GAS_Info();
 | 
	
		
			
				|  |  | -                        if (Gasinfo == 0) strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | -                        else strResult +="         <devinfo name=\"gas\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  | -                    } catch (RuntimeException re) {
 | 
	
		
			
				|  |  | -                        LogUtil.errorLogInfo("", TAG, re);
 | 
	
		
			
				|  |  | -                        strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    catch (Exception e) {
 | 
	
		
			
				|  |  | -                        //e.printStackTrace();
 | 
	
		
			
				|  |  | -                        LogUtil.errorLogInfo("", TAG, e);
 | 
	
		
			
				|  |  | -                        strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                        if (Gasinfo == 1) {
 | 
	
		
			
				|  |  | +                            // 사용함
 | 
	
		
			
				|  |  | +                            if (bGasAsCooktopOutlet) {
 | 
	
		
			
				|  |  | +                                strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                                strResult +="         <devinfo name=\"cooktop\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            else {
 | 
	
		
			
				|  |  | +                                strResult +="         <devinfo name=\"gas\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  | +                                strResult +="         <devinfo name=\"cooktop\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else {
 | 
	
		
			
				|  |  | +                            // 사용안함
 | 
	
		
			
				|  |  | +                            strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                            strResult +="         <devinfo name=\"cooktop\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if (devlist[i].equals("cooktop")) {
 | 
	
		
			
				|  |  | -                    try {
 | 
	
		
			
				|  |  | -                        //int Gooktopinfo = devSet.Get_Cooktop_Info();
 | 
	
		
			
				|  |  | -                        int Gooktopinfo = devSet.Get_GAS_Info();
 | 
	
		
			
				|  |  | -                        if (Gooktopinfo == 0) strResult +="         <devinfo name=\"cooktop\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | -                        else strResult +="         <devinfo name=\"cooktop\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  | -                    } catch (RuntimeException re) {
 | 
	
		
			
				|  |  | -                        LogUtil.errorLogInfo("", TAG, re);
 | 
	
		
			
				|  |  | -                        strResult +="         <devinfo name=\"cooktop\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  | +                    else if (mWallPadAPI.GetGasKind() == 2) {
 | 
	
		
			
				|  |  | +                        // 하이브리드 쿡탑
 | 
	
		
			
				|  |  | +                        if (mCooktopAPI != null) {
 | 
	
		
			
				|  |  | +                            int nGas = 0; int nOutlet = 0;
 | 
	
		
			
				|  |  | +                            for (int j = 0; j < mCooktopAPI.data.DeviceCnt; j++) {
 | 
	
		
			
				|  |  | +                                for (int k = 0; k < mCooktopAPI.data.DeviceCnt; k++) {
 | 
	
		
			
				|  |  | +                                    if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.GASVALVE) nGas++;
 | 
	
		
			
				|  |  | +                                    else if (mCooktopAPI.data.Device[j].circuit[i].hType == DataClasses.CooktopCtrl.DEVICE_TYPE.OUTLET) nOutlet++;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            strResult +="         <devinfo name=\"gas\" value=\"" + nGas + "\"/>\r\n";
 | 
	
		
			
				|  |  | +                            strResult +="         <devinfo name=\"cooktop\" value=\"" + nOutlet + "\"/>\r\n";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    catch (Exception e) {
 | 
	
		
			
				|  |  | -                        //e.printStackTrace();
 | 
	
		
			
				|  |  | -                        LogUtil.errorLogInfo("", TAG, e);
 | 
	
		
			
				|  |  | +                    else {
 | 
	
		
			
				|  |  | +                        strResult +="         <devinfo name=\"gas\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  |                          strResult +="         <devinfo name=\"cooktop\" value=\"0\"/>\r\n";
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -6186,6 +6211,9 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                              else if ((lightinfo[0] == 1) && (lightinfo[1] == WallpadDeviceSet.LIGHT_TYPE_LIVING)) {
 | 
	
		
			
				|  |  |                                  strResult += "         <devinfo name=\"light\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | +                            else if ((lightinfo[0] == 1) && (lightinfo[1] == WallpadDeviceSet.LIGHT_TYPE_HDC_INTLIGHT_NORMAL)) {
 | 
	
		
			
				|  |  | +                                strResult += "         <devinfo name=\"light\" value=\"1\"/>\r\n";
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  |                              else {
 | 
	
		
			
				|  |  |                                  MultiSwitchAPI multisw = mWallPadAPI.Get_MultiSwitchController();
 | 
	
		
			
				|  |  |                                  int ret = multisw.Refresh((byte)0xFF, false);
 | 
	
	
		
			
				|  | @@ -6221,7 +6249,7 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                                  Log.w(TAG, "[iCMDProcDevList] Not supported!!");
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        else if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL) {
 | 
	
		
			
				|  |  | +                        else if (Version.getModelType() == Version.MODEL_TYPE.IHN_1020GL || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443 ) {
 | 
	
		
			
				|  |  |                              strResult  += "         <devinfo name=\"livinglight\" value=\"" + lightinfo[2] + "\"/>\r\n";
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          else {
 | 
	
	
		
			
				|  | @@ -8472,6 +8500,40 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | +                else if(lightcmd.unitnum.toLowerCase().equals("all") == true)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    int result = -999;
 | 
	
		
			
				|  |  | +                    if(lightCTR!=null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        if (lightcmd.ctraction.equalsIgnoreCase("on") == true) {
 | 
	
		
			
				|  |  | +                            result = lightCTR.LightControl((byte)0xFF, true);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else if (lightcmd.ctraction.equalsIgnoreCase("off") == true) {
 | 
	
		
			
				|  |  | +                            result = lightCTR.LightControl((byte)0xFF, false);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        if (result >= 0) {
 | 
	
		
			
				|  |  | +                            // 제어 성공
 | 
	
		
			
				|  |  | +                            try { Thread.sleep(1000);}
 | 
	
		
			
				|  |  | +                            catch (RuntimeException re) {
 | 
	
		
			
				|  |  | +                                LogUtil.errorLogInfo("", TAG, re);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            catch (Exception e) {
 | 
	
		
			
				|  |  | +                                LogUtil.errorLogInfo("", TAG, e);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            lightCTR.Refresh(false);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            retStr += "result=\"ok\"> \r\n      <action>\"control\"</action>\r\n      <status_map dev_num=\""+lightcmd.devnum+"\" unit_cnt=\""+lightCTR.data.LightCount+"\"/>\r\n";
 | 
	
		
			
				|  |  | +                            for(int i=0 ; i< lightCTR.data.LightCount; i++) {
 | 
	
		
			
				|  |  | +                                retStr+= "         <status_info unit_num=\"" + String.format("switch%d\" unit_status=\"%s\" />\r\n", i+1, lightCTR.data.LightStatus[i]==true?"on":"off");
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            retStr+="   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else {
 | 
	
		
			
				|  |  | +                            retStr += "result=\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  else {
 | 
	
		
			
				|  |  |                      int num = Integer.parseInt(lightcmd.unitnum.replaceAll("switch", ""));
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -8498,6 +8560,7 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else {
 | 
	
		
			
				|  |  |                  retStr += "result = \"fail\">\r\n   </service>\r\n</imap>";
 | 
	
	
		
			
				|  | @@ -8562,83 +8625,188 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |              Node itemaction = itemsaction.item(0);
 | 
	
		
			
				|  |  |              Node text = itemaction.getFirstChild();
 | 
	
		
			
				|  |  |              String actionTXT = text.getNodeValue();
 | 
	
		
			
				|  |  | -            GasAPI GasValveCTR = mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            //수정
 | 
	
		
			
				|  |  |              strResult =  XMLHeader + "   <service type=\"reply\" name=\"remote_access_gas\" result=";
 | 
	
		
			
				|  |  |              actionTXT = trimquotation(actionTXT);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            GasAPI GasValveCTR = null;
 | 
	
		
			
				|  |  | +            CooktopAPI HybridCookTopCTR = null;
 | 
	
		
			
				|  |  | +            if(mWallPadAPI.GetGasKind() == 2)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                //하이브리드
 | 
	
		
			
				|  |  | +                HybridCookTopCTR = mWallPadAPI.Get_CookTopController();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                GasValveCTR = mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              if (actionTXT.equalsIgnoreCase("status")) {
 | 
	
		
			
				|  |  |                  // 가스밸브 상태 조회
 | 
	
		
			
				|  |  | -                if(GasValveCTR!=null)
 | 
	
		
			
				|  |  | +                if(mWallPadAPI.GetGasKind() == 2)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    int ret = GasValveCTR.Refresh((byte)0, false);
 | 
	
		
			
				|  |  | -                    if (ret < 0) {
 | 
	
		
			
				|  |  | -                        strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | -                        return strResult;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                    //하이브리드
 | 
	
		
			
				|  |  | +                    if(HybridCookTopCTR!=null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        //전체 정보가져오기
 | 
	
		
			
				|  |  | +                        int ret = HybridCookTopCTR.Refresh((byte)0xFF, false);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        int OnOpenCount = 0;
 | 
	
		
			
				|  |  | +                        int OperationCount = 0;
 | 
	
		
			
				|  |  | +                        for(int RoomIndex=0 ; RoomIndex<HybridCookTopCTR.data.Device[0].circuit.length ; RoomIndex++)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            //  콘센트 ON/OFF 업데이트
 | 
	
		
			
				|  |  | +                            if( HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus != DataClasses.CooktopCtrl.DEVICE_STATUS.NOINFO) {
 | 
	
		
			
				|  |  | +                                if(HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus == DataClasses.CooktopCtrl.DEVICE_STATUS.OPEN)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    OnOpenCount++;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +                                else if(HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus == DataClasses.CooktopCtrl.DEVICE_STATUS.WORKING)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    OperationCount++;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (GasValveCTR.data.DeviceCnt == 2) {
 | 
	
		
			
				|  |  | -                        GasValveCTR.Refresh((byte)1, false);
 | 
	
		
			
				|  |  | +                        if(OperationCount > 0)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "ing";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else if(OnOpenCount > 0)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "open";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "close";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    if(GasValveCTR!=null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        int ret = GasValveCTR.Refresh((byte)0, false);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    byte GasStatus = GasAPI.GASSTATUS.Close;
 | 
	
		
			
				|  |  | -                    for (int i = 0; i < GasValveCTR.data.DeviceCnt; i++) {
 | 
	
		
			
				|  |  | -                        if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Operation) {
 | 
	
		
			
				|  |  | -                            GasStatus = GasAPI.GASSTATUS.Operation;
 | 
	
		
			
				|  |  | -                            break;
 | 
	
		
			
				|  |  | +                        if (GasValveCTR.data.DeviceCnt == 2) {
 | 
	
		
			
				|  |  | +                            GasValveCTR.Refresh((byte)1, false);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Open) {
 | 
	
		
			
				|  |  | -                            GasStatus = GasAPI.GASSTATUS.Open;
 | 
	
		
			
				|  |  | -                            break;
 | 
	
		
			
				|  |  | +                        byte GasStatus = GasAPI.GASSTATUS.Close;
 | 
	
		
			
				|  |  | +                        for (int i = 0; i < GasValveCTR.data.DeviceCnt; i++) {
 | 
	
		
			
				|  |  | +                            if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Operation) {
 | 
	
		
			
				|  |  | +                                GasStatus = GasAPI.GASSTATUS.Operation;
 | 
	
		
			
				|  |  | +                                break;
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Open) {
 | 
	
		
			
				|  |  | +                                GasStatus = GasAPI.GASSTATUS.Open;
 | 
	
		
			
				|  |  | +                                break;
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (GasStatus == GasAPI.GASSTATUS.Close) valvestatus = "close";
 | 
	
		
			
				|  |  | -                    else if (GasStatus == GasAPI.GASSTATUS.Open) valvestatus = "open";
 | 
	
		
			
				|  |  | -                    else if (GasStatus == GasAPI.GASSTATUS.Operation) valvestatus = "ing";
 | 
	
		
			
				|  |  | -                    else valvestatus = "unknown";
 | 
	
		
			
				|  |  | +                        if (GasStatus == GasAPI.GASSTATUS.Close) valvestatus = "close";
 | 
	
		
			
				|  |  | +                        else if (GasStatus == GasAPI.GASSTATUS.Open) valvestatus = "open";
 | 
	
		
			
				|  |  | +                        else if (GasStatus == GasAPI.GASSTATUS.Operation) valvestatus = "ing";
 | 
	
		
			
				|  |  | +                        else valvestatus = "unknown";
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else if (actionTXT.equalsIgnoreCase("control")) {
 | 
	
		
			
				|  |  |                  // 가스밸브 콘트롤
 | 
	
		
			
				|  |  | -                if(GasValveCTR!=null)
 | 
	
		
			
				|  |  | +                if(mWallPadAPI.GetGasKind() == 2)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    int ret = GasValveCTR.SetClose((byte)0xFF);
 | 
	
		
			
				|  |  | -                    if (ret < 0) {
 | 
	
		
			
				|  |  | -                        strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | -                        return strResult;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                    //하이브리드
 | 
	
		
			
				|  |  | +                    if(HybridCookTopCTR!=null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        int ret = HybridCookTopCTR.setEntireCircuitClose((byte) 0);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    ret = GasValveCTR.Refresh((byte)0, false);
 | 
	
		
			
				|  |  | -                    if (ret < 0) {
 | 
	
		
			
				|  |  | -                        strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | -                        return strResult;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | +                        ret = HybridCookTopCTR.Refresh((byte)0xFF, false);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        int OnOpenCount = 0;
 | 
	
		
			
				|  |  | +                        int OperationCount = 0;
 | 
	
		
			
				|  |  | +                        for(int RoomIndex=0 ; RoomIndex<HybridCookTopCTR.data.Device[0].circuit.length ; RoomIndex++)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            //  콘센트 ON/OFF 업데이트
 | 
	
		
			
				|  |  | +                            if( HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus != DataClasses.CooktopCtrl.DEVICE_STATUS.NOINFO) {
 | 
	
		
			
				|  |  | +                                if(HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus == DataClasses.CooktopCtrl.DEVICE_STATUS.OPEN)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    OnOpenCount++;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +                                else if(HybridCookTopCTR.data.Device[0].circuit[RoomIndex].hStatus == DataClasses.CooktopCtrl.DEVICE_STATUS.WORKING)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    OperationCount++;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (GasValveCTR.data.DeviceCnt == 2) {
 | 
	
		
			
				|  |  | -                        GasValveCTR.Refresh((byte)1, false);
 | 
	
		
			
				|  |  | +                        if(OperationCount > 0)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "ing";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else if(OnOpenCount > 0)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "open";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                        else
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            valvestatus = "close";
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    if(GasValveCTR!=null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        int ret = GasValveCTR.SetClose((byte)0xFF);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    byte GasStatus = GasAPI.GASSTATUS.Close;
 | 
	
		
			
				|  |  | -                    for (int i = 0; i < GasValveCTR.data.DeviceCnt; i++) {
 | 
	
		
			
				|  |  | -                        if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Operation) {
 | 
	
		
			
				|  |  | -                            GasStatus = GasAPI.GASSTATUS.Operation;
 | 
	
		
			
				|  |  | -                            break;
 | 
	
		
			
				|  |  | +                        ret = GasValveCTR.Refresh((byte)0, false);
 | 
	
		
			
				|  |  | +                        if (ret < 0) {
 | 
	
		
			
				|  |  | +                            strResult += "\"fail\">\r\n   </service>\r\n</imap>";
 | 
	
		
			
				|  |  | +                            return strResult;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Open) {
 | 
	
		
			
				|  |  | -                            GasStatus = GasAPI.GASSTATUS.Open;
 | 
	
		
			
				|  |  | -                            break;
 | 
	
		
			
				|  |  | +                        if (GasValveCTR.data.DeviceCnt == 2) {
 | 
	
		
			
				|  |  | +                            GasValveCTR.Refresh((byte)1, false);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        byte GasStatus = GasAPI.GASSTATUS.Close;
 | 
	
		
			
				|  |  | +                        for (int i = 0; i < GasValveCTR.data.DeviceCnt; i++) {
 | 
	
		
			
				|  |  | +                            if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Operation) {
 | 
	
		
			
				|  |  | +                                GasStatus = GasAPI.GASSTATUS.Operation;
 | 
	
		
			
				|  |  | +                                break;
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            if (GasValveCTR.data.Device[i].GasStatus == GasAPI.GASSTATUS.Open) {
 | 
	
		
			
				|  |  | +                                GasStatus = GasAPI.GASSTATUS.Open;
 | 
	
		
			
				|  |  | +                                break;
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    if (GasStatus == GasAPI.GASSTATUS.Close) valvestatus = "close";
 | 
	
		
			
				|  |  | -                    else if (GasStatus == GasAPI.GASSTATUS.Open) valvestatus = "open";
 | 
	
		
			
				|  |  | -                    else if (GasStatus == GasAPI.GASSTATUS.Operation) valvestatus = "ing";
 | 
	
		
			
				|  |  | -                    else valvestatus = "unknown";
 | 
	
		
			
				|  |  | +                        if (GasStatus == GasAPI.GASSTATUS.Close) valvestatus = "close";
 | 
	
		
			
				|  |  | +                        else if (GasStatus == GasAPI.GASSTATUS.Open) valvestatus = "open";
 | 
	
		
			
				|  |  | +                        else if (GasStatus == GasAPI.GASSTATUS.Operation) valvestatus = "ing";
 | 
	
		
			
				|  |  | +                        else valvestatus = "unknown";
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -12656,22 +12824,41 @@ public class iMapServer extends Service {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                                      if (devSet.Get_GAS_Info() == 1)
 | 
	
		
			
				|  |  |                                      {
 | 
	
		
			
				|  |  | -                                        GasAPI GasCTR = mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | +                                        //여기서 신우전자확인이 더 필요함
 | 
	
		
			
				|  |  | +                                        GasAPI GasCTR = null;//mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | +                                        CooktopAPI HybridCookTopCTR = null;
 | 
	
		
			
				|  |  |                                          subunitcnt = "1";
 | 
	
		
			
				|  |  |                                          devid 	= "0x31";
 | 
	
		
			
				|  |  |                                          Vender  = "null";
 | 
	
		
			
				|  |  |                                          Model   = "null";
 | 
	
		
			
				|  |  | -                                        if(GasCTR!=null)
 | 
	
		
			
				|  |  | +                                        if(mWallPadAPI.GetGasKind() == 2)
 | 
	
		
			
				|  |  |                                          {
 | 
	
		
			
				|  |  | -                                            GasCTR.TRInfo.GetTransactionList(0);
 | 
	
		
			
				|  |  | -                                            statusRate = String.format("%d/%d",GasCTR.TRInfo.RecentSuccess, (GasCTR.TRInfo.RecentSuccess+GasCTR.TRInfo.RecentFail));
 | 
	
		
			
				|  |  | -                                            double surate = GasCTR.TRInfo.GetSuccessRate(false);
 | 
	
		
			
				|  |  | -                                            statusType = surate>70?"good":surate>30?"notgood":"bad";
 | 
	
		
			
				|  |  | -                                            message    = "null";
 | 
	
		
			
				|  |  | -                                            ControlDEVList+="		<unit type=\"gas\" id=\""+devid+"\" vendor=\""+Vender+"\" model=\""+Model+"\" subunit_cnt=\""+subunitcnt+"\" status_com=\""+statusRate+"\" status_type=\""+statusType+"\" message=\""+message+"\"/>\r\n";
 | 
	
		
			
				|  |  | -                                            itemCNT++;
 | 
	
		
			
				|  |  | +                                            HybridCookTopCTR = mWallPadAPI.Get_CookTopController();
 | 
	
		
			
				|  |  | +                                            if(HybridCookTopCTR!=null)
 | 
	
		
			
				|  |  | +                                            {
 | 
	
		
			
				|  |  | +                                                HybridCookTopCTR.TRInfo.GetTransactionList(0);
 | 
	
		
			
				|  |  | +                                                statusRate = String.format("%d/%d",HybridCookTopCTR.TRInfo.RecentSuccess, (HybridCookTopCTR.TRInfo.RecentSuccess+HybridCookTopCTR.TRInfo.RecentFail));
 | 
	
		
			
				|  |  | +                                                double surate = HybridCookTopCTR.TRInfo.GetSuccessRate(false);
 | 
	
		
			
				|  |  | +                                                statusType = surate>70?"good":surate>30?"notgood":"bad";
 | 
	
		
			
				|  |  | +                                                message    = "null";
 | 
	
		
			
				|  |  | +                                                ControlDEVList+="		<unit type=\"gas\" id=\""+devid+"\" vendor=\""+Vender+"\" model=\""+Model+"\" subunit_cnt=\""+subunitcnt+"\" status_com=\""+statusRate+"\" status_type=\""+statusType+"\" message=\""+message+"\"/>\r\n";
 | 
	
		
			
				|  |  | +                                                itemCNT++;
 | 
	
		
			
				|  |  | +                                            }
 | 
	
		
			
				|  |  | +                                        }
 | 
	
		
			
				|  |  | +                                        else
 | 
	
		
			
				|  |  | +                                        {
 | 
	
		
			
				|  |  | +                                            GasCTR = mWallPadAPI.Get_GasController();
 | 
	
		
			
				|  |  | +                                            if(GasCTR!=null)
 | 
	
		
			
				|  |  | +                                            {
 | 
	
		
			
				|  |  | +                                                GasCTR.TRInfo.GetTransactionList(0);
 | 
	
		
			
				|  |  | +                                                statusRate = String.format("%d/%d",GasCTR.TRInfo.RecentSuccess, (GasCTR.TRInfo.RecentSuccess+GasCTR.TRInfo.RecentFail));
 | 
	
		
			
				|  |  | +                                                double surate = GasCTR.TRInfo.GetSuccessRate(false);
 | 
	
		
			
				|  |  | +                                                statusType = surate>70?"good":surate>30?"notgood":"bad";
 | 
	
		
			
				|  |  | +                                                message    = "null";
 | 
	
		
			
				|  |  | +                                                ControlDEVList+="		<unit type=\"gas\" id=\""+devid+"\" vendor=\""+Vender+"\" model=\""+Model+"\" subunit_cnt=\""+subunitcnt+"\" status_com=\""+statusRate+"\" status_type=\""+statusType+"\" message=\""+message+"\"/>\r\n";
 | 
	
		
			
				|  |  | +                                                itemCNT++;
 | 
	
		
			
				|  |  | +                                            }
 | 
	
		
			
				|  |  |                                          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      else
 | 
	
		
			
				|  |  |                                      {
 |