/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void c_RetornarDatosSensorCompleted(object sender, RetornarDatosSensorCompletedEventArgs e)
        {
            String     tipo = "";
            FeedXively feed = e.Result;

            try
            {
                if (listaRectangulos.Count > 0)
                {
                    Rectangle x = listaRectangulos[listaRectangulos.Count - 1];
                    listaRectangulos.RemoveAt(listaRectangulos.Count - 1);
                    switch (riesgo(feed.feed))
                    {
                    case 1: tipo = "RectanguloDispositivoBueno"; break;

                    case 2: tipo = "RectanguloDispositivoAceptable"; break;

                    case 3: tipo = "RectanguloDispositivoMalo"; break;
                    }
                    x.Style = Application.Current.Resources[tipo] as Style;
                }
            }
            finally
            {
            }
        }
Пример #2
0
        /// <summary>
        /// Este método es el resultado de una consulta al indice semantico en el cual
        /// se recuperan los ultimos registros agregados de un dispositivo (feedId),
        /// y se actualiza su color y nivel de Contaminación.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void wsCliente_RetornarDatosSensorCompleted(object sender, RetornarDatosSensorCompletedEventArgs e)
        {
            String     tipo = "";
            FeedXively feed = e.Result;

            try
            {
                txtDispositivo.Text = feed.feed.title + "\nEn: " + feed.feed.location.name;
                txtSO2.Text         = feed.feed.datastreams[0].current_value;
                txtNO2.Text         = feed.feed.datastreams[1].current_value;
                txtCO.Text          = feed.feed.datastreams[2].current_value;
                txtO3.Text          = feed.feed.datastreams[3].current_value;
                txtPM10.Text        = feed.feed.datastreams[4].current_value;
                txtPST.Text         = feed.feed.datastreams[5].current_value;

                switch (riesgo(feed))
                {
                case 1:
                    tipo = "RectanguloDispositivoBueno";
                    break;

                case 2:
                    tipo = "RectanguloDispositivoAceptable";
                    break;

                case 3: tipo = "RectanguloDispositivoMalo";
                    break;
                }

                rtgEstado.Style = Application.Current.Resources[tipo] as Style;

                r1.Style = Application.Current.Resources[riesgo("SO2", feed)] as Style;
                r2.Style = Application.Current.Resources[riesgo("NO2", feed)] as Style;
                r3.Style = Application.Current.Resources[riesgo("CO", feed)] as Style;
                r4.Style = Application.Current.Resources[riesgo("O3", feed)] as Style;
                r5.Style = Application.Current.Resources[riesgo("PM10", feed)] as Style;
                r6.Style = Application.Current.Resources[riesgo("PST", feed)] as Style;
            }
            finally
            {
            }
        }