private string PressButtonRele(string command, int part)
        {
            Controller controller = new Controller();
            Rele       rele       = new Rele();

            ICommand typeCommand = null;

            if (command == "ON")
            {
                //typeCommand how releOn
                typeCommand = new ReleOnCommand(rele);
                controller.setCommand(typeCommand);
            }
            else
            {
                //typeCommand how releOff
                typeCommand = new ReleOffCommand(rele);
                controller.setCommand(typeCommand);
            }
            return(controller.SendCommand(part));
        }
Exemple #2
0
        internal string ButtonRelePress(string comando)
        {
            Controller controller = new Controller();
            Rele       rele       = new Rele();

            ICommand typeCommand = null;

            if (comando == "ON")
            {
                //typeCommand how releOn
                typeCommand = new ReleOnCommand(rele);
                controller.setCommand(typeCommand);
            }
            else
            {
                //typeCommand how releOff
                typeCommand = new ReleOffCommand(rele);
                controller.setCommand(typeCommand);
            }
            string retorno = controller.SendCommand(0);

            return(retorno);
        }