Exemple #1
0
        void MonitoreoProceso_Main(object sender, MonitoreoEventArgs e)
        {
            bool   TramaVentaManguera = false;
            bool   Levanta            = false;
            string galones            = "";
            string dinero             = "";

            if (e.Texto == "LEVANTAMANGUERA")
            {
                TramaVentaManguera = true;
                Levanta            = true;
            }
            if (e.Texto.StartsWith("BAJAMANGUERA"))
            {
                string[] arrayMensaje = UtilidadesTramas.ObtieneArrayTrama(e.Texto);
                if (arrayMensaje.Count() == 3)
                {
                    galones = arrayMensaje[1];
                    dinero  = arrayMensaje[2];
                }
                TramaVentaManguera = true;
                Levanta            = false;
            }
            if (TramaVentaManguera == true)
            {
                if (this.InvokeRequired == true)
                {
                    LevantaBajaMangueraEvent d = new LevantaBajaMangueraEvent(LevantaoBajaManguera);
                    this.Invoke(d, e.Cara, e.IdXbee, Levanta, galones, dinero);
                }
                else
                {
                    LevantaoBajaManguera(e.Cara, e.IdXbee, Levanta, galones, dinero);
                }
                return;
            }


            LogPantalla newLog = new LogPantalla();

            newLog.Mensaje     = e.Texto;
            newLog.Fecha       = DateTime.Now;
            newLog.Dispositivo = e.Dispositivo;
            if (this.SFGridLog.InvokeRequired == true)
            {
                AsignarRegistrosRejilla d = new AsignarRegistrosRejilla(RefrescarRejilla);
                this.Invoke(d, newLog);
            }
            else
            {
                RefrescarRejilla(newLog);
            }
        }
Exemple #2
0
        void MonitoreoProceso_Main(object sender, MonitoreoEventArgs e)
        {
            bool TramaVentaManguera = false;
            bool Levanta = false;
            string galones = "";
            string dinero = "";

            if (e.Texto == "LEVANTAMANGUERA")
            {
                TramaVentaManguera = true;
                Levanta = true;
            }
            if (e.Texto.StartsWith("BAJAMANGUERA"))
            {
                string[] arrayMensaje = UtilidadesTramas.ObtieneArrayTrama(e.Texto);
                if (arrayMensaje.Count() == 3)
                {
                    galones = arrayMensaje[1];
                    dinero = arrayMensaje[2];
                }
                TramaVentaManguera = true;
                Levanta = false;
            }
            if (TramaVentaManguera == true)
            {
                if (this.InvokeRequired == true)
                {
                    LevantaBajaMangueraEvent d = new LevantaBajaMangueraEvent(LevantaoBajaManguera);
                    this.Invoke(d, e.Cara, e.IdXbee, Levanta, galones, dinero);
                }
                else
                {
                    LevantaoBajaManguera(e.Cara, e.IdXbee, Levanta,galones,dinero);
                }
                return;
            }

            LogPantalla newLog = new LogPantalla();
            newLog.Mensaje = e.Texto;
            newLog.Fecha = DateTime.Now;
            newLog.Dispositivo = e.Dispositivo;
            if (this.SFGridLog.InvokeRequired == true)
            {
                AsignarRegistrosRejilla d = new AsignarRegistrosRejilla(RefrescarRejilla);
                this.Invoke(d, newLog);
            }
            else
            {
                RefrescarRejilla(newLog);
            }
        }