使用WinForms实现警报消息列表屏幕(如在SCADA中) [英] Implementing Alarm Message list Screen (like in SCADA) with WinForms

查看:91
本文介绍了使用WinForms实现警报消息列表屏幕(如在SCADA中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All:

Hello All:

我目前正在开发一个带有c#和winforms的项目,与Modbus TCP设备进行通信以收集和分析日期。其中一项功能是在接收到的数据超出范围时生成警报消息。警报屏幕应实现
,如图所示。报警消息应在生成时显示在屏幕上。消息应该闪烁。眨眼应该关闭一次"Ack"。按下按钮。 "清零"按钮应清除屏幕。

I am currently working on a project with c# and winforms to communicate with Modbus TCP devices to collect and analyze the date. One of the function is to generate the alarm messages if received data is out of range. An Alarm screen should be implemented as shown in the picture. Alarm messages should be displayed on the screen as they are generated. Messages should be blinking. The blinking should be off once "Ack" button is pressed. "Clear" button should clear the screen.

任何人都可以告诉我是否可以实现这样的东西,或者有更好的方法在WinForms中实现相同的目标。任何想法都会受到极大的赞赏。

Could anyone please let me know if it is possible to implement the something like this, or is there any better way to achieve the same in WinForms. Any ideas will be greatly apprecicated.

谢谢,

Shwetha。

推荐答案

Hi Shwegc,

Hi Shwegc,

< span class ="x_x_short_text"id ="x_x_result_box"lang ="en"style =""> 默认情况下,Winform没有这样的功能。作为替代方案,您可以使用一些控件(如图片框)进行模拟,请参阅以下演示:

        public Form3()
        {
            InitializeComponent();
            timer.Interval = 200;
            timer.Tick += Timer_Tick;            
        }

        Timer timer = new Timer();
        int num = 0;

        private void Timer_Tick(object sender, EventArgs e)
        {
            num++;
            if (num % 2 == 0)
            {
                pictureBox1.BackColor = Color.Red;
            }
            else
                pictureBox1.BackColor = Color.Transparent;
        }

        //stop
        private void button1_Click(object sender, EventArgs e)
        {
            timer.Stop();
        }

        //clear
        private void button2_Click(object sender, EventArgs e)
        {
            this.Controls.Clear();
        }

        //start the timer, you can start the timer when the data is out of range in your project
        private void button3_Click(object sender, EventArgs e)
        {
            timer.Start();
        }

问候,

Frankie


这篇关于使用WinForms实现警报消息列表屏幕(如在SCADA中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆