I use the insim library for c# and i'm trying to make a panel with gauges.
But the rpm doesn increase. I tried with a while loop, but the same thing.
But the rpm doesn increase. I tried with a while loop, but the same thing.
private void button1_Click(object sender, EventArgs e)
{
/// Create timeout interval.
TimeSpan timeout = TimeSpan.FromSeconds(1);
// Create OutGauge object with the specified timeout.
using (OutGauge outgauge = new OutGauge(timeout))
{
// Attach event handler to packet-received event.
outgauge.PacketReceived += new EventHandler<OutGaugeEventArgs>(outgauge_PacketReceived);
outgauge.TimedOut += new EventHandler(outgauge_TimedOut);
// Start listening for packets from LFS.
outgauge.Connect("127.0.0.1", 30000);
}
}
static void outgauge_TimedOut(object sender, EventArgs e)
{
MessageBox.Show("OutGauge timed out!");
}
private void outgauge_PacketReceived(object sender, OutGaugeEventArgs e)
{
// Handle packet.
float FValue = e.RPM;
int FValue1 = Convert.ToInt16(FValue);
string final = Convert.ToString(FValue1);
if (FValue > 0)
{
while (true)
{
label1.Text = final;
}
}
}