im having problem compiling with this code.. what is the problem of this code?
regardsCode:private void sensorwatch() { while (Thread.CurrentThread.IsAlive) { //Wait for sensor to be ready while (Inp(inportAddress) == sensor2); //Scan sensor activity while (Inp(inportAddress) != sensor2) { if (Inp(inportAddress) == sensor1) //BB has passed thru sensor1 QueryPerformanceCounter(ref time1); //record the time } QueryPerformanceCounter(ref time2); //BB has passed thru sensor 2 //Compute the Velocity elapsed = time2 - time1; ts = (1 / freq) * elapsed; FpsResult = System.Math.Round(1/(ts * (12/sensorGap)), 3); MpsResult = System.Math.Round(FpsResult / 3.333333,3); if (Thread.CurrentThread.IsAlive) { //Add list to Velocity log lstFireLog.Items.Add("Fire # " + fireCount.ToString() + " : " + Convert.ToString(Math.Round(ts * 1000,4)) + " millisec : " + MpsResult + " mps | " + FpsResult + " fps"); lstFireLog.SelectedIndex = lstFireLog.Items.Count - 1; lblFPSResult.Text = Convert.ToString(System.Math.Round(FpsResult, 0)); lblMPSResult.Text = Convert.ToString(System.Math.Round(MpsResult, 0)); //Compute the average FPS and MPS FPSArray.Add(FpsResult); MPSArray.Add(MpsResult); FPSSum = FPSSum + Convert.ToDouble(FPSArray[fireCount]); MPSSum = MPSSum + Convert.ToDouble(MPSArray[fireCount]); fpsAverage = Math.Round(FPSSum / FPSArray.Count,2); mpsAverage = Math.Round(MPSSum / MPSArray.Count,2); lblFPSAve.Text = fpsAverage.ToString(); lblMPSAve.Text = mpsAverage.ToString(); //increment fire count lblFireCount.Text = fireCount.ToString(); fireCount++; } } }





Reply With Quote