Jump to content
Software FX Community

quanone

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by quanone

  1.  

    Hi there,


     


    I have installed several gauges with Inner gauge in my program. I
    need to update the gauges periodically. The program I have is as below:


     


    // update gauges


      private void timer2_Tick_1(object sender, EventArgs e)


      {  


     


     
    radialGauge4.BeginInvoke((MethodInvoker)delegate


      {


     
    radialGauge4.MainValue = ReceiveSCSStatus.SCMDUCMtrspd_val;


     


      });


      radialGauge1.BeginInvoke((MethodInvoker)delegate


      {


     
    radialGauge1.MainValue = DynoRPM_val;


      });


      .


      .


      .


        }


     


    The problem for above code is: this
    periodic call slows down my program performance. So I tried to update
    the gauges only when there is a change of the main value. The new code is as below:


     


    // update gauges


      private void timer2_Tick_1(object sender, EventArgs e)


      {  


     


      if (ReceiveSCSStatus.SCMDUCMtrspd_val !=
    Last_SCMDUCMtrspd_val)


    {


     


     
    radialGauge4.BeginInvoke((MethodInvoker)delegate


      {


     
    radialGauge4.MainValue = ReceiveSCSStatus.SCMDUCMtrspd_val;


     


      });


      }


      if (DynoRPM_val !=
    Last_DynoRPM_val)


      {


     
    radialGauge1.BeginInvoke((MethodInvoker)delegate


      {


     
    radialGauge1.MainValue = DynoRPM_val;


      });


      }


      .


      .


      .


        }


     


    This way is theoretically correct. But when I run the program and change the
    main value, the Inner gauge display does not got changed automatically. Only when
    I break inside the loop, and run program again, then the new value comes out on the Inner gauge display . Do you know why this happens?


    Also, when I design the gauges, the '.MainValue' is defaulted to

×
×
  • Create New...