以列和行格式显示实时数据 [英] Display real time data in Column and Row format

查看:72
本文介绍了以列和行格式显示实时数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个c#应用程序从套接字读取数据消息。每条消息都有X个数据字段。我想创建一个表单来在网格(列和行)中显示数据。我遇到过C#DataGridView和DataTable类。他们似乎做了这个工作。我很少关注并希望从社区中找到好的建议。



1)这是一个时间敏感的应用程序,数据消息相当快(每秒几百个) )。 DataGridView是否能够以这个速度执行?



2)我希望能够在视图中保持100行并且能够向后滚动以查看但我不会想要太多可能会减慢系统速度。如何做到这一点?

Hello,

I have a c# application that reads data messages from a socket. Each message has X number of data fields. I want to create a form to present the data in a grid (columns and rows). I've come across C# DataGridView and DataTable classes. They seems to do the job. Few concerns I have and hope to find good advices from the community.

1) This is a time responsive application, data message comes in fairly quick (few hundreds per second). Will DataGridView be able to perform at this rate?

2) I want to be able to keep say 100 rows in view and able to scroll back to see but I dont want too many it may slow the system down. How can this be done?

推荐答案

假设您想要构建SCADA或类似的东西。我没有看到你为什么要在网格中每秒显示100个样本的原因,它会像地狱一样变化。用户不会看到任何内容。并且无法处理他所看到的内容。你最好给他看一个趋势图。

在SCADA架构中,你应该考虑将数据收集器部分与可视化器分开。 DataGridView有一个VirtualMode参数,如果你想向后滚动,你可以拥有很多任何数据存储。 DataTable可能不是最佳选择,因为它具有相当大的开销,并且您不需要太多的功能。

我建议您将一个或多或少分离的过程中的数据收集到一个快速数据存储区中( sqlite可以是一个选项),并使用在其他进程中实现演示者。 VirtualMode [ ^ 。您仍然可以使用某些IPC向主持人通知收集的最新值(或过滤后的值),或者将其添加到图表中。



PS:如SA所述,这不是实时的。但是你给我的描述并不意味着实时,它更像是一个流媒体源阅读器。您还没有告诉该应用程序还有什么必须做,也没有说明数据到达的频率有多明确。
Let's suppose you want to build a SCADA or something like that. I don't see the reason why do you want do show 100 samples per second in a grid, it will change like hell. The user won't see anything. And won't be able to process what he sees. You better show him a trend graph.
In a SCADA architecture, you should consider dividing the data collector part from the visualizer. DataGridView has a VirtualMode parameter sou you can have much any data store behind if you want to scroll back. DataTable might not be the best option, since it has considerable overhead and you don't need much of it's features.
I suggest you collect the data in a more or less separated process into a quick datastore (sqlite can be an option), and you implement the presenter in an other process using VirtualMode[^]. You can still use some IPC to have the presenter notified about the most recent value collected (or a filtered value) to be presented in a label, or added to a chart.

PS: as SA states, this won't be real-time. But the description you gave me does not implies real-time, it is more a streaming source reader. You have not told what else this application has to do, neither how definite the frequency of data arrival is.


这篇关于以列和行格式显示实时数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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