code-artist / agauge Goto Github PK
View Code? Open in Web Editor NEWC# Gauge Control
License: MIT License
C# Gauge Control
License: MIT License
Inside the Dispose method the following line could crash:
this.gaugeBitmap.Dispose();
This could happens if the control is instantiated but never shown. The gaugeBitmap is instantiated only inside the OnPaint method.
Greetings,
Thank you for merging my last PR; I'm glad you're still willing to accept contributions to keep this project going. I've been making some changes here and there in my fork, but my ultimate goal is to fix a bug where the gauge major tick marks sometimes are drawn past the end of the gauge.
I'd like to take you up on your offer to make an official release as I'd also like to switch WinNUT back to using AGauge as a nuget dependency, with a modified gauge class. Do you have an original .nuspec file, or are you fine with me generating one for upload to NuGet?
I have two of these gauges on a form updating every 100ms with new values. Every time the gauge value is updated the memory usage is increasing. I noticed the memory will reach about 210MB before a garbage collection occurs.
In comparison I replaced the AGauage with a DevExpress gauge and did not experience the issue. Memory usage stayed steady at 20MB with no garbage collections occurring.
Below is a copy of the code on the main (and only form) in the program. (NOTE: This is currently the code for the devexpress gauges but it was very identical for the Aguage. I used gauge labels to display the degree and velocity.)
namespace TSDemoGUI
{
public partial class Form1 : Form
{
private int selectedDevice;
private double angle;
private double ChannelOneVelocity;
private double ChannelOneVelocityRPM;
private double ChannelOneVelocityRPS;
private Random value;
public Form1()
{
InitializeComponent();
// Set Up Synchro Device
selectedDevice = 0;
//SRTestSystemDevice.InitDevice(selectedDevice);
//SRTestSystemDevice.SetUpDevice(selectedDevice);
value = new Random();
timerUpdateAngles.Enabled = true;
}
private void timerUpdateAngles_Tick(object sender, EventArgs e)
{
// Angle
angle = value.Next(0, 359);
arcScaleComponent2.Value = Convert.ToUInt32(angle);
labelComponent3.Text = angle.ToString("000.000");
// Velocity
ChannelOneVelocityRPS = value.NextDouble() * 15;
arcScaleComponent3.Value = Convert.ToSingle(ChannelOneVelocityRPS);
labelComponent6.Text = ChannelOneVelocityRPS.ToString("+00.00;-00.00; 00.00");
}
private void buttonExit_Click(object sender, EventArgs e)
{
Close();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
timerUpdateAngles.Enabled = false;
}
}
}
Hello
Thanks for your great package.
It is working well but when I change my Region Format in control panel to Persian, I counter this error:
System.InvalidOperationException
HResult=0x80131509
Message=Failed to initialize because CategoryName is missing.
Source=System
StackTrace:
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter.EndInit()
at WindowsFormsApp1.Form1.InitializeComponent() in C:\Users\user\source\repos\WindowsFormsApp1\WindowsFormsApp1\Form1.Designer.cs:line 141
at WindowsFormsApp1.Form1..ctor() in C:\Users\user\source\repos\WindowsFormsApp1\WindowsFormsApp1\Form1.cs:line 17
at WindowsFormsApp1.Program.Main() in C:\Users\user\source\repos\WindowsFormsApp1\WindowsFormsApp1\Program.cs:line 18
Would you take a lock at it?
Best Regards
I have set the needle type to advance, but it shows as simple on other boxes. Is this a known problem?
A better way to align gauge labels would be appreciated. Often I want to center the text and only adjust Y position up and down.
Perhaps a property on gauge labels which returns the Size of the drawn text. With this information one could calculate where to place the text using the size of the control and the size of the text.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.