Exemple #1
0
        // ------------------------- обработчики событий -------------------------

        /// <summary>
        /// Технология завершила обработку данных
        /// </summary>
        /// <param name="sender">Источник события</param>
        /// <param name="e">Аргументы события</param>
        private void Technology_onComplete(object sender, EventArgs e)
        {
            try
            {
                if (NShow)
                {
                    if (Interlocked.Read(ref initialized) == 1)
                    {
                        if (items != null)
                        {
                            foreach (VPanelParameter item in items)
                            {
                                if (item != null && item.Tag != null)
                                {
                                    Parameter parameter = _app.GetParameter(item.Identifier);
                                    if (parameter != null)
                                    {
                                        PanelItem panel_item = item.Tag as PanelItem;
                                        if (panel_item != null)
                                        {
                                            panel_item.Value = parameter.FormattedCaclulatedValue;
                                        }
                                    }
                                }
                            }
                        }
                        panel.Redraw();
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.WriteToLog(this, new ErrorArgs(ex.Message, ErrorType.NotFatal));
            }
        }
Exemple #2
0
        /// <summary>
        /// Обновить панель
        /// </summary>
        public override void UpdateWithRedraw()
        {
            try
            {
                base.Update();
                n_panel.ClearItems();

                GPanel_1.UpdatePanelWithRedraw();
                GPanel_2.UpdatePanelWithRedraw();
                GPanel_3.UpdatePanelWithRedraw();

                InitializeNumericPanelItems();
                n_panel.Redraw();
            }
            catch (Exception ex)
            {
                ErrorHandler.WriteToLog(this, new ErrorArgs(string.Format("message: {0} stack: {1}", ex.Message, ex.StackTrace)));
            }
        }
Exemple #3
0
        // ------------------------- обработчики событий -------------------------

        /// <summary>
        /// Технология завершила обработку данных
        /// </summary>
        /// <param name="sender">Источник события</param>
        /// <param name="e">Аргументы события</param>
        private void Technology_onComplete(object sender, EventArgs e)
        {
            if (NShow)
            {
                if (Interlocked.Read(ref initialized) == 1)
                {
                    /*Parameter p_svp = _app.GetParameter(svp.PNumber);
                     * Parameter p_m_svp = _app.GetParameter(m_svp.PNumber);
                     *
                     * Parameter p_kmb = _app.GetParameter(kmb.PNumber);
                     * Parameter p_rotor = _app.GetParameter(rotor.PNumber);
                     *
                     * Parameter p_mom1 = _app.GetParameter(mom1.PNumber);
                     * Parameter p_mom2 = _app.GetParameter(mom2.PNumber);*/

                    Parameter p_svp   = _app.GetParameter(svp.Identifier);
                    Parameter p_m_svp = _app.GetParameter(m_svp.Identifier);

                    Parameter p_kmb   = _app.GetParameter(kmb.Identifier);
                    Parameter p_rotor = _app.GetParameter(rotor.Identifier);

                    Parameter p_mom1 = _app.GetParameter(mom1.Identifier);
                    Parameter p_mom2 = _app.GetParameter(mom2.Identifier);

                    items[0].Value = string.Format("{0:F3}", _app.Technology.P0211.Value);
                    items[1].Value = string.Format("{0:F3}", _app.Technology.P0208.Value);
                    items[2].Value = string.Format("{0:F3}", _app.Technology.P0209.Value);
                    items[3].Value = string.Format("{0:F3}", _app.Technology.P0207.Value);
                    items[4].Value = string.Format("{0:F3}", _app.Technology.P0203.Value);
                    items[5].Value = string.Format("{0:F3}", _app.Technology.P0005.Value);
                    items[6].Value = string.Format("{0:F3}", _app.Technology.P0102.Value);
                    items[7].Value = string.Format("{0:F3}", _app.Technology.P0004.Value);
                    items[8].Value = string.Format("{0:F3}", _app.Technology.P0201.Value);
                    items[9].Value = string.Format("{0:F3}", _app.Technology.P0110.Value);

                    if (p_mom1 != null)
                    {
                        /*items[10].Color = Color.Black;
                         * if (p_mom1.IsControlAlarm)
                         * {
                         *  if (p_mom1.CalculatedValue >= p_mom1.Alarm)
                         *  {
                         *      items[10].Color = Color.Red;
                         *  }
                         * }*/
                        items[10].Value = p_mom1.FormattedCaclulatedValue;
                    }

                    if (p_mom2 != null)
                    {
                        /*items[11].Color = Color.Black;
                         * if (p_mom2.IsControlAlarm)
                         * {
                         *  if (p_mom2.CalculatedValue >= p_mom2.Alarm)
                         *  {
                         *      items[11].Color = Color.Red;
                         *  }
                         * }*/
                        items[11].Value = p_mom2.FormattedCaclulatedValue;
                    }

                    if (p_rotor != null)
                    {
                        /*items[12].Color = Color.Black;
                         * if (p_rotor.IsControlAlarm)
                         * {
                         *  if (p_rotor.CalculatedValue >= p_rotor.Alarm)
                         *  {
                         *      items[12].Color = Color.Red;
                         *  }
                         * }*/
                        items[12].Value = p_rotor.FormattedCaclulatedValue;
                    }

                    if (p_svp != null)
                    {
                        /*items[13].Color = Color.Black;
                         * if (p_svp.IsControlAlarm)
                         * {
                         *  if (p_svp.CalculatedValue >= p_svp.Alarm)
                         *  {
                         *      items[13].Color = Color.Yellow;
                         *  }
                         *
                         * }*/
                        items[13].Value = p_svp.FormattedCaclulatedValue;
                    }

                    items[14].Value = string.Format("{0:F3}", _app.Technology.P0114.Value);
                    items[15].Value = string.Format("{0:F3}", _app.Technology.P0106.Value);

                    items[16].Value = string.Format("{0:F3}", _app.Technology.P0202.Value);

                    if (p_m_svp != null)
                    {
                        /*items[17].Color = Color.Black;
                         * if (p_m_svp.IsControlAlarm)
                         * {
                         *  if (p_m_svp.CalculatedValue >= p_m_svp.Alarm)
                         *  {
                         *      items[17].Color = Color.Yellow;
                         *  }
                         * }*/
                        items[17].Value = p_m_svp.FormattedCaclulatedValue;
                    }

                    if (p_kmb != null)
                    {
                        /*items[18].Color = Color.Black;
                         * if (p_kmb.IsControlAlarm)
                         * {
                         *  if (p_kmb.CalculatedValue >= p_kmb.Alarm)
                         *  {
                         *      items[18].Color = Color.Yellow;
                         *  }
                         * }*/
                        items[18].Value = p_kmb.FormattedCaclulatedValue;
                    }

                    panel.Redraw();
                }
            }
        }