Page 28 - MDP2020-1
P. 28

|    인천전자마이스터고등학교  ·············································································································
            22

                                    const  json  =  JSON.parse(jsonFile);
                                    if(json.shot_down  ===  "1"  &&  pastdown  ===  "0"){
                                            offModule();
                            display_condition  =  false;

                                    }
                                    if(json.turn_on  ===  "1"  &&  paston  ==="0"){
                                            turnOn();
                            display_condition  =  true;

                                    }
                                    pastdown=json.shot_down;
                                    paston=json.turn_on;
                            }
                    );
                    fs.readFile('/home/pi/Camera/fdCam/user.json',  'utf8',  (error,  jsonFile)  =>{

                            const  userJson  =  JSON.parse(jsonFile);
                            user  =  userJson.Current_USER;
                    });
                    fs.readFile('userData.json',  'utf8',  (error,  jsonFile)  =>{

                            const  DataJson  =  JSON.parse(jsonFile);
                    if(display_condition){
                                    Greetusr.removeChild(Greetusr.firstChild);
                                    while(Custom1.hasChildNodes()){
                                            Custom1.removeChild(Custom1.firstChild);
                                    }

                                    while(Custom2.hasChildNodes()){
                                            Custom2.removeChild(Custom2.firstChild);
                                    }
                                    greetModule(".GREETUSR",  user);
                    }

                            if(DataJson.hyeonwoo.name  ===  user  &&  display_condition){
                                    if(DataJson.hyeonwoo.melon  ===  "0"){
                                            menuModule(".CUSTOM1");
                                            subwayModule(".CUSTOM2");
                                    }

                                    else  if(DataJson.hyeonwoo.menu  ===  "0"){
                                            melonModule(".CUSTOM1");
                                            subwayModule(".CUSTOM2");
                                    }
                                    else{

                                            melonModule(".CUSTOM1");
                                            menuModule(".CUSTOM2");
   23   24   25   26   27   28   29   30   31   32   33