Page 262 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 262

return  false;


                 }
                    //led와  gas의  값이  바뀌면  상태  변환.




                    public  boolean  isChange(String  kind,  int  status)
                 {


                       SQLiteDatabase db  =getReadableDatabase();
                            Cursor  cursor=  db.rawQuery("select  status  from  home  ",null);
                       cursor.moveToNext();
                            boolean  led0=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                            boolean  led1=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                            boolean  led2=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                            boolean  led3=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                            boolean  led4=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                       int  fan  =  cursor.getInt(0);
                       cursor.moveToNext();
                            boolean  Gas=  cursor.getInt(0)==1;
                       cursor.moveToNext();
                       int  Ctn= cursor.getInt(0);
                       cursor.moveToNext();


                       switch (kind)
                       {
                            case  "Ctn"  :  return (Ctn  !=  status);
                            case  "Fan"  :  return (fan  != status);
                       }
                       return  false;
                    //같은  맥락의  커튼(Right,  Left,  TurnR,  TurnL로  기억함)과  환풍기(On/Off)
                 }
                    public  boolean  isNull()  {
                       SQLiteDatabase db  =  getReadableDatabase();
                       Cursor  cursor  =  db.rawQuery("SELECT  *  FROM  home  where  no  =  1;",  null);






                                                         -  255  -
   257   258   259   260   261   262   263   264   265   266   267