简体   繁体   English

Delphi:实时运行时滚动

[英]Delphi: scrolling whilst running real time

I have implemented a Scroll box that dynamically adds TCharts dependent on the number of channels available on an input device. 我实现了一个滚动框,该滚动框根据输入设备上可用通道的数量动态添加TCharts。 The charts repaint on a loop to show the value of the voltage through the channel, so that the display outputs effectively a "real-time" view of the voltages being applied to each channel. 这些图表在回路上重新绘制,以显示通过通道的电压值,从而使显示屏有效地输出施加到每个通道的电压的“实时”视图。

Currently I have an Application.ProcessMessages function to prevent the application becoming unresponsive during a run, but I would like to be able to scroll through the box whilst the channels are being displayed, without disturbing the display, which currently pauses whilst the scroll bar is clicked. 目前,我有一个Application.ProcessMessages函数来防止应用程序在运行过程中变得无响应,但是我希望能够在显示通道的同时滚动浏览框,而不会干扰显示,当前该显示在滚动条处于暂停状态时会暂停点击。

Is this possible? 这可能吗?

Yes, this is possible. 是的,这是可能的。

The charts repaint on a loop ... 图表在循环上重绘...

Repaints driven by an own loop indeed ensures respiratory distres on the system, which exactly is the reason for the need of Application.ProcessMessages . 由自己的循环驱动的重绘确实确保了系统上的呼吸偏移,这正是需要Application.ProcessMessages的原因。 Try not to use it . 尽量不要使用它 Instead, you should just ask the charts to repaint themselves with Invalidate when new data comes in, and let the system decide when it is convenient to do so. 相反,您应该只要求图表在输入新数据时用Invalidate重新绘制自身,并让系统决定何时方便这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM