Visual Studio C# WinForms, a question for better performance.
Hello! I am making a rocket ground station application. There is a serial port connection which gives me rocket's data to display it on screen. I am displaying this variables properly but there is 2 designs in the screenshot at the bottom. Which shows rocket's degree with ground and speed of it. Serial port receiving data in every 100 miliseconds and my application rotating these pictures like a realistic gauge. But when data is coming too fast, variables are displaying wrong a lot because rotating these photos making my application a bit busy. What can I do for this? I don't know how to rotate them in an async way. I am using Guna2 NuGet package for design.
21 Replies
realistic as in it takes time for the needle to move?
as you see in the video, after finishing displaying gauges, application just getting fast
gauge showing the value directly there is no animation
like if 200m/s means 90 degree
app just rotation the image to 90 degree
to show it is 200m/s
Unfortunately WinForms isn't known for its performance
It's terrible if you want transparency and/or performance
this sounds like a throttling thing, you'd want to start skipping updates if the UI is falling behind
I would recommend WPF as it's significantly better regarding performance.
And yes, as Jimmacle mentioned. It definitely sounds like throttling
Possible to poll it instead?
So the UI reports when it needs an update, and not the other way around.
does wpf have lot of difference with winforms?
about coding designing and Packages
sorry for my untechnical english but what do you mean
Can you describe a bit more
yes
WPF is a xaml based ui framework
You should never use the designer
$rulesofwpf
I think I am a bit late to make my project in wpf lol
and also I don't have much idea about wpf so creating a spesific app like rocket management system might be a bad idea
WPF has been in development for a loong time, it is stable enough.
Winforms is ancient technology.
can you describe a bit more please
basically, make the UI ignore new data if it's still updating from the old data
so it doesn't slow down
yeah ofc but I don't know xml or other things about wpf so
I see
but that means it will be unsmoothed display with correct varibles
I have to choose in the end
Not many apps updates data that frequently
Can I make my app use more ram ?
No, this isnt Java.
.NET manages the RAM automatically, no need to dedicate X amount of RAM
I see
rotating picturebox with async method maybe?
would this work
I just need only a bit better performance
if the underlying operations aren't async, making the method async won't help
async is most useful with IO where the CPU doesn't have to do any work while waiting for the operation to complete
So there is no exit except increasing update interval
I think I should to learn wpf as soon as possible
I mean you saying wpf is one the best desktop app developing way right?
WPF is better than winforms for more complex apps